Compare commits

...
135 Commits
Author SHA1 Message Date
github-actions[bot] 0d4b5df61e [CI Skip] release/stable 8.11.1
skip-checks: true
2022-07-02 05:24:57 +00:00
Jaco 8bacac840f 8.11.1 (#5018) 2022-07-02 08:14:49 +03:00
github-actions[bot] f75d32e198 [CI Skip] bump/beta 8.10.2-23-x
skip-checks: true
2022-07-02 04:49:10 +00:00
Jaco 0282cbac35 Bump statis metadata (#5017) 2022-07-02 07:41:25 +03:00
github-actions[bot] 98506f9fea [CI Skip] bump/beta 8.10.2-22-x
skip-checks: true
2022-07-01 15:08:33 +00:00
Jaco ecf6ad725b Bump common (#5015) 2022-07-01 17:58:28 +03:00
github-actions[bot] 627e54473e [CI Skip] bump/beta 8.10.2-21-x
skip-checks: true
2022-07-01 13:21:10 +00:00
Jaco 8e56995556 Bump dev (#5014) 2022-07-01 16:11:18 +03:00
github-actions[bot] 45525b4288 [CI Skip] bump/beta 8.10.2-20-x
skip-checks: true
2022-07-01 12:02:35 +00:00
Jaco 6808eb1925 CHANGELOG (#5013)
* CHANGELOG

* typo
2022-07-01 14:53:32 +03:00
github-actions[bot] c301e7128d [CI Skip] bump/beta 8.10.2-19-x
skip-checks: true
2022-07-01 11:49:50 +00:00
Jaco 72a6f60498 Runtime older offchain & txqueue, additional pow (#5012) 2022-07-01 14:40:00 +03:00
github-actions[bot] ef6cbce6e5 [CI Skip] bump/beta 8.10.2-18-x
skip-checks: true
2022-07-01 11:31:18 +00:00
Btwiuse ArchandJaco 50e9e9cb1e Add side effect check workaround (#4994) (#5009)
* Add side effect check workaround (#4994)

* Update packages/api/src/base/Getters.ts

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

* Update packages/api/src/base/Getters.ts

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

* eslint --fix

* inline isUndefined

Co-authored-by: Jaco <jacogr@gmail.com>
2022-07-01 14:22:51 +03:00
github-actions[bot] 230cc2c437 [CI Skip] bump/beta 8.10.2-17-x
skip-checks: true
2022-07-01 10:40:37 +00:00
Jaco 511a345b23 Runtime ParachainHost v1 (#5011) 2022-07-01 13:31:05 +03:00
github-actions[bot] 5800ba5d91 [CI Skip] bump/beta 8.10.2-16-x
skip-checks: true
2022-07-01 09:37:31 +00:00
Jaco d91b16f93d Fix typo in hex -> name logic (#5008) 2022-07-01 12:28:59 +03:00
github-actions[bot] 6d4027e116 [CI Skip] bump/beta 8.10.2-15-x
skip-checks: true
2022-07-01 09:25:26 +00:00
Jaco e39a1ebac5 Old runtime versions for Core (all) & BlockBuilder (some) (#5010) 2022-07-01 12:15:14 +03:00
github-actions[bot] 2ef672d4ec [CI Skip] bump/beta 8.10.2-14-x
skip-checks: true
2022-07-01 08:18:49 +00:00
Jaco 9a89ad37c9 Try and infer runtime names (& adjust mismatch mapping) (#5007) 2022-07-01 11:10:06 +03:00
github-actions[bot] 7eb907b155 [CI Skip] bump/beta 8.10.2-13-x
skip-checks: true
2022-07-01 07:27:49 +00:00
Jaco 5fc142cf5c Add orml{Oracle, Tokens} generic runtime definitions (#5006)
* Add orml{Oracle, Tokens} generic runtime definitions

* Adjust
2022-07-01 10:18:24 +03:00
github-actions[bot] 7571c6ae76 [CI Skip] bump/beta 8.10.2-12-x
skip-checks: true
2022-07-01 07:06:47 +00:00
Jaco 5a1598a389 Allow for runtime methods interleave (#5005) 2022-07-01 09:58:40 +03:00
github-actions[bot] b8451b4fe7 [CI Skip] bump/beta 8.10.2-11-x
skip-checks: true
2022-06-30 17:43:42 +00:00
Jaco a97da748be Complete EthereumRuntimeRPCApi runtime (#5003) 2022-06-30 20:34:50 +03:00
github-actions[bot] 34fead5c8a [CI Skip] bump/beta 8.10.2-10-x
skip-checks: true
2022-06-30 16:54:52 +00:00
Jaco 332b79a04a Add CollectCollationInfo runtime interfaces (#5002) 2022-06-30 19:44:02 +03:00
github-actions[bot] 64384a6a04 [CI Skip] bump/beta 8.10.2-9-x
skip-checks: true
2022-06-30 16:35:28 +00:00
Jaco 6e6f46a188 Fix small typos in field names (#5001)
* Fix small typos in field names

* Rebuild types
2022-06-30 19:27:29 +03:00
github-actions[bot] ee09a2f4d6 [CI Skip] bump/beta 8.10.2-8-x
skip-checks: true
2022-06-30 16:04:46 +00:00
Jaco 62be4530f9 Runtime interface for ParachainHost (#4999) 2022-06-30 18:56:49 +03:00
github-actions[bot] 516289bcb7 [CI Skip] bump/beta 8.10.2-7-x
skip-checks: true
2022-06-30 15:16:17 +00:00
Jaco b24e13f478 Additional runtime call definitions (#4998)
* Additional runtime call definitions

* Additional

* Additional

* Expand

* mmr (+ grandpa fixes)
2022-06-30 18:08:27 +03:00
github-actions[bot] 6fdd0d674e [CI Skip] bump/beta 8.10.2-6-x
skip-checks: true
2022-06-30 12:41:27 +00:00
Jaco d85a096066 Bump dev deps (#4997)
* Bump dev deps

* Changes
2022-06-30 15:33:46 +03:00
github-actions[bot] df68fde6cd [CI Skip] bump/beta 8.10.2-5-x
skip-checks: true
2022-06-30 11:31:14 +00:00
Jaco 1664c868df Adjust runtime decoration & typegen (#4996) 2022-06-30 14:23:01 +03:00
github-actions[bot] f5e89b7530 [CI Skip] bump/beta 8.10.2-4-x
skip-checks: true
2022-06-30 07:32:37 +00:00
Jaco abdbd37215 Add runtime decoration defaults (#4993)
* Add runtime decoration defaults

* Default exports

* Additional

* hash + version
2022-06-30 10:23:00 +03:00
github-actions[bot] 354c4b8fd4 [CI Skip] bump/beta 8.10.2-3-x
skip-checks: true
2022-06-30 05:29:14 +00:00
Jaco 2ddacb67db Aura, Babe & Session runtime definitions (#4992) 2022-06-30 08:21:27 +03:00
github-actions[bot] 602cff44a4 [CI Skip] bump/beta 8.10.2-2-x
skip-checks: true
2022-06-29 14:59:00 +00:00
Jaco 9ea866815b Check against runtime for calls generation (#4990)
* Check against runtime for calls generation

* No default augmentation
2022-06-29 17:34:11 +03:00
github-actions[bot] 74e1442343 [CI Skip] bump/beta 8.10.2-1-x
skip-checks: true
2022-06-29 12:05:36 +00:00
Jaco 23069dad76 Split rpc definitions into rpc.ts files (#4989) 2022-06-29 14:57:54 +03:00
github-actions[bot] 560bf096f7 [CI Skip] bump/beta 8.10.2-0-x
skip-checks: true
2022-06-29 10:19:43 +00:00
Jaco ac1837cdfe Basic/configurable no-metadata state_call interfaces (#4987)
* Basic/configurable no-metadata state_call interfaces

* Decorate on a per-section/method basis

* Expose metadata

* Adjust

* s/calls/runtime/

* Adjust

* Adjust

* Adjust for AugmentedCall

* Adjust base type exports

* Basics for generation (not enabled)

* Non-exported basic generation test

* lint fixes

* yarn.lock

* Adjust with lookups

* Adjust

* Adjust

* api-base into tsconfig for typegen

* typegen with args

* manual test for args passing

* CHANGELOG

* Adjust with new call definitions

* Allow multiple historic versions

* Metadata_metadata
2022-06-29 13:12:21 +03:00
github-actions[bot] 0a9158befc [CI Skip] release/stable 8.10.1
skip-checks: true
2022-06-26 06:56:57 +00:00
Jaco 9c4e984f7b 8.10.1 (#4986) 2022-06-26 09:49:34 +03:00
github-actions[bot] c1187f4c7a [CI Skip] bump/beta 8.9.2-24-x
skip-checks: true
2022-06-25 09:30:24 +00:00
Jaco e279d50224 Metadata bump (#4985) 2022-06-25 12:22:09 +03:00
github-actions[bot] f28908d28e [CI Skip] release/beta 8.9.2-23
skip-checks: true
2022-06-25 06:50:38 +00:00
Jaco 570cf5fea4 Bump dev (#4984) 2022-06-25 09:43:05 +03:00
github-actions[bot] 7bf5bb7a3b [CI Skip] bump/beta 8.9.2-22-x
skip-checks: true
2022-06-25 05:52:37 +00:00
Jaco 756502771e Bump util to 9.6.2 (#4983) 2022-06-25 08:42:41 +03:00
github-actions[bot] 977eb3f9ec [CI Skip] bump/beta 8.9.2-21-x
skip-checks: true
2022-06-24 04:30:32 +00:00
Jaco 909b3429f2 Update CHANGELOG (#4980)
* Update CHANGELOG

* Additional
2022-06-24 07:21:37 +03:00
github-actions[bot] 116b817696 [CI Skip] bump/beta 8.9.2-20-x
skip-checks: true
2022-06-23 17:31:39 +00:00
Alan Sapede c295d699e7 Adds Eth feeHistory & maxPriorityFeePerGas rpc (#4956)
* Adds Eth feeHistory & maxPriorityFeePerGas

* linted

* Fixes rpc method ordering
2022-06-23 20:22:05 +03:00
github-actions[bot] c8ab0e6959 [CI Skip] bump/beta 8.9.2-19-x
skip-checks: true
2022-06-23 17:11:08 +00:00
Jaco cf52676025 Bump dev (w/ deno build fix) (#4979) 2022-06-23 20:02:51 +03:00
github-actions[bot] 935b176740 [CI Skip] bump/beta 8.9.2-18-x
skip-checks: true
2022-06-23 11:23:19 +00:00
Jaco af9c4e0e4b Bump dev 2022-06-23 14:15:35 +03:00
github-actions[bot] 17eccc0b7b [CI Skip] release/beta 8.9.2-17
skip-checks: true
2022-06-23 09:05:32 +00:00
Jaco 1ba2413c86 Bump deps (#4978) 2022-06-23 11:57:28 +03:00
github-actions[bot] ff69198b1a [CI Skip] release/beta 8.9.2-16
skip-checks: true
2022-06-23 07:10:22 +00:00
Jaco 7b368a3f2d Dev bump (w/ publish) (#4977) 2022-06-23 10:01:03 +03:00
github-actions[bot] 58020291ea [CI Skip] release/beta 8.9.2-15
skip-checks: true
2022-06-23 06:35:43 +00:00
Jaco fb1e428615 Westend 9250 upgrade block (#4976) 2022-06-23 09:25:18 +03:00
github-actions[bot] 2164f80a3c [CI Skip] release/beta 8.9.2-14
skip-checks: true
2022-06-23 06:18:45 +00:00
Jaco 59903dfba3 Bump dev (Only publish betas with explicit indicator) (#4975) 2022-06-23 09:08:57 +03:00
github-actions[bot] 97ded7d284 [CI Skip] release/beta 8.9.2-13
skip-checks: true
2022-06-23 04:02:23 +00:00
Jaco 772ab6e7d1 Bump dev (w/ deno augmentation) (#4974)
* Bump dev (w/ deno augmentation)

* Build deno
2022-06-23 06:54:02 +03:00
github-actions[bot] f7a3907519 [CI Skip] release/beta 8.9.2-12
skip-checks: true
2022-06-23 03:46:07 +00:00
Jaco 891790b2b6 Fix f32/f64 primtive typegen (#4973) 2022-06-23 06:37:02 +03:00
github-actions[bot] fac008f453 [CI Skip] release/beta 8.9.2-11
skip-checks: true
2022-06-22 12:09:06 +00:00
Jaco 32fd91a221 Bump dependencies (#4972) 2022-06-22 15:01:15 +03:00
github-actions[bot] 472ab9acac [CI Skip] release/beta 8.9.2-10
skip-checks: true
2022-06-22 10:12:36 +00:00
Jaco 393f528e89 Support for F32 & F64 (#4958)
* Support for F32 & F64

* Additional

* Adjust

* Expand

* Empty creation

* Empty creation #2 (no params)

* Comment around toJSON()

* createdAtHash

* Float tests

* Comments

* typo

* Expand class description

* Add floats to InterfaceTypes

* Jiggle names

* CHANGELOG
2022-06-22 13:02:41 +03:00
github-actions[bot] 4a9d5fd3c1 [CI Skip] release/beta 8.9.2-9
skip-checks: true
2022-06-22 09:16:52 +00:00
Jaco 8e8bcd5f68 Trigger bundles 2022-06-22 12:07:50 +03:00
Jaco bd300791b5 Bump deps (w/ CI performance skips) (#4971)
* Bump deps (w/ CI performance skips)

* Bump common
2022-06-22 12:05:14 +03:00
github-actions[bot] cd2b3be962 [CI Skip] release/beta 8.9.2-8
skip-checks: true
2022-06-22 07:08:24 +00:00
Jaco 87df83a2b9 Bump deps (#4970) 2022-06-22 09:59:50 +03:00
github-actions[bot] 697688eea5 [CI Skip] release/beta 8.9.2-7
skip-checks: true
2022-06-21 13:09:11 +00:00
Jaco 9bbe095a5d Bump dev (w/ stable deno publish) (#4968)
* Bump dev (w/ stable deno publish)

* Bump dev
2022-06-21 16:01:18 +03:00
github-actions[bot] 51a6e50b09 [CI Skip] release/beta 8.9.2-6
skip-checks: true
2022-06-21 04:56:01 +00:00
Jaco d496ab2d1e Bump TS to 4.7.4 (#4967) 2022-06-21 07:47:59 +03:00
github-actions[bot] 3acca845f7 [CI Skip] release/beta 8.9.2-5
skip-checks: true
2022-06-20 17:45:34 +00:00
Jaco 3a8b1c5683 Adjust assert usage (#4966)
* Adjust assert usage

* Adjust assert

* Apply suggestions from code review
2022-06-20 20:37:17 +03:00
github-actions[bot] 94c5c025a9 [CI Skip] release/beta 8.9.2-4
skip-checks: true
2022-06-20 11:26:54 +00:00
Jaco a7c54d704b AbstractBigInt extensible (also via wrapper) (#4965)
* AbstractBigInt extensible (also via wrapper)

* Add missing package
2022-06-20 14:17:24 +03:00
github-actions[bot] 4640939908 [CI Skip] release/beta 8.9.2-3
skip-checks: true
2022-06-20 10:43:37 +00:00
Jaco 6d07803003 Use static get [Symbol.species] () for Array & Uint8Array types (#4964) 2022-06-20 13:33:24 +03:00
github-actions[bot] 13f7e853e8 [CI Skip] release/beta 8.9.2-2
skip-checks: true
2022-06-20 08:45:34 +00:00
Jaco fbd0e4212f Change Date.now to performance.now (#4963)
* Change Date.now to performance.now

* Additional logs
2022-06-20 11:35:50 +03:00
github-actions[bot] ebb9f5c63b [CI Skip] release/beta 8.9.2-1
skip-checks: true
2022-06-20 07:55:16 +00:00
Nikos Kontakis bffb72f29f Bump substrate connect to 0.7.7 (#4962) 2022-06-20 10:45:02 +03:00
github-actions[bot] 68272615e7 [CI Skip] release/beta 8.9.2-0
skip-checks: true
2022-06-20 05:32:32 +00:00
Jaco 190959dbd4 Beefy payload adjustment (#4961) 2022-06-20 08:24:50 +03:00
github-actions[bot] dbb427be5c [CI Skip] release/stable 8.9.1
skip-checks: true
2022-06-19 05:06:55 +00:00
Jaco 9a18016701 8.9.1 (#4957) 2022-06-19 07:57:41 +03:00
github-actions[bot] bcda5caa39 [CI Skip] release/beta 8.8.3-14
skip-checks: true
2022-06-18 19:33:04 +00:00
Jaco b88cad4b87 Bump Substrate metadata (#4955) 2022-06-18 22:25:42 +03:00
github-actions[bot] c86807c0b8 [CI Skip] release/beta 8.8.3-13
skip-checks: true
2022-06-18 12:42:41 +00:00
Jaco 771f3bc6fd Bump util (#4953) 2022-06-18 15:34:57 +03:00
github-actions[bot] 58a18e1da5 [CI Skip] release/beta 8.8.3-12
skip-checks: true
2022-06-18 10:52:53 +00:00
Jaco b42669f864 Adjust type asserts (#4952) 2022-06-18 13:45:04 +03:00
github-actions[bot] 0d2e938674 [CI Skip] release/beta 8.8.3-11
skip-checks: true
2022-06-18 09:10:54 +00:00
Jaco 98b3b10bd9 Add a hash alias for engine CreatedBlock (#4950) 2022-06-18 12:03:27 +03:00
github-actions[bot] 34a1e0cbe2 [CI Skip] release/beta 8.8.3-10
skip-checks: true
2022-06-18 07:13:01 +00:00
Jaco 44512c1d5f Add Kusama 9230 upgrade block (#4951) 2022-06-18 10:05:39 +03:00
github-actions[bot] 0440ce606a [CI Skip] release/beta 8.8.3-9
skip-checks: true
2022-06-17 15:03:36 +00:00
Jaco c05cb79005 Adjust PortableRegistry objectSpread (#4947) 2022-06-17 17:56:02 +03:00
github-actions[bot] ce39264b77 [CI Skip] release/beta 8.8.3-8
skip-checks: true
2022-06-17 14:28:29 +00:00
Jaco 7c5f82404f Adjust PortableRegistry name extraction (#4946)
* Adjust PortableRegistry name extraction

* Adjust count

* Adjust

* Adjust .every check

* Adjust ink! test outcomes
2022-06-17 17:20:26 +03:00
github-actions[bot] 7da9c5c20b [CI Skip] release/beta 8.8.3-7
skip-checks: true
2022-06-17 08:49:42 +00:00
Jaco ccd3b62632 Use switch internal to decodeFixedVec (#4945) 2022-06-17 11:40:45 +03:00
github-actions[bot] fdf6ec9530 [CI Skip] release/beta 8.8.3-6
skip-checks: true
2022-06-17 08:37:08 +00:00
Jaco 51b583d9ea Adjustments for getTypeDef (#4944)
* Adjustments for getTypeDef

* Cleanup unneeded +

* Adjust sanitize replacers

* Ordering

* Adjust sanitize
2022-06-17 11:29:01 +03:00
github-actions[bot] 6149b6ca76 [CI Skip] release/beta 8.8.3-5
skip-checks: true
2022-06-17 07:46:57 +00:00
Jaco 083e0478c3 Rename Base -> AbstractBase (#4943) 2022-06-17 10:36:44 +03:00
github-actions[bot] ee584f62a7 [CI Skip] release/beta 8.8.3-4
skip-checks: true
2022-06-17 06:56:34 +00:00
Jaco 530909d773 Dedupe internal Codec property access (#4941)
* Dedupe internal Codec property access

* Remove getter override

* OptionBool fixes

* Adjust isBasic

* Remove isBasic check

* Re-add isBasic

* Remove static decodeCompact
2022-06-17 09:46:57 +03:00
github-actions[bot] d0c55a31b8 [CI Skip] release/beta 8.8.3-3
skip-checks: true
2022-06-17 05:38:45 +00:00
Jaco eafd4923fe Bump @polkadot/util (#4942) 2022-06-17 08:29:30 +03:00
github-actions[bot] 264bcaf4ac [CI Skip] release/beta 8.8.3-2
skip-checks: true
2022-06-16 09:32:08 +00:00
Pierre Krieger a25c057ae7 Update substrate/connect to 0.7.6 (#4940) 2022-06-16 12:22:20 +03:00
github-actions[bot] 29927129a1 [CI Skip] release/beta 8.8.3-1
skip-checks: true
2022-06-15 14:59:39 +00:00
Jaco 4385320554 Shortcuts for Compact/Number instantiation (#4939)
* Shortcuts for Compact/Number instantiation

* Move/combine isHex/isString
2022-06-15 17:51:39 +03:00
github-actions[bot] 58eadc4e0f [CI Skip] release/beta 8.8.3-0
skip-checks: true
2022-06-15 08:31:14 +00:00
Jaco 89e4cba131 Adjust PortableRegistry name extraction (#4938)
* Adjust PortableRegistry name extraction

* Adjust contract tests

* Adjust

* Adjust
2022-06-15 11:23:38 +03:00
315 changed files with 21551 additions and 15658 deletions
+1
View File
@@ -0,0 +1 @@
8.11.1
+1
View File
@@ -2,6 +2,7 @@ _book/
build/
build-cjs/
build-esm/
build-deno/
build-docs/
coverage/
docs/.vuepress/dist/
+53 -1
View File
@@ -1,10 +1,62 @@
# CHANGELOG
## 8.11.1 Jul 2, 2022
Contributed:
- Adjust `api.{tx, query, ...}` with no external side-effects (Thanks to https://github.com/btwiuse)
Changes:
- Support for `state_call` definitions via API config (exposed on `api.call.*`)
- Base type definitions for `state_call` from Substrate, Polkadot & Orml
- Align runtime types with latest Substrate master
- Type generation for runtime call definitions (internal & external)
- Update to latest Substrate, Polkadot & Kusama metadata
## 8.10.1 Jun 26, 2022
Contributed:
- Bump `@substrate/connect` to 0.7.7 (Thanks to https://github.com/wirednkod)
- Support `feeHistory` & `maxPriorityFeePerGas` eth RPCs (Thanks to https://github.com/crystalin)
Changes:
- Align `BeefyPayload` with Substrate master
- Use `static get [Symbol.species] ()` for `Array` & `Uint8Array` types
- Add support for (optional, non-runtime recommended) `f32` & `f64` types
- Add future-use `AbstrateBigInt` wrapper extension
- Update Codec-internal performance tests
- Add Westend 9250 upgrade block
- Update to latest Substrate, Polkadot & Kusama metadata
## 8.9.1 Jun 19, 2022
Contributed:
- Update `@substrate/connect` to 0.7.6 (Thanks to https://github.com/tomaka)
Changes:
- Deupe all internal type property getters
- Adjust `@polkadot/types-codec` asserts
- Rename `Base` type to `AbstractBase` (reflecting usage)
- Alias `blockHash` on `rpc.engine.createBlock` return
- Instantiate `Compact/UInt/Int` with `number` when passed
- Adjust name extraction in `PortableRegistry` (maintainability)
- Adjust string type path extraction (maintainability)
- Add Kusama 9230 upgrade block
- Update to latest Substrate metadata
## 8.8.2 Jun 14, 2022
Changes:
- Aling historic `DispatchErrorModule` with `U8` variant
- Align historic `DispatchErrorModule` with `U8` variant
- Extend lookup type name generation when conflicts arrise
- Update to latest Substrate metadata
+5 -2
View File
@@ -1,4 +1,4 @@
3023 Jaco 8.8.2 (#4937)
3087 Jaco 8.11.1 (#5018)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
@@ -9,12 +9,12 @@
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
5 Chevdor Fix metadata package link (#3458)
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
5 Nikos Kontakis Bump substrate connect to 0.7.7 (#4962)
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
4 Alex Wang fix issue that creates duplicate providers (#983)
4 Alexander Popiak Add asset id in signing (#4009)
4 Joshy Orndorff spelling; efect -> effect (#2295)
4 Nantian fix bigint type (#3869)
4 Nikos Kontakis Update substrate connect to 0.7.5 (#4835)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
4 Thibaut Sardan no subscription for http (#3127)
3 André Silva add support for ValidationCodeHash (#3640)
@@ -43,8 +43,10 @@
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
2 Zannis Kalampoukis fix: Typegen handles structs and vectors of structs without erroring (#4743)
2 扩散性百万甜面包 Typo, deocrateMethod -> decorateMethod (#1594)
1 Alan Sapede Adds Eth feeHistory & maxPriorityFeePerGas rpc (#4956)
1 Andreea Eftene Add storage deposit support (#4304)
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
1 Btwiuse Arch Add side effect check workaround (#4994) (#5009)
1 chriswmercer little readme tweak (#279)
1 codingsh #2182 - add: search for docs (#2232)
1 coolcorexix Investigate 4559 v2 (#4608)
@@ -86,6 +88,7 @@
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)
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
1 qiuhao update DeriveCustom type (#2581)
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
1 Raphael Flechtner fix: typegen disconnect ws on success (#4901)
+7 -7
View File
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "8.8.2",
"version": "8.11.1",
"workspaces": [
"packages/*"
],
@@ -31,15 +31,15 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3",
"@polkadot/dev": "^0.67.3",
"@babel/core": "^7.18.6",
"@babel/register": "^7.18.6",
"@babel/runtime": "^7.18.6",
"@polkadot/dev": "^0.67.46",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^28.1.1",
"@types/jest": "^28.1.4",
"copyfiles": "^2.4.1"
},
"resolutions": {
"typescript": "^4.7.3"
"typescript": "^4.7.4"
}
}
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api-base": "8.8.2",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-augment": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
"@babel/runtime": "^7.18.6",
"@polkadot/api-base": "8.11.1",
"@polkadot/rpc-augment": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-augment": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/util": "^9.7.1"
},
"devDependencies": {
"@polkadot/types-support": "8.8.2"
"@polkadot/types-support": "8.11.1"
}
}
+14 -9
View File
@@ -497,6 +497,10 @@ declare module '@polkadot/api-base/types/errors' {
* these are removed, either through `unvote` or `reap_vote`.
**/
VotesExist: AugmentedError<ApiType>;
/**
* Voting period too low
**/
VotingPeriodLow: AugmentedError<ApiType>;
/**
* Invalid upper bound.
**/
@@ -895,10 +899,6 @@ declare module '@polkadot/api-base/types/errors' {
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* The member is already unbonding in this era.
**/
AlreadyUnbonding: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
@@ -911,7 +911,7 @@ declare module '@polkadot/api-base/types/errors' {
* Some error occurred that should never happen. This should be reported to the
* maintainers.
**/
DefensiveError: AugmentedError<ApiType>;
Defensive: AugmentedError<ApiType>;
/**
* The caller does not have adequate permissions.
**/
@@ -921,10 +921,6 @@ declare module '@polkadot/api-base/types/errors' {
* anymore to, for example, collect rewards).
**/
FullyUnbonding: AugmentedError<ApiType>;
/**
* The pool has insufficient balance to bond as a nominator.
**/
InsufficientBond: AugmentedError<ApiType>;
/**
* Too many members in the pool or system.
**/
@@ -1855,6 +1851,10 @@ declare module '@polkadot/api-base/types/errors' {
* Not a member.
**/
NotMember: AugmentedError<ApiType>;
/**
* Too many members.
**/
TooManyMembers: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -1891,6 +1891,11 @@ declare module '@polkadot/api-base/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
* amount to be spent.
**/
InsufficientPermission: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
+44 -2
View File
@@ -293,6 +293,10 @@ declare module '@polkadot/api-base/types/events' {
* A proposal preimage was removed and used (the deposit was returned).
**/
PreimageUsed: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128], { proposalHash: H256, provider: AccountId32, deposit: u128 }>;
/**
* A proposal got canceled.
**/
ProposalCanceled: AugmentedEvent<ApiType, [propIndex: u32], { propIndex: u32 }>;
/**
* A motion has been proposed by a public account.
**/
@@ -554,6 +558,10 @@ declare module '@polkadot/api-base/types/events' {
* A payout has been made to a member.
**/
PaidOut: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, payout: u128], { member: AccountId32, poolId: u32, payout: u128 }>;
/**
* The active balance of pool `pool_id` has been slashed to `balance`.
**/
PoolSlashed: AugmentedEvent<ApiType, [poolId: u32, balance: u128], { poolId: u32, balance: u128 }>;
/**
* The roles of a pool have been updated to the given new roles. Note that the depositor
* can never change.
@@ -565,12 +573,31 @@ declare module '@polkadot/api-base/types/events' {
StateChanged: AugmentedEvent<ApiType, [poolId: u32, newState: PalletNominationPoolsPoolState], { poolId: u32, newState: PalletNominationPoolsPoolState }>;
/**
* A member has unbonded from their pool.
*
* - `balance` is the corresponding balance of the number of points that has been
* requested to be unbonded (the argument of the `unbond` transaction) from the bonded
* pool.
* - `points` is the number of points that are issued as a result of `balance` being
* dissolved into the corresponding unbonding pool.
*
* In the absence of slashing, these values will match. In the presence of slashing, the
* number of points that are issued in the unbonding pool will be less than the amount
* requested to be unbonded.
**/
Unbonded: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, amount: u128], { member: AccountId32, poolId: u32, amount: u128 }>;
Unbonded: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, balance: u128, points: u128], { member: AccountId32, poolId: u32, balance: u128, points: u128 }>;
/**
* The unbond pool at `era` of pool `pool_id` has been slashed to `balance`.
**/
UnbondingPoolSlashed: AugmentedEvent<ApiType, [poolId: u32, era: u32, balance: u128], { poolId: u32, era: u32, balance: u128 }>;
/**
* A member has withdrawn from their pool.
*
* The given number of `points` have been dissolved in return of `balance`.
*
* Similar to `Unbonded` event, in the absence of slashing, the ratio of point to balance
* will be 1.
**/
Withdrawn: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, amount: u128], { member: AccountId32, poolId: u32, amount: u128 }>;
Withdrawn: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, balance: u128, points: u128], { member: AccountId32, poolId: u32, balance: u128, points: u128 }>;
/**
* Generic event
**/
@@ -1112,6 +1139,17 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
* has been paid by `who`.
**/
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
treasury: {
/**
* Some funds have been allocated.
@@ -1137,6 +1175,10 @@ declare module '@polkadot/api-base/types/events' {
* Spending has finished; this is the amount that rolls over until next spend.
**/
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
/**
* A new spend proposal has been approved.
**/
SpendApproved: AugmentedEvent<ApiType, [proposalIndex: u32, amount: u128, beneficiary: AccountId32], { proposalIndex: u32, amount: u128, beneficiary: AccountId32 }>;
/**
* We have ended a spend period and will now allocate funds.
**/
+1
View File
@@ -7,4 +7,5 @@ import './errors';
import './events';
import './query';
import './registry';
import './runtime';
import './tx';
+3
View File
@@ -849,6 +849,9 @@ declare module '@polkadot/api-base/types/storage' {
*
* This is the amount that the depositor must put as their initial stake in the pool, as an
* indication of "skin in the game".
*
* This is the value that will always exist in the staking ledger of the pool bonded account
* while all other accounts leave.
**/
minCreateBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
+334
View File
@@ -0,0 +1,334 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, Vec, bool, u32 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
import type { ValidatorSet } from '@polkadot/types/interfaces/beefy';
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot, ValidatorId } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
import type { IExtrinsic, Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/1 */
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/1 */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/2 */
babeApi: {
/**
* Return the genesis configuration for BABE. The configuration is only read on genesis.
**/
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* Generates a proof of key ownership for the given authority in the current epoch.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Returns information regarding the next epoch (which was already previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x49eaaf1b548a0cb0/1 */
beefyApi: {
/**
* Return the current active BEEFY validator set
**/
validatorSet: AugmentedCall<ApiType, () => Observable<Option<ValidatorSet>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/6 */
blockBuilder: {
/**
* Apply the given extrinsic.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
/**
* Check that the inherents are valid.
**/
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
/**
* Generate inherent extrinsics.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/4 */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Initialize a block with the given header.
**/
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/3 */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Generates a proof of key ownership for the given authority in the given set.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/1 */
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/1 */
mmrApi: {
/**
* Generate MMR proof for a series of leaves under given indices.
**/
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
/**
* Generate MMR proof for a leaf under given index.
**/
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR for a batch of leaves.
**/
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash or a batch of leaves.
**/
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR.
**/
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash.
**/
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/2 */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xaf2c0297a23e6d3d/2 */
parachainHost: {
/**
* Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.
**/
assumedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, hash: Hash | string | Uint8Array) => Observable<Option<ITuple<[PersistedValidationData, ValidationCodeHash]>>>>;
/**
* Yields information on all availability cores as relevant to the child block.
**/
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<CoreState>>>;
/**
* Get a vector of events concerning candidates that occurred within a block.
**/
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<CandidateEvent>>>;
/**
* Get the receipt of a candidate pending availability.
**/
candidatePendingAvailability: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<CommittedCandidateReceipt>>>;
/**
* Checks if the given validation outputs pass the acceptance criteria.
**/
checkValidationOutputs: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, outputs: CandidateCommitments | { upwardMessages?: any; horizontalMessages?: any; newValidationCode?: any; headData?: any; processedDownwardMessages?: any; hrmpWatermark?: any } | string | Uint8Array) => Observable<bool>>;
/**
* Get all the pending inbound messages in the downward message queue for a para.
**/
dmqContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundDownwardMessage>>>;
/**
* Get the contents of all channels addressed to the given recipient.
**/
inboundHrmpChannelsContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundHrmpMessage>>>;
/**
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
**/
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<ScrapedOnChainVotes>>>;
/**
* Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.
**/
persistedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<PersistedValidationData>>>;
/**
* Returns code hashes of PVFs that require pre-checking by validators in the active set.
**/
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<ValidationCodeHash>>>;
/**
* Returns the session index expected at a child of the block.
**/
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<SessionIndex>>;
/**
* Get the session info for the given session, if stored.
**/
sessionInfo: AugmentedCall<ApiType, (index: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<SessionInfo>>>;
/**
* Submits a PVF pre-checking statement into the transaction pool.
**/
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: ValidatorSignature | string | Uint8Array) => Observable<Null>>;
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<ValidationCode>>;
/**
* Get the validation code from its hash.
**/
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
/**
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCodeHash: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCodeHash>>>;
/**
* Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on
**/
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo]>>>;
/**
* Get the current validators.
**/
validators: AugmentedCall<ApiType, () => Observable<Vec<ValidatorId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/1 */
sessionKeys: {
/**
* Decode the given public session keys.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
/**
* Generate a set of session keys with optionally using the given seed.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xd2bc9897eed08f15/3 */
taggedTransactionQueue: {
/**
* Validate the transaction.
**/
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/1 */
transactionPaymentApi: {
/**
* The transaction fee details
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
/**
* The transaction info
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
+57 -9
View File
@@ -1139,8 +1139,9 @@ declare module '@polkadot/api-base/types/submittable' {
* The dispatch of this call must be `FastTrackOrigin`.
*
* - `proposal_hash`: The hash of the current external proposal.
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
* `FastTrackVotingPeriod` if too low.
* - `voting_period`: The period that is allowed for voting on this proposal.
* Must be always greater than zero.
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
* - `delay`: The number of block after voting has ended in approval and this should be
* enacted. This doesn't have a minimum amount.
*
@@ -1452,12 +1453,17 @@ declare module '@polkadot/api-base/types/submittable' {
};
grandpa: {
/**
* Note that the current authority set of the GRANDPA finality gadget has
* stalled. This will trigger a forced authority set change at the beginning
* of the next session, to be enacted `delay` blocks after that. The delay
* should be high enough to safely assume that the block signalling the
* forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters
* will start the new authority set using the given finalized block as base.
* Note that the current authority set of the GRANDPA finality gadget has stalled.
*
* This will trigger a forced authority set change at the beginning of the next session, to
* be enacted `delay` blocks after that. The `delay` should be high enough to safely assume
* that the block signalling the forced change will not be re-orged e.g. 1000 blocks.
* The block production rate (which may be slowed down because of finality lagging) should
* be taken into account when choosing the `delay`. The GRANDPA voters based on the new
* authority will start voting on top of `best_finalized_block_number` for new finalized
* blocks. `best_finalized_block_number` should be the highest of the latest finalized
* block of all validators of the new authority set.
*
* Only callable by root.
**/
noteStalled: AugmentedSubmittable<(delay: u32 | AnyNumber | Uint8Array, bestFinalizedBlockNumber: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
@@ -2117,6 +2123,16 @@ declare module '@polkadot/api-base/types/submittable' {
* accumulated rewards, see [`BondExtra`].
**/
bondExtra: AugmentedSubmittable<(extra: PalletNominationPoolsBondExtra | { FreeBalance: any } | { Rewards: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsBondExtra]>;
/**
* Chill on behalf of the pool.
*
* The dispatch origin of this call must be signed by the pool nominator or the pool
* root role, same as [`Pallet::nominate`].
*
* This directly forward the call to the staking pallet, on behalf of the pool bonded
* account.
**/
chill: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* A bonded member can use this to claim their payout based on the rewards that the pool
* has accumulated since their last claimed payout (OR since joining if this is there first
@@ -2159,6 +2175,15 @@ declare module '@polkadot/api-base/types/submittable' {
* * Only a pool with [`PoolState::Open`] can be joined
**/
join: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, poolId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, u32]>;
/**
* Nominate on behalf of the pool.
*
* The dispatch origin of this call must be signed by the pool nominator or the pool
* root role.
*
* This directly forward the call to the staking pallet, on behalf of the pool bonded
* account.
**/
nominate: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, validators: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<AccountId32>]>;
/**
* Call `withdraw_unbonded` for the pools account. This call can be made by any account.
@@ -2182,12 +2207,24 @@ declare module '@polkadot/api-base/types/submittable' {
* * `max_members_per_pool` - Set [`MaxPoolMembersPerPool`].
**/
setConfigs: AugmentedSubmittable<(minJoinBond: PalletNominationPoolsConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minCreateBond: PalletNominationPoolsConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxPools: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxMembers: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxMembersPerPool: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsConfigOpU32, PalletNominationPoolsConfigOpU32]>;
/**
* Set a new metadata for the pool.
*
* The dispatch origin of this call must be signed by the state toggler, or the root role
* of the pool.
**/
setMetadata: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, metadata: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
/**
* Set a new state for the pool.
*
* The dispatch origin of this call must be signed by the state toggler, or the root role
* of the pool.
**/
setState: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, state: PalletNominationPoolsPoolState | 'Open' | 'Blocked' | 'Destroying' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsPoolState]>;
/**
* Unbond up to `unbonding_points` of the `member_account`'s funds from the pool. It
* implicitly collects the rewards one last time, since not doing so would mean some
* rewards would go forfeited.
* rewards would be forfeited.
*
* Under certain conditions, this call can be dispatched permissionlessly (i.e. by any
* account).
@@ -4209,6 +4246,17 @@ declare module '@polkadot/api-base/types/submittable' {
* exist altogether, thus there is no way it would have been approved in the first place.
**/
removeApproval: AugmentedSubmittable<(proposalId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Propose and approve a spend of treasury funds.
*
* - `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`.
* - `amount`: The amount to be transferred from the treasury to the `beneficiary`.
* - `beneficiary`: The destination account for the transfer.
*
* NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the
* beneficiary.
**/
spend: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, MultiAddress]>;
/**
* Generic tx
**/
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.11.1' };
@@ -497,6 +497,10 @@ declare module '@polkadot/api-base/types/errors' {
* these are removed, either through `unvote` or `reap_vote`.
**/
VotesExist: AugmentedError<ApiType>;
/**
* Voting period too low
**/
VotingPeriodLow: AugmentedError<ApiType>;
/**
* Invalid upper bound.
**/
@@ -1557,6 +1561,10 @@ declare module '@polkadot/api-base/types/errors' {
* Not a member.
**/
NotMember: AugmentedError<ApiType>;
/**
* Too many members.
**/
TooManyMembers: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -1593,6 +1601,11 @@ declare module '@polkadot/api-base/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
* amount to be spent.
**/
InsufficientPermission: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
@@ -293,6 +293,10 @@ declare module '@polkadot/api-base/types/events' {
* A proposal preimage was removed and used (the deposit was returned).
**/
PreimageUsed: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128], { proposalHash: H256, provider: AccountId32, deposit: u128 }>;
/**
* A proposal got canceled.
**/
ProposalCanceled: AugmentedEvent<ApiType, [propIndex: u32], { propIndex: u32 }>;
/**
* A motion has been proposed by a public account.
**/
@@ -942,6 +946,17 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
* has been paid by `who`.
**/
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
treasury: {
/**
* Some funds have been allocated.
@@ -967,6 +982,10 @@ declare module '@polkadot/api-base/types/events' {
* Spending has finished; this is the amount that rolls over until next spend.
**/
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
/**
* A new spend proposal has been approved.
**/
SpendApproved: AugmentedEvent<ApiType, [proposalIndex: u32, amount: u128, beneficiary: AccountId32], { proposalIndex: u32, amount: u128, beneficiary: AccountId32 }>;
/**
* We have ended a spend period and will now allocate funds.
**/
@@ -7,4 +7,5 @@ import './errors';
import './events';
import './query';
import './registry';
import './runtime';
import './tx';
@@ -0,0 +1,334 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, Vec, bool, u32 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
import type { ValidatorSet } from '@polkadot/types/interfaces/beefy';
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot, ValidatorId } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
import type { IExtrinsic, Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/1 */
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/1 */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/2 */
babeApi: {
/**
* Return the genesis configuration for BABE. The configuration is only read on genesis.
**/
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* Generates a proof of key ownership for the given authority in the current epoch.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Returns information regarding the next epoch (which was already previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x49eaaf1b548a0cb0/1 */
beefyApi: {
/**
* Return the current active BEEFY validator set
**/
validatorSet: AugmentedCall<ApiType, () => Observable<Option<ValidatorSet>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/6 */
blockBuilder: {
/**
* Apply the given extrinsic.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
/**
* Check that the inherents are valid.
**/
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
/**
* Generate inherent extrinsics.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/4 */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Initialize a block with the given header.
**/
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/3 */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Generates a proof of key ownership for the given authority in the given set.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/1 */
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/1 */
mmrApi: {
/**
* Generate MMR proof for a series of leaves under given indices.
**/
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
/**
* Generate MMR proof for a leaf under given index.
**/
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR for a batch of leaves.
**/
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash or a batch of leaves.
**/
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR.
**/
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash.
**/
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/2 */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xaf2c0297a23e6d3d/2 */
parachainHost: {
/**
* Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.
**/
assumedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, hash: Hash | string | Uint8Array) => Observable<Option<ITuple<[PersistedValidationData, ValidationCodeHash]>>>>;
/**
* Yields information on all availability cores as relevant to the child block.
**/
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<CoreState>>>;
/**
* Get a vector of events concerning candidates that occurred within a block.
**/
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<CandidateEvent>>>;
/**
* Get the receipt of a candidate pending availability.
**/
candidatePendingAvailability: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<CommittedCandidateReceipt>>>;
/**
* Checks if the given validation outputs pass the acceptance criteria.
**/
checkValidationOutputs: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, outputs: CandidateCommitments | { upwardMessages?: any; horizontalMessages?: any; newValidationCode?: any; headData?: any; processedDownwardMessages?: any; hrmpWatermark?: any } | string | Uint8Array) => Observable<bool>>;
/**
* Get all the pending inbound messages in the downward message queue for a para.
**/
dmqContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundDownwardMessage>>>;
/**
* Get the contents of all channels addressed to the given recipient.
**/
inboundHrmpChannelsContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundHrmpMessage>>>;
/**
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
**/
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<ScrapedOnChainVotes>>>;
/**
* Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.
**/
persistedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<PersistedValidationData>>>;
/**
* Returns code hashes of PVFs that require pre-checking by validators in the active set.
**/
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<ValidationCodeHash>>>;
/**
* Returns the session index expected at a child of the block.
**/
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<SessionIndex>>;
/**
* Get the session info for the given session, if stored.
**/
sessionInfo: AugmentedCall<ApiType, (index: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<SessionInfo>>>;
/**
* Submits a PVF pre-checking statement into the transaction pool.
**/
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: ValidatorSignature | string | Uint8Array) => Observable<Null>>;
/**
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<ValidationCode>>;
/**
* Get the validation code from its hash.
**/
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
/**
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.
**/
validationCodeHash: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCodeHash>>>;
/**
* Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on
**/
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo]>>>;
/**
* Get the current validators.
**/
validators: AugmentedCall<ApiType, () => Observable<Vec<ValidatorId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/1 */
sessionKeys: {
/**
* Decode the given public session keys.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
/**
* Generate a set of session keys with optionally using the given seed.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xd2bc9897eed08f15/3 */
taggedTransactionQueue: {
/**
* Validate the transaction.
**/
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/1 */
transactionPaymentApi: {
/**
* The transaction fee details
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
/**
* The transaction info
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
+25 -8
View File
@@ -1139,8 +1139,9 @@ declare module '@polkadot/api-base/types/submittable' {
* The dispatch of this call must be `FastTrackOrigin`.
*
* - `proposal_hash`: The hash of the current external proposal.
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
* `FastTrackVotingPeriod` if too low.
* - `voting_period`: The period that is allowed for voting on this proposal.
* Must be always greater than zero.
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
* - `delay`: The number of block after voting has ended in approval and this should be
* enacted. This doesn't have a minimum amount.
*
@@ -1401,12 +1402,17 @@ declare module '@polkadot/api-base/types/submittable' {
};
grandpa: {
/**
* Note that the current authority set of the GRANDPA finality gadget has
* stalled. This will trigger a forced authority set change at the beginning
* of the next session, to be enacted `delay` blocks after that. The delay
* should be high enough to safely assume that the block signalling the
* forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters
* will start the new authority set using the given finalized block as base.
* Note that the current authority set of the GRANDPA finality gadget has stalled.
*
* This will trigger a forced authority set change at the beginning of the next session, to
* be enacted `delay` blocks after that. The `delay` should be high enough to safely assume
* that the block signalling the forced change will not be re-orged e.g. 1000 blocks.
* The block production rate (which may be slowed down because of finality lagging) should
* be taken into account when choosing the `delay`. The GRANDPA voters based on the new
* authority will start voting on top of `best_finalized_block_number` for new finalized
* blocks. `best_finalized_block_number` should be the highest of the latest finalized
* block of all validators of the new authority set.
*
* Only callable by root.
**/
noteStalled: AugmentedSubmittable<(delay: u32 | AnyNumber | Uint8Array, bestFinalizedBlockNumber: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
@@ -3562,6 +3568,17 @@ declare module '@polkadot/api-base/types/submittable' {
* exist altogether, thus there is no way it would have been approved in the first place.
**/
removeApproval: AugmentedSubmittable<(proposalId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Propose and approve a spend of treasury funds.
*
* - `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`.
* - `amount`: The amount to be transferred from the treasury to the `beneficiary`.
* - `beneficiary`: The destination account for the transfer.
*
* NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the
* beneficiary.
**/
spend: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, MultiAddress]>;
/**
* Generic tx
**/
@@ -733,6 +733,10 @@ declare module '@polkadot/api-base/types/errors' {
* these are removed, either through `unvote` or `reap_vote`.
**/
VotesExist: AugmentedError<ApiType>;
/**
* Voting period too low
**/
VotingPeriodLow: AugmentedError<ApiType>;
/**
* Invalid upper bound.
**/
@@ -1333,6 +1333,17 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
* has been paid by `who`.
**/
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
transactionStorage: {
/**
* Storage proof was successfully checked.
@@ -7,4 +7,5 @@ import './errors';
import './events';
import './query';
import './registry';
import './runtime';
import './tx';
@@ -1701,14 +1701,6 @@ declare module '@polkadot/api-base/types/storage' {
* Storage fee per transaction.
**/
entryFee: AugmentedQuery<ApiType, () => Observable<Option<u128>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maximum number of indexed transactions in the block.
**/
maxBlockTransactions: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maximum data set in a single transaction in bytes.
**/
maxTransactionSize: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Was the proof checked in this block?
**/
@@ -0,0 +1,265 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, Vec, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeUploadResult, ContractExecResult, ContractInstantiateResult } from '@polkadot/types/interfaces/contracts';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Balance, Block, Hash, Header, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
import type { IExtrinsic, Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
/** 0xbc9d89904f5b923f/1 */
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x687ad44ad37f03c2/1 */
authorityDiscoveryApi: {
/**
* Retrieve authority identifiers of the current and next authority set.
**/
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xcbca25e39f142387/2 */
babeApi: {
/**
* Return the genesis configuration for BABE. The configuration is only read on genesis.
**/
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
/**
* Returns information regarding the current epoch.
**/
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Returns the slot that started the current epoch.
**/
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
/**
* Generates a proof of key ownership for the given authority in the current epoch.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Returns information regarding the next epoch (which was already previously announced).
**/
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x40fe3ad401f8959a/6 */
blockBuilder: {
/**
* Apply the given extrinsic.
**/
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
/**
* Check that the inherents are valid.
**/
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
/**
* Finish the current block.
**/
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
/**
* Generate inherent extrinsics.
**/
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x68b66ba122c93fa7/1 */
contractsApi: {
/**
* Perform a call from a specified account to a given contract.
**/
call: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, dest: AccountId | string | Uint8Array, value: Balance | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array, inputData: Bytes | string | Uint8Array) => Observable<ContractExecResult>>;
/**
* Query a given storage key in a given contract.
**/
getStorage: AugmentedCall<ApiType, (address: AccountId | string | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
/**
* Instantiate a new contract.
**/
instantiate: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, value: Balance | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => Observable<ContractInstantiateResult>>;
/**
* Upload new code without instantiating a contract from it.
**/
uploadCode: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, code: Bytes | string | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array) => Observable<CodeUploadResult>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xdf6acb689907609b/4 */
core: {
/**
* Execute the given block.
**/
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Initialize a block with the given header.
**/
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Returns the version of the runtime.
**/
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xed99c5acb25eedf5/3 */
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Generates a proof of key ownership for the given authority in the given set.
**/
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Submits an unsigned extrinsic to report an equivocation.
**/
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/1 */
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91d5df18b0d2cf58/1 */
mmrApi: {
/**
* Generate MMR proof for a series of leaves under given indices.
**/
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
/**
* Generate MMR proof for a leaf under given index.
**/
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
/**
* Return the on-chain MMR root hash.
**/
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR for a batch of leaves.
**/
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash or a batch of leaves.
**/
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against on-chain MMR.
**/
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Verify MMR proof against given root hash.
**/
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xf78b278be53f454c/2 */
offchainWorkerApi: {
/**
* Starts the off-chain task for given block header.
**/
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xab3c0572291feb8b/1 */
sessionKeys: {
/**
* Decode the given public session keys.
**/
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
/**
* Generate a set of session keys with optionally using the given seed.
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xd2bc9897eed08f15/3 */
taggedTransactionQueue: {
/**
* Validate the transaction.
**/
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/1 */
transactionPaymentApi: {
/**
* The transaction fee details
**/
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
/**
* The transaction info
**/
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
+3 -2
View File
@@ -1655,8 +1655,9 @@ declare module '@polkadot/api-base/types/submittable' {
* The dispatch of this call must be `FastTrackOrigin`.
*
* - `proposal_hash`: The hash of the current external proposal.
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
* `FastTrackVotingPeriod` if too low.
* - `voting_period`: The period that is allowed for voting on this proposal.
* Must be always greater than zero.
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
* - `delay`: The number of block after voting has ended in approval and this should be
* enacted. This doesn't have a minimum amount.
*
+5 -5
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/util": "^9.4.1",
"@babel/runtime": "^7.18.6",
"@polkadot/rpc-core": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/util": "^9.7.1",
"rxjs": "^7.5.5"
}
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.11.1' };
+6
View File
@@ -65,3 +65,9 @@ export interface PaginationOptions<A = unknown> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type DecorateMethod<ApiType extends ApiTypes, T = any> =
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
type AsCodec<R extends Codec | any> = R extends Codec
? R
: Codec;
export type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
+29
View File
@@ -0,0 +1,29 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types';
import type { ApiTypes, ReturnCodec } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedCalls<ApiType extends ApiTypes> {
// augmented
}
export interface QueryableCalls<ApiType extends ApiTypes> extends AugmentedCalls<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleCalls<ApiType>;
}
export interface QueryableModuleCalls<ApiType extends ApiTypes> {
[key: string]: DecoratedCallBase<ApiType>;
}
export type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
ApiType extends 'rxjs'
? <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Observable<T>
: <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Promise<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
DecoratedCallBase<ApiType, F> & { meta: DefinitionCallNamed };
+1
View File
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// These are augmented, do an augmentation export
export * from '@polkadot/api-base/types/calls';
export * from '@polkadot/api-base/types/consts';
export * from '@polkadot/api-base/types/errors';
export * from '@polkadot/api-base/types/events';
+1 -7
View File
@@ -6,7 +6,7 @@ import type { StorageKey, u64 } from '@polkadot/types';
import type { Hash } from '@polkadot/types/interfaces';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types';
import type { ApiTypes, DropLast, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
import type { ApiTypes, DropLast, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedQueries<ApiType extends ApiTypes> {
@@ -22,12 +22,6 @@ export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQ
[key: string]: QueryableModuleStorageAt<ApiType>;
}
type AsCodec<R extends Codec | any> = R extends Codec
? R
: Codec;
type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
interface StorageEntryObservableMulti<R extends Codec = Codec> {
<T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
}
+10 -10
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/types-create": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/util-crypto": "^9.4.1",
"@babel/runtime": "^7.18.6",
"@polkadot/api": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/types-create": "8.11.1",
"@polkadot/util": "^9.7.1",
"@polkadot/util-crypto": "^9.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "8.8.2",
"@polkadot/keyring": "^9.4.1"
"@polkadot/api-augment": "8.11.1",
"@polkadot/keyring": "^9.7.1"
}
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.11.1' };
@@ -160,6 +160,7 @@
{
"info": "Enum",
"lookupIndex": 10,
"lookupName": "InkStorageCollectionsStashEntry",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
@@ -180,6 +180,7 @@
{
"info": "Struct",
"lookupIndex": 10,
"lookupName": "InkStorageCollectionsHashmapValueEntryEntry",
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
"docs": [],
"namespace": "ink_storage::collections::hashmap::ValueEntry",
@@ -205,6 +206,7 @@
{
"info": "Enum",
"lookupIndex": 11,
"lookupName": "InkStorageCollectionsStashEntry",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
@@ -275,6 +277,7 @@
{
"info": "Struct",
"lookupIndex": 13,
"lookupName": "InkStorageCollectionsHashmapValueEntryOption",
"type": "{\"value\":\"bool\",\"keyIndex\":\"u32\"}",
"docs": [],
"namespace": "ink_storage::collections::hashmap::ValueEntry",
@@ -226,6 +226,7 @@
{
"info": "Struct",
"lookupIndex": 12,
"lookupName": "InkStorageCollectionsHashmapValueEntry",
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
"docs": [],
"namespace": "ink_storage::collections::hashmap::ValueEntry",
@@ -251,7 +252,7 @@
{
"info": "Enum",
"lookupIndex": 13,
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainMultisigPlainTransaction\"}}",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainTransaction\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
"sub": [
@@ -268,7 +269,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 14,
"lookupName": "MultisigPlainMultisigPlainTransaction",
"lookupName": "MultisigPlainTransaction",
"type": "Lookup14",
"index": 1,
"name": "Occupied"
@@ -278,7 +279,7 @@
{
"info": "Struct",
"lookupIndex": 14,
"lookupName": "MultisigPlainMultisigPlainTransaction",
"lookupName": "MultisigPlainTransaction",
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Bytes\",\"transferredValue\":\"u128\",\"gasLimit\":\"u64\"}",
"docs": [],
"namespace": "multisig_plain::multisig_plain::Transaction",
@@ -373,6 +374,7 @@
{
"info": "Enum",
"lookupIndex": 19,
"lookupName": "InkStorageCollectionsStashEntry",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
@@ -416,7 +418,7 @@
{
"info": "Tuple",
"lookupIndex": 21,
"type": "(u32,MultisigPlainMultisigPlainConfirmationStatus)",
"type": "(u32,MultisigPlainConfirmationStatus)",
"docs": [],
"namespace": "",
"sub": [
@@ -431,7 +433,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 22,
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
"lookupName": "MultisigPlainConfirmationStatus",
"type": "Lookup22"
}
]
@@ -439,7 +441,7 @@
{
"info": "Enum",
"lookupIndex": 22,
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
"lookupName": "MultisigPlainConfirmationStatus",
"type": "{\"_enum\":{\"Confirmed\":\"Null\",\"ConfirmationsNeeded\":\"u32\"}}",
"docs": [],
"namespace": "multisig_plain::multisig_plain::ConfirmationStatus",
@@ -310,6 +310,7 @@
{
"info": "Enum",
"lookupIndex": 15,
"lookupName": "InkStorageCollectionsStashEntry",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
@@ -380,6 +381,7 @@
{
"info": "Struct",
"lookupIndex": 17,
"lookupName": "InkStorageCollectionsHashmapValueEntry",
"type": "{\"value\":\"Null\",\"keyIndex\":\"u32\"}",
"docs": [],
"namespace": "ink_storage::collections::hashmap::ValueEntry",
@@ -83,6 +83,7 @@
{
"info": "Struct",
"lookupIndex": 6,
"lookupName": "InkStorageLazyMapping",
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
"docs": [],
"namespace": "ink_storage::lazy::mapping::Mapping",
@@ -83,6 +83,7 @@
{
"info": "Struct",
"lookupIndex": 6,
"lookupName": "InkStorageLazyMapping",
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
"docs": [],
"namespace": "ink_storage::lazy::mapping::Mapping",
@@ -23,8 +23,8 @@
{
"info": "Enum",
"lookupIndex": 4,
"lookupName": "EnumExampleEnumExampleVariant",
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleEnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleEnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleEnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleEnumExampleColor\"}}",
"lookupName": "EnumExampleVariant",
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleColor\"}}",
"docs": [],
"namespace": "enum_example::enum_example::Variant",
"sub": [
@@ -38,7 +38,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 5,
"lookupName": "EnumExampleEnumExampleWeekday",
"lookupName": "EnumExampleWeekday",
"type": "Lookup5",
"index": 1,
"name": "Weekday"
@@ -47,7 +47,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 6,
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
"lookupName": "EnumExampleTupleMaybeSigned",
"type": "Lookup6",
"index": 2,
"name": "TupleMaybeSigned"
@@ -56,7 +56,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 7,
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
"lookupName": "EnumExampleNamedMaybeSigned",
"type": "Lookup7",
"index": 3,
"name": "NamedMaybeSigned"
@@ -65,7 +65,7 @@
"docs": [],
"info": "Si",
"lookupIndex": 8,
"lookupName": "EnumExampleEnumExampleColor",
"lookupName": "EnumExampleColor",
"type": "Lookup8",
"index": 4,
"name": "Color"
@@ -75,7 +75,7 @@
{
"info": "Enum",
"lookupIndex": 5,
"lookupName": "EnumExampleEnumExampleWeekday",
"lookupName": "EnumExampleWeekday",
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}",
"docs": [],
"namespace": "enum_example::enum_example::Weekday",
@@ -127,7 +127,7 @@
{
"info": "Enum",
"lookupIndex": 6,
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
"lookupName": "EnumExampleTupleMaybeSigned",
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}",
"docs": [],
"namespace": "enum_example::enum_example::TupleMaybeSigned",
@@ -155,7 +155,7 @@
{
"info": "Enum",
"lookupIndex": 7,
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
"lookupName": "EnumExampleNamedMaybeSigned",
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}",
"docs": [],
"namespace": "enum_example::enum_example::NamedMaybeSigned",
@@ -197,7 +197,7 @@
{
"info": "Enum",
"lookupIndex": 8,
"lookupName": "EnumExampleEnumExampleColor",
"lookupName": "EnumExampleColor",
"type": "{\"_enum\":{\"Red\":\"Null\",\"Blue\":\"Null\",\"Green\":\"Null\",\"Yellow\":\"Null\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}",
"docs": [],
"namespace": "enum_example::enum_example::Color",
@@ -160,6 +160,7 @@
{
"info": "Enum",
"lookupIndex": 10,
"lookupName": "InkStorageCollectionsStashEntry",
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
"docs": [],
"namespace": "ink_storage::collections::stash::Entry",
+15 -15
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.8.2",
"@polkadot/api-augment": "8.8.2",
"@polkadot/api-base": "8.8.2",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/util-crypto": "^9.4.1",
"@babel/runtime": "^7.18.6",
"@polkadot/api": "8.11.1",
"@polkadot/api-augment": "8.11.1",
"@polkadot/api-base": "8.11.1",
"@polkadot/rpc-core": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/util": "^9.7.1",
"@polkadot/util-crypto": "^9.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api": "8.8.2",
"@polkadot/api-augment": "8.8.2",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/rpc-provider": "8.8.2",
"@polkadot/types-support": "8.8.2"
"@polkadot/api": "8.11.1",
"@polkadot/api-augment": "8.11.1",
"@polkadot/rpc-augment": "8.11.1",
"@polkadot/rpc-provider": "8.11.1",
"@polkadot/types-support": "8.11.1"
}
}
@@ -10,6 +10,7 @@ import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types';
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
import { Enum } from '@polkadot/types';
import { isFunction, stringToHex } from '@polkadot/util';
import { memo } from '../util';
@@ -24,7 +25,7 @@ interface SchedulerInfo {
function isMaybeHashed (call: FrameSupportScheduleMaybeHashed | Call): call is FrameSupportScheduleMaybeHashed {
// check for enum
return (call as FrameSupportScheduleMaybeHashed).isBasic === false;
return call instanceof Enum;
}
function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.11.1' };
+18 -18
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api-augment": "8.8.2",
"@polkadot/api-base": "8.8.2",
"@polkadot/api-derive": "8.8.2",
"@polkadot/keyring": "^9.4.1",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/rpc-provider": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-augment": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/types-create": "8.8.2",
"@polkadot/types-known": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/util-crypto": "^9.4.1",
"@babel/runtime": "^7.18.6",
"@polkadot/api-augment": "8.11.1",
"@polkadot/api-base": "8.11.1",
"@polkadot/api-derive": "8.11.1",
"@polkadot/keyring": "^9.7.1",
"@polkadot/rpc-augment": "8.11.1",
"@polkadot/rpc-core": "8.11.1",
"@polkadot/rpc-provider": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-augment": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/types-create": "8.11.1",
"@polkadot/types-known": "8.11.1",
"@polkadot/util": "^9.7.1",
"@polkadot/util-crypto": "^9.7.1",
"eventemitter3": "^4.0.7",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "8.8.2",
"@polkadot/types-support": "8.8.2"
"@polkadot/api-augment": "8.11.1",
"@polkadot/types-support": "8.11.1"
}
}
+182 -4
View File
@@ -2,13 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { DeriveCustom } from '@polkadot/api-base/types';
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types';
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionRpc, DefinitionRpcSub, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../submittable/types';
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types';
import type { VersionedRegistry } from './types';
@@ -18,8 +19,10 @@ import { BehaviorSubject, combineLatest, from, map, of, switchMap, tap, toArray
import { getAvailableDerives } from '@polkadot/api-derive';
import { memo, RpcCore } from '@polkadot/rpc-core';
import { WsProvider } from '@polkadot/rpc-provider';
import { expandMetadata, Metadata, TypeRegistry, unwrapStorageType } from '@polkadot/types';
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, u8aToHex } from '@polkadot/util';
import { expandMetadata, Metadata, typeDefinitions, TypeRegistry, unwrapStorageType } from '@polkadot/types';
import { getSpecRuntime } from '@polkadot/types-known';
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
import { blake2AsHex } from '@polkadot/util-crypto';
import { createSubmittable } from '../submittable';
import { augmentObject } from '../util/augmentObject';
@@ -66,6 +69,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// HACK Use BN import so decorateDerive works... yes, wtf.
protected __phantom = new BN(0);
protected _call: QueryableCalls<ApiType> = {} as QueryableCalls<ApiType>;
protected _consts: QueryableConsts<ApiType> = {} as QueryableConsts<ApiType>;
protected _derive?: ReturnType<Decorate<ApiType>['_decorateDerive']>;
@@ -94,6 +99,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
protected _rpcCore: RpcCore & RpcInterface;
protected _runtimeMap: Record<HexString, string> = {};
protected _runtimeChain?: Text;
protected _runtimeMetadata?: Metadata;
@@ -206,6 +213,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
protected _emptyDecorated (registry: Registry, blockHash?: Uint8Array): ApiDecoration<ApiType> {
return {
call: {},
consts: {},
errors: {},
events: {},
@@ -227,6 +235,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
registry.decoratedMeta = expandMetadata(registry.registry, registry.metadata);
}
const runtime = this._decorateCalls(registry, this._decorateMethod, blockHash);
const storage = this._decorateStorage(registry.decoratedMeta, this._decorateMethod, blockHash);
const storageRx = this._decorateStorage(registry.decoratedMeta, this._rxDecorateMethod, blockHash);
@@ -235,6 +244,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
augmentObject('events', registry.decoratedMeta.events, decoratedApi.events, fromEmpty);
augmentObject('query', storage, decoratedApi.query, fromEmpty);
augmentObject('query', storageRx, decoratedApi.rx.query, fromEmpty);
augmentObject('call', runtime, decoratedApi.call, fromEmpty);
decoratedApi.findCall = (callIndex: Uint8Array | string): CallFunction =>
findCall(registry.registry, callIndex);
@@ -259,6 +269,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const { decoratedApi, decoratedMeta } = this._createDecorated(registry, fromEmpty, registry.decoratedApi);
this._call = decoratedApi.call;
this._consts = decoratedApi.consts;
this._errors = decoratedApi.errors;
this._events = decoratedApi.events;
@@ -316,6 +327,28 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this._decorateRpc(this._rpcCore, this._rxDecorateMethod, this._rx.rpc);
}
// extract the actual sections from the methods (this is useful when
// we try and create mappings to runtime names via a hash mapping)
const sectionMap: Record<string, boolean> = {};
for (let i = 0; i < methods.length; i++) {
const [section] = methods[i].split('_');
sectionMap[section] = true;
}
// convert the actual section names into an easy name lookup
const sections = Object.keys(sectionMap);
for (let i = 0; i < sections.length; i++) {
const nameA = stringUpperFirst(sections[i]);
const nameB = `${nameA}Api`;
this._runtimeMap[blake2AsHex(nameA, 64)] = nameA;
this._runtimeMap[blake2AsHex(nameB, 64)] = nameB;
}
// finally we filter the actual methods to expose
this._filterRpcMethods(methods);
}
@@ -404,6 +437,151 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return out as DecoratedRpc<ApiType, RpcInterface>;
}
// add all definition entries
protected _addRuntimeDef (result: DefinitionsCall, additional?: DefinitionsCall): void {
if (!additional) {
return;
}
const entries = Object.entries(additional);
for (let j = 0; j < entries.length; j++) {
const [key, defs] = entries[j];
if (result[key]) {
// we have this one already, step through for new versions or
// new methods and add those as applicable
for (let k = 0; k < defs.length; k++) {
const def = defs[k];
const prev = result[key].find(({ version }) => def.version === version);
if (prev) {
// interleave the new methods with the old - last definition wins
objectSpread(prev.methods, def.methods);
} else {
// we don't have this specific version, add it
result[key].push(def);
}
}
} else {
// we don't have this runtime definition, add it as-is
result[key] = defs;
}
}
}
// extract all runtime definitions
protected _getRuntimeDefs (registry: Registry, specName: Text, chain: Text | string = ''): [string, DefinitionsCallEntry[]][] {
const result: DefinitionsCall = {};
const defValues = Object.values(typeDefinitions);
// options > chain/spec > built-in, apply in reverse order with
// methods overriding previous definitions (or interleave missing)
for (let i = 0; i < defValues.length; i++) {
this._addRuntimeDef(result, defValues[i].runtime);
}
this._addRuntimeDef(result, getSpecRuntime(registry, chain, specName));
this._addRuntimeDef(result, this._options.runtime);
return Object.entries(result);
}
// pre-metadata decoration
protected _decorateCalls<ApiType extends ApiTypes> ({ registry, runtimeVersion: { apis, specName } }: VersionedRegistry<ApiType>, decorateMethod: DecorateMethod<ApiType>, blockHash?: Uint8Array | string | null): QueryableCalls<ApiType> {
const result = {} as QueryableCalls<ApiType>;
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
const hashes: Record<HexString, boolean> = {};
const sections = this._getRuntimeDefs(registry, specName, this._runtimeChain);
const older: string[] = [];
for (let i = 0; i < sections.length; i++) {
const [_section, secs] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const rtApi = apis.find(([a]) => a.eq(sectionHash));
hashes[sectionHash] = true;
if (rtApi) {
const all = secs.map(({ version }) => version).sort();
const sec = secs.find(({ version }) => rtApi[1].eq(version));
if (sec) {
const section = stringCamelCase(_section);
const methods = Object.entries(sec.methods);
if (methods.length) {
if (!named[section]) {
named[section] = {};
}
for (let m = 0; m < methods.length; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
named[section][method] = objectSpread({ method, name: `${_section}_${_method}`, section, sectionHash }, def);
}
}
} else {
older.push(`${_section}/${rtApi[1].toString()} (${all.join('/')} known)`);
}
}
}
// find the runtimes that we don't have hashes for
const notFound = apis
.map(([a, v]): [HexString, string] => [a.toHex(), v.toString()])
.filter(([a]) => !hashes[a])
.map(([a, v]) => `${this._runtimeMap[a] || a}/${v}`);
if (older.length) {
l.warn(`Not decorating runtime apis without matching versions: ${older.join(', ')}`);
}
if (notFound.length) {
l.warn(`Not decorating unknown runtime apis: ${notFound.join(', ')}`);
}
const stateCall = blockHash
? (name: string, bytes: Uint8Array) => this._rpcCore.state.call(name, bytes, blockHash)
: (name: string, bytes: Uint8Array) => this._rpcCore.state.call(name, bytes);
const lazySection = (section: string) =>
lazyMethods({}, Object.keys(named[section]), (method: string) =>
this._decorateCall(registry, named[section][method], stateCall, decorateMethod)
);
const modules = Object.keys(named);
for (let i = 0; i < modules.length; i++) {
lazyMethod(result, modules[i], lazySection);
}
return result;
}
protected _decorateCall<ApiType extends ApiTypes> (registry: Registry, def: DefinitionCallNamed, stateCall: (method: string, bytes: Uint8Array) => Observable<Codec>, decorateMethod: DecorateMethod<ApiType>): AugmentedCall<ApiType> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const decorated = decorateMethod((...args: unknown[]): Observable<Codec> => {
if (args.length !== def.params.length) {
throw new Error(`${def.name}:: Expected ${def.params.length} arguments, found ${args.length}`);
}
const bytes = registry.createType('Raw', u8aConcatStrict(
args.map((a, i) => registry.createTypeUnsafe(def.params[i].type, [a]).toU8a())
));
return stateCall(def.name, bytes).pipe(
map((r) => registry.createTypeUnsafe(def.type, [r]))
);
});
(decorated as AugmentedCall<ApiType>).meta = def;
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return decorated;
}
// only be called if supportMulti is true
protected _decorateMulti<ApiType extends ApiTypes> (decorateMethod: DecorateMethod<ApiType>): QueryableStorageMulti<ApiType> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
+13 -4
View File
@@ -7,9 +7,7 @@ import type { Text } from '@polkadot/types';
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Metadata } from '@polkadot/types/metadata';
import type { CallFunction, RegistryError } from '@polkadot/types/types';
import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types';
import { assertReturn } from '@polkadot/util';
import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableCalls, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types';
import { packageInfo } from '../packageInfo';
import { findCall, findError } from './find';
@@ -21,10 +19,21 @@ interface PkgJson {
}
function assertResult<T> (value: T | undefined): T {
return assertReturn(value, 'Api needs to be initialized before using, listen on \'ready\'');
if (value === undefined) {
throw new Error("Api interfaces needs to be initialized before using, wait for 'isReady'");
}
return value;
}
export abstract class Getters<ApiType extends ApiTypes> extends Init<ApiType> implements ApiDecoration<ApiType> {
/**
* @description Runtime call interfaces (currently untyped, only decorated via API options)
*/
public get call (): QueryableCalls<ApiType> {
return assertResult(this._call);
}
/**
* @description Contains the parameter types (constants) of all modules.
*
+18 -1
View File
@@ -18,6 +18,19 @@ import { SubmittableResult } from './';
const registry = new TypeRegistry();
async function calls (api: ApiPromise): Promise<void> {
// it allows defaults
const testSetId = await api.call.grandpaApi.currentSetId();
// it allows type overrides (generally shouldn't be used, but available)
const testSetIdO = await api.call.grandpaApi.currentSetId<AccountId>();
// it allows actual params
const nonce = await api.call.accountNonceApi.accountNonce('5Test');
console.log(testSetId.toNumber(), testSetIdO.isAscii, nonce.toNumber());
}
function consts (api: ApiPromise): void {
// constants has actual value & metadata
console.log(
@@ -213,12 +226,15 @@ function types (api: ApiPromise): void {
const balance = registry.createType('Balance', 2);
const gas = registry.createType('Gas', 2);
const compact = registry.createType('Compact<u32>', 2);
const f32 = registry.createType('f32');
const u32 = registry.createType('u32');
const raw = registry.createType('Raw');
// const random = registry.createType('RandomType', 2); // This one should deliberately show a TS error
const gasUnsafe = createTypeUnsafe(registry, 'Gas', [2]);
const overriddenUnsafe = createTypeUnsafe<Header>(registry, 'Gas', [2]);
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, api.createType('AccountData'));
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, u32.toNumber(), f32.toNumber(), api.createType('AccountData'), raw.subarray(0, 10));
}
async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
@@ -287,6 +303,7 @@ async function main (): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Promise.all([
calls(api),
consts(api),
derive(api),
errors(api),
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.11.1' };
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from '@polkadot/api-base/types/calls';
+8 -1
View File
@@ -3,6 +3,7 @@
import type { ApiTypes, DeriveCustom, QueryableStorageMulti } from '@polkadot/api-base/types';
import type { ApiInterfaceRx as ApiInterfaceBase } from '@polkadot/api-base/types/api';
import type { QueryableCalls } from '@polkadot/api-base/types/calls';
import type { QueryableConsts } from '@polkadot/api-base/types/consts';
import type { DecoratedErrors } from '@polkadot/api-base/types/errors';
import type { DecoratedEvents } from '@polkadot/api-base/types/events';
@@ -10,7 +11,7 @@ import type { QueryableStorage } from '@polkadot/api-base/types/storage';
import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types';
import type { ApiBase } from '../base';
@@ -18,6 +19,7 @@ import type { SubmittableExtrinsic } from '../types/submittable';
import type { AllDerives } from '../util/decorate';
export * from '@polkadot/api-base/types';
export * from '@polkadot/api/types/calls';
export * from '@polkadot/api/types/consts';
export * from '@polkadot/api/types/errors';
export * from '@polkadot/api/types/events';
@@ -60,6 +62,10 @@ export interface ApiOptions extends RegisteredTypes {
* @description User-defined RPC methods
*/
rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
/**
* @description Overrides for state_call usage (this will be removed in some future version)
*/
runtime?: DefinitionsCall;
/**
* @description Any chain-specific signed extensions that are now well-known
*/
@@ -90,6 +96,7 @@ export interface SignerOptions extends SignatureOptions {
}
export interface ApiDecoration<ApiType extends ApiTypes> {
call: QueryableCalls<ApiType>;
consts: QueryableConsts<ApiType>;
errors: DecoratedErrors<ApiType>;
events: DecoratedEvents<ApiType>;
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
"@babel/runtime": "^7.18.6",
"@polkadot/rpc-core": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/util": "^9.7.1"
}
}
+12 -4
View File
@@ -3,7 +3,7 @@
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey } from '@polkadot/types';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types-codec';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
@@ -14,7 +14,7 @@ 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 { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
@@ -56,11 +56,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
/**
* Submit and subscribe to watch an extrinsic until unsubscribed
**/
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<ExtrinsicStatus>>;
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ExtrinsicStatus>>;
/**
* Submit a fully formatted extrinsic for block inclusion
**/
submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<Hash>>;
submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Hash>>;
};
babe: {
/**
@@ -197,6 +197,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Estimate gas needed for execution of given contract.
**/
estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
/**
* Returns fee history for given block count & reward percentiles
**/
feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option<Vec<f64>> | null | object | string | Uint8Array) => Observable<EthFeeHistory>>;
/**
* Returns current gas price.
**/
@@ -289,6 +293,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Returns the number of hashes per second that the node is mining with.
**/
hashrate: AugmentedRpc<() => Observable<U256>>;
/**
* Returns max priority fee per gas
**/
maxPriorityFeePerGas: AugmentedRpc<() => Observable<U256>>;
/**
* Returns true if client is actively mining new blocks.
**/
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/rpc-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.11.1' };
+8 -8
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/rpc-provider": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/util": "^9.4.1",
"@babel/runtime": "^7.18.6",
"@polkadot/rpc-augment": "8.11.1",
"@polkadot/rpc-provider": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/util": "^9.7.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^9.4.1",
"@polkadot/rpc-augment": "8.8.2"
"@polkadot/keyring": "^9.7.1",
"@polkadot/rpc-augment": "8.11.1"
}
}
+7 -3
View File
@@ -12,7 +12,7 @@ import type { RpcInterfaceMethod } from './types';
import { Observable, publishReplay, refCount } from 'rxjs';
import { rpcDefinitions } from '@polkadot/types';
import { assert, hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util';
import { hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util';
import { drr, refCountDelay } from './util';
@@ -106,7 +106,9 @@ export class RpcCore {
*/
constructor (instanceId: string, registry: Registry, provider: ProviderInterface, userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {}) {
// eslint-disable-next-line @typescript-eslint/unbound-method
assert(provider && isFunction(provider.send), 'Expected Provider to API create');
if (!provider || !isFunction(provider.send)) {
throw new Error('Expected Provider to API create');
}
this.#instanceId = instanceId;
this.#registryDefault = registry;
@@ -360,7 +362,9 @@ export class RpcCore {
? ''
: ` (${def.params.length - reqArgCount} optional)`;
assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, () => `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
if (inputs.length < reqArgCount || inputs.length > def.params.length) {
throw new Error(`Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
}
return inputs.map((input, index): Codec =>
registry.createTypeUnsafe(def.params[index].type, [input], { blockHash })
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.11.1' };
+12 -12
View File
@@ -20,21 +20,21 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/keyring": "^9.4.1",
"@polkadot/types": "8.8.2",
"@polkadot/types-support": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/util-crypto": "^9.4.1",
"@polkadot/x-fetch": "^9.4.1",
"@polkadot/x-global": "^9.4.1",
"@polkadot/x-ws": "^9.4.1",
"@substrate/connect": "0.7.5",
"@babel/runtime": "^7.18.6",
"@polkadot/keyring": "^9.7.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-support": "8.11.1",
"@polkadot/util": "^9.7.1",
"@polkadot/util-crypto": "^9.7.1",
"@polkadot/x-fetch": "^9.7.1",
"@polkadot/x-global": "^9.7.1",
"@polkadot/x-ws": "^9.7.1",
"@substrate/connect": "0.7.7",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.5",
"nock": "^13.2.6"
"nock": "^13.2.8"
}
}
+18 -4
View File
@@ -3,7 +3,7 @@
import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types';
import { assert, isNumber, isString, isUndefined, stringify } from '@polkadot/util';
import { isNumber, isString, isUndefined, stringify } from '@polkadot/util';
import RpcError from './error';
@@ -36,15 +36,29 @@ export class RpcCoder {
#id = 0;
public decodeResponse (response?: JsonRpcResponse): unknown {
assert(response && response.jsonrpc === '2.0', 'Invalid jsonrpc field in decoded object');
if (!response || response.jsonrpc !== '2.0') {
throw new Error('Invalid jsonrpc field in decoded object');
}
const isSubscription = !isUndefined(response.params) && !isUndefined(response.method);
assert(isNumber(response.id) || (isSubscription && (isNumber(response.params.subscription) || isString(response.params.subscription))), 'Invalid id field in decoded object');
if (
!isNumber(response.id) &&
(
!isSubscription || (
!isNumber(response.params.subscription) &&
!isString(response.params.subscription)
)
)
) {
throw new Error('Invalid id field in decoded object');
}
checkError(response.error);
assert(!isUndefined(response.result) || isSubscription, 'No result found in jsonrpc response');
if (response.result === undefined && !isSubscription) {
throw new Error('No result found in jsonrpc response');
}
if (isSubscription) {
checkError(response.params.error);
+7 -3
View File
@@ -3,7 +3,7 @@
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
import { assert, logger } from '@polkadot/util';
import { logger } from '@polkadot/util';
import { fetch } from '@polkadot/x-fetch';
import { RpcCoder } from '../coder';
@@ -49,7 +49,9 @@ export class HttpProvider implements ProviderInterface {
* @param {string} endpoint The endpoint url starting with http://
*/
constructor (endpoint: string = defaults.HTTP_URL, headers: Record<string, string> = {}) {
assert(/^(https|http):\/\//.test(endpoint), () => `Endpoint should start with 'http://', received '${endpoint}'`);
if (!/^(https|http):\/\//.test(endpoint)) {
throw new Error(`Endpoint should start with 'http://' or 'https://', received '${endpoint}'`);
}
this.#coder = new RpcCoder();
this.#endpoint = endpoint;
@@ -156,7 +158,9 @@ export class HttpProvider implements ProviderInterface {
method: 'POST'
});
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
if (!response.ok) {
throw new Error(`[${response.status}]: ${response.statusText}`);
}
const result = await response.text();
+10 -4
View File
@@ -16,7 +16,7 @@ import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
import rpcHeader from '@polkadot/types-support/json/Header.004.json';
import rpcSignedBlock from '@polkadot/types-support/json/SignedBlock.004.immortal.json';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { assert, BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
import { BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
import { randomAsU8a } from '@polkadot/util-crypto';
const INTERVAL = 1000;
@@ -130,7 +130,9 @@ export class MockProvider implements ProviderInterface {
public async send <T = any> (method: string, params: unknown[]): Promise<T> {
l.debug(() => ['send', method, params]);
assert(this.requests[method], () => `provider.send: Invalid method '${method}'`);
if (!this.requests[method]) {
throw new Error(`provider.send: Invalid method '${method}'`);
}
return this.requests[method](this.db, params) as T;
}
@@ -139,7 +141,9 @@ export class MockProvider implements ProviderInterface {
public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> {
l.debug(() => ['subscribe', method, params]);
assert(this.subscriptions[method], () => `provider.subscribe: Invalid method '${method}'`);
if (!this.subscriptions[method]) {
throw new Error(`provider.subscribe: Invalid method '${method}'`);
}
const callback = params.pop() as MockStateSubscriptionCallback;
const id = ++this.subscriptionId;
@@ -160,7 +164,9 @@ export class MockProvider implements ProviderInterface {
l.debug(() => ['unsubscribe', id, sub]);
assert(sub, () => `Unable to find subscription for ${id}`);
if (!sub) {
throw new Error(`Unable to find subscription for ${id}`);
}
delete this.subscriptionMap[id];
delete this.subscriptions[sub].callbacks[id];
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.11.1' };
@@ -1,8 +1,6 @@
// 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
@@ -63,10 +61,9 @@ export function healthChecker (): HealthChecker {
return checker.responsePassThrough(jsonRpcResponse);
},
sendJsonRpc: (request) => {
assert(
sendJsonRpc,
'setSendJsonRpc must be called before sending requests'
);
if (!sendJsonRpc) {
throw new Error('setSendJsonRpc must be called before sending requests');
}
if (checker === null) {
sendJsonRpc(request);
@@ -78,14 +75,12 @@ export function healthChecker (): HealthChecker {
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'
);
if (checker !== null) {
throw new Error("Can't start the health checker multiple times in parallel");
} else if (!sendJsonRpc) {
throw new Error('setSendJsonRpc must be called before starting the health checks');
}
checker = new InnerChecker(healthCallback, sendJsonRpc);
checker.update(true);
},
@@ -216,7 +211,9 @@ class InnerChecker {
const id: string = parsedResponse.id;
// Need to remove the `extern:` prefix.
assert(id.startsWith('extern:'), 'State inconsistency in health checker');
if (!id.startsWith('extern:')) {
throw new Error('State inconsistency in health checker');
}
const newId = JSON.parse(id.slice('extern:'.length)) as string;
@@ -283,10 +280,9 @@ class InnerChecker {
};
startSubscription = (): void => {
assert(
!this.#currentSubunsubRequestId && !this.#currentSubscriptionId,
'Internal error in health checker'
);
if (this.#currentSubunsubRequestId || this.#currentSubscriptionId) {
throw new Error('Internal error in health checker');
}
this.#currentSubunsubRequestId = 'health-checker:'.concat(
this.#nextRequestId.toString()
@@ -303,10 +299,9 @@ class InnerChecker {
};
endSubscription = (): void => {
assert(
!this.#currentSubunsubRequestId && this.#currentSubscriptionId,
'Internal error in health checker'
);
if (this.#currentSubunsubRequestId || !this.#currentSubscriptionId) {
throw new Error('Internal error in health checker');
}
this.#currentSubunsubRequestId = 'health-checker:'.concat(
this.#nextRequestId.toString()
@@ -7,7 +7,7 @@ import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, Pro
import { Chain, createScClient, ScClient, WellKnownChain } from '@substrate/connect';
import EventEmitter from 'eventemitter3';
import { assert, isError } from '@polkadot/util';
import { isError } from '@polkadot/util';
import { RpcCoder } from '../coder';
import { healthChecker } from './Health';
@@ -71,7 +71,9 @@ export class ScProvider implements ProviderInterface {
// Config details can be found in @substrate/connect repo following the link:
// https://github.com/paritytech/substrate-connect/blob/main/packages/connect/src/connector/index.ts
async connect (config?: ScConfig): Promise<void> {
assert(!this.isConnected, 'Already connected!');
if (this.isConnected) {
throw new Error('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
@@ -91,7 +93,10 @@ export class ScProvider implements ProviderInterface {
? scClients.get(this.#sharedSandbox)
: createScClient(config);
assert(client, 'Unkown ScProvider!');
if (!client) {
throw new Error('Unkown ScProvider!');
}
scClients.set(this, client);
const hc = healthChecker();
@@ -156,7 +161,9 @@ export class ScProvider implements ProviderInterface {
const stale = staleSubscriptions.pop();
assert(stale, 'Unable to get stale subscription');
if (!stale) {
throw new Error('Unable to get stale subscription');
}
const { id, unsubscribeMethod } = stale;
@@ -264,7 +271,9 @@ export class ScProvider implements ProviderInterface {
}
public async send<T = any> (method: string, params: unknown[]): Promise<T> {
assert(this.isConnected && this.#chain, 'Provider is not connected');
if (!this.isConnected || !this.#chain) {
throw new Error('Provider is not connected');
}
const chain = await this.#chain;
const [id, json] = this.#coder.encodeJson(method, params);
@@ -302,10 +311,9 @@ export class ScProvider implements ProviderInterface {
params: any[],
callback: ProviderInterfaceCallback
): Promise<number | string> {
assert(
subscriptionUnsubscriptionMethods.has(method),
`Unsupported subscribe method: ${method}`
);
if (!subscriptionUnsubscriptionMethods.has(method)) {
throw new Error(`Unsupported subscribe method: ${method}`);
}
const id = await this.send<number | string>(method, params);
const subscriptionId = `${type}::${id}`;
@@ -320,7 +328,9 @@ export class ScProvider implements ProviderInterface {
const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method);
assert(unsubscribeMethod, 'Invalid unsubscribe method found');
if (!unsubscribeMethod) {
throw new Error('Invalid unsubscribe method found');
}
this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]);
@@ -332,10 +342,9 @@ export class ScProvider implements ProviderInterface {
method: string,
id: number | string
): Promise<boolean> {
assert(
this.isConnected,
'Provider is not connected'
);
if (!this.isConnected) {
throw new Error('Provider is not connected');
}
const subscriptionId = `${type}::${id}`;
+13 -5
View File
@@ -7,7 +7,7 @@ import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, Pro
import EventEmitter from 'eventemitter3';
import { assert, isChildClass, isNull, isUndefined, logger, objectSpread } from '@polkadot/util';
import { isChildClass, isNull, isUndefined, logger, objectSpread } from '@polkadot/util';
import { xglobal } from '@polkadot/x-global';
import { WebSocket } from '@polkadot/x-ws';
@@ -122,10 +122,14 @@ export class WsProvider implements ProviderInterface {
? endpoint
: [endpoint];
assert(endpoints.length !== 0, 'WsProvider requires at least one Endpoint');
if (endpoints.length === 0) {
throw new Error('WsProvider requires at least one Endpoint');
}
endpoints.forEach((endpoint) => {
assert(/^(wss|ws):\/\//.test(endpoint), () => `Endpoint should start with 'ws://', received '${endpoint}'`);
if (!/^(wss|ws):\/\//.test(endpoint)) {
throw new Error(`Endpoint should start with 'ws://', received '${endpoint}'`);
}
});
this.#eventemitter = new EventEmitter();
@@ -319,7 +323,9 @@ export class WsProvider implements ProviderInterface {
async #send <T> (id: number, body: string, method: string, params: unknown[], subscription?: SubscriptionHandler): Promise<T> {
return new Promise<T>((resolve, reject): void => {
try {
assert(this.isConnected && !isNull(this.#websocket), 'WebSocket is not connected');
if (!this.isConnected || this.#websocket === null) {
throw new Error('WebSocket is not connected');
}
const callback = (error?: Error | null, result?: T): void => {
error
@@ -531,7 +537,9 @@ export class WsProvider implements ProviderInterface {
};
#onSocketOpen = (): boolean => {
assert(!isNull(this.#websocket), 'WebSocket cannot be null in onOpen');
if (this.#websocket === null) {
throw new Error('WebSocket cannot be null in onOpen');
}
l.debug(() => ['connected to', this.#endpoints[this.#endpointIndex]]);
+16 -15
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,20 +30,21 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
},
"dependencies": {
"@babel/core": "^7.18.5",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.8.2",
"@polkadot/api-augment": "8.8.2",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/rpc-provider": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-augment": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/types-create": "8.8.2",
"@polkadot/types-support": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/x-ws": "^9.4.1",
"@babel/core": "^7.18.6",
"@babel/register": "^7.18.6",
"@babel/runtime": "^7.18.6",
"@polkadot/api": "8.11.1",
"@polkadot/api-augment": "8.11.1",
"@polkadot/rpc-augment": "8.11.1",
"@polkadot/rpc-provider": "8.11.1",
"@polkadot/types": "8.11.1",
"@polkadot/types-augment": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/types-create": "8.11.1",
"@polkadot/types-support": "8.11.1",
"@polkadot/util": "^9.7.1",
"@polkadot/util-crypto": "^9.7.1",
"@polkadot/x-ws": "^9.7.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.5.1"
+25 -7
View File
@@ -9,10 +9,12 @@ import yargs from 'yargs';
import { Definitions } from '@polkadot/types/types';
import { formatNumber } from '@polkadot/util';
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util';
function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void {
type Version = { apis: [HexString, number][] };
function generate (metaHex: HexString, version: Version | null, pkg: string | undefined, output: string, isStrict?: boolean): void {
console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`);
const outputPath = assertDir(path.join(process.cwd(), output));
@@ -46,12 +48,15 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
generateDefaultQuery(path.join(outputPath, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
generateDefaultRpc(path.join(outputPath, 'augment-api-rpc.ts'), extraTypes);
generateDefaultTx(path.join(outputPath, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
generateDefaultCalls(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, version, extraTypes, isStrict, customLookupDefinitions);
writeFile(path.join(outputPath, 'augment-api.ts'), (): string =>
[
HEADER('chain'),
...[
...['consts', 'errors', 'events', 'query', 'tx', 'rpc'].filter((key) => !!key).map((key) => `./augment-api-${key}`)
...['consts', 'errors', 'events', 'query', 'tx', 'rpc', 'runtime']
.filter((key) => !!key)
.map((key) => `./augment-api-${key}`)
].map((path) => `import '${path}';\n`)
].join('')
);
@@ -59,10 +64,10 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
process.exit(0);
}
type ArgV = { endpoint: string; output: string; package?: string; strict?: boolean };
type ArgV = { endpoint: string; output: string; package?: string; strict?: boolean, version?: string };
export function main (): void {
const { endpoint, output, package: pkg, strict: isStrict } = yargs.strict().options({
const { endpoint, output, package: pkg, strict: isStrict, version } = yargs.strict().options({
endpoint: {
description: 'The endpoint to connect to (e.g. wss://kusama-rpc.polkadot.io) or relative path to a file containing the JSON output of an RPC state_getMetadata call',
required: true,
@@ -80,15 +85,28 @@ export function main (): void {
strict: {
description: 'Turns on strict mode, no output of catch-all generic versions',
type: 'boolean'
},
version: {
description: 'Pass through a version JSON (if endpoint is non-wss)',
type: 'string'
}
}).argv as ArgV;
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
getMetadataViaWs(endpoint)
.then((metadata) => generate(metadata, pkg, output, isStrict))
.then(({ metadata, version }) => generate(metadata, version, pkg, output, isStrict))
.catch(() => process.exit(1));
} else {
let rtv: Version | null = null;
if (version) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
rtv = (require(assertFile(path.join(process.cwd(), version))) as Record<string, Version>).result;
}
// eslint-disable-next-line @typescript-eslint/no-var-requires
generate((require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result, pkg, output, isStrict);
const metadata = (require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result;
generate(metadata, rtv, pkg, output, isStrict);
}
}
+1 -1
View File
@@ -72,7 +72,7 @@ export function main (): void {
if (endpoint) {
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
getMetadataViaWs(endpoint)
.then((metadata) => generateDefaultLookup(inputPath, metadata))
.then(({ metadata }) => generateDefaultLookup(inputPath, metadata))
.catch(() => process.exit(1));
} else {
// eslint-disable-next-line @typescript-eslint/no-var-requires
+1
View File
@@ -8,5 +8,6 @@ export { generateDefaultInterface } from './interfaceRegistry';
export { generateDefaultLookup } from './lookup';
export { generateDefaultQuery } from './query';
export { generateDefaultRpc } from './rpc';
export { generateDefaultCalls } from './runtime';
export { generateDefaultTsDef } from './tsDef';
export { generateDefaultTx } from './tx';
+2 -2
View File
@@ -30,7 +30,7 @@ const StorageKeyType = 'StorageKey | string | Uint8Array | any';
const generateRpcTypesTemplate = Handlebars.compile(readTemplate('rpc'));
/** @internal */
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: ExtraTypes = {}): void {
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: ExtraTypes): void {
writeFile(dest, (): string => {
const allTypes: ExtraTypes = { '@polkadot/types/interfaces': importDefinitions, ...extraTypes };
const imports = createImports(allTypes);
@@ -46,7 +46,7 @@ export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Rec
const additional: Record<string, ModuleDef> = {};
const modules = rpcKeys.map((sectionFullName) => {
const rpc = definitions[sectionFullName].rpc;
const rpc = definitions[sectionFullName].rpc || {};
const section = sectionFullName.split('/').pop();
const allMethods = Object.keys(rpc).sort().map((methodName) => {
+159
View File
@@ -0,0 +1,159 @@
// Copyright 2017-2022 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TypeRegistry } from '@polkadot/types/create';
import type { DefinitionCallNamed, Definitions } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import lookupDefinitions from '@polkadot/types-augment/lookup/definitions';
import { objectSpread, stringCamelCase } from '@polkadot/util';
import { blake2AsHex } from '@polkadot/util-crypto';
import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util';
type Apis = [HexString, number][];
const generateCallsTypesTemplate = Handlebars.compile(readTemplate('calls'));
/** @internal */
function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<string, Record<string, DefinitionCallNamed>> {
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
const all = Object.values(defs);
for (let j = 0; j < all.length; j++) {
const set = all[j].runtime;
if (set) {
const sections = Object.entries(set);
for (let i = 0; i < sections.length; i++) {
const [_section, sec] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const api = apis && apis.find(([h]) => h === sectionHash);
if (api) {
const ver = sec.find(({ version }) => version === api[1]);
if (ver) {
const methods = Object.entries(ver.methods);
if (methods.length) {
const section = stringCamelCase(_section);
if (!named[section]) {
named[section] = {};
}
for (let m = 0; m < methods.length; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
named[section][method] = objectSpread({ method, name: `${_section}_${method}`, section, sectionHash, version: ver.version }, def);
}
}
} else {
console.warn(`Unable to find matching version for runtime ${_section}, expected ${api[1]}`);
}
}
}
}
}
return named;
}
/** @internal */
export function generateCallTypes (registry: TypeRegistry, dest: string, apis: Apis | null, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
writeFile(dest, (): string => {
const allTypes: ExtraTypes = {
'@polkadot/types-augment': {
lookup: {
...lookupDefinitions,
...customLookupDefinitions
}
},
'@polkadot/types/interfaces': defaultDefs,
...extraTypes
};
const imports = createImports(allTypes);
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
}, {});
const definitions = getDefs(apis, imports.definitions as Record<string, Definitions>);
const callKeys = Object.keys(definitions);
const modules = callKeys.map((section) => {
const calls = definitions[section];
const allMethods = Object.keys(calls).sort().map((methodName) => {
const def = calls[methodName];
setImports(allDefs, imports, [def.type]);
const args = def.params.map((param) => {
const similarTypes = getSimilarTypes(registry, imports.definitions, param.type, imports);
setImports(allDefs, imports, [param.type, ...similarTypes]);
return `${param.name}: ${similarTypes.join(' | ')}`;
});
return {
args: args.join(', '),
docs: [def.description],
name: methodName,
sectionHash: def.sectionHash,
sectionName: def.section,
sectionVersion: def.version,
type: formatType(registry, allDefs, def.type, imports)
};
}).sort((a, b) => a.name.localeCompare(b.name));
return {
items: allMethods,
name: section || 'unknown',
sectionHash: allMethods.length && allMethods[0].sectionHash,
sectionName: allMethods.length && allMethods[0].sectionName,
sectionVersion: allMethods.length && allMethods[0].sectionVersion
};
}).filter(({ items }) => items.length).sort((a, b) => a.name.localeCompare(b.name));
if (modules.length) {
imports.typesTypes.Observable = true;
}
return generateCallsTypesTemplate({
headerType: 'chain',
imports,
isStrict,
modules,
types: [
...Object.keys(imports.localTypes).sort().map((packagePath): { file: string; types: string[] } => ({
file: packagePath.replace('@polkadot/types-augment', '@polkadot/types'),
types: Object.keys(imports.localTypes[packagePath])
})),
{
file: '@polkadot/api-base/types',
types: ['ApiTypes']
}
]
});
});
}
export function generateDefaultCalls (dest: string, data: HexString, rtVersion: { apis: Apis } | null = null, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
const { registry } = initMeta(data, extraTypes);
generateCallTypes(
registry,
dest,
rtVersion && rtVersion.apis,
extraTypes,
isStrict,
customLookupDefinitions
);
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2022 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
export type ExtraTypes = Record<string, Record<string, { types: Record<string, any> }>>;
export type ExtraTypes = Record<string, Record<string, { runtime?: Record<string, any>, types: Record<string, any> }>>;
+6 -1
View File
@@ -6,11 +6,15 @@ import type { HexString } from '@polkadot/util/types';
import kusama from '@polkadot/types-support/metadata/static-kusama';
import polkadot from '@polkadot/types-support/metadata/static-polkadot';
import substrate from '@polkadot/types-support/metadata/static-substrate';
import kusamaVer from '@polkadot/types-support/versions/kusama';
import polkadotVer from '@polkadot/types-support/versions/polkadot';
import substrateVer from '@polkadot/types-support/versions/substrate';
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate';
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate';
const BASE = 'packages/api-augment/src';
const METAS = Object.entries({ kusama, polkadot, substrate }) as [string, HexString][];
const VERS = { kusama: kusamaVer, polkadot: polkadotVer, substrate: substrateVer };
export function main (): void {
generateDefaultInterface();
@@ -27,5 +31,6 @@ export function main (): void {
generateDefaultEvents(`${BASE}/${name}/events.ts`, staticMeta);
generateDefaultQuery(`${BASE}/${name}/query.ts`, staticMeta);
generateDefaultTx(`${BASE}/${name}/tx.ts`, staticMeta);
generateDefaultCalls(`${BASE}/${name}/runtime.ts`, staticMeta, VERS[name as keyof typeof VERS] as unknown as { apis: [HexString, number][] });
}
}
+2 -2
View File
@@ -138,10 +138,10 @@ function addRpc (): string {
.reduce((all: Section[], _sectionName): Section[] => {
const section = definitions[_sectionName as 'babe'];
Object.keys(section.rpc)
Object.keys(section.rpc || {})
.sort()
.forEach((methodName) => {
const method = section.rpc[methodName];
const method = (section.rpc || {})[methodName];
const sectionName = method.aliasSection || _sectionName;
const topName = method.aliasSection ? `${_sectionName}/${method.aliasSection}` : _sectionName;
let container = all.find(({ name }) => name === topName);
+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: '8.8.2' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.11.1' };
+23
View File
@@ -0,0 +1,23 @@
{{> header }}
{{{ importsAll }}}
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
{{#each modules}}
/** {{{sectionHash}}}/{{{sectionVersion}}} */
{{{name}}}: {
{{#each items}}
{{> docs}}
{{{name}}}: AugmentedCall<ApiType, ({{{args}}}) => Observable<{{{type}}}>>;
{{/each}}
{{#unless @root.isStrict}}
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
{{/unless}}
};
{{/each}}
} // AugmentedCalls
} // declare module
+1 -1
View File
@@ -31,7 +31,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
if (type === 'Extrinsic') {
setImports(definitions, imports, ['IExtrinsic']);
return ['IExtrinsic'];
return ['Extrinsic', 'IExtrinsic', 'string', 'Uint8Array'];
} else if (type === 'Keys') {
// This one is weird... surely it should popup as a Tuple? (but either way better as defined hex)
return ['Keys', 'string', 'Uint8Array'];
+3 -3
View File
@@ -4,8 +4,6 @@
import fs from 'fs';
import path from 'path';
import { assert } from '@polkadot/util';
import { packageInfo } from '../packageInfo';
export function writeFile (dest: string, generator: () => string, noLog?: boolean): void {
@@ -35,7 +33,9 @@ export function readTemplate (template: string): string {
.map((p) => path.join(rootDir, p, `${template}.hbs`))
.find((p) => fs.existsSync(p));
assert(file, `Unable to locate ${template}.hbs from ${rootDir}`);
if (!file) {
throw new Error(`Unable to locate ${template}.hbs from ${rootDir}`);
}
return fs.readFileSync(file).toString();
}
+2 -2
View File
@@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Registry } from '@polkadot/types/types';
import type { AnyString, Registry } from '@polkadot/types/types';
import type { TypeDef } from '@polkadot/types-create/types';
import Handlebars from 'handlebars';
@@ -270,7 +270,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
*/
/** @internal */
// eslint-disable-next-line @typescript-eslint/ban-types
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: string | String | TypeDef, imports: TypeImports, withShortcut = false): string {
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: AnyString | TypeDef, imports: TypeImports, withShortcut = false): string {
let typeDef: TypeDef;
if (isString(type)) {
+15 -3
View File
@@ -5,7 +5,7 @@ import type { HexString } from '@polkadot/util/types';
import { WebSocket } from '@polkadot/x-ws';
export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
async function getWsData <T> (endpoint: string, method: 'state_getMetadata' | 'state_getRuntimeVersion'): Promise<T> {
return new Promise((resolve): void => {
try {
const websocket = new WebSocket(endpoint);
@@ -28,11 +28,11 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
websocket.onopen = (): void => {
console.log('connected');
websocket.send('{"id":"1","jsonrpc":"2.0","method":"state_getMetadata","params":[]}');
websocket.send(`{"id":"1","jsonrpc":"2.0","method":"${method}","params":[]}`);
};
websocket.onmessage = (message: { data: string }): void => {
resolve((JSON.parse(message.data) as { result: HexString }).result);
resolve((JSON.parse(message.data) as { result: T }).result);
websocket.close();
};
} catch (error) {
@@ -40,3 +40,15 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
}
});
}
export async function getMetadataViaWs (endpoint: string): Promise<{ metadata: HexString, version: { apis: [HexString, number][] } }> {
return Promise
.all([
getWsData<HexString>(endpoint, 'state_getMetadata'),
getWsData<{ apis: [HexString, number][] }>(endpoint, 'state_getRuntimeVersion')
])
.then(([metadata, version]) => ({
metadata,
version
}));
}
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
"@babel/runtime": "^7.18.6",
"@polkadot/types": "8.11.1",
"@polkadot/types-codec": "8.11.1",
"@polkadot/util": "^9.7.1"
}
}
+5 -5
View File
@@ -5,13 +5,13 @@
export default {
/**
* Lookup79: kusama_runtime::ProxyType
* Lookup80: kusama_runtime::ProxyType
**/
KusamaRuntimeProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
},
/**
* Lookup258: kusama_runtime::SessionKeys
* Lookup261: kusama_runtime::SessionKeys
**/
KusamaRuntimeSessionKeys: {
grandpa: 'SpFinalityGrandpaAppPublic',
@@ -22,7 +22,7 @@ export default {
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
},
/**
* Lookup332: kusama_runtime::OriginCaller
* Lookup335: kusama_runtime::OriginCaller
**/
KusamaRuntimeOriginCaller: {
_enum: {
@@ -129,7 +129,7 @@ export default {
}
},
/**
* Lookup398: kusama_runtime::NposCompactSolution24
* Lookup401: kusama_runtime::NposCompactSolution24
**/
KusamaRuntimeNposCompactSolution24: {
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
@@ -158,7 +158,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup774: kusama_runtime::Runtime
* Lookup779: kusama_runtime::Runtime
**/
KusamaRuntimeRuntime: 'Null'
};
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -6,7 +6,7 @@ declare module '@polkadot/types/lookup' {
import type { ITuple } from '@polkadot/types-codec/types';
import type { PerU16 } from '@polkadot/types/interfaces/runtime';
/** @name KusamaRuntimeProxyType (79) */
/** @name KusamaRuntimeProxyType (80) */
export interface KusamaRuntimeProxyType extends Enum {
readonly isAny: boolean;
readonly isNonTransfer: boolean;
@@ -19,7 +19,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
}
/** @name KusamaRuntimeSessionKeys (258) */
/** @name KusamaRuntimeSessionKeys (261) */
export interface KusamaRuntimeSessionKeys extends Struct {
readonly grandpa: SpFinalityGrandpaAppPublic;
readonly babe: SpConsensusBabeAppPublic;
@@ -29,7 +29,7 @@ declare module '@polkadot/types/lookup' {
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
}
/** @name KusamaRuntimeOriginCaller (332) */
/** @name KusamaRuntimeOriginCaller (335) */
export interface KusamaRuntimeOriginCaller extends Enum {
readonly isSystem: boolean;
readonly asSystem: FrameSupportDispatchRawOrigin;
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
}
/** @name KusamaRuntimeNposCompactSolution24 (398) */
/** @name KusamaRuntimeNposCompactSolution24 (401) */
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name KusamaRuntimeRuntime (774) */
/** @name KusamaRuntimeRuntime (779) */
export type KusamaRuntimeRuntime = Null;
} // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/types-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.8.2' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.11.1' };
@@ -2,15 +2,17 @@
/* eslint-disable */
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter } from '@polkadot/types/interfaces/benchmark';
import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder';
import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
@@ -20,13 +22,13 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import type { BlockStats } from '@polkadot/types/interfaces/dev';
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt';
@@ -34,28 +36,29 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A
import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity';
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { Approvals } from '@polkadot/types/interfaces/poll';
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue';
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
@@ -94,6 +97,7 @@ declare module '@polkadot/types/types/registry' {
AnySignature: AnySignature;
ApiId: ApiId;
ApplyExtrinsicResult: ApplyExtrinsicResult;
ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6;
ApprovalFlag: ApprovalFlag;
Approvals: Approvals;
ArithmeticError: ArithmeticError;
@@ -129,6 +133,8 @@ declare module '@polkadot/types/types/registry' {
BabeBlockWeight: BabeBlockWeight;
BabeEpochConfiguration: BabeEpochConfiguration;
BabeEquivocationProof: BabeEquivocationProof;
BabeGenesisConfiguration: BabeGenesisConfiguration;
BabeGenesisConfigurationV1: BabeGenesisConfigurationV1;
BabeWeight: BabeWeight;
BackedCandidate: BackedCandidate;
Balance: Balance;
@@ -136,12 +142,18 @@ declare module '@polkadot/types/types/registry' {
BalanceLockTo212: BalanceLockTo212;
BalanceOf: BalanceOf;
BalanceStatus: BalanceStatus;
BeefyAuthoritySet: BeefyAuthoritySet;
BeefyCommitment: BeefyCommitment;
BeefyId: BeefyId;
BeefyKey: BeefyKey;
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
BeefyPayload: BeefyPayload;
BeefyPayloadId: BeefyPayloadId;
BeefySignedCommitment: BeefySignedCommitment;
BenchmarkConfig: BenchmarkConfig;
BenchmarkList: BenchmarkList;
BenchmarkMetadata: BenchmarkMetadata;
BenchmarkParameter: BenchmarkParameter;
Bid: Bid;
Bidder: Bidder;
BidKind: BidKind;
@@ -185,6 +197,7 @@ declare module '@polkadot/types/types/registry' {
CallOrigin: CallOrigin;
CandidateCommitments: CandidateCommitments;
CandidateDescriptor: CandidateDescriptor;
CandidateEvent: CandidateEvent;
CandidateHash: CandidateHash;
CandidateInfo: CandidateInfo;
CandidatePendingAvailability: CandidatePendingAvailability;
@@ -194,6 +207,7 @@ declare module '@polkadot/types/types/registry' {
ChainType: ChainType;
ChangesTrieConfiguration: ChangesTrieConfiguration;
ChangesTrieSignal: ChangesTrieSignal;
CheckInherentsResult: CheckInherentsResult;
ClassDetails: ClassDetails;
ClassId: ClassId;
ClassMetadata: ClassMetadata;
@@ -203,6 +217,8 @@ declare module '@polkadot/types/types/registry' {
CodeUploadRequest: CodeUploadRequest;
CodeUploadResult: CodeUploadResult;
CodeUploadResultValue: CodeUploadResultValue;
CollationInfo: CollationInfo;
CollationInfoV1: CollationInfoV1;
CollatorId: CollatorId;
CollatorSignature: CollatorSignature;
CollectiveOrigin: CollectiveOrigin;
@@ -286,6 +302,7 @@ declare module '@polkadot/types/types/registry' {
CoreAssignment: CoreAssignment;
CoreIndex: CoreIndex;
CoreOccupied: CoreOccupied;
CoreState: CoreState;
CrateVersion: CrateVersion;
CreatedBlock: CreatedBlock;
Data: Data;
@@ -305,14 +322,17 @@ declare module '@polkadot/types/types/registry' {
DispatchClass: DispatchClass;
DispatchError: DispatchError;
DispatchErrorModule: DispatchErrorModule;
DispatchErrorModulePre6: DispatchErrorModulePre6;
DispatchErrorModuleU8: DispatchErrorModuleU8;
DispatchErrorModuleU8a: DispatchErrorModuleU8a;
DispatchErrorPre6: DispatchErrorPre6;
DispatchErrorTo198: DispatchErrorTo198;
DispatchFeePayment: DispatchFeePayment;
DispatchInfo: DispatchInfo;
DispatchInfoTo190: DispatchInfoTo190;
DispatchInfoTo244: DispatchInfoTo244;
DispatchOutcome: DispatchOutcome;
DispatchOutcomePre6: DispatchOutcomePre6;
DispatchResult: DispatchResult;
DispatchResultOf: DispatchResultOf;
DispatchResultTo198: DispatchResultTo198;
@@ -336,6 +356,7 @@ declare module '@polkadot/types/types/registry' {
ElectionStatus: ElectionStatus;
EncodedFinalityProofs: EncodedFinalityProofs;
EncodedJustification: EncodedJustification;
Epoch: Epoch;
EpochAuthorship: EpochAuthorship;
Era: Era;
EraIndex: EraIndex;
@@ -360,6 +381,7 @@ declare module '@polkadot/types/types/registry' {
EthereumAddress: EthereumAddress;
EthereumLookupSource: EthereumLookupSource;
EthereumSignature: EthereumSignature;
EthFeeHistory: EthFeeHistory;
EthFilter: EthFilter;
EthFilterAddress: EthFilterAddress;
EthFilterChanges: EthFilterChanges;
@@ -369,6 +391,8 @@ declare module '@polkadot/types/types/registry' {
EthHeader: EthHeader;
EthLog: EthLog;
EthReceipt: EthReceipt;
EthReceiptV0: EthReceiptV0;
EthReceiptV3: EthReceiptV3;
EthRichBlock: EthRichBlock;
EthRichHeader: EthRichHeader;
EthStorageProof: EthStorageProof;
@@ -396,6 +420,8 @@ declare module '@polkadot/types/types/registry' {
EventMetadataV9: EventMetadataV9;
EventRecord: EventRecord;
EvmAccount: EvmAccount;
EvmCallInfo: EvmCallInfo;
EvmCreateInfo: EvmCreateInfo;
EvmLog: EvmLog;
EvmVicinity: EvmVicinity;
ExecReturnValue: ExecReturnValue;
@@ -424,6 +450,10 @@ declare module '@polkadot/types/types/registry' {
ExtrinsicsWeight: ExtrinsicsWeight;
ExtrinsicUnknown: ExtrinsicUnknown;
ExtrinsicV4: ExtrinsicV4;
f32: f32;
F32: F32;
f64: f64;
F64: F64;
FeeDetails: FeeDetails;
Fixed128: Fixed128;
Fixed64: Fixed64;
@@ -468,6 +498,7 @@ declare module '@polkadot/types/types/registry' {
GrandpaPrevote: GrandpaPrevote;
GrandpaSignedPrecommit: GrandpaSignedPrecommit;
GroupIndex: GroupIndex;
GroupRotationInfo: GroupRotationInfo;
H1024: H1024;
H128: H128;
H160: H160;
@@ -524,6 +555,8 @@ declare module '@polkadot/types/types/registry' {
Index: Index;
IndicesLookupSource: IndicesLookupSource;
IndividualExposure: IndividualExposure;
InherentData: InherentData;
InherentIdentifier: InherentIdentifier;
InitializationData: InitializationData;
InstanceDetails: InstanceDetails;
InstanceId: InstanceId;
@@ -594,8 +627,14 @@ declare module '@polkadot/types/types/registry' {
MetadataV14: MetadataV14;
MetadataV9: MetadataV9;
MigrationStatusResult: MigrationStatusResult;
MmrBatchProof: MmrBatchProof;
MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf;
MmrError: MmrError;
MmrLeafBatchProof: MmrLeafBatchProof;
MmrLeafIndex: MmrLeafIndex;
MmrLeafProof: MmrLeafProof;
MmrNodeIndex: MmrNodeIndex;
MmrProof: MmrProof;
MmrRootHash: MmrRootHash;
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
ModuleConstantMetadataV11: ModuleConstantMetadataV11;
@@ -646,11 +685,16 @@ declare module '@polkadot/types/types/registry' {
NominatorIndexCompact: NominatorIndexCompact;
NotConnectedPeer: NotConnectedPeer;
Null: Null;
OccupiedCore: OccupiedCore;
OccupiedCoreAssumption: OccupiedCoreAssumption;
OffchainAccuracy: OffchainAccuracy;
OffchainAccuracyCompact: OffchainAccuracyCompact;
OffenceDetails: OffenceDetails;
Offender: Offender;
OldV1SessionInfo: OldV1SessionInfo;
OpaqueCall: OpaqueCall;
OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof;
OpaqueMetadata: OpaqueMetadata;
OpaqueMultiaddr: OpaqueMultiaddr;
OpaqueNetworkState: OpaqueNetworkState;
OpaquePeerId: OpaquePeerId;
@@ -751,6 +795,7 @@ declare module '@polkadot/types/types/registry' {
ProxyDefinition: ProxyDefinition;
ProxyState: ProxyState;
ProxyType: ProxyType;
PvfCheckStatement: PvfCheckStatement;
QueryId: QueryId;
QueryStatus: QueryStatus;
QueueConfigData: QueueConfigData;
@@ -821,8 +866,11 @@ declare module '@polkadot/types/types/registry' {
RuntimeVersion: RuntimeVersion;
RuntimeVersionApi: RuntimeVersionApi;
RuntimeVersionPartial: RuntimeVersionPartial;
RuntimeVersionPre3: RuntimeVersionPre3;
RuntimeVersionPre4: RuntimeVersionPre4;
Schedule: Schedule;
Scheduled: Scheduled;
ScheduledCore: ScheduledCore;
ScheduledTo254: ScheduledTo254;
SchedulePeriod: SchedulePeriod;
SchedulePriority: SchedulePriority;
@@ -830,6 +878,7 @@ declare module '@polkadot/types/types/registry' {
ScheduleTo258: ScheduleTo258;
ScheduleTo264: ScheduleTo264;
Scheduling: Scheduling;
ScrapedOnChainVotes: ScrapedOnChainVotes;
Seal: Seal;
SealV0: SealV0;
SeatHolder: SeatHolder;
@@ -918,6 +967,7 @@ declare module '@polkadot/types/types/registry' {
SlashingSpansTo204: SlashingSpansTo204;
SlashJournalEntry: SlashJournalEntry;
Slot: Slot;
SlotDuration: SlotDuration;
SlotNumber: SlotNumber;
SlotRange: SlotRange;
SlotRange10: SlotRange10;
@@ -966,6 +1016,7 @@ declare module '@polkadot/types/types/registry' {
StorageHasherV13: StorageHasherV13;
StorageHasherV14: StorageHasherV14;
StorageHasherV9: StorageHasherV9;
StorageInfo: StorageInfo;
StorageKey: StorageKey;
StorageKind: StorageKind;
StorageMetadataV10: StorageMetadataV10;
@@ -995,11 +1046,15 @@ declare module '@polkadot/types/types/registry' {
TraceError: TraceError;
TransactionalError: TransactionalError;
TransactionInfo: TransactionInfo;
TransactionLongevity: TransactionLongevity;
TransactionPriority: TransactionPriority;
TransactionSource: TransactionSource;
TransactionStorageProof: TransactionStorageProof;
TransactionTag: TransactionTag;
TransactionV0: TransactionV0;
TransactionV1: TransactionV1;
TransactionV2: TransactionV2;
TransactionValidity: TransactionValidity;
TransactionValidityError: TransactionValidityError;
TransientValidationData: TransientValidationData;
TreasuryProposal: TreasuryProposal;
@@ -1046,10 +1101,12 @@ declare module '@polkadot/types/types/registry' {
ValidatorPrefsTo196: ValidatorPrefsTo196;
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
ValidatorSet: ValidatorSet;
ValidatorSetId: ValidatorSetId;
ValidatorSignature: ValidatorSignature;
ValidDisputeStatementKind: ValidDisputeStatementKind;
ValidityAttestation: ValidityAttestation;
ValidTransaction: ValidTransaction;
VecInboundHrmpMessage: VecInboundHrmpMessage;
VersionedMultiAsset: VersionedMultiAsset;
VersionedMultiAssets: VersionedMultiAssets;
File diff suppressed because one or more lines are too long
+8 -7
View File
@@ -20,16 +20,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"version": "8.11.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/util": "^9.4.1"
"@babel/runtime": "^7.18.6",
"@polkadot/util": "^9.7.1",
"@polkadot/x-bigint": "^9.7.1"
},
"devDependencies": {
"@polkadot/types": "8.8.2",
"@polkadot/types-augment": "8.8.2",
"@polkadot/types-support": "8.8.2",
"@polkadot/util-crypto": "^9.4.1"
"@polkadot/types": "8.11.1",
"@polkadot/types-augment": "8.11.1",
"@polkadot/types-support": "8.11.1",
"@polkadot/util-crypto": "^9.7.1"
}
}
@@ -20,6 +20,14 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
public createdAtHash?: IU8a;
/**
* @description This ensures that operators such as clice, filter, map, etc. return
* new Array instances (without this we need to apply overrides)
*/
static get [Symbol.species] (): typeof Array {
return Array;
}
protected constructor (registry: Registry, length: number) {
super(length);
@@ -73,14 +81,14 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
public inspect (): Inspect {
return {
inner: this.inspectInner(),
outer: [compactToU8a(this.length)]
};
}
inspectInner (): Inspect[] {
public inspectInner (): Inspect[] {
const inner = new Array<Inspect>(this.length);
for (let i = 0; i < this.length; i++) {
@@ -169,43 +177,4 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
return encoded;
}
// Below are methods that we override. When we do a `new Vec(...).map()`,
// we want it to return an Array. We only override the methods that return a
// new instance.
/**
* @description Concatenates two arrays
*/
public override concat (other: T[]): T[] {
return this.toArray().concat(other instanceof AbstractArray ? other.toArray() : other);
}
/**
* @description Filters the array with the callback
*/
public override filter (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: unknown): T[] {
return this.toArray().filter(callbackfn, thisArg);
}
/**
* @description Maps the array with the callback
*/
public override map<U> (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: unknown): U[] {
return this.toArray().map(callbackfn, thisArg);
}
/**
* @description Checks if the array includes a specific value
*/
public override includes (check: unknown): boolean {
return this.some((value: T) => value.eq(check));
}
/**
* @description Returns a slice of an array
*/
public override slice (start?: number, end?: number): T[] {
return this.toArray().slice(start, end);
}
}

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