Compare commits

...
181 Commits
Author SHA1 Message Date
github-actions[bot] bb75b42273 [CI Skip] release/stable 7.14.2
skip-checks: true
2022-03-28 05:23:21 +00:00
Jaco 949e429d04 Don't export ScProvider top-level in @polkadot/rpc-provider (#4694)
* Don't export `ScProvider` top-level in `@polkadot/rpc-provider`

* 7.14.2
2022-03-28 08:12:33 +03:00
github-actions[bot] 0b1c20efd7 [CI Skip] release/stable 7.14.1
skip-checks: true
2022-03-27 08:29:36 +00:00
Jaco 0536998766 Correct release to 7.14.1 (#4691) 2022-03-27 11:19:58 +03:00
Jaco 22651eb4b8 8.14.1 (#4690) 2022-03-27 11:00:19 +03:00
github-actions[bot] 48414bdb34 [CI Skip] release/beta 7.13.2-10
skip-checks: true
2022-03-27 06:34:39 +00:00
Jaco 2ff6a85fb3 Bump TypeScript (#4689) 2022-03-27 09:27:11 +03:00
github-actions[bot] 8be1f337a8 [CI Skip] release/beta 7.13.2-9
skip-checks: true
2022-03-25 16:31:07 +00:00
Jaco 2c7056da25 Bump dev (& update CHANGELOG) (#4687) 2022-03-25 18:20:15 +02:00
github-actions[bot] b53c22d6d3 [CI Skip] release/beta 7.13.2-8
skip-checks: true
2022-03-25 15:56:15 +00:00
Josep M SobrepereandJaco 17f316b7c7 Add smoldot rpc provider (#4672)
* Add smoldot rpc provider

* remove smoldot references and fix lint issues

* fix wrong export

* Update packages/rpc-provider/src/substrate-connect/createScClient.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* Update packages/rpc-provider/src/substrate-connect/createScClient.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* Update packages/rpc-provider/src/substrate-connect/Health.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* fix linting on `createScClient.ts`

* fix linting on `Health.ts`

* use @polkadotjs/utils

* remove @substrate/connect

* add @substrate/connect

* fixt linting issues

* export `ScProvider` class

* fix connecting to dependency

* make ScProvider lazy

* dendency -> sharedSandbox

* use @substrate/connect@0.7.0-alpha.0

* fix bundle.ts export

Co-authored-by: Jaco <jacogr@gmail.com>
2022-03-25 17:46:24 +02:00
github-actions[bot] b44fcc90b2 [CI Skip] release/beta 7.13.2-7
skip-checks: true
2022-03-24 18:19:20 +00:00
Jaco b4e477a8c1 Remove all README links (#4685) 2022-03-24 20:09:16 +02:00
github-actions[bot] 4b921c8a55 [CI Skip] release/beta 7.13.2-6
skip-checks: true
2022-03-24 10:13:45 +00:00
Yaroslav Bolyukin e53231b70a Support BTreeMap/BTreeSet in typegen (#4682) 2022-03-24 12:04:14 +02:00
github-actions[bot] afd1db58ac [CI Skip] release/beta 7.13.2-5
skip-checks: true
2022-03-23 14:18:04 +00:00
Jaco 63ba84a641 Clear connection timeout on disconnect (#4681) 2022-03-23 16:09:25 +02:00
github-actions[bot] 044aecbfc3 [CI Skip] release/beta 7.13.2-4
skip-checks: true
2022-03-23 05:29:10 +00:00
Jaco e573c26df3 Bump dev (#4679) 2022-03-23 07:19:33 +02:00
github-actions[bot] 31e7de31f3 [CI Skip] release/beta 7.13.2-3
skip-checks: true
2022-03-22 14:26:51 +00:00
Jaco 7cd9c16eae Add dev_getBlockStats RPC (#4677)
* Add dev_getBlockStats RPC

* CHANGELOG
2022-03-22 16:18:13 +02:00
github-actions[bot] 2b1a7da446 [CI Skip] release/beta 7.13.2-2
skip-checks: true
2022-03-22 07:49:36 +00:00
Jaco 9399c8d24f Output BitVec toHuman to LSB (limit support) (#4676) 2022-03-22 09:41:17 +02:00
github-actions[bot] 798e5fcc78 [CI Skip] release/beta 7.13.2-1
skip-checks: true
2022-03-22 07:05:38 +00:00
Jaco d8ad237b00 Add total.bytes{Recv, Sent} to provider stats (#4671) 2022-03-22 08:54:42 +02:00
github-actions[bot] 550cb10766 [CI Skip] release/beta 7.13.2-0
skip-checks: true
2022-03-22 06:52:53 +00:00
Jaco a44108c3f3 Exatra BitVec namespaces top-level (#4674) 2022-03-22 08:43:08 +02:00
github-actions[bot] 2f28ea0ea8 [CI Skip] release/stable 7.13.1
skip-checks: true
2022-03-19 11:41:58 +00:00
Jaco 488d078b9c 7.13.1 (#4670)
* 7.13.1

* typo
2022-03-19 13:33:35 +02:00
github-actions[bot] ba384cee78 [CI Skip] release/beta 7.12.2-9
skip-checks: true
2022-03-19 09:06:14 +00:00
Jaco 4f95f33cbb Bump util (#4668) 2022-03-19 10:58:21 +02:00
github-actions[bot] 368cb8314c [CI Skip] release/beta 7.12.2-8
skip-checks: true
2022-03-19 07:51:35 +00:00
Jaco c01896d24f Bump babel & dev (#4667) 2022-03-19 09:43:03 +02:00
github-actions[bot] 983043bd1e [CI Skip] release/beta 7.12.2-7
skip-checks: true
2022-03-18 15:17:52 +00:00
MOZGIII 9c2ed6297a Follow-up fix after #4665 (#4666)
* Fix a small nit

* Correct a newly discovered type issue
2022-03-18 17:09:41 +02:00
github-actions[bot] 8a7fee5903 [CI Skip] release/beta 7.12.2-6
skip-checks: true
2022-03-18 14:41:33 +00:00
MOZGIII b0e8a8512a Allow generic Data param at RpcError (#4665)
* Allow generic Data param at RpcError

* Ensure that unless `Data` is specified, the field can't be accessed
2022-03-18 16:33:14 +02:00
github-actions[bot] f83d23d0f6 [CI Skip] release/beta 7.12.2-5
skip-checks: true
2022-03-18 07:50:30 +00:00
Jaco 9dfb5cb237 state_trieMigrationStatus RPC (#4664) 2022-03-18 09:40:37 +02:00
github-actions[bot] 8c87b16924 [CI Skip] release/beta 7.12.2-4
skip-checks: true
2022-03-17 19:01:11 +00:00
Jaco 0d5dce002d Bump static metadata (#4663) 2022-03-17 20:51:10 +02:00
github-actions[bot] 4d0c777a8f [CI Skip] release/beta 7.12.2-3
skip-checks: true
2022-03-17 15:41:45 +00:00
Jaco d63108a4b4 Add basic provider stats (#4662)
* Add basic provider stats

* Add timeout counter

* Make stats() optional for providers (don't break what is out there)

* Update packages/rpc-provider/src/types.ts
2022-03-17 17:33:40 +02:00
github-actions[bot] 5898ac335e [CI Skip] release/beta 7.12.2-2
skip-checks: true
2022-03-17 08:24:12 +00:00
Jaco f108d16d1b RPC timeouts (#4661)
* RPC timeouts

* for loop
2022-03-17 10:14:26 +02:00
github-actions[bot] 32f1495993 [CI Skip] release/beta 7.12.2-1
skip-checks: true
2022-03-17 05:45:53 +00:00
Jaco 2527497e4a Bump dev deps (#4658)
* Bump dev deps

* trigger
2022-03-17 07:37:40 +02:00
github-actions[bot] e50209da0d [CI Skip] release/beta 7.12.2-0
skip-checks: true
2022-03-15 06:28:29 +00:00
Noah Corona cccd512d70 Add rpc error fields (#4637)
* [WIP] Add RpcError

Currently located in rpc-core at request of maintainer. However unclear as to how it should be used, because the error
needs to be thrown in rpc-provider, and depending on it causes a dependency loop.

* Move `RpcError` to `rpc-provider`

Also add tests
2022-03-15 08:20:16 +02:00
github-actions[bot] 1db2136a3d [CI Skip] release/stable 7.12.1
skip-checks: true
2022-03-13 09:50:36 +00:00
Jaco 466485d5aa 7.12.1 (#4653) 2022-03-13 11:39:47 +02:00
github-actions[bot] c9ea333add [CI Skip] release/beta 7.11.2-8
skip-checks: true
2022-03-12 10:15:28 +00:00
Jaco dca62cf3ba Bump common (#4652) 2022-03-12 12:06:50 +02:00
github-actions[bot] 2d9e667d01 [CI Skip] release/beta 7.11.2-7
skip-checks: true
2022-03-11 12:02:08 +00:00
Jaco 67679f34e9 Align CHANGELOG (#4650)
* Align CHANGELOG

* Typos
2022-03-11 13:54:11 +02:00
github-actions[bot] d646fa03af [CI Skip] release/beta 7.11.2-6
skip-checks: true
2022-03-11 06:17:48 +00:00
Jaco 6c33e98553 Ensure Option<None> of different type evaluates to None (#4647) 2022-03-11 08:09:21 +02:00
github-actions[bot] e8cdbf9e80 [CI Skip] release/beta 7.11.2-5
skip-checks: true
2022-03-10 18:51:25 +00:00
Jaco 5016e12ae4 Fix conversion of metadata prior to <= V11 to V14 (#4646) 2022-03-10 20:41:09 +02:00
github-actions[bot] ac09179768 [CI Skip] release/beta 7.11.2-4
skip-checks: true
2022-03-10 08:08:05 +00:00
Jaco 8cc1663bd8 Bump deps (#4644) 2022-03-10 09:57:55 +02:00
github-actions[bot] 34d090c9b3 [CI Skip] release/beta 7.11.2-3
skip-checks: true
2022-03-09 11:37:47 +00:00
Jaco cb1d13e04c Add lookup types to the registry (#4642)
* Add lookup types to the registry

* Adjust
2022-03-09 13:29:31 +02:00
github-actions[bot] 022d79c4cd [CI Skip] release/beta 7.11.2-2
skip-checks: true
2022-03-09 09:53:38 +00:00
Jaco ed079a6acb Adjust registry augment location (#4641) 2022-03-09 11:44:54 +02:00
github-actions[bot] 01d023d141 [CI Skip] release/beta 7.11.2-1
skip-checks: true
2022-03-08 11:08:05 +00:00
Jaco 0b03f73975 Allow for (ab)use of Option<Null>/Option<()> as a boolean (#4639)
* Allow for (ab)use of Option<Null> as a boolean

* Additional test for ()

* Adjust
2022-03-08 12:58:33 +02:00
github-actions[bot] e4cae64187 [CI Skip] release/beta 7.11.2-0
skip-checks: true
2022-03-07 08:22:49 +00:00
Jaco f13989d712 Support bundlers where import.meta.url is undefined (#4634) 2022-03-07 10:13:02 +02:00
github-actions[bot] 05c3f12cd7 [CI Skip] release/stable 7.11.1
skip-checks: true
2022-03-06 16:38:04 +00:00
Jaco 9f6f33844a 7.11.1 (#4631)
* 7.11.1

* packageInfo

* Robustness
2022-03-06 18:30:20 +02:00
github-actions[bot] 895f82920d [CI Skip] release/beta 7.10.2-10
skip-checks: true
2022-03-06 09:24:51 +00:00
Jaco 06fa4aa6eb Allow use of options.signer for status updates (#4615)
* Allow use of options.signer for status updates

* Use isFunction as applicable

* Use UpdateInfo

* CHANGELOG
2022-03-06 11:14:50 +02:00
github-actions[bot] 1e5002fb5e [CI Skip] release/beta 7.10.2-9
skip-checks: true
2022-03-06 08:36:08 +00:00
Jaco 8be52dec13 Apply chunking to era{Exposure, Prefs, Slashes} (#4620)
* Apply chunking to era{Exposure, Prefs, Slashes}

* CHANGELOG

* Failsafe return location

* typo
2022-03-06 10:26:43 +02:00
github-actions[bot] 8fcda8cd54 [CI Skip] release/beta 7.10.2-8
skip-checks: true
2022-03-06 08:02:44 +00:00
Jaco d08c306887 Bump metadata (#4630) 2022-03-06 09:54:02 +02:00
github-actions[bot] eb6b0232c3 [CI Skip] release/beta 7.10.2-7
skip-checks: true
2022-03-06 06:50:29 +00:00
Jaco e5fbaeb7cd Bump deps (#4629) 2022-03-06 08:42:51 +02:00
github-actions[bot] 8e61ea1b8b [CI Skip] release/beta 7.10.2-6
skip-checks: true
2022-03-04 10:32:35 +00:00
Jaco 9fe202a4d3 Add Polkadot 9170 upgrade block (#4627) 2022-03-04 12:24:43 +02:00
github-actions[bot] 6e62d03652 [CI Skip] release/beta 7.10.2-5
skip-checks: true
2022-03-04 07:51:56 +00:00
Jaco 49dc66f7d4 Adjust auto actions (#4626)
* Adjust auto actions

* Adjust
2022-03-04 09:43:58 +02:00
github-actions[bot] 22320f9995 [CI Skip] release/beta 7.10.2-4
skip-checks: true
2022-03-03 09:39:17 +00:00
Jaco 7603bad434 Remove checkout from auto-{approve, merge} actions (#4624) 2022-03-03 11:29:15 +02:00
github-actions[bot] e82f0f35ad [CI Skip] release/beta 7.10.2-3
skip-checks: true
2022-03-02 05:22:27 +00:00
Jaco ae0aa14eb8 Replace mergify with action (#4619) 2022-03-02 07:14:42 +02:00
github-actions[bot] 4875bb9990 [CI Skip] release/beta 7.10.2-2
skip-checks: true
2022-03-01 11:16:01 +00:00
Jacoandmergify[bot] a0308dd25a Bump TS (#4616)
* Bump TS

* Adjust

* Adjust Observable Codec returns

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-01 11:08:20 +00:00
github-actions[bot] edb06d971a [CI Skip] release/beta 7.10.2-1
skip-checks: true
2022-02-28 10:44:59 +00:00
Jacoandmergify[bot] 271a4d8fd7 Kusama 9170 upgrade block (#4613)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-28 10:26:56 +00:00
github-actions[bot] a71e5ad95c [CI Skip] release/beta 7.10.2-0
skip-checks: true
2022-02-28 07:34:42 +00:00
Jaco edcdb70e8a Adjust approve workflow (#4612) 2022-02-28 07:13:43 +00:00
github-actions[bot] 17357f6b99 [CI Skip] release/stable 7.10.1
skip-checks: true
2022-02-27 08:04:03 +00:00
Jaco c596a8cb51 7.10.1 (#4609) 2022-02-27 09:42:16 +02:00
github-actions[bot] bdf13b10e5 [CI Skip] release/beta 7.9.2-12
skip-checks: true
2022-02-27 07:15:02 +00:00
coolcorexixandphat.itern 519a12f19a Investigate 4559 v2 (#4608)
* first build

* second build, area of defect found

* third build, fixed the problem successfully

* cleaning up after receving maintainer's response

Co-authored-by: phat.itern <phatNfqAsia>
2022-02-27 08:50:54 +02:00
github-actions[bot] beffc7b754 [CI Skip] release/beta 7.9.2-11
skip-checks: true
2022-02-26 08:51:00 +00:00
Jaco d5ae7031cd Metadata bump (#4606)
* Metadata bump

* Detect BitSequence order

* Adjust
2022-02-26 10:29:41 +02:00
github-actions[bot] 8aff13b827 [CI Skip] release/beta 7.9.2-10
skip-checks: true
2022-02-25 11:03:13 +00:00
Jaco a23b3f953b Retrieve named reserves (#4602) 2022-02-25 12:40:35 +02:00
github-actions[bot] 1249c46019 [CI Skip] release/beta 7.9.2-9
skip-checks: true
2022-02-24 18:44:58 +00:00
Jaco 2aaf52bb92 Use assertUnreachable from @polkadot/util (#4600) 2022-02-24 18:28:34 +00:00
github-actions[bot] 3372898f82 [CI Skip] release/beta 7.9.2-8
skip-checks: true
2022-02-24 06:38:41 +00:00
Jacoandmergify[bot] ed2f512cfc Don't auto-attach lookup to registry (#4599)
* Don't auto-attach lookup to registry

* CHANGELOG

* Add base u* types

* s/compatTypes/specs/

* CHANGELOG

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-24 06:31:06 +00:00
github-actions[bot] 00147df500 [CI Skip] release/beta 7.9.2-7
skip-checks: true
2022-02-24 05:52:26 +00:00
Jacoandmergify[bot] 3b0c8887d7 Add chain.getBlockByNumber (#4598)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-24 05:42:58 +00:00
github-actions[bot] 16452233b2 [CI Skip] release/beta 7.9.2-6
skip-checks: true
2022-02-23 10:43:52 +00:00
Jaco 5bf87262bc Skip job on non-local repo 2022-02-23 12:33:41 +02:00
github-actions[bot] b8e01fd674 [CI Skip] release/beta 7.9.2-5
skip-checks: true
2022-02-23 10:09:24 +00:00
Jaco f8378ba0f7 Use jacogr/action-approve (#4595) 2022-02-23 12:00:15 +02:00
github-actions[bot] afc105400c [CI Skip] release/beta 7.9.2-4
skip-checks: true
2022-02-22 17:27:21 +00:00
Jaco cca1f10563 XcmV2TraitsOutcome test (#4593)
* XcmV2TraitsOutcome test

* Cleanup build with correct references
2022-02-22 17:19:28 +00:00
github-actions[bot] 6cdbbf5372 [CI Skip] release/beta 7.9.2-3
skip-checks: true
2022-02-22 10:06:24 +00:00
Jaco 8c89732eb7 Decoded storage hashers with primary lookup (#4591) 2022-02-22 09:58:36 +00:00
github-actions[bot] ab3ad6b2ca [CI Skip] release/beta 7.9.2-2
skip-checks: true
2022-02-22 09:01:10 +00:00
Jaco 72f427a250 Map initialU8aLength test (#4590) 2022-02-22 08:51:40 +00:00
github-actions[bot] 5b0bd9d4b7 [CI Skip] release/beta 7.9.2-1
skip-checks: true
2022-02-21 18:14:49 +00:00
Jacoandmergify[bot] cd9662ab4c Ensure BTreeSet has the correct decoded length (#4588)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-21 18:07:11 +00:00
github-actions[bot] 13751b6fdf [CI Skip] release/beta 7.9.2-0
skip-checks: true
2022-02-21 10:38:39 +00:00
Jaco 652f8c28a4 Bump dev (#4585) 2022-02-21 10:30:49 +00:00
github-actions[bot] 0bae9138b8 [CI Skip] release/stable 7.9.1
skip-checks: true
2022-02-20 15:23:37 +00:00
Jaco 98e8cac424 7.9.1 (#4580) 2022-02-20 17:15:17 +02:00
github-actions[bot] dca7f208bc [CI Skip] release/beta 7.8.2-9
skip-checks: true
2022-02-20 06:44:31 +00:00
Jacoandmergify[bot] 67ff12885a Align CHANGELOG (#4579)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-20 06:35:03 +00:00
github-actions[bot] 08c53032eb [CI Skip] release/beta 7.8.2-8
skip-checks: true
2022-02-20 06:00:20 +00:00
Scott TwinameandJaco 5da8f21947 Add support for historical BlockNumber rpc methods (#4574)
* Add support for historical BlockNumber rpc methods

* Update function description

* Apply suggestions from code review

Co-authored-by: Jaco <jacogr@gmail.com>
2022-02-20 07:50:41 +02:00
github-actions[bot] 5080b266a0 [CI Skip] release/beta 7.8.2-7
skip-checks: true
2022-02-19 06:51:06 +00:00
Jaco 0186848936 Convert ExactDerive to interface (#4578) 2022-02-19 06:41:12 +00:00
github-actions[bot] d0de35b05b [CI Skip] release/beta 7.8.2-6
skip-checks: true
2022-02-18 08:42:41 +00:00
Jaco 3ded30a0f3 Bump static metadata (#4575)
* Bump static metadata

* previous incarnation of trieIndex
2022-02-18 08:30:55 +00:00
github-actions[bot] 9fef78c5e1 [CI Skip] release/beta 7.8.2-5
skip-checks: true
2022-02-17 10:28:47 +00:00
Jaco b2a7c453c4 Align grandpa_proveFinality with Substrate (#4573) 2022-02-17 10:19:24 +00:00
github-actions[bot] 030258a671 [CI Skip] release/beta 7.8.2-4
skip-checks: true
2022-02-17 06:12:57 +00:00
Scott Twiname 0a85b4839d Fix getting block registry when historical type isn't BlockHash (#4571)
* Fix getting block registry when historical type isn't BlockHash

* Revert change, remove isHistoric from historical BlockNumber fields
2022-02-17 08:05:06 +02:00
github-actions[bot] ad363bac09 [CI Skip] release/beta 7.8.2-3
skip-checks: true
2022-02-16 08:32:56 +00:00
Jaco e0c0a8c583 Bump deps (#4568) 2022-02-16 08:23:40 +00:00
github-actions[bot] f923a31758 [CI Skip] release/beta 7.8.2-2
skip-checks: true
2022-02-15 18:32:20 +00:00
Jaco 416229d976 Bump deps (#4567) 2022-02-15 18:20:37 +00:00
github-actions[bot] 4380c45f17 [CI Skip] release/beta 7.8.2-1
skip-checks: true
2022-02-15 07:53:05 +00:00
Jaco d481aed8cb Add mergify (#4566) 2022-02-15 09:45:10 +02:00
github-actions[bot] ca25983e3e [CI Skip] release/beta 7.8.2-0
skip-checks: true
2022-02-14 15:08:31 +00:00
Jaco f7caa496e4 Kusama 9160 upgrade block (#4565) 2022-02-14 17:00:05 +02:00
github-actions[bot] 3f8e4ce133 [CI Skip] release/stable 7.8.1
skip-checks: true
2022-02-14 12:55:48 +00:00
Jaco 39c99083bc 7.8.1 (#4564) 2022-02-14 14:46:24 +02:00
github-actions[bot] 46aa427f98 [CI Skip] release/beta 7.7.2-17
skip-checks: true
2022-02-14 05:51:41 +00:00
Jaco 6336fc0787 Bump common (#4563) 2022-02-14 07:43:13 +02:00
github-actions[bot] b0532be7df [CI Skip] release/beta 7.7.2-16
skip-checks: true
2022-02-13 12:55:58 +00:00
Jaco e7a5b015e9 Don't run scripts on CI (#4562) 2022-02-13 14:47:33 +02:00
github-actions[bot] 2f07f18a5a [CI Skip] release/beta 7.7.2-15
skip-checks: true
2022-02-11 07:49:46 +00:00
Jaco c92d5b7eb0 Bump metadata (#4558) 2022-02-11 09:40:07 +02:00
github-actions[bot] e340a99eda [CI Skip] release/beta 7.7.2-14
skip-checks: true
2022-02-10 08:29:28 +00:00
Jaco f169ca08a8 Expose txIndex on extrinsic results (#4556)
* Expose txIndex on extrinsic results

* CHANGELOG

* optional txIndex

* Adjust result
2022-02-10 10:20:57 +02:00
github-actions[bot] 898d1593f3 [CI Skip] release/beta 7.7.2-13
skip-checks: true
2022-02-09 18:38:12 +00:00
Keith Ingram 2c8d9563c4 Update contract types and rpc (#4541)
* Update contract types and rpc

* Corrected InstantiateReturnValue

* enum, set fallbacks

* set definition

* underscore
2022-02-09 20:29:43 +02:00
github-actions[bot] 804c0c4887 [CI Skip] release/beta 7.7.2-12
skip-checks: true
2022-02-09 12:11:11 +00:00
Jaco 3b991ce8c7 Ensure camelCase names appear in inspect (#4554) 2022-02-09 14:01:47 +02:00
github-actions[bot] e66cc0fb45 [CI Skip] release/beta 7.7.2-11
skip-checks: true
2022-02-09 10:20:46 +00:00
Jaco 61daa0f2c8 Adjust inspect inner/outer (#4553) 2022-02-09 12:11:53 +02:00
github-actions[bot] 7af315f278 [CI Skip] release/beta 7.7.2-10
skip-checks: true
2022-02-09 08:29:19 +00:00
Jaco e55661ca34 Bump util (#4552) 2022-02-09 10:20:38 +02:00
github-actions[bot] 097a1748fd [CI Skip] release/beta 7.7.2-9
skip-checks: true
2022-02-09 06:19:32 +00:00
Jaco 9c587d378e Bump dev (#4551) 2022-02-09 08:09:28 +02:00
github-actions[bot] 02f99356aa [CI Skip] release/beta 7.7.2-8
skip-checks: true
2022-02-08 16:27:10 +00:00
Jaco cacacec130 Codec.inspect (#4538)
* Codec.inspect

* Additional

* Adjust

* LookupSource

* Some tests

* All base tests

* Tests for BTree{Map, Set}

* Additional tests

* All extended type tests

* Additional

* Native tests

* Adjust

* Struct with names
2022-02-08 18:18:31 +02:00
github-actions[bot] 6d095a042f [CI Skip] release/beta 7.7.2-7
skip-checks: true
2022-02-08 13:41:15 +00:00
Jaco b022ad3154 Bump dev (#4548) 2022-02-08 15:33:06 +02:00
github-actions[bot] e0129aa02e [CI Skip] release/beta 7.7.2-6
skip-checks: true
2022-02-08 12:28:09 +00:00
Jaco dfc200a25a Wrap storage inspect in hasher function (#4547) 2022-02-08 14:18:17 +02:00
github-actions[bot] 85fdbed227 [CI Skip] release/beta 7.7.2-5
skip-checks: true
2022-02-08 11:16:59 +00:00
Jaco 04a23c0f60 Extract the arg types (#4546) 2022-02-08 13:08:29 +02:00
github-actions[bot] 0bf9eb2f3a [CI Skip] release/beta 7.7.2-4
skip-checks: true
2022-02-08 10:43:13 +00:00
Jaco f13462f7cf Add inspect(...args) to storage (#4545) 2022-02-08 12:34:01 +02:00
github-actions[bot] 0754bc45d3 [CI Skip] release/beta 7.7.2-3
skip-checks: true
2022-02-08 07:52:43 +00:00
Jaco e314f51813 Re-enable BitVec tests (#4543)
* Re-enable BitVec tests

* CHANGELOG
2022-02-08 09:42:24 +02:00
github-actions[bot] 5148bc42ae [CI Skip] release/beta 7.7.2-2
skip-checks: true
2022-02-08 04:50:29 +00:00
Scott Twiname b43c848817 Fix isHistorical to isHistoric (#4540) 2022-02-08 06:42:32 +02:00
github-actions[bot] abd2b58b52 [CI Skip] release/beta 7.7.2-1
skip-checks: true
2022-02-07 21:14:51 +00:00
Scott Twiname 2ce1decd99 Add isHistorical field to relevant eth rpc requests (#4539)
Adds `isHistorical` to `BlockNumber` parameters for eth rpc requests that support querying at a point in time.
2022-02-07 23:04:59 +02:00
github-actions[bot] f8112735af [CI Skip] release/beta 7.7.2-0
skip-checks: true
2022-02-07 10:54:52 +00:00
Jaco 455a8d2a91 Adjust map header output type with lookup (#4536)
* Adjust map header output type with lookup

* Adjust typings
2022-02-07 12:44:17 +02:00
209 changed files with 25399 additions and 12594 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
39
40
1.4.2
1.6.2
@@ -47,4 +47,6 @@
6.10.2
6.10.3
7.0.2
7.0.2
7.14.2
+16
View File
@@ -0,0 +1,16 @@
name: bot
on:
pull_request:
types: [labeled]
jobs:
approve:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-approve@master
with:
authors: jacogr
labels: -auto
token: ${{ secrets.GH_PAT_BOT }}
+16
View File
@@ -0,0 +1,16 @@
name: bot
on:
pull_request:
types: [labeled]
jobs:
merge:
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-merge@master
with:
checks: build,lint,test
labels: -auto
strategy: squash
token: ${{ secrets.GH_PAT_BOT }}
+2
View File
@@ -7,6 +7,8 @@ on:
jobs:
lock:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: dessant/lock-threads@v2
with:
+2
View File
@@ -8,6 +8,8 @@ jobs:
step: ['lint', 'test', 'build']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.step }}
+6 -5
View File
@@ -12,17 +12,18 @@ jobs:
step: ['build:release']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: ${{ matrix.step }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
+2
View File
@@ -9,6 +9,8 @@ jobs:
check:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
+2
View File
@@ -6,6 +6,8 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/stale@v3
with:
-768
View File
File diff suppressed because one or more lines are too long
+785
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -10,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
yarnPath: .yarn/releases/yarn-3.1.1.cjs
yarnPath: .yarn/releases/yarn-3.2.0.cjs
+110
View File
@@ -1,5 +1,115 @@
# CHANGELOG
## 7.14.2 Mat 28, 2022
Changes:
- Don't export `ScProvider` top-level in `@polkadot/rpc-provider`
## 7.14.1 Mar 27, 2022
Contributed:
- Add `ScProvider` for `@substrate/substrate-connect` (Thanks to https://github.com/josepot)
- Add support for `BTree{Map, Set}` in typegen (Thanks to https://github.com/CertainLach)
Changes:
- Only explicitly support LSB on `BitVec` types
- Change `toHuman()` on `BitVec` to output default LSB
- Add `bytes{Sent, Recv}` to provider stats
- Clear connection timout on provider `disconnect()`
- Add support for `dev_getBlockStats` RPC
## 7.13.1 Mar 19, 2022
**Important** This contains an upgraded version of `@polkadot/wasm-crypto`. For users of asm.js, e.g. React Native, there are some additional upgrade instructions in the release notes for this version https://github.com/polkadot-js/wasm/releases/tag/v5.0.1
Contributed:
- Expose custom RPC error details (Thanks to https://github.com/intendednull)
- Improve custom RPC error typings (Thanks to https://github.com/MOZGIII)
Changes:
- Support for rejection of hanging RPC requests (30s timeout)
- Add `.stats` to provider interfaces with running counters
- Add support for `state_trieMigrationStatus` RPC
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update to `@polkadot/util` 8.6.1
- Additional workaround for Vite bundling
## 7.12.1 Mar 13, 2022
Changes:
- Allow for correct handling of `Option<Null>` types
- Adjust for bundlers where `import.meta.url` is undefined
- Update to `@polkadot/util` 8.5.1
## 7.11.1 Mar 6, 2022
Changes:
- Chunk derive retrieval of `era{Exposure, Prefs, Slashes}`
- Ensure that signer (passed via options) do get updated
- Kusama & Polkadot 9170 upgrade blocks
- Update to latest Substrate, Kusama & Polkadot static metadata
- Adjustments for TypeScript 7.6.2
## 7.10.1 Feb 27, 2022
Contributed:
- Ensure `updateId` is correct in signer callbacks (Thanks to https://github.com/coolcorexix)
Changes:
- Ensure `BTreeSet` has the correct decoded length
- Attach `PortableRegistry` at point of metadata set
- Add `derive.chain.getBlockByNumber`
- Retrieve named reserves in `derive.balances.all`
- Ensure `v13 -> v14` metadata conversion attaches primitives
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.9.1 Feb 20, 2022
Contributed:
- Support historic queries via blockNumber (Thanks to https://github.com/stwiname)
Changes:
- Align `grandpa_proveFinality` with Substrate
- Allow for derive augmentation (swap base type to interfaces)
- Kusama 9160 upgrade block
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.8.1 Feb 14, 2022
Contributed:
- Add `isHistoric` flag to ETH RPCs (Thanks to https://github.com/stwiname)
- Align contract instantiate types with Substrate (Thanks to https://github.com/kwingram25)
Changes:
- Adjust map header output type with lookup id
- Re-enable all `BitVec` tests for `toU8a`
- Expose `txIndex` as event index on extrinsic results
- Allow inspection of Codec encoding (experimental)
- Allow inspection of storage key encoding (experimental)
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update `@polkadot/util` to 8.4.1
## 7.7.1 Feb 6, 2022
Upgrade priority: Low. Recommended for users with long-running scripts.
+8 -2
View File
@@ -1,6 +1,6 @@
2805 Jaco 7.7.1 (#4535)
2885 Jaco Don't export `ScProvider` top-level in `@polkadot/rpc-provider` (#4694)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
36 Keith Ingram Storage deposit limit changes (#4370)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
@@ -13,6 +13,7 @@
4 Alexander Popiak Add asset id in signing (#4009)
4 Joshy Orndorff spelling; efect -> effect (#2295)
4 Nantian fix bigint type (#3869)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
4 Thibaut Sardan no subscription for http (#3127)
3 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
3 André Silva add support for ValidationCodeHash (#3640)
@@ -32,6 +33,7 @@
2 Jakub Pánik All heads subscription (#1899)
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
2 MOZGIII Follow-up fix after #4665 (#4666)
2 Nikos Kontakis Add auction in shared types (#4085)
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
2 sung wu Update tx.md (#2485)
@@ -42,6 +44,7 @@
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
1 chriswmercer little readme tweak (#279)
1 codingsh #2182 - add: search for docs (#2232)
1 coolcorexix Investigate 4559 v2 (#4608)
1 Dan Forbes Add WeightToFeeCoefficient type (#2296)
1 Daniel Maricic Fixed typo in README (#2402)
1 Daniel Savu fix: Generate custom type definitions (#4224)
@@ -62,6 +65,7 @@
1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062)
1 Joey don't throw error at `onSocketClose` (#4363)
1 Jordan Allow typegen for custom RPCs (#2876)
1 Josep M Sobrepere Add smoldot rpc provider (#4672)
1 JQQQ Allow rpc expose definition/ metadata (#3488)
1 Kian Paimani Update definitions.ts (#2514)
1 Krzysztof Jelski Derive for bounties and descriptions (#2925)
@@ -76,6 +80,7 @@
1 Nazar Mokrynskyi Performance tweaks (#4143)
1 Nikhil Ranjan add vestingPerBlock and vestingEndBlock in DeriveBalancesAll when doing calcBalances (#2563)
1 Nikolay Volf Fix typo (#1730)
1 Noah Corona Add rpc error fields (#4637)
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
1 Paul M Fox Basic BTreeMaps codec support (#1474)
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
@@ -89,6 +94,7 @@
1 Sergei Pepyakin INK! -> ink! (#1347)
1 WoeOm adapt Darwinia, Crab Network types (#3498)
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
1 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682)
1 yjh fix MetadataVersioned.asV12 (#2983)
1 Yuri fixes #3693 Fix uniques return types (#3694)
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)
-14
View File
@@ -14,17 +14,3 @@ If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.m
## tutorials
Looking for tutorials to get started? Look at [examples](https://polkadot.js.org/docs/api/examples/promise/) for guides on how to use the API to make queries and submit transactions.
## overview
The API is split up into a number of internal packages -
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
- [@polkadot/metadata](packages/metadata/) Base extrinsic, storage and constant injectors for injection
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
Type definitions for interfaces as exposed by Polkadot & Substrate clients -
- [@polkadot/types](packages/types/) Codecs for all Polkadot and Substrate primitives
+3
View File
@@ -15,5 +15,8 @@ module.exports = {
// eslint-disable-next-line sort-keys
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
},
"transformIgnorePatterns": [
'/node_modules/(?!@polkadot|@substrate/connect|@babel/runtime/helpers/esm/)'
],
testTimeout: 30000
};
+8 -8
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2.0",
"packageManager": "yarn@3.0.1",
"packageManager": "yarn@3.2.0",
"private": true,
"repository": {
"type": "git",
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "7.7.1",
"version": "7.14.2",
"workspaces": [
"packages/*"
],
@@ -31,15 +31,15 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/register": "^7.17.0",
"@babel/runtime": "^7.17.0",
"@polkadot/dev": "^0.65.50",
"@babel/core": "^7.17.8",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.17.8",
"@polkadot/dev": "^0.65.101",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.4.0",
"@types/jest": "^27.4.1",
"copyfiles": "^2.4.1"
},
"resolutions": {
"typescript": "^4.5.5"
"typescript": "^4.6.3"
}
}
+11 -8
View File
@@ -20,15 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/api-base": "7.7.1",
"@polkadot/rpc-augment": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-augment": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.8",
"@polkadot/api-base": "7.14.2",
"@polkadot/rpc-augment": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-augment": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/util": "^8.7.1"
},
"devDependencies": {
"@polkadot/types-support": "7.14.2"
}
}
+45 -10
View File
@@ -67,23 +67,23 @@ declare module '@polkadot/api-base/types/consts' {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their vote weight. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
* weight, but peer ids within a particular bag are sorted in insertion order.
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
* will behave identically.
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
@@ -101,8 +101,8 @@ declare module '@polkadot/api-base/types/consts' {
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
* into bag 0, an id with weight 2 will fall into bag 1, etc.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
@@ -171,6 +171,25 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
childBounties: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/**
* Minimum value for a child-bounty.
**/
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of child-bounties that can be added to a parent bounty.
**/
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
@@ -592,8 +611,13 @@ declare module '@polkadot/api-base/types/consts' {
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
*
* NOTE: The threshold programmed in this Pallet uses u16, so it does
* not really make sense to have a limit here greater than u16::MAX.
* But also, that is a lot more than you should probably set this value
* to anyway...
**/
maxFriends: u16 & AugmentedConst<ApiType>;
maxFriends: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
@@ -703,6 +727,10 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -710,6 +738,11 @@ declare module '@polkadot/api-base/types/consts' {
* claim their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
* determines how many unique eras a staker may be unbonding in.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
@@ -846,6 +879,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
+28 -1
View File
@@ -97,7 +97,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
IdNotFound: AugmentedError<ApiType>;
/**
* An Id does not have a greater vote weight than another Id.
* An Id does not have a greater score than another Id.
**/
NotHeavier: AugmentedError<ApiType>;
/**
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -194,6 +198,24 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
childBounties: {
/**
* The bounty balance is not enough to add new child-bounty.
**/
InsufficientBountyBalance: AugmentedError<ApiType>;
/**
* The parent bounty is not in active state.
**/
ParentBountyNotActive: AugmentedError<ApiType>;
/**
* Number of child-bounties exceeds limit `MaxActiveChildBountyCount`.
**/
TooManyChildBounties: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
claims: {
/**
* Invalid Ethereum signature.
@@ -1351,6 +1373,11 @@ declare module '@polkadot/api-base/types/errors' {
* Cannot schedule downgrade of parachain to parathread
**/
CannotDowngrade: AugmentedError<ApiType>;
/**
* Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are
* correct for the swap to work.
**/
CannotSwap: AugmentedError<ApiType>;
/**
* Cannot schedule upgrade of parathread to parachain
**/
@@ -0,0 +1,43 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/api-augment/kusama';
import type { PolkadotRuntimeParachainsUmpPalletEvent, XcmV2TraitsOutcome } from '@polkadot/types/lookup';
import { Metadata, TypeRegistry } from '@polkadot/types';
import metadataStatic from '@polkadot/types-support/metadata/static-kusama';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
describe('correct types', (): void => {
it('correctly creates XcmV2TraitsOutcome', (): void => {
const test = registry.createType<XcmV2TraitsOutcome>('XcmV2TraitsOutcome', {
Incomplete: [3_000_000_000, 'BadOrigin']
});
expect(test.toHuman()).toEqual({
Incomplete: [
'3,000,000,000',
'BadOrigin'
]
});
expect(test.isIncomplete).toEqual(true);
expect(test.asIncomplete.toHuman()).toEqual([
'3,000,000,000',
'BadOrigin'
]);
});
it('correctly creates PolkadotRuntimeParachainsUmpPalletEvent', (): void => {
const test = registry.createType<PolkadotRuntimeParachainsUmpPalletEvent>('PolkadotRuntimeParachainsUmpPalletEvent', '0x02112233445566778811223344556677881122334455667788112233445566778801005ed0b20000000006');
expect(test.asExecutedUpward[1].asIncomplete.toHuman()).toEqual([
'3,000,000,000',
'BadOrigin'
]);
});
});
+28 -6
View File
@@ -6,7 +6,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV1CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
@@ -143,6 +143,28 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
childBounties: {
/**
* A child-bounty is added.
**/
Added: AugmentedEvent<ApiType, [u32, u32]>;
/**
* A child-bounty is awarded to a beneficiary.
**/
Awarded: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
/**
* A child-bounty is cancelled.
**/
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
/**
* A child-bounty is claimed by beneficiary.
**/
Claimed: AugmentedEvent<ApiType, [u32, u32, u128, AccountId32]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
claims: {
/**
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
@@ -539,15 +561,15 @@ declare module '@polkadot/api-base/types/events' {
/**
* A candidate was backed. `[candidate, head_data]`
**/
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate was included. `[candidate, head_data]`
**/
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate timed out. `[candidate, head_data]`
**/
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32]>;
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32]>;
/**
* Generic event
**/
@@ -575,12 +597,12 @@ declare module '@polkadot/api-base/types/events' {
**/
NewHeadNoted: AugmentedEvent<ApiType, [u32]>;
/**
* The given validation code was rejected by the PVF pre-checking vote.
* The given validation code was accepted by the PVF pre-checking vote.
* `code_hash` `para_id`
**/
PvfCheckAccepted: AugmentedEvent<ApiType, [H256, u32]>;
/**
* The given validation code was accepted by the PVF pre-checking vote.
* The given validation code was rejected by the PVF pre-checking vote.
* `code_hash` `para_id`
**/
PvfCheckRejected: AugmentedEvent<ApiType, [H256, u32]>;
+1
View File
@@ -6,4 +6,5 @@ import './consts';
import './errors';
import './events';
import './query';
import './registry';
import './tx';
+42 -20
View File
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -257,6 +257,33 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
childBounties: {
/**
* Child-bounties that have been added.
**/
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* Number of total child bounties.
**/
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The description of each child-bounty.
**/
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The cumulative child-bounty curator fee for each parent bounty.
**/
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Number of child-bounties per parent bounty.
* Map of parent bounty index to number of child bounties.
**/
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
claims: {
claims: AugmentedQuery<ApiType, (arg: EthereumAddress | string | Uint8Array) => Observable<Option<u128>>, [EthereumAddress]> & QueryableStorageEntry<ApiType, [EthereumAddress]>;
/**
@@ -356,9 +383,9 @@ declare module '@polkadot/api-base/types/storage' {
**/
newRaise: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Tracker for the next available trie index
* Tracker for the next available fund index
**/
nextTrieIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
nextFundIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -385,13 +412,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -482,7 +502,7 @@ declare module '@polkadot/api-base/types/storage' {
*
* Can be set via `set_minimum_untrusted_score`.
**/
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<Vec<u128>>>, []> & QueryableStorageEntry<ApiType, []>;
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
**/
@@ -504,7 +524,7 @@ declare module '@polkadot/api-base/types/storage' {
* can be quite large, so we're willing to pay the cost of multiple database accesses to access
* them one at a time instead of reading and decoding all of them at once.
**/
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<Vec<u128>, u32>>, []> & QueryableStorageEntry<ApiType, []>;
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<SpNposElectionsElectionScore, u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The next index to be assigned to an incoming signed submission.
*
@@ -835,7 +855,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* The commitments of candidates pending availability, by `ParaId`.
**/
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
@@ -854,7 +874,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* Scraped on chain data for extracting resolved disputes as well as backing votes.
**/
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV1ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -900,6 +920,8 @@ declare module '@polkadot/api-base/types/storage' {
heads: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* All parachains. Ordered ascending by `ParaId`. Parathreads are not included.
*
* Consider using the [`ParachainsCache`] type of modifying.
**/
parachains: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -970,7 +992,7 @@ declare module '@polkadot/api-base/types/storage' {
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
* the format will require migration of parachains.
**/
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* This is used by the relay-chain to communicate that there are restrictions for performing
* an upgrade for this parachain.
@@ -982,7 +1004,7 @@ declare module '@polkadot/api-base/types/storage' {
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
* the format will require migration of parachains.
**/
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
@@ -999,7 +1021,7 @@ declare module '@polkadot/api-base/types/storage' {
* * The number of parachains and parathread multiplexers
* * The number of validators divided by `configuration.max_validators_per_core`.
**/
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV1CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV2CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* An index used to ensure that only one claim on a parathread exists in the queue or is
* currently being handled by an occupied core.
@@ -1050,7 +1072,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* All ongoing or concluded disputes for the last several sessions.
**/
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV1DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV2DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/**
* Whether the chain is frozen. Starts as `None`. When this is `Some`,
* the chain will not accept any new parachain blocks for backing or inclusion,
@@ -1087,7 +1109,7 @@ declare module '@polkadot/api-base/types/storage' {
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
* When in doubt, use `Sessions` API instead.
**/
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV1AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The earliest session for which previous session info is stored.
**/
@@ -1113,7 +1135,7 @@ declare module '@polkadot/api-base/types/storage' {
* The parachain attestation keys of the validators actively participating in parachain consensus.
* This should be the same length as `ActiveValidatorIndices`.
**/
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV0ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current session index.
**/
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
import '@polkadot/types-augment/registry/polkadot';
import '@polkadot/types-augment/registry/kusama';
+189 -18
View File
@@ -7,7 +7,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u1
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppSignature, PolkadotPrimitivesV1InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -100,12 +100,12 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Only works if
* - both nodes are within the same bag,
* - and `origin` has a greater `VoteWeight` than `lighter`.
* - and `origin` has a greater `Score` than `lighter`.
**/
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
* changed its weight that it should properly fall into a different bag than its current
* changed its score that it should properly fall into a different bag than its current
* one.
*
* Anyone can call this function about any potentially dislocated account.
@@ -334,6 +334,175 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
childBounties: {
/**
* Accept the curator role for the child-bounty.
*
* The dispatch origin for this call must be the curator of this
* child-bounty.
*
* A deposit will be reserved from the curator and refund upon
* successful payout or cancellation.
*
* Fee for curator is deducted from curator fee of parent bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in "CuratorProposed" state, for processing the
* call. And state of child-bounty is moved to "Active" on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
acceptCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Add a new child-bounty.
*
* The dispatch origin for this call must be the curator of parent
* bounty and the parent bounty must be in "active" state.
*
* Child-bounty gets added successfully & fund gets transferred from
* parent bounty to child-bounty account, if parent bounty has enough
* funds, else the call fails.
*
* Upper bound to maximum number of active child-bounties that can be
* added are managed via runtime trait config
* [`Config::MaxActiveChildBountyCount`].
*
* If the call is success, the status of child-bounty is updated to
* "Added".
*
* - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added.
* - `value`: Value for executing the proposal.
* - `description`: Text description for the child-bounty.
**/
addChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u128>, Bytes]>;
/**
* Award child-bounty to a beneficiary.
*
* The beneficiary will be able to claim the funds after a delay.
*
* The dispatch origin for this call must be the master curator or
* curator of this child-bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in active state, for processing the call. And
* state of child-bounty is moved to "PendingPayout" on successful call
* completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
* - `beneficiary`: Beneficiary account.
**/
awardChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
/**
* Claim the payout from an awarded child-bounty after payout delay.
*
* The dispatch origin for this call may be any signed origin.
*
* Call works independent of parent bounty state, No need for parent
* bounty to be in active state.
*
* The Beneficiary is paid out with agreed bounty value. Curator fee is
* paid & curator deposit is unreserved.
*
* Child-bounty must be in "PendingPayout" state, for processing the
* call. And instance of child-bounty is removed from the state on
* successful call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
claimChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Cancel a proposed or active child-bounty. Child-bounty account funds
* are transferred to parent bounty account. The child-bounty curator
* deposit may be unreserved if possible.
*
* The dispatch origin for this call must be either parent curator or
* `T::RejectOrigin`.
*
* If the state of child-bounty is `Active`, curator deposit is
* unreserved.
*
* If the state of child-bounty is `PendingPayout`, call fails &
* returns `PendingPayout` error.
*
* For the origin other than T::RejectOrigin, parent bounty must be in
* active state, for this child-bounty call to work. For origin
* T::RejectOrigin execution is forced.
*
* Instance of child-bounty is removed from the state on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
closeChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Propose curator for funded child-bounty.
*
* The dispatch origin for this call must be curator of parent bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in "Added" state, for processing the call. And
* state of child-bounty is moved to "CuratorProposed" on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
* - `curator`: Address of child-bounty curator.
* - `fee`: payment fee to child-bounty curator for execution.
**/
proposeCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, curator: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress, Compact<u128>]>;
/**
* Unassign curator from a child-bounty.
*
* The dispatch origin for this call can be either `RejectOrigin`, or
* the curator of the parent bounty, or any signed origin.
*
* For the origin other than T::RejectOrigin and the child-bounty
* curator, parent-bounty must be in active state, for this call to
* work. We allow child-bounty curator and T::RejectOrigin to execute
* this call irrespective of the parent-bounty state.
*
* If this function is called by the `RejectOrigin` or the
* parent-bounty curator, we assume that the child-bounty curator is
* malicious or inactive. As a result, child-bounty curator deposit is
* slashed.
*
* If the origin is the child-bounty curator, we take this as a sign
* that they are unable to do their job, and are willingly giving up.
* We could slash the deposit, but for now we allow them to unreserve
* their deposit and exit without issue. (We may want to change this if
* it is abused.)
*
* Finally, the origin can be anyone iff the child-bounty curator is
* "inactive". Expiry update due of parent bounty is used to estimate
* inactive state of child-bounty curator.
*
* This allows anyone in the community to call out that a child-bounty
* curator is not doing their due diligence, and we should pick a new
* one. In this case the child-bounty curator deposit is slashed.
*
* State of child-bounty is moved to Added state on successful call
* completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
unassignCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
claims: {
/**
* Attest to a statement, needed to finalize the claims process.
@@ -1223,7 +1392,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* This check can be turned off by setting the value to `None`.
**/
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<Vec<u128>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<Vec<u128>>]>;
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<SpNposElectionsElectionScore> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<SpNposElectionsElectionScore>]>;
/**
* Submit a solution for the signed phase.
*
@@ -1234,12 +1403,8 @@ declare module '@polkadot/api-base/types/submittable' {
*
* A deposit is reserved and recorded for the solution. Based on the outcome, the solution
* might be rewarded, slashed, or get all or a part of the deposit back.
*
* # <weight>
* Queue size must be provided as witness data.
* # </weight>
**/
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array, numSignedSubmissions: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution, u32]>;
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution]>;
/**
* Submit a solution for the unsigned phase.
*
@@ -1982,7 +2147,7 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Enter the paras inherent. This will process bitfields and backed candidates.
**/
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV1InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV1InherentData]>;
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV2InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2InherentData]>;
/**
* Generic tx
**/
@@ -2031,7 +2196,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and
* enacts the results if that was the last vote before achieving the supermajority.
**/
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV0ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV0ValidatorAppSignature]>;
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV2ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature]>;
/**
* Remove the validation code from the storage iff the reference count is 0.
*
@@ -2213,7 +2378,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight is a function of the number of proxies the user has (P).
* # </weight>
**/
addProxy: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u32]>;
addProxy: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u32]>;
/**
* Publish the hash of a proxy-call that will be made in the future.
*
@@ -2263,7 +2428,7 @@ declare module '@polkadot/api-base/types/submittable' {
* # </weight>
* TODO: Might be over counting 1 read
**/
anonymous: AugmentedSubmittable<(proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array, index: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [KusamaRuntimeProxyType, u32, u16]>;
anonymous: AugmentedSubmittable<(proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array, index: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [KusamaRuntimeProxyType, u32, u16]>;
/**
* Removes a previously spawned anonymous proxy.
*
@@ -2286,7 +2451,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight is a function of the number of proxies the user has (P).
* # </weight>
**/
killAnonymous: AugmentedSubmittable<(spawner: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array, height: Compact<u32> | AnyNumber | Uint8Array, extIndex: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u16, Compact<u32>, Compact<u32>]>;
killAnonymous: AugmentedSubmittable<(spawner: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number | Uint8Array, index: u16 | AnyNumber | Uint8Array, height: Compact<u32> | AnyNumber | Uint8Array, extIndex: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u16, Compact<u32>, Compact<u32>]>;
/**
* Dispatch the given `call` from an account that the sender is authorised for through
* `add_proxy`.
@@ -2389,7 +2554,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight is a function of the number of proxies the user has (P).
* # </weight>
**/
removeProxy: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u32]>;
removeProxy: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, proxyType: KusamaRuntimeProxyType | 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society' | number | Uint8Array, delay: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, KusamaRuntimeProxyType, u32]>;
/**
* Generic tx
**/
@@ -3201,6 +3366,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -3340,7 +3511,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - Time complexity: O(L), where L is unlocking chunks
* - Bounded by `MAX_UNLOCKING_CHUNKS`.
* - Bounded by `MaxUnlockingChunks`.
* - Storage changes: Can't increase storage, only decrease it.
* # </weight>
**/
@@ -3443,7 +3614,7 @@ declare module '@polkadot/api-base/types/submittable' {
* NOTE: Existing nominators and validators will not be affected by this update.
* to kick people under the new limits, `chill_other` should be called.
**/
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: u128 | AnyNumber | Uint8Array, minValidatorBond: u128 | AnyNumber | Uint8Array, maxNominatorCount: Option<u32> | null | object | string | Uint8Array, maxValidatorCount: Option<u32> | null | object | string | Uint8Array, chillThreshold: Option<Percent> | null | object | string | Uint8Array, minCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, Option<u32>, Option<u32>, Option<Percent>, Perbill]>;
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minValidatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxNominatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxValidatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, chillThreshold: PalletStakingPalletConfigOpPercent | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minCommission: PalletStakingPalletConfigOpPerbill | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpPerbill]>;
/**
* Sets the ideal number of validators.
*
@@ -3465,7 +3636,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Once the unlock period is done, you can call `withdraw_unbonded` to actually move
* the funds out of management ready for transfer.
*
* No more than a limited number of unlocking chunks (see `MAX_UNLOCKING_CHUNKS`)
* No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)
* can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need
* to be called first to remove some of the chunks (if possible).
*
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.14.2' };
+39 -9
View File
@@ -67,23 +67,23 @@ declare module '@polkadot/api-base/types/consts' {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their vote weight. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
* weight, but peer ids within a particular bag are sorted in insertion order.
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
* will behave identically.
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
@@ -101,8 +101,8 @@ declare module '@polkadot/api-base/types/consts' {
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
* into bag 0, an id with weight 2 will fall into bag 1, etc.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
@@ -171,6 +171,25 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
childBounties: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/**
* Minimum value for a child-bounty.
**/
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of child-bounties that can be added to a parent bounty.
**/
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
@@ -575,6 +594,10 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -582,6 +605,11 @@ declare module '@polkadot/api-base/types/consts' {
* claim their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
* determines how many unique eras a staker may be unbonding in.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
@@ -718,6 +746,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
+62 -1
View File
@@ -97,7 +97,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
IdNotFound: AugmentedError<ApiType>;
/**
* An Id does not have a greater vote weight than another Id.
* An Id does not have a greater score than another Id.
**/
NotHeavier: AugmentedError<ApiType>;
/**
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -194,6 +198,24 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
childBounties: {
/**
* The bounty balance is not enough to add new child-bounty.
**/
InsufficientBountyBalance: AugmentedError<ApiType>;
/**
* The parent bounty is not in active state.
**/
ParentBountyNotActive: AugmentedError<ApiType>;
/**
* Number of child-bounties exceeds limit `MaxActiveChildBountyCount`.
**/
TooManyChildBounties: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
claims: {
/**
* Invalid Ethereum signature.
@@ -1053,6 +1075,40 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
parasDisputes: {
/**
* Ancient dispute statement provided.
**/
AncientDisputeStatement: AugmentedError<ApiType>;
/**
* Duplicate dispute statement sets provided.
**/
DuplicateDisputeStatementSets: AugmentedError<ApiType>;
/**
* Validator vote submitted more than once to dispute.
**/
DuplicateStatement: AugmentedError<ApiType>;
/**
* Invalid signature on statement.
**/
InvalidSignature: AugmentedError<ApiType>;
/**
* Too many spam slots used by some specific validator.
**/
PotentialSpam: AugmentedError<ApiType>;
/**
* A dispute where there are only votes on one side.
**/
SingleSidedDispute: AugmentedError<ApiType>;
/**
* Validator index on statement is out of bounds for session.
**/
ValidatorIndexOutOfBounds: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
phragmenElection: {
/**
* Duplicated candidate submission.
@@ -1208,6 +1264,11 @@ declare module '@polkadot/api-base/types/errors' {
* Cannot schedule downgrade of parachain to parathread
**/
CannotDowngrade: AugmentedError<ApiType>;
/**
* Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are
* correct for the swap to work.
**/
CannotSwap: AugmentedError<ApiType>;
/**
* Cannot schedule upgrade of parathread to parachain
**/
+55 -6
View File
@@ -6,7 +6,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV1CandidateReceipt, PolkadotRuntimeProxyType, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeProxyType, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
@@ -143,6 +143,28 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
childBounties: {
/**
* A child-bounty is added.
**/
Added: AugmentedEvent<ApiType, [u32, u32]>;
/**
* A child-bounty is awarded to a beneficiary.
**/
Awarded: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
/**
* A child-bounty is cancelled.
**/
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
/**
* A child-bounty is claimed by beneficiary.
**/
Claimed: AugmentedEvent<ApiType, [u32, u32, u128, AccountId32]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
claims: {
/**
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
@@ -517,15 +539,15 @@ declare module '@polkadot/api-base/types/events' {
/**
* A candidate was backed. `[candidate, head_data]`
**/
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate was included. `[candidate, head_data]`
**/
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate timed out. `[candidate, head_data]`
**/
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32]>;
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32]>;
/**
* Generic event
**/
@@ -553,12 +575,12 @@ declare module '@polkadot/api-base/types/events' {
**/
NewHeadNoted: AugmentedEvent<ApiType, [u32]>;
/**
* The given validation code was rejected by the PVF pre-checking vote.
* The given validation code was accepted by the PVF pre-checking vote.
* `code_hash` `para_id`
**/
PvfCheckAccepted: AugmentedEvent<ApiType, [H256, u32]>;
/**
* The given validation code was accepted by the PVF pre-checking vote.
* The given validation code was rejected by the PVF pre-checking vote.
* `code_hash` `para_id`
**/
PvfCheckRejected: AugmentedEvent<ApiType, [H256, u32]>;
@@ -572,6 +594,33 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
parasDisputes: {
/**
* A dispute has concluded for or against a candidate.
* `\[para id, candidate hash, dispute result\]`
**/
DisputeConcluded: AugmentedEvent<ApiType, [H256, PolkadotRuntimeParachainsDisputesDisputeResult]>;
/**
* A dispute has been initiated. \[candidate hash, dispute location\]
**/
DisputeInitiated: AugmentedEvent<ApiType, [H256, PolkadotRuntimeParachainsDisputesDisputeLocation]>;
/**
* A dispute has timed out due to insufficient participation.
* `\[para id, candidate hash\]`
**/
DisputeTimedOut: AugmentedEvent<ApiType, [H256]>;
/**
* A dispute has concluded with supermajority against a candidate.
* Block authors should no longer build on top of this head and should
* instead revert the block at the given height. This should be the
* number of the child of the last known valid block in the chain.
**/
Revert: AugmentedEvent<ApiType, [u32]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
phragmenElection: {
/**
* A candidate was slashed by amount due to failing to obtain a seat as member or
@@ -6,4 +6,5 @@ import './consts';
import './errors';
import './events';
import './query';
import './registry';
import './tx';
+76 -19
View File
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -257,6 +257,33 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
childBounties: {
/**
* Child-bounties that have been added.
**/
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* Number of total child bounties.
**/
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The description of each child-bounty.
**/
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The cumulative child-bounty curator fee for each parent bounty.
**/
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Number of child-bounties per parent bounty.
* Map of parent bounty index to number of child bounties.
**/
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
claims: {
claims: AugmentedQuery<ApiType, (arg: EthereumAddress | string | Uint8Array) => Observable<Option<u128>>, [EthereumAddress]> & QueryableStorageEntry<ApiType, [EthereumAddress]>;
/**
@@ -356,9 +383,9 @@ declare module '@polkadot/api-base/types/storage' {
**/
newRaise: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Tracker for the next available trie index
* Tracker for the next available fund index
**/
nextTrieIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
nextFundIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -385,13 +412,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -482,7 +502,7 @@ declare module '@polkadot/api-base/types/storage' {
*
* Can be set via `set_minimum_untrusted_score`.
**/
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<Vec<u128>>>, []> & QueryableStorageEntry<ApiType, []>;
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
**/
@@ -504,7 +524,7 @@ declare module '@polkadot/api-base/types/storage' {
* can be quite large, so we're willing to pay the cost of multiple database accesses to access
* them one at a time instead of reading and decoding all of them at once.
**/
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<Vec<u128>, u32>>, []> & QueryableStorageEntry<ApiType, []>;
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<SpNposElectionsElectionScore, u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The next index to be assigned to an incoming signed submission.
*
@@ -809,7 +829,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* The commitments of candidates pending availability, by `ParaId`.
**/
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
@@ -828,7 +848,7 @@ declare module '@polkadot/api-base/types/storage' {
/**
* Scraped on chain data for extracting resolved disputes as well as backing votes.
**/
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV1ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -874,6 +894,8 @@ declare module '@polkadot/api-base/types/storage' {
heads: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* All parachains. Ordered ascending by `ParaId`. Parathreads are not included.
*
* Consider using the [`ParachainsCache`] type of modifying.
**/
parachains: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -944,7 +966,7 @@ declare module '@polkadot/api-base/types/storage' {
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
* the format will require migration of parachains.
**/
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* This is used by the relay-chain to communicate that there are restrictions for performing
* an upgrade for this parachain.
@@ -956,7 +978,7 @@ declare module '@polkadot/api-base/types/storage' {
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
* the format will require migration of parachains.
**/
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
@@ -973,7 +995,7 @@ declare module '@polkadot/api-base/types/storage' {
* * The number of parachains and parathread multiplexers
* * The number of validators divided by `configuration.max_validators_per_core`.
**/
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV1CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV2CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* An index used to ensure that only one claim on a parathread exists in the queue or is
* currently being handled by an occupied core.
@@ -1020,13 +1042,48 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
parasDisputes: {
/**
* All ongoing or concluded disputes for the last several sessions.
**/
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV2DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/**
* Whether the chain is frozen. Starts as `None`. When this is `Some`,
* the chain will not accept any new parachain blocks for backing or inclusion,
* and its value indicates the last valid block number in the chain.
* It can only be set back to `None` by governance intervention.
**/
frozen: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* All included blocks on the chain, as well as the block number in this chain that
* should be reverted back to if the candidate is disputed and determined to be invalid.
**/
included: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<u32>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/**
* The last pruned session, if any. All data stored by this module
* references sessions.
**/
lastPrunedSession: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maps session indices to a vector indicating the number of potentially-spam disputes
* each validator is participating in. Potentially-spam disputes are remote disputes which have
* fewer than `byzantine_threshold + 1` validators.
*
* The i'th entry of the vector corresponds to the i'th validator in the session.
**/
spamSlots: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Vec<u32>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
paraSessionInfo: {
/**
* Assignment keys for the current session.
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
* When in doubt, use `Sessions` API instead.
**/
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV1AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The earliest session for which previous session info is stored.
**/
@@ -1052,7 +1109,7 @@ declare module '@polkadot/api-base/types/storage' {
* The parachain attestation keys of the validators actively participating in parachain consensus.
* This should be the same length as `ActiveValidatorIndices`.
**/
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV0ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current session index.
**/
@@ -0,0 +1,5 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
import '@polkadot/types-augment/registry/polkadot';
+192 -14
View File
@@ -7,7 +7,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u1
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppSignature, PolkadotPrimitivesV1InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -100,12 +100,12 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Only works if
* - both nodes are within the same bag,
* - and `origin` has a greater `VoteWeight` than `lighter`.
* - and `origin` has a greater `Score` than `lighter`.
**/
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
* changed its weight that it should properly fall into a different bag than its current
* changed its score that it should properly fall into a different bag than its current
* one.
*
* Anyone can call this function about any potentially dislocated account.
@@ -334,6 +334,175 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
childBounties: {
/**
* Accept the curator role for the child-bounty.
*
* The dispatch origin for this call must be the curator of this
* child-bounty.
*
* A deposit will be reserved from the curator and refund upon
* successful payout or cancellation.
*
* Fee for curator is deducted from curator fee of parent bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in "CuratorProposed" state, for processing the
* call. And state of child-bounty is moved to "Active" on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
acceptCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Add a new child-bounty.
*
* The dispatch origin for this call must be the curator of parent
* bounty and the parent bounty must be in "active" state.
*
* Child-bounty gets added successfully & fund gets transferred from
* parent bounty to child-bounty account, if parent bounty has enough
* funds, else the call fails.
*
* Upper bound to maximum number of active child-bounties that can be
* added are managed via runtime trait config
* [`Config::MaxActiveChildBountyCount`].
*
* If the call is success, the status of child-bounty is updated to
* "Added".
*
* - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added.
* - `value`: Value for executing the proposal.
* - `description`: Text description for the child-bounty.
**/
addChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u128>, Bytes]>;
/**
* Award child-bounty to a beneficiary.
*
* The beneficiary will be able to claim the funds after a delay.
*
* The dispatch origin for this call must be the master curator or
* curator of this child-bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in active state, for processing the call. And
* state of child-bounty is moved to "PendingPayout" on successful call
* completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
* - `beneficiary`: Beneficiary account.
**/
awardChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
/**
* Claim the payout from an awarded child-bounty after payout delay.
*
* The dispatch origin for this call may be any signed origin.
*
* Call works independent of parent bounty state, No need for parent
* bounty to be in active state.
*
* The Beneficiary is paid out with agreed bounty value. Curator fee is
* paid & curator deposit is unreserved.
*
* Child-bounty must be in "PendingPayout" state, for processing the
* call. And instance of child-bounty is removed from the state on
* successful call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
claimChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Cancel a proposed or active child-bounty. Child-bounty account funds
* are transferred to parent bounty account. The child-bounty curator
* deposit may be unreserved if possible.
*
* The dispatch origin for this call must be either parent curator or
* `T::RejectOrigin`.
*
* If the state of child-bounty is `Active`, curator deposit is
* unreserved.
*
* If the state of child-bounty is `PendingPayout`, call fails &
* returns `PendingPayout` error.
*
* For the origin other than T::RejectOrigin, parent bounty must be in
* active state, for this child-bounty call to work. For origin
* T::RejectOrigin execution is forced.
*
* Instance of child-bounty is removed from the state on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
closeChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Propose curator for funded child-bounty.
*
* The dispatch origin for this call must be curator of parent bounty.
*
* Parent bounty must be in active state, for this child-bounty call to
* work.
*
* Child-bounty must be in "Added" state, for processing the call. And
* state of child-bounty is moved to "CuratorProposed" on successful
* call completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
* - `curator`: Address of child-bounty curator.
* - `fee`: payment fee to child-bounty curator for execution.
**/
proposeCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, curator: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress, Compact<u128>]>;
/**
* Unassign curator from a child-bounty.
*
* The dispatch origin for this call can be either `RejectOrigin`, or
* the curator of the parent bounty, or any signed origin.
*
* For the origin other than T::RejectOrigin and the child-bounty
* curator, parent-bounty must be in active state, for this call to
* work. We allow child-bounty curator and T::RejectOrigin to execute
* this call irrespective of the parent-bounty state.
*
* If this function is called by the `RejectOrigin` or the
* parent-bounty curator, we assume that the child-bounty curator is
* malicious or inactive. As a result, child-bounty curator deposit is
* slashed.
*
* If the origin is the child-bounty curator, we take this as a sign
* that they are unable to do their job, and are willingly giving up.
* We could slash the deposit, but for now we allow them to unreserve
* their deposit and exit without issue. (We may want to change this if
* it is abused.)
*
* Finally, the origin can be anyone iff the child-bounty curator is
* "inactive". Expiry update due of parent bounty is used to estimate
* inactive state of child-bounty curator.
*
* This allows anyone in the community to call out that a child-bounty
* curator is not doing their due diligence, and we should pick a new
* one. In this case the child-bounty curator deposit is slashed.
*
* State of child-bounty is moved to Added state on successful call
* completion.
*
* - `parent_bounty_id`: Index of parent bounty.
* - `child_bounty_id`: Index of child bounty.
**/
unassignCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
claims: {
/**
* Attest to a statement, needed to finalize the claims process.
@@ -1223,7 +1392,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* This check can be turned off by setting the value to `None`.
**/
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<Vec<u128>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<Vec<u128>>]>;
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<SpNposElectionsElectionScore> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<SpNposElectionsElectionScore>]>;
/**
* Submit a solution for the signed phase.
*
@@ -1234,12 +1403,8 @@ declare module '@polkadot/api-base/types/submittable' {
*
* A deposit is reserved and recorded for the solution. Based on the outcome, the solution
* might be rewarded, slashed, or get all or a part of the deposit back.
*
* # <weight>
* Queue size must be provided as witness data.
* # </weight>
**/
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array, numSignedSubmissions: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution, u32]>;
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution]>;
/**
* Submit a solution for the unsigned phase.
*
@@ -1931,7 +2096,7 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Enter the paras inherent. This will process bitfields and backed candidates.
**/
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV1InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV1InherentData]>;
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV2InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2InherentData]>;
/**
* Generic tx
**/
@@ -1980,7 +2145,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and
* enacts the results if that was the last vote before achieving the supermajority.
**/
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV0ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV0ValidatorAppSignature]>;
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV2ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature]>;
/**
* Remove the validation code from the storage iff the reference count is 0.
*
@@ -1994,6 +2159,13 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
parasDisputes: {
forceUnfreeze: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
parasShared: {
/**
* Generic tx
@@ -2612,6 +2784,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -2751,7 +2929,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - Time complexity: O(L), where L is unlocking chunks
* - Bounded by `MAX_UNLOCKING_CHUNKS`.
* - Bounded by `MaxUnlockingChunks`.
* - Storage changes: Can't increase storage, only decrease it.
* # </weight>
**/
@@ -2854,7 +3032,7 @@ declare module '@polkadot/api-base/types/submittable' {
* NOTE: Existing nominators and validators will not be affected by this update.
* to kick people under the new limits, `chill_other` should be called.
**/
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: u128 | AnyNumber | Uint8Array, minValidatorBond: u128 | AnyNumber | Uint8Array, maxNominatorCount: Option<u32> | null | object | string | Uint8Array, maxValidatorCount: Option<u32> | null | object | string | Uint8Array, chillThreshold: Option<Percent> | null | object | string | Uint8Array, minCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, Option<u32>, Option<u32>, Option<Percent>, Perbill]>;
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minValidatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxNominatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxValidatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, chillThreshold: PalletStakingPalletConfigOpPercent | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minCommission: PalletStakingPalletConfigOpPerbill | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpPerbill]>;
/**
* Sets the ideal number of validators.
*
@@ -2876,7 +3054,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Once the unlock period is done, you can call `withdraw_unbonded` to actually move
* the funds out of management ready for transfer.
*
* No more than a limited number of unlocking chunks (see `MAX_UNLOCKING_CHUNKS`)
* No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)
* can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need
* to be called first to remove some of the chunks (if possible).
*
+82 -11
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, PalletStateTrieMigrationMigrationLimits, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -81,23 +81,23 @@ declare module '@polkadot/api-base/types/consts' {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their vote weight. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
* weight, but peer ids within a particular bag are sorted in insertion order.
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
* will behave identically.
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
@@ -115,8 +115,8 @@ declare module '@polkadot/api-base/types/consts' {
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
* into bag 0, an id with weight 2 will fall into bag 1, etc.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
@@ -257,6 +257,26 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
convictionVoting: {
/**
* The maximum number of concurrent votes an account may have.
*
* Also used to compute weight, an overly large value can
* lead to extrinsic with large weight estimation: see `delegate` for instance.
**/
maxVotes: u32 & AugmentedConst<ApiType>;
/**
* The minimum period of vote locking.
*
* It should be no shorter than enactment period to ensure that in the case of an approval,
* those successful voters are locked into the consequences that their votes entail.
**/
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
@@ -665,8 +685,13 @@ declare module '@polkadot/api-base/types/consts' {
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
*
* NOTE: The threshold programmed in this Pallet uses u16, so it does
* not really make sense to have a limit here greater than u16::MAX.
* But also, that is a lot more than you should probably set this value
* to anyway...
**/
maxFriends: u16 & AugmentedConst<ApiType>;
maxFriends: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
@@ -682,6 +707,31 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
referenda: {
/**
* Quantization level for the referendum wakeup scheduler. A higher number will result in
* fewer storage reads/writes needed for smaller voters, but also result in delays to the
* automatic referendum status changes. Explicit servicing instructions are unaffected.
**/
alarmInterval: u32 & AugmentedConst<ApiType>;
/**
* Maximum size of the referendum queue for a single track.
**/
maxQueued: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount to be used as a deposit for a public referendum proposal.
**/
submissionDeposit: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks after submission that a referendum must begin being decided by.
* Once this passes, then anyone may cancel the referendum.
**/
undecidingTimeout: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
* The maximum weight that may be scheduled per block for any dispatchables of less
@@ -747,6 +797,10 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -754,6 +808,11 @@ declare module '@polkadot/api-base/types/consts' {
* claim their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
* determines how many unique eras a staker may be unbonding in.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
@@ -770,6 +829,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
stateTrieMigration: {
/**
* The maximum limits that the signed migration could use.
**/
signedMigrationMaxLimits: PalletStateTrieMigrationMigrationLimits & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
@@ -890,6 +959,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
+167 -2
View File
@@ -131,7 +131,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
IdNotFound: AugmentedError<ApiType>;
/**
* An Id does not have a greater vote weight than another Id.
* An Id does not have a greater score than another Id.
**/
NotHeavier: AugmentedError<ApiType>;
/**
@@ -219,6 +219,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -309,6 +313,10 @@ declare module '@polkadot/api-base/types/errors' {
* `seal_call` forwarded this contracts input. It therefore is no longer available.
**/
InputForwarded: AugmentedError<ApiType>;
/**
* Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`.
**/
InvalidCallFlags: AugmentedError<ApiType>;
/**
* A new schedule must have a greater version than the current one.
**/
@@ -381,6 +389,61 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
convictionVoting: {
/**
* The account is already delegating.
**/
AlreadyDelegating: AugmentedError<ApiType>;
/**
* The account currently has votes attached to it and the operation cannot succeed until
* these are removed, either through `unvote` or `reap_vote`.
**/
AlreadyVoting: AugmentedError<ApiType>;
/**
* The class ID supplied is invalid.
**/
BadClass: AugmentedError<ApiType>;
/**
* The class must be supplied since it is not easily determinable from the state.
**/
ClassNeeded: AugmentedError<ApiType>;
/**
* Too high a balance was provided that the account cannot afford.
**/
InsufficientFunds: AugmentedError<ApiType>;
/**
* Maximum number of votes reached.
**/
MaxVotesReached: AugmentedError<ApiType>;
/**
* Delegation to oneself makes no sense.
**/
Nonsense: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action right now but will do in the future.
**/
NoPermissionYet: AugmentedError<ApiType>;
/**
* The account is not currently delegating.
**/
NotDelegating: AugmentedError<ApiType>;
/**
* Poll is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* The given account did not vote on the poll.
**/
NotVoter: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
council: {
/**
* Members are already initialized!
@@ -1093,6 +1156,56 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
referenda: {
/**
* The referendum index provided is invalid in this context.
**/
BadReferendum: AugmentedError<ApiType>;
/**
* The track identifier given was invalid.
**/
BadTrack: AugmentedError<ApiType>;
/**
* There are already a full complement of referendums in progress for this track.
**/
Full: AugmentedError<ApiType>;
/**
* Referendum's decision deposit is already paid.
**/
HasDeposit: AugmentedError<ApiType>;
/**
* The deposit cannot be refunded since none was made.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The deposit refunder is not the depositor.
**/
NoPermission: AugmentedError<ApiType>;
/**
* There was nothing to do in the advancement.
**/
NothingToDo: AugmentedError<ApiType>;
/**
* Referendum is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* No track exists for the proposal origin.
**/
NoTrack: AugmentedError<ApiType>;
/**
* The queue of the track is empty.
**/
QueueEmpty: AugmentedError<ApiType>;
/**
* Any deposit cannot be refunded until after the decision is over.
**/
Unfinished: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
scheduler: {
/**
* Failed to schedule a call
@@ -1325,6 +1438,28 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
stateTrieMigration: {
/**
* bad witness data provided.
**/
BadWitness: AugmentedError<ApiType>;
/**
* max signed limits not respected.
**/
MaxSignedLimits: AugmentedError<ApiType>;
/**
* submitter does not have enough funds.
**/
NotEnoughFunds: AugmentedError<ApiType>;
/**
* upper bound of size is exceeded,
**/
SizeUpperBoundExceeded: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
sudo: {
/**
* Sender must be the Sudo account
@@ -1560,6 +1695,10 @@ declare module '@polkadot/api-base/types/errors' {
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The named owner has not signed ownership of the class is acceptable.
**/
Unaccepted: AugmentedError<ApiType>;
/**
* No approval exists that would allow the transfer.
**/
@@ -1567,7 +1706,7 @@ declare module '@polkadot/api-base/types/errors' {
/**
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
UnknownClass: AugmentedError<ApiType>;
/**
* The delegate turned out to be different to what was expected.
**/
@@ -1618,5 +1757,31 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
whitelist: {
/**
* The call was already whitelisted; No-Op.
**/
CallAlreadyWhitelisted: AugmentedError<ApiType>;
/**
* The call was not whitelisted.
**/
CallIsNotWhitelisted: AugmentedError<ApiType>;
/**
* The weight of the decoded call was higher than the witness.
**/
InvalidCallWeightWitness: AugmentedError<ApiType>;
/**
* The preimage of the call hash could not be loaded.
**/
UnavailablePreImage: AugmentedError<ApiType>;
/**
* The call could not be decoded.
**/
UndecodableCall: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
} // AugmentedErrors
} // declare module
+107 -1
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPostDispatchInfo, NodeRuntimeProxyType, PalletConvictionVotingTally, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PalletStateTrieMigrationMigrationCompute, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
@@ -211,6 +211,10 @@ declare module '@polkadot/api-base/types/events' {
* Code with the specified hash has been stored.
**/
CodeStored: AugmentedEvent<ApiType, [H256]>;
/**
* A contract's code was updated.
**/
ContractCodeUpdated: AugmentedEvent<ApiType, [AccountId32, H256, H256]>;
/**
* A custom event emitted by the contract.
**/
@@ -233,6 +237,20 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
convictionVoting: {
/**
* An account has delegated their vote to another account. \[who, target\]
**/
Delegated: AugmentedEvent<ApiType, [AccountId32, AccountId32]>;
/**
* An \[account\] has cancelled a previous delegation operation.
**/
Undelegated: AugmentedEvent<ApiType, [AccountId32]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
council: {
/**
* A motion was approved by the required threshold.
@@ -680,6 +698,58 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
referenda: {
/**
* A referendum has been approved and its proposal has been scheduled.
**/
Approved: AugmentedEvent<ApiType, [u32]>;
/**
* A referendum has been cancelled.
**/
Cancelled: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
ConfirmAborted: AugmentedEvent<ApiType, [u32]>;
/**
* A referendum has ended its confirmation phase and is ready for approval.
**/
Confirmed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
ConfirmStarted: AugmentedEvent<ApiType, [u32]>;
/**
* The decision deposit has been placed.
**/
DecisionDepositPlaced: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
/**
* The decision deposit has been refunded.
**/
DecisionDepositRefunded: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
/**
* A referendum has moved into the deciding phase.
**/
DecisionStarted: AugmentedEvent<ApiType, [u32, u8, H256, PalletConvictionVotingTally]>;
/**
* A deposit has been slashaed.
**/
DepositSlashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
* A referendum has been killed.
**/
Killed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* A proposal has been rejected by referendum.
**/
Rejected: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* A referendum has being submitted.
**/
Submitted: AugmentedEvent<ApiType, [u32, u8, H256]>;
/**
* A referendum has been timed out without being decided.
**/
TimedOut: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
scheduler: {
/**
* The call for the provided hash was not found so the task has been aborted.
@@ -849,6 +919,29 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
stateTrieMigration: {
/**
* The auto migration task finished.
**/
AutoMigrationFinished: AugmentedEvent<ApiType, []>;
/**
* Migration got halted.
**/
Halted: AugmentedEvent<ApiType, []>;
/**
* Given number of `(top, child)` keys were migrated respectively, with the given
* `compute`.
**/
Migrated: AugmentedEvent<ApiType, [u32, u32, PalletStateTrieMigrationMigrationCompute]>;
/**
* Some account got slashed by the given amount.
**/
Slashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
sudo: {
/**
* The \[sudoer\] just switched identity; the old key is supplied if one existed.
@@ -1116,6 +1209,10 @@ declare module '@polkadot/api-base/types/events' {
* The owner changed.
**/
OwnerChanged: AugmentedEvent<ApiType, [u32, AccountId32]>;
/**
* Ownership acceptance has changed for an account.
**/
OwnershipAcceptanceChanged: AugmentedEvent<ApiType, [AccountId32, Option<u32>]>;
/**
* Metadata has been cleared for an asset instance.
**/
@@ -1175,5 +1272,14 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
whitelist: {
CallWhitelisted: AugmentedEvent<ApiType, [H256]>;
WhitelistedCallDispatched: AugmentedEvent<ApiType, [H256, Result<FrameSupportWeightsPostDispatchInfo, SpRuntimeDispatchErrorWithPostInfo>]>;
WhitelistedCallRemoved: AugmentedEvent<ApiType, [H256]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
} // AugmentedEvents
} // declare module
@@ -6,4 +6,5 @@ import './consts';
import './errors';
import './events';
import './query';
import './registry';
import './tx';
+100 -14
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfo, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -293,10 +293,6 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
contracts: {
/**
* The subtrie counter.
**/
accountCounter: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A mapping between an original code hash and instrumented wasm code, ready for execution.
**/
@@ -314,6 +310,31 @@ declare module '@polkadot/api-base/types/storage' {
* stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
**/
deletionQueue: AugmentedQuery<ApiType, () => Observable<Vec<PalletContractsStorageDeletedContract>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* This is a **monotonic** counter incremented on contract instantiation.
*
* This is used in order to generate unique trie ids for contracts.
* The trie id of a new contract is calculated from hash(account_id, nonce).
* The nonce is required because otherwise the following sequence would lead to
* a possible collision of storage:
*
* 1. Create a new contract.
* 2. Terminate the contract.
* 3. Immediately recreate the contract with the same account_id.
*
* This is bad because the contents of a trie are deleted lazily and there might be
* storage of the old instantiation still in it when the new contract is created. Please
* note that we can't replace the counter by the block number because the sequence above
* can happen in the same block. We also can't keep the account counter in memory only
* because storage is the only way to communicate across different extrinsics in the
* same block.
*
* # Note
*
* Do not use it to determine the number of contracts. It won't be decremented if
* a contract is destroyed.
**/
nonce: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A mapping between an original code hash and its owner information.
**/
@@ -327,6 +348,23 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
convictionVoting: {
/**
* The voting classes which have a non-zero lock requirement and the lock amounts which they
* require. The actual amount locked on behalf of this pallet should always be the maximum of
* this list.
**/
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u8, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* All voting for a particular voter in a particular voting class. We store the balance for the
* number of votes that we have recorded.
**/
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u8 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u8]> & QueryableStorageEntry<ApiType, [AccountId32, u8]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
council: {
/**
* The current members of the collective. This is stored sorted (just by value).
@@ -378,13 +416,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -455,7 +486,7 @@ declare module '@polkadot/api-base/types/storage' {
*
* Can be set via `set_minimum_untrusted_score`.
**/
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<Vec<u128>>>, []> & QueryableStorageEntry<ApiType, []>;
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
**/
@@ -477,7 +508,7 @@ declare module '@polkadot/api-base/types/storage' {
* can be quite large, so we're willing to pay the cost of multiple database accesses to access
* them one at a time instead of reading and decoding all of them at once.
**/
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<Vec<u128>, u32>>, []> & QueryableStorageEntry<ApiType, []>;
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<SpNposElectionsElectionScore, u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The next index to be assigned to an incoming signed submission.
*
@@ -841,6 +872,31 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
referenda: {
/**
* The number of referenda being decided currently.
**/
decidingCount: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<u32>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
/**
* The next free referendum index, aka the number of referenda started so far.
**/
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Information concerning any given referendum.
**/
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfo>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
* conviction-weighted approvals.
*
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
**/
trackQueue: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
scheduler: {
/**
* Items to be executed, indexed by the block number that they should be executed on.
@@ -1212,6 +1268,25 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
stateTrieMigration: {
/**
* The limits that are imposed on automatic migrations.
*
* If set to None, then no automatic migration happens.
**/
autoLimits: AugmentedQuery<ApiType, () => Observable<Option<PalletStateTrieMigrationMigrationLimits>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Migration progress.
*
* This stores the snapshot of the last migrated keys. It can be set into motion and move
* forward by any of the means provided by this pallet.
**/
migrationProcess: AugmentedQuery<ApiType, () => Observable<PalletStateTrieMigrationMigrationTask>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
sudo: {
/**
* The `AccountId` of the sudo key.
@@ -1477,6 +1552,10 @@ declare module '@polkadot/api-base/types/storage' {
* Metadata of an asset instance.
**/
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* The class, if any, of which an account is willing to take ownership.
**/
ownershipAcceptance: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Generic query
**/
@@ -1498,5 +1577,12 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
whitelist: {
whitelistedCall: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Null>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
} // AugmentedQueries
} // declare module
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
+318 -43
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -494,12 +494,12 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Only works if
* - both nodes are within the same bag,
* - and `origin` has a greater `VoteWeight` than `lighter`.
* - and `origin` has a greater `Score` than `lighter`.
**/
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
* changed its weight that it should properly fall into a different bag than its current
* changed its score that it should properly fall into a different bag than its current
* one.
*
* Anyone can call this function about any potentially dislocated account.
@@ -985,6 +985,130 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
convictionVoting: {
/**
* Delegate the voting power (with some given conviction) of the sending account for a
* particular class of polls.
*
* 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 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.
* - `class`: The class of polls to delegate. To delegate multiple classes, multiple calls
* to this function are required.
* - `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: `O(R)` where R is the number of polls the voter delegating to has
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
**/
delegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, conviction: PalletConvictionVotingConviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32, PalletConvictionVotingConviction, u128]>;
/**
* Remove a vote for a poll.
*
* If the `target` is equal to the signer, then this function is exactly equivalent to
* `remove_vote`. If not equal to the signer, then the vote must have expired,
* either because the poll was cancelled, because the voter lost the poll or
* because the conviction period is over.
*
* The dispatch origin of this call must be _Signed_.
*
* - `target`: The account of the vote to be removed; this account must have voted for poll
* `index`.
* - `index`: The index of poll of the vote to be removed.
* - `class`: The class of the poll.
*
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
* Weight is calculated for the maximum number of vote.
**/
removeOtherVote: AugmentedSubmittable<(target: AccountId32 | string | Uint8Array, clazz: u8 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u8, u32]>;
/**
* Remove a vote for a poll.
*
* If:
* - the poll was cancelled, or
* - the poll is ongoing, or
* - the poll has ended such that
* - the vote of the account was in opposition to the result; or
* - there was no conviction to the account's vote; or
* - the account made a split vote
* ...then the vote is removed cleanly and a following call to `unlock` may result in more
* funds being available.
*
* If, however, the poll has ended and:
* - it finished corresponding to the vote of the account, and
* - the account made a standard vote with conviction, and
* - the lock period of the conviction is not over
* ...then the lock will be aggregated into the overall account's lock, which may involve
* *overlocking* (where the two locks are combined into a single lock that is the maximum
* of both the amount locked and the time is it locked for).
*
* The dispatch origin of this call must be _Signed_, and the signer must have a vote
* registered for poll `index`.
*
* - `index`: The index of poll of the vote to be removed.
* - `class`: Optional parameter, if given it indicates the class of the poll. For polls
* which have finished or are cancelled, this must be `Some`.
*
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
* Weight is calculated for the maximum number of vote.
**/
removeVote: AugmentedSubmittable<(clazz: Option<u8> | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u8>, u32]>;
/**
* Undelegate the voting power of the sending account for a particular class of polls.
*
* 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
* currently delegating.
*
* - `class`: The class of polls to remove the delegation from.
*
* Emits `Undelegated`.
*
* Weight: `O(R)` where R is the number of polls the voter delegating to has
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
**/
undelegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
/**
* Remove the lock caused prior voting/delegating which has expired within a particluar
* class.
*
* The dispatch origin of this call must be _Signed_.
*
* - `class`: The class of polls to unlock.
* - `target`: The account to remove the lock on.
*
* Weight: `O(R)` with R number of vote of target.
**/
unlock: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32]>;
/**
* Vote in a poll. 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_.
*
* - `poll_index`: The index of the poll to vote for.
* - `vote`: The vote configuration.
*
* Weight: `O(R)` where R is the number of polls the voter has voted on.
**/
vote: AugmentedSubmittable<(pollIndex: Compact<u32> | AnyNumber | Uint8Array, vote: PalletConvictionVotingVoteAccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, PalletConvictionVotingVoteAccountVote]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
council: {
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
@@ -1502,7 +1626,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* This check can be turned off by setting the value to `None`.
**/
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<Vec<u128>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<Vec<u128>>]>;
setMinimumUntrustedScore: AugmentedSubmittable<(maybeNextScore: Option<SpNposElectionsElectionScore> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<SpNposElectionsElectionScore>]>;
/**
* Submit a solution for the signed phase.
*
@@ -1513,12 +1637,8 @@ declare module '@polkadot/api-base/types/submittable' {
*
* A deposit is reserved and recorded for the solution. Based on the outcome, the solution
* might be rewarded, slashed, or get all or a part of the deposit back.
*
* # <weight>
* Queue size must be provided as witness data.
* # </weight>
**/
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array, numSignedSubmissions: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution, u32]>;
submit: AugmentedSubmittable<(rawSolution: PalletElectionProviderMultiPhaseRawSolution | { solution?: any; score?: any; round?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletElectionProviderMultiPhaseRawSolution]>;
/**
* Submit a solution for the unsigned phase.
*
@@ -2758,6 +2878,82 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
referenda: {
/**
* Cancel an ongoing referendum.
*
* - `origin`: must be the `CancelOrigin`.
* - `index`: The index of the referendum to be cancelled.
*
* Emits `Cancelled`.
**/
cancel: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Cancel an ongoing referendum and slash the deposits.
*
* - `origin`: must be the `KillOrigin`.
* - `index`: The index of the referendum to be cancelled.
*
* Emits `Killed` and `DepositSlashed`.
**/
kill: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Advance a referendum onto its next logical state. Only used internally.
*
* - `origin`: must be `Root`.
* - `index`: the referendum to be advanced.
**/
nudgeReferendum: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Advance a track onto its next logical state. Only used internally.
*
* - `origin`: must be `Root`.
* - `track`: the track to be advanced.
*
* Action item for when there is now one fewer referendum in the deciding phase and the
* `DecidingCount` is not yet updated. This means that we should either:
* - begin deciding another referendum (and leave `DecidingCount` alone); or
* - decrement `DecidingCount`.
**/
oneFewerDeciding: AugmentedSubmittable<(track: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
/**
* Post the Decision Deposit for a referendum.
*
* - `origin`: must be `Signed` and the account must have funds available for the
* referendum's track's Decision Deposit.
* - `index`: The index of the submitted referendum whose Decision Deposit is yet to be
* posted.
*
* Emits `DecisionDepositPlaced`.
**/
placeDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Refund the Decision Deposit for a closed referendum back to the depositor.
*
* - `origin`: must be `Signed` or `Root`.
* - `index`: The index of a closed referendum whose Decision Deposit has not yet been
* refunded.
*
* Emits `DecisionDepositRefunded`.
**/
refundDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Propose a referendum on a privileged action.
*
* - `origin`: must be `Signed` and the account must have `SubmissionDeposit` funds
* available.
* - `proposal_origin`: The origin from which the proposal should be executed.
* - `proposal_hash`: The hash of the proposal preimage.
* - `enactment_moment`: The moment that the proposal should be enacted.
*
* Emits `Submitted`.
**/
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: FrameSupportScheduleDispatchTime | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, FrameSupportScheduleDispatchTime]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
scheduler: {
/**
* Cancel an anonymously scheduled task.
@@ -3255,6 +3451,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -3394,7 +3596,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - Time complexity: O(L), where L is unlocking chunks
* - Bounded by `MAX_UNLOCKING_CHUNKS`.
* - Bounded by `MaxUnlockingChunks`.
* - Storage changes: Can't increase storage, only decrease it.
* # </weight>
**/
@@ -3497,7 +3699,7 @@ declare module '@polkadot/api-base/types/submittable' {
* NOTE: Existing nominators and validators will not be affected by this update.
* to kick people under the new limits, `chill_other` should be called.
**/
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: u128 | AnyNumber | Uint8Array, minValidatorBond: u128 | AnyNumber | Uint8Array, maxNominatorCount: Option<u32> | null | object | string | Uint8Array, maxValidatorCount: Option<u32> | null | object | string | Uint8Array, chillThreshold: Option<Percent> | null | object | string | Uint8Array, minCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, Option<u32>, Option<u32>, Option<Percent>, Perbill]>;
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minValidatorBond: PalletStakingPalletConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxNominatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxValidatorCount: PalletStakingPalletConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, chillThreshold: PalletStakingPalletConfigOpPercent | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minCommission: PalletStakingPalletConfigOpPerbill | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpU32, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpPerbill]>;
/**
* Sets the ideal number of validators.
*
@@ -3519,7 +3721,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Once the unlock period is done, you can call `withdraw_unbonded` to actually move
* the funds out of management ready for transfer.
*
* No more than a limited number of unlocking chunks (see `MAX_UNLOCKING_CHUNKS`)
* No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)
* can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need
* to be called first to remove some of the chunks (if possible).
*
@@ -3562,6 +3764,58 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
stateTrieMigration: {
/**
* Continue the migration for the given `limits`.
*
* The dispatch origin of this call can be any signed account.
*
* This transaction has NO MONETARY INCENTIVES. calling it will not reward anyone. Albeit,
* Upon successful execution, the transaction fee is returned.
*
* The (potentially over-estimated) of the byte length of all the data read must be
* provided for up-front fee-payment and weighing. In essence, the caller is guaranteeing
* that executing the current `MigrationTask` with the given `limits` will not exceed
* `real_size_upper` bytes of read data.
*
* The `witness_task` is merely a helper to prevent the caller from being slashed or
* generally trigger a migration that they do not intend. This parameter is just a message
* from caller, saying that they believed `witness_task` was the last state of the
* migration, and they only wish for their transaction to do anything, if this assumption
* holds. In case `witness_task` does not match, the transaction fails.
*
* Based on the documentation of [`MigrationTask::migrate_until_exhaustion`], the
* recommended way of doing this is to pass a `limit` that only bounds `count`, as the
* `size` limit can always be overwritten.
**/
continueMigrate: AugmentedSubmittable<(limits: PalletStateTrieMigrationMigrationLimits | { size_?: any; item?: any } | string | Uint8Array, realSizeUpper: u32 | AnyNumber | Uint8Array, witnessTask: PalletStateTrieMigrationMigrationTask | { progressTop?: any; progressChild?: any; size_?: any; topItems?: any; childItems?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStateTrieMigrationMigrationLimits, u32, PalletStateTrieMigrationMigrationTask]>;
/**
* Control the automatic migration.
*
* The dispatch origin of this call must be [`Config::ControlOrigin`].
**/
controlAutoMigration: AugmentedSubmittable<(maybeConfig: Option<PalletStateTrieMigrationMigrationLimits> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<PalletStateTrieMigrationMigrationLimits>]>;
/**
* Migrate the list of child keys by iterating each of them one by one.
*
* All of the given child keys must be present under one `child_root`.
*
* This does not affect the global migration process tracker ([`MigrationProcess`]), and
* should only be used in case any keys are leftover due to a bug.
**/
migrateCustomChild: AugmentedSubmittable<(root: Bytes | string | Uint8Array, childKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[], totalSize: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, Vec<Bytes>, u32]>;
/**
* Migrate the list of top keys by iterating each of them one by one.
*
* This does not affect the global migration process tracker ([`MigrationProcess`]), and
* should only be used in case any keys are leftover due to a bug.
**/
migrateCustomTop: AugmentedSubmittable<(keys: Vec<Bytes> | (Bytes | string | Uint8Array)[], witnessSize: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>, u32]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
sudo: {
/**
* Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo
@@ -4151,7 +4405,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
approveTransfer: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
approveTransfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
/**
* Destroy a single asset instance.
*
@@ -4167,7 +4421,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight: `O(1)`
* Modes: `check_owner.is_some()`.
**/
burn: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
burn: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
/**
* Cancel the prior approval for the transfer of an asset by a delegate.
*
@@ -4186,27 +4440,24 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
cancelApproval: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
cancelApproval: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
/**
* Set an attribute for an asset class or instance.
* Clear an attribute for an asset class or instance.
*
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
* asset `class`.
*
* If the origin is Signed, then funds of signer are reserved according to the formula:
* `MetadataDepositBase + DepositPerByte * (key.len + value.len)` taking into
* account any already reserved funds.
* Any deposit is freed for the asset class owner.
*
* - `class`: The identifier of the asset class whose instance's metadata to set.
* - `instance`: The identifier of the asset instance whose metadata to set.
* - `class`: The identifier of the asset class whose instance's metadata to clear.
* - `maybe_instance`: The identifier of the asset instance whose metadata to clear.
* - `key`: The key of the attribute.
* - `value`: The value to which to set the attribute.
*
* Emits `AttributeSet`.
* Emits `AttributeCleared`.
*
* Weight: `O(1)`
**/
clearAttribute: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Option<u32>, Bytes]>;
clearAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes]>;
/**
* Clear the metadata for an asset class.
*
@@ -4221,7 +4472,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
clearClassMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
clearClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Clear the metadata for an asset instance.
*
@@ -4237,7 +4488,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
clearMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
clearMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
/**
* Issue a new class of non-fungible assets from a public origin.
*
@@ -4256,7 +4507,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
create: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
create: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
/**
* Destroy a class of fungible assets.
*
@@ -4274,7 +4525,7 @@ declare module '@polkadot/api-base/types/submittable' {
* - `m = witness.instance_metadatas`
* - `a = witness.attributes`
**/
destroy: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { instances?: any; instanceMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, PalletUniquesDestroyWitness]>;
destroy: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { instances?: any; instanceMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletUniquesDestroyWitness]>;
/**
* Alter the attributes of a given asset.
*
@@ -4294,7 +4545,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
forceAssetStatus: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
forceAssetStatus: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
/**
* Issue a new class of non-fungible assets from a privileged origin.
*
@@ -4313,7 +4564,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
forceCreate: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, bool]>;
forceCreate: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, bool]>;
/**
* Disallow further unprivileged transfer of an asset instance.
*
@@ -4326,7 +4577,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
freeze: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
freeze: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
/**
* Disallow further unprivileged transfers for a whole asset class.
*
@@ -4338,7 +4589,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
freezeClass: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
freezeClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Mint an asset instance of a particular class.
*
@@ -4352,7 +4603,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
mint: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
mint: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
/**
* Reevaluate the deposits on some assets.
*
@@ -4372,7 +4623,20 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(instances.len())`
**/
redeposit: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instances: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Vec<u32>]>;
redeposit: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instances: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
/**
* Set (or reset) the acceptance of ownership for a particular account.
*
* Origin must be `Signed` and if `maybe_class` is `Some`, then the signer must have a
* provider reference.
*
* - `maybe_class`: The identifier of the asset class whose ownership the signer is willing
* to accept, or if `None`, an indication that the signer is willing to accept no
* ownership transferal.
*
* Emits `OwnershipAcceptanceChanged`.
**/
setAcceptOwnership: AugmentedSubmittable<(maybeClass: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
/**
* Set an attribute for an asset class or instance.
*
@@ -4392,7 +4656,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
setAttribute: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Option<u32>, Bytes, Bytes]>;
setAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes, Bytes]>;
/**
* Set the metadata for an asset class.
*
@@ -4411,7 +4675,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
setClassMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Bytes, bool]>;
setClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes, bool]>;
/**
* Set the metadata for an asset instance.
*
@@ -4431,7 +4695,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
setMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Bytes, bool]>;
setMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, bool]>;
/**
* Change the Issuer, Admin and Freezer of an asset class.
*
@@ -4446,7 +4710,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
setTeam: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress]>;
setTeam: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress]>;
/**
* Re-allow unprivileged transfer of an asset instance.
*
@@ -4459,7 +4723,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
thaw: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
thaw: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
/**
* Re-allow unprivileged transfers for a whole asset class.
*
@@ -4471,7 +4735,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
thawClass: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
thawClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Move an asset from the sender account to another.
*
@@ -4489,20 +4753,21 @@ declare module '@polkadot/api-base/types/submittable' {
*
* Weight: `O(1)`
**/
transfer: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
transfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
/**
* Change the Owner of an asset class.
*
* Origin must be Signed and the sender should be the Owner of the asset `class`.
*
* - `class`: The asset class whose owner should be changed.
* - `owner`: The new Owner of this asset class.
* - `owner`: The new Owner of this asset class. They must have called
* `set_accept_ownership` with `class` in order for this operation to succeed.
*
* Emits `OwnerChanged`.
*
* Weight: `O(1)`
**/
transferOwnership: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
transferOwnership: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
/**
* Generic tx
**/
@@ -4687,5 +4952,15 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
whitelist: {
dispatchWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array, callWeightWitness: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, u64]>;
dispatchWhitelistedCallWithPreimage: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
removeWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
whitelistCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
} // AugmentedSubmittables
} // declare module
+3 -1
View File
@@ -6,6 +6,7 @@
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts",
"**/kusama/*.ts",
"**/polkadot/*.ts"
],
@@ -14,6 +15,7 @@
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
{ "path": "../types-augment/tsconfig.build.json" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
@@ -9,6 +9,9 @@
"**/base.ts",
"**/kusama/*.ts"
],
"exclude": [
"**/kusama/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/kusama/*.spec.ts"
],
"references": [
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../api-augment/tsconfig.kusama.json" },
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
@@ -9,6 +9,9 @@
"**/base.ts",
"**/polkadot/*.ts"
],
"exclude": [
"**/polkadot/*.spec.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/rpc-core": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/util": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.8",
"@polkadot/rpc-core": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/util": "^8.7.1",
"rxjs": "^7.5.5"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.14.2' };
@@ -66,6 +66,7 @@ export interface SubmittableResultValue {
internalError?: Error;
status: ExtrinsicStatus;
txHash: Hash;
txIndex?: number;
}
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
+11 -11
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/api": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/types-create": "7.7.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.8",
"@polkadot/api": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/types-create": "7.14.2",
"@polkadot/util": "^8.7.1",
"@polkadot/util-crypto": "^8.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "7.7.1",
"@polkadot/keyring": "^8.3.3"
"@polkadot/api-augment": "7.14.2",
"@polkadot/keyring": "^8.7.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.14.2' };
+16 -16
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/api": "7.7.1",
"@polkadot/api-augment": "7.7.1",
"@polkadot/api-base": "7.7.1",
"@polkadot/rpc-core": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.8",
"@polkadot/api": "7.14.2",
"@polkadot/api-augment": "7.14.2",
"@polkadot/api-base": "7.14.2",
"@polkadot/rpc-core": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/util": "^8.7.1",
"@polkadot/util-crypto": "^8.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api": "7.7.1",
"@polkadot/api-augment": "7.7.1",
"@polkadot/rpc-augment": "7.7.1",
"@polkadot/rpc-provider": "7.7.1",
"@polkadot/types-support": "7.7.1"
"@polkadot/api": "7.14.2",
"@polkadot/api-augment": "7.14.2",
"@polkadot/rpc-augment": "7.14.2",
"@polkadot/rpc-provider": "7.14.2",
"@polkadot/types-support": "7.14.2"
}
}
+53 -26
View File
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { QueryableStorageMultiArg } from '@polkadot/api-base/types';
import type { Option, Vec } from '@polkadot/types';
import type { AccountId, AccountIndex, Address, Balance, BalanceLockTo212, BlockNumber, VestingSchedule } from '@polkadot/types/interfaces';
import type { PalletBalancesBalanceLock, PalletVestingVestingInfo } from '@polkadot/types/lookup';
import type { PalletBalancesBalanceLock, PalletBalancesReserveData, PalletVestingVestingInfo } from '@polkadot/types/lookup';
import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData, DeriveBalancesAllVesting } from '../types';
import { combineLatest, map, of, switchMap } from 'rxjs';
@@ -14,9 +14,7 @@ import { BN, BN_ZERO, bnMax, bnMin, isFunction } from '@polkadot/util';
import { memo } from '../util';
type BalanceLocksEntry = Vec<PalletBalancesBalanceLock | BalanceLockTo212>;
type BalanceLocks = BalanceLocksEntry[];
type ResultBalance = [PalletVestingVestingInfo[] | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[]];
type ResultBalance = [PalletVestingVestingInfo[] | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[], PalletBalancesReserveData[][]];
type Result = [DeriveBalancesAccount, BlockNumber, ResultBalance];
interface AllLocked {
@@ -86,7 +84,9 @@ function calcVesting (bestNumber: BlockNumber, shared: DeriveBalancesAllAccountD
return {
isVesting,
vestedBalance,
vestedClaimable: isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : BN_ZERO,
vestedClaimable: isVesting
? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance))
: BN_ZERO,
vesting: vesting
.map(({ locked, perBlock, startingBlock }, index) => ({
endBlock: locked.div(perBlock).iadd(startingBlock),
@@ -100,7 +100,7 @@ function calcVesting (bestNumber: BlockNumber, shared: DeriveBalancesAllAccountD
};
}
function calcBalances (api: DeriveApi, [data, bestNumber, [vesting, allLocks]]: Result): DeriveBalancesAll {
function calcBalances (api: DeriveApi, [data, bestNumber, [vesting, allLocks, namedReserves]]: Result): DeriveBalancesAll {
const shared = calcShared(api, bestNumber, data, allLocks[0]);
return {
@@ -110,7 +110,8 @@ function calcBalances (api: DeriveApi, [data, bestNumber, [vesting, allLocks]]:
accountNonce: data.accountNonce,
additional: allLocks
.filter((_, index) => index !== 0)
.map((l, index) => calcShared(api, bestNumber, data.additional[index], l))
.map((l, index) => calcShared(api, bestNumber, data.additional[index], l)),
namedReserves
};
}
@@ -133,7 +134,8 @@ function queryOld (api: DeriveApi, accountId: AccountId): Observable<ResultBalan
vestingNew
? [vestingNew]
: null,
[locks]
[locks],
[]
];
})
);
@@ -141,33 +143,58 @@ function queryOld (api: DeriveApi, accountId: AccountId): Observable<ResultBalan
const isNonNullable = <T>(nullable: T): nullable is NonNullable<T> => !!nullable;
function createCalls (accountId: AccountId, calls: unknown[]): [boolean[], QueryableStorageMultiArg<'rxjs'>[]] {
return [
calls.map((c) => !c),
calls
.filter(isNonNullable)
.map((c) => [c, accountId] as unknown as QueryableStorageMultiArg<'rxjs'>)
];
}
// current (balances, vesting)
function queryCurrent (api: DeriveApi, accountId: AccountId, balanceInstances: string[] = ['balances']): Observable<ResultBalance> {
const calls = balanceInstances.map((m): DeriveApi['query']['balances']['locks'] | undefined =>
(api.derive as DeriveCustomLocks)[m]?.customLocks || api.query[m as 'balances']?.locks
const [lockEmpty, lockQueries] = createCalls(
accountId,
balanceInstances.map((m): DeriveApi['query']['balances']['locks'] | undefined =>
(api.derive as DeriveCustomLocks)[m]?.customLocks || api.query[m as 'balances']?.locks
)
);
const [reserveEmpty, reserveQueries] = createCalls(
accountId,
balanceInstances.map((m): DeriveApi['query']['balances']['reserves'] | undefined =>
api.query[m as 'balances']?.reserves
)
);
const lockEmpty = calls.map((c) => !c);
const queries = calls.filter(isNonNullable).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
return (
return combineLatest([
api.query.vesting?.vesting
? api.queryMulti<[Option<PalletVestingVestingInfo> | Option<Vec<PalletVestingVestingInfo>>, ...BalanceLocks]>([[api.query.vesting.vesting, accountId], ...queries])
// TODO We need to check module instances here as well, not only the balances module
: queries.length
? api.queryMulti<[...(Vec<PalletBalancesBalanceLock>)[]]>(queries).pipe(
map((r): [Option<PalletVestingVestingInfo>, ...BalanceLocks] => [api.registry.createType('Option<VestingInfo>'), ...r])
)
: of([api.registry.createType('Option<VestingInfo>')] as [Option<PalletVestingVestingInfo>])
).pipe(
map(([opt, ...locks]): ResultBalance => {
let offset = -1;
? api.query.vesting.vesting(accountId)
: of(api.registry.createType('Option<VestingInfo>')),
lockQueries.length
? api.queryMulti<[...(Vec<PalletBalancesBalanceLock>)[]]>(lockQueries)
: of([] as Vec<PalletBalancesBalanceLock>[]),
reserveQueries.length
? api.queryMulti<[...(Vec<PalletBalancesReserveData>)[]]>(reserveQueries)
: of([] as Vec<PalletBalancesReserveData>[])
]).pipe(
map(([opt, locks, reserves]): ResultBalance => {
let offsetLock = -1;
let offsetReserve = -1;
const vesting = opt.unwrapOr(null);
return [
vesting
? Array.isArray(vesting) ? vesting : [vesting]
? Array.isArray(vesting)
? vesting
: [vesting as PalletVestingVestingInfo]
: null,
lockEmpty.map((e) => e ? api.registry.createType<Vec<PalletBalancesBalanceLock>>('Vec<BalanceLock>') : locks[++offset])
lockEmpty.map((e) =>
e ? api.registry.createType<Vec<PalletBalancesBalanceLock>>('Vec<BalanceLock>') : locks[++offsetLock]
),
reserveEmpty.map((e) =>
e ? api.registry.createType<Vec<PalletBalancesReserveData>>('Vec<PalletBalancesReserveData>') : reserves[++offsetReserve]
)
];
})
);
@@ -202,7 +229,7 @@ export function all (instanceId: string, api: DeriveApi): (address: AccountIndex
? queryCurrent(api, account.accountId, balanceInstances)
: queryOld(api, account.accountId)
])
: of([account, api.registry.createType('BlockNumber'), [null, []]])
: of([account, api.registry.createType('BlockNumber'), [null, [], []]])
)
),
map((result): DeriveBalancesAll => calcBalances(api, result))
+2 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { AccountId, Balance, BalanceLockTo212, Index } from '@polkadot/types/interfaces';
import type { PalletBalancesBalanceLock } from '@polkadot/types/lookup';
import type { PalletBalancesBalanceLock, PalletBalancesReserveData } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';
export interface DeriveBalancesAccountData {
@@ -44,6 +44,7 @@ export interface DeriveBalancesAllVesting {
export interface DeriveBalancesAll extends DeriveBalancesAccount, DeriveBalancesAllAccountData, DeriveBalancesAllVesting {
additional: DeriveBalancesAllAccountData[];
namedReserves: PalletBalancesReserveData[][];
}
export type DeriveBalancesMap = Record<string, DeriveBalancesAll>;
@@ -0,0 +1,19 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyNumber } from '@polkadot/types/types';
import type { SignedBlockExtended } from '../type/types';
import type { DeriveApi } from '../types';
import { switchMap } from 'rxjs';
import { memo } from '../util';
export function getBlockByNumber (instanceId: string, api: DeriveApi): (blockNumber: AnyNumber) => Observable<SignedBlockExtended | undefined> {
return memo(instanceId, (blockNumber: AnyNumber): Observable<SignedBlockExtended | undefined> =>
api.rpc.chain.getBlockHash(blockNumber).pipe(
switchMap((h) => api.derive.chain.getBlock(h))
)
);
}
+1
View File
@@ -6,5 +6,6 @@ export * from './bestNumberFinalized';
export * from './bestNumberLag';
export * from './getHeader';
export * from './getBlock';
export * from './getBlockByNumber';
export * from './subscribeNewBlocks';
export * from './subscribeNewHeads';
+11 -3
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Option } from '@polkadot/types';
import type { Option, u32 } from '@polkadot/types';
import type { PolkadotRuntimeCommonCrowdloanFundInfo } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';
import type { DeriveApi } from '../types';
@@ -14,12 +14,20 @@ import { blake2AsU8a } from '@polkadot/util-crypto';
import { memo } from '../util';
function createChildKey ({ trieIndex }: PolkadotRuntimeCommonCrowdloanFundInfo): string {
interface AllInfo extends PolkadotRuntimeCommonCrowdloanFundInfo {
// previously it was named trieIndex
trieIndex?: u32;
}
function createChildKey (info: AllInfo): string {
return u8aToHex(
u8aConcat(
':child_storage:default:',
blake2AsU8a(
u8aConcat('crowdloan', trieIndex.toU8a())
u8aConcat(
'crowdloan',
(info.fundIndex || info.trieIndex).toU8a()
)
)
)
);
+4 -1
View File
@@ -33,4 +33,7 @@ type DeriveAllSections<AllSections> = {
[S in keyof AllSections]: DeriveSection<AllSections[S]>
};
export type ExactDerive = DeriveAllSections<typeof derive>;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ExactDerive extends DeriveAllSections<typeof derive> {
// keep empty, allows for augmentation
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.14.2' };
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { AccountId, EraIndex } from '@polkadot/types/interfaces';
import type { PalletStakingStakingLedger } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';
import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types';
import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPoints, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types';
import type { DeriveStakingQuery } from './types';
import { combineLatest, map, of, switchMap } from 'rxjs';
@@ -18,7 +18,7 @@ type ErasResult = [DeriveEraPoints[], DeriveEraPrefs[], DeriveEraRewards[]];
function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPrefs, erasRewards]: ErasResult, exposures: DeriveStakerExposure[]): DeriveStakerReward[] {
return exposures.map(({ era, isEmpty, isValidator, nominating, validators: eraValidators }): DeriveStakerReward => {
const { eraPoints, validators: allValPoints } = erasPoints.find((p) => p.era.eq(era)) || { eraPoints: BN_ZERO, validators: {} };
const { eraPoints, validators: allValPoints } = erasPoints.find((p) => p.era.eq(era)) || { eraPoints: BN_ZERO, validators: {} as DeriveEraValPoints };
const { eraReward } = erasRewards.find((r) => r.era.eq(era)) || { eraReward: api.registry.createType('Balance') };
const { validators: allValPrefs } = erasPrefs.find((p) => p.era.eq(era)) || { validators: {} as DeriveEraValPrefs };
const validators: Record<string, DeriveStakerRewardValidator> = {};
+36 -5
View File
@@ -7,12 +7,40 @@ import type { EraIndex } from '@polkadot/types/interfaces';
import type { ExactDerive } from '../derive';
import type { DeriveApi } from '../types';
import { combineLatest, of, switchMap } from 'rxjs';
import { BehaviorSubject, combineLatest, map, of, switchMap, tap, toArray } from 'rxjs';
import { arrayChunk, arrayFlatten } from '@polkadot/util';
import { memo } from '../util';
type ApplyReturn<T extends keyof ExactDerive['staking']> = ReturnType<ExactDerive['staking'][T]>;
// only retrieve a maximum of 14 eras (84 / 6) at a time
// (This is not empirically calculated. Rather smaller sizes take longer
// time due to the serial nature, large sizes may tie up the RPCs)
const ERA_CHUNK_SIZE = 14;
function chunkEras <T> (eras: EraIndex[], fn: (eras: EraIndex[]) => Observable<T[]>): Observable<T[]> {
const chunked = arrayChunk(eras, ERA_CHUNK_SIZE);
let index = 0;
const startSubject = new BehaviorSubject<EraIndex[]>(chunked[index]);
return startSubject.pipe(
switchMap(fn),
tap((): void => {
setTimeout((): void => {
index++;
index === chunked.length
? startSubject.complete()
: startSubject.next(chunked[index]);
}, 0);
}),
toArray(),
map(arrayFlatten)
);
}
export function filterEras <T extends { era: EraIndex }> (eras: EraIndex[], list: T[]): EraIndex[] {
return eras.filter((e) => !list.some(({ era }) => e.eq(era)));
}
@@ -53,9 +81,12 @@ export function combineEras <F extends '_eraExposure' | '_eraPrefs' | '_eraSlash
// Cannot quite get the typing right, but it is right in the code
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
memo(instanceId, (eras: EraIndex[], withActive: boolean) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
eras.length
? combineLatest(eras.map((e) => api.derive.staking[fn](e, withActive)))
: of([])
!eras.length
? of([])
: chunkEras(eras, (eras) =>
combineLatest(
eras.map((e) => api.derive.staking[fn](e, withActive))
)
)
) as any;
}
+19 -19
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/api-augment": "7.7.1",
"@polkadot/api-base": "7.7.1",
"@polkadot/api-derive": "7.7.1",
"@polkadot/keyring": "^8.3.3",
"@polkadot/rpc-augment": "7.7.1",
"@polkadot/rpc-core": "7.7.1",
"@polkadot/rpc-provider": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-augment": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/types-create": "7.7.1",
"@polkadot/types-known": "7.7.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"@babel/runtime": "^7.17.8",
"@polkadot/api-augment": "7.14.2",
"@polkadot/api-base": "7.14.2",
"@polkadot/api-derive": "7.14.2",
"@polkadot/keyring": "^8.7.1",
"@polkadot/rpc-augment": "7.14.2",
"@polkadot/rpc-core": "7.14.2",
"@polkadot/rpc-provider": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-augment": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/types-create": "7.14.2",
"@polkadot/types-known": "7.14.2",
"@polkadot/util": "^8.7.1",
"@polkadot/util-crypto": "^8.7.1",
"eventemitter3": "^4.0.7",
"rxjs": "^7.5.2"
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "7.7.1",
"@polkadot/types-support": "7.7.1"
"@polkadot/api-augment": "7.14.2",
"@polkadot/types-support": "7.14.2"
}
}
+2
View File
@@ -64,6 +64,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._rpcCore.setRegistrySwap((blockHash: Uint8Array) => this.getBlockRegistry(blockHash));
this._rpcCore.setResolveBlockHash((blockNumber) => firstValueFrom(this._rpcCore.chain.getBlockHash(blockNumber)));
if (this.hasSubscriptions) {
this._rpcCore.provider.on('disconnected', () => this.#onProviderDisconnect());
this._rpcCore.provider.on('error', (e: Error) => this.#onProviderError(e));
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.14.2' };
+16 -9
View File
@@ -14,7 +14,15 @@ interface Tracker<T> {
resolve: (value: T) => void;
}
// a Promise completion tracker, wrapping an isComplete variable that ensures the promise only resolves once
type CodecReturnType<T extends (...args: unknown[]) => Observable<Codec>> =
T extends (...args: any) => infer R
? R extends Observable<Codec>
? ObsInnerType<R>
: never
: never;
// a Promise completion tracker, wrapping an isComplete variable that ensures
// that the promise only resolves once
export function promiseTracker<T> (resolve: (value: T) => void, reject: (value: Error) => void): Tracker<T> {
let isCompleted = false;
@@ -40,14 +48,13 @@ export function promiseTracker<T> (resolve: (value: T) => void, reject: (value:
// extract the arguments and callback params from a value array possibly containing a callback
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])) {
callback = actualArgs.pop() as Callback<Codec>;
}
const callback = (args.length && isFunction(args[args.length - 1]))
? actualArgs.pop() as Callback<Codec>
: undefined;
// When we need a subscription, ensure that a valid callback is actually passed
assert(!needsCallback || isFunction(callback), 'Expected a callback to be passed with subscriptions');
@@ -56,7 +63,7 @@ function extractArgs (args: unknown[], needsCallback: boolean): [unknown[], Call
}
// Decorate a call for a single-shot result - retrieve and then immediate unsubscribe
function decorateCall<M extends DecorateFn<ObsInnerType<ReturnType<M>>>> (method: M, args: unknown[]): Promise<ObsInnerType<ReturnType<M>>> {
function decorateCall<M extends DecorateFn<CodecReturnType<M>>> (method: M, args: unknown[]): Promise<CodecReturnType<M>> {
return new Promise((resolve, reject): void => {
// single result tracker - either reject with Error or resolve with Codec result
const tracker = promiseTracker(resolve, reject);
@@ -74,7 +81,7 @@ function decorateCall<M extends DecorateFn<ObsInnerType<ReturnType<M>>>> (method
}
// Decorate a subscription where we have a result callback specified
function decorateSubscribe<M extends DecorateFn<ObsInnerType<ReturnType<M>>>> (method: M, args: unknown[], resultCb: Callback<Codec>): UnsubscribePromise {
function decorateSubscribe<M extends DecorateFn<CodecReturnType<M>>> (method: M, args: 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);
@@ -95,10 +102,10 @@ function decorateSubscribe<M extends DecorateFn<ObsInnerType<ReturnType<M>>>> (m
/**
* @description Decorate method for ApiPromise, where the results are converted to the Promise equivalent
*/
export function toPromiseMethod<M extends DecorateFn<ObsInnerType<ReturnType<M>>>> (method: M, options?: DecorateMethodOptions): StorageEntryPromiseOverloads {
export function toPromiseMethod<M extends DecorateFn<CodecReturnType<M>>> (method: M, options?: DecorateMethodOptions): StorageEntryPromiseOverloads {
const needsCallback = !!(options && options.methodName && options.methodName.includes('subscribe'));
return function (...args: unknown[]): Promise<ObsInnerType<ReturnType<M>>> | UnsubscribePromise {
return function (...args: unknown[]): Promise<CodecReturnType<M>> | UnsubscribePromise {
const [actualArgs, resultCb] = extractArgs(args, needsCallback);
return resultCb
+4 -1
View File
@@ -47,13 +47,16 @@ export class SubmittableResult implements ISubmittableResult {
public readonly txHash: Hash;
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash }: SubmittableResultValue) {
public readonly txIndex?: number;
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }: SubmittableResultValue) {
this.dispatchError = dispatchError || extractError(events);
this.dispatchInfo = dispatchInfo || extractInfo(events);
this.events = events || [];
this.internalError = internalError;
this.status = status;
this.txHash = txHash;
this.txIndex = txIndex;
}
public get isCompleted (): boolean {
+31 -20
View File
@@ -3,7 +3,7 @@
/* eslint-disable no-dupe-class-members */
import type { Observable, OperatorFunction } from 'rxjs';
import type { Observable } from 'rxjs';
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
import type { Callback, Codec, Constructor, IKeyringPair, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types-codec/types';
@@ -24,6 +24,11 @@ interface SubmittableOptions<ApiType extends ApiTypes> {
decorateMethod: ApiBase<ApiType>['_decorateMethod'];
}
interface UpdateInfo {
options: SignatureOptions;
updateId: number;
}
const identity = <T> (input: T): T => input;
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
@@ -174,7 +179,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return decorateMethod(
(): Observable<this> =>
this.#observeSign(account, partialOptions).pipe(
mapTo<number | undefined, this>(this)
mapTo(this)
)
)();
}
@@ -197,10 +202,10 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return decorateMethod(
(): Observable<Codec> => (
this.#observeSign(account, options).pipe(
switchMap((updateId: number | undefined): Observable<ISubmittableResult> | Observable<Hash> =>
switchMap((info): Observable<ISubmittableResult> | Observable<Hash> =>
isSubscription
? this.#observeSubscribe(updateId)
: this.#observeSend(updateId)
? this.#observeSubscribe(info)
: this.#observeSend(info)
)
) as Observable<Codec>) // FIXME This is wrong, SubmittableResult is _not_ a codec
)(statusCb);
@@ -213,23 +218,24 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return this;
}
#observeSign = (account: AddressOrPair, partialOptions?: Partial<SignerOptions>): Observable<number | undefined> => {
#observeSign = (account: AddressOrPair, partialOptions?: Partial<SignerOptions>): Observable<UpdateInfo> => {
const address = isKeyringPair(account) ? account.address : account.toString();
const options = optionsOrNonce(partialOptions);
let updateId: number | undefined;
return api.derive.tx.signingInfo(address, options.nonce, options.era).pipe(
first(),
mergeMap(async (signingInfo): Promise<void> => {
mergeMap(async (signingInfo): Promise<UpdateInfo> => {
const eraOptions = makeEraOptions(api, this.registry, options, signingInfo);
let updateId = -1;
if (isKeyringPair(account)) {
this.sign(account, eraOptions);
} else {
updateId = await this.#signViaSigner(address, eraOptions, signingInfo.header);
}
}),
mapTo(updateId) as OperatorFunction<void, number | undefined>
return { options: eraOptions, updateId };
})
);
};
@@ -248,7 +254,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return api.derive.tx.events(blockHash).pipe(
map(({ block, events }): ISubmittableResult =>
this.#transformResult(new SubmittableResult({
events: filterEvents(txHash, block, events, status),
...filterEvents(txHash, block, events, status),
status,
txHash
}))
@@ -263,15 +269,15 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
);
};
#observeSend = (updateId = -1): Observable<Hash> => {
#observeSend = (info: UpdateInfo): Observable<Hash> => {
return api.rpc.author.submitExtrinsic(this).pipe(
tap((hash): void => {
this.#updateSigner(updateId, hash);
this.#updateSigner(hash, info);
})
);
};
#observeSubscribe = (updateId = -1): Observable<ISubmittableResult> => {
#observeSubscribe = (info: UpdateInfo): Observable<ISubmittableResult> => {
const txHash = this.hash;
return api.rpc.author.submitAndWatchExtrinsic(this).pipe(
@@ -279,7 +285,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
this.#observeStatus(txHash, status)
),
tap((status): void => {
this.#updateSigner(updateId, status);
this.#updateSigner(status, info);
})
);
};
@@ -296,9 +302,9 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
})]);
let result: SignerResult;
if (signer.signPayload) {
if (isFunction(signer.signPayload)) {
result = await signer.signPayload(payload.toPayload());
} else if (signer.signRaw) {
} else if (isFunction(signer.signRaw)) {
result = await signer.signRaw(payload.toRaw());
} else {
throw new Error('Invalid signer interface, it should implement either signPayload or signRaw (or both)');
@@ -312,9 +318,14 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return result.id;
};
#updateSigner = (updateId: number, status: Hash | ISubmittableResult): void => {
if ((updateId !== -1) && api.signer && api.signer.update) {
api.signer.update(updateId, status);
#updateSigner = (status: Hash | ISubmittableResult, info?: UpdateInfo): void => {
if (info && (info.updateId !== -1)) {
const { options, updateId } = info;
const signer = options.signer || api.signer;
if (signer && isFunction(signer.update)) {
signer.update(updateId, status);
}
}
};
}
+10 -7
View File
@@ -5,14 +5,17 @@ import type { EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@polkadot/
import { l } from './logging';
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): EventRecord[] | undefined {
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): { events?: EventRecord[], txIndex?: number } {
// extrinsics to hashes
for (const [index, x] of extrinsics.entries()) {
for (const [txIndex, x] of extrinsics.entries()) {
if (x.hash.eq(txHash)) {
return allEvents.filter(({ phase }) =>
// only ApplyExtrinsic has the extrinsic index
phase.isApplyExtrinsic && phase.asApplyExtrinsic.eqn(index)
);
return {
events: allEvents.filter(({ phase }) =>
phase.isApplyExtrinsic &&
phase.asApplyExtrinsic.eqn(txIndex)
),
txIndex
};
}
}
@@ -24,5 +27,5 @@ export function filterEvents (txHash: H256, { block: { extrinsics, header } }: S
l.warn(`block ${header.hash.toHex()}: Unable to find extrinsic ${txHash.toHex()} inside ${allHashes.join(', ')}`);
}
return undefined;
return {};
}
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/rpc-core": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.8",
"@polkadot/rpc-core": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/util": "^8.7.1"
}
}
+14 -3
View File
@@ -12,6 +12,7 @@ import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
import type { BlockStats } from '@polkadot/types/interfaces/dev';
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
@@ -21,7 +22,7 @@ import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
import type { IExtrinsic, Observable } from '@polkadot/types/types';
@@ -155,6 +156,12 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
**/
uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<CodeUploadResult>>;
};
dev: {
/**
* Reexecute the specified `block_hash` and gather statistics while doing so
**/
getBlockStats: AugmentedRpc<(at: Hash | string | Uint8Array) => Observable<Option<BlockStats>>>;
};
engine: {
/**
* Instructs the manual-seal authorship task to create a new block
@@ -333,9 +340,9 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
};
grandpa: {
/**
* Prove finality for the range (begin; end] hash.
* Prove finality for the given block number, returning the Justification for the last block in the set.
**/
proveFinality: AugmentedRpc<(begin: BlockHash | string | Uint8Array, end: BlockHash | string | Uint8Array, authoritiesSetId?: u64 | AnyNumber | Uint8Array) => Observable<Option<EncodedFinalityProofs>>>;
proveFinality: AugmentedRpc<(blockNumber: BlockNumber | AnyNumber | Uint8Array) => Observable<Option<EncodedFinalityProofs>>>;
/**
* Returns the state of the current best round state as well as the ongoing background rounds
**/
@@ -472,6 +479,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Provides a way to trace the re-execution of a single block
**/
traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | object | string | Uint8Array, storageKeys: Option<Text> | null | object | string | Uint8Array, methods: Option<Text> | null | object | string | Uint8Array) => Observable<TraceBlockResponse>>;
/**
* Check current migration state
**/
trieMigrationStatus: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<MigrationStatusResult>>;
};
syncstate: {
/**
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.14.2' };
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/rpc-augment": "7.7.1",
"@polkadot/rpc-provider": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/util": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.8",
"@polkadot/rpc-augment": "7.14.2",
"@polkadot/rpc-provider": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/util": "^8.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^8.3.3",
"@polkadot/rpc-augment": "7.7.1"
"@polkadot/keyring": "^8.7.1",
"@polkadot/rpc-augment": "7.14.2"
}
}
+19 -3
View File
@@ -5,7 +5,7 @@ import type { Observer } from 'rxjs';
import type { ProviderInterface, ProviderInterfaceCallback } from '@polkadot/rpc-provider/types';
import type { StorageKey, Vec } from '@polkadot/types';
import type { Hash } from '@polkadot/types/interfaces';
import type { AnyJson, Codec, DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types';
import type { AnyJson, AnyNumber, Codec, DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types';
import type { Memoized } from '@polkadot/util/types';
import type { RpcInterfaceMethod } from './types';
@@ -85,6 +85,7 @@ export class RpcCore {
#registryDefault: Registry;
#getBlockRegistry?: (blockHash: Uint8Array) => Promise<{ registry: Registry }>;
#getBlockHash?: (blockNumber: AnyNumber) => Promise<Uint8Array>;
readonly #storageCache = new Map<string, string | null>();
@@ -146,6 +147,15 @@ export class RpcCore {
});
}
/**
* @description Sets a function to resolve block hash from block number
*/
public setResolveBlockHash (resolveBlockHash: (blockNumber: AnyNumber) => Promise<Uint8Array>): void {
this.#getBlockHash = memoize(resolveBlockHash, {
getInstanceId: () => this.#instanceId
});
}
public addUserInterfaces (userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): void {
// add any extra user-defined sections
this.sections.push(...Object.keys(userRpc).filter((k) => !this.sections.includes(k)));
@@ -202,12 +212,18 @@ export class RpcCore {
// execute the RPC call, doing a registry swap for historic as applicable
const callWithRegistry = async <T> (isScale: boolean, values: unknown[]): Promise<T> => {
const blockHash = hashIndex === -1
const blockId = hashIndex === -1
? null
: values[hashIndex] as (Uint8Array | string | null | undefined);
: values[hashIndex];
const blockHash = blockId && def.params[hashIndex].type === 'BlockNumber'
? await this.#getBlockHash?.(blockId as AnyNumber)
: blockId as (Uint8Array | string | null | undefined);
const { registry } = isScale && blockHash && this.#getBlockRegistry
? await this.#getBlockRegistry(u8aToU8a(blockHash))
: { registry: this.#registryDefault };
const params = this._formatInputs(registry, null, def, values);
// only cache .at(<blockHash>) queries, e.g. where valid blockHash was supplied
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.14.2' };
+3 -1
View File
@@ -36,7 +36,9 @@ describe('replay', (): void => {
const observable = rpc.system.chain();
let a: any | undefined;
observable.subscribe((value?: unknown): void => { a = value; });
observable.subscribe((value?: unknown): void => {
a = value;
});
setTimeout((): void => {
// Subscribe again to the same observable, it should fire value immediately
+3 -1
View File
@@ -14,7 +14,9 @@ describe('drr', (): void => {
it('should not fire twice the same value', (done): void => {
let count = 0;
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => { ++count; });
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => {
++count;
});
setTimeout((): void => {
expect(count).toBe(1);
+23 -2
View File
@@ -4,9 +4,9 @@ Generic transport providers to handle the transport of method calls to and from
## Provider Selection
There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the [[WsProvider]] since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
There are three flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets, and the third one uses substrate light-client through @substrate/connect. It is generally recommended to use the [[WsProvider]] since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
Both providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
All providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
## Usage
@@ -39,3 +39,24 @@ const version = await provider.send('chain_getBlockHash', []);
console.log('latest block Hash', hash);
```
@substrate/connect Initialization -
Instantiating a Provider for the Polkadot Relay Chain:
```javascript
import { ScProvider } from '@polkadot/rpc-provider';
const provider = new ScProvider(SupportedChains.polkadot);
await provider.connect();
const version = await provider.send('chain_getBlockHash', []);
```
Instantiating a Provider for a Polkadot parachain:
```javascript
import { ScProvider } from '@polkadot/rpc-provider';
const polkadotProvider = new ScProvider(SupportedChains.polkadot);
const parachainProvider = new ScProvider(parachainSpec, polkadotProvider);
await parachainProvider.connect();
const version = await parachainProvider.send('chain_getBlockHash', []);
```
+11 -10
View File
@@ -20,18 +20,19 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/keyring": "^8.3.3",
"@polkadot/types": "7.7.1",
"@polkadot/types-support": "7.7.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"@polkadot/x-fetch": "^8.3.3",
"@polkadot/x-global": "^8.3.3",
"@polkadot/x-ws": "^8.3.3",
"@babel/runtime": "^7.17.8",
"@polkadot/keyring": "^8.7.1",
"@polkadot/types": "7.14.2",
"@polkadot/types-support": "7.14.2",
"@polkadot/util": "^8.7.1",
"@polkadot/util-crypto": "^8.7.1",
"@polkadot/x-fetch": "^8.7.1",
"@polkadot/x-global": "^8.7.1",
"@polkadot/x-ws": "^8.7.1",
"@substrate/connect": "0.7.0-alpha.0",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.2",
"nock": "^13.2.4"
+3
View File
@@ -4,3 +4,6 @@
export { HttpProvider } from './http';
export { packageInfo } from './packageInfo';
export { WsProvider } from './ws';
// ESM-only, only export top-level when we have dual versions
// export { ScProvider } from './substrate-connect';
@@ -0,0 +1,109 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { isError } from '@polkadot/util/is/error';
import RpcError from './error';
describe('RpcError', (): void => {
describe('constructor', (): void => {
it('constructs an Error that is still an Error', (): void => {
expect(
isError(
new RpcError()
)
).toEqual(true);
});
});
describe('static', (): void => {
it('exposes the .CODES as a static', (): void => {
expect(
Object.keys(RpcError.CODES)
).not.toEqual(0);
});
});
describe('constructor properties', (): void => {
it('sets the .message property', (): void => {
expect(
new RpcError('test message').message
).toEqual('test message');
});
it("sets the .message to '' when not set", (): void => {
expect(
new RpcError().message
).toEqual('');
});
it('sets the .code property', (): void => {
expect(
new RpcError('test message', 1234).code
).toEqual(1234);
});
it('sets the .code to UKNOWN when not set', (): void => {
expect(
new RpcError('test message').code
).toEqual(RpcError.CODES.UNKNOWN);
});
it('sets the .data property', (): void => {
const data = 'here';
expect(
new RpcError('test message', 1234, data).data
).toEqual(data);
});
it('sets the .data property to generic value', (): void => {
const data = { custom: 'value' } as const;
expect(
new RpcError('test message', 1234, data).data
).toEqual(data);
});
});
describe('stack traces', (): void => {
// eslint-disable-next-line @typescript-eslint/ban-types
let captureStackTrace: (targetObject: Record<string, any>, constructorOpt?: Function | undefined) => void;
beforeEach((): void => {
captureStackTrace = Error.captureStackTrace;
Error.captureStackTrace = function (error): void {
Object.defineProperty(error, 'stack', {
configurable: true,
get: function getStack (): string {
const value = 'some stack returned';
Object.defineProperty(this, 'stack', { value });
return value;
}
});
};
});
afterEach((): void => {
Error.captureStackTrace = captureStackTrace;
});
it('captures via captureStackTrace when available', (): void => {
expect(
new RpcError().stack
).toEqual('some stack returned');
});
it('captures via stack when captureStackTrace not available', (): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Error.captureStackTrace = null as any;
expect(
new RpcError().stack.length
).not.toEqual(0);
});
});
});
+66
View File
@@ -0,0 +1,66 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { isFunction } from '@polkadot/util/is/function';
import { RpcErrorInterface } from '../types';
const UNKNOWN = -99999;
function extend<Data, K extends keyof RpcError<Data>> (that: RpcError<Data>, name: K, value: RpcError<Data>[K]): void {
Object.defineProperty(that, name, {
configurable: true,
enumerable: false,
value
});
}
/**
* @name RpcError
* @summary Extension to the basic JS Error.
* @description
* The built-in JavaScript Error class is extended by adding a code to allow for Error categorization. In addition to the normal `stack`, `message`, the numeric `code` and `data` (any types) parameters are available on the object.
* @example
* <BR>
*
* ```javascript
* const { RpcError } from '@polkadot/util');
*
* throw new RpcError('some message', RpcError.CODES.METHOD_NOT_FOUND); // => error.code = -32601
* ```
*/
export default class RpcError<Data = never> extends Error implements RpcErrorInterface<Data> {
public code!: number;
public data?: Data;
public override message!: string;
public override name!: string;
public override stack!: string;
public constructor (message = '', code: number = UNKNOWN, data?: Data) {
super();
extend(this, 'message', String(message));
extend(this, 'name', this.constructor.name);
extend(this, 'data', data);
extend(this, 'code', code);
if (isFunction(Error.captureStackTrace)) {
Error.captureStackTrace(this, this.constructor);
} else {
const { stack } = new Error(message);
stack && extend(this, 'stack', stack);
}
}
public static CODES = {
ASSERT: -90009,
INVALID_JSONRPC: -99998,
METHOD_NOT_FOUND: -32601, // Rust client
UNKNOWN
};
}
+4 -1
View File
@@ -5,6 +5,8 @@ import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '
import { assert, isNumber, isString, isUndefined, stringify } from '@polkadot/util';
import RpcError from './error';
function formatErrorData (data?: string | number): string {
if (isUndefined(data)) {
return '';
@@ -68,8 +70,9 @@ export class RpcCoder {
private _checkError (error?: JsonRpcResponseBaseError): void {
if (error) {
const { code, data, message } = error;
const fmtMessage = `${code}: ${message}${formatErrorData(data)}`;
throw new Error(`${code}: ${message}${formatErrorData(data)}`);
throw new RpcError(fmtMessage, code, data);
}
}
}
+46 -14
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
import { assert, logger } from '@polkadot/util';
import { fetch } from '@polkadot/x-fetch';
@@ -43,6 +43,8 @@ export class HttpProvider implements ProviderInterface {
readonly #headers: Record<string, string>;
readonly #stats: ProviderStats;
/**
* @param {string} endpoint The endpoint url starting with http://
*/
@@ -52,6 +54,10 @@ export class HttpProvider implements ProviderInterface {
this.#coder = new RpcCoder();
this.#endpoint = endpoint;
this.#headers = headers;
this.#stats = {
active: { requests: 0, subscriptions: 0 },
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
};
}
/**
@@ -82,6 +88,13 @@ export class HttpProvider implements ProviderInterface {
// noop
}
/**
* @description Returns the connection stats
*/
public get stats (): ProviderStats {
return this.#stats;
}
/**
* @summary Whether the node is connected or not.
* @return {boolean} true if connected
@@ -107,6 +120,8 @@ export class HttpProvider implements ProviderInterface {
* @summary Send HTTP POST Request with Body to configured HTTP Endpoint.
*/
public async send <T> (method: string, params: unknown[], isCacheable?: boolean): Promise<T> {
this.#stats.total.requests++;
const body = this.#coder.encodeJson(method, params);
let resultPromise: Promise<T> | null = isCacheable
? this.#callCache.get(body) as Promise<T>
@@ -118,28 +133,45 @@ export class HttpProvider implements ProviderInterface {
if (isCacheable) {
this.#callCache.set(body, resultPromise);
}
} else {
this.#stats.total.cached++;
}
return resultPromise;
}
async #send <T> (body: string): Promise<T> {
const response = await fetch(this.#endpoint, {
body,
headers: {
Accept: 'application/json',
'Content-Length': `${body.length}`,
'Content-Type': 'application/json',
...this.#headers
},
method: 'POST'
});
this.#stats.active.requests++;
this.#stats.total.bytesSent += body.length;
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
try {
const response = await fetch(this.#endpoint, {
body,
headers: {
Accept: 'application/json',
'Content-Length': `${body.length}`,
'Content-Type': 'application/json',
...this.#headers
},
method: 'POST'
});
const result = (await response.json()) as JsonRpcResponse;
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
return this.#coder.decodeResponse(result) as T;
const result = await response.text();
this.#stats.total.bytesRecv += result.length;
const decoded = this.#coder.decodeResponse(JSON.parse(result) as JsonRpcResponse) as T;
this.#stats.active.requests--;
return decoded;
} catch (e) {
this.#stats.active.requests--;
throw e;
}
}
/**
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.14.2' };
@@ -0,0 +1,347 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { assert } from '@polkadot/util';
export interface SmoldotHealth {
isSyncing: boolean
peers: number
shouldHavePeers: boolean
}
export interface HealthChecker {
setSendJsonRpc(sendRequest: (request: string) => void): void
start(healthCallback: (health: SmoldotHealth) => void): void
stop(): void
sendJsonRpc(request: string): void
responsePassThrough(response: string): string | null
}
/*
* Creates a new health checker.
*
* The role of the health checker is to report to the user the health of a smoldot chain.
*
* In order to use it, start by creating a health checker, and call `setSendJsonRpc` to set the
* way to send a JSON-RPC request to a chain. The health checker is disabled by default. Use
* `start()` in order to start the health checks. The `start()` function must be passed a callback called
* when an update to the health of the node is available.
*
* In order to send a JSON-RPC request to the chain, you **must** use the `sendJsonRpc` function
* of the health checker. The health checker rewrites the `id` of the requests it receives.
*
* When the chain send a JSON-RPC response, it must be passed to `responsePassThrough()`. This
* function intercepts the responses destined to the requests that have been emitted by the health
* checker and returns `null`. If the response doesn't concern the health checker, the response is
* simply returned by the function.
*
* # How it works
*
* The health checker periodically calls the `system_health` JSON-RPC call in order to determine
* the health of the chain.
*
* In addition to this, as long as the health check reports that `isSyncing` is `true`, the
* health checker also maintains a subscription to new best blocks using `chain_subscribeNewHeads`.
* Whenever a new block is notified, a health check is performed immediately in order to determine
* whether `isSyncing` has changed to `false`.
*
* Thanks to this subscription, the latency of the report of the switch from `isSyncing: true` to
* `isSyncing: false` is very low.
*
*/
export function healthChecker (): HealthChecker {
// `null` if health checker is not started.
let checker: null | InnerChecker = null;
let sendJsonRpc: null | ((request: string) => void) = null;
return {
responsePassThrough: (jsonRpcResponse) => {
if (checker === null) {
return jsonRpcResponse;
}
return checker.responsePassThrough(jsonRpcResponse);
},
sendJsonRpc: (request) => {
assert(
sendJsonRpc,
'setSendJsonRpc must be called before sending requests'
);
if (checker === null) {
sendJsonRpc(request);
} else {
checker.sendJsonRpc(request);
}
},
setSendJsonRpc: (cb) => {
sendJsonRpc = cb;
},
start: (healthCallback) => {
assert(
checker === null,
"Can't start the health checker multiple times in parallel"
);
assert(
sendJsonRpc,
'setSendJsonRpc must be called before starting the health checks'
);
checker = new InnerChecker(healthCallback, sendJsonRpc);
checker.update(true);
},
stop: () => {
if (checker === null) {
return;
} // Already stopped.
checker.destroy();
checker = null;
}
};
}
class InnerChecker {
#healthCallback: (health: SmoldotHealth) => void;
#currentHealthCheckId: string | null = null;
#currentHealthTimeout: ReturnType<typeof setTimeout> | null = null;
#currentSubunsubRequestId: string | null = null;
#currentSubscriptionId: string | null = null;
#requestToSmoldot: (request: string) => void;
#isSyncing = false;
#nextRequestId = 0;
constructor (
healthCallback: (health: SmoldotHealth) => void,
requestToSmoldot: (request: string) => void
) {
this.#healthCallback = healthCallback;
this.#requestToSmoldot = requestToSmoldot;
}
sendJsonRpc = (request: string): void => {
// Replace the `id` in the request to prefix the request ID with `extern:`.
let parsedRequest: {id: string | number};
try {
parsedRequest = JSON.parse(request) as {id: string | number};
} catch (err) {
return;
}
if (parsedRequest.id) {
const newId = 'extern:' + JSON.stringify(parsedRequest.id);
parsedRequest.id = newId;
}
this.#requestToSmoldot(JSON.stringify(parsedRequest));
};
responsePassThrough = (jsonRpcResponse: string): string | null => {
let parsedResponse: {id: string, result?: SmoldotHealth, params?: { subscription: string }};
try {
parsedResponse = JSON.parse(jsonRpcResponse) as {id: string, result: undefined | SmoldotHealth};
} catch (err) {
return jsonRpcResponse;
}
// Check whether response is a response to `system_health`.
if (parsedResponse.id && this.#currentHealthCheckId === parsedResponse.id) {
this.#currentHealthCheckId = null;
// Check whether query was successful. It is possible for queries to fail for
// various reasons, such as the client being overloaded.
if (!parsedResponse.result) {
this.update(false);
return null;
}
this.#healthCallback(parsedResponse.result);
this.#isSyncing = parsedResponse.result.isSyncing;
this.update(false);
return null;
}
// Check whether response is a response to the subscription or unsubscription.
if (
parsedResponse.id &&
this.#currentSubunsubRequestId === parsedResponse.id
) {
this.#currentSubunsubRequestId = null;
// Check whether query was successful. It is possible for queries to fail for
// various reasons, such as the client being overloaded.
if (!parsedResponse.result) {
this.update(false);
return null;
}
if (this.#currentSubscriptionId) {
this.#currentSubscriptionId = null;
} else {
this.#currentSubscriptionId = parsedResponse.result as unknown as string;
}
this.update(false);
return null;
}
// Check whether response is a notification to a subscription.
if (
parsedResponse.params &&
this.#currentSubscriptionId &&
parsedResponse.params.subscription === this.#currentSubscriptionId
) {
// Note that after a successful subscription, a notification containing
// the current best block is always returned. Considering that a
// subscription is performed in response to a health check, calling
// `startHealthCheck()` here will lead to a second health check.
// It might seem redundant to perform two health checks in a quick
// succession, but doing so doesn't lead to any problem, and it is
// actually possible for the health to have changed in between as the
// current best block might have been updated during the subscription
// request.
this.update(true);
return null;
}
// Response doesn't concern us.
if (parsedResponse.id) {
const id: string = parsedResponse.id;
// Need to remove the `extern:` prefix.
assert(id.startsWith('extern:'), 'State inconsistency in health checker');
const newId = JSON.parse(id.slice('extern:'.length)) as string;
parsedResponse.id = newId;
}
return JSON.stringify(parsedResponse);
};
update = (startNow: boolean): void => {
// If `startNow`, clear `#currentHealthTimeout` so that it is set below.
if (startNow && this.#currentHealthTimeout) {
clearTimeout(this.#currentHealthTimeout);
this.#currentHealthTimeout = null;
}
if (!this.#currentHealthTimeout) {
const startHealthRequest = () => {
this.#currentHealthTimeout = null;
// No matter what, don't start a health request if there is already one in progress.
// This is sane to do because receiving a response to a health request calls `update()`.
if (this.#currentHealthCheckId) {
return;
}
// Actual request starting.
this.#currentHealthCheckId = 'health-checker:'.concat(
this.#nextRequestId.toString()
);
this.#nextRequestId += 1;
this.#requestToSmoldot(
JSON.stringify({
id: this.#currentHealthCheckId,
jsonrpc: '2.0',
method: 'system_health',
params: []
})
);
};
if (startNow) {
startHealthRequest();
} else {
this.#currentHealthTimeout = setTimeout(startHealthRequest, 1000);
}
}
if (
this.#isSyncing &&
!this.#currentSubscriptionId &&
!this.#currentSubunsubRequestId
) {
this.startSubscription();
}
if (
!this.#isSyncing &&
this.#currentSubscriptionId &&
!this.#currentSubunsubRequestId
) {
this.endSubscription();
}
};
startSubscription = (): void => {
assert(
!this.#currentSubunsubRequestId && !this.#currentSubscriptionId,
'Internal error in health checker'
);
this.#currentSubunsubRequestId = 'health-checker:'.concat(
this.#nextRequestId.toString()
);
this.#nextRequestId += 1;
this.#requestToSmoldot(
JSON.stringify({
id: this.#currentSubunsubRequestId,
jsonrpc: '2.0',
method: 'chain_subscribeNewHeads',
params: []
})
);
};
endSubscription = (): void => {
assert(
!this.#currentSubunsubRequestId && this.#currentSubscriptionId,
'Internal error in health checker'
);
this.#currentSubunsubRequestId = 'health-checker:'.concat(
this.#nextRequestId.toString()
);
this.#nextRequestId += 1;
this.#requestToSmoldot(
JSON.stringify({
id: this.#currentSubunsubRequestId,
jsonrpc: '2.0',
method: 'chain_unsubscribeNewHeads',
params: [this.#currentSubscriptionId]
})
);
};
destroy = (): void => {
if (this.#currentHealthTimeout) {
clearTimeout(this.#currentHealthTimeout);
this.#currentHealthTimeout = null;
}
};
}
export class HealthCheckError extends Error {
readonly #cause: unknown;
getCause (): unknown {
return this.#cause;
}
constructor (
response: unknown,
message = 'Got error response asking for system health'
) {
super(message);
this.#cause = response;
}
}
@@ -0,0 +1,647 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
/* eslint-disable promise/param-names */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/ban-types */
import type { Chain, JsonRpcCallback } from '@substrate/connect';
import type { HealthChecker, SmoldotHealth } from './Health';
import type { ScProviderClass } from './ScProvider';
import { jest } from '@jest/globals';
const wait = (ms: number) => new Promise((res) => setTimeout(res, ms));
type MockedHealthChecker = HealthChecker & {
_isActive: () => boolean
_triggerHealthUpdate: (update: SmoldotHealth) => void
}
const healthCheckerMock = (): MockedHealthChecker => {
let cb: (health: SmoldotHealth) => void = () => {};
let sendJsonRpc: (request: string) => void = () => {};
let isActive = false;
return {
setSendJsonRpc: (cb) => {
sendJsonRpc = cb;
},
start: (x) => {
isActive = true;
cb = x;
},
stop: () => {
isActive = false;
},
sendJsonRpc: (...args) => sendJsonRpc(...args),
responsePassThrough: (response) => response,
_isActive: () => isActive,
_triggerHealthUpdate: (update: SmoldotHealth) => {
cb(update);
}
};
};
const healthCheckerFactory = () => {
const _healthCheckers: MockedHealthChecker[] = [];
return {
healthChecker: () => {
const result = healthCheckerMock();
_healthCheckers.push(result);
return result;
},
_healthCheckers,
_latestHealthChecker: () => _healthCheckers.slice(-1)[0]
};
};
jest.mock('./Health', () => healthCheckerFactory());
type MockChain = Chain & {
_spec: () => string
_recevedRequests: () => string[]
_isTerminated: () => boolean
_triggerCallback: (response: string | {}) => void
_setTerminateInterceptor: (fn: () => void) => void
_setSendJsonRpcInterceptor: (fn: (rpc: string) => void) => void
_getLatestRequest: () => string
}
const getFakeChain = (spec: string, callback: JsonRpcCallback): MockChain => {
const _receivedRequests: string[] = [];
let _isTerminated = false;
let terminateInterceptor: Function = Function.prototype;
let sendJsonRpcInterceptor: Function = Function.prototype;
return {
_spec: () => spec,
_recevedRequests: () => _receivedRequests,
_isTerminated: () => _isTerminated,
_triggerCallback: (response) => {
callback(
typeof response === 'string' ? response : JSON.stringify(response)
);
},
_setSendJsonRpcInterceptor: (fn) => {
sendJsonRpcInterceptor = fn;
},
_setTerminateInterceptor: (fn) => {
terminateInterceptor = fn;
},
sendJsonRpc: (rpc) => {
sendJsonRpcInterceptor(rpc);
_receivedRequests.push(rpc);
},
remove: () => {
terminateInterceptor();
_isTerminated = true;
},
_getLatestRequest: () => _receivedRequests[_receivedRequests.length - 1]
};
};
const getFakeClient = () => {
const chains: MockChain[] = [];
let addChainInterceptor: Promise<void> = Promise.resolve();
let addWellKnownChainInterceptor: Promise<void> = Promise.resolve();
return {
_chains: () => chains,
_setAddChainInterceptor: (interceptor: Promise<void>) => {
addChainInterceptor = interceptor;
},
_setAddWellKnownChainInterceptor: (interceptor: Promise<void>) => {
addWellKnownChainInterceptor = interceptor;
},
addChain: (chainSpec: string, cb: JsonRpcCallback): Promise<MockChain> =>
addChainInterceptor.then(() => {
const result = getFakeChain(chainSpec, cb);
chains.push(result);
return result;
}),
addWellKnownChain: (
wellKnownChain: string,
cb: JsonRpcCallback
): Promise<MockChain> =>
addWellKnownChainInterceptor.then(() => {
const result = getFakeChain(wellKnownChain, cb);
chains.push(result);
return result;
})
};
};
enum WellKnownChain {
polkadot = 'polkadot',
ksmcc3 = 'ksmcc3',
rococo_v2_1 = 'rococo_v2_1',
westend2 = 'westend2'
}
const connectorFactory = () => {
const clients: ReturnType<typeof getFakeClient>[] = [];
const latestClient = () => clients[clients.length - 1];
return {
WellKnownChain,
createScClient: () => {
const result = getFakeClient();
clients.push(result);
return result;
},
_clients: () => clients,
latestClient,
latestChain: () =>
latestClient()._chains()[latestClient()._chains().length - 1]
};
};
jest.mock('@substrate/connect', () => connectorFactory());
let ScProvider: ScProviderClass;
let mockedConnector: ReturnType<typeof connectorFactory>;
let mockedHealthChecker: ReturnType<typeof healthCheckerFactory>;
const getCurrentHealthChecker = () => mockedHealthChecker._latestHealthChecker();
const setChainSyncyingStatus = (isSyncing: boolean) => {
getCurrentHealthChecker()._triggerHealthUpdate({
isSyncing,
peers: 1,
shouldHavePeers: true
});
};
beforeAll(async () => {
({ ScProvider } = await import('./ScProvider'));
mockedConnector = (await import(
'@substrate/connect'
)) as unknown as ReturnType<typeof connectorFactory>;
mockedHealthChecker = await (import('./Health') as any);
});
describe('ScProvider', () => {
describe('on', () => {
it('emits `connected` as soon as the chain is not syncing', async () => {
const provider = new ScProvider('');
await provider.connect();
const onConnected = jest.fn();
provider.on('connected', onConnected);
expect(onConnected).not.toHaveBeenCalled();
setChainSyncyingStatus(false);
expect(onConnected).toHaveBeenCalled();
});
it('stops receiving notifications after unsubscribing', async () => {
const provider = new ScProvider('');
await provider.connect();
const onConnected = jest.fn();
provider.on('connected', onConnected)();
expect(onConnected).not.toHaveBeenCalled();
setChainSyncyingStatus(false);
expect(onConnected).not.toHaveBeenCalled();
});
it('synchronously emits connected if the Provider is already `connected`', async () => {
const provider = new ScProvider('');
await provider.connect();
setChainSyncyingStatus(false);
const onConnected = jest.fn();
provider.on('connected', onConnected);
expect(onConnected).toHaveBeenCalled();
});
it('emits `disconnected` once the chain goes back to syncing', async () => {
const provider = new ScProvider('');
await provider.connect();
setChainSyncyingStatus(false);
const onConnected = jest.fn();
provider.on('connected', onConnected);
const onDisconnected = jest.fn();
provider.on('disconnected', onDisconnected);
expect(onConnected).toHaveBeenCalled();
expect(onDisconnected).not.toHaveBeenCalled();
onConnected.mockRestore();
setChainSyncyingStatus(true);
expect(onConnected).not.toHaveBeenCalled();
expect(onDisconnected).toHaveBeenCalled();
});
});
describe('hasSubscriptions', () => {
it('supports subscriptions', async () => {
const provider = new ScProvider('');
await provider.connect();
expect(provider.hasSubscriptions).toBe(true);
});
});
describe('clone', () => {
it('can not be clonned', async () => {
const provider = new ScProvider('');
await provider.connect();
expect(() => provider.clone()).toThrowError();
});
});
describe('connect', () => {
it('does not create a new chain when trying to re-connect while the current chain is syncing', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
await provider.connect();
expect(chain).toBe(mockedConnector.latestChain());
});
it('throws when trying to connect on an already connected Provider', async () => {
const provider = new ScProvider('');
await provider.connect();
setChainSyncyingStatus(false);
await expect(provider.connect()).rejects.toThrowError(
'Already connected!'
);
});
});
describe('disconnect', () => {
it('removes the chain and cleans up', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
await provider.disconnect();
expect(chain._isTerminated()).toBe(true);
});
it('does not throw when disconnecting on an already disconnected Provider', async () => {
const provider = new ScProvider('');
await provider.connect();
await provider.disconnect();
await expect(provider.disconnect()).resolves.not.toThrow();
});
});
describe('send', () => {
it('throws when trying to send a request while the Provider is not connected', async () => {
const provider = new ScProvider('');
await provider.connect();
await expect(provider.send('', [])).rejects.toThrow();
});
it('receives responses to its requests', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
const responsePromise = provider.send('getData', ['foo']);
await wait(0);
expect(chain._getLatestRequest()).toEqual(
'{"id":1,"jsonrpc":"2.0","method":"getData","params":["foo"]}'
);
const result = { foo: 'foo' };
chain._triggerCallback({
jsonrpc: '2.0',
id: 1,
result
});
const response = await responsePromise;
expect(response).toEqual(result);
});
it("rejects when the response can't be deserialized", async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
setTimeout(() => {
chain._triggerCallback({
jsonrpc: '2.0',
id: 1
});
}, 0);
await expect(provider.send('getData', ['foo'])).rejects.toThrow();
});
it('rejects when the smoldot chain has crashed', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
await wait(0);
chain._setSendJsonRpcInterceptor(() => {
throw new Error('boom!');
});
await expect(provider.send('getData', ['foo'])).rejects.toThrowError(
'Disconnected'
);
expect(provider.isConnected).toBe(false);
});
});
describe('subscribe', () => {
it('subscribes and recives messages until it unsubscribes', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
const unsubscribeToken = 'unsubscribeToken';
setTimeout(() => {
chain._triggerCallback({
jsonrpc: '2.0',
id: 1,
result: unsubscribeToken
});
}, 0);
const cb = jest.fn();
const token = await provider.subscribe(
'foo',
'chain_subscribeNewHeads',
['baz'],
cb
);
expect(token).toBe(unsubscribeToken);
expect(cb).not.toHaveBeenCalled();
chain._triggerCallback({
jsonrpc: '2.0',
method: 'foo',
params: {
result: 1,
subscription: token
}
});
expect(cb).toHaveBeenCalledTimes(1);
expect(cb).toHaveBeenLastCalledWith(null, 1);
chain._triggerCallback({
jsonrpc: '2.0',
method: 'foo',
params: {
result: 2,
subscription: token
}
});
expect(cb).toHaveBeenCalledTimes(2);
expect(cb).toHaveBeenLastCalledWith(null, 2);
provider.unsubscribe('foo', 'chain_unsubscribeNewHeads', unsubscribeToken);
chain._triggerCallback({
jsonrpc: '2.0',
method: 'foo',
params: {
result: 3,
subscription: token
}
});
expect(cb).toHaveBeenCalledTimes(2);
expect(cb).toHaveBeenLastCalledWith(null, 2);
});
it('ignores subscription messages that were received before the subscription token', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
const unsubscribeToken = 'unsubscribeToken';
chain._triggerCallback({
jsonrpc: '2.0',
method: 'foo',
params: {
result: 1,
subscription: unsubscribeToken
}
});
setTimeout(() => {
chain._triggerCallback({
jsonrpc: '2.0',
id: 1,
result: unsubscribeToken
});
}, 0);
const cb = jest.fn();
const token = await provider.subscribe(
'foo',
'chain_subscribeNewHeads',
['baz'],
cb
);
expect(token).toBe(unsubscribeToken);
expect(cb).not.toHaveBeenCalled();
});
it('emits the error when the message has an error', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
setChainSyncyingStatus(false);
await wait(0);
const unsubscribeToken = 'unsubscribeToken';
setTimeout(() => {
chain._triggerCallback({
jsonrpc: '2.0',
id: 1,
result: unsubscribeToken
});
}, 0);
const cb = jest.fn();
const token = await provider.subscribe(
'foo',
'chain_subscribeNewHeads',
['baz'],
cb
);
chain._triggerCallback({
jsonrpc: '2.0',
method: 'foo',
params: {
error: 'boom',
subscription: unsubscribeToken
}
});
expect(token).toBe(unsubscribeToken);
expect(cb).toHaveBeenCalledTimes(1);
expect(cb.mock.lastCall![0]).toBeInstanceOf(Error);
expect(cb.mock.lastCall![1]).toBe(undefined);
});
it('errors when subscribing to an unsupported method', async () => {
const provider = new ScProvider('');
await provider.connect();
setChainSyncyingStatus(false);
await wait(0);
await expect(
provider.subscribe('foo', 'bar', ['baz'], () => {})
).rejects.toThrowError('Unsupported subscribe method: bar');
});
});
describe('unsubscribe', () => {
it('rejects when trying to unsubscribe from un unexisting subscription', async () => {
const provider = new ScProvider('');
await provider.connect();
setChainSyncyingStatus(false);
await expect(provider.unsubscribe('', '', '')).rejects.toThrowError(
'Unable to find active subscription=::'
);
});
});
it('cleans up the stale subscriptions once it reconnects', async () => {
const provider = new ScProvider('');
await provider.connect();
const chain = mockedConnector.latestChain();
// setting the syncing status of the chain to fals so that the Provider
// gets `connected`
setChainSyncyingStatus(false);
// while connected we create a subscription
const unsubscribeToken = 'unsubscribeToken';
setTimeout(() => {
chain._triggerCallback({
jsonrpc: '2.0',
id: 1,
result: unsubscribeToken
});
}, 0);
const cb = jest.fn();
const token = await provider.subscribe(
'foo',
'chain_subscribeNewHeads',
['baz'],
cb
);
// setting the syncing status of the chain to fals so that the Provider
// gets `disconnected`
setChainSyncyingStatus(true);
// let's wait some time in order to ensure that the stale unsubscription
// messages are not sent until the chain syncing status changes back to false
await wait(200);
// before we let the healthChecker know that the chain is no longer syncing,
// let's make sure that the chain has received the correct request, and
// most importantly that it has not received a request for unsubscribing
// from the stale subscription, since that request should happen once the
// chain is no longer syncing
expect(chain._recevedRequests()).toEqual([
'{"id":1,"jsonrpc":"2.0","method":"chain_subscribeNewHeads","params":["baz"]}'
]);
// lets change the sync status back to false
setChainSyncyingStatus(false);
// let's wait one tick to ensure that the microtasks got processed
await wait(0);
// let's make sure that we have now sent the request for killing the
// stale subscription
expect(chain._recevedRequests()).toEqual([
'{"id":1,"jsonrpc":"2.0","method":"chain_subscribeNewHeads","params":["baz"]}',
`{"id":2,"jsonrpc":"2.0","method":"chain_unsubscribeNewHeads","params":["${token}"]}`
]);
});
});
@@ -0,0 +1,345 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
import { Chain, createScClient, ScClient, WellKnownChain } from '@substrate/connect';
import EventEmitter from 'eventemitter3';
import { assert, isError } from '@polkadot/util';
import { RpcCoder } from '../coder';
import { healthChecker } from './Health';
type ResponseCallback = (response: string | Error) => void
// These methods have been taken from:
// https://github.com/paritytech/smoldot/blob/17425040ddda47d539556eeaf62b88c4240d1d42/src/json_rpc/methods.rs#L338-L462
// It's important to take into account that smoldot is adding support to the new
// json-rpc-interface https://paritytech.github.io/json-rpc-interface-spec/
// However, at the moment this list only includes methods that belong to the "old" API
const subscriptionUnsubscriptionMethods = new Map<string, string>([
['author_submitAndWatchExtrinsic', 'author_unwatchExtrinsic'],
['chain_subscribeAllHeads', 'chain_unsubscribeAllHeads'],
['chain_subscribeFinalizedHeads', 'chain_unsubscribeFinalizedHeads'],
['chain_subscribeFinalisedHeads', 'chain_subscribeFinalisedHeads'],
['chain_subscribeNewHeads', 'chain_unsubscribeNewHeads'],
['chain_subscribeNewHead', 'chain_unsubscribeNewHead'],
['chain_subscribeRuntimeVersion', 'chain_unsubscribeRuntimeVersion'],
['subscribe_newHead', 'unsubscribe_newHead'],
['state_subscribeRuntimeVersion', 'state_unsubscribeRuntimeVersion'],
['state_subscribeStorage', 'state_unsubscribeStorage']
]);
const wellKnownChains = new Set(Object.values(WellKnownChain));
const scClients = new WeakMap<ScProvider, ScClient>();
export class ScProvider implements ProviderInterface {
readonly #coder: RpcCoder = new RpcCoder();
readonly #spec: string | WellKnownChain;
readonly #sharedSandbox?: ScProvider;
readonly #subscriptions: Map<
string,
[ResponseCallback, { unsubscribeMethod: string; id: string | number }]
> = new Map();
readonly #requests: Map<number, ResponseCallback> = new Map();
readonly #eventemitter: EventEmitter = new EventEmitter();
#chain: Promise<Chain> | null = null;
#isChainReady = false;
public constructor (spec: string | WellKnownChain, sharedSandbox?: ScProvider) {
this.#spec = spec;
this.#sharedSandbox = sharedSandbox;
}
public get hasSubscriptions (): boolean {
// Indicates that subscriptions are supported
return true;
}
public get isConnected (): boolean {
return !!this.#chain && this.#isChainReady;
}
public clone (): ProviderInterface {
throw new Error('clone() is not supported.');
}
async connect (): Promise<void> {
assert(!this.isConnected, 'Already connected!');
// it could happen that after emitting `disconnected` due to the fact taht
// smoldot is syncing, the consumer tries to reconnect after a certain amount
// of time... In which case we want to make sure that we don't create a new
// chain.
if (this.#chain) {
await this.#chain;
return;
}
if (this.#sharedSandbox && !this.#sharedSandbox.isConnected) {
await this.#sharedSandbox.connect();
}
const client = this.#sharedSandbox
? scClients.get(this.#sharedSandbox)
: createScClient();
assert(client, 'Unkown ScProvider!');
scClients.set(this, client);
const hc = healthChecker();
const onResponse = (res: string): void => {
const hcRes = hc.responsePassThrough(res);
if (!hcRes) {
return;
}
const response = JSON.parse(hcRes) as JsonRpcResponse;
let decodedResponse: string | Error;
try {
decodedResponse = this.#coder.decodeResponse(response) as string;
} catch (e) {
decodedResponse = e as Error;
}
// It's not a subscription message, but rather a standar RPC response
if (response.params?.subscription === undefined || !response.method) {
return this.#requests.get(response.id)?.(decodedResponse);
}
// We are dealing with a subscription message
const subscriptionId = `${response.method}::${response.params.subscription}`;
const callback = this.#subscriptions.get(subscriptionId)?.[0];
callback?.(decodedResponse);
};
const addChain = wellKnownChains.has(this.#spec as WellKnownChain)
? client.addWellKnownChain
: client.addChain;
this.#chain = addChain(this.#spec as WellKnownChain, onResponse).then((chain) => {
hc.setSendJsonRpc(chain.sendJsonRpc);
this.#isChainReady = false;
const cleanup = () => {
// If there are any callbacks left, we have to reject/error them.
// Otherwise, that would cause a memory leak.
const disconnectionError = new Error('Disconnected');
this.#requests.forEach((cb) => cb(disconnectionError));
this.#subscriptions.forEach(([cb]) => cb(disconnectionError));
this.#subscriptions.clear();
};
const staleSubscriptions: {
unsubscribeMethod: string
id: number | string
}[] = [];
const killStaleSubscriptions = () => {
if (staleSubscriptions.length === 0) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { id, unsubscribeMethod } = staleSubscriptions.pop()!;
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Promise.race([
this.send(unsubscribeMethod, [id]).catch(Function.prototype as () => void),
new Promise((resolve) => setTimeout(resolve, 500))
]).then(killStaleSubscriptions);
};
hc.start((health) => {
const isReady =
!health.isSyncing && (health.peers > 0 || !health.shouldHavePeers);
// if it's the same as before, then nothing has changed and we are done
if (this.#isChainReady === isReady) {
return;
}
this.#isChainReady = isReady;
if (!isReady) {
// If we've reached this point, that means that the chain used to be "ready"
// and now we are about to emit `disconnected`.
//
// This will cause the PolkadotJs API think that the connection is
// actually dead. In reality the smoldot chain is not dead, of course.
// However, we have to cleanup all the existing callbacks because when
// the smoldot chain stops syncing, then we will emit `connected` and
// the PolkadotJs API will try to re-create the previous
// subscriptions and requests. Although, now is not a good moment
// to be sending unsubscription messages to the smoldot chain, we
// should wait until is no longer syncing to send the unsubscription
// messages from the stale subscriptions of the previous connection.
//
// That's why -before we perform the cleanup of `this.#subscriptions`-
// we keep the necessary information that we will need later on to
// kill the stale subscriptions.
[...this.#subscriptions.values()].forEach((s) => {
staleSubscriptions.push(s[1]);
});
cleanup();
} else {
killStaleSubscriptions();
}
this.#eventemitter.emit(isReady ? 'connected' : 'disconnected');
});
return {
...chain,
remove: () => {
hc.stop();
chain.remove();
cleanup();
},
sendJsonRpc: hc.sendJsonRpc.bind(hc)
};
});
try {
await this.#chain;
} catch (e) {
this.#chain = null;
this.#eventemitter.emit('error', e);
throw e;
}
}
async disconnect (): Promise<void> {
if (!this.#chain) {
return;
}
const chain = await this.#chain;
this.#chain = null;
this.#isChainReady = false;
try {
chain.remove();
} catch (_) {}
this.#eventemitter.emit('disconnected');
}
public on (
type: ProviderInterfaceEmitted,
sub: ProviderInterfaceEmitCb
): () => void {
// It's possible. Although, quite unlikely, that by the time that polkadot
// subscribes to the `connected` event, the Provider is already connected.
// In that case, we must emit to let the consumer know that we are connected.
if (type === 'connected' && this.isConnected) {
sub();
}
this.#eventemitter.on(type, sub);
return (): void => {
this.#eventemitter.removeListener(type, sub);
};
}
public async send<T = any> (method: string, params: unknown[]): Promise<T> {
assert(this.isConnected, 'Provider is not connected');
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const chain = await this.#chain!;
const json = this.#coder.encodeJson(method, params);
const id = this.#coder.getId();
const result = new Promise<T>((resolve, reject): void => {
this.#requests.set(id, (response) => {
(isError(response) ? reject : resolve)(response as unknown as T);
});
try {
chain.sendJsonRpc(json);
} catch (e) {
this.#chain = null;
try {
chain.remove();
} catch (_) {}
this.#eventemitter.emit('error', e);
}
});
try {
return await result;
} finally {
// let's ensure that once the Promise is resolved/rejected, then we remove
// remove its entry from the internal #requests
this.#requests.delete(id);
}
}
public async subscribe (
type: string,
method: string,
params: any[],
callback: ProviderInterfaceCallback
): Promise<number | string> {
assert(
subscriptionUnsubscriptionMethods.has(method),
`Unsupported subscribe method: ${method}`
);
const id = await this.send<number | string>(method, params);
const subscriptionId = `${type}::${id}`;
const cb = (response: Error | string) => {
if (response instanceof Error) {
callback(response, undefined);
} else {
callback(null, response);
}
};
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method)!;
this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]);
return id;
}
public unsubscribe (
type: string,
method: string,
id: number | string
): Promise<boolean> {
assert(
this.isConnected,
'Provider is not connected'
);
const subscriptionId = `${type}::${id}`;
if (!this.#subscriptions.has(subscriptionId)) {
return Promise.reject(
new Error(`Unable to find active subscription=${subscriptionId}`)
);
}
this.#subscriptions.delete(subscriptionId);
return this.send(method, [id]);
}
}
export type ScProviderClass = typeof ScProvider
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './ScProvider';
+23
View File
@@ -17,6 +17,13 @@ export interface JsonRpcResponseBaseError {
message: string;
}
export interface RpcErrorInterface<Data> {
code: number;
data?: Data;
message: string;
stack: string;
}
interface JsonRpcResponseSingle {
error?: JsonRpcResponseBaseError;
result?: unknown;
@@ -44,6 +51,7 @@ export type ProviderInterfaceEmitCb = (value?: any) => any;
export interface ProviderInterface {
readonly hasSubscriptions: boolean;
readonly isConnected: boolean;
readonly stats?: ProviderStats;
clone (): ProviderInterface;
connect (): Promise<void>;
@@ -53,3 +61,18 @@ export interface ProviderInterface {
subscribe (type: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number | string>;
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
}
export interface ProviderStats {
active: {
requests: number;
subscriptions: number;
};
total: {
bytesRecv: number;
bytesSent: number;
cached: number;
requests: number;
subscriptions: number;
timeout: number;
};
}
+66 -3
View File
@@ -3,7 +3,7 @@
/* eslint-disable camelcase */
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
import EventEmitter from 'eventemitter3';
@@ -25,6 +25,7 @@ interface WsStateAwaiting {
callback: ProviderInterfaceCallback;
method: string;
params: unknown[];
start: number;
subscription?: SubscriptionHandler;
}
@@ -39,7 +40,11 @@ const ALIASES: { [index: string]: string } = {
chain_unsubscribeFinalisedHeads: 'chain_unsubscribeFinalizedHeads'
};
const RETRY_DELAY = 2500;
const RETRY_DELAY = 2_500;
const TIMEOUT_S = 30;
const TIMEOUT_MS = TIMEOUT_S * 1000;
const TIMEOUT_INTERVAL = 5_000;
const MEGABYTE = 1024 * 1024;
@@ -90,6 +95,8 @@ export class WsProvider implements ProviderInterface {
readonly #isReadyPromise: Promise<WsProvider>;
readonly #stats: ProviderStats;
readonly #waitingForId: Record<string, JsonRpcResponse> = {};
#autoConnectMs: number;
@@ -100,6 +107,8 @@ export class WsProvider implements ProviderInterface {
#subscriptions: Record<string, WsStateSubscription> = {};
#timeoutId?: NodeJS.Timeout | null = null;
#websocket: WebSocket | null;
/**
@@ -124,6 +133,10 @@ export class WsProvider implements ProviderInterface {
this.#endpoints = endpoints;
this.#headers = headers;
this.#websocket = null;
this.#stats = {
active: { requests: 0, subscriptions: 0 },
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
};
if (autoConnectMs > 0) {
this.connectWithRetry().catch((): void => {
@@ -195,6 +208,9 @@ export class WsProvider implements ProviderInterface {
this.#websocket.onerror = this.#onSocketError;
this.#websocket.onmessage = this.#onSocketMessage;
this.#websocket.onopen = this.#onSocketOpen;
// timeout any handlers that have not had a response
this.#timeoutId = setInterval(() => this.#timeout(), TIMEOUT_INTERVAL);
} catch (error) {
l.error(error);
@@ -243,6 +259,19 @@ export class WsProvider implements ProviderInterface {
}
}
/**
* @description Returns the connection stats
*/
public get stats (): ProviderStats {
return {
active: {
requests: Object.keys(this.#handlers).length,
subscriptions: Object.keys(this.#subscriptions).length
},
total: this.#stats.total
};
}
/**
* @summary Listens on events after having subscribed using the [[subscribe]] function.
* @param {ProviderInterfaceEmitted} type Event
@@ -264,6 +293,8 @@ export class WsProvider implements ProviderInterface {
* @param subscription Subscription details (internally used)
*/
public send <T = any> (method: string, params: unknown[], isCacheable?: boolean, subscription?: SubscriptionHandler): Promise<T> {
this.#stats.total.requests++;
const body = this.#coder.encodeJson(method, params);
let resultPromise: Promise<T> | null = isCacheable
? this.#callCache.get(body) as Promise<T>
@@ -275,6 +306,8 @@ export class WsProvider implements ProviderInterface {
if (isCacheable) {
this.#callCache.set(body, resultPromise);
}
} else {
this.#stats.total.cached++;
}
return resultPromise;
@@ -299,9 +332,10 @@ export class WsProvider implements ProviderInterface {
callback,
method,
params,
start: Date.now(),
subscription
};
this.#stats.total.bytesSent += json.length;
this.#websocket.send(json);
} catch (error) {
reject(error);
@@ -328,6 +362,8 @@ export class WsProvider implements ProviderInterface {
* ```
*/
public subscribe (type: string, method: string, params: unknown[], callback: ProviderInterfaceCallback): Promise<number | string> {
this.#stats.total.subscriptions++;
// subscriptions are not cached, LRU applies to .at(<blockHash>) only
return this.send<number | string>(method, params, false, { callback, type });
}
@@ -380,6 +416,11 @@ export class WsProvider implements ProviderInterface {
this.#websocket = null;
}
if (this.#timeoutId) {
clearInterval(this.#timeoutId);
this.#timeoutId = null;
}
this.#emit('disconnected');
// reject all hanging requests
@@ -410,6 +451,8 @@ export class WsProvider implements ProviderInterface {
#onSocketMessage = (message: MessageEvent<string>): void => {
l.debug(() => ['received', message.data]);
this.#stats.total.bytesRecv += message.data.length;
const response = JSON.parse(message.data) as JsonRpcResponse;
return isUndefined(response.method)
@@ -515,4 +558,24 @@ export class WsProvider implements ProviderInterface {
}
})).catch(l.error);
};
#timeout = (): void => {
const now = Date.now();
const ids = Object.keys(this.#handlers);
for (let i = 0; i < ids.length; i++) {
const handler = this.#handlers[ids[i]];
if ((now - handler.start) > TIMEOUT_MS) {
try {
handler.callback(new Error(`No response received from RPC endpoint in ${TIMEOUT_S}s`), undefined);
} catch {
// ignore
}
this.#stats.total.timeout++;
delete this.#handlers[ids[i]];
}
}
};
}
+17 -17
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,26 +30,26 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
},
"dependencies": {
"@babel/core": "^7.17.0",
"@babel/register": "^7.17.0",
"@babel/runtime": "^7.17.0",
"@polkadot/api": "7.7.1",
"@polkadot/api-augment": "7.7.1",
"@polkadot/rpc-augment": "7.7.1",
"@polkadot/rpc-provider": "7.7.1",
"@polkadot/types": "7.7.1",
"@polkadot/types-augment": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/types-create": "7.7.1",
"@polkadot/types-support": "7.7.1",
"@polkadot/util": "^8.3.3",
"@polkadot/x-ws": "^8.3.3",
"@babel/core": "^7.17.8",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.17.8",
"@polkadot/api": "7.14.2",
"@polkadot/api-augment": "7.14.2",
"@polkadot/rpc-augment": "7.14.2",
"@polkadot/rpc-provider": "7.14.2",
"@polkadot/types": "7.14.2",
"@polkadot/types-augment": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/types-create": "7.14.2",
"@polkadot/types-support": "7.14.2",
"@polkadot/util": "^8.7.1",
"@polkadot/x-ws": "^8.7.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.3.1"
"yargs": "^17.4.0"
},
"devDependencies": {
"@types/websocket": "^1.0.5",
"@types/yargs": "^17.0.8"
"@types/yargs": "^17.0.10"
}
}
@@ -79,6 +79,6 @@ export function generateInterfaceTypes (importDefinitions: { [importPath: string
export function generateDefaultInterface (): void {
generateInterfaceTypes(
{ '@polkadot/types/interfaces': defaultDefinitions },
'packages/types-augment/src/registry.ts'
'packages/types-augment/src/registry/interfaces.ts'
);
}
+23 -1
View File
@@ -25,6 +25,7 @@ const generateLookupDefsTmpl = Handlebars.compile(readTemplate('lookup/defs'));
const generateLookupDefsNamedTmpl = Handlebars.compile(readTemplate('lookup/defs-named'));
const generateLookupIndexTmpl = Handlebars.compile(readTemplate('lookup/index'));
const generateLookupTypesTmpl = Handlebars.compile(readTemplate('lookup/types'));
const generateRegistryTmpl = Handlebars.compile(readTemplate('interfaceRegistry'));
function generateParamType (registry: Registry, { name, type }: SiTypeParameter): string {
if (type.isSome) {
@@ -214,13 +215,34 @@ function generateLookupTypes (registry: Registry, filtered: [PortableType, TypeD
writeFile(path.join(destDir, 'index.ts'), () => generateLookupIndexTmpl({ headerType: 'defs' }), true);
}
function generateLookup (destDir: string, entries: [string | undefined, HexString][]): void {
function generateRegistry (registry: Registry, filtered: [PortableType, TypeDef][], destDir: string, subPath: string): void {
writeFile(path.join(destDir, `${subPath}.ts`), (): string => {
const items = filtered
.map(([, { lookupName }]) => lookupName)
.filter((n): n is string => !!n)
.sort()
.reduce((all: string[], n) => all.includes(n) ? all : all.concat(n), []);
const imports = createImports({}, { types: {} });
imports.lookupTypes = items.reduce((all, n) => ({ ...all, [n]: true }), {});
return generateRegistryTmpl({
headerType: 'defs',
imports,
items,
types: []
});
}, true);
}
function generateLookup (destDir: string, entries: [string, HexString][]): void {
entries.reduce<string[]>((exclude, [subPath, staticMeta]): string[] => {
const { lookup, registry } = initMeta(staticMeta).metadata.asLatest;
const filtered = getFilteredTypes(lookup, exclude);
generateLookupDefs(registry, filtered, destDir, subPath);
generateLookupTypes(registry, filtered, destDir, subPath);
generateRegistry(registry, filtered, destDir, subPath === 'lookup' ? 'registry' : `../registry/${subPath}`);
return exclude.concat(
...filtered
+4
View File
@@ -77,6 +77,8 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
case TypeDefInfo.Struct:
case TypeDefInfo.Tuple:
case TypeDefInfo.Vec:
case TypeDefInfo.BTreeMap:
case TypeDefInfo.BTreeSet:
case TypeDefInfo.Option:
case TypeDefInfo.VecFixed:
case TypeDefInfo.WrapperKeepOpaque:
@@ -125,6 +127,8 @@ function tsResultGetter (registry: Registry, definitions: Record<string, ModuleT
case TypeDefInfo.Si:
case TypeDefInfo.Tuple:
case TypeDefInfo.Vec:
case TypeDefInfo.BTreeMap:
case TypeDefInfo.BTreeSet:
case TypeDefInfo.WrapperKeepOpaque:
case TypeDefInfo.WrapperOpaque:
return `${isGetter}${asGetter}`;
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.7.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.14.2' };
@@ -20,6 +20,7 @@ describe('getSimilarTypes', (): void => {
genericTypes: {},
ignoredTypes: [],
localTypes: {},
lookupTypes: {},
metadataTypes: {},
primitiveTypes: {},
typeToModule: {},
@@ -17,6 +17,7 @@ describe('formatType', (): void => {
genericTypes: {},
ignoredTypes: [],
localTypes: {},
lookupTypes: {},
metadataTypes: {},
primitiveTypes: {},
typeToModule: {},
+5 -1
View File
@@ -47,6 +47,10 @@ function extractImports ({ imports, types }: This): string[] {
!NO_CODEC.includes(n) && !ON_CODEC.includes(n)
)
},
{
file: '@polkadot/types/lookup',
types: Object.keys(imports.lookupTypes)
},
{
file: '@polkadot/types/types',
types: Object.keys(imports.typesTypes).filter((n) =>
@@ -183,7 +187,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
},
[TypeDefInfo.Si]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
return formatType(registry, definitions, (registry).lookup.getTypeDef(typeDef.type), imports, withShortcut);
return formatType(registry, definitions, registry.lookup.getTypeDef(typeDef.type), imports, withShortcut);
},
[TypeDefInfo.Struct]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
+2
View File
@@ -25,6 +25,7 @@ export interface TypeImports {
genericTypes: TypeExist; // `import {} from '@polkadot/types/generic`
ignoredTypes: string[]; // No need to import these types
localTypes: TypeExistMap; // `import {} from '../something'`
lookupTypes: TypeExistMap; // `import {} from '@polkadot/types/lookup`
primitiveTypes: TypeExist; // `import {} from '@polkadot/types/primitive`
metadataTypes: TypeExist; // `import {} from '@polkadot/types/metadata`
typesTypes: TypeExist; // `import {} from '@polkadot/types/types`
@@ -119,6 +120,7 @@ export function createImports (importDefinitions: Record<string, Record<string,
return local;
}, {}),
lookupTypes: {},
metadataTypes: {},
primitiveTypes: {},
typeToModule,
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.7.1",
"version": "7.14.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.0",
"@polkadot/types": "7.7.1",
"@polkadot/types-codec": "7.7.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.8",
"@polkadot/types": "7.14.2",
"@polkadot/types-codec": "7.14.2",
"@polkadot/util": "^8.7.1"
}
}
+9 -53
View File
@@ -5,51 +5,28 @@
export default {
/**
* Lookup74: kusama_runtime::ProxyType
* Lookup75: kusama_runtime::ProxyType
**/
KusamaRuntimeProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction']
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
},
/**
* Lookup104: polkadot_runtime_parachains::disputes::pallet::Event<T>
**/
PolkadotRuntimeParachainsDisputesPalletEvent: {
_enum: {
DisputeInitiated: '(H256,PolkadotRuntimeParachainsDisputesDisputeLocation)',
DisputeConcluded: '(H256,PolkadotRuntimeParachainsDisputesDisputeResult)',
DisputeTimedOut: 'H256',
Revert: 'u32'
}
},
/**
* Lookup106: polkadot_runtime_parachains::disputes::DisputeLocation
**/
PolkadotRuntimeParachainsDisputesDisputeLocation: {
_enum: ['Local', 'Remote']
},
/**
* Lookup107: polkadot_runtime_parachains::disputes::DisputeResult
**/
PolkadotRuntimeParachainsDisputesDisputeResult: {
_enum: ['Valid', 'Invalid']
},
/**
* Lookup247: kusama_runtime::SessionKeys
* Lookup252: kusama_runtime::SessionKeys
**/
KusamaRuntimeSessionKeys: {
grandpa: 'SpFinalityGrandpaAppPublic',
babe: 'SpConsensusBabeAppPublic',
imOnline: 'PalletImOnlineSr25519AppSr25519Public',
paraValidator: 'PolkadotPrimitivesV0ValidatorAppPublic',
paraAssignment: 'PolkadotPrimitivesV1AssignmentAppPublic',
paraValidator: 'PolkadotPrimitivesV2ValidatorAppPublic',
paraAssignment: 'PolkadotPrimitivesV2AssignmentAppPublic',
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
},
/**
* Lookup320: kusama_runtime::OriginCaller
* Lookup326: kusama_runtime::OriginCaller
**/
KusamaRuntimeOriginCaller: {
_enum: {
system: 'FrameSystemRawOrigin',
system: 'FrameSupportDispatchRawOrigin',
__Unused1: 'Null',
__Unused2: 'Null',
__Unused3: 'Null',
@@ -152,7 +129,7 @@ export default {
}
},
/**
* Lookup385: kusama_runtime::NposCompactSolution24
* Lookup392: kusama_runtime::NposCompactSolution24
**/
KusamaRuntimeNposCompactSolution24: {
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
@@ -181,28 +158,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup505: polkadot_runtime_parachains::disputes::pallet::Call<T>
**/
PolkadotRuntimeParachainsDisputesPalletCall: {
_enum: ['force_unfreeze']
},
/**
* Lookup697: polkadot_primitives::v1::DisputeState<N>
**/
PolkadotPrimitivesV1DisputeState: {
validatorsFor: 'BitVec',
validatorsAgainst: 'BitVec',
start: 'u32',
concludedAt: 'Option<u32>'
},
/**
* Lookup698: polkadot_runtime_parachains::disputes::pallet::Error<T>
**/
PolkadotRuntimeParachainsDisputesPalletError: {
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
},
/**
* Lookup733: kusama_runtime::Runtime
* Lookup747: kusama_runtime::Runtime
**/
KusamaRuntimeRuntime: 'Null'
};
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More