Commit Graph
203 Commits
Author SHA1 Message Date
Jaco Greeff bf1a4a9e08 Ovreride toJSON on {Header, ReferendumInfo}Extended (#723) 2019-02-20 07:33:53 +01:00
Jaco Greeff 447ab2fde0 Option construction & ReferendumInfoExtended (#720)
* Option construction & ReferendumInfoExtended

* Simplify, optional index
2019-02-19 17:46:22 +01:00
Jaco Greeff f820dfcffa Inject index properly into ReferendumInfo (with unwrap) (#718)
* Inject inject properly into ReferendumInfo (with unwrap)

* Use unwrapOr

* Fix type import
2019-02-19 15:20:45 +01:00
Jaco Greeff f807a93e87 Handle storage with optional modifiers (#717)
* Handle storage with optional modifiers

* Storage docs indicate Option

* Cleanup Option logic

* Convert Optional derive to use Option

* Bump version, update changelog

* Update CHANGELOG description

* Enum.spec.js -> Enum.spec.ts

* Add isEmpty to primitive types
2019-02-19 13:47:36 +01:00
Jaco Greeff cf5ca51f7f Split types into primitive (base) & type (derived) (#715)
* Split types into primitves & structs

* Bump version (breaking change)
2019-02-19 09:40:14 +01:00
Jaco Greeff b846152f11 ChainProperties tokenSymbol returns string (#713)
* ChainProperties tokenSymbol returns string

* Bump deps

* 0.43.14
2019-02-18 12:13:23 +01:00
Jaco Greeff 29c83a09a9 Build docs from latest (#710) 2019-02-17 11:03:10 +01:00
Jaco Greeff 5a0d692842 typo, actual sectionName 2019-02-17 08:52:27 +01:00
Jaco Greeff 40a1ec9ffa Cleanup md rendering, remove empty sections (#709)
* Cleanup md rendering, remove empty sections

* Remov extra files
2019-02-17 08:40:25 +01:00
Jaco Greeff 9a56f1b5ec Update metadata to latest (#708) 2019-02-17 07:53:28 +01:00
Jaco Greeff c4ba8ca64d Add ts-check for examples (#705)
* Add ts-check for examples

* Typing cleanups, now shows properly

* Bump

* Cleanup checks

* Bump keyring
2019-02-16 12:25:53 +01:00
Jaco Greeff 4735253cbd Bump deps (#702)
* Bump deps

* Update keyring
2019-02-15 17:38:49 +01:00
Jaco Greeff 15b22dab1c Allow indexOf to work with Codec eq (#699)
* Allow indexOf to work with Codec eq

* Convert to type before check

* Swap compare (in case of empty/invalid values)
2019-02-15 10:52:00 +01:00
Jaco Greeff ead67ec9d6 Integrate new keyring (#693)
* Integrate new keyring

* Bump

* Bump version

* ed25519 dusl-support
2019-02-14 23:17:02 +01:00
Jaco Greeff b88b6646af Additional export cleanups (root & types) (#694) 2019-02-13 21:12:49 +01:00
Jaco Greeff f95763906e Add codec exports to types index (#689)
* Add codec exports to types index

* Use actual index exports (internally)

* Merge {AccountId, Balance, Moment}Of into parent classes
2019-02-13 16:00:59 +01:00
Jaco Greeff b754ea6ffb Expose #687 on index (#688) 2019-02-13 10:02:49 +01:00
Jaco Greeff 0ef15dc547 Add {AccountId, Balance, Moment, Seed}Of (#687) 2019-02-12 17:40:40 +01:00
Jaco Greeff acc318761e Fix encodedLength for non-ascii strings (#684) 2019-02-12 11:28:52 +01:00
Jaco Greeff dbd37da72f Allow enum definitions via JSON (#681)
* Allow enum definitions via JSON

* Return only type of type & value via toString()

* Remove displaced console.error

* Fix toString tests
2019-02-11 15:46:10 +01:00
Jaco Greeff 96624a6d66 Allow boolean decoding for Vote constructor (#677) 2019-02-11 12:52:15 +01:00
Jaco Greeff 6d759cd234 Add api.registerTypes (#670) 2019-02-09 08:02:47 +02:00
Jaco Greeff c1a6f0230c Cater for signature over hash (with version checks) (#655)
* Cater for signature over hash (with version checks)

* Allow Submittable signAndSend

* isUndefined for nonce check

* .sign with backwards compat

* e2e tests started

* Work around optional callback for Promise

* Commit actual e2e test

* Promise allows for submitExtrinsic

* e2e tests are passing

* Bump version, update CHANGELOG
2019-01-31 18:01:14 +01:00
Jaco Greeff 661cb3c453 Codec types (call definitions in API) (#650)
* Codec types (call definitions)

* Pass Codec & Subscription generic types

* WIP typing

* Typing seems ok

* Linting

* Queryable storage retuns Hash & U64 for .hash and .size

* Better typing for SubmittableExtrinsic

* Indentation.

* Update with needsCallback

* Update SubmittableExtrinsic.ts
2019-01-31 14:15:59 +01:00
Jaco Greeff aea223f024 Updates for V1 formatting changes (#651)
* Updates for V1 formatting changes

* Rework V1 with the new simplified structures

* Parsing parses

* asV0 in-place, rework class splits

* e2e testing completed

* Update args, docs & fallback (shorter, non-collision naming)

* More v0-like event output
2019-01-30 15:41:49 +01:00
Jaco Greeff 82531493da Option unwrapOr helper (#652)
* Option unwrapOrNull helper

* unwrapOrNull -> unwrapOr
2019-01-30 15:40:59 +01:00
Jaco Greeff 383573658b Auto-convert large numbers to hex, smaller as number (#647)
* Auto-convert large numbers to hex, smaller as number

* Update tests
2019-01-29 17:09:54 +01:00
Jaco Greeff ebcb7954cc EnumType toJSON to include type & value (#645)
* EnumType toJSON to include type & value

* Update metadata for new EnumType formatting

* PlainType & MapType
2019-01-28 18:01:25 +01:00
Jaco Greeff b34277aeca Filter events based on order and actual number of events (#644) 2019-01-28 16:50:57 +01:00
Jaco Greeff e798df949b Ensure large >U32 is encoded as hex (#641)
* Ensure large >U32 is enocoded as hex

* Update U64 test compares to hex

* Update subscribe.spec.ts
2019-01-28 13:11:44 +01:00
Jaco Greeff 5898caa71e Compact unwrap (returns raw UInt/Moment) (#636) 2019-01-28 12:14:27 +01:00
Jaco Greeff 3ced943f36 derive.chain.* allows for non-available session (#638)
* derive.chain.* allows for non-available session

* Cleanup typing

* Slightly more robust validators init
2019-01-26 16:45:11 +01:00
Jaco Greeff fd93fbc4a6 Support new versioned metadata format (#632)
* Start something...

* Parsing via proxy (everything still all-ok)

* Imp[ort order (minor)

* WIP expanding the structure

* Adjust V1 structure

* Parsing seems to do the trick...

* Add CodeHash and Schedule types

* //v0/ -> /v0/

* Update Extrinsic.ts

* Updated with compact outerDispatch, non-throw construction

* v1 to V0 conversion

* Bubble non-magic errors in constructor

* Update e2e after testing them

* Bump version with CHANGELOG  (potentially breaking change)
2019-01-26 16:27:00 +01:00
Jaco Greeff 25c18bb399 Pull in latest contract types (#634) 2019-01-24 18:09:09 +01:00
Jaco Greeff 10bdaf518a Check actual valueOf in bool for yes/no (#633)
* Check actual valueOf in bool for yes/no

* Add test for false encoding
2019-01-24 14:38:20 +01:00
Jaco Greeff 843f374ca7 Misc small cleanups (#625)
* Misc small cleanups

* Bump deps
2019-01-23 22:10:38 +01:00
Jaco Greeff 52718d76f7 Add .eq to Codec (#622)
* Add .eq to Codec

* Tests for Codec .eq

* Extra ()'s around checks

* Update AbstractInt.ts

* Use .size in Map compare

* Equivalency comment

* Update Compact.eq to user wrapper eq
2019-01-23 13:29:03 +01:00
Jaco Greeff a1c64be28c ValidatorPref threshold -> Compact<u32> (#613) 2019-01-21 13:38:26 +01:00
Jaco Greeff cfd71db468 Allow EnumType to decode isHex (#611)
* Allow EnumType to decode isHex

* Consistently use string (not String/string mix)
2019-01-21 10:30:04 +01:00
Jaco Greeff 15721c16a6 Make U8aFixed always return the correct length (#605)
* Make U8aFixed always return the correct length

* compact isEmpty check

* Revert unsigned-as-long-string

* Skip extra object allocation

* Shortcut version encoding

* Move isEmpty to U8a (base)

* Slightly more optimal set (only when needed)
2019-01-21 10:29:32 +01:00
Jaco Greeff 0d29925406 ValidatorPrefs has Compact<Balance> (#604) 2019-01-21 10:29:09 +01:00
Xiliang Chen 97c6eca01f fix peerId mapping (#608) 2019-01-21 00:37:10 +01:00
Jaco Greeff db832f0207 Add derive.chain.{getHeader,subscribeNewHead} with author (#602)
* Add derive.chain.{getHeader,subscribeNewHead} with author

* tslint cast, ignore
2019-01-18 14:44:55 +01:00
Jaco Greeff a3e421f665 Allow for balance/indices lookups (#596)
* Allow for balance/indices lookups

* Latest metadata

* Indices work

* Update json with actual decoded

* Update Type.ts

* Some tests updated

* Update final tests

* Remove .only from derive e2e (really skip it)
2019-01-17 15:11:50 +01:00
Jaco Greeff 695e4f2cad AccountId toString() with isEmpty (#592)
* AccountId toString() with isEmpty

* isEmpty is real isEmpty check
2019-01-16 10:05:46 +01:00
Jaco Greeff 0576375a2b Add isEmpty to AccountId (#583) 2019-01-14 14:42:51 +01:00
Xiliang Chen 9a4973237e Fix Compact decode hex value (#582)
* decode header is broken

* Ignore length for Compact isHex check
2019-01-14 07:49:59 +01:00
Jaco Greeff 8f698d7964 As gettters, as{ContainedType} to EnumType (convenience) (#579)
* As as{ContainedType} to EnumType (convenience)

* Use as inside phase filter

* asFinalised in SubmittableExtrinsic

* Cleanup imports (lint)

* Cleanup imports (linting)
2019-01-12 16:05:21 +01:00
Jaco Greeff 1f401d6791 Add system_peers RPC endpoint (#577)
* Add system_peers RPC endpoint

* Don't double-up on error logs
2019-01-12 09:22:27 +01:00
Jaco Greeff a2f176dca7 Construct Bytes via Array<number> (no prefix) (#573)
* Construct Bytes via Array<number> (no prefix)

* Remove unused imports

* Allow extrinsics with/without prefix
2019-01-11 16:59:34 +01:00