Compare commits

..
92 Commits
Author SHA1 Message Date
Github Actions f428a58006 [CI Skip] release/stable 1.21.1
skip-checks: true
2020-06-23 16:12:18 +00:00
Jaco Greeff fcce2ab340 1.21 (#2384)
* 1.21

* CHANGELOG

* Babe EquivocationProof

* Update CHANGELOG.md
2020-06-23 18:01:47 +02:00
Jaco Greeff 877eb11717 Swap releases type to shared enum (#2388)
* Swap releases type to u8

* Shared enum for releases

* Update metadata for new names
2020-06-23 17:40:15 +02:00
Jaco Greeff 4b55f1be93 Babe Equivocation (#2374)
* Babe Equivocation

* metadata field rename to GrandpaEquivocationProof
2020-06-23 16:46:26 +02:00
Github Actions f2a677634e [CI Skip] release/beta 1.21.0-beta.4
skip-checks: true
2020-06-23 13:18:12 +00:00
Jaco Greeff eea4c8775e Use setImmediate for unsubscribe (allow outer resolve) (#2385) 2020-06-23 15:06:08 +02:00
Github Actions 792bf0ec36 [CI Skip] release/beta 1.21.0-beta.3
skip-checks: true
2020-06-23 12:20:27 +00:00
Jaco Greeff e3d13107a9 Add support for CheckMortality extension (#2383) 2020-06-23 14:08:40 +02:00
Jaco Greeff e5c2c6a228 Use BN in-place operators as appropriate (#2381)
* Use BN in-place operators as appropriate

* CHANGELOG
2020-06-23 14:02:54 +02:00
Github Actions d2be79132c [CI Skip] release/beta 1.21.0-beta.2
skip-checks: true
2020-06-23 11:59:30 +00:00
Jaco Greeff 76da2638c1 Ensure subscriptions always unsubscribe as required (#2380)
* Ensure single-shot calls always unsubscribe

* memo/refCount cleanups

* Fix unsubscriptions

* Cleanup linting types

* CHANGELOG
2020-06-23 13:47:28 +02:00
Github Actions daf3912920 [CI Skip] release/beta 1.21.0-beta.1
skip-checks: true
2020-06-23 09:17:57 +00:00
Jaco Greeff 6dfebbb9fe Fixup subscriptions for promise (w/ callback) (#2379)
* Fixup subscriptions for promise (w/ callback)

* Update packages/api/src/base/Decorate.ts
2020-06-23 11:05:51 +02:00
Github Actions e55c5f77f7 [CI Skip] release/beta 1.21.0-beta.0
skip-checks: true
2020-06-23 07:41:54 +00:00
Jaco Greeff c7315ffb74 Do not use subscriptions on single subs (#2378)
* Do not use subscriptions on single subs

* Apply suggestions from code review
2020-06-23 09:29:49 +02:00
Github Actions 84eb806f07 [CI Skip] release/stable 1.20.1
skip-checks: true
2020-06-22 14:20:44 +00:00
Jaco Greeff 2493442a2e 1.20 (#2377)
* 1.20

* Indicate @polkadot/util bump
2020-06-22 16:08:22 +02:00
Github Actions 77df7907c7 [CI Skip] release/beta 1.20.0-beta.9
skip-checks: true
2020-06-22 13:42:01 +00:00
Jaco Greeff f1b6268784 Bump metadata (#2376) 2020-06-22 15:31:27 +02:00
Github Actions 9aa9380251 [CI Skip] release/beta 1.20.0-beta.8
skip-checks: true
2020-06-22 08:22:33 +00:00
Jaco Greeff b4306cb60a Bump metadata (#2373) 2020-06-22 10:12:01 +02:00
Github Actions 1e83daf797 [CI Skip] release/beta 1.20.0-beta.7
skip-checks: true
2020-06-21 11:26:27 +00:00
Jaco Greeff d46d32d9bc Optimize query/queryMulti retrievals (#2371)
* Optimize query/queryMulti retrievals

* Current retrieval on a batch basis

* Dedup staking.account/accounts internally
2020-06-21 13:13:38 +02:00
Github Actions 032a0a595c [CI Skip] release/beta 1.20.0-beta.6
skip-checks: true
2020-06-21 08:09:28 +00:00
Jaco Greeff 34101ec12b Adjust with queryMulti as applicable (#2370) 2020-06-21 09:56:02 +02:00
Github Actions 4e02b982d3 [CI Skip] release/beta 1.20.0-beta.5
skip-checks: true
2020-06-20 18:12:10 +00:00
Jaco Greeff 5b96d52fa6 Adjust for zero-length combines (#2369) 2020-06-20 20:00:01 +02:00
Github Actions 735f2b835e [CI Skip] release/beta 1.20.0-beta.4
skip-checks: true
2020-06-20 13:42:40 +00:00
Jaco Greeff 646e64c286 Add derive.staking.waitingInfo (#2367)
* Add derive.staking.waitingInfo

* Small optimizations

* Updated
2020-06-20 15:30:48 +02:00
Github Actions fc9060caa8 [CI Skip] release/beta 1.20.0-beta.3
skip-checks: true
2020-06-19 12:04:34 +00:00
Jaco Greeff 503c2b3c63 Add transactionPayment release type (#2366) 2020-06-19 13:51:40 +02:00
Github Actions 168abc130f [CI Skip] release/beta 1.20.0-beta.2
skip-checks: true
2020-06-18 08:28:13 +00:00
Jaco Greeff 5c5db2709b Add system_dryRun RPCs (#2363)
* Add system_dryRun RPCs

* CHANGELOG
2020-06-18 10:15:41 +02:00
Github Actions 5a4ff5420f [CI Skip] release/beta 1.20.0-beta.1
skip-checks: true
2020-06-18 08:04:22 +00:00
Jaco Greeff a1655508ba Cleanups in API typing (& overrides) (#2362)
* Cleanups in API typing (& overrides)

* Less magic "as" overrides
2020-06-18 09:52:39 +02:00
Github Actions 64827a6114 [CI Skip] release/beta 1.20.0-beta.0
skip-checks: true
2020-06-17 22:18:49 +00:00
Jaco Greeff 2eb09374bc Map entries/keys cleanups (#2360) 2020-06-18 00:06:19 +02:00
Github Actions ddf67d5564 [CI Skip] release/stable 1.19.1
skip-checks: true
2020-06-16 06:47:45 +00:00
Jaco Greeff ad6b8280a2 1.19 (#2354)
* Bump deps

* 1.19

* Update CHANGELOG.md

* Freshen Substrate metadata
2020-06-16 08:34:19 +02:00
Github Actions 682c6b6fb2 [CI Skip] release/beta 1.19.0-beta.3
skip-checks: true
2020-06-12 21:28:49 +00:00
Jaco Greeff 6a281211b4 Bump metadata, allow type alias on events (#2351)
* Bump metadata, allow type alias on events

* Update packages/api/src/submittable/createClass.ts

* Update packages/metadata/src/Metadata/v11/static-substrate.json

* Fresh, no config changes
2020-06-12 23:15:50 +02:00
Github Actions 6ef94b3c3b [CI Skip] release/beta 1.19.0-beta.2
skip-checks: true
2020-06-12 16:31:41 +00:00
Jeremías Díaz e900d1d657 impovement: better typing of entries related funcs (#2346)
* impovement: better typing of entries related funcs

* refactor: remove duplicate definition
2020-06-12 18:19:55 +02:00
Github Actions 7f1a3fa636 [CI Skip] release/beta 1.19.0-beta.1
skip-checks: true
2020-06-11 07:00:42 +00:00
Jaco Greeff 21802664b8 Metadata bump (#2348) 2020-06-11 08:48:52 +02:00
Github Actions 1492df11a7 [CI Skip] release/beta 1.19.0-beta.0
skip-checks: true
2020-06-10 11:13:46 +00:00
Jaco Greeff 00fed90da2 Update parachain types (#2344) 2020-06-10 13:00:10 +02:00
Github Actions e6beb6554d [CI Skip] release/stable 1.18.1
skip-checks: true
2020-06-08 15:53:39 +00:00
Jaco Greeff 099cf5a351 1.18 (#2340)
* 1.18

* Polkadot ProxyType
2020-06-08 17:39:12 +02:00
Github Actions 55e762a348 [CI Skip] release/beta 1.18.0-beta.10
skip-checks: true
2020-06-08 13:43:22 +00:00
Jaco Greeff 0ad146c607 Adjust ProxyType for Westend (#2339) 2020-06-08 15:30:51 +02:00
Github Actions 4e7f3f5268 [CI Skip] release/beta 1.18.0-beta.9
skip-checks: true
2020-06-08 08:02:24 +00:00
Jeremías DíazandJaco Greeff 6a9e3d80f1 feat: add external pagination support (#2325)
* feat: add external pagination support

* Ordering, no functionality changes

* fix: use correct assertion condition

Also moved the PaginationOptions type to the base types file

* Apply suggestions from code review

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2020-06-08 09:49:53 +02:00
Github Actions dee98fae55 [CI Skip] release/beta 1.18.0-beta.8
skip-checks: true
2020-06-08 05:59:44 +00:00
Xiliang Chen ff52876920 allow Option in enum & Result type (#2336) 2020-06-08 07:45:22 +02:00
Github Actions 4d01a09c54 [CI Skip] release/beta 1.18.0-beta.7
skip-checks: true
2020-06-07 17:27:50 +00:00
Jaco Greeff 7310ea825e Allow for string subids (#2335) 2020-06-07 19:16:16 +02:00
Github Actions 15b80a47c3 [CI Skip] release/beta 1.18.0-beta.6
skip-checks: true
2020-06-07 13:02:15 +00:00
Jaco Greeff 622682b4ef npos-election ElectionScore type (#2334) 2020-06-07 14:50:25 +02:00
Github Actions 56415df4ab [CI Skip] release/beta 1.18.0-beta.5
skip-checks: true
2020-06-06 06:53:17 +00:00
Jaco Greeff 8bea5e5a3b Align Call section/method field names (#2332) 2020-06-06 08:40:41 +02:00
Github Actions d6372ade44 [CI Skip] release/beta 1.18.0-beta.4
skip-checks: true
2020-06-05 20:32:29 +00:00
Jaco Greeff f501994df8 Bump deps (#2333) 2020-06-05 22:20:32 +02:00
Github Actions b787a7d5a0 [CI Skip] release/beta 1.18.0-beta.3
skip-checks: true
2020-06-03 20:20:42 +00:00
Gerben van de Wiel 11d162a10d Adding some extra notes on changes in the specname (#2329) 2020-06-03 22:08:06 +02:00
Github Actions e2564dea17 [CI Skip] release/beta 1.18.0-beta.2
skip-checks: true
2020-06-03 13:40:22 +00:00
Jaco Greeff 2b9152871e Add ProxyType (#2327) 2020-06-03 15:27:11 +02:00
Github Actions 70ecb03d14 [CI Skip] release/beta 1.18.0-beta.1
skip-checks: true
2020-06-03 05:46:05 +00:00
djuanito.eth a2f179acb1 Update fees to current constants (#2320)
* Update fees to current constants

* Reorder args on map()

* Fixed incorrect order of args on map()
2020-06-03 07:34:03 +02:00
Jaco Greeff c8cb97edef beta 0 reset 2020-06-03 07:33:27 +02:00
Github Actions 69d344c6c3 [CI Skip] release/stable 1.17.2
skip-checks: true
2020-06-02 15:26:46 +00:00
Jaco Greeff 44cdf49b2c Resolve first result after unsub promise (via setImmediate) (#2324) 2020-06-02 17:14:29 +02:00
Github Actions daaf4654a1 [CI Skip] release/stable 1.17.1
skip-checks: true
2020-06-02 12:26:21 +00:00
Jaco Greeff f8d4fcaf04 1.17 (#2323) 2020-06-02 14:15:27 +02:00
Github Actions eb19a39d82 [CI Skip] release/beta 1.17.0-beta.8
skip-checks: true
2020-06-02 10:50:47 +00:00
Jaco Greeff 7ed958fb2d Metadata bump (#2322)
* Metadata bump

* yarn.lock

* var requires
2020-06-02 12:39:48 +02:00
Github Actions bbe9b94f26 [CI Skip] release/beta 1.17.0-beta.7
skip-checks: true
2020-06-02 09:17:06 +00:00
Jaco Greeff 6e83e6aaef Adjust call-only metadata output (#2321) 2020-06-02 11:03:34 +02:00
Github Actions 1545bbf7c5 [CI Skip] release/beta 1.17.0-beta.6
skip-checks: true
2020-05-31 11:18:45 +00:00
Jaco Greeff 5bfc2cd534 Protect against div-by-zero (#2319)
* Protect against div-by-zero

* Rewrite
2020-05-31 13:07:42 +02:00
Github Actions b22d0a196f [CI Skip] 1.17.0-beta.5
skip-checks: true
2020-05-28 11:23:47 +00:00
Jaco Greeff b174864804 Adjust own cache key (per accountId) (#2317) 2020-05-28 13:12:27 +02:00
Github Actions e6834d60c5 [CI Skip] 1.17.0-beta.4
skip-checks: true
2020-05-28 10:54:39 +00:00
Jaco Greeff 97438bb2e8 Small combineLatest -> queryMulti opts (#2316)
* Small combineLatest -> queryMulti opts

* Update packages/api-derive/src/staking/ownSlashes.ts
2020-05-28 12:43:02 +02:00
Github Actions f630d43a25 [CI Skip] 1.17.0-beta.3
skip-checks: true
2020-05-28 10:19:44 +00:00
Jaco Greeff 0187f1ff19 Extend deriveCache around ownExposure/ownSlash (#2315) 2020-05-28 12:07:02 +02:00
Github Actions d8db866316 [CI Skip] 1.17.0-beta.2
skip-checks: true
2020-05-28 09:55:46 +00:00
Jaco Greeff 28aa9e18a7 Bump deps (#2314) 2020-05-28 11:43:45 +02:00
Github Actions 3eaea97b8f [CI Skip] 1.17.0-beta.1
skip-checks: true
2020-05-28 08:55:06 +00:00
Jaco Greeff ea0e5e4547 BTreeSet decoding from Array (#2313) 2020-05-28 10:42:46 +02:00
Github Actions 1256317b65 [CI Skip] 1.17.0-beta.0
skip-checks: true
2020-05-27 17:42:13 +00:00
Jaco Greeff e0c3ed1b96 Fix ElectionSize type (#2312) 2020-05-27 19:29:13 +02:00
93 changed files with 5451 additions and 3367 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
1.4.2
1.6.2
1.11.2
1.12.2
1.12.21.17.2
+2 -5
View File
@@ -10,7 +10,7 @@ jobs:
matrix:
step: ['build:release', 'docs:release']
name: ${{ matrix.step }}
if: "! contains(github.event.head_commit.message, '[CI Skip]') && github.repository == 'polkadot-js/api'"
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'polkadot-js/api'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@@ -21,16 +21,13 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAGES_SRC: build-docs
GH_PAT: ${{ secrets.GH_PAT }}
GH_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
dummy:
name: Dummy
if: "contains(github.event.head_commit.message, '[CI Skip]')"
runs-on: ubuntu-latest
steps:
- name: dummy
+136 -81
View File
@@ -1,4 +1,59 @@
# 1.16.1 May 26, 2020
# CHANGELOG
## 1.21.1 Jun 23, 2020
- Fix subscriptions never unsubscribing after the id swap in 1.18.1 (Thanks to https://github.com/dillu24 for testing iterations)
- Add support for `CheckMortality` signed extension (old `CheckEra` is now an alias)
- Promise API will default to using `getStorage` on non-subscription calls, reducing RPC overhead
- Optimize derive BN allocations, using in-place operators as applicable
- Add new substrate types for Babe EquivocationProof
- Adjust `Releases` enum to use a shared instance
## 1.20.1 Jun 22, 2020
- **Important** RPC for `account_nextIndex` has been moved to `system_accountNextIndex` (Aligning with Substrate as a primary alias)
- Cleanup map entries support with only Substrate 2.0-era RPCs (when introduced)
- Add `system_dryRun` RPC
- Optimize `derive.staking.queryMulti` retrievals with additional per-type batching
- Add `derive.staking.waitingInfo` (same as `electedInfo` for waiting validators)
- Adjust types & metadata for latest Substrate
- `@polkadot/util` 2.15
## 1.19.1 Jun 16, 2020
- Improve typing on `.entries()` queries (Thanks to https://github.com/monitz87)
- Align metadata and types with latest Substrate
- Update Polkadot types for current evolution of parachains
- Allow for type aliasing on events (aligning with calls & queries)
- `@polkadot/util` 2.14
## 1.18.1 Jun 8, 2020
- Expand docs on node-template types (Thanks to https://github.com/g2udevelopment)
- Update contract fees to current impl. (Thanks to https://github.com/djuanit0x)
- Allow `Option` types in enum/Result type generation (Thanks to http://github.com/xlc)
- Add `.entriesPaged` and `.keysPaged` methods for state maps (https://github.com/monitz87)
- Add types for new Substrate proxy module
- Adjust types for new Substrate (renamed) npos-elections module
- `Call` now exposes `method` & `section` fields (aligned with `toHuman()` representation)
- Cater for new Substrate string subscription ids (with backwards compatibility)
- `@polkadot/util` 2.13
## 1.17.2 Jun 2, 2020
- Ensure subscription promise resolves before first result
## 1.17.1 Jun 2, 2020
- Fix `ElectionSize` type (Thanks to https://github.com/arjanz)
- Allow `BTreeSet` decoding from Array/JSON inputs
- Adjust Call-only metadata output to trim documentation to first full line
- Safeguard against divide-by-zero for total era points (expired reward eras)
- Internal derive optimizations with combining calls
- Support for latest Substrate types & metadata
- `@polkadot/util` 2.12
## 1.16.1 May 26, 2020
- Support for Polkadot CC1 types & signed extensions
- Add support for Babe VRF secondary digests (author extraction)
@@ -7,7 +62,7 @@
- Update to latest TypeScript, eslint & typescript-eslint
- `@polkadot/util` 2.11
# 1.15.1 May 23, 2020
## 1.15.1 May 23, 2020
- Adjust `keyPrefix()` with DoubleMap args (Thanks to https://github.com/KiChjang)
- Added `WeightToFeeCoefficient` type (Thanks to https://github.com/danforbes)
@@ -19,7 +74,7 @@
- Adjust `Multiplier` type to `Fixed128` (as per latest Substrate)
- Updated to latest Substrate metadata & add new types
# 1.14.1 May 14, 2020
## 1.14.1 May 14, 2020
- **Important** `DispatchInfo` changed `paysFee` to an enum, if using an older version use, `DispatchInfo: 'DispatchInfoTo244'`
- Align imOnline `Heartbeat` with Substrate (Thanks to https://github.com/arjanz)
@@ -36,7 +91,7 @@
- Extends types for Polkadot claims
- Update `@polkadot/util` to 2.10
# 1.13.1 May 6, 2020
## 1.13.1 May 6, 2020
- Add support for ECDSA keypairs in extrinsic signers (Thanks to https://github.com/akru)
- Rework type generation to use templating for better maintenance (Thanks to https://github.com/xlc)
@@ -49,11 +104,11 @@
- Update types & metadata as per latest Substrate master
- Adjust Centrifuge starting version
# 1.12.2 Apr 30, 2020
## 1.12.2 Apr 30, 2020
- Update `@polkadot/util` to stable 2.9.1 (sadly missed in the previous version, stable should match to stable)
# 1.12.1 Apr 29, 2020
## 1.12.1 Apr 29, 2020
- Fix `CompactAssignments` types (Thanks to https://github.com/arjanz)
- Provider ayo-connect now allows for interval config (Thanks to https://github.com/jnaviask)
@@ -64,11 +119,11 @@
- Allow generic types in ApiPromise.combineLatest
- Update to latest substrate metadata
# 1.11.2 Apr 22, 2020
## 1.11.2 Apr 22, 2020
- Small patch to add missing Polkadot master types (will be in next Kusama update)
# 1.11.1 Apr 21, 2020
## 1.11.1 Apr 21, 2020
- **Important** Substrate master has an updated `Weight` (to `u64`), on older chains apply `Weight: 'u32'` (This does affect event decoding if wrongly set)
- Allow user type augmentation to work with different versions of rxjs (Thanks to https://github.com/monitz87)
@@ -87,7 +142,7 @@
- Enhance API support for non-subscription providers (skip subscription to runtimeVersion)
- Adjust types for Kusama 1057 (notably the new `StakingLedger`)
# 1.10.1 Apr 13, 2020
## 1.10.1 Apr 13, 2020
- **Important** Substrate master has updated staking, on older chains apply `StakingLedger: 'StakingLedgerTo240'`
- Add `rpc.system.chainType` to retrieve the chain type (Development. Local, Live & Custom)
@@ -100,7 +155,7 @@
- Internally all private/protected methods/variables are now `_` prefixed (Aligning with the `private/protected` indicators in the TS definitions)
- Update metadata/docs-from-metadata to the latest Substrate
# 1.9.1 Apr 1, 2020
## 1.9.1 Apr 1, 2020
- **Breaking change** (TypeScript with derives only) The return type names for `api.derive.*` have been adjusted for consistency, all starting with `Derive*` (previously a mixture of `Derived*` and `Derive*`)
- **Breaking change** (derives only) Additional cleanups of democracy proposal & referenda derives, including support for new Polkadot/Substrate vote retrievals
@@ -115,7 +170,7 @@
- Fix encoding for `Vec<u8>`-related types as part of constants
- Internal adjustment of interface type locations (no impact on imports via `@polkadot/types/interfaces`)
# 1.8.1 Mar 22, 2020
## 1.8.1 Mar 22, 2020
- **Breaking change** The format for any custom RPCs have been changed (alongside API-internal changes) to allow for better RPC management. If you are currently using custom RPCs (or planning to do so), look at the [updated documentation](https://polkadot.js.org/api/start/rpc.custom.html)
- **Breaking change** Alongside API RPC changes, the `@polkadot/jsonrpc` package has been removed. Since it was never documented and only used internally, this should not have adverse impacts. All RPC definitions itself has now been moved to the relevant modules inside `@polkadot/types/interfaces`
@@ -127,7 +182,7 @@
- Adjusted referendum derives to cater for bot new/old democracy. Derived `referendumInfo` now includes `status` field, not `info`
- Add `initWasm` flag to API options. When set to `false` does not init the WASM portion (leaving it to the user elsewhere)
# 1.7.1 Mar 17, 2020
## 1.7.1 Mar 17, 2020
- **Important** Current versions of Polkadot/Substrate have dropped support for linked maps on storage entries. If you are using these queries to retrieve all entries, for instance `staking.{nominators,validators}()` and using an upgraded chain, you need to swap to retrieving entries via `.entries()` or `.keys()` for the keys.
- Pull in support and types for latest Polkadot/Substrate
@@ -137,11 +192,11 @@
- Expanded `derive.staking.*` derives, including addition of `derive.staking.own*`
- Re-add fixed (with tests) checks for query args, previously disabled in 1.6.2
# 1.6.2 Mar 12, 2020
## 1.6.2 Mar 12, 2020
- Revert checks for query args, not working on `.at()` queries (proper fix in next version)
# 1.6.1 Mar 12, 2020
## 1.6.1 Mar 12, 2020
- **Breaking change** `api.rpc.state.queryStorage(...)` now fully decodes the `Vec<StorageChangeSet>` and returns a decoded `[Hash, Codec[]][]` when using this RPC.
- `StorageKey` now has an `.args` property, decoded from meta where `twox64_concat` or `blake128_concat` are used on maps
@@ -155,7 +210,7 @@
- Add runtime validation for map arguments to `api.query.*`
- TypeScript interfaces for linked maps now correctly generates as `[Type, Linkage<Next>]`
# 1.5.1 Mar 06, 2020
## 1.5.1 Mar 06, 2020
- **Important** Substrate master has updated staking, on older chains supply `StakingLedger: 'StakingLedgerTo223'`
- **Important** Substrate master has updated collective, on older chains supply `Votes: 'VotesTo230'`
@@ -175,11 +230,11 @@
- Add additional derives to `api.derive.staking` to handle lazy-payout retrievals
- Update `@polkadot/{util, util-crypto, keyring}` to 1.6.1 & `@polkadot/wasm` to 1.2.1
# 1.4.2 Feb 27, 2020
## 1.4.2 Feb 27, 2020
- Fix `api.tx(<extrinsic>): Submittable` decoration (non-working in 1.4.1, now with proper test)
# 1.4.1 Feb 26, 2020
## 1.4.1 Feb 26, 2020
- **Breaking change** (TypeScript only) The `*.d.ts` files now contain TypeScript 3.8 features (specifically `#private`), which is not usable in TS versions < 3.8
- **Breaking change** - `api.derive.staking.*` has updated result types and detects support for lazy payouts queries
@@ -205,7 +260,7 @@
- Cleanup augmentation and generation scripts for type definitions, aligning with api augmentation
- Bump to `@polkadot/{util, util-crypto, keyring}` 2.5.1
# 1.3.1 Feb 18, 2020
## 1.3.1 Feb 18, 2020
- Add `@types/bn.js` as a normal dependency, exposed in `*.d.ts` (Thanks to https://github.com/monitz87)
- Type generation scripts (including `polkadot-types-from-{chain,defs}`) has been moved to the `@polkadot/typegen` package
@@ -213,7 +268,7 @@
- Expose chain properties on registry (and use for API type formatting)
- Add `toHuman(isExtended?: boolean)` to all codec types, formatting into a human-readable structure
# 1.2.1 Feb 16, 2020
## 1.2.1 Feb 16, 2020
- **Important** Update RPC status codes (latest Substrate 2), with the `isInBlock` (`isFinalized` now indicates finality)
- Storage `.entries(arg?: any)` now has the correct argument type for DoubleMap (Thanks to https://github.com/monitz87)
@@ -231,7 +286,7 @@
- Cleanup `codec/Date` tests to make it run properly on all timezones
- Add explicit dependencies to all packages and move TypeScript `@types/*` to dev deps
# 1.1.1 Feb 06, 2020
## 1.1.1 Feb 06, 2020
- **Important** Chains without `balances.account` or `system.account` should supply `"BalanceLock": "BalanceLockTo212"` to their types to use the previous-generation `BalanceLock` (when querying locks)
- Add support for `balances.account` in all applicable derives (incl. `vesting` module)
@@ -245,7 +300,7 @@
- Adjust balances fees derivation with optional transfer and creation fees (removed in Substrate)
- Adjust enum `.toJSON()` to return type name as specified
# 1.0.1 Jan 30, 2020
## 1.0.1 Jan 30, 2020
- **Breaking change** Drop support for Substrate v1 chain in all derives
- Return unsub functions from provider .on emitters (Thanks to https://github.com/jak-pan)
@@ -264,7 +319,7 @@
- Remove support for un-deployed metadata
- Remove old known types for Substrate V1
# 0.100.1 Jan 13, 2020
## 0.100.1 Jan 13, 2020
- **Important** This will the the last API version with Substrate 1.x support. Although you will still be able to use subsequent versions with older chains, dependent libraries such as sr25519 may not be compatible.
- Add support for the Substrate identity module
@@ -275,7 +330,7 @@
- Add support for latest Polkadot/Substrate types
- Add `paymentInfo` to submittables to calculate fees
# 0.99.1 Dec 13, 2019
## 0.99.1 Dec 13, 2019
- **Breaking change** The `Data` and `U8a` type has been renamed and just replaced with the `Raw` type
- **Breaking change** The `api.derive.staking.info` has been split into 2 - `staking.query` for non-balance related information (more effective) and `staking.account` that enhances query for all the information previously found `.info`
@@ -284,7 +339,7 @@
- Add additional derives for both council & treasury
- Alignment with latest Polkadot/Substrate master branch types
# 0.98.1 Dec 04, 2019
## 0.98.1 Dec 04, 2019
- Make the TypeScript generation script mor re-usable (Thanks to https://github.com/xlc)
- Add `.entries()` for all map-types, returning storage keys and values
@@ -293,7 +348,7 @@
- Support for new Substrate democracy with preimages in derive
- Alignment of types with Substrate/Polkadot master branches
# 0.97.1 Nov 29, 2019
## 0.97.1 Nov 29, 2019
- **Breaking change** Add the passing on an explicit `Registry` to all calls to `createType` as well as all codec classes. If you are upgrading form an older version, use the [migration guide](UPGRADING.md) to walk through the changes required.
- **Breaking change** The metadata classes have been moved from `@polkadot/types` into `@polkadot/metadata`. If you explicitly create `Metadata` classes, you now would need to do so with the `import Metadata from '@polkadot/metadata';` This is a decorated class, where the previous metadata is now available on `Metadata.metadata`, alongside decorated `consts.*`', `tx.*` and `query.*`.
@@ -305,7 +360,7 @@
- Support for Metadata V9, which adjusts the hashing methods of storage entries
- Support for Metadata V10 (still un-released), which includes prefixed map support
# 0.96.1 Nov 09, 2019
## 0.96.1 Nov 09, 2019
- Updated types for latest Kusama
- Add `filterRecords` (in addition to `findRecord`) on submittable results
@@ -315,11 +370,11 @@
- Update council derives for the latest Substrate master support (with constants)
- Derive cleanups, including sharing of instances between the API and internal to derives
# 0.95.2 Oct 25, 2019
## 0.95.2 Oct 25, 2019
- Temporary removal of `account_nextIndex` use, will be re-added in a future release
# 0.95.1 Oct 25, 2019
## 0.95.1 Oct 25, 2019
- Support Extrinsic V4 with additional signature indicator (Latest Polkadot/Substrate/Kusama)
- Adjust subscription update checks to avoid duplicated data updates
@@ -329,7 +384,7 @@
- All latest Polkadot & Substrate types (as per master branches)
- **Breaking change** `Call.injectMethods` is moved to `Call.injectMetadata` to align with `Events` (This _should_ not be used externally, however mentioned as breaking here)
# 0.94.1 Oct 07, 2019
## 0.94.1 Oct 07, 2019
- Add handling of `Result<Ok, Error>` definitions
- Adjust API cloning now takes RPC filters from source into account
@@ -341,7 +396,7 @@
- Add documentation for custom extrinsic formats (advanced chains)
- Update to latest substrate master metadata
# 0.93.1 Sep 26, 2019
## 0.93.1 Sep 26, 2019
- Support for Kusama CC2
- In extrinsic submission, use `rpc.account.nextIndex` to retrieve the nonce when available
@@ -351,7 +406,7 @@
- Support recursive type registration (self-referencing via `Box`) in addition to better sanitation of user-defined-types
- Documentation and example updates (thanks mostly to contributions)
# 0.92.1 Sep 12, 2019
## 0.92.1 Sep 12, 2019
- The API now correctly sets the ss58 prefix as retrieved from the chain properties via `ss58Format`
- Bump to `@polkadot/util` 1.4.1, removing use of `ExtError`
@@ -359,7 +414,7 @@
- Support the latest Polkadot & Substrate master branches (incl. metadata updates)
- Getting started documentation has been made available
# 0.91.1 Sep 09, 2019
## 0.91.1 Sep 09, 2019
- This release was focussed on stability, with a number of cleanups and bug-fixes
- Adjustments for Substrate 1.x chain detection (with auto-types) and Substrate 2.x support has been extended with all latest types
@@ -373,7 +428,7 @@
- **Breaking change** `SignerPayload` is renamed to `SignerPayloadJSON`
- **Breaking change** `SignerPayloadJSON`, `SignerPayloadRawBase` and `SignerPayloadRaw` are all moved to `@polkadot/types`
# 0.90.1 Aug 24, 2019
## 0.90.1 Aug 24, 2019
If you are upgrading form an older version, use the CHANGELOG hand-in-hand with the [migration guide](UPGRADING.md).
@@ -391,7 +446,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- The `types/codec/createType` has been moved to `types/codec/create` with the same exports. If you explicitly imported from here (and not doing the suggested `import { createType } from '@polkadot/types`), the reference needs to be updated
# 0.82.0-beta.x Jul 28, 2019
## 0.82.0-beta.x Jul 28, 2019
- Support for substrate 2.x (master) has been extended,
- Additional types have been addedd for the modules
@@ -410,7 +465,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- The `ContractsAbi` type has been moved from `@polkadot/types` to `import { Abi } from '@polkadot/api-contract`. This paves the way for an enhanced contracts interface, instead of dealing with low-level API calls.
# 0.81.1 Jun 14, 2019
## 0.81.1 Jun 14, 2019
- The dependency on `@polkadot/keyring` has been removed - if you relied on the API to provide this, you would now need to manually add it
- `createType` allows for the creation of `[u8; <length>]` types (opening the door for contract support)
@@ -430,7 +485,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Add `off` method to `Api` (Base, for both `ApiPromise` & `ApiRx`) to remove an event listener
# 0.80.1 Jun 04, 2019
## 0.80.1 Jun 04, 2019
- Support for mortal transactions
- Better DoubleMap storage support
@@ -440,7 +495,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Misc. cleanups and fixes
# 0.79.1 May 22, 2019
## 0.79.1 May 22, 2019
- DoubleMap query support
- Support latest EventRecord metadata (substrate master)
@@ -452,7 +507,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Add `toRawType` on all type classes (breakdown into primitive types)
# 0.78.1 May 08, 2019
## 0.78.1 May 08, 2019
- Fix linked-maps (not working since 0.77.1)
- Convert Usize to U32 (as found in WASM environments)
@@ -463,13 +518,13 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Metadata updates for substrate (WithdrawReasons, ContractInfo)
# 0.77.1 Apr 25, 2019
## 0.77.1 Apr 25, 2019
- Support Metadata v4, which introduces the use of a custom hasher to hash storage map keys.
- Add TreasuryProposal (not the same as democracy, type aliased)
# 0.76.1 Apr 03, 2019
## 0.76.1 Apr 03, 2019
- Caching improvements (duplicate queries, no duplicate subscriptions)
- Experimental contract API
@@ -477,12 +532,12 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Update @polkadot/util-crypto with smaller footprint
# 0.75.1 Mar 29, 2019
## 0.75.1 Mar 29, 2019
- Start journey to 1.0
# 0.53.1 Mar 29, 2019
## 0.53.1 Mar 29, 2019
- Change spelling to US English as per substrate master (1.0-rc1). Breaking changes as a result:
- For extrinsic status results, if you have checked the type returns, i.e. `result.type === 'Finalised'` now check on the status for `result.status.isFinalized` or `result.status.isBroadcast`, ... (the `type` property is now accessible only on `result.status.type`)
@@ -493,7 +548,7 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- All examples have been updated with sr25519 addresses (with the new checksums)
# 0.52.1 Mar 28, 2019
## 0.52.1 Mar 28, 2019
- Support queries to linked mapped storage (found in new staking interfaces)
- Add `derive.staking.controllers` to retrieve all active staking controllers
@@ -503,42 +558,42 @@ If you are upgrading form an older version, use the CHANGELOG hand-in-hand with
- Check for single instances for api and types as they are loaded (assertSingletonPackage)
# 0.51.1 Mar 25, 2019
## 0.51.1 Mar 25, 2019
- Support metadata V2 as per latest substrate master
- Update metadata with new types as per latest substrate master
# 0.50.1 Mar 23, 2019
## 0.50.1 Mar 23, 2019
- Latest util-crypto (usage of WASM with JS fallbacks if not available)
- Update upstream @polkadot dependencies (for new crypto)
# 0.49.1 Mar 20, 2019
## 0.49.1 Mar 20, 2019
- Fix large message signing on non-known nodes (default is now hashing, there has been enough time between upgrades)
# 0.48.1 Mar 18, 2019
## 0.48.1 Mar 18, 2019
- Pull in new sr25519 capable keyring for dev nodes
- When using dev mode, it assumes that the node is the latest with derived sr25519 keys
# 0.47.1 Mar 14, 2019
## 0.47.1 Mar 14, 2019
- Swap to publishing -beta.x on merge (non-breaking testing)
# 0.46.1 Mar 01, 2019
## 0.46.1 Mar 01, 2019
- Extended type registration to now handle internal types as well. Additionally the built-in Extrinsic type can now we overridden with a custom version.
- Where `Extrinsic` and `Method` is used as types, consider importing `{ IMethod, IExtrinsic }` from `@polkadot/types/types`, especially in the cases where this is used from a `SubmittableExtrinsic`
- The `typeRegistry` constant is now `getTypeRegistry()` as a function
# 0.45.1 Feb 19, 2019
## 0.45.1 Feb 19, 2019
- Storage with option values now correctly return `Option<Type>` and is indicated as such in the documentation
@@ -555,7 +610,7 @@ console.log('llo', llo.unwrapOr('not set') /* Option<BlockNumber> */)
```
# 0.44.1 Feb 19, 2019
## 0.44.1 Feb 19, 2019
- Split primitives and types into separate folders. This should not affect external use since the exports remain the same, however does have an impact where classes are referenced directly. e.g.
@@ -573,45 +628,45 @@ import { Method, Signature } from '@polkadot/types';
```
# 0.43.1 Feb 14, 2019
## 0.43.1 Feb 14, 2019
- Introduces support for the new keyring with sr25519 support in addition to ed25519. While this does not change the exposed API, it is considered breaking since @polkadot/keyring has interface changes. (Unless needed, don't rush the upgrade)
# 0.42.1 Jan 31, 2019
## 0.42.1 Jan 31, 2019
- Support for substrate hash signing with implVersion >= 18
- Changed signatures for Extrinsic signing, this should not have (much) of an impact since it is generally not used directly. SubmittableExtrinsic (as exposed by the API), supports the old-style use.
# 0.41.1 Jan 26, 2019
## 0.41.1 Jan 26, 2019
- Support the V1 metadata specification from Substrate in addition to the currently testnet active V0 version
# 0.40.1 Jan 16, 2019
## 0.40.1 Jan 16, 2019
- The API interfaces now require a WS-compatible provider, e.g. subscription support is a must. Previously the HTTPProvider could be use (although it was very limited in the interactions).
# 0.39.1 Jan 11, 2019
## 0.39.1 Jan 11, 2019
- The Promise API now returns a `Promise<UnsubFunction>` instead of `UnsubFunction` when making subscriptions.
# 0.38.1 Jan 08, 2019
## 0.38.1 Jan 08, 2019
Substrate has been updated with a breaking new transaction format where the Index/Nonce is now encoded as a Compact. This change is being rolled out to both Alexander (Polkadot testnet) as well as Charred Cherry (Substrate testnet) - transactions between old and new are not compatible.
# 0.37.1 Jan 04, 2019
## 0.37.1 Jan 04, 2019
api-observable has been removed. This was only used in /apps and inconsistent with the api/rx and api/promise APIs. Future work will include derives like was included in api-observable into the base.
Tuples now return single types when only one type is available, i.e. `(AccountId)` would now resolve as `AccountId`. The extra type wrapper adds no benefit to users here.
# 0.36.1 Jan 03, 2019
## 0.36.1 Jan 03, 2019
Api Promise has been updated in the way we deal with subscriptions. Previously a subscription returned `Promise<number>` where the caller was to keep track of the id and use it in subsequent unsubscribes. Now any subscriptions return an unsubscribe/destroy function `(): void`, that is use for removing the subscriptions, e.g.
@@ -622,51 +677,51 @@ unsubscribe(); // here we destroy the subscription
```
# 0.35.1 Dec 20, 2018
## 0.35.1 Dec 20, 2018
Swapped to new metadata structures from Substrate. If the API is not working with your node, update Substrate to latest master branch. (Or 0.9.1 for Charred Cherry). Dropped support for old metadata as found as far back as BBQ Birch.
# 0.34.1 Dec 18, 2018
## 0.34.1 Dec 18, 2018
Changed the send signature (for future expansion of eg. events) to return `result: { status: ExtrinsicStatus }` instead of `status: ExtrinsicStatus`. For most cases where only status `type` checks are used, i.e. `status.type === 'Finalised'` this should not be a breaking change. Deep inspection of the status object however will need to adapt.
# 0.33.1 Dec 06, 2018
## 0.33.1 Dec 06, 2018
# 0.32.1 Nov 21, 2018
## 0.32.1 Nov 21, 2018
# 0.31.1 Oct 10, 2018
## 0.31.1 Oct 10, 2018
# 0.30.1 Sep 27, 2018
## 0.30.1 Sep 27, 2018
# 0.29.1 Sep 14, 2018
## 0.29.1 Sep 14, 2018
# 0.28.1 Aug 11, 2018
## 0.28.1 Aug 11, 2018
# 0.15.1 Aug 07, 2018
## 0.15.1 Aug 07, 2018
# 0.14.1 Jun 23, 2018
## 0.14.1 Jun 23, 2018
# 0.13.1 May 29, 2018
## 0.13.1 May 29, 2018
# 0.12.1 May 18, 2018
## 0.12.1 May 18, 2018
# 0.11.1 May 16, 2018
## 0.11.1 May 16, 2018
# 0.10.1 May 07, 2018
## 0.10.1 May 07, 2018
# 0.9.1 Apr 24, 2018
## 0.9.1 Apr 24, 2018
# 0.8.1 Mar 15, 2018
## 0.8.1 Mar 15, 2018
# 0.7.1 Jan 25, 2018
## 0.7.1 Jan 25, 2018
# 0.6.1 Dec 03, 2017
## 0.6.1 Dec 03, 2017
# 0.5.1 Nov 28, 2017
## 0.5.1 Nov 28, 2017
# 0.4.1 Nov 19, 2017
## 0.4.1 Nov 19, 2017
# 0.3.1 Nov 19, 2017
## 0.3.1 Nov 19, 2017
# 0.2.1 Nov 18, 2017
## 0.2.1 Nov 18, 2017
+3
View File
@@ -20,6 +20,9 @@ All data transferred between the API and the Node is in a SCALE-encoded binary f
To fix this, you should look at the specific `api.tx.*` params and adjust the type definitions for those param types to match what is found on the node side. In some rare cases the cause could be extrinsic formatting related, to track these make an `api.tx.system.remark(data: Bytes)` call, if it fails, the API and node cannot agree on [an extrinsic format and adjustments are required](types.extend.md#impact-on-extrinsics).
If you are using a node-template based version of substrate and you changed the specName you need to add these typings(In addition to other custom types) `{"Address": "AccountId","LookupSource": "AccountId"}`. This is also the case when you use [polkadot-js/apps](https://github.com/polkadot-js/apps) to connect to your node. When the specName stays node-template the API is smart enough to add the custom typings.
## I would like to sign transactions offline
The API itself is independent on where the signature comes from and how it is injected. Additionally it implements a signer interface, that can be used for external signing - an example of this is the [polkadot-js/apps](https://github.com/polkadot-js/apps) support for signing via extensions and even the [polkadot-js/extension](https://github.com/polkadot-js/extension) support for tools such as the [Parity Signer](https://github.com/paritytech/parity-signer).
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "1.16.1"
"version": "1.21.1"
}
+10 -9
View File
@@ -24,14 +24,15 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/register": "^7.9.0",
"@babel/runtime": "^7.9.6",
"@polkadot/dev": "^0.54.1",
"@polkadot/ts": "^0.3.23",
"@babel/core": "^7.10.3",
"@babel/register": "^7.10.3",
"@babel/runtime": "^7.10.3",
"@polkadot/dev": "^0.55.12",
"@polkadot/ts": "^0.3.26",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^25.2.3",
"@vuepress/plugin-search": "^1.5.0",
"copyfiles": "^2.2.0"
}
"@types/jest": "^26.0.0",
"@vuepress/plugin-search": "^1.5.2",
"copyfiles": "^2.3.0"
},
"version": "1.21.1"
}
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-contract",
"version": "1.16.1",
"version": "1.21.1",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"keywords": [
@@ -26,11 +26,11 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/api": "1.16.1",
"@polkadot/rpc-core": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/api": "1.21.1",
"@polkadot/rpc-core": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"bn.js": "^5.1.2",
"rxjs": "^6.5.5"
}
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "1.16.1",
"version": "1.21.1",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"keywords": [
@@ -27,18 +27,18 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/api": "1.16.1",
"@polkadot/rpc-core": "1.16.1",
"@polkadot/rpc-provider": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@polkadot/util-crypto": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/api": "1.21.1",
"@polkadot/rpc-core": "1.21.1",
"@polkadot/rpc-provider": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"@polkadot/util-crypto": "^2.15.1",
"bn.js": "^5.1.2",
"memoizee": "^0.4.14",
"rxjs": "^6.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1"
"@polkadot/keyring": "^2.15.1"
}
}
+9 -7
View File
@@ -11,23 +11,24 @@ import { map } from 'rxjs/operators';
import { memo } from '../util';
type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN];
type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN, BN];
// query via constants (current applicable path)
function queryConstants (api: ApiInterfaceRx): Observable<ResultV2> {
return of([
// deprecated
api.consts.contracts.callBaseFee || api.registry.createType('Balance'),
api.consts.contracts.contractFee || api.registry.createType('Balance'),
api.consts.contracts.creationFee || api.registry.createType('Balance'),
api.consts.contracts.transactionBaseFee || api.registry.createType('Balance'),
api.consts.contracts.transactionByteFee || api.registry.createType('Balance'),
api.consts.contracts.transferFee || api.registry.createType('Balance'),
// current
api.consts.contracts.callBaseFee,
api.consts.contracts.contractFee,
api.consts.contracts.rentByteFee,
api.consts.contracts.rentDepositOffset,
api.consts.contracts.tombstoneDeposit,
api.consts.contracts.transactionBaseFee,
api.consts.contracts.transactionByteFee
api.consts.contracts.surchargeReward,
api.consts.contracts.tombstoneDeposit
]) as unknown as Observable<ResultV2>;
}
@@ -47,12 +48,13 @@ function queryConstants (api: ApiInterfaceRx): Observable<ResultV2> {
export function fees (api: ApiInterfaceRx): () => Observable<DeriveContractFees> {
return memo((): Observable<DeriveContractFees> => {
return queryConstants(api).pipe(
map(([creationFee, transferFee, callBaseFee, contractFee, rentByteFee, rentDepositOffset, tombstoneDeposit, transactionBaseFee, transactionByteFee]): DeriveContractFees => ({
map(([callBaseFee, contractFee, creationFee, transactionBaseFee, transactionByteFee, transferFee, rentByteFee, rentDepositOffset, surchargeReward, tombstoneDeposit]): DeriveContractFees => ({
callBaseFee,
contractFee,
creationFee,
rentByteFee,
rentDepositOffset,
surchargeReward,
tombstoneDeposit,
transactionBaseFee,
transactionByteFee,
+3 -3
View File
@@ -82,15 +82,15 @@ function calcVotesPrev (votesFor: DeriveReferendumVote[]): DeriveReferendumVoteS
if (vote.isAye) {
state.allAye.push(derived);
state.voteCountAye++;
state.votedAye = state.votedAye.add(counted);
state.votedAye.iadd(counted);
} else {
state.allNay.push(derived);
state.voteCountNay++;
state.votedNay = state.votedNay.add(counted);
state.votedNay.iadd(counted);
}
state.voteCount++;
state.votedTotal = state.votedTotal.add(counted);
state.votedTotal.iadd(counted);
return state;
}, {
+2 -2
View File
@@ -17,9 +17,9 @@ type ResultSlots = [u64, u64, u64, Option<SessionIndex>];
type ResultSlotsFlat = [u64, u64, u64, SessionIndex];
function createDerive (api: ApiInterfaceRx, info: DeriveSessionInfo, [currentSlot, epochIndex, epochOrGenesisStartSlot, activeEraStartSessionIndex]: ResultSlotsFlat): DeriveSessionProgress {
const epochStartSlot = epochIndex.mul(info.sessionLength).add(epochOrGenesisStartSlot);
const epochStartSlot = epochIndex.mul(info.sessionLength).iadd(epochOrGenesisStartSlot);
const sessionProgress = currentSlot.sub(epochStartSlot);
const eraProgress = info.currentIndex.sub(activeEraStartSessionIndex).mul(info.sessionLength).add(sessionProgress);
const eraProgress = info.currentIndex.sub(activeEraStartSessionIndex).imul(info.sessionLength).iadd(sessionProgress);
return {
...info,
+25 -26
View File
@@ -7,7 +7,7 @@ import { Balance, StakingLedger, UnlockChunk } from '@polkadot/types/interfaces'
import { DeriveSessionInfo, DeriveStakingAccount, DeriveStakingQuery, DeriveUnlocking } from '../types';
import BN from 'bn.js';
import { Observable, combineLatest } from 'rxjs';
import { Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { isUndefined } from '@polkadot/util';
@@ -21,7 +21,7 @@ function groupByEra (list: UnlockChunk[]): Record<string, BN> {
map[key] = !map[key]
? value.unwrap()
: map[key].add(value.unwrap());
: map[key].iadd(value.unwrap());
return map;
}, {});
@@ -32,8 +32,8 @@ function calculateUnlocking (api: ApiInterfaceRx, stakingLedger: StakingLedger |
return undefined;
}
const unlockingChunks = stakingLedger.unlocking.filter(({ era }): boolean =>
era.unwrap().sub(sessionInfo.activeEra).gtn(0)
const unlockingChunks = stakingLedger.unlocking.filter(({ era }) =>
era.unwrap().gt(sessionInfo.activeEra)
);
if (!unlockingChunks.length) {
@@ -43,11 +43,13 @@ function calculateUnlocking (api: ApiInterfaceRx, stakingLedger: StakingLedger |
// group the unlock chunks that have the same era and sum their values
const groupedResult = groupByEra(unlockingChunks);
const results = Object.entries(groupedResult).map(([eraString, value]): DeriveUnlocking => ({
remainingEras: new BN(eraString).sub(sessionInfo.activeEra),
remainingEras: new BN(eraString).isub(sessionInfo.activeEra),
value: api.registry.createType('Balance', value)
}));
return results.length ? results : undefined;
return results.length
? results
: undefined;
}
function redeemableSum (api: ApiInterfaceRx, stakingLedger: StakingLedger | undefined, sessionInfo: DeriveSessionInfo): Balance {
@@ -57,7 +59,7 @@ function redeemableSum (api: ApiInterfaceRx, stakingLedger: StakingLedger | unde
return api.registry.createType('Balance', stakingLedger.unlocking.reduce((total, { era, value }): BN => {
return sessionInfo.activeEra.gte(era.unwrap())
? total.add(value.unwrap())
? total.iadd(value.unwrap())
: total;
}, new BN(0)));
}
@@ -70,23 +72,6 @@ function parseResult (api: ApiInterfaceRx, sessionInfo: DeriveSessionInfo, query
};
}
export function _account (api: ApiInterfaceRx): (sessionInfo: DeriveSessionInfo, accountId: Uint8Array | string) => Observable<DeriveStakingAccount> {
return memo((sessionInfo: DeriveSessionInfo, accountId: Uint8Array | string): Observable<DeriveStakingAccount> =>
api.derive.staking.query(accountId).pipe(
map((query) => parseResult(api, sessionInfo, query))
));
}
/**
* @description From a stash, retrieve the controllerId and fill in all the relevant staking details
*/
export function account (api: ApiInterfaceRx): (accountId: Uint8Array | string) => Observable<DeriveStakingAccount> {
return memo((accountId: Uint8Array | string): Observable<DeriveStakingAccount> =>
api.derive.session.info().pipe(
switchMap((sessionInfo) => api.derive.staking._account(sessionInfo, accountId))
));
}
/**
* @description From a list of stashes, fill in all the relevant staking details
*/
@@ -94,7 +79,21 @@ export function accounts (api: ApiInterfaceRx): (accountIds: (Uint8Array | strin
return memo((accountIds: (Uint8Array | string)[]): Observable<DeriveStakingAccount[]> =>
api.derive.session.info().pipe(
switchMap((sessionInfo) =>
combineLatest(accountIds.map((accountId) => api.derive.staking._account(sessionInfo, accountId)))
api.derive.staking.queryMulti(accountIds).pipe(
map((queries) => queries.map((query) => parseResult(api, sessionInfo, query)))
)
)
));
)
);
}
/**
* @description From a stash, retrieve the controllerId and fill in all the relevant staking details
*/
export function account (api: ApiInterfaceRx): (accountId: Uint8Array | string) => Observable<DeriveStakingAccount> {
return memo((accountId: Uint8Array | string): Observable<DeriveStakingAccount> =>
api.derive.staking.accounts([accountId]).pipe(
map(([first]) => first)
)
);
}
+10 -15
View File
@@ -3,10 +3,9 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ApiInterfaceRx } from '@polkadot/api/types';
import { AccountId } from '@polkadot/types/interfaces';
import { DeriveStakingQuery, DeriveStakingElected } from '../types';
import { DeriveStakingElected } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
import { Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { memo } from '../util';
@@ -14,18 +13,14 @@ import { memo } from '../util';
export function electedInfo (api: ApiInterfaceRx): () => Observable<DeriveStakingElected> {
return memo((): Observable<DeriveStakingElected> =>
api.derive.staking.validators().pipe(
switchMap(({ nextElected }): Observable<[AccountId[], DeriveStakingQuery[]]> =>
combineLatest([
of(nextElected),
combineLatest(
nextElected.map((accountId) => api.derive.staking.query(accountId))
)
])
),
map(([nextElected, info]): DeriveStakingElected => ({
info,
nextElected
}))
switchMap(({ nextElected }): Observable<DeriveStakingElected> =>
api.derive.staking.queryMulti(nextElected).pipe(
map((info): DeriveStakingElected => ({
info,
nextElected
}))
)
)
)
);
}
+1
View File
@@ -21,3 +21,4 @@ export * from './stakerRewards';
export * from './stakerSlashes';
export * from './stashes';
export * from './validators';
export * from './waitingInfo';
+47 -19
View File
@@ -2,34 +2,62 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { EraIndex, Exposure } from '@polkadot/types/interfaces';
import { ApiInterfaceRx } from '@polkadot/api/types';
import { DeriveOwnExposure } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { memo } from '../util';
import { deriveCache, memo } from '../util';
export function ownExposure (api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable<DeriveOwnExposure[]> {
return memo((accountId: Uint8Array | string, withActive?: boolean): Observable<DeriveOwnExposure[]> => {
const CACHE_KEY = 'ownExposure';
export function _ownExposure (api: ApiInterfaceRx): (accountId: Uint8Array | string, era: EraIndex, withActive: boolean) => Observable<DeriveOwnExposure> {
return memo((accountId: Uint8Array | string, era: EraIndex, withActive: boolean): Observable<DeriveOwnExposure> => {
const cacheKey = `${CACHE_KEY}-${era.toString()}-${accountId.toString()}`;
const cached = withActive
? undefined
: deriveCache.get<DeriveOwnExposure>(cacheKey);
return cached
? of(cached)
: api.queryMulti<[Exposure, Exposure]>([
[api.query.staking.erasStakersClipped, [era, accountId]],
[api.query.staking.erasStakers, [era, accountId]]
]).pipe(
map(([clipped, exposure]): DeriveOwnExposure => {
const value = { clipped, era, exposure };
!withActive && deriveCache.set(cacheKey, value);
return value;
})
);
});
}
export function ownExposure (api: ApiInterfaceRx): (accountId: Uint8Array | string, era: EraIndex) => Observable<DeriveOwnExposure> {
return memo((accountId: Uint8Array | string, era: EraIndex): Observable<DeriveOwnExposure> =>
api.derive.staking._ownExposure(accountId, era, true)
);
}
export function _ownExposures (api: ApiInterfaceRx): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable<DeriveOwnExposure[]> {
return memo((accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean): Observable<DeriveOwnExposure[]> =>
eras.length
? combineLatest(
eras.map((era) => api.derive.staking._ownExposure(accountId, era, withActive))
)
: of([])
);
}
export function ownExposures (api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable<DeriveOwnExposure[]> {
return memo((accountId: Uint8Array | string, withActive = false): Observable<DeriveOwnExposure[]> => {
return api.derive.staking.erasHistoric(withActive).pipe(
switchMap((eras) =>
eras.length
? combineLatest(
eras.map((era) => combineLatest([
of(era),
api.query.staking.erasStakersClipped(era, accountId),
api.query.staking.erasStakers(era, accountId)
]))
)
: of([])
),
map((result): DeriveOwnExposure[] =>
result.map(([era, clipped, exposure]): DeriveOwnExposure => ({
clipped,
era,
exposure
}))
api.derive.staking._ownExposures(accountId, eras, withActive)
)
);
});
+52 -18
View File
@@ -3,34 +3,68 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ApiInterfaceRx } from '@polkadot/api/types';
import { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces';
import { ITuple } from '@polkadot/types/types';
import { DeriveStakerSlashes } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { Option } from '@polkadot/types';
import { memo } from '../util';
import { deriveCache, memo } from '../util';
const CACHE_KEY = 'ownSlash';
export function _ownSlash (api: ApiInterfaceRx): (accountId: Uint8Array | string, era: EraIndex, withActive: boolean) => Observable<DeriveStakerSlashes> {
return memo((accountId: Uint8Array | string, era: EraIndex, withActive: boolean): Observable<DeriveStakerSlashes> => {
const cacheKey = `${CACHE_KEY}-${era.toString()}-${accountId.toString()}`;
const cached = withActive
? undefined
: deriveCache.get<DeriveStakerSlashes>(cacheKey);
return cached
? of(cached)
: api.queryMulti<[Option<BalanceOf>, Option<ITuple<[Perbill, BalanceOf]>>]>([
[api.query.staking.nominatorSlashInEra, [era, accountId]],
[api.query.staking.validatorSlashInEra, [era, accountId]]
]).pipe(
map(([optNom, optVal]): DeriveStakerSlashes => {
const value = {
era,
total: optVal.isSome
? optVal.unwrap()[1]
: optNom.unwrapOrDefault()
};
!withActive && deriveCache.set(cacheKey, value);
return value;
})
);
});
}
export function ownSlash (api: ApiInterfaceRx): (accountId: Uint8Array | string, era: EraIndex) => Observable<DeriveStakerSlashes> {
return memo((accountId: Uint8Array | string, era: EraIndex): Observable<DeriveStakerSlashes> =>
api.derive.staking._ownSlash(accountId, era, true)
);
}
export function _ownSlashes (api: ApiInterfaceRx): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable<DeriveStakerSlashes[]> {
return memo((accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean): Observable<DeriveStakerSlashes[]> =>
eras.length
? combineLatest(
eras.map((era) => api.derive.staking._ownSlash(accountId, era, withActive))
)
: of([])
);
}
export function ownSlashes (api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable<DeriveStakerSlashes[]> {
return memo((accountId: Uint8Array | string, withActive = false): Observable<DeriveStakerSlashes[]> => {
return api.derive.staking.erasHistoric(withActive).pipe(
switchMap((eras) =>
eras.length
? combineLatest(
eras.map((era) => combineLatest([
of(era),
api.query.staking.nominatorSlashInEra(era, accountId),
api.query.staking.validatorSlashInEra(era, accountId)
]))
)
: of([])
),
map((result): DeriveStakerSlashes[] =>
result.map(([era, optNom, optVal]): DeriveStakerSlashes => ({
era,
total: optVal.isSome
? optVal.unwrap()[1]
: optNom.unwrapOrDefault()
}))
api.derive.staking._ownSlashes(accountId, eras, withActive)
)
);
});
+80 -59
View File
@@ -3,7 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ApiInterfaceRx } from '@polkadot/api/types';
import { AccountId, Exposure, Keys, Nominations, RewardDestination, ValidatorPrefs } from '@polkadot/types/interfaces';
import { AccountId, EraIndex, Exposure, Keys, Nominations, RewardDestination, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces';
import { ITuple } from '@polkadot/types/types';
import { DeriveStakingQuery } from '../types';
@@ -16,7 +16,7 @@ import { memo } from '../util';
type MultiResult = [Option<AccountId>, Option<ITuple<[Nominations]> | Nominations>, RewardDestination, ITuple<[ValidatorPrefs]> | ValidatorPrefs, Option<Keys>, Exposure];
function unwrapSessionIds (stashId: AccountId, queuedKeys: [AccountId, Keys][], nextKeys: Option<Keys>): { nextSessionIds: AccountId[]; sessionIds: AccountId[] } {
function parseSessionIds (stashId: AccountId, queuedKeys: [AccountId, Keys][], nextKeys: Option<Keys>): { nextSessionIds: AccountId[]; sessionIds: AccountId[] } {
const sessionIds = (queuedKeys.find(([currentId]): boolean =>
currentId.eq(stashId)
) || [undefined, [] as AccountId[]])[1];
@@ -28,6 +28,31 @@ function unwrapSessionIds (stashId: AccountId, queuedKeys: [AccountId, Keys][],
};
}
function parseController (stashId: AccountId, queuedKeys: Vec<ITuple<[AccountId, Keys]>>, [controllerIdOpt, nominatorsOpt, rewardDestination, validatorPrefs, nextKeys, exposure]: MultiResult, stakingLedgerOpt: Option<StakingLedger>): DeriveStakingQuery {
const controllerId = controllerIdOpt.unwrapOr(null);
const nominators = nominatorsOpt.unwrapOr(null);
return controllerId && stakingLedgerOpt.isSome
? {
accountId: stashId,
controllerId,
exposure,
nominators: nominators
? Array.isArray(nominators)
? nominators[0].targets
: nominators.targets
: [],
rewardDestination,
stakingLedger: stakingLedgerOpt.unwrapOr(undefined),
stashId,
validatorPrefs: Array.isArray(validatorPrefs)
? validatorPrefs[0]
: validatorPrefs,
...parseSessionIds(stashId, queuedKeys, nextKeys)
}
: { accountId: stashId, nextSessionIds: [], sessionIds: [] };
}
function retrievePrev (api: ApiInterfaceRx, stashId: AccountId): Observable<MultiResult> {
return api.queryMulti<MultiResult>([
[api.query.staking.bonded, stashId],
@@ -39,64 +64,43 @@ function retrievePrev (api: ApiInterfaceRx, stashId: AccountId): Observable<Mult
]);
}
function retrieveCurr (api: ApiInterfaceRx, stashId: AccountId): Observable<MultiResult> {
return api.derive.session.indexes().pipe(
switchMap(({ activeEra }) =>
api.queryMulti<MultiResult>([
[api.query.staking.bonded, stashId],
[api.query.staking.nominators, stashId],
[api.query.staking.payee, stashId],
[api.query.staking.validators, stashId],
api.consts.session?.dedupKeyPrefix
? [api.query.session.nextKeys, [api.consts.session.dedupKeyPrefix, stashId]]
: [api.query.session.nextKeys, stashId],
[api.query.staking.erasStakers, [activeEra, stashId]]
])
function retrieveCurr (api: ApiInterfaceRx, stashIds: AccountId[], activeEra: EraIndex): Observable<MultiResult[]> {
return combineLatest([
api.query.staking.bonded.multi<Option<AccountId>>(stashIds),
api.query.staking.nominators.multi<Option<Nominations>>(stashIds),
api.query.staking.payee.multi<RewardDestination>(stashIds),
api.query.staking.validators.multi<ValidatorPrefs>(stashIds),
api.consts.session?.dedupKeyPrefix
? api.query.session.nextKeys.multi<Option<Keys>>(stashIds.map((stashId) => [api.consts.session.dedupKeyPrefix, stashId]))
: api.query.session.nextKeys.multi<Option<Keys>>(stashIds),
api.query.staking.erasStakers.multi<Exposure>(stashIds.map((stashId) => [activeEra, stashId]))
]).pipe(
map(([controllerIdOpt, nominatorsOpt, rewardDestination, validatorPrefs, nextKeys, exposure]): MultiResult[] =>
controllerIdOpt.map((controllerIdOpt, index): MultiResult =>
[controllerIdOpt, nominatorsOpt[index], rewardDestination[index], validatorPrefs[index], nextKeys[index], exposure[index]]
)
)
);
}
function retrieveController (api: ApiInterfaceRx, stashId: AccountId, queuedKeys: Vec<ITuple<[AccountId, Keys]>>, [controllerIdOpt, nominatorsOpt, rewardDestination, validatorPrefs, nextKeys, exposure]: MultiResult): Observable<DeriveStakingQuery> {
const controllerId = controllerIdOpt.unwrapOr(null);
const nominators = nominatorsOpt.unwrapOr(null);
function retrieveControllers (api: ApiInterfaceRx, optControllerIds: Option<AccountId>[]): Observable<Option<StakingLedger>[]> {
const ids = optControllerIds.filter((opt) => opt.isSome).map((opt) => opt.unwrap());
return controllerId
? api.query.staking.ledger(controllerId).pipe(
map((stakingLedgerOpt): DeriveStakingQuery => ({
accountId: stashId,
controllerId,
exposure,
nominators: nominators
? Array.isArray(nominators)
? nominators[0].targets
: nominators.targets
: [],
rewardDestination,
stakingLedger: stakingLedgerOpt.unwrapOr(undefined),
stashId,
validatorPrefs: Array.isArray(validatorPrefs)
? validatorPrefs[0]
: validatorPrefs,
...unwrapSessionIds(stashId, queuedKeys, nextKeys)
}))
)
: of({ accountId: stashId, nextSessionIds: [], sessionIds: [] });
}
if (!ids.length) {
return of(optControllerIds.map(() => api.registry.createType('Option<StakingLedger>')));
}
export function queryWithQueued (api: ApiInterfaceRx): (accountId: Uint8Array | string, queuedKeys: Vec<ITuple<[AccountId, Keys]>>) => Observable<DeriveStakingQuery> {
return memo((accountId: Uint8Array | string, queuedKeys: Vec<ITuple<[AccountId, Keys]>>): Observable<DeriveStakingQuery> => {
const stashId = api.registry.createType('AccountId', accountId);
return api.query.staking.ledger.multi<Option<StakingLedger>>(ids).pipe(
map((optLedgers): Option<StakingLedger>[] => {
let offset = -1;
return (
isFunction(api.query.staking.erasStakers)
? retrieveCurr(api, stashId)
: retrievePrev(api, stashId)
).pipe(
switchMap((result): Observable<DeriveStakingQuery> =>
retrieveController(api, stashId, queuedKeys, result)
)
);
});
return optControllerIds.map((opt): Option<StakingLedger> =>
opt.isSome
? optLedgers[++offset]
: api.registry.createType('Option<StakingLedger>')
);
})
);
}
/**
@@ -104,8 +108,8 @@ export function queryWithQueued (api: ApiInterfaceRx): (accountId: Uint8Array |
*/
export function query (api: ApiInterfaceRx): (accountId: Uint8Array | string) => Observable<DeriveStakingQuery> {
return memo((accountId: Uint8Array | string): Observable<DeriveStakingQuery> =>
api.query.session.queuedKeys<Vec<ITuple<[AccountId, Keys]>>>().pipe(
switchMap((queuedKeys) => api.derive.staking.queryWithQueued(accountId, queuedKeys))
api.derive.staking.queryMulti([accountId]).pipe(
map(([first]) => first)
)
);
}
@@ -113,10 +117,27 @@ export function query (api: ApiInterfaceRx): (accountId: Uint8Array | string) =>
export function queryMulti (api: ApiInterfaceRx): (accountIds: (Uint8Array | string)[]) => Observable<DeriveStakingQuery[]> {
return memo((accountIds: (Uint8Array | string)[]): Observable<DeriveStakingQuery[]> =>
accountIds.length
? api.query.session.queuedKeys<Vec<ITuple<[AccountId, Keys]>>>().pipe(
switchMap((queuedKeys) => combineLatest(
accountIds.map((acc) => api.derive.staking.queryWithQueued(acc, queuedKeys))
))
? combineLatest([
api.query.session.queuedKeys<Vec<ITuple<[AccountId, Keys]>>>(),
api.derive.session.indexes()
]).pipe(
switchMap(([queuedKeys, { activeEra }]): Observable<DeriveStakingQuery[]> => {
const stashIds = accountIds.map((accountId) => api.registry.createType('AccountId', accountId));
return (
isFunction(api.query.staking.erasStakers)
? retrieveCurr(api, stashIds, activeEra)
: combineLatest(stashIds.map((stashId) => retrievePrev(api, stashId)))
).pipe(
switchMap((results): Observable<DeriveStakingQuery[]> =>
retrieveControllers(api, results.map(([optController]) => optController)).pipe(
map((stakingLedgerOpts) =>
stashIds.map((stashId, index) => parseController(stashId, queuedKeys, results[index], stakingLedgerOpts[index]))
)
)
)
);
})
)
: of([])
);
@@ -32,25 +32,27 @@ function parseRewards (api: ApiInterfaceRx, stashId: AccountId, [, erasPoints, e
Object.entries(eraValidators).forEach(([validatorId, exposure]): void => {
const valPoints = allValPoints[validatorId] || ZERO;
const valComm = allValPrefs[validatorId]?.commission.unwrap() || ZERO;
const avail = eraReward.mul(valPoints).div(eraPoints);
const valCut = valComm.mul(avail).div(COMM_DIV);
const expTotal = exposure.total.unwrap();
let avail = ZERO;
let value: BN | undefined;
if (!expTotal.isZero() && !valPoints.isZero()) {
if (!(expTotal.isZero() || valPoints.isZero() || eraPoints.isZero())) {
avail = eraReward.mul(valPoints).div(eraPoints);
const valCut = valComm.mul(avail).div(COMM_DIV);
let staked: BN;
if (validatorId === stakerId) {
staked = exposure.own.unwrap();
} else {
const stakerExp = exposure.others.find(({ who }): boolean => who.eq(stakerId));
const stakerExp = exposure.others.find(({ who }) => who.eq(stakerId));
staked = stakerExp
? stakerExp.value.unwrap()
: ZERO;
}
value = avail.sub(valCut).mul(staked).div(expTotal).add(validatorId === stakerId ? valCut : ZERO);
value = avail.sub(valCut).imul(staked).div(expTotal).iadd(validatorId === stakerId ? valCut : ZERO);
}
validators[validatorId] = {
+5
View File
@@ -96,6 +96,11 @@ export interface DeriveStakingElected {
info: DeriveStakingQuery[];
}
export interface DeriveStakingWaiting {
info: DeriveStakingQuery[];
waiting: AccountId[];
}
export interface DeriveStakingValidators {
nextElected: AccountId[];
validators: AccountId[];
@@ -18,9 +18,7 @@ export function nextElected (api: ApiInterfaceRx): () => Observable<AccountId[]>
// only populate for next era in the last session, so track both here - entries are not
// subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh
switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)),
map((keys): AccountId[] =>
keys.map((key): AccountId => key.args[1] as AccountId)
)
map((keys) => keys.map((key) => key.args[1] as AccountId))
)
: api.query.staking.currentElected<AccountId[]>()
);
@@ -0,0 +1,32 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { ApiInterfaceRx } from '@polkadot/api/types';
import { DeriveStakingWaiting } from '../types';
import { Observable, combineLatest } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { memo } from '../util';
export function waitingInfo (api: ApiInterfaceRx): () => Observable<DeriveStakingWaiting> {
return memo((): Observable<DeriveStakingWaiting> =>
combineLatest([
api.derive.staking.validators(),
api.derive.staking.stashes()
]).pipe(
switchMap(([{ nextElected }, stashes]): Observable<DeriveStakingWaiting> => {
const elected = nextElected.map((a) => a.toString());
const waiting = stashes.filter((v) => !elected.includes(v.toString()));
return api.derive.staking.queryMulti(waiting).pipe(
map((info): DeriveStakingWaiting => ({
info,
waiting
}))
);
})
)
);
}
+3 -3
View File
@@ -20,7 +20,7 @@ interface Result {
function latestNonce (api: ApiInterfaceRx, address: string): Observable<Index> {
return api.derive.balances.account(address).pipe(
map(({ accountNonce }): Index => accountNonce)
map(({ accountNonce }) => accountNonce)
);
}
@@ -31,7 +31,7 @@ function signingHeader (api: ApiInterfaceRx): Observable<Header> {
switchMap((hash) => api.rpc.chain.getHeader(hash))
)
]).pipe(
map(([current, finalized]): Header =>
map(([current, finalized]) =>
// determine the hash to use, current when lag > max, else finalized
current.number.unwrap().sub(finalized.number.unwrap()).gt(MAX_FINALITY_LAG)
? current
@@ -57,7 +57,7 @@ export function signingInfo (api: ApiInterfaceRx): (address: string, nonce?: Any
header,
mortalLength: MORTAL_PERIOD
.div(api.consts.babe?.expectedBlockTime || api.consts.timestamp?.minimumPeriod.muln(2) || FALLBACK_PERIOD)
.add(MAX_FINALITY_LAG)
.iadd(MAX_FINALITY_LAG)
.toNumber(),
nonce
}))
+1
View File
@@ -42,6 +42,7 @@ export interface DeriveContractFees {
creationFee: BN;
rentByteFee: BN;
rentDepositOffset: BN;
surchargeReward: BN;
tombstoneDeposit: BN;
transactionBaseFee: BN;
transactionByteFee: BN;
+9 -9
View File
@@ -3,15 +3,11 @@
// of the Apache-2.0 license. See the LICENSE file for details.v
import createMemo from 'memoizee';
import { Observable, Observer } from 'rxjs';
import { Observable, Observer, TeardownLogic } from 'rxjs';
import { drr } from '@polkadot/rpc-core/rxjs';
type ObsFn <T> = (...params: any[]) => Observable<T>;
// Normalize via JSON.stringify, allow e.g. AccountId -> ss58
// eslint-disable-next-line @typescript-eslint/unbound-method
const normalizer = JSON.stringify;
// Wraps a derive, doing 2 things to optimize calls -
// 1. creates a memo of the inner fn -> Observable, removing when unsubscribed
// 2. wraps the observable in a drr() (which includes an unsub delay)
@@ -19,15 +15,19 @@ const normalizer = JSON.stringify;
export function memo <T> (inner: ObsFn<T>): ObsFn<T> {
const cached = createMemo(
(...params: any[]): Observable<T> =>
new Observable((observer: Observer<T>): VoidCallback => {
const sub = inner(...params).subscribe(observer);
new Observable((observer: Observer<T>): TeardownLogic => {
const subscription = inner(...params).subscribe(observer);
return (): void => {
cached.delete(...params);
sub.unsubscribe();
subscription.unsubscribe();
};
}).pipe(drr()),
{ normalizer }
{
// Normalize via JSON.stringify, allow e.g. AccountId -> ss58
// eslint-disable-next-line @typescript-eslint/unbound-method
normalizer: JSON.stringify
}
);
return cached;
+12 -12
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "1.16.1",
"version": "1.21.1",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
"keywords": [
@@ -26,21 +26,21 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/api-derive": "1.16.1",
"@polkadot/keyring": "^2.11.1",
"@polkadot/metadata": "1.16.1",
"@polkadot/rpc-core": "1.16.1",
"@polkadot/rpc-provider": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/types-known": "1.16.1",
"@polkadot/util": "^2.11.1",
"@polkadot/util-crypto": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/api-derive": "1.21.1",
"@polkadot/keyring": "^2.15.1",
"@polkadot/metadata": "1.21.1",
"@polkadot/rpc-core": "1.21.1",
"@polkadot/rpc-provider": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/types-known": "1.21.1",
"@polkadot/util": "^2.15.1",
"@polkadot/util-crypto": "^2.15.1",
"bn.js": "^5.1.2",
"eventemitter3": "^4.0.4",
"rxjs": "^6.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1"
"@polkadot/keyring": "^2.15.1"
}
}
+77 -4
View File
@@ -3,8 +3,8 @@
import { Codec } from '@polkadot/types/types';
import { Vec } from '@polkadot/types/codec';
import { u32, u64 } from '@polkadot/types/primitive';
import { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import { u16, u32, u64 } from '@polkadot/types/primitive';
import { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import { SessionIndex } from '@polkadot/types/interfaces/session';
import { EraIndex } from '@polkadot/types/interfaces/staking';
import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
@@ -68,8 +68,12 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
**/
signedClaimHandicap: AugmentedConst<BlockNumber>;
/**
* Size of a contract at the time of instantiation. This is a simple way to ensure that
* empty contracts eventually gets deleted.
* A size offset for an contract. A just created account with untouched storage will have that
* much of storage from the perspective of the state rent.
*
* This is a simple way to ensure that contracts with empty storage eventually get deleted
* by making them pay rent. This creates an incentive to remove them early in order to save
* rent.
**/
storageSizeOffset: AugmentedConst<u32>;
/**
@@ -172,6 +176,40 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
**/
subAccountDeposit: AugmentedConst<BalanceOf>;
};
proxy: {
[index: string]: AugmentedConst<object & Codec>;
/**
* The maximum amount of proxies allowed for a single account.
**/
maxProxies: AugmentedConst<u16>;
/**
* The base amount of currency needed to reserve for creating a proxy.
**/
proxyDepositBase: AugmentedConst<BalanceOf>;
/**
* The amount of currency needed per proxy added.
**/
proxyDepositFactor: AugmentedConst<BalanceOf>;
};
recovery: {
[index: string]: AugmentedConst<object & Codec>;
/**
* The base amount of currency needed to reserve for creating a recovery configuration.
**/
configDepositBase: AugmentedConst<BalanceOf>;
/**
* The amount of currency needed per additional user when creating a recovery configuration.
**/
friendDepositFactor: AugmentedConst<BalanceOf>;
/**
* The maximum amount of friends allowed in a recovery configuration.
**/
maxFriends: AugmentedConst<u16>;
/**
* The base amount of currency needed to reserve for starting a recovery.
**/
recoveryDeposit: AugmentedConst<BalanceOf>;
};
society: {
[index: string]: AugmentedConst<object & Codec>;
/**
@@ -211,10 +249,45 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: AugmentedConst<EraIndex>;
/**
* The number of blocks before the end of the era from which election submissions are allowed.
*
* Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
* be used.
*
* This is bounded by being within the last session. Hence, setting it to a value more than the
* length of a session will be pointless.
**/
electionLookahead: AugmentedConst<BlockNumber>;
/**
* Maximum number of balancing iterations to run in the offchain submission.
*
* If set to 0, balance_solution will not be executed at all.
**/
maxIterations: AugmentedConst<u32>;
/**
* The maximum number of nominators rewarded for each validator.
*
* For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
* their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: AugmentedConst<u32>;
/**
* The threshold of improvement that should be provided for a new solution to be accepted.
**/
minSolutionScoreBump: AugmentedConst<Perbill>;
/**
* Number of sessions per era.
**/
sessionsPerEra: AugmentedConst<SessionIndex>;
/**
* Number of eras that slashes are deferred by, after computation.
*
* This should be less than the bonding duration.
* Set to 0 if slashes should be applied immediately, without opportunity for
* intervention.
**/
slashDeferDuration: AugmentedConst<EraIndex>;
};
system: {
[index: string]: AugmentedConst<object & Codec>;
+29 -33
View File
@@ -6,22 +6,22 @@ import { Option, U8aFixed, Vec } from '@polkadot/types/codec';
import { Bytes, Data, bool, u32, u64 } from '@polkadot/types/primitive';
import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
import { AccountData, BalanceLock, ReleasesBalances } from '@polkadot/types/interfaces/balances';
import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
import { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective';
import { AuthorityId } from '@polkadot/types/interfaces/consensus';
import { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
import { PreimageStatus, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReleasesDemocracy, Voting } from '@polkadot/types/interfaces/democracy';
import { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy';
import { VoteThreshold } from '@polkadot/types/interfaces/elections';
import { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity';
import { AuthIndex } from '@polkadot/types/interfaces/imOnline';
import { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences';
import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import { AccountId, AccountIndex, Balance, BalanceOf, BlockNumber, ExtrinsicsWeight, Hash, KeyTypeId, Moment, Perbill, ValidatorId } from '@polkadot/types/interfaces/runtime';
import { AccountId, AccountIndex, Balance, BalanceOf, BlockNumber, ExtrinsicsWeight, Hash, KeyTypeId, Moment, Perbill, ProxyType, Releases, ValidatorId } from '@polkadot/types/interfaces/runtime';
import { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import { Keys, SessionIndex } from '@polkadot/types/interfaces/session';
import { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import { ActiveEraInfo, ElectionResult, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, PhragmenScore, ReleasesStaking, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import { AccountInfo, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system';
import { OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import { Multiplier } from '@polkadot/types/interfaces/txpayment';
@@ -121,9 +121,6 @@ declare module '@polkadot/api/types/storage' {
/**
* The balance of an account.
*
* NOTE: THIS MAY NEVER BE IN EXISTENCE AND YET HAVE A `total().is_zero()`. If the total
* is ever zero, then the entry *MUST* be removed.
*
* NOTE: This is only used in the case that this module is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountData>> & QueryableStorageEntry<ApiType>;
@@ -137,7 +134,7 @@ declare module '@polkadot/api/types/storage' {
*
* This is set to v2.0.0 for new networks.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<ReleasesBalances>> & QueryableStorageEntry<ApiType>;
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>> & QueryableStorageEntry<ApiType>;
/**
* The total units issued in the system.
**/
@@ -242,13 +239,6 @@ declare module '@polkadot/api/types/storage' {
* The block number is the block at which it was deposited.
**/
preimages: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<PreimageStatus>>> & QueryableStorageEntry<ApiType>;
/**
* Who is able to vote for whom. Value is the fund-holding account, key is the
* vote-transaction-sending account.
*
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
**/
proxy: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<ProxyState>>> & QueryableStorageEntry<ApiType>;
/**
* The number of (public) proposals that have been made so far.
**/
@@ -272,7 +262,7 @@ declare module '@polkadot/api/types/storage' {
*
* New networks start with last version.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<Option<ReleasesDemocracy>>> & QueryableStorageEntry<ApiType>;
storageVersion: AugmentedQuery<ApiType, () => Observable<Option<Releases>>> & QueryableStorageEntry<ApiType>;
/**
* All votes for a particular voter. We store the balance for the number of votes that we
* have recorded. The second item is the total amount of delegations, that will be added.
@@ -398,7 +388,15 @@ declare module '@polkadot/api/types/storage' {
/**
* The lookup from index to account.
**/
accounts: AugmentedQuery<ApiType, (arg: AccountIndex | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId, BalanceOf]>>>> & QueryableStorageEntry<ApiType>;
accounts: AugmentedQuery<ApiType, (arg: AccountIndex | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId, BalanceOf, bool]>>>> & QueryableStorageEntry<ApiType>;
};
multisig: {
[index: string]: QueryableStorageEntry<ApiType>;
calls: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Option<ITuple<[Bytes, AccountId, BalanceOf]>>>> & QueryableStorageEntry<ApiType>;
/**
* The set of open multisig operations.
**/
multisigs: AugmentedQueryDoubleMap<ApiType, (key1: AccountId | string | Uint8Array, key2: U8aFixed | string | Uint8Array) => Observable<Option<Multisig>>> & QueryableStorageEntry<ApiType>;
};
offences: {
[index: string]: QueryableStorageEntry<ApiType>;
@@ -425,6 +423,14 @@ declare module '@polkadot/api/types/storage' {
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: Kind | string | Uint8Array) => Observable<Bytes>> & QueryableStorageEntry<ApiType>;
};
proxy: {
[index: string]: QueryableStorageEntry<ApiType>;
/**
* The set of account proxies. Maps the account which has delegated to the accounts
* which are being delegated to, together with the amount held on deposit.
**/
proxies: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<ITuple<[Vec<ITuple<[AccountId, ProxyType]>>, BalanceOf]>>> & QueryableStorageEntry<ApiType>;
};
randomnessCollectiveFlip: {
[index: string]: QueryableStorageEntry<ApiType>;
/**
@@ -669,9 +675,9 @@ declare module '@polkadot/api/types/storage' {
*
* Information is kept for eras in `[current_era - history_depth; current_era]`.
*
* Must be more than the number of eras delayed by session otherwise.
* I.e. active era must always be in history.
* I.e. `active_era > current_era - history_depth` must be guaranteed.
* Must be more than the number of eras delayed by session otherwise. I.e. active era must
* always be in history. I.e. `active_era > current_era - history_depth` must be
* guaranteed.
**/
historyDepth: AugmentedQuery<ApiType, () => Observable<u32>> & QueryableStorageEntry<ApiType>;
/**
@@ -689,10 +695,6 @@ declare module '@polkadot/api/types/storage' {
* Map from all (unlocked) "controller" accounts to the info regarding the staking.
**/
ledger: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<StakingLedger>>> & QueryableStorageEntry<ApiType>;
/**
* The era where we migrated from Lazy Payouts to Simple Payouts
**/
migrateEra: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>> & QueryableStorageEntry<ApiType>;
/**
* Minimum number of staking participants before emergency conditions are imposed.
**/
@@ -718,7 +720,7 @@ declare module '@polkadot/api/types/storage' {
/**
* The score of the current [`QueuedElected`].
**/
queuedScore: AugmentedQuery<ApiType, () => Observable<Option<PhragmenScore>>> & QueryableStorageEntry<ApiType>;
queuedScore: AugmentedQuery<ApiType, () => Observable<Option<ElectionScore>>> & QueryableStorageEntry<ApiType>;
/**
* Slashing spans for stash accounts.
**/
@@ -750,7 +752,7 @@ declare module '@polkadot/api/types/storage' {
*
* This is set to v3.0.0 for new networks.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<ReleasesStaking>> & QueryableStorageEntry<ApiType>;
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>> & QueryableStorageEntry<ApiType>;
/**
* All unapplied slashes that are queued for later.
**/
@@ -901,6 +903,7 @@ declare module '@polkadot/api/types/storage' {
transactionPayment: {
[index: string]: QueryableStorageEntry<ApiType>;
nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<Multiplier>> & QueryableStorageEntry<ApiType>;
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>> & QueryableStorageEntry<ApiType>;
};
treasury: {
[index: string]: QueryableStorageEntry<ApiType>;
@@ -928,13 +931,6 @@ declare module '@polkadot/api/types/storage' {
**/
tips: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Option<OpenTip>>> & QueryableStorageEntry<ApiType>;
};
utility: {
[index: string]: QueryableStorageEntry<ApiType>;
/**
* The set of open multisig operations.
**/
multisigs: AugmentedQueryDoubleMap<ApiType, (key1: AccountId | string | Uint8Array, key2: U8aFixed | string | Uint8Array) => Observable<Option<Multisig>>> & QueryableStorageEntry<ApiType>;
};
vesting: {
[index: string]: QueryableStorageEntry<ApiType>;
/**
+9 -7
View File
@@ -19,16 +19,10 @@ import { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import { RpcMethods } from '@polkadot/types/interfaces/rpc';
import { AccountId, BlockNumber, H256, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
import { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state';
import { ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo } from '@polkadot/types/interfaces/system';
import { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo } from '@polkadot/types/interfaces/system';
declare module '@polkadot/rpc-core/types.jsonrpc' {
export interface RpcInterface {
account: {
/**
* Retrieves the next accountIndex as available on the node
**/
nextIndex: AugmentedRpc<(accountId: AccountId | string | Uint8Array) => Observable<Index>>;
};
author: {
/**
* Returns true if the keystore has private keys for the given public key and key type.
@@ -244,6 +238,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;
};
system: {
/**
* Retrieves the next accountIndex as available on the node
**/
accountNextIndex: AugmentedRpc<(accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Adds a reserved peer
**/
@@ -256,6 +254,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
* Retrieves the chain type
**/
chainType: AugmentedRpc<() => Observable<ChainType>>;
/**
* Dry run an extrinsic at a given block
**/
dryRun: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
/**
* Return health status of the node
**/
+414 -346
View File
@@ -9,14 +9,14 @@ import { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts';
import { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
import { DefunctVoter, Renouncing } from '@polkadot/types/interfaces/elections';
import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
import { EquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
import { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity';
import { Heartbeat } from '@polkadot/types/interfaces/imOnline';
import { AccountId, AccountIndex, Address, Balance, BalanceOf, BlockNumber, Call, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, Perbill, Weight } from '@polkadot/types/interfaces/runtime';
import { AccountId, AccountIndex, Address, Balance, BalanceOf, BlockNumber, Call, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, Perbill, Percent, ProxyType, Weight } from '@polkadot/types/interfaces/runtime';
import { Period, Priority } from '@polkadot/types/interfaces/scheduler';
import { Keys } from '@polkadot/types/interfaces/session';
import { SocietyJudgement } from '@polkadot/types/interfaces/society';
import { CompactAssignments, ElectionSize, EraIndex, PhragmenScore, RewardDestination, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RewardDestination, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import { Key } from '@polkadot/types/interfaces/system';
import { Timepoint } from '@polkadot/types/interfaces/utility';
import { VestingInfo } from '@polkadot/types/interfaces/vesting';
@@ -184,7 +184,24 @@ declare module '@polkadot/api/types/submittable' {
* - up to 3 events
* # </weight>
**/
close: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact<ProposalIndex> | AnyNumber | Uint8Array, proposalWeightBound: Compact<Weight> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact<ProposalIndex> | AnyNumber | Uint8Array, proposalWeightBound: Compact<Weight> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current state.
*
* Must be called by the Root origin.
*
* Parameters:
* * `proposal_hash`: The hash of the proposal that should be disapproved.
*
* # <weight>
* Complexity: O(P) where P is the number of max proposals
* Base Weight: .49 * P
* DB Weight:
* * Reads: Proposals
* * Writes: Voting, Proposals, ProposalOf
* # </weight>
**/
disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Dispatch a proposal from a member using the `Member` origin.
*
@@ -273,23 +290,6 @@ declare module '@polkadot/api/types/submittable' {
};
democracy: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Specify a proxy that is already open to us. Called by the stash.
*
* NOTE: Used to be called `set_proxy`.
*
* The dispatch origin of this call must be _Signed_.
*
* - `proxy`: The account that will be activated as proxy.
*
* # <weight>
* - Complexity: `O(1)`
* - Db reads: `Proxy`
* - Db writes: `Proxy`
* - Base Weight: 7.972 µs
* # </weight>
**/
activateProxy: AugmentedSubmittable<(proxy: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Cancel a proposal queued for enactment.
*
@@ -331,40 +331,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
clearPublicProposals: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
/**
* Clear the proxy. Called by the proxy.
*
* NOTE: Used to be called `resign_proxy`.
*
* The dispatch origin of this call must be _Signed_.
*
* # <weight>
* - Complexity: `O(1)`
* - Db reads: `Proxy`, `sender account`
* - Db writes: `Proxy`, `sender account`
* - Base Weight: 15.41 µs
* # </weight>
**/
closeProxy: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
/**
* Deactivate the proxy, but leave open to this account. Called by the stash.
*
* The proxy must already be active.
*
* NOTE: Used to be called `remove_proxy`.
*
* The dispatch origin of this call must be _Signed_.
*
* - `proxy`: The account that will be deactivated as proxy.
*
* # <weight>
* - Complexity: `O(1)`
* - Db reads: `Proxy`
* - Db writes: `Proxy`
* - Base Weight: 8.03 µs
* # </weight>
**/
deactivateProxy: AugmentedSubmittable<(proxy: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Delegate the voting power (with some given conviction) of the sending account.
*
@@ -530,25 +496,6 @@ declare module '@polkadot/api/types/submittable' {
* Same as `note_preimage` but origin is `OperationalPreimageOrigin`.
**/
notePreimageOperational: AugmentedSubmittable<(encodedProposal: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Become a proxy.
*
* This must be called prior to a later `activate_proxy`.
*
* Origin must be a Signed.
*
* - `target`: The account whose votes will later be proxied.
*
* `close_proxy` must be called before the account can be destroyed.
*
* # <weight>
* - Complexity: O(1)
* - Db reads: `Proxy`, `proxy account`
* - Db writes: `Proxy`, `proxy account`
* - Base Weight: 14.86 µs
* # </weight>
**/
openProxy: AugmentedSubmittable<(target: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Propose a sensitive action to be taken.
*
@@ -569,95 +516,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
propose: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Delegate the voting power (with some given conviction) of a proxied account.
*
* The balance delegated is locked for as long as it's delegated, and thereafter for the
* time appropriate for the conviction's lock period.
*
* The dispatch origin of this call must be _Signed_, and the signing account must have
* been set as the proxy account for `target`.
*
* - `target`: The account whole voting power shall be delegated and whose balance locked.
* This account must either:
* - be delegating already; or
* - have no voting activity (if there is, then it will need to be removed/consolidated
* through `reap_vote` or `unvote`).
* - `to`: The account whose voting the `target` account's voting power will follow.
* - `conviction`: The conviction that will be attached to the delegated votes. When the
* account is undelegated, the funds will be locked for the corresponding period.
* - `balance`: The amount of the account's balance to be used in delegating. This must
* not be more than the account's current balance.
*
* Emits `Delegated`.
*
* # <weight>
* same as `delegate with additional:
* - Db reads: `Proxy`, `proxy account`
* - Db writes: `proxy account`
* - Base Weight: 68.61 + 8.039 * R µs
* # </weight>
**/
proxyDelegate: AugmentedSubmittable<(to: AccountId | string | Uint8Array, conviction: Conviction | 'None'|'Locked1x'|'Locked2x'|'Locked3x'|'Locked4x'|'Locked5x'|'Locked6x' | number | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Remove a proxied vote for a referendum.
*
* Exactly equivalent to `remove_vote` except that it operates on the account that the
* sender is a proxy for.
*
* The dispatch origin of this call must be _Signed_ and the signing account must be a
* proxy for some other account which has a registered vote for the referendum of `index`.
*
* - `index`: The index of referendum of the vote to be removed.
*
* # <weight>
* - `O(R + log R)` where R is the number of referenda that `target` has voted on.
* Weight is calculated for the maximum number of vote.
* - Db reads: `ReferendumInfoOf`, `VotingOf`, `Proxy`
* - Db writes: `ReferendumInfoOf`, `VotingOf`
* - Base Weight: 26.35 + .36 * R µs
* # </weight>
**/
proxyRemoveVote: AugmentedSubmittable<(index: ReferendumIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Undelegate the voting power of a proxied account.
*
* Tokens may be unlocked following once an amount of time consistent with the lock period
* of the conviction with which the delegation was issued.
*
* The dispatch origin of this call must be _Signed_ and the signing account must be a
* proxy for some other account which is currently delegating.
*
* Emits `Undelegated`.
*
* # <weight>
* same as `undelegate with additional:
* Db reads: `Proxy`
* Base Weight: 39 + 7.958 * R µs
* # </weight>
**/
proxyUndelegate: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
/**
* Vote in a referendum on behalf of a stash. If `vote.is_aye()`, the vote is to enact
* the proposal; otherwise it is a vote to keep the status quo.
*
* The dispatch origin of this call must be _Signed_.
*
* - `ref_index`: The index of the referendum to proxy vote for.
* - `vote`: The vote configuration.
*
* # <weight>
* - Complexity: `O(R)` where R is the number of referendums the proxy has voted on.
* weight is charged as if maximum votes.
* - Db reads: `ReferendumInfoOf`, `VotingOf`, `balances locks`, `Proxy`, `proxy account`
* - Db writes: `ReferendumInfoOf`, `VotingOf`, `balances locks`
* ------------
* - Base Weight:
* - Proxy Vote New: 54.35 + .344 * R µs
* - Proxy Vote Existing: 54.35 + .35 * R µs
* # </weight>
**/
proxyVote: AugmentedSubmittable<(refIndex: Compact<ReferendumIndex> | AnyNumber | Uint8Array, vote: AccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Remove an expired proposal preimage and collect the deposit.
*
@@ -844,7 +702,7 @@ declare module '@polkadot/api/types/submittable' {
* the outgoing member is slashed.
*
* If a runner-up is available, then the best runner-up will be removed and replaces the
* outgoing member. Otherwise, a new phragmen round is started.
* outgoing member. Otherwise, a new phragmen election is started.
*
* Note that this does not affect the designated block number of the next election.
*
@@ -1020,7 +878,7 @@ declare module '@polkadot/api/types/submittable' {
* submission of invalid equivocation reports, a mandatory pre-validation of
* the extrinsic is implemented in a `SignedExtension`.
**/
reportEquivocation: AugmentedSubmittable<(equivocationProof: EquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
reportEquivocation: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
identity: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
@@ -1280,6 +1138,9 @@ declare module '@polkadot/api/types/submittable' {
* - One storage mutation (codec `O(1)`).
* - One reserve operation.
* - One event.
* -------------------
* - Base Weight: 28.69 µs
* - DB Weight: 1 Read/Write (Accounts)
* # </weight>
**/
claim: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
@@ -1291,6 +1152,7 @@ declare module '@polkadot/api/types/submittable' {
*
* - `index`: the index to be (re-)assigned.
* - `new`: the new owner of the index. This function is a no-op if it is equal to sender.
* - `freeze`: if set to `true`, will freeze the index so it cannot be transferred.
*
* Emits `IndexAssigned` if successful.
*
@@ -1299,9 +1161,14 @@ declare module '@polkadot/api/types/submittable' {
* - One storage mutation (codec `O(1)`).
* - Up to one reserve operation.
* - One event.
* -------------------
* - Base Weight: 26.83 µs
* - DB Weight:
* - Reads: Indices Accounts, System Account (original owner)
* - Writes: Indices Accounts, System Account (original owner)
* # </weight>
**/
forceTransfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
forceTransfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array, freeze: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Free up an index owned by the sender.
*
@@ -1318,9 +1185,33 @@ declare module '@polkadot/api/types/submittable' {
* - One storage mutation (codec `O(1)`).
* - One reserve operation.
* - One event.
* -------------------
* - Base Weight: 25.53 µs
* - DB Weight: 1 Read/Write (Accounts)
* # </weight>
**/
free: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Freeze an index so it will always point to the sender account. This consumes the deposit.
*
* The dispatch origin for this call must be _Signed_ and the signing account must have a
* non-frozen account `index`.
*
* - `index`: the index to be frozen in place.
*
* Emits `IndexFrozen` if successful.
*
* # <weight>
* - `O(1)`.
* - One storage mutation (codec `O(1)`).
* - Up to one slash operation.
* - One event.
* -------------------
* - Base Weight: 30.86 µs
* - DB Weight: 1 Read/Write (Accounts)
* # </weight>
**/
freeze: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Assign an index already owned by the sender to another account. The balance reservation
* is effectively transferred to the new account.
@@ -1337,10 +1228,283 @@ declare module '@polkadot/api/types/submittable' {
* - One storage mutation (codec `O(1)`).
* - One transfer operation.
* - One event.
* -------------------
* - Base Weight: 33.74 µs
* - DB Weight:
* - Reads: Indices Accounts, System Account (recipient)
* - Writes: Indices Accounts, System Account (recipient)
* # </weight>
**/
transfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
multisig: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Register approval for a dispatch to be made from a deterministic composite account if
* approved by a total of `threshold - 1` of `other_signatories`.
*
* Payment: `DepositBase` will be reserved if this is the first approval, plus
* `threshold` times `DepositFactor`. It is returned once this dispatch happens or
* is cancelled.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is
* not the first approval, then it must be `Some`, with the timepoint (block number and
* transaction index) of the first approval transaction.
* - `call_hash`: The hash of the call to be executed.
*
* NOTE: If this is the final approval, you will want to use `as_multi` instead.
*
* # <weight>
* - `O(S)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One encode & hash, both of complexity `O(S)`.
* - Up to one binary search and insert (`O(logS + S)`).
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
* - One event.
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
* deposit taken for its lifetime of
* `DepositBase + threshold * DepositFactor`.
* ----------------------------------
* - Base Weight:
* - Create: 44.71 + 0.088 * S
* - Approve: 31.48 + 0.116 * S
* - DB Weight:
* - Read: Multisig Storage, [Caller Account]
* - Write: Multisig Storage, [Caller Account]
* # </weight>
**/
approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], maybeTimepoint: Option<Timepoint> | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Register approval for a dispatch to be made from a deterministic composite account if
* approved by a total of `threshold - 1` of `other_signatories`.
*
* If there are enough, then dispatch the call.
*
* Payment: `DepositBase` will be reserved if this is the first approval, plus
* `threshold` times `DepositFactor`. It is returned once this dispatch happens or
* is cancelled.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is
* not the first approval, then it must be `Some`, with the timepoint (block number and
* transaction index) of the first approval transaction.
* - `call`: The call to be executed.
*
* NOTE: Unless this is the final approval, you will generally want to use
* `approve_as_multi` instead, since it only requires a hash of the call.
*
* Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise
* on success, result is `Ok` and the result from the interior call, if it was executed,
* may be found in the deposited `MultisigExecuted` event.
*
* # <weight>
* - `O(S + Z + Call)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len.
* - One encode & hash, both of complexity `O(S)`.
* - Up to one binary search and insert (`O(logS + S)`).
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
* - One event.
* - The weight of the `call`.
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
* deposit taken for its lifetime of
* `DepositBase + threshold * DepositFactor`.
* -------------------------------
* - Base Weight:
* - Create: 41.89 + 0.118 * S + .002 * Z µs
* - Create w/ Store: 53.57 + 0.119 * S + .003 * Z µs
* - Approve: 31.39 + 0.136 * S + .002 * Z µs
* - Complete: 39.94 + 0.26 * S + .002 * Z µs
* - DB Weight:
* - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)
* - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)
* - Plus Call Weight
* # </weight>
**/
asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], maybeTimepoint: Option<Timepoint> | null | object | string | Uint8Array, call: Bytes | string | Uint8Array, storeCall: bool | boolean | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Immediately dispatch a multi-signature call using a single approval from the caller.
*
* The dispatch origin for this call must be _Signed_.
*
* - `other_signatories`: The accounts (other than the sender) who are part of the
* multi-signature, but do not participate in the approval process.
* - `call`: The call to be executed.
*
* Result is equivalent to the dispatched result.
*
* # <weight>
* O(Z + C) where Z is the length of the call and C its execution weight.
* -------------------------------
* - Base Weight: 33.72 + 0.002 * Z µs
* - DB Weight: None
* - Plus Call Weight
* # </weight>
**/
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
* for this operation will be unreserved on success.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `timepoint`: The timepoint (block number and transaction index) of the first approval
* transaction for this dispatch.
* - `call_hash`: The hash of the call to be executed.
*
* # <weight>
* - `O(S)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One encode & hash, both of complexity `O(S)`.
* - One event.
* - I/O: 1 read `O(S)`, one remove.
* - Storage: removes one item.
* ----------------------------------
* - Base Weight: 36.07 + 0.124 * S
* - DB Weight:
* - Read: Multisig Storage, [Caller Account], Refund Account, Calls
* - Write: Multisig Storage, [Caller Account], Refund Account, Calls
* # </weight>
**/
cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], timepoint: Timepoint | { height?: any; index?: any } | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
proxy: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Register a proxy account for the sender that is able to make calls on its behalf.
*
* The dispatch origin for this call must be _Signed_.
*
* Parameters:
* - `proxy`: The account that the `caller` would like to make a proxy.
* - `proxy_type`: The permissions allowed for this proxy account.
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 17.48 + .176 * P µs
* - DB weight: 1 storage read and write.
* # </weight>
**/
addProxy: AugmentedSubmittable<(proxy: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any'|'NonTransfer'|'Governance'|'Staking' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and
* initialize it with a proxy of `proxy_type` for `origin` sender.
*
* Requires a `Signed` origin.
*
* - `proxy_type`: The type of the proxy that the sender will be registered as over the
* new account. This will almost always be the most permissive `ProxyType` possible to
* allow for maximum flexibility.
* - `index`: A disambiguation index, in case this is called multiple times in the same
* transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just
* want to use `0`.
*
* Fails with `Duplicate` if this has already been called in this transaction, from the
* same sender, with the same parameters.
*
* Fails if there are insufficient funds to pay for deposit.
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 36.48 + .039 * P µs
* - DB weight: 1 storage read and write.
* # </weight>
**/
anonymous: AugmentedSubmittable<(proxyType: ProxyType | 'Any'|'NonTransfer'|'Governance'|'Staking' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Removes a previously spawned anonymous proxy.
*
* WARNING: **All access to this account will be lost.** Any funds held in it will be
* inaccessible.
*
* Requires a `Signed` origin, and the sender account must have been created by a call to
* `anonymous` with corresponding parameters.
*
* - `spawner`: The account that originally called `anonymous` to create this account.
* - `index`: The disambiguation index originally passed to `anonymous`. Probably `0`.
* - `proxy_type`: The proxy type originally passed to `anonymous`.
* - `height`: The height of the chain when the call to `anonymous` was processed.
* - `ext_index`: The extrinsic index in which the call to `anonymous` was processed.
*
* Fails with `NoPermission` in case the caller is not a previously created anonymous
* account whose `anonymous` call has corresponding parameters.
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 15.65 + .137 * P µs
* - DB weight: 1 storage read and write.
* # </weight>
**/
killAnonymous: AugmentedSubmittable<(spawner: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any'|'NonTransfer'|'Governance'|'Staking' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array, height: Compact<BlockNumber> | AnyNumber | Uint8Array, extIndex: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Dispatch the given `call` from an account that the sender is authorised for through
* `add_proxy`.
*
* The dispatch origin for this call must be _Signed_.
*
* Parameters:
* - `real`: The account that the proxy will make a call on behalf of.
* - `force_proxy_type`: Specify the exact proxy type to be used and checked for this call.
* - `call`: The call to be made by the `real` account.
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 19.87 + .141 * P µs
* - DB weight: 1 storage read.
* - Plus the weight of the `call`
* # </weight>
**/
proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option<ProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Unregister all proxy accounts for the sender.
*
* The dispatch origin for this call must be _Signed_.
*
* WARNING: This may be called on accounts created by `anonymous`, however if done, then
* the unreserved fees will be inaccessible. **All access to this account will be lost.**
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 13.73 + .129 * P µs
* - DB weight: 1 storage read and write.
* # </weight>
**/
removeProxies: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
/**
* Unregister a proxy account for the sender.
*
* The dispatch origin for this call must be _Signed_.
*
* Parameters:
* - `proxy`: The account that the `caller` would like to remove as a proxy.
* - `proxy_type`: The permissions currently enabled for the removed proxy account.
*
* # <weight>
* P is the number of proxies the user has
* - Base weight: 14.37 + .164 * P µs
* - DB weight: 1 storage read and write.
* # </weight>
**/
removeProxy: AugmentedSubmittable<(proxy: AccountId | string | Uint8Array, proxyType: ProxyType | 'Any'|'NonTransfer'|'Governance'|'Staking' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
recovery: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
@@ -2092,6 +2256,17 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
forceUnstake: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Increments the ideal number of validators.
*
* The dispatch origin must be Root.
*
* # <weight>
* Base Weight: 1.717 µs
* Read/Write: Validator Count
* # </weight>
**/
increaseValidatorCount: AugmentedSubmittable<(additional: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Declare the desire to nominate `targets` for the origin controller.
*
@@ -2114,39 +2289,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
nominate: AugmentedSubmittable<(targets: Vec<LookupSource> | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
/**
* **This extrinsic will be removed after `MigrationEra + HistoryDepth` has passed, giving
* opportunity for users to claim all rewards before moving to Simple Payouts. After this
* time, you should use `payout_stakers` instead.**
*
* Make one nominator's payout for one era.
*
* - `who` is the controller account of the nominator to pay out.
* - `era` may not be lower than one following the most recently paid era. If it is higher,
* then it indicates an instruction to skip the payout of all previous eras.
* - `validators` is the list of all validators that `who` had exposure to during `era`,
* alongside the index of `who` in the clipped exposure of the validator.
* I.e. each element is a tuple of
* `(validator, index of `who` in clipped exposure of validator)`.
* If it is incomplete, then less than the full reward will be paid out.
* It must not exceed `MAX_NOMINATIONS`.
*
* WARNING: once an era is payed for a validator such validator can't claim the payout of
* previous era.
*
* WARNING: Incorrect arguments here can result in loss of payout. Be very careful.
*
* # <weight>
* - Number of storage read of `O(validators)`; `validators` is the argument of the call,
* and is bounded by `MAX_NOMINATIONS`.
* - Each storage read is `O(N)` size and decode complexity; `N` is the maximum
* nominations that can be given to a single validator.
* - Computation complexity: `O(MAX_NOMINATIONS * logN)`; `MAX_NOMINATIONS` is the
* maximum number of validators that may be nominated by a single nominator, it is
* bounded only economically (all nominators are required to place a minimum stake).
* # </weight>
**/
payoutNominator: AugmentedSubmittable<(era: EraIndex | AnyNumber | Uint8Array, validators: Vec<ITuple<[AccountId, u32]>> | ([AccountId | string | Uint8Array, u32 | AnyNumber | Uint8Array])[]) => SubmittableExtrinsic<ApiType>>;
/**
* Pay out all the stakers behind a single validator for a single era.
*
@@ -2166,35 +2308,13 @@ declare module '@polkadot/api/types/submittable' {
* N is the Number of payouts for the validator (including the validator)
* Base Weight: 110 + 54.2 * N µs (Median Slopes)
* DB Weight:
* - Read: EraElectionStatus, CurrentEra, HistoryDepth, MigrateEra, ErasValidatorReward,
* - Read: EraElectionStatus, CurrentEra, HistoryDepth, ErasValidatorReward,
* ErasStakersClipped, ErasRewardPoints, ErasValidatorPrefs (8 items)
* - Read Each: Bonded, Ledger, Payee, Locks, System Account (5 items)
* - Write Each: System Account, Locks, Ledger (3 items)
* # </weight>
**/
payoutStakers: AugmentedSubmittable<(validatorStash: AccountId | string | Uint8Array, era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* **This extrinsic will be removed after `MigrationEra + HistoryDepth` has passed, giving
* opportunity for users to claim all rewards before moving to Simple Payouts. After this
* time, you should use `payout_stakers` instead.**
*
* Make one validator's payout for one era.
*
* - `who` is the controller account of the validator to pay out.
* - `era` may not be lower than one following the most recently paid era. If it is higher,
* then it indicates an instruction to skip the payout of all previous eras.
*
* WARNING: once an era is payed for a validator such validator can't claim the payout of
* previous era.
*
* WARNING: Incorrect arguments here can result in loss of payout. Be very careful.
*
* # <weight>
* - Time complexity: O(1).
* - Contains a limited number of reads and writes.
* # </weight>
**/
payoutValidator: AugmentedSubmittable<(era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Remove all data structure concerning a staker/stash once its balance is zero.
* This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone
@@ -2232,6 +2352,17 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
rebond: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Scale up the ideal number of validators by a factor.
*
* The dispatch origin must be Root.
*
* # <weight>
* Base Weight: 1.717 µs
* Read/Write: Validator Count
* # </weight>
**/
scaleValidatorCount: AugmentedSubmittable<(factor: Percent | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* (Re-)set the controller of a stash.
*
@@ -2318,7 +2449,7 @@ declare module '@polkadot/api/types/submittable' {
**/
setValidatorCount: AugmentedSubmittable<(updated: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Submit a phragmen result to the chain. If the solution:
* Submit an election result to the chain. If the solution:
*
* 1. is valid.
* 2. has a better score than a potentially existing solution on chain.
@@ -2331,7 +2462,7 @@ declare module '@polkadot/api/types/submittable' {
* 2. `assignments`: the compact version of an assignment vector that encodes the edge
* weights.
*
* Both of which may be computed using [`phragmen`], or any other algorithm.
* Both of which may be computed using _phragmen_, or any other algorithm.
*
* Additionally, the submitter must provide:
*
@@ -2366,7 +2497,7 @@ declare module '@polkadot/api/types/submittable' {
* See `crate::weight` module.
* # </weight>
**/
submitElectionSolution: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: PhragmenScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
submitElectionSolution: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Unsigned version of `submit_election_solution`.
*
@@ -2378,7 +2509,7 @@ declare module '@polkadot/api/types/submittable' {
* See `crate::weight` module.
* # </weight>
**/
submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: PhragmenScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Schedule a portion of the stash to be unlocked ready for transfer out after the bond
* period ends. If this leaves an amount actively bonded less than
@@ -2668,7 +2799,24 @@ declare module '@polkadot/api/types/submittable' {
* - up to 3 events
* # </weight>
**/
close: AugmentedSubmittable<(proposal: Hash | string | Uint8Array, index: Compact<ProposalIndex> | AnyNumber | Uint8Array, proposalWeightBound: Compact<Weight> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
close: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array, index: Compact<ProposalIndex> | AnyNumber | Uint8Array, proposalWeightBound: Compact<Weight> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current state.
*
* Must be called by the Root origin.
*
* Parameters:
* * `proposal_hash`: The hash of the proposal that should be disapproved.
*
* # <weight>
* Complexity: O(P) where P is the number of max proposals
* Base Weight: .49 * P
* DB Weight:
* * Reads: Proposals
* * Writes: Voting, Proposals, ProposalOf
* # </weight>
**/
disapproveProposal: AugmentedSubmittable<(proposalHash: Hash | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Dispatch a proposal from a member using the `Member` origin.
*
@@ -2981,103 +3129,30 @@ declare module '@polkadot/api/types/submittable' {
utility: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Register approval for a dispatch to be made from a deterministic composite account if
* approved by a total of `threshold - 1` of `other_signatories`.
* Send a call through an indexed pseudonym of the sender.
*
* Payment: `MultisigDepositBase` will be reserved if this is the first approval, plus
* `threshold` times `MultisigDepositFactor`. It is returned once this dispatch happens or
* is cancelled.
* Filter from origin are passed along. The call will be dispatched with an origin which
* use the same filter as the origin of this call.
*
* NOTE: If you need to ensure that any account-based filtering is not honored (i.e.
* because you expect `proxy` to have been used prior in the call stack and you do not want
* the call restrictions to apply to any sub-accounts), then use `as_sub` instead.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is
* not the first approval, then it must be `Some`, with the timepoint (block number and
* transaction index) of the first approval transaction.
* - `call_hash`: The hash of the call to be executed.
*
* NOTE: If this is the final approval, you will want to use `as_multi` instead.
*
* # <weight>
* - `O(S)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One encode & hash, both of complexity `O(S)`.
* - Up to one binary search and insert (`O(logS + S)`).
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
* - One event.
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
* deposit taken for its lifetime of
* `MultisigDepositBase + threshold * MultisigDepositFactor`.
* ----------------------------------
* - Base Weight:
* - Create: 44.71 + 0.088 * S
* - Approve: 31.48 + 0.116 * S
* - DB Weight:
* - Read: Multisig Storage, [Caller Account]
* - Write: Multisig Storage, [Caller Account]
* - Base weight: 2.861 µs
* - Plus the weight of the `call`
* # </weight>
**/
approveAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], maybeTimepoint: Option<Timepoint> | null | object | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Register approval for a dispatch to be made from a deterministic composite account if
* approved by a total of `threshold - 1` of `other_signatories`.
*
* If there are enough, then dispatch the call.
*
* Payment: `MultisigDepositBase` will be reserved if this is the first approval, plus
* `threshold` times `MultisigDepositFactor`. It is returned once this dispatch happens or
* is cancelled.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is
* not the first approval, then it must be `Some`, with the timepoint (block number and
* transaction index) of the first approval transaction.
* - `call`: The call to be executed.
*
* NOTE: Unless this is the final approval, you will generally want to use
* `approve_as_multi` instead, since it only requires a hash of the call.
*
* Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise
* on success, result is `Ok` and the result from the interior call, if it was executed,
* may be found in the deposited `MultisigExecuted` event.
*
* # <weight>
* - `O(S + Z + Call)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len.
* - One encode & hash, both of complexity `O(S)`.
* - Up to one binary search and insert (`O(logS + S)`).
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
* - One event.
* - The weight of the `call`.
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
* deposit taken for its lifetime of
* `MultisigDepositBase + threshold * MultisigDepositFactor`.
* -------------------------------
* - Base Weight:
* - Create: 46.55 + 0.089 * S µs
* - Approve: 34.03 + .112 * S µs
* - Complete: 40.36 + .225 * S µs
* - DB Weight:
* - Reads: Multisig Storage, [Caller Account]
* - Writes: Multisig Storage, [Caller Account]
* - Plus Call Weight
* # </weight>
**/
asMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], maybeTimepoint: Option<Timepoint> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
asLimitedSub: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Send a call through an indexed pseudonym of the sender.
*
* NOTE: If you need to ensure that any account-based filtering is honored (i.e. because
* you expect `proxy` to have been used prior in the call stack and you want it to apply to
* any sub-accounts), then use `as_limited_sub` instead.
*
* The dispatch origin for this call must be _Signed_.
*
* # <weight>
@@ -3089,12 +3164,13 @@ declare module '@polkadot/api/types/submittable' {
/**
* Send a batch of dispatch calls.
*
* This will execute until the first one fails and then stop.
*
* May be called from any origin.
*
* - `calls`: The calls to be dispatched from the same origin.
*
* If origin is root then call are dispatch without checking origin filter. (This includes
* bypassing `frame_system::Trait::BaseCallFilter`).
*
* # <weight>
* - Base weight: 14.39 + .987 * c µs
* - Plus the sum of the weights of the `calls`.
@@ -3108,39 +3184,31 @@ declare module '@polkadot/api/types/submittable' {
* event is deposited.
**/
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
/**
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
* for this operation will be unreserved on success.
*
* The dispatch origin for this call must be _Signed_.
*
* - `threshold`: The total number of approvals for this dispatch before it is executed.
* - `other_signatories`: The accounts (other than the sender) who can approve this
* dispatch. May not be empty.
* - `timepoint`: The timepoint (block number and transaction index) of the first approval
* transaction for this dispatch.
* - `call_hash`: The hash of the call to be executed.
*
* # <weight>
* - `O(S)`.
* - Up to one balance-reserve or unreserve operation.
* - One passthrough operation, one insert, both `O(S)` where `S` is the number of
* signatories. `S` is capped by `MaxSignatories`, with weight being proportional.
* - One encode & hash, both of complexity `O(S)`.
* - One event.
* - I/O: 1 read `O(S)`, one remove.
* - Storage: removes one item.
* ----------------------------------
* - Base Weight: 37.6 + 0.084 * S
* - DB Weight:
* - Read: Multisig Storage, [Caller Account]
* - Write: Multisig Storage, [Caller Account]
* # </weight>
**/
cancelAsMulti: AugmentedSubmittable<(threshold: u16 | AnyNumber | Uint8Array, otherSignatories: Vec<AccountId> | (AccountId | string | Uint8Array)[], timepoint: Timepoint | { height?: any; index?: any } | string | Uint8Array, callHash: U8aFixed | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
};
vesting: {
[index: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Force a vested transfer.
*
* The dispatch origin for this call must be _Root_.
*
* - `source`: The account whose funds should be transferred.
* - `target`: The account that should be transferred the vested funds.
* - `amount`: The amount of funds to transfer and will be vested.
* - `schedule`: The vesting schedule attached to the transfer.
*
* Emits `VestingCreated`.
*
* # <weight>
* - `O(1)`.
* - DbWeight: 4 Reads, 4 Writes
* - Reads: Vesting Storage, Balances Locks, Target Account, Source Account
* - Writes: Vesting Storage, Balances Locks, Target Account, Source Account
* - Benchmark: 100.3 + .365 * l µs (min square analysis)
* - Using 100 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
* # </weight>
**/
forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
/**
* Unlock any vested funds of the sender account.
*
+83 -52
View File
@@ -7,11 +7,11 @@ import { RpcInterface } from '@polkadot/rpc-core/types';
import { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import { AnyFunction, CallFunction, Codec, CodecArg as Arg, ITuple, InterfaceTypes, ModulesWithCalls, Registry, RegistryTypes } from '@polkadot/types/types';
import { SubmittableExtrinsic } from '../submittable/types';
import { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types';
import { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, PaginationOptions, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types';
import BN from 'bn.js';
import { BehaviorSubject, Observable, combineLatest, of } from 'rxjs';
import { map, switchMap, take, tap, toArray } from 'rxjs/operators';
import { map, switchMap, tap, toArray } from 'rxjs/operators';
import decorateDerive, { ExactDerive } from '@polkadot/api-derive';
import { memo } from '@polkadot/api-derive/util';
import DecoratedMeta from '@polkadot/metadata/Decorated';
@@ -145,7 +145,7 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
/**
* @description Creates an instance of a type as registered
*/
public createType <K extends keyof InterfaceTypes> (type: K, ...params: any[]): InterfaceTypes[K] {
public createType <K extends keyof InterfaceTypes> (type: K, ...params: unknown[]): InterfaceTypes[K] {
return this.registry.createType(type, ...params);
}
@@ -320,75 +320,84 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
private _decorateStorageEntry<ApiType extends ApiTypes> (creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): QueryableStorageEntry<ApiType> {
// get the storage arguments, with DoubleMap as an array entry, otherwise spread
const getArgs = (...args: any[]): any[] => extractStorageArgs(creator, args);
const getArgs = (...args: unknown[]): unknown[] => extractStorageArgs(creator, args);
// Disable this where it occurs for each field we are decorating
/* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
// FIXME We probably want to be able to query the full list with non-subs as well
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const decorated = this.hasSubscriptions && creator.iterKey && creator.meta.type.isMap && creator.meta.type.asMap.linked.isTrue
? this._decorateStorageLinked(creator, decorateMethod)
: decorateMethod((...args: any[]): Observable<Codec> => (
this.hasSubscriptions
? this._rpcCore.state
// Unfortunately for one-shot calls we also use .subscribeStorage here
.subscribeStorage<[Codec]>([getArgs(...args)])
// state_storage returns an array of values, since we have just subscribed to
// a single entry, we pull that from the array and return it as-is
.pipe(map(([data]): Codec => data))
: this._rpcCore.state.getStorage(getArgs(...args))
), { methodName: creator.method });
: this._decorateStorageCall(creator, decorateMethod);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
decorated.creator = creator;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.at = decorateMethod((hash: Hash, arg1?: Arg, arg2?: Arg): Observable<Codec> =>
this._rpcCore.state.getStorage(getArgs(arg1, arg2), hash));
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.hash = decorateMethod((arg1?: Arg, arg2?: Arg): Observable<Hash> =>
this._rpcCore.state.getStorageHash(getArgs(arg1, arg2)));
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
decorated.key = (arg1?: Arg, arg2?: Arg): string =>
u8aToHex(compactStripLength(creator(creator.meta.type.isDoubleMap ? [arg1, arg2] : arg1))[1]);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
decorated.keyPrefix = (key1?: Arg): string =>
u8aToHex(creator.keyPrefix(key1));
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.range = decorateMethod((range: [Hash, Hash?], arg1?: Arg, arg2?: Arg): Observable<[Hash, Codec][]> =>
this._decorateStorageRange(decorated, [arg1, arg2], range));
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.size = decorateMethod((arg1?: Arg, arg2?: Arg): Observable<u64> =>
this._rpcCore.state.getStorageSize(getArgs(arg1, arg2)));
// .keys() & .entries() only available on map types
if (creator.iterKey && (creator.meta.type.isMap || creator.meta.type.isDoubleMap)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.entries = decorateMethod(
memo((doubleMapArg?: Arg): Observable<[StorageKey, Codec][]> =>
this._retrieveMapEntries(creator, doubleMapArg)));
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.entriesPaged = decorateMethod(
memo((opts: PaginationOptions): Observable<[StorageKey, Codec][]> =>
this._retrieveMapEntriesPaged(creator, opts)));
decorated.keys = decorateMethod(
memo((doubleMapArg?: Arg): Observable<StorageKey[]> =>
this._retrieveMapKeys(creator, doubleMapArg)));
decorated.keysPaged = decorateMethod(
memo((opts: PaginationOptions): Observable<StorageKey[]> =>
this._retrieveMapKeysPaged(creator, opts)));
}
// only support multi where subs are available
if (this.hasSubscriptions) {
// When using double map storage function, user need to pass double map key as an array
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
decorated.multi = decorateMethod((args: (Arg | Arg[])[]): Observable<Codec[]> =>
this._rpcCore.state.subscribeStorage(
args.map((arg: Arg[] | Arg): [StorageEntry, Arg | Arg[]] => [creator, arg])));
}
/* eslint-enable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
return this._decorateFunctionMeta(creator as any, decorated) as unknown as QueryableStorageEntry<ApiType>;
}
// Decorate the base storage call. In the case or rxjs or promise-without-callback (await)
// we make a subscription, alternatively we push this through a single-shot query
private _decorateStorageCall<ApiType extends ApiTypes> (creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): ReturnType<DecorateMethod<ApiType>> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return decorateMethod((...args: unknown[]): Observable<Codec> => {
return this.hasSubscriptions
? this._rpcCore.state.subscribeStorage<[Codec]>([extractStorageArgs(creator, args)]).pipe(
map(([data]) => data) // extract first/only result from list
)
: this._rpcCore.state.getStorage(extractStorageArgs(creator, args));
}, {
methodName: creator.method,
overrideNoSub: (...args: unknown[]) => this._rpcCore.state.getStorage(extractStorageArgs(creator, args))
});
}
private _decorateStorageRange<ApiType extends ApiTypes> (decorated: QueryableStorageEntry<ApiType>, args: [Arg?, Arg?], range: [Hash, Hash?]): Observable<[Hash, Codec][]> {
const outputType = unwrapStorageType(decorated.creator.meta.type, decorated.creator.meta.modifier.isOptional);
@@ -402,6 +411,8 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
));
}
// This is deprecated/removed on substrate - we still have some live chains, eg. Edgeware needing it, so it
// has not been dropped yet. Slated for removal in API 2.0
private _decorateStorageLinked<ApiType extends ApiTypes> (creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): ReturnType<DecorateMethod<ApiType>> {
const result = new Map<Codec, ITuple<[Codec, Linkage<Codec>]> | null>();
let subject: BehaviorSubject<LinkageResult>;
@@ -467,15 +478,15 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
// this handles the case where the head changes effectively, i.e. a new entry
// appears at the top of the list, the new getNext gets kicked off
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return decorateMethod((...args: any[]): Observable<LinkageResult | [Codec, Linkage<Codec>]> =>
return decorateMethod((...args: unknown[]): Observable<LinkageResult | [Codec, Linkage<Codec>]> =>
args.length
? this._rpcCore.state
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
.subscribeStorage<[[Codec, Linkage<Codec>]]>([[creator, ...args]])
.pipe(map(([data]): [Codec, Linkage<Codec>] => data))
.pipe(map(([data]) => data))
: this._rpcCore.state
.subscribeStorage<[LinkageResult]>([iterKey()])
.pipe(switchMap(([key]): Observable<LinkageResult> => getNext(head = key)))
.pipe(switchMap(([key]) => getNext(head = key)))
);
}
@@ -485,24 +496,30 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
const headKey = iterKey(arg).toHex();
const startSubject = new BehaviorSubject<string>(headKey);
return this._rpcCore.state.getKeysPaged
? startSubject.pipe(
switchMap((startKey) =>
this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_KEYS, startKey).pipe(
map((keys) => keys.map((key) => key.setMeta(meta)))
)
),
tap((keys): void => {
keys.length === PAGE_SIZE_KEYS
? startSubject.next(keys[PAGE_SIZE_KEYS - 1].toHex())
: startSubject.complete();
}),
toArray(), // toArray since we want to startSubject to be completed
map((keysArr: StorageKey[][]) => keysArr.reduce((result: StorageKey[], keys) => result.concat(keys), []))
)
: this._rpcCore.state.getKeys(headKey).pipe(
map((keys) => keys.map((key) => key.setMeta(meta)))
);
return startSubject.pipe(
switchMap((startKey) =>
this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_KEYS, startKey).pipe(
map((keys) => keys.map((key) => key.setMeta(meta)))
)
),
tap((keys): void => {
keys.length === PAGE_SIZE_KEYS
? startSubject.next(keys[PAGE_SIZE_KEYS - 1].toHex())
: startSubject.complete();
}),
toArray(), // toArray since we want to startSubject to be completed
map((keysArr: StorageKey[][]) => keysArr.reduce((result: StorageKey[], keys) => result.concat(keys), []))
);
}
private _retrieveMapKeysPaged ({ iterKey, meta }: StorageEntry, opts: PaginationOptions): Observable<StorageKey[]> {
assert(iterKey && (meta.type.isMap || meta.type.isDoubleMap), 'keys can only be retrieved on maps, linked maps and double maps');
const headKey = iterKey(opts.arg).toHex();
return this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey).pipe(
map((keys) => keys.map((key) => key.setMeta(meta)))
);
}
private _retrieveMapEntries (entry: StorageEntry, arg?: Arg): Observable<[StorageKey, Codec][]> {
@@ -512,13 +529,27 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
of(keys),
...Array(Math.ceil(keys.length / PAGE_SIZE_VALS))
.fill(0)
.map((_, index): Observable<Codec[]> => {
const keyset = keys.slice(index * PAGE_SIZE_VALS, (index * PAGE_SIZE_VALS) + PAGE_SIZE_VALS);
.map((_, index): Observable<Codec[]> =>
this._rpcCore.state.queryStorageAt<Codec[]>(
keys.slice(index * PAGE_SIZE_VALS, (index * PAGE_SIZE_VALS) + PAGE_SIZE_VALS)
)
)
])
),
map(([keys, ...valsArr]): [StorageKey, Codec][] =>
valsArr
.reduce((result: Codec[], vals) => result.concat(vals), [])
.map((value, index) => [keys[index], value])
)
);
}
return this._rpcCore.state.queryStorageAt
? this._rpcCore.state.queryStorageAt<Codec[]>(keyset)
: this._rpcCore.state.subscribeStorage<Codec[]>(keyset).pipe(take(1));
})
private _retrieveMapEntriesPaged (entry: StorageEntry, opts: PaginationOptions): Observable<[StorageKey, Codec][]> {
return this._retrieveMapKeysPaged(entry, opts).pipe(
switchMap((keys) =>
combineLatest<[StorageKey[], ...Codec[][]]>([
of(keys),
this._rpcCore.state.queryStorageAt<Codec[]>(keys)
])
),
map(([keys, ...valsArr]): [StorageKey, Codec][] =>
+60 -42
View File
@@ -2,31 +2,30 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { AnyFunction, Callback, Codec } from '@polkadot/types/types';
import { ApiOptions, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise } from '../types';
import { Callback, Codec } from '@polkadot/types/types';
import { ApiOptions, DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types';
import { Observable, EMPTY } from 'rxjs';
import { catchError, first, tap } from 'rxjs/operators';
import { EMPTY, Observable, Subscription } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import { isFunction, assert } from '@polkadot/util';
import ApiBase from '../base';
import Combinator, { CombinatorCallback, CombinatorFunction } from './Combinator';
interface Tracker {
interface Tracker<T> {
reject: (value: Error) => Observable<never>;
resolve: (value: () => void) => void;
resolve: (value: T) => void;
}
// extract the arguments and callback params from a value array possibly containing a callback
function extractArgs (args: any[], needsCallback: boolean): [any[], Callback<Codec> | undefined] {
function extractArgs (args: unknown[], needsCallback: boolean): [unknown[], Callback<Codec> | undefined] {
let callback: Callback<Codec> | undefined;
const actualArgs = args.slice();
// If the last arg is a function, we pop it, put it into callback.
// actualArgs will then hold the actual arguments to be passed to `method`
if (args.length && isFunction(args[args.length - 1])) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
callback = actualArgs.pop();
callback = actualArgs.pop() as Callback<Codec>;
}
// When we need a subscription, ensure that a valid callback is actually passed
@@ -36,56 +35,75 @@ function extractArgs (args: any[], needsCallback: boolean): [any[], Callback<Cod
}
// a Promise completion tracker, wrapping an isComplete variable that ensures the promise only resolves once
function promiseTracker (resolve: (value: () => void) => void, reject: (value: Error) => void): Tracker {
function promiseTracker<T> (resolve: (value: T) => void, reject: (value: Error) => void): Tracker<T> {
let isCompleted = false;
// eslint-disable-next-line @typescript-eslint/ban-types
const complete = (fn: Function, value: any): void => {
if (!isCompleted) {
isCompleted = true;
fn(value);
}
};
return {
reject: (error: Error): Observable<never> => {
complete(reject, error);
if (!isCompleted) {
isCompleted = true;
reject(error);
}
return EMPTY;
},
resolve: (value: any): void => {
complete(resolve, value);
resolve: (value: T): void => {
if (!isCompleted) {
isCompleted = true;
resolve(value);
}
}
};
}
// Decorate a call for a single-shot result - retrieve and then immediate unsubscribe
function decorateCall<Method extends DecorateFn<ObsInnerType<ReturnType<Method>>>> (method: Method, actualArgs: unknown[]): Promise<ObsInnerType<ReturnType<Method>>> {
return new Promise((resolve, reject): void => {
// single result tracker - either reject with Error or resolve with Codec result
const tracker = promiseTracker(resolve, reject);
// errors reject immediately, any result unsubscribes and resolves
const subscription: Subscription = method(...actualArgs).pipe(
catchError((error) => tracker.reject(error))
).subscribe((result): void => {
tracker.resolve(result);
setImmediate(() => subscription.unsubscribe());
});
});
}
// Decorate a subscription where we have a result callback specified
function decorateSubscribe<Method extends DecorateFn<ObsInnerType<ReturnType<Method>>>> (method: Method, actualArgs: unknown[], resultCb: Callback<Codec>): UnsubscribePromise {
return new Promise<VoidFn>((resolve, reject): void => {
// either reject with error or resolve with unsubscribe callback
const tracker = promiseTracker(resolve, reject);
// errors reject immediately, the first result resolves with an unsubscribe promise, all results via callback
const subscription: Subscription = method(...actualArgs).pipe(
catchError((error) => tracker.reject(error)),
tap(() => tracker.resolve(() => subscription.unsubscribe()))
).subscribe((result): void => {
// We use setImmediate here to ensure that the Promise above (tracker) has resolved, before returning
// the first result. By putting is back in the queue, the promise above is guarded for first execution
setImmediate(() => resultCb(result) as void);
});
});
}
/**
* @description Decorate method for ApiPromise, where the results are converted to the Promise equivalent
*/
export function decorateMethod<Method extends AnyFunction> (method: Method, options?: DecorateMethodOptions): StorageEntryPromiseOverloads {
export function decorateMethod<Method extends DecorateFn<ObsInnerType<ReturnType<Method>>>> (method: Method, options?: DecorateMethodOptions): StorageEntryPromiseOverloads {
const needsCallback = options && options.methodName && options.methodName.includes('subscribe');
return function (...args: any[]): Promise<ObsInnerType<ReturnType<Method>>> | UnsubscribePromise {
const [actualArgs, callback] = extractArgs(args, !!needsCallback);
return function (...args: unknown[]): Promise<ObsInnerType<ReturnType<Method>>> | UnsubscribePromise {
const [actualArgs, resultCb] = extractArgs(args, !!needsCallback);
if (!callback) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
return method(...actualArgs).pipe(first()).toPromise() as Promise<ObsInnerType<ReturnType<Method>>>;
}
return new Promise((resolve, reject): void => {
const tracker = promiseTracker(resolve, reject);
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
const subscription: { unsubscribe: () => void } = method(...actualArgs).pipe(
// if we find an error (invalid params, etc), reject the promise
catchError((error): Observable<never> => tracker.reject(error)),
// upon the first result, resolve with the unsub function
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return
tap(() => tracker.resolve(() => subscription.unsubscribe()))
).subscribe(callback);
}) as UnsubscribePromise;
return resultCb
? decorateSubscribe(method, actualArgs, resultCb)
: decorateCall((options?.overrideNoSub as Method) || method, actualArgs);
} as StorageEntryPromiseOverloads;
}
+3 -3
View File
@@ -2,14 +2,14 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { AnyFunction } from '@polkadot/types/types';
import { ApiOptions } from '../types';
import { Codec } from '@polkadot/types/types';
import { ApiOptions, DecorateFn } from '../types';
import { from, Observable } from 'rxjs';
import ApiBase from '../base';
export function decorateMethod <Method extends AnyFunction> (method: Method): Method {
export function decorateMethod <Method extends DecorateFn<Codec>> (method: Method): Method {
return method;
}
+14 -3
View File
@@ -2,8 +2,8 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Observable } from 'rxjs';
import { AnyFunction, Callback, Codec } from '@polkadot/types/types';
import type { Observable } from 'rxjs';
import { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types';
// Prepend an element V onto the beginning of a tuple T.
// Cons<1, [2,3,4]> is [1,2,3,4]
@@ -30,7 +30,9 @@ export type ApiTypes = 'promise' | 'rxjs';
// Returns the inner type of an Observable
export type ObsInnerType<O extends Observable<any>> = O extends Observable<infer U> ? U : never;
export type UnsubscribePromise = Promise<() => void>;
export type VoidFn = () => void;
export type UnsubscribePromise = Promise<VoidFn>;
// FIXME The day TS has higher-kinded types, we can remove this hardcoded stuff
export type PromiseOrObs<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
@@ -66,6 +68,15 @@ export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiT
// information. This describes it.
export interface DecorateMethodOptions {
methodName?: string;
overrideNoSub?: (...args: unknown[]) => Observable<Codec>;
}
export type DecorateFn <T extends Codec> = (...args: any[]) => Observable<T>;
export interface PaginationOptions<ArgType = CodecArg> {
arg?: ArgType;
pageSize: number;
startKey?: string;
}
export type DecorateMethod<ApiType extends ApiTypes> = <Method extends (...args: any[]) => Observable<any>>(method: Method, options?: DecorateMethodOptions) => any;
+2 -2
View File
@@ -5,10 +5,11 @@
// Augment the modules
import '@polkadot/api/augment';
import BN from 'bn.js';
import type BN from 'bn.js';
import { DeriveCustom, ExactDerive } from '@polkadot/api-derive';
import { Constants } from '@polkadot/metadata/Decorated/types';
import { RpcInterface } from '@polkadot/rpc-core/types';
import { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import { Metadata } from '@polkadot/types';
import { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import { DefinitionRpc, DefinitionRpcSub, Signer, SignatureOptions, Registry, RegisteredTypes } from '@polkadot/types/types';
@@ -18,7 +19,6 @@ import ApiBase from '../base';
import { DecoratedRpc } from './rpc';
import { QueryableStorage, QueryableStorageMulti } from './storage';
import { SubmittableExtrinsics } from './submittable';
import { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
export { Signer, SignerResult } from '@polkadot/types/types';
export { default as ApiBase } from '../base';
+4 -3
View File
@@ -8,7 +8,7 @@ import { Hash } from '@polkadot/types/interfaces';
import { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types';
import StorageKey, { StorageEntry } from '@polkadot/types/primitive/StorageKey';
import { ApiTypes, MethodResult, ObsInnerType, PromiseOrObs, UnsubscribePromise } from './base';
import { ApiTypes, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AugmentedQueries<ApiType extends ApiTypes> { }
@@ -28,18 +28,19 @@ export type QueryableStorageEntry<ApiType extends ApiTypes> =
export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunction> {
at: <T extends Codec | any = ObsInnerType<ReturnType<F>>>(hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, T>;
creator: StorageEntry;
entries: <T extends Codec | any = ObsInnerType<ReturnType<F>>>(arg?: any) => PromiseOrObs<ApiType, [StorageKey, T][]>;
entries: <T extends Codec | any = ObsInnerType<ReturnType<F>>>(arg?: Parameters<F>[0]) => PromiseOrObs<ApiType, [StorageKey, T][]>;
entriesPaged: <T extends Codec | any = ObsInnerType<ReturnType<F>>>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey, T][]>;
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
key: (...args: Parameters<F>) => string;
keyPrefix: () => string;
keys: (arg?: any) => PromiseOrObs<ApiType, StorageKey[]>;
keysPaged: (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey[]>;
range: <T extends Codec | any = ObsInnerType<ReturnType<F>>>([from, to]: [Hash | Uint8Array | string, Hash | Uint8Array | string | undefined] | [Hash | Uint8Array | string], ...args: Parameters<F>) => PromiseOrObs<ApiType, [Hash, T][]>;
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
multi: ApiType extends 'rxjs' ? StorageEntryObservableMulti : StorageEntryPromiseMulti;
}
export interface StorageEntryDoubleMap<ApiType extends ApiTypes, F extends AnyFunction> extends StorageEntryBase<ApiType, F> {
entries: <T extends Codec | any = ObsInnerType<ReturnType<F>>>(arg?: Parameters<F>[0]) => PromiseOrObs<ApiType, [StorageKey, T][]>;
keyPrefix: (key1?: Parameters<F>[0]) => string;
}
+4 -4
View File
@@ -32,7 +32,7 @@ function extractKeys (src: Record<string, Record<string, any>>, dst: Record<stri
}
function findSectionExcludes (a: string[], b: string[]): string[] {
return a.filter((section): boolean => !b.includes(section));
return a.filter((section) => !b.includes(section));
}
function extractSections (src: Record<string, Record<string, any>>, dst: Record<string, Record<string, any>>): StringsStrings {
@@ -49,15 +49,15 @@ function findMethodExcludes (src: Record<string, Record<string, any>>, dst: Reco
const dstSections = Object.keys(dst);
return dstSections
.filter((section): boolean => srcSections.includes(section))
.filter((section) => srcSections.includes(section))
.reduce((rmMethods: string[], section): string[] => {
const srcMethods = Object.keys(src[section]);
return rmMethods.concat(
...Object
.keys(dst[section])
.filter((method): boolean => !srcMethods.includes(method))
.map((method): string => `${section}.${method}`)
.filter((method) => !srcMethods.includes(method))
.map((method) => `${section}.${method}`)
);
}, []);
}
+1 -1
View File
@@ -24,7 +24,7 @@ export default function filterEvents (extHash: H256, { block: { extrinsics, head
return;
}
return allEvents.filter(({ phase }): boolean =>
return allEvents.filter(({ phase }) =>
// only ApplyExtrinsic has the extrinsic index
phase.isApplyExtrinsic && phase.asApplyExtrinsic.eqn(index)
);
+3 -3
View File
@@ -11,7 +11,7 @@ function sig ({ method, section }: StorageEntry, ...args: Type[]): string {
return `${section}.${method}(${args.join(', ')})`;
}
function doDoubleMap (creator: StorageEntry, args: any[]): [StorageEntry, [any, any]] {
function doDoubleMap (creator: StorageEntry, args: unknown[]): [StorageEntry, [any, any]] {
const { key1, key2 } = creator.meta.type.asDoubleMap;
assert(args.length === 2, `${sig(creator, key1, key2)} is a doublemap, requiring 2 arguments, ${args.length} found`);
@@ -20,7 +20,7 @@ function doDoubleMap (creator: StorageEntry, args: any[]): [StorageEntry, [any,
return [creator, args as [any, any]];
}
function doMap (creator: StorageEntry, args: any[]): [StorageEntry] | [StorageEntry, any] {
function doMap (creator: StorageEntry, args: unknown[]): [StorageEntry] | [StorageEntry, any] {
const { key, linked } = creator.meta.type.asMap;
linked.isTrue
@@ -35,7 +35,7 @@ function doMap (creator: StorageEntry, args: any[]): [StorageEntry] | [StorageEn
// sets up the arguments in the form of [creator, args] ready to be used in a storage
// call. Additionally, it verifies that the correct number of arguments have been passed
export function extractStorageArgs (creator: StorageEntry, _args: any[]): [StorageEntry, [any, any]] | [StorageEntry] | [StorageEntry, any] {
export function extractStorageArgs (creator: StorageEntry, _args: unknown[]): [StorageEntry, [any, any]] | [StorageEntry] | [StorageEntry, any] {
const args = _args.filter((arg) => !isUndefined(arg));
if (creator.meta.type.isDoubleMap) {
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/metadata",
"version": "1.16.1",
"version": "1.21.1",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
"publishConfig": {
@@ -26,14 +26,14 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/types": "1.16.1",
"@polkadot/types-known": "1.16.1",
"@polkadot/util": "^2.11.1",
"@polkadot/util-crypto": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/types": "1.21.1",
"@polkadot/types-known": "1.21.1",
"@polkadot/util": "^2.15.1",
"@polkadot/util-crypto": "^2.15.1",
"bn.js": "^5.1.2"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1"
"@polkadot/keyring": "^2.15.1"
}
}
@@ -12,6 +12,15 @@ interface ModuleMetadataTrimmed {
calls: Option<Vec<FunctionMetadataLatest>>;
}
function trimDocs (documentation: Vec<Text>): string[] {
const strings = documentation.map((doc) => doc.toString().trim());
const firstEmpty = strings.findIndex((doc) => !doc.length);
return firstEmpty === -1
? strings
: strings.slice(0, firstEmpty);
}
function mapCalls (registry: Registry, _calls: Option<Vec<FunctionMetadataLatest>>): Option<Vec<FunctionMetadataLatest>> {
const calls = _calls.unwrapOr(null);
@@ -21,7 +30,7 @@ function mapCalls (registry: Registry, _calls: Option<Vec<FunctionMetadataLatest
? calls.map(({ args, documentation, name }) =>
registry.createType('FunctionMetadataLatest', {
args,
documentation: documentation.map((doc) => doc.toString().trim()),
documentation: trimDocs(documentation),
name
})
)
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+17 -1
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { FunctionMetadataV11, FunctionMetadataLatest, MetadataV11, MetadataLatest, ModuleMetadataLatest, StorageMetadataV11, StorageMetadataLatest, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata';
import { EventMetadataV11, EventMetadataLatest, FunctionMetadataV11, FunctionMetadataLatest, MetadataV11, MetadataLatest, ModuleMetadataLatest, StorageMetadataV11, StorageMetadataLatest, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata';
import { Registry, OverrideModuleType } from '@polkadot/types/types';
import { getModuleTypes } from '@polkadot/types-known';
@@ -35,6 +35,18 @@ function convertCalls (registry: Registry, calls: FunctionMetadataV11[], section
});
}
/**
* Apply module-specific type overrides (always be done as part of toLatest)
* @internal
**/
function convertEvents (registry: Registry, events: EventMetadataV11[], sectionTypes: OverrideModuleType): EventMetadataLatest[] {
return events.map(({ args, documentation, name }): EventMetadataLatest => {
args.forEach((type): void => setTypeOverride(sectionTypes, type));
return registry.createType('EventMetadataLatest', { args, documentation, name });
});
}
/**
* Apply module-specific storage type overrides (always part of toLatest)
* @internal
@@ -70,6 +82,7 @@ export default function toLatest (registry: Registry, { extrinsic, modules }: Me
extrinsic,
modules: modules.map((mod): ModuleMetadataLatest => {
const calls = mod.calls.unwrapOr(null);
const events = mod.events.unwrapOr(null);
const storage = mod.storage.unwrapOr(null);
const sectionTypes = getModuleTypes(registry, stringCamelCase(mod.name.toString()));
@@ -78,6 +91,9 @@ export default function toLatest (registry: Registry, { extrinsic, modules }: Me
calls: calls
? convertCalls(registry, calls, sectionTypes)
: null,
events: events
? convertEvents(registry, events, sectionTypes)
: null,
storage: storage
? convertStorage(registry, storage, sectionTypes)
: null
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-core",
"version": "1.16.1",
"version": "1.21.1",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"keywords": [
@@ -26,15 +26,15 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/metadata": "1.16.1",
"@polkadot/rpc-provider": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/metadata": "1.21.1",
"@polkadot/rpc-provider": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"memoizee": "^0.4.14",
"rxjs": "^6.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1"
"@polkadot/keyring": "^2.15.1"
}
}
+18 -15
View File
@@ -12,10 +12,15 @@ import { combineLatest, from, Observable, Observer, of, throwError } from 'rxjs'
import { catchError, map, publishReplay, refCount, switchMap } from 'rxjs/operators';
import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
import { Option, StorageKey, Vec, createClass, createTypeUnsafe } from '@polkadot/types';
import { assert, hexToU8a, isFunction, isNull, isNumber, isUndefined, logger, u8aToU8a } from '@polkadot/util';
import { assert, hexToU8a, isFunction, isNull, isUndefined, logger, u8aToU8a } from '@polkadot/util';
import { drr } from './rxjs';
interface StorageChangeSetJSON {
block: string;
changes: [string, string | null][];
}
const l = logger('rpc-core');
const EMPTY_META = {
@@ -75,8 +80,6 @@ export default class Rpc implements RpcInterface {
// these via the createInterfaces inside the constructor. However... this is not quite visible. The reason
// why we don't do for individual assignments is to allow user-defined RPCs to also be defined
public readonly account!: RpcInterface['account'];
public readonly author!: RpcInterface['author'];
public readonly babe!: RpcInterface['babe'];
@@ -212,7 +215,7 @@ export default class Rpc implements RpcInterface {
}
// create a subscriptor, it subscribes once and resolves with the id as subscribe
private _createSubscriber ({ paramsJson, subName, subType, update }: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback }, errorHandler: (error: Error) => void): Promise<number> {
private _createSubscriber ({ paramsJson, subName, subType, update }: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback }, errorHandler: (error: Error) => void): Promise<number | string> {
return new Promise((resolve, reject): void => {
this.provider
.subscribe(subType, subName, paramsJson, update)
@@ -229,11 +232,12 @@ export default class Rpc implements RpcInterface {
const subName = `${section}_${subMethod}`;
const unsubName = `${section}_${unsubMethod}`;
const subType = `${section}_${updateType}`;
let memoized: null | RpcInterfaceMethod & memoizee.Memoized<RpcInterfaceMethod> = null;
const creator = (isRaw: boolean) => (...values: any[]): Observable<any> => {
const creator = (isRaw: boolean) => (...values: unknown[]): Observable<any> => {
return new Observable((observer: Observer<any>): VoidCallback => {
// Have at least an empty promise, as used in the unsubscribe
let subscriptionPromise: Promise<number | void> = Promise.resolve();
let subscriptionPromise: Promise<number | string | null> = Promise.resolve(null);
const errorHandler = (error: Error): void => {
logErrorMessage(method, def, error);
@@ -279,22 +283,21 @@ export default class Rpc implements RpcInterface {
// api.query.system.account(addr1).subscribe(); // will output 6 instead of 7 if we don't clear cache
// // that's because all our observables are replay(1)
// ```
// eslint-disable-next-line @typescript-eslint/no-use-before-define
memoized.delete(...values);
memoized && memoized.delete(...values);
// Unsubscribe from provider
subscriptionPromise
.then((subscriptionId): Promise<boolean> =>
isNumber(subscriptionId)
? this.provider.unsubscribe(subType, unsubName, subscriptionId)
: Promise.resolve(false)
isNull(subscriptionId)
? Promise.resolve(false)
: this.provider.unsubscribe(subType, unsubName, subscriptionId)
)
.catch((error: Error): void => logErrorMessage(method, def, error));
.catch((error: Error) => logErrorMessage(method, def, error));
};
}).pipe(drr());
};
const memoized = memoizee(this._createMethodWithRaw(creator), {
memoized = memoizee(this._createMethodWithRaw(creator), {
// Dynamic length for argument
length: false,
// Normalize args so that different args that should be cached
@@ -341,10 +344,10 @@ export default class Rpc implements RpcInterface {
const keys = params[0] as Vec<StorageKey>;
return keys
? this._formatStorageSet(keys, (result as { changes: [string, string | null][] }).changes)
? this._formatStorageSet(keys, (result as StorageChangeSetJSON).changes)
: this.registry.createType('StorageChangeSet', result);
} else if (rpc.type === 'Vec<StorageChangeSet>') {
const mapped = (result as { block: string; changes: [string, string | null][] }[]).map(({ block, changes }): [Hash, Codec[]] => [
const mapped = (result as StorageChangeSetJSON[]).map(({ block, changes }): [Hash, Codec[]] => [
this.registry.createType('Hash', block),
this._formatStorageSet(params[0] as Vec<StorageKey>, changes)
]);
+6 -4
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { asapScheduler, ConnectableObservable, MonoTypeOperatorFunction, Observable, Subscription } from 'rxjs';
import { asapScheduler, ConnectableObservable, MonoTypeOperatorFunction, Observable, Subscription, TeardownLogic } from 'rxjs';
const DELAY = 1750;
@@ -11,7 +11,7 @@ function refCountDelayInner <T> (source: Observable<T>): Observable<T> {
// state: 0 = disconnected, 1 = disconnecting, 2 = connecting, 3 = connected
let [state, refCount, connection, scheduler] = [0, 0, Subscription.EMPTY, Subscription.EMPTY];
return new Observable((ob) => {
return new Observable((ob): TeardownLogic => {
source.subscribe(ob);
if (refCount++ === 0) {
@@ -27,12 +27,14 @@ function refCountDelayInner <T> (source: Observable<T>): Observable<T> {
return (): void => {
if (--refCount === 0) {
if (state === 2) {
state = 0; scheduler.unsubscribe();
state = 0;
scheduler.unsubscribe();
} else {
// state === 3
state = 1;
scheduler = asapScheduler.schedule((): void => {
state = 0; connection.unsubscribe();
state = 0;
connection.unsubscribe();
}, DELAY);
}
}
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-provider",
"version": "1.16.1",
"version": "1.21.1",
"description": "Transport providers for the API",
"main": "index.js",
"keywords": [
@@ -26,18 +26,18 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/metadata": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@polkadot/util-crypto": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/metadata": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"@polkadot/util-crypto": "^2.15.1",
"bn.js": "^5.1.2",
"eventemitter3": "^4.0.4",
"isomorphic-fetch": "^2.2.1",
"websocket": "^1.0.31"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1",
"@polkadot/keyring": "^2.15.1",
"mock-socket": "^9.0.3",
"nock": "^12.0.3"
}
@@ -48,6 +48,18 @@ describe('decodeResponse', (): void => {
).toThrow(/123: test error: Some random error description/);
});
it('allows for number subscription ids', (): void => {
expect(
coder.decodeResponse({ id: 1, jsonrpc: '2.0', method: 'test', params: { result: 'test result', subscription: 1 } } as JsonRpcResponse)
).toEqual('test result');
});
it('allows for string subscription ids', (): void => {
expect(
coder.decodeResponse({ id: 1, jsonrpc: '2.0', method: 'test', params: { result: 'test result', subscription: 'abc' } } as JsonRpcResponse)
).toEqual('test result');
});
it('returns the result', (): void => {
expect(
coder.decodeResponse({ id: 1, jsonrpc: '2.0', result: 'some result' } as JsonRpcResponse)
+1 -1
View File
@@ -30,7 +30,7 @@ export default class RpcCoder {
const isSubscription = !isUndefined(response.params) && !isUndefined(response.method);
assert(isNumber(response.id) || (isSubscription && isNumber(response.params.subscription)), 'Invalid id field in decoded object');
assert(isNumber(response.id) || (isSubscription && (isNumber(response.params.subscription) || isString(response.params.subscription))), 'Invalid id field in decoded object');
this._checkError(response.error);
+3 -3
View File
@@ -28,7 +28,7 @@ interface JsonRpcResponseSubscription {
params: {
error?: JsonRpcResponseBaseError;
result: unknown;
subscription: number;
subscription: number | string;
};
}
@@ -49,6 +49,6 @@ export interface ProviderInterface {
isConnected (): boolean;
on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void;
send (method: string, params: any[]): Promise<any>;
subscribe (type: string, method: string, params: any[], cb: ProviderInterfaceCallback): Promise<number>;
unsubscribe (type: string, method: string, id: number): Promise<boolean>;
subscribe (type: string, method: string, params: any[], cb: ProviderInterfaceCallback): Promise<number | string>;
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
}
+3 -3
View File
@@ -247,8 +247,8 @@ export default class WsProvider implements WSProviderInterface {
* })
* ```
*/
public async subscribe (type: string, method: string, params: any[], callback: ProviderInterfaceCallback): Promise<number> {
const id = await this.send(method, params, { callback, type }) as Promise<number>;
public async subscribe (type: string, method: string, params: any[], callback: ProviderInterfaceCallback): Promise<number | string> {
const id = await this.send(method, params, { callback, type }) as Promise<number | string>;
return id;
}
@@ -256,7 +256,7 @@ export default class WsProvider implements WSProviderInterface {
/**
* @summary Allows unsubscribing to subscriptions made with [[subscribe]].
*/
public async unsubscribe (type: string, method: string, id: number): Promise<boolean> {
public async unsubscribe (type: string, method: string, id: number | string): Promise<boolean> {
const subscription = `${type}::${id}`;
// FIXME This now could happen with re-subscriptions. The issue is that with a re-sub
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/typegen",
"version": "1.16.1",
"version": "1.21.1",
"description": "Type generation scripts",
"main": "index.js",
"bin": {
@@ -33,14 +33,14 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
"dependencies": {
"@babel/core": "^7.9.6",
"@babel/register": "^7.9.0",
"@babel/runtime": "^7.9.6",
"@polkadot/api": "1.16.1",
"@polkadot/metadata": "1.16.1",
"@polkadot/rpc-provider": "1.16.1",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@babel/core": "^7.10.3",
"@babel/register": "^7.10.3",
"@babel/runtime": "^7.10.3",
"@polkadot/api": "1.21.1",
"@polkadot/metadata": "1.21.1",
"@polkadot/rpc-provider": "1.21.1",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"handlebars": "^4.7.6",
"websocket": "^1.0.31",
"yargs": "^15.3.1"
+2 -1
View File
@@ -18,6 +18,7 @@ function generate (metaHex: string, pkg: string | undefined, output: string, isS
console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`);
const extraTypes = pkg
// eslint-disable-next-line @typescript-eslint/no-var-requires
? { [pkg]: require(path.join(process.cwd(), output, 'definitions')) as Record<string, any> }
: {};
@@ -97,7 +98,7 @@ export default function main (): void {
process.exit(1);
});
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-member-access
generate(require(path.join(process.cwd(), endpoint)).result, pkg, output, isStrict);
}
}
+2
View File
@@ -61,6 +61,7 @@ function tsEnum (definitions: Record<string, ModuleTypes>, { name: enumName, sub
case TypeDefInfo.Plain:
case TypeDefInfo.Tuple:
case TypeDefInfo.Vec:
case TypeDefInfo.Option:
return `${isGetter}${asGetter}`;
default:
@@ -89,6 +90,7 @@ function tsResultGetter (definitions: Record<string, ModuleTypes>, resultName =
case TypeDefInfo.Plain:
case TypeDefInfo.Tuple:
case TypeDefInfo.Vec:
case TypeDefInfo.Option:
return `${isGetter}${asGetter}`;
default:
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types-known",
"version": "1.16.1",
"version": "1.21.1",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"keywords": [
@@ -26,9 +26,9 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/types": "1.16.1",
"@polkadot/util": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/types": "1.21.1",
"@polkadot/util": "^2.15.1",
"bn.js": "^5.1.2"
},
"devDependencies": {
+8 -5
View File
@@ -6,8 +6,11 @@ import { OverrideModuleType } from '@polkadot/types/types';
// type overrides for modules (where duplication between modules exist)
const typesModules: Record<string, OverrideModuleType> = {
babe: {
EquivocationProof: 'BabeEquivocationProof'
},
balances: {
Releases: 'ReleasesBalances'
Status: 'BalanceStatus'
},
contract: { // old metadata & naming
// v2 & v3
@@ -16,8 +19,9 @@ const typesModules: Record<string, OverrideModuleType> = {
contracts: {
StorageKey: 'ContractStorageKey'
},
democracy: {
Releases: 'ReleasesDemocracy'
grandpa: {
Equivocation: 'GrandpaEquivocation',
EquivocationProof: 'GrandpaEquivocationProof'
},
identity: {
Judgement: 'IdentityJudgement'
@@ -30,8 +34,7 @@ const typesModules: Record<string, OverrideModuleType> = {
Vote: 'SocietyVote'
},
staking: {
Compact: 'CompactAssignments',
Releases: 'ReleasesStaking'
Compact: 'CompactAssignments'
},
treasury: {
Proposal: 'TreasuryProposal'
+12 -1
View File
@@ -7,12 +7,23 @@ import { OverrideVersionedType } from '@polkadot/types/types';
// these are override types for Polkadot
const versioned: OverrideVersionedType[] = [
{
minmax: [0, undefined],
minmax: [0, 3],
types: {
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId'
}
},
{
minmax: [4, undefined],
types: {
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'SudoBalances']
}
}
}
];
+12 -1
View File
@@ -16,12 +16,23 @@ const versioned: OverrideVersionedType[] = [
}
},
{
minmax: [3, undefined],
minmax: [3, 19],
types: {
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId'
}
},
{
minmax: [20, undefined],
types: {
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances']
}
}
}
];
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types",
"version": "1.16.1",
"version": "1.21.1",
"description": "Implementation of the Parity codec",
"main": "index.js",
"keywords": [
@@ -26,17 +26,17 @@
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.9.6",
"@polkadot/metadata": "1.16.1",
"@polkadot/util": "^2.11.1",
"@polkadot/util-crypto": "^2.11.1",
"@babel/runtime": "^7.10.3",
"@polkadot/metadata": "1.21.1",
"@polkadot/util": "^2.15.1",
"@polkadot/util-crypto": "^2.15.1",
"@types/bn.js": "^4.11.6",
"bn.js": "^5.1.2",
"memoizee": "^0.4.14",
"rxjs": "^6.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^2.11.1",
"@polkadot/keyring": "^2.15.1",
"@types/memoizee": "^0.4.4"
}
}
+96 -66
View File
@@ -7,38 +7,38 @@ import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/t
import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import { AccountData, BalanceLock, BalanceLockTo212, Reasons, ReleasesBalances, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import { BlockHash } from '@polkadot/types/interfaces/chain';
import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
import { MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultSuccess, ContractInfo, ContractStorageKey, Gas, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, ReleasesDemocracy, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
import { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
import { Account, Log, Vicinity } from '@polkadot/types/interfaces/evm';
import { EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV1, ExtrinsicPayloadV2, ExtrinsicPayloadV3, ExtrinsicPayloadV4, ExtrinsicSignatureV1, ExtrinsicSignatureV2, ExtrinsicSignatureV3, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV1, ExtrinsicV2, ExtrinsicV3, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
import { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
import { AuthorityIndex, AuthorityList, AuthorityWeight, Equivocation, EquivocationProof, GrandpaEquivocation, GrandpaPrevote, KeyOwnerProof, NextAuthority, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import { AuthorityIndex, AuthorityList, AuthorityWeight, GrandpaEquivocation, GrandpaEquivocationProof, GrandpaEquivocationValue, GrandpaPrevote, KeyOwnerProof, NextAuthority, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement } from '@polkadot/types/interfaces/identity';
import { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import { CallMetadataV0, DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV3, DoubleMapTypeV4, DoubleMapTypeV5, DoubleMapTypeV6, DoubleMapTypeV7, DoubleMapTypeV8, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV8, ErrorMetadataV9, EventMetadataLatest, EventMetadataV0, EventMetadataV1, EventMetadataV10, EventMetadataV11, EventMetadataV2, EventMetadataV3, EventMetadataV4, EventMetadataV5, EventMetadataV6, EventMetadataV7, EventMetadataV8, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV0, FunctionArgumentMetadataV1, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV2, FunctionArgumentMetadataV3, FunctionArgumentMetadataV4, FunctionArgumentMetadataV5, FunctionArgumentMetadataV6, FunctionArgumentMetadataV7, FunctionArgumentMetadataV8, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV0, FunctionMetadataV1, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV2, FunctionMetadataV3, FunctionMetadataV4, FunctionMetadataV5, FunctionMetadataV6, FunctionMetadataV7, FunctionMetadataV8, FunctionMetadataV9, MapTypeLatest, MapTypeV0, MapTypeV10, MapTypeV11, MapTypeV2, MapTypeV3, MapTypeV4, MapTypeV5, MapTypeV6, MapTypeV7, MapTypeV8, MapTypeV9, MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV10, MetadataV11, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV6, ModuleConstantMetadataV7, ModuleConstantMetadataV8, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV0, ModuleMetadataV1, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV2, ModuleMetadataV3, ModuleMetadataV4, ModuleMetadataV5, ModuleMetadataV6, ModuleMetadataV7, ModuleMetadataV8, ModuleMetadataV9, OuterDispatchCallV0, OuterDispatchMetadataV0, OuterEventEventMetadataEventsV0, OuterEventEventMetadataV0, OuterEventMetadataV0, PlainTypeLatest, PlainTypeV0, PlainTypeV10, PlainTypeV11, PlainTypeV2, PlainTypeV3, PlainTypeV4, PlainTypeV5, PlainTypeV6, PlainTypeV7, PlainTypeV8, PlainTypeV9, RuntimeModuleMetadataV0, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV6, StorageEntryMetadataV7, StorageEntryMetadataV8, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV6, StorageEntryModifierV7, StorageEntryModifierV8, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV6, StorageEntryTypeV7, StorageEntryTypeV8, StorageEntryTypeV9, StorageFunctionMetadataV0, StorageFunctionMetadataV1, StorageFunctionMetadataV2, StorageFunctionMetadataV3, StorageFunctionMetadataV4, StorageFunctionMetadataV5, StorageFunctionModifierV0, StorageFunctionModifierV1, StorageFunctionModifierV2, StorageFunctionModifierV3, StorageFunctionModifierV4, StorageFunctionModifierV5, StorageFunctionTypeV0, StorageFunctionTypeV1, StorageFunctionTypeV2, StorageFunctionTypeV3, StorageFunctionTypeV4, StorageFunctionTypeV5, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV4, StorageHasherV5, StorageHasherV6, StorageHasherV7, StorageHasherV8, StorageHasherV9, StorageMetadataLatest, StorageMetadataV0, StorageMetadataV10, StorageMetadataV11, StorageMetadataV7, StorageMetadataV8, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import { StorageKind } from '@polkadot/types/interfaces/offchain';
import { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import { AttestedCandidate, AuctionIndex, Bidder, CandidateReceipt, CollatorId, CollatorSignature, DoubleVoteReport, DoubleVoteReportProof, DoubleVoteReportStatement, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, Retriable, SigningContext, SlotRange, Statement, SubId, UpwardMessage, ValidationCode, ValidatorSignature, ValidityAttestation, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import { AbridgedCandidateReceipt, AttestedCandidate, AuctionIndex, Bidder, CandidateCommitments, CandidateReceipt, CollatorId, CollatorSignature, DoubleVoteReport, DownwardMessage, GlobalValidationSchedule, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, LocalValidationData, NewBidder, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, Remark, Retriable, Scheduling, SigningContext, SlotRange, Statement, SubId, UpwardMessage, ValidationCode, ValidatorSignature, ValidityAttestation, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import { RpcMethods } from '@polkadot/types/interfaces/rpc';
import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, ExtrinsicsWeight, Fixed128, Fixed64, H160, H256, H512, Hash, Header, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, Origin, Pays, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, H160, H256, H512, Hash, Header, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, Origin, Pays, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, ProxyType, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, ValidatorCount } from '@polkadot/types/interfaces/session';
import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import { ActiveEraInfo, CompactAssignments, CompactScore, ElectionCompute, ElectionResult, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, OffchainAccuracy, PerU16, PhragmenScore, Points, ReleasesStaking, RewardDestination, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import { ActiveEraInfo, CompactAssignments, CompactScore, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, OffchainAccuracy, PerU16, PhragmenScore, Points, RewardDestination, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import { AccountInfo, ChainProperties, ChainType, DigestOf, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, EventRecordTo76, Health, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RefCount } from '@polkadot/types/interfaces/system';
import { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, EventRecordTo76, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RefCount, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system';
import { OpenTip, OpenTipFinder, OpenTipTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import { Multiplier } from '@polkadot/types/interfaces/txpayment';
import { CallHash, Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
@@ -171,18 +171,6 @@ declare module '@polkadot/types/types/registry' {
DigestItem: DigestItem;
'Option<DigestItem>': Option<DigestItem>;
'Vec<DigestItem>': Vec<DigestItem>;
DispatchClass: DispatchClass;
'Option<DispatchClass>': Option<DispatchClass>;
'Vec<DispatchClass>': Vec<DispatchClass>;
DispatchInfo: DispatchInfo;
'Option<DispatchInfo>': Option<DispatchInfo>;
'Vec<DispatchInfo>': Vec<DispatchInfo>;
DispatchInfoTo190: DispatchInfoTo190;
'Option<DispatchInfoTo190>': Option<DispatchInfoTo190>;
'Vec<DispatchInfoTo190>': Vec<DispatchInfoTo190>;
DispatchInfoTo244: DispatchInfoTo244;
'Option<DispatchInfoTo244>': Option<DispatchInfoTo244>;
'Vec<DispatchInfoTo244>': Vec<DispatchInfoTo244>;
ExtrinsicsWeight: ExtrinsicsWeight;
'Option<ExtrinsicsWeight>': Option<ExtrinsicsWeight>;
'Vec<ExtrinsicsWeight>': Vec<ExtrinsicsWeight>;
@@ -265,6 +253,12 @@ declare module '@polkadot/types/types/registry' {
PhantomData: PhantomData;
'Option<PhantomData>': Option<PhantomData>;
'Vec<PhantomData>': Vec<PhantomData>;
ProxyType: ProxyType;
'Option<ProxyType>': Option<ProxyType>;
'Vec<ProxyType>': Vec<ProxyType>;
Releases: Releases;
'Option<Releases>': Option<Releases>;
'Vec<Releases>': Vec<Releases>;
RuntimeDbWeight: RuntimeDbWeight;
'Option<RuntimeDbWeight>': Option<RuntimeDbWeight>;
'Vec<RuntimeDbWeight>': Vec<RuntimeDbWeight>;
@@ -313,16 +307,19 @@ declare module '@polkadot/types/types/registry' {
'Compact<BabeBlockWeight>': Compact<BabeBlockWeight>;
'Option<BabeBlockWeight>': Option<BabeBlockWeight>;
'Vec<BabeBlockWeight>': Vec<BabeBlockWeight>;
BabeEquivocationProof: BabeEquivocationProof;
'Option<BabeEquivocationProof>': Option<BabeEquivocationProof>;
'Vec<BabeEquivocationProof>': Vec<BabeEquivocationProof>;
BabeWeight: BabeWeight;
'Compact<BabeWeight>': Compact<BabeWeight>;
'Option<BabeWeight>': Option<BabeWeight>;
'Vec<BabeWeight>': Vec<BabeWeight>;
MaybeRandomness: MaybeRandomness;
'Option<MaybeRandomness>': Option<MaybeRandomness>;
'Vec<MaybeRandomness>': Vec<MaybeRandomness>;
MaybeVrf: MaybeVrf;
'Option<MaybeVrf>': Option<MaybeVrf>;
'Vec<MaybeVrf>': Vec<MaybeVrf>;
BabeWeight: BabeWeight;
'Compact<BabeWeight>': Compact<BabeWeight>;
'Option<BabeWeight>': Option<BabeWeight>;
'Vec<BabeWeight>': Vec<BabeWeight>;
EpochAuthorship: EpochAuthorship;
'Option<EpochAuthorship>': Option<EpochAuthorship>;
'Vec<EpochAuthorship>': Vec<EpochAuthorship>;
@@ -381,9 +378,9 @@ declare module '@polkadot/types/types/registry' {
BalanceLock: BalanceLock;
'Option<BalanceLock>': Option<BalanceLock>;
'Vec<BalanceLock>': Vec<BalanceLock>;
ReleasesBalances: ReleasesBalances;
'Option<ReleasesBalances>': Option<ReleasesBalances>;
'Vec<ReleasesBalances>': Vec<ReleasesBalances>;
BalanceStatus: BalanceStatus;
'Option<BalanceStatus>': Option<BalanceStatus>;
'Vec<BalanceStatus>': Vec<BalanceStatus>;
Reasons: Reasons;
'Option<Reasons>': Option<Reasons>;
'Vec<Reasons>': Vec<Reasons>;
@@ -509,9 +506,6 @@ declare module '@polkadot/types/types/registry' {
ReferendumStatus: ReferendumStatus;
'Option<ReferendumStatus>': Option<ReferendumStatus>;
'Vec<ReferendumStatus>': Vec<ReferendumStatus>;
ReleasesDemocracy: ReleasesDemocracy;
'Option<ReleasesDemocracy>': Option<ReleasesDemocracy>;
'Vec<ReleasesDemocracy>': Vec<ReleasesDemocracy>;
Tally: Tally;
'Option<Tally>': Option<Tally>;
'Vec<Tally>': Vec<Tally>;
@@ -670,15 +664,15 @@ declare module '@polkadot/types/types/registry' {
'Compact<AuthorityWeight>': Compact<AuthorityWeight>;
'Option<AuthorityWeight>': Option<AuthorityWeight>;
'Vec<AuthorityWeight>': Vec<AuthorityWeight>;
Equivocation: Equivocation;
'Option<Equivocation>': Option<Equivocation>;
'Vec<Equivocation>': Vec<Equivocation>;
EquivocationProof: EquivocationProof;
'Option<EquivocationProof>': Option<EquivocationProof>;
'Vec<EquivocationProof>': Vec<EquivocationProof>;
GrandpaEquivocation: GrandpaEquivocation;
'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>;
'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>;
GrandpaEquivocationProof: GrandpaEquivocationProof;
'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>;
'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>;
GrandpaEquivocationValue: GrandpaEquivocationValue;
'Option<GrandpaEquivocationValue>': Option<GrandpaEquivocationValue>;
'Vec<GrandpaEquivocationValue>': Vec<GrandpaEquivocationValue>;
GrandpaPrevote: GrandpaPrevote;
'Option<GrandpaPrevote>': Option<GrandpaPrevote>;
'Vec<GrandpaPrevote>': Vec<GrandpaPrevote>;
@@ -888,6 +882,9 @@ declare module '@polkadot/types/types/registry' {
ElectionResult: ElectionResult;
'Option<ElectionResult>': Option<ElectionResult>;
'Vec<ElectionResult>': Vec<ElectionResult>;
ElectionScore: ElectionScore;
'Option<ElectionScore>': Option<ElectionScore>;
'Vec<ElectionScore>': Vec<ElectionScore>;
ElectionSize: ElectionSize;
'Option<ElectionSize>': Option<ElectionSize>;
'Vec<ElectionSize>': Vec<ElectionSize>;
@@ -936,9 +933,6 @@ declare module '@polkadot/types/types/registry' {
PhragmenScore: PhragmenScore;
'Option<PhragmenScore>': Option<PhragmenScore>;
'Vec<PhragmenScore>': Vec<PhragmenScore>;
ReleasesStaking: ReleasesStaking;
'Option<ReleasesStaking>': Option<ReleasesStaking>;
'Vec<ReleasesStaking>': Vec<ReleasesStaking>;
RewardDestination: RewardDestination;
'Option<RewardDestination>': Option<RewardDestination>;
'Vec<RewardDestination>': Vec<RewardDestination>;
@@ -999,6 +993,9 @@ declare module '@polkadot/types/types/registry' {
AccountInfo: AccountInfo;
'Option<AccountInfo>': Option<AccountInfo>;
'Vec<AccountInfo>': Vec<AccountInfo>;
ApplyExtrinsicResult: ApplyExtrinsicResult;
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
ChainProperties: ChainProperties;
'Option<ChainProperties>': Option<ChainProperties>;
'Vec<ChainProperties>': Vec<ChainProperties>;
@@ -1008,6 +1005,9 @@ declare module '@polkadot/types/types/registry' {
DigestOf: DigestOf;
'Option<DigestOf>': Option<DigestOf>;
'Vec<DigestOf>': Vec<DigestOf>;
DispatchClass: DispatchClass;
'Option<DispatchClass>': Option<DispatchClass>;
'Vec<DispatchClass>': Vec<DispatchClass>;
DispatchError: DispatchError;
'Option<DispatchError>': Option<DispatchError>;
'Vec<DispatchError>': Vec<DispatchError>;
@@ -1017,6 +1017,18 @@ declare module '@polkadot/types/types/registry' {
DispatchErrorTo198: DispatchErrorTo198;
'Option<DispatchErrorTo198>': Option<DispatchErrorTo198>;
'Vec<DispatchErrorTo198>': Vec<DispatchErrorTo198>;
DispatchInfo: DispatchInfo;
'Option<DispatchInfo>': Option<DispatchInfo>;
'Vec<DispatchInfo>': Vec<DispatchInfo>;
DispatchInfoTo190: DispatchInfoTo190;
'Option<DispatchInfoTo190>': Option<DispatchInfoTo190>;
'Vec<DispatchInfoTo190>': Vec<DispatchInfoTo190>;
DispatchInfoTo244: DispatchInfoTo244;
'Option<DispatchInfoTo244>': Option<DispatchInfoTo244>;
'Vec<DispatchInfoTo244>': Vec<DispatchInfoTo244>;
DispatchOutcome: DispatchOutcome;
'Option<DispatchOutcome>': Option<DispatchOutcome>;
'Vec<DispatchOutcome>': Vec<DispatchOutcome>;
DispatchResult: DispatchResult;
'Option<DispatchResult>': Option<DispatchResult>;
'Vec<DispatchResult>': Vec<DispatchResult>;
@@ -1045,6 +1057,9 @@ declare module '@polkadot/types/types/registry' {
Health: Health;
'Option<Health>': Option<Health>;
'Vec<Health>': Vec<Health>;
InvalidTransaction: InvalidTransaction;
'Option<InvalidTransaction>': Option<InvalidTransaction>;
'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
Key: Key;
'Option<Key>': Option<Key>;
'Vec<Key>': Vec<Key>;
@@ -1088,6 +1103,12 @@ declare module '@polkadot/types/types/registry' {
'Compact<RefCount>': Compact<RefCount>;
'Option<RefCount>': Option<RefCount>;
'Vec<RefCount>': Vec<RefCount>;
TransactionValidityError: TransactionValidityError;
'Option<TransactionValidityError>': Option<TransactionValidityError>;
'Vec<TransactionValidityError>': Vec<TransactionValidityError>;
UnknownTransaction: UnknownTransaction;
'Option<UnknownTransaction>': Option<UnknownTransaction>;
'Vec<UnknownTransaction>': Vec<UnknownTransaction>;
OpenTip: OpenTip;
'Option<OpenTip>': Option<OpenTip>;
'Vec<OpenTip>': Vec<OpenTip>;
@@ -1130,6 +1151,9 @@ declare module '@polkadot/types/types/registry' {
StatementKind: StatementKind;
'Option<StatementKind>': Option<StatementKind>;
'Vec<StatementKind>': Vec<StatementKind>;
AbridgedCandidateReceipt: AbridgedCandidateReceipt;
'Option<AbridgedCandidateReceipt>': Option<AbridgedCandidateReceipt>;
'Vec<AbridgedCandidateReceipt>': Vec<AbridgedCandidateReceipt>;
AttestedCandidate: AttestedCandidate;
'Option<AttestedCandidate>': Option<AttestedCandidate>;
'Vec<AttestedCandidate>': Vec<AttestedCandidate>;
@@ -1140,6 +1164,9 @@ declare module '@polkadot/types/types/registry' {
Bidder: Bidder;
'Option<Bidder>': Option<Bidder>;
'Vec<Bidder>': Vec<Bidder>;
CandidateCommitments: CandidateCommitments;
'Option<CandidateCommitments>': Option<CandidateCommitments>;
'Vec<CandidateCommitments>': Vec<CandidateCommitments>;
CandidateReceipt: CandidateReceipt;
'Option<CandidateReceipt>': Option<CandidateReceipt>;
'Vec<CandidateReceipt>': Vec<CandidateReceipt>;
@@ -1152,58 +1179,61 @@ declare module '@polkadot/types/types/registry' {
DoubleVoteReport: DoubleVoteReport;
'Option<DoubleVoteReport>': Option<DoubleVoteReport>;
'Vec<DoubleVoteReport>': Vec<DoubleVoteReport>;
DoubleVoteReportProof: DoubleVoteReportProof;
'Option<DoubleVoteReportProof>': Option<DoubleVoteReportProof>;
'Vec<DoubleVoteReportProof>': Vec<DoubleVoteReportProof>;
DoubleVoteReportStatement: DoubleVoteReportStatement;
'Option<DoubleVoteReportStatement>': Option<DoubleVoteReportStatement>;
'Vec<DoubleVoteReportStatement>': Vec<DoubleVoteReportStatement>;
EgressQueueRoot: EgressQueueRoot;
'Option<EgressQueueRoot>': Option<EgressQueueRoot>;
'Vec<EgressQueueRoot>': Vec<EgressQueueRoot>;
DownwardMessage: DownwardMessage;
'Option<DownwardMessage>': Option<DownwardMessage>;
'Vec<DownwardMessage>': Vec<DownwardMessage>;
GlobalValidationSchedule: GlobalValidationSchedule;
'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>;
'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>;
HeadData: HeadData;
'Option<HeadData>': Option<HeadData>;
'Vec<HeadData>': Vec<HeadData>;
IncomingParachainDeploy: IncomingParachainDeploy;
'Option<IncomingParachainDeploy>': Option<IncomingParachainDeploy>;
'Vec<IncomingParachainDeploy>': Vec<IncomingParachainDeploy>;
IncomingParachainFixed: IncomingParachainFixed;
'Option<IncomingParachainFixed>': Option<IncomingParachainFixed>;
'Vec<IncomingParachainFixed>': Vec<IncomingParachainFixed>;
IncomingParachain: IncomingParachain;
'Option<IncomingParachain>': Option<IncomingParachain>;
'Vec<IncomingParachain>': Vec<IncomingParachain>;
IncomingParachainFixed: IncomingParachainFixed;
'Option<IncomingParachainFixed>': Option<IncomingParachainFixed>;
'Vec<IncomingParachainFixed>': Vec<IncomingParachainFixed>;
IncomingParachainDeploy: IncomingParachainDeploy;
'Option<IncomingParachainDeploy>': Option<IncomingParachainDeploy>;
'Vec<IncomingParachainDeploy>': Vec<IncomingParachainDeploy>;
LeasePeriod: LeasePeriod;
'Option<LeasePeriod>': Option<LeasePeriod>;
'Vec<LeasePeriod>': Vec<LeasePeriod>;
LeasePeriodOf: LeasePeriodOf;
'Option<LeasePeriodOf>': Option<LeasePeriodOf>;
'Vec<LeasePeriodOf>': Vec<LeasePeriodOf>;
LocalValidationData: LocalValidationData;
'Option<LocalValidationData>': Option<LocalValidationData>;
'Vec<LocalValidationData>': Vec<LocalValidationData>;
NewBidder: NewBidder;
'Option<NewBidder>': Option<NewBidder>;
'Vec<NewBidder>': Vec<NewBidder>;
ParachainDispatchOrigin: ParachainDispatchOrigin;
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
ParaId: ParaId;
'Compact<ParaId>': Compact<ParaId>;
'Option<ParaId>': Option<ParaId>;
'Vec<ParaId>': Vec<ParaId>;
ParaIdOf: ParaIdOf;
'Option<ParaIdOf>': Option<ParaIdOf>;
'Vec<ParaIdOf>': Vec<ParaIdOf>;
ParaInfo: ParaInfo;
'Option<ParaInfo>': Option<ParaInfo>;
'Vec<ParaInfo>': Vec<ParaInfo>;
ParaPastCodeMeta: ParaPastCodeMeta;
'Option<ParaPastCodeMeta>': Option<ParaPastCodeMeta>;
'Vec<ParaPastCodeMeta>': Vec<ParaPastCodeMeta>;
ParachainDispatchOrigin: ParachainDispatchOrigin;
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
ParaScheduling: ParaScheduling;
'Option<ParaScheduling>': Option<ParaScheduling>;
'Vec<ParaScheduling>': Vec<ParaScheduling>;
Remark: Remark;
'Option<Remark>': Option<Remark>;
'Vec<Remark>': Vec<Remark>;
Retriable: Retriable;
'Option<Retriable>': Option<Retriable>;
'Vec<Retriable>': Vec<Retriable>;
Scheduling: Scheduling;
'Option<Scheduling>': Option<Scheduling>;
'Vec<Scheduling>': Vec<Scheduling>;
SigningContext: SigningContext;
'Option<SigningContext>': Option<SigningContext>;
'Vec<SigningContext>': Vec<SigningContext>;
@@ -1223,18 +1253,18 @@ declare module '@polkadot/types/types/registry' {
ValidationCode: ValidationCode;
'Option<ValidationCode>': Option<ValidationCode>;
'Vec<ValidationCode>': Vec<ValidationCode>;
ValidityAttestation: ValidityAttestation;
'Option<ValidityAttestation>': Option<ValidityAttestation>;
'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
ValidatorSignature: ValidatorSignature;
'Option<ValidatorSignature>': Option<ValidatorSignature>;
'Vec<ValidatorSignature>': Vec<ValidatorSignature>;
WinningDataEntry: WinningDataEntry;
'Option<WinningDataEntry>': Option<WinningDataEntry>;
'Vec<WinningDataEntry>': Vec<WinningDataEntry>;
ValidityAttestation: ValidityAttestation;
'Option<ValidityAttestation>': Option<ValidityAttestation>;
'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
WinningData: WinningData;
'Option<WinningData>': Option<WinningData>;
'Vec<WinningData>': Vec<WinningData>;
WinningDataEntry: WinningDataEntry;
'Option<WinningDataEntry>': Option<WinningDataEntry>;
'Vec<WinningDataEntry>': Vec<WinningDataEntry>;
CallMetadataV0: CallMetadataV0;
'Option<CallMetadataV0>': Option<CallMetadataV0>;
'Vec<CallMetadataV0>': Vec<CallMetadataV0>;
+4 -4
View File
@@ -32,7 +32,7 @@ function decodeSetFromU8a<V extends Codec = Codec> (registry: Registry, ValClass
}
/** @internal */
function decodeSetFromSet<V extends Codec = Codec> (registry: Registry, ValClass: Constructor<V>, value: Set<any>): Set<V> {
function decodeSetFromSet<V extends Codec = Codec> (registry: Registry, ValClass: Constructor<V>, value: Set<any> | string[]): Set<V> {
const output = new Set<V>();
value.forEach((val: any) => {
@@ -62,7 +62,7 @@ function decodeSetFromSet<V extends Codec = Codec> (registry: Registry, ValClass
* @param jsonSet
* @internal
*/
function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constructor<V> | keyof InterfaceTypes, value?: Uint8Array | string | Set<any>): Set<V> {
function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constructor<V> | keyof InterfaceTypes, value?: Uint8Array | string | string[] | Set<any>): Set<V> {
if (!value) {
return new Set<V>();
}
@@ -73,7 +73,7 @@ function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constr
return decodeSet(registry, ValClass, hexToU8a(value));
} else if (isU8a(value)) {
return decodeSetFromU8a<V>(registry, ValClass, u8aToU8a(value));
} else if (value instanceof Set) {
} else if (Array.isArray(value) || value instanceof Set) {
return decodeSetFromSet<V>(registry, ValClass, value);
}
@@ -85,7 +85,7 @@ export default class BTreeSet<V extends Codec = Codec> extends Set<V> implements
readonly #ValClass: Constructor<V>;
constructor (registry: Registry, valType: Constructor<V> | keyof InterfaceTypes, rawValue?: Uint8Array | string | Set<any>) {
constructor (registry: Registry, valType: Constructor<V> | keyof InterfaceTypes, rawValue?: Uint8Array | string | string[] | Set<any>) {
super(decodeSet(registry, valType, rawValue));
this.registry = registry;
+1 -1
View File
@@ -153,7 +153,7 @@ export class TypeRegistry implements Registry {
/**
* @description Creates an instance of a type as registered
*/
public createType <K extends keyof InterfaceTypes> (type: K, ...params: any[]): InterfaceTypes[K] {
public createType <K extends keyof InterfaceTypes> (type: K, ...params: unknown[]): InterfaceTypes[K] {
return createType(this, type, ...params);
}
@@ -0,0 +1,8 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
export default {
extra: {},
types: {}
};
@@ -4,29 +4,13 @@
import { ExtDef } from './types';
import EmptyCheck from './emptyCheck';
export default {
LimitParathreadCommits: {
extra: {},
types: {}
},
OnlyStakingAndClaims: {
extra: {},
types: {}
},
PrevalidateAttests: {
extra: {},
types: {}
},
RestrictFunctionality: {
extra: {},
types: {}
},
TransactionCallFilter: {
extra: {},
types: {}
},
ValidateDoubleVoteReports: {
extra: {},
types: {}
}
LimitParathreadCommits: EmptyCheck,
OnlyStakingAndClaims: EmptyCheck,
PrevalidateAttests: EmptyCheck,
RestrictFunctionality: EmptyCheck,
TransactionCallFilter: EmptyCheck,
ValidateDoubleVoteReports: EmptyCheck
} as ExtDef;
@@ -4,6 +4,17 @@
import { ExtDef } from './types';
import EmptyCheck from './emptyCheck';
const CheckMortality = {
extra: {
blockHash: 'Hash'
},
types: {
era: 'ExtrinsicEra'
}
};
export default {
ChargeTransactionPayment: {
extra: {},
@@ -11,24 +22,15 @@ export default {
tip: 'Compact<Balance>'
}
},
CheckBlockGasLimit: {
extra: {},
types: {}
},
CheckEra: {
extra: {
blockHash: 'Hash'
},
types: {
era: 'ExtrinsicEra'
}
},
CheckBlockGasLimit: EmptyCheck,
CheckEra: CheckMortality,
CheckGenesis: {
extra: {
genesisHash: 'Hash'
},
types: {}
},
CheckMortality,
CheckNonce: {
extra: {},
types: {
@@ -53,16 +55,7 @@ export default {
},
types: {}
},
CheckWeight: {
extra: {},
types: {}
},
LockStakingStatus: {
extra: {},
types: {}
},
ValidateEquivocationReport: {
extra: {},
types: {}
}
CheckWeight: EmptyCheck,
LockStakingStatus: EmptyCheck,
ValidateEquivocationReport: EmptyCheck
} as ExtDef;
+14
View File
@@ -194,6 +194,13 @@ export default class Call extends Struct implements IMethod {
return this.registry.findMetaCall(this.callIndex).method;
}
/**
* @description Returns the name of the method
*/
public get method (): string {
return this.methodName;
}
/**
* @description Returns the module containing the method
*/
@@ -201,6 +208,13 @@ export default class Call extends Struct implements IMethod {
return this.registry.findMetaCall(this.callIndex).section;
}
/**
* @description Returns the module containing the method
*/
public get section (): string {
return this.sectionName;
}
/**
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
@@ -1,25 +0,0 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// order important in structs... :)
/* eslint-disable sort-keys */
import { Definitions } from '../../types';
export default {
rpc: {
nextIndex: {
alias: ['system_accountNextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
}
},
types: {}
} as Definitions;
@@ -1,4 +0,0 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -1,4 +0,0 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export type PHANTOM_ACCOUNT = 'account';
@@ -21,10 +21,15 @@ export default {
},
BabeAuthorityWeight: 'u64',
BabeBlockWeight: 'u32',
BabeEquivocationProof: {
offender: 'AuthorityId',
slotNumber: 'SlotNumber',
firstHeader: 'Header',
secondHeader: 'Header'
},
BabeWeight: 'u64',
MaybeRandomness: 'Option<Randomness>',
MaybeVrf: 'Option<VrfData>',
// TODO Remove as soon as merged and metadata static updated
BabeWeight: 'u64',
EpochAuthorship: {
primary: 'Vec<u64>',
secondary: 'Vec<u64>'
+10 -1
View File
@@ -4,7 +4,8 @@
import { ITuple } from '@polkadot/types/types';
import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
import { u32, u64 } from '@polkadot/types/primitive';
import { Hash } from '@polkadot/types/interfaces/runtime';
import { AuthorityId } from '@polkadot/types/interfaces/consensus';
import { Hash, Header } from '@polkadot/types/interfaces/runtime';
/** @name AllowedSlots */
export interface AllowedSlots extends Enum {
@@ -19,6 +20,14 @@ export interface BabeAuthorityWeight extends u64 {}
/** @name BabeBlockWeight */
export interface BabeBlockWeight extends u32 {}
/** @name BabeEquivocationProof */
export interface BabeEquivocationProof extends Struct {
readonly offender: AuthorityId;
readonly slotNumber: SlotNumber;
readonly firstHeader: Header;
readonly secondHeader: Header;
}
/** @name BabeWeight */
export interface BabeWeight extends u64 {}
@@ -27,8 +27,8 @@ export default {
amount: 'Balance',
reasons: 'Reasons'
},
ReleasesBalances: {
_enum: ['V1_0_0', 'V2_0_0']
BalanceStatus: {
_enum: ['Free', 'Reserved']
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
@@ -27,6 +27,12 @@ export interface BalanceLockTo212 extends Struct {
readonly reasons: WithdrawReasons;
}
/** @name BalanceStatus */
export interface BalanceStatus extends Enum {
readonly isFree: boolean;
readonly isReserved: boolean;
}
/** @name Reasons */
export interface Reasons extends Enum {
readonly isFee: boolean;
@@ -34,12 +40,6 @@ export interface Reasons extends Enum {
readonly isAll: boolean;
}
/** @name ReleasesBalances */
export interface ReleasesBalances extends Enum {
readonly isV100: boolean;
readonly isV200: boolean;
}
/** @name VestingSchedule */
export interface VestingSchedule extends Struct {
readonly offset: Balance;
@@ -45,7 +45,6 @@ export { default as metadata } from './metadata/definitions';
export { default as rpc } from './rpc/definitions';
// rpc-only definitions
export { default as account } from './account/definitions';
export { default as author } from './author/definitions';
export { default as chain } from './chain/definitions';
export { default as childstate } from './childstate/definitions';
@@ -96,9 +96,6 @@ export default {
delay: 'BlockNumber',
tally: 'Tally'
},
ReleasesDemocracy: {
_enum: ['V1']
},
Tally: {
ayes: 'Balance',
nays: 'Balance',
@@ -112,11 +112,6 @@ export interface ReferendumStatus extends Struct {
readonly tally: Tally;
}
/** @name ReleasesDemocracy */
export interface ReleasesDemocracy extends Enum {
readonly isV1: boolean;
}
/** @name Tally */
export interface Tally extends Struct {
readonly ayes: Balance;
@@ -0,0 +1,18 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { TypeRegistry } from '../../create';
import json3 from '../../json/GrandpaRoundstate.001.json';
describe('ReportedRoundStates', (): void => {
const registry = new TypeRegistry();
it('decodes from an actual message', (): void => {
const states = registry.createType('ReportedRoundStates', json3.result);
expect(states.best.precommits.missing.size).toEqual(250);
});
});
@@ -19,17 +19,17 @@ export default {
AuthorityIndex: 'u64',
AuthorityList: 'Vec<NextAuthority>',
AuthorityWeight: 'u64',
Equivocation: {
GrandpaEquivocation: {
_enum: {
Prevote: 'GrandpaEquivocation',
Precommit: 'GrandpaEquivocation'
Prevote: 'GrandpaEquivocationValue',
Precommit: 'GrandpaEquivocationValue'
}
},
EquivocationProof: {
GrandpaEquivocationProof: {
setId: 'SetId',
equivocation: 'Equivocation'
equivocation: 'GrandpaEquivocation'
},
GrandpaEquivocation: {
GrandpaEquivocationValue: {
roundNumber: 'u64',
identity: 'AuthorityId',
first: '(GrandpaPrevote, AuthoritySignature)',
+15 -15
View File
@@ -18,22 +18,22 @@ export interface AuthorityList extends Vec<NextAuthority> {}
/** @name AuthorityWeight */
export interface AuthorityWeight extends u64 {}
/** @name Equivocation */
export interface Equivocation extends Enum {
readonly isPrevote: boolean;
readonly asPrevote: GrandpaEquivocation;
readonly isPrecommit: boolean;
readonly asPrecommit: GrandpaEquivocation;
}
/** @name EquivocationProof */
export interface EquivocationProof extends Struct {
readonly setId: SetId;
readonly equivocation: Equivocation;
}
/** @name GrandpaEquivocation */
export interface GrandpaEquivocation extends Struct {
export interface GrandpaEquivocation extends Enum {
readonly isPrevote: boolean;
readonly asPrevote: GrandpaEquivocationValue;
readonly isPrecommit: boolean;
readonly asPrecommit: GrandpaEquivocationValue;
}
/** @name GrandpaEquivocationProof */
export interface GrandpaEquivocationProof extends Struct {
readonly setId: SetId;
readonly equivocation: GrandpaEquivocation;
}
/** @name GrandpaEquivocationValue */
export interface GrandpaEquivocationValue extends Struct {
readonly roundNumber: u64;
readonly identity: AuthorityId;
readonly first: ITuple<[GrandpaPrevote, AuthoritySignature]>;
@@ -7,11 +7,22 @@
import { Definitions } from '../../types';
const SLOT_RANGE_COUNT = 10;
export default {
rpc: {},
types: {
AbridgedCandidateReceipt: {
parachainIndex: 'ParaId',
relayParent: 'Hash',
headData: 'HeadData',
collator: 'CollatorId',
signature: 'CollatorSignature',
povBlockHash: 'Hash',
commitments: 'CandidateCommitments'
},
AttestedCandidate: {
candidate: 'CandidateReceipt',
candidate: 'AbridgedCandidateReceipt',
validityVotes: 'Vec<ValidityAttestation>',
validatorIndices: 'BitVec'
},
@@ -22,42 +33,45 @@ export default {
Existing: 'ParaId'
}
},
CandidateCommitments: {
fees: 'Balance',
upwardMessages: 'Vec<UpwardMessage>',
erasureRoot: 'Hash',
newValidationCode: 'Option<ValidationCode>',
processedDownwardMessages: 'u32'
},
CandidateReceipt: {
parachainIndex: 'ParaId',
relayParent: 'Hash',
head_data: 'HeadData',
collator: 'CollatorId',
signature: 'CollatorSignature',
headData: 'HeadData',
egressQueueRoots: 'Vec<(ParaId, Hash)>',
fees: 'Balance',
blockDataHash: 'Hash',
upwardMessages: 'Vec<UpwardMessage>',
erasureRoot: 'Hash'
povBlockHash: 'Hash',
globalValidation: 'GlobalValidationSchedule',
localValidation: 'LocalValidationData',
commitments: 'CandidateCommitments'
},
CollatorId: 'H256',
CollatorId: '[u8; 32]',
CollatorSignature: 'Signature',
DoubleVoteReport: {
identity: 'ValidatorId',
first: 'DoubleVoteReportStatement',
second: 'DoubleVoteReportStatement',
proof: 'DoubleVoteReportProof',
first: '(Statement, ValidatorSignature)',
second: '(Statement, ValidatorSignature)',
proof: 'MembershipProof',
signingContext: 'SigningContext'
},
// session::historical::Proof
DoubleVoteReportProof: {
session: 'SessionIndex',
trieNodes: 'Vec<Bytes>'
DownwardMessage: {
_enum: {
TransferInto: '(AccountId, Balance, Remark)',
Opaque: 'Vec<u8>'
}
},
GlobalValidationSchedule: {
maxCodeSize: 'u32',
maxHeadDataSize: 'u32',
blockNumber: 'BlockNumber'
},
DoubleVoteReportStatement: '(Statement, ValidatorSignature)',
EgressQueueRoot: '(ParaId, Hash)',
HeadData: 'Bytes',
IncomingParachainDeploy: {
code: 'Bytes',
initialHeadData: 'Bytes'
},
IncomingParachainFixed: {
codeHash: 'Hash',
initialHeadData: 'Bytes'
},
IncomingParachain: {
_enum: {
Unset: 'NewBidder',
@@ -65,55 +79,60 @@ export default {
Deploy: 'IncomingParachainDeploy'
}
},
IncomingParachainFixed: {
codeHash: 'Hash',
codeSize: 'u32',
initialHeadData: 'HeadData'
},
IncomingParachainDeploy: {
code: 'ValidationCode',
initialHeadData: 'HeadData'
},
LeasePeriod: 'BlockNumber',
LeasePeriodOf: 'LeasePeriod',
LocalValidationData: {
parentHead: 'HeadData',
balance: 'Balance',
codeUpgradeAllowed: 'Option<BlockNumber>'
},
NewBidder: {
who: 'AccountId',
sub: 'SubId'
},
ParachainDispatchOrigin: {
_enum: ['Signed', 'Parachain', 'Root']
},
ParaId: 'u32',
ParaIdOf: 'ParaId',
ParaInfo: {
scheduling: 'ParaScheduling'
scheduling: 'Scheduling'
},
ParaPastCodeMeta: {
upgradeTimes: 'Vec<BlockNumber>',
lastPruned: 'Option<BlockNumber>'
},
ParachainDispatchOrigin: {
_enum: ['Signed', 'Parachain']
},
ParaScheduling: {
_enum: ['Always', 'Dynamic']
},
Remark: '[u8; 32]',
Retriable: {
_enum: {
Never: 'Null',
WithRetries: 'u32'
}
},
Scheduling: {
_enum: ['Always', 'Dynamic']
},
SigningContext: {
sessionIndex: 'SessionIndex',
parentHash: 'Hash'
},
SlotRange: {
_enum: [
'ZeroZero', // 0
'ZeroOne', // 1,
'ZeroTwo', // 2,
'ZeroThree', // 3,
'OneOne', // 4,
'OneTwo', // 5,
'OneThree', // 6,
'TwoTwo', // 7,
'TwoThree', // 8,
'ThreeThree' // 9
]
_enum: ['ZeroZero', 'ZeroOne', 'ZeroTwo', 'ZeroThree', 'OneOne', 'OneTwo', 'OneThree', 'TwoTwo', 'TwoThree', 'ThreeThree']
},
Statement: {
_enum: {
// This Null is not in the original, however indexes start at 1
Never: 'Null',
Never: 'Null', // starts at 1
Candidate: 'Hash',
Valid: 'Hash',
Invalid: 'Hash'
@@ -122,19 +141,18 @@ export default {
SubId: 'u32',
UpwardMessage: {
origin: 'ParachainDispatchOrigin',
data: 'Bytes'
data: 'Vec<u8>'
},
ValidationCode: 'Bytes',
ValidatorSignature: 'Signature',
ValidityAttestation: {
_enum: {
// This Null is not in the original, however indexes start at 1
Never: 'Null',
Implicit: 'ValidatorSignature', // 1
Explicit: 'ValidatorSignature' // 2
Never: 'Null', // starts at 1
Implicit: 'ValidatorSignature',
Explicit: 'ValidatorSignature'
}
},
ValidatorSignature: 'Signature',
WinningDataEntry: '(AccountId, ParaIdOf, BalanceOf)',
WinningData: '[WinningDataEntry; 10]'
WinningData: `[WinningDataEntry; ${SLOT_RANGE_COUNT}]`,
WinningDataEntry: 'Option<Bidder>'
}
} as Definitions;
@@ -2,15 +2,26 @@
/* eslint-disable */
import { ITuple } from '@polkadot/types/types';
import { Enum, Option, Struct, Vec } from '@polkadot/types/codec';
import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
import { BitVec, Bytes, u32 } from '@polkadot/types/primitive';
import { Signature } from '@polkadot/types/interfaces/extrinsics';
import { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, ValidatorId } from '@polkadot/types/interfaces/runtime';
import { SessionIndex } from '@polkadot/types/interfaces/session';
import { AccountId, Balance, BlockNumber, Hash, ValidatorId } from '@polkadot/types/interfaces/runtime';
import { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session';
/** @name AbridgedCandidateReceipt */
export interface AbridgedCandidateReceipt extends Struct {
readonly parachainIndex: ParaId;
readonly relayParent: Hash;
readonly headData: HeadData;
readonly collator: CollatorId;
readonly signature: CollatorSignature;
readonly povBlockHash: Hash;
readonly commitments: CandidateCommitments;
}
/** @name AttestedCandidate */
export interface AttestedCandidate extends Struct {
readonly candidate: CandidateReceipt;
readonly candidate: AbridgedCandidateReceipt;
readonly validityVotes: Vec<ValidityAttestation>;
readonly validatorIndices: BitVec;
}
@@ -26,21 +37,30 @@ export interface Bidder extends Enum {
readonly asExisting: ParaId;
}
/** @name CandidateCommitments */
export interface CandidateCommitments extends Struct {
readonly fees: Balance;
readonly upwardMessages: Vec<UpwardMessage>;
readonly erasureRoot: Hash;
readonly newValidationCode: Option<ValidationCode>;
readonly processedDownwardMessages: u32;
}
/** @name CandidateReceipt */
export interface CandidateReceipt extends Struct {
readonly parachainIndex: ParaId;
readonly relayParent: Hash;
readonly head_data: HeadData;
readonly collator: CollatorId;
readonly signature: CollatorSignature;
readonly headData: HeadData;
readonly egressQueueRoots: Vec<ITuple<[ParaId, Hash]>>;
readonly fees: Balance;
readonly blockDataHash: Hash;
readonly upwardMessages: Vec<UpwardMessage>;
readonly erasureRoot: Hash;
readonly povBlockHash: Hash;
readonly globalValidation: GlobalValidationSchedule;
readonly localValidation: LocalValidationData;
readonly commitments: CandidateCommitments;
}
/** @name CollatorId */
export interface CollatorId extends H256 {}
export interface CollatorId extends U8aFixed {}
/** @name CollatorSignature */
export interface CollatorSignature extends Signature {}
@@ -48,23 +68,26 @@ export interface CollatorSignature extends Signature {}
/** @name DoubleVoteReport */
export interface DoubleVoteReport extends Struct {
readonly identity: ValidatorId;
readonly first: DoubleVoteReportStatement;
readonly second: DoubleVoteReportStatement;
readonly proof: DoubleVoteReportProof;
readonly first: ITuple<[Statement, ValidatorSignature]>;
readonly second: ITuple<[Statement, ValidatorSignature]>;
readonly proof: MembershipProof;
readonly signingContext: SigningContext;
}
/** @name DoubleVoteReportProof */
export interface DoubleVoteReportProof extends Struct {
readonly session: SessionIndex;
readonly trieNodes: Vec<Bytes>;
/** @name DownwardMessage */
export interface DownwardMessage extends Enum {
readonly isTransferInto: boolean;
readonly asTransferInto: ITuple<[AccountId, Balance, Remark]>;
readonly isOpaque: boolean;
readonly asOpaque: Bytes;
}
/** @name DoubleVoteReportStatement */
export interface DoubleVoteReportStatement extends ITuple<[Statement, ValidatorSignature]> {}
/** @name EgressQueueRoot */
export interface EgressQueueRoot extends ITuple<[ParaId, Hash]> {}
/** @name GlobalValidationSchedule */
export interface GlobalValidationSchedule extends Struct {
readonly maxCodeSize: u32;
readonly maxHeadDataSize: u32;
readonly blockNumber: BlockNumber;
}
/** @name HeadData */
export interface HeadData extends Bytes {}
@@ -81,14 +104,15 @@ export interface IncomingParachain extends Enum {
/** @name IncomingParachainDeploy */
export interface IncomingParachainDeploy extends Struct {
readonly code: Bytes;
readonly initialHeadData: Bytes;
readonly code: ValidationCode;
readonly initialHeadData: HeadData;
}
/** @name IncomingParachainFixed */
export interface IncomingParachainFixed extends Struct {
readonly codeHash: Hash;
readonly initialHeadData: Bytes;
readonly codeSize: u32;
readonly initialHeadData: HeadData;
}
/** @name LeasePeriod */
@@ -97,6 +121,13 @@ export interface LeasePeriod extends BlockNumber {}
/** @name LeasePeriodOf */
export interface LeasePeriodOf extends LeasePeriod {}
/** @name LocalValidationData */
export interface LocalValidationData extends Struct {
readonly parentHead: HeadData;
readonly balance: Balance;
readonly codeUpgradeAllowed: Option<BlockNumber>;
}
/** @name NewBidder */
export interface NewBidder extends Struct {
readonly who: AccountId;
@@ -107,17 +138,15 @@ export interface NewBidder extends Struct {
export interface ParachainDispatchOrigin extends Enum {
readonly isSigned: boolean;
readonly isParachain: boolean;
readonly isRoot: boolean;
}
/** @name ParaId */
export interface ParaId extends u32 {}
/** @name ParaIdOf */
export interface ParaIdOf extends ParaId {}
/** @name ParaInfo */
export interface ParaInfo extends Struct {
readonly scheduling: ParaScheduling;
readonly scheduling: Scheduling;
}
/** @name ParaPastCodeMeta */
@@ -132,6 +161,9 @@ export interface ParaScheduling extends Enum {
readonly isDynamic: boolean;
}
/** @name Remark */
export interface Remark extends U8aFixed {}
/** @name Retriable */
export interface Retriable extends Enum {
readonly isNever: boolean;
@@ -139,6 +171,12 @@ export interface Retriable extends Enum {
readonly asWithRetries: u32;
}
/** @name Scheduling */
export interface Scheduling extends Enum {
readonly isAlways: boolean;
readonly isDynamic: boolean;
}
/** @name SigningContext */
export interface SigningContext extends Struct {
readonly sessionIndex: SessionIndex;
@@ -198,6 +236,6 @@ export interface ValidityAttestation extends Enum {
export interface WinningData extends Vec<WinningDataEntry> {}
/** @name WinningDataEntry */
export interface WinningDataEntry extends ITuple<[AccountId, ParaIdOf, BalanceOf]> {}
export interface WinningDataEntry extends Option<Bidder> {}
export type PHANTOM_PARACHAINS = 'parachains';
@@ -2,7 +2,8 @@
/* eslint-disable */
import { Struct } from '@polkadot/types/codec';
import { Balance, DispatchClass, Weight } from '@polkadot/types/interfaces/runtime';
import { Balance, Weight } from '@polkadot/types/interfaces/runtime';
import { DispatchClass } from '@polkadot/types/interfaces/system';
/** @name RuntimeDispatchInfo */
export interface RuntimeDispatchInfo extends Struct {
@@ -39,23 +39,6 @@ export default {
PreRuntime: 'PreRuntime' // 6
}
},
DispatchClass: {
_enum: ['Normal', 'Operational', 'Mandatory']
},
DispatchInfo: {
weight: 'Weight',
class: 'DispatchClass',
paysFee: 'Pays'
},
DispatchInfoTo190: {
weight: 'Weight',
class: 'DispatchClass'
},
DispatchInfoTo244: {
weight: 'Weight',
class: 'DispatchClass',
paysFee: 'bool'
},
ExtrinsicsWeight: {
normal: 'Weight',
operational: 'Weight'
@@ -92,6 +75,12 @@ export default {
Perquintill: 'u64',
Phantom: 'Null',
PhantomData: 'Null',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking']
},
Releases: {
_enum: ['V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'V8', 'V9', 'V10']
},
RuntimeDbWeight: {
read: 'Weight',
write: 'Weight'
+23 -28
View File
@@ -4,7 +4,7 @@
import { ITuple } from '@polkadot/types/types';
import { Compact, Enum, Int, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
import { GenericAccountId, GenericAccountIndex, GenericAddress, GenericBlock, GenericCall, GenericConsensusEngineId } from '@polkadot/types/generic';
import { Bytes, DoNotConstruct, Null, StorageKey, bool, u128, u32, u64, u8 } from '@polkadot/types/primitive';
import { Bytes, DoNotConstruct, Null, StorageKey, u128, u32, u64, u8 } from '@polkadot/types/primitive';
import { AuthorityId } from '@polkadot/types/interfaces/consensus';
import { Signature } from '@polkadot/types/interfaces/extrinsics';
@@ -73,33 +73,6 @@ export interface DigestItem extends Enum {
readonly asPreRuntime: PreRuntime;
}
/** @name DispatchClass */
export interface DispatchClass extends Enum {
readonly isNormal: boolean;
readonly isOperational: boolean;
readonly isMandatory: boolean;
}
/** @name DispatchInfo */
export interface DispatchInfo extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
readonly paysFee: Pays;
}
/** @name DispatchInfoTo190 */
export interface DispatchInfoTo190 extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
}
/** @name DispatchInfoTo244 */
export interface DispatchInfoTo244 extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
readonly paysFee: bool;
}
/** @name ExtrinsicsWeight */
export interface ExtrinsicsWeight extends Struct {
readonly normal: Weight;
@@ -190,6 +163,28 @@ export interface PhantomData extends Null {}
/** @name PreRuntime */
export interface PreRuntime extends ITuple<[ConsensusEngineId, Bytes]> {}
/** @name ProxyType */
export interface ProxyType extends Enum {
readonly isAny: boolean;
readonly isNonTransfer: boolean;
readonly isGovernance: boolean;
readonly isStaking: boolean;
}
/** @name Releases */
export interface Releases extends Enum {
readonly isV1: boolean;
readonly isV2: boolean;
readonly isV3: boolean;
readonly isV4: boolean;
readonly isV5: boolean;
readonly isV6: boolean;
readonly isV7: boolean;
readonly isV8: boolean;
readonly isV9: boolean;
readonly isV10: boolean;
}
/** @name RuntimeDbWeight */
export interface RuntimeDbWeight extends Struct {
readonly read: Weight;
@@ -51,9 +51,10 @@ export default {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, Exposure)>'
},
ElectionScore: '[u128; 3]',
ElectionSize: {
validators: 'ValidatorIndex',
nominators: 'NominatorIndex'
validators: 'Compact<ValidatorIndex>',
nominators: 'Compact<NominatorIndex>'
},
ElectionStatus: {
_enum: {
@@ -99,9 +100,6 @@ export default {
PerU16: 'u16',
PhragmenScore: '[u128; 3]',
Points: 'u32',
ReleasesStaking: {
_enum: ['V1_0_0', 'V2_0_0', 'V3_0_0']
},
RewardDestination: {
_enum: [
'Staked',
@@ -50,10 +50,13 @@ export interface ElectionResult extends Struct {
readonly exposures: Vec<ITuple<[AccountId, Exposure]>>;
}
/** @name ElectionScore */
export interface ElectionScore extends Vec<u128> {}
/** @name ElectionSize */
export interface ElectionSize extends Struct {
readonly validators: ValidatorIndex;
readonly nominators: NominatorIndex;
readonly validators: Compact<ValidatorIndex>;
readonly nominators: Compact<NominatorIndex>;
}
/** @name ElectionStatus */
@@ -133,13 +136,6 @@ export interface PhragmenScore extends Vec<u128> {}
/** @name Points */
export interface Points extends u32 {}
/** @name ReleasesStaking */
export interface ReleasesStaking extends Enum {
readonly isV100: boolean;
readonly isV200: boolean;
readonly isV300: boolean;
}
/** @name RewardDestination */
export interface RewardDestination extends Enum {
readonly isStaked: boolean;
@@ -9,6 +9,33 @@ import { Definitions } from '../../types';
export default {
rpc: {
accountNextIndex: {
alias: ['account_nextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
},
dryRun: {
alias: ['system_dryRunAt'],
description: 'Dry run an extrinsic at a given block',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
name: 'at',
type: 'BlockHash',
isOptional: true
}
],
type: 'ApplyExtrinsicResult'
},
name: {
description: 'Retrieves the node name',
params: [],
@@ -91,6 +118,7 @@ export default {
refcount: 'RefCount',
data: 'AccountData'
},
ApplyExtrinsicResult: 'Result<DispatchOutcome, TransactionValidityError>',
ChainProperties: {
ss58Format: 'Option<u8>',
tokenDecimals: 'Option<u32>',
@@ -105,6 +133,9 @@ export default {
}
},
DigestOf: 'Digest',
DispatchClass: {
_enum: ['Normal', 'Operational', 'Mandatory']
},
DispatchError: {
_enum: {
Other: 'Null',
@@ -121,6 +152,21 @@ export default {
module: 'Option<u8>',
error: 'u8'
},
DispatchInfo: {
weight: 'Weight',
class: 'DispatchClass',
paysFee: 'Pays'
},
DispatchInfoTo190: {
weight: 'Weight',
class: 'DispatchClass'
},
DispatchInfoTo244: {
weight: 'Weight',
class: 'DispatchClass',
paysFee: 'bool'
},
DispatchOutcome: 'Result<(), DispatchError>',
DispatchResult: 'Result<(), DispatchError>',
DispatchResultOf: 'DispatchResult',
DispatchResultTo198: 'Result<(), Text>',
@@ -141,6 +187,20 @@ export default {
isSyncing: 'bool',
shouldHavePeers: 'bool'
},
InvalidTransaction: {
_enum: {
Call: 'Null',
Payment: 'Null',
Future: 'Null',
Stale: 'Null',
BadProof: 'Null',
AncientBirthBlock: 'Null',
ExhaustsResources: 'Null',
Custom: 'u8',
BadMandatory: 'Null',
MandatoryDispatch: 'Null'
}
},
Key: 'Bytes',
LastRuntimeUpgradeInfo: {
specVersion: 'Compact<u32>',
@@ -214,6 +274,19 @@ export default {
Initialization: 'Null'
}
},
RefCount: 'u8'
RefCount: 'u8',
TransactionValidityError: {
_enum: {
Invalid: 'InvalidTransaction',
Unknown: 'UnknownTransaction'
}
},
UnknownTransaction: {
_enum: {
CannotLookup: 'Null',
NoUnsignedValidator: 'Null',
Custom: 'u8'
}
}
}
} as Definitions;
+75 -1
View File
@@ -6,7 +6,7 @@ import { Compact, Enum, HashMap, Option, Result, Struct, U8aFixed, Vec } from '@
import { GenericEvent } from '@polkadot/types/generic';
import { Bytes, Text, bool, u32, u64, u8 } from '@polkadot/types/primitive';
import { AccountData } from '@polkadot/types/interfaces/balances';
import { BlockNumber, Digest, Hash, Index } from '@polkadot/types/interfaces/runtime';
import { BlockNumber, Digest, Hash, Index, Pays, Weight } from '@polkadot/types/interfaces/runtime';
/** @name AccountInfo */
export interface AccountInfo extends Struct {
@@ -15,6 +15,14 @@ export interface AccountInfo extends Struct {
readonly data: AccountData;
}
/** @name ApplyExtrinsicResult */
export interface ApplyExtrinsicResult extends Result<DispatchOutcome, TransactionValidityError> {
readonly isError: boolean;
readonly asError: TransactionValidityError;
readonly isOk: boolean;
readonly asOk: DispatchOutcome;
}
/** @name ChainProperties */
export interface ChainProperties extends Struct {
readonly ss58Format: Option<u8>;
@@ -34,6 +42,13 @@ export interface ChainType extends Enum {
/** @name DigestOf */
export interface DigestOf extends Digest {}
/** @name DispatchClass */
export interface DispatchClass extends Enum {
readonly isNormal: boolean;
readonly isOperational: boolean;
readonly isMandatory: boolean;
}
/** @name DispatchError */
export interface DispatchError extends Enum {
readonly isOther: boolean;
@@ -55,6 +70,34 @@ export interface DispatchErrorTo198 extends Struct {
readonly error: u8;
}
/** @name DispatchInfo */
export interface DispatchInfo extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
readonly paysFee: Pays;
}
/** @name DispatchInfoTo190 */
export interface DispatchInfoTo190 extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
}
/** @name DispatchInfoTo244 */
export interface DispatchInfoTo244 extends Struct {
readonly weight: Weight;
readonly class: DispatchClass;
readonly paysFee: bool;
}
/** @name DispatchOutcome */
export interface DispatchOutcome extends Result<ITuple<[]>, DispatchError> {
readonly isError: boolean;
readonly asError: DispatchError;
readonly isOk: boolean;
readonly asOk: ITuple<[]>;
}
/** @name DispatchResult */
export interface DispatchResult extends Result<ITuple<[]>, DispatchError> {
readonly isError: boolean;
@@ -103,6 +146,21 @@ export interface Health extends Struct {
readonly shouldHavePeers: bool;
}
/** @name InvalidTransaction */
export interface InvalidTransaction extends Enum {
readonly isCall: boolean;
readonly isPayment: boolean;
readonly isFuture: boolean;
readonly isStale: boolean;
readonly isBadProof: boolean;
readonly isAncientBirthBlock: boolean;
readonly isExhaustsResources: boolean;
readonly isCustom: boolean;
readonly asCustom: u8;
readonly isBadMandatory: boolean;
readonly isMandatoryDispatch: boolean;
}
/** @name Key */
export interface Key extends Bytes {}
@@ -199,4 +257,20 @@ export interface Phase extends Enum {
/** @name RefCount */
export interface RefCount extends u8 {}
/** @name TransactionValidityError */
export interface TransactionValidityError extends Enum {
readonly isInvalid: boolean;
readonly asInvalid: InvalidTransaction;
readonly isUnknown: boolean;
readonly asUnknown: UnknownTransaction;
}
/** @name UnknownTransaction */
export interface UnknownTransaction extends Enum {
readonly isCannotLookup: boolean;
readonly isNoUnsignedValidator: boolean;
readonly isCustom: boolean;
readonly asCustom: u8;
}
export type PHANTOM_SYSTEM = 'system';
-1
View File
@@ -35,7 +35,6 @@ export * from './claims/types';
export * from './parachains/types';
export * from './metadata/types';
export * from './rpc/types';
export * from './account/types';
export * from './author/types';
export * from './chain/types';
export * from './childstate/types';
@@ -0,0 +1,523 @@
{
"jsonrpc": "2.0",
"result": {
"background": [],
"best": {
"precommits": {
"currentWeight": 0,
"missing": [
"Cc2YhyWFfeXv5jfAsFnBKaHr2V5atN4wf6LubeSMpWBUNpa",
"CfTYiCjhcit9N7EJNjAYv3rku6H8uSn6E6TTmmM1NrwdYKB",
"Cicfcxq9fNSVV64wsgqHpLSBedY5TzB1hr6fESXoL5UYZ4x",
"CiqujmJXHwNkg2WVNn6DR9e5TrYD7YkQZ3myExygkKqhpz8",
"CkXk1WRGEb8ZJU1M5W5oHcEgAq9drBRdLac4QjHQwE4bGep",
"CmdHZ3MLTHJhgHTkyC1bm6kwFyGuhCSWcvs5e5DnRWJULRX",
"CoHt3KzCuuFsoT3sftmARcvJ8NF414RvPfaXrRKUg5HAHFh",
"CoUxi1tafPBMRx9yAwsuHZKR9qC8cXkp3d3h63jQJiWJN3Z",
"Cp5Yg6ZUYXFWPpXfkjfQC2Vq9UMtRdAkBVx8BgV94ted3kU",
"CpUj9JPRwKi27GPtxEznxKDbYVW9MYCcz4pJy5VUFVoyEks",
"Cq5fjZKywKh3pNrNNEHyYsAXgfXZD6TMEc8B7BP2CjG5gHQ",
"Cqix2rD93Mdf7ytg8tBavAig2TvhXPgPZ2mejQvkq7qgRPq",
"Cs9HdXcS6hXdAnCMDqCqx1ncqAteiLSQD7GLJLDEStfz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vXCeeovK8cCcywvHUj4uhiWQXQNd7",
"HzrQ8JziKrwSsxuidobfX6XVNhKFyQLYfULkVMWymDUf7pA",
"J4BMGF4W9yWiJz4pkhQW73X6QMGpKUzmPppVnqzBCqw5dQq",
"J4ibGw1bqrSkwsw43rUf9w6hyXCxZKrdZJEkcfH7E4yzAL6",
"J62bGdbHT4f3R7aeG1Tt5y9f11bJZLBZUAeZpDaX3HR3oXx",
"J6f5w6eydwAi7pcPy8TNDnYMnBvvZyVXwjQVnJvH8YzUQvd",
"J8jwjHCEGAhWSiTAUyC62Df1H8hUKqQsVYdCKvusRipHWHy",
"J8vr5XuCMjUXfnvQdrZ2M2cWsykk8Wae79uCDEiWymmU8Bh",
"JAXs5Hp5AEB2nHDbJUsUZdnGaH8TnEyv3pquPHAorK5kkh1",
"JBsSffyWTv5vvy3VJ4ro3VSg4NwiiHGe9aCcLTfW2TLWiCt",
"JCBp59HSq5mZigc2v57PFeafPVg5KcSu3e2DCW39aPxSzvY",
"JE3pk8v6QYhHGJtuPh2R82DDPLQBFsMSBYbqXMsa4bbJpVC",
"JEnSTZJpLh91cSryptj57RtFxq9xXqf4U5wBH3qoP91ZZhN",
"JH4xgpSTLqMn4Mo8xBtUitezsvpqTwYN9G7GDpH6wWwyMCG",
"JKyTzmQVXE17pu1wbqHphyaKoTdqg1J5g7C15iEuK8LGKC4",
"JLnxrPb3QEXhVVBxKWaQhchDWgmwJKhY957iz19f1X8kiv2"
]
},
"round": 2195,
"thresholdWeight": 167,
"totalWeight": 250
},
"setId": 961
},
"id": 35
}
+5 -1
View File
@@ -2,6 +2,8 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Codec } from './codec';
import BN from 'bn.js';
// We cannot inline this into CodecArg, TS thrws up when building docs
@@ -26,4 +28,6 @@ export type ArrayElementType<T extends ReadonlyArray<unknown>> = T extends Reado
export type BareOpts = boolean | Record<string, boolean>;
export type Callback<T> = (result: T) => void | Promise<void>;
export type Callback<T, E = undefined> = E extends Codec
? (result: T, extra: E) => void | Promise<void>
: (result: T) => void | Promise<void>;
+1 -1
View File
@@ -121,7 +121,7 @@ export interface Registry {
findMetaEvent (eventIndex: Uint8Array): Constructor<any>;
createClass <K extends keyof InterfaceTypes> (type: K): Constructor<InterfaceTypes[K]>;
createType <K extends keyof InterfaceTypes> (type: K, ...params: any[]): InterfaceTypes[K];
createType <K extends keyof InterfaceTypes> (type: K, ...params: unknown[]): InterfaceTypes[K];
get <T extends Codec = Codec> (name: string, withUnknown?: boolean): Constructor<T> | undefined;
getChainProperties (): ChainProperties | undefined;
getDefinition (name: string): string | undefined;
+1965 -1438
View File
File diff suppressed because it is too large Load Diff