Commit Graph
33 Commits
Author SHA1 Message Date
Amaury Martiny 51751d0781 Add support for default values (#484)
* Create AbstractInt

* Use abstract class

* Bump packages

* Allow decoding metadata with default values

* Add console.logs

* Add latest rpc

* Add Bytes decode

* Get encoded lenght right

* Remove useless tests

* Add getter

* Metadata json with default as hex

* FIx bugs

* Fix lint

* EOF add line

* Remove file

* Update latest rpc

* Update static.ts

* Typo

* Don't create types for default values for now, leave as Bytes

* Update & skip tests

* Remove unused file
2018-12-20 20:33:32 +01:00
Jaco Greeff 919a73ccf6 Allow new Extrinsic(method: Method) (#499)
* Allow new Extrinsic(method: Method)

* Update types

* Be explicit in returned types

* Submittable with Method constructor
2018-12-20 12:21:03 +01:00
Jaco Greeff caff93941b Method -> Extrinsic circular dep (#495)
* Method -> Extrinsic circular dep

* Cleanup test formatting
2018-12-19 14:43:30 +01:00
Jaco Greeff 3e7e1c653b Additional Codeclimate cleanups (#452)
* Additional Codeclimate cleanups

* Keep original Vector.with

* Cleanup subtype extraction

* Cleanup fromMeta

* Cleanup createType tests
2018-12-09 10:54:43 +01:00
Jaco Greeff 448a729d70 Fix some Codeclimate smells (#450)
* Fix some Codeclimate smells

* Cleanup Metadata complexity

* Cleanup uniqueTypes

* Bump deps
2018-12-08 15:31:54 +01:00
Jaco Greeff d0ff8937a4 Use compact* from util for encoding (#409)
* Use compact* from util for encoding

* Remove @polkadot/extrinsics from types imports

* Cleanup manual length concat

* Add missing @polkadot/types dependencies
2018-11-21 17:21:44 +01:00
Jaco Greeff 4805f9cb36 Update LICENSE and README (#408)
* Update LICENSE and README

* Bump
2018-11-21 13:37:27 +01:00
Jaco Greeff d5bca161b5 Allow index calc as fallback (#391) 2018-11-10 11:56:43 +01:00
Jaco Greeff 4997d8fb06 Event definitions (#350)
* Event definitions

* Compact things a bit

* Cleanup AccountIndex decoding, align Address

* Remove stand-alone MethodIndex (declutter)

* Inject metadata into Event from api

* Update API TODOs to reflect current state

* Update & expand comments

* EventData only takes Uint8Array inputs (via EventRecord)

* Remove duplicated toHex

* Add FIXME with link to base issue
2018-10-26 14:24:38 +02:00
Jaco Greeff 9f570cbbe9 Make Extrinsic compatible with Method (#335)
* Make Extrinsic compatible with Method

* Remove Method -> methodIndex, only use callIndex
2018-10-22 12:10:39 +02:00
Jaco Greeff 55ac4626d5 Cleanup imports from @polkadot/util (#315)
* Cleanup imports from @polkadot/util

* Example imports

* Alphabetic imports
2018-10-18 13:30:04 +02:00
Amaury Martiny 471bfce769 Rewrite Method (#308)
* Let Method extend Struct

* Fix Method

* Allow to pass array into Struct constructor

* Formatting

* Fix tests

* Add explicit function return type
2018-10-17 10:46:12 +02:00
Amaury Martiny 106c59d341 Don't use fromJSON/fromU8a anywhere in code (#298)
* Don't use fromJSON/u8a anywhere

* Remove useless cast

* Nicer formatting
2018-10-16 12:35:40 +02:00
Jaco Greeff 9644daf5eb Fix decoding with eras (#293)
* Fix decoding with eras

* Typo
2018-10-15 11:48:14 +02:00
Jaco Greeff 2b5169c232 Bump @polkadot/keyring, change package name (#272) 2018-10-12 17:33:29 +02:00
Jaco Greeff 27b2885722 Extend ApiRx from abstract Base (prepare for promise) (#243)
* Extend ApiRx from abstract Base (prepare for promise)

* Update Metadata parsing

* Update Base.ts

* Update types.d.ts

* Cleanup base

* Cleanup linting (renamed imports)

* PR comments

* Update decoded Metadata.json
2018-10-11 10:20:54 +02:00
Luke Schoen 267411d778 fix: Fixes #235 TypeDoc updates consistent with renaming (#236)
* fix: Remove docs/api since replaced with docs/rpc-core

* fix: Remove docs/api-provider since replaced with docs/rpc-provider

* fix: Remove docs/api-rx since replaced with docs/rpc-rx

* fix: Remove the guide file that serves no purpose

* fix: Change license from ui-observable to api-observable

* fix: Remove disused mockHttp and mockWs that are duplicates of those in rpc-provider

* fix: Clarifies difference between PropIndex and ProposalIndex from Issue #226

* fix: Update api-observable Readme to refer to rpc-core, previously called api

* misc: Update Readme of rpc-core. See commit message details.

* Update name to be @polkadot/rpc-core instead of @polkadot/api

* Use Yarn instead of NPM for instructions adding dependencies

* Refer to @polkadot/rpc-core as `Rpc`

* Highlight that given block header hash should be a 0x-prefixed hex string with length of 64 (not only length of 10 as shown in the example)

* Showcase more information that you can obtain from the header object (i.e. best block number, parentHash, stateRoot, extrinsicsRoot, and digest)

* Use `header.raw` instead of just `header` to access properties of the header object

* Update the example to console.log the subscription ID

* Add missing semicolon

* fix: Fix name in license header and rename Api to Rpc for rpc-core e2e tests

* fix: Update rpc-provider Readme to use Yarn instead of NPM install

* fix: Fix minor typo

* fix: Rename Api to Rpc for rpc-provider ws

* fix: Refer to rpc-core instead of api in the rpc-rx Readme

* fix: Update rpc-rx files to refer to it as RpcRx instead of RxApi or just Api

* fix: Refer to rpc-core as Rpc instead of Api

* fix: Update type-jsonrpc Readme. Fix typo. Use Yarn not NPM. Refer to TSLint not Flow

* refactor: Move non-type dependency import with non-type dependencies

* docs: Add link to parity-codec repo

* fix: Avoid use of .raw. Fix listen to blocks example

* fix: Add missing error to newHead in listen to blocks example
2018-10-10 20:11:22 +02:00
Jaco Greeff 5b5caa1e80 Raw decoding for extrinsics (#214) 2018-10-05 15:44:30 +02:00
Jaco Greeff 82dbc93f79 Mortal -> Extrinsic, expand for decoding start (#212)
* Mortal -> Extrinsic, expand for decoding start

* Method, Section -> Rpc{Method, Section}

* Only expose callIndex

* CallIndex -> MethodIndex in spec
2018-10-05 12:29:06 +02:00
Jaco Greeff 427c38ee21 Expose callIndex on extrinsics (lookups) (#206)
* Expose callId on extrinsics (lookups)

* Expose call meta

* s/callId/callIndex/
2018-10-05 09:21:14 +02:00
Jaco Greeff 02aba14e7e Expose whenReady and extrinsics/storage (#199)
* Expose whenReady and extrinsics/storage

* Load genesisHash, expose

* Fix import

* whenReady -> Observable<boolean>

* Check isConnected before making call

* Fix import order
2018-10-04 11:16:45 +02:00
Jaco Greeff cce329b19a UncheckedEncoding (#192)
* Re add type-extrinsics

* Add descriptor

* Add uncheked mortal extrinsic

* Add e2e test

* Add versionInfo and signatureInfo

* Skip e2e test

* Small updates

* Additions for era & extra types

* Move types to types, fixup tests

* Small test updates

* Update test for full decoding
2018-10-04 08:37:32 +02:00
Jaco Greeff a4572e42c2 Update tests 2018-10-04 08:21:12 +02:00
Jaco Greeff 48e57f9a55 Rename api-codec -> types (#183)
* Rename api-codec -> types

* Cleanups with exports (as found with use)

* Docs to build for /types
2018-10-02 11:30:45 +02:00
Jaco Greeff 2f60ba0e1c Add method name & prefix to StorageFunction (#182)
* Add methods & prefix to StorageFunction

* Match method/section to exposed names

* Export method/section on extrinsic & jsonrpc

* PR comment prefix -> section
2018-10-02 11:10:17 +02:00
Amaury Martiny 8840f33d20 Rewrite type-extrinsics (#173)
* Cleanup jsonrpc, refer to api-codec

* Remove misplaced debug log

* Add metadat array (hack around json import)

* Move json metadata to ts

* Rewrite type-extrinsics

* Make tests pass in type-params

* Skip failing tests in type-primitives

* Use legacy type for legacy stuff

* Remove useless comments

* Remove type params (finally)

* Remove type-primitives (!)

* Remove legacy stuff

* Remove useless import

* Remove useless file

* Update header

* Remove useless files

* Fix test

* Typo

* Export default

* Fix test

* Add index counting

* Fix test index counting

* toNumber() on id

* Fix bug u8a
2018-10-01 10:43:05 +02:00
Jaco Greeff eb0356b6eb Cleanup extrinsic encoding (#150)
* Cleanup extrinsic encoding

* Removed now-defunct type

* Add uncheckedLength encoding
2018-09-12 12:14:50 +02:00
Jaco Greeff 99628f2dbd Allow extrinsic length encoding to operate on u8a[] (#148) 2018-09-12 10:25:31 +02:00
Jaco Greeff 0b61aded8f Missing staking methods (slashing, propsal missed, setBalance) (#143) 2018-09-04 09:57:24 +02:00
Jaco Greeff 6bc06ad38f Add session.noteOffline extrinsic (#140)
* Add session.noteOffline extrinsic

* Remove extra debug logging
2018-08-22 10:04:22 +02:00
Jaco Greeff a369c8804a Add chain_getBlock & author_pendingExtrinsics (#132)
* Add chain_getBlock & author_pendingExtrinsics

* Remove sample

* TSLint
2018-08-15 15:34:16 +02:00
Jaco Greeff 187c66f600 Add storage subscription API endpoints (#126)
* Add storage subscriptions

* StorageResult formatting

* Decoding WIP

* Storage subsciptions in place

* Allow null decodes, ref https://github.com/polkadot-js/apps/issues/215

* e2e tests for subscribeStorage

* Cache subscription results, return with changeset
2018-08-11 20:50:57 +02:00
Jaco Greeff ad968ec794 Import type-* from common repo (#125)
* Import type-* from common repo

* Update links

* Fix lint links (package index)
2018-08-11 11:14:20 +02:00