Compare commits

..
87 Commits
Author SHA1 Message Date
github-actions[bot] 3f8e4ce133 [CI Skip] release/stable 7.8.1
skip-checks: true
2022-02-14 12:55:48 +00:00
Jaco 39c99083bc 7.8.1 (#4564) 2022-02-14 14:46:24 +02:00
github-actions[bot] 46aa427f98 [CI Skip] release/beta 7.7.2-17
skip-checks: true
2022-02-14 05:51:41 +00:00
Jaco 6336fc0787 Bump common (#4563) 2022-02-14 07:43:13 +02:00
github-actions[bot] b0532be7df [CI Skip] release/beta 7.7.2-16
skip-checks: true
2022-02-13 12:55:58 +00:00
Jaco e7a5b015e9 Don't run scripts on CI (#4562) 2022-02-13 14:47:33 +02:00
github-actions[bot] 2f07f18a5a [CI Skip] release/beta 7.7.2-15
skip-checks: true
2022-02-11 07:49:46 +00:00
Jaco c92d5b7eb0 Bump metadata (#4558) 2022-02-11 09:40:07 +02:00
github-actions[bot] e340a99eda [CI Skip] release/beta 7.7.2-14
skip-checks: true
2022-02-10 08:29:28 +00:00
Jaco f169ca08a8 Expose txIndex on extrinsic results (#4556)
* Expose txIndex on extrinsic results

* CHANGELOG

* optional txIndex

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

* Corrected InstantiateReturnValue

* enum, set fallbacks

* set definition

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

* Additional

* Adjust

* LookupSource

* Some tests

* All base tests

* Tests for BTree{Map, Set}

* Additional tests

* All extended type tests

* Additional

* Native tests

* Adjust

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

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

* Adjust typings
2022-02-07 12:44:17 +02:00
github-actions[bot] ca692cc7c0 [CI Skip] release/stable 7.7.1
skip-checks: true
2022-02-06 07:05:44 +00:00
Jaco f5f5b540af 7.7.1 (#4535) 2022-02-06 08:56:28 +02:00
github-actions[bot] 8b3b1b4611 [CI Skip] release/beta 7.6.2-9
skip-checks: true
2022-02-05 20:05:06 +00:00
Jaco 21cb76e517 Bump dev (#4534) 2022-02-05 21:54:35 +02:00
github-actions[bot] d774a3c2ab [CI Skip] release/beta 7.6.2-8
skip-checks: true
2022-02-04 14:54:50 +00:00
Jaco 0c08e8ba9e Re-decorate all runtime endpoints (#4532) 2022-02-04 16:46:44 +02:00
github-actions[bot] c2549ec166 [CI Skip] release/beta 7.6.2-7
skip-checks: true
2022-02-04 12:28:12 +00:00
Jaco d27fce3b29 Bump deps (#4531) 2022-02-04 14:19:14 +02:00
github-actions[bot] 849588e305 [CI Skip] release/beta 7.6.2-6
skip-checks: true
2022-02-03 14:50:08 +00:00
Jaco 4f3fedc27e beefy_getFinalizedHead (#4530) 2022-02-03 16:42:00 +02:00
github-actions[bot] 57a5892f99 [CI Skip] release/beta 7.6.2-5
skip-checks: true
2022-02-03 10:52:43 +00:00
Jaco f5499ca4ed Don't show Call/Event extract warning pre-v14 (#4528) 2022-02-03 12:44:05 +02:00
github-actions[bot] 37ae595f03 [CI Skip] release/beta 7.6.2-4
skip-checks: true
2022-02-03 10:39:21 +00:00
Jaco 868a4a2964 Bump metadata (#4527) 2022-02-03 12:30:18 +02:00
github-actions[bot] 3656480cff [CI Skip] release/beta 7.6.2-3
skip-checks: true
2022-02-03 09:24:49 +00:00
Jaco 37cf4b5e88 Explicit class cache clear (#4523)
* Explicit class cache clear

* Re-register defaults

* Track knownDefaults in getters

* get ordering
2022-02-03 11:14:43 +02:00
github-actions[bot] 75a4e7b5d7 [CI Skip] release/beta 7.6.2-2
skip-checks: true
2022-02-03 09:02:59 +00:00
Jaco 12d6cf8a5b Don't want on resolvable Lookup* types (#4524) 2022-02-03 10:54:22 +02:00
github-actions[bot] aa7e5ea601 [CI Skip] release/beta 7.6.2-1
skip-checks: true
2022-02-02 14:54:43 +00:00
Gérard Dethier 9f5232019e Fix LRUCache memory leak. (#4520) 2022-02-02 16:46:28 +02:00
github-actions[bot] 3063763a18 [CI Skip] release/beta 7.6.2-0
skip-checks: true
2022-02-02 09:38:40 +00:00
Jaco b76f9e7e21 Adjust runtime upgrade init (#4519) 2022-02-02 11:30:25 +02:00
github-actions[bot] 558636b6b0 [CI Skip] release/stable 7.6.1
skip-checks: true
2022-01-30 05:32:32 +00:00
Jaco 8b92772b2f 7.6.1 (#4515) 2022-01-30 07:21:26 +02:00
github-actions[bot] cf0881f704 [CI Skip] release/beta 7.5.2-11
skip-checks: true
2022-01-29 15:43:58 +00:00
Jaco 1adc17b598 Workaround for regenerator runtime + private callback (#4514)
* Workaround for regenerator runtime + private callback

* CHANGELOG
2022-01-29 17:34:35 +02:00
github-actions[bot] a55256a247 [CI Skip] release/beta 7.5.2-10
skip-checks: true
2022-01-29 11:02:51 +00:00
Jaco faaa4e9480 CHANGELOG update (#4512) 2022-01-29 12:52:53 +02:00
github-actions[bot] ba52ab450e [CI Skip] release/beta 7.5.2-9
skip-checks: true
2022-01-29 10:49:04 +00:00
r0t0r-r0t0r 0660d0cf15 Fix memory leak on raw rpc call (#4505)
* Fix memory leak on raw rpc call

While processing a raw rpc call an observable is removed from the wrong cache. It causes a memory leak.

* Fix memory leak on raw rpc subscription, fix types

Fixed similar memory leak on raw rpc subscription.
Also added proper type declaration for the return value of the _memomize function to address build error.
2022-01-29 12:41:02 +02:00
Jaco fa1a3315f8 Bump deps (#4511) 2022-01-29 12:30:48 +02:00
github-actions[bot] 5f281b07fe [CI Skip] release/beta 7.5.2-8
skip-checks: true
2022-01-27 07:27:58 +00:00
Jaco e5bc2601cc Add support for rpc.contracts.uploadCode (#4508) 2022-01-27 09:18:51 +02:00
github-actions[bot] 6132a34333 [CI Skip] release/beta 7.5.2-7
skip-checks: true
2022-01-26 16:14:58 +00:00
Jaco 697e6d8b8b Exhaustive TypeDefInfo handling in extractType (#4506) 2022-01-26 18:06:18 +02:00
github-actions[bot] 33c4d82293 [CI Skip] release/beta 7.5.2-6
skip-checks: true
2022-01-26 09:00:43 +00:00
Jaco c46e0e9d5b Adjust bounty derive, empty on no {treasury, bounties}.bounties (#4503) 2022-01-26 10:51:24 +02:00
github-actions[bot] 4b9f987203 [CI Skip] release/beta 7.5.2-5
skip-checks: true
2022-01-25 15:13:05 +00:00
Jaco a650ae195e Non-aliased CallEvent type extraction (#4502)
* Non-aliased CallEvent type extraction

* Update packages/types/src/metadata/PortableRegistry/PortableRegistry.ts
2022-01-25 17:01:57 +02:00
github-actions[bot] 0dca7bacc2 [CI Skip] release/beta 7.5.2-4
skip-checks: true
2022-01-25 11:00:20 +00:00
Jaco 87f79151b4 Bump static metadata (#4499) 2022-01-25 12:52:00 +02:00
github-actions[bot] 480ae203b4 [CI Skip] release/beta 7.5.2-3
skip-checks: true
2022-01-25 07:05:28 +00:00
Jaco c4427c0497 Emit decorated event on API (incl. upgrades) (#4497) 2022-01-25 08:57:08 +02:00
github-actions[bot] f130f55167 [CI Skip] release/beta 7.5.2-2
skip-checks: true
2022-01-25 06:20:10 +00:00
Jaco 2009483542 Adjust SlotRange to 36 entries (with older 10-count version) (#4495)
* Adjust SlotRange to 36 entries (with older 10-count version)

* Fix tuple

* Adjust
2022-01-25 08:09:53 +02:00
github-actions[bot] ca50309554 [CI Skip] release/beta 7.5.2-1
skip-checks: true
2022-01-24 06:57:53 +00:00
Jaco db5b0986c4 Align Range/RangeInclusive handling with other definitions (#4489)
* Align Range/RangeInclusive handling with other definitions

* Split RangeInclusive class

* Rnage -> Range TypeDef

* Correct Range wrappers

* CHANGELOG

* Remove extra Range CHANGELOG entry

* Update CHANGELOG.md
2022-01-24 08:46:35 +02:00
github-actions[bot] b94cf566c9 [CI Skip] release/beta 7.5.2-0
skip-checks: true
2022-01-24 06:23:53 +00:00
Jaco ff24cec841 Dedupe WrapperOpaque classes (#4479)
* Dedupe WrapperOpaque classes

* Keep WrapperOpaque in own file
2022-01-24 08:13:08 +02:00
162 changed files with 17648 additions and 11970 deletions
+2
View File
@@ -7,6 +7,8 @@ on:
jobs:
lock:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: dessant/lock-threads@v2
with:
+2
View File
@@ -8,6 +8,8 @@ jobs:
step: ['lint', 'test', 'build']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.step }}
+6 -5
View File
@@ -12,17 +12,18 @@ jobs:
step: ['build:release']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: ${{ matrix.step }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
+2
View File
@@ -9,6 +9,8 @@ jobs:
check:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
+2
View File
@@ -6,6 +6,8 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/stale@v3
with:
+1
View File
@@ -6,6 +6,7 @@ docs/.vuepress/dist/
docs/substrate/*.md
node_modules/
tmp/
NOTES.md
.DS_Store
.env.local
.env.development.local
+57
View File
@@ -1,5 +1,62 @@
# CHANGELOG
## 7.8.1 Feb 14, 2022
Contributed:
- Add `isHistoric` flag to ETH RPCs (Thanks to https://github.com/stwiname)
- Align contract instantiate types with Substrate (Thanks to https://github.com/kwingram25)
Changes:
- Adjust map header output type with lookup id
- Re-enable all `BitVec` tests for `toU8a`
- Expose `txIndex` as event index on extrinsic results
- Allow inspection of Codec encoding (experimental)
- Allow inspection of storage key encoding (experimental)
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update `@polkadot/util` to 8.4.1
## 7.7.1 Feb 6, 2022
Upgrade priority: Low. Recommended for users with long-running scripts.
Contributed:
- Fix rpc-provider LRU memory leak (Thanks to https://github.com/gdethier)
Changes:
- Don't warn on `Lookup*` types missing (these are resolvable)
- Don't clear injected `PortableRegistry` types on runtime upgrade
- Clear warning for `Call`/`Event` on non-meta v14 runtimes
- Add `beefy_getFinalizedHead` RPC support
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.6.1 Jan 30, 2022
Upgdare priority: Low. Recommended for users with long-running scripts and those chains based around the latest Substrate master versions.
Contributed:
- Fix memory leak on `.raw` RPC calls (Thanks to https://github.com/r0t0r-r0t0r)
Changes:
- Adjust extraction of `Call` & `Event` types for metadata v14
- Adjust historic `WinningData` and `SlotRange` types (36-entry variant)
- Emit `decorated` event on API on metadata decoration
- Dedupe and extend `WrapperKeepOpaque/WrapperOpaque`
- Align `Range/RangeInclusive` usage with similar types
- Adjust bounty derive, return empty on no `{treasury, bounties}.bounties`
- Ensure handling of all `TypeDefInfo` keys in extraction
- Add support for `rpc.contracts.uploadCode`
- Workaround for generators where `#private = { this... }` yields undefined
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.5.1 Jan 23, 2022
Upgrade priority: Low. Recommended for users of the latest contract pallet and ink! versions.
+5 -2
View File
@@ -1,6 +1,6 @@
2782 Jaco 7.5.1 (#4492)
2821 Jaco 7.8.1 (#4564)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
36 Keith Ingram Storage deposit limit changes (#4370)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
@@ -34,6 +34,7 @@
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
2 Nikos Kontakis Add auction in shared types (#4085)
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
2 Scott Twiname Fix `isHistorical` to `isHistoric` (#4540)
2 sung wu Update tx.md (#2485)
2 Veliko Abi constructor takes different parameters (#3347)
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
@@ -52,6 +53,7 @@
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
1 Furqan A fix: fixed 404 to the docs from the api readme (#3985)
1 Gérard Dethier Fix LRUCache memory leak. (#4520)
1 Gerben van de Wiel Adding some extra notes on changes in the specname (#2329)
1 HackFisher fix OutboundLaneData types (#3992)
1 Hoani Bryson Multiple Endpoint support for WsProvider (#2234)
@@ -79,6 +81,7 @@
1 Paul M Fox Basic BTreeMaps codec support (#1474)
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
1 qiuhao update DeriveCustom type (#2581)
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
1 Rocco Musolino remove broken link (#2671)
1 satellitex Add BTreeSet<V> Codec (#1639)
1 satellitex Add traits replace rules. for invalid cases `::<type>` and `<type>::`. (#885)
+6 -6
View File
@@ -2,7 +2,7 @@
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2",
"license": "Apache-2.0",
"packageManager": "yarn@3.0.1",
"private": true,
"repository": {
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "7.5.1",
"version": "7.8.1",
"workspaces": [
"packages/*"
],
@@ -31,10 +31,10 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.16.12",
"@babel/register": "^7.16.9",
"@babel/runtime": "^7.16.7",
"@polkadot/dev": "^0.65.43",
"@babel/core": "^7.17.2",
"@babel/register": "^7.17.0",
"@babel/runtime": "^7.17.2",
"@polkadot/dev": "^0.65.56",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.4.0",
"copyfiles": "^2.4.1"
+8 -8
View File
@@ -20,15 +20,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/api-base": "7.5.1",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-augment": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.2",
"@polkadot/api-base": "7.8.1",
"@polkadot/rpc-augment": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-augment": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/util": "^8.4.1"
}
}
+13 -3
View File
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
@@ -592,8 +592,13 @@ declare module '@polkadot/api-base/types/consts' {
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
*
* NOTE: The threshold programmed in this Pallet uses u16, so it does
* not really make sense to have a limit here greater than u16::MAX.
* But also, that is a lot more than you should probably set this value
* to anyway...
**/
maxFriends: u16 & AugmentedConst<ApiType>;
maxFriends: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
@@ -703,7 +708,6 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -847,6 +851,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
@@ -858,6 +864,10 @@ declare module '@polkadot/api-base/types/consts' {
* An accepted proposal gets these back. A rejected proposal does not.
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
+40
View File
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -503,6 +507,10 @@ declare module '@polkadot/api-base/types/errors' {
* The call is not allowed at this point.
**/
CallNotAllowed: AugmentedError<ApiType>;
/**
* The fallback failed
**/
FallbackFailed: AugmentedError<ApiType>;
/**
* `Self::insert_submission` returned an invalid index.
**/
@@ -696,6 +704,10 @@ declare module '@polkadot/api-base/types/errors' {
* The requested maximum message size is 0.
**/
OpenHrmpChannelZeroMessageSize: AugmentedError<ApiType>;
/**
* The provided witness data is wrong.
**/
WrongWitness: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -874,6 +886,10 @@ declare module '@polkadot/api-base/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
paraInclusion: {
/**
* Bitfield consists of zeros only.
**/
BitfieldAllZeros: AugmentedError<ApiType>;
/**
* Multiple bitfields submitted by same validator or validators out of order by index.
**/
@@ -953,10 +969,26 @@ declare module '@polkadot/api-base/types/errors' {
* Scheduled cores out of order.
**/
ScheduledOutOfOrder: AugmentedError<ApiType>;
/**
* A different relay parent was provided compared to the on-chain stored one.
**/
UnexpectedRelayParent: AugmentedError<ApiType>;
/**
* Candidate submitted but para not scheduled.
**/
UnscheduledCandidate: AugmentedError<ApiType>;
/**
* Backed candidates are out of order (core index) or contain duplicates.
**/
UnsortedOrDuplicateBackedCandidates: AugmentedError<ApiType>;
/**
* Dispute statement sets are out of order or contain duplicates.
**/
UnsortedOrDuplicateDisputeStatementSet: AugmentedError<ApiType>;
/**
* Validator indices are out of order or contains duplicates.
**/
UnsortedOrDuplicateValidatorIndices: AugmentedError<ApiType>;
/**
* The validation data hash does not match expected.
**/
@@ -983,6 +1015,14 @@ declare module '@polkadot/api-base/types/errors' {
* Disputed candidate that was concluded invalid.
**/
CandidateConcludedInvalid: AugmentedError<ApiType>;
/**
* A dispute statement was invalid.
**/
DisputeInvalid: AugmentedError<ApiType>;
/**
* The ordering of dispute statements was invalid.
**/
DisputeStatementsUnsortedOrDuplicates: AugmentedError<ApiType>;
/**
* The data given to the inherent will result in an overweight block.
**/
+53 -31
View File
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -185,8 +185,29 @@ declare module '@polkadot/api-base/types/storage' {
};
balances: {
/**
* The balance of an account.
* The Balances pallet example of storing the balance of an account.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
* }
* ```
*
* You can also store the balance of an account in the `System` pallet.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = System
* }
* ```
*
* But this comes with tradeoffs, storing account balances in the system pallet stores
* `frame_system` data alongside the account data contrary to storing account balances in the
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
* NOTE: This is only used in the case that this pallet is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
@@ -364,13 +385,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -596,13 +610,12 @@ declare module '@polkadot/api-base/types/storage' {
**/
hrmpChannelContents: AugmentedQuery<ApiType, (arg: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => Observable<Vec<PolkadotCorePrimitivesInboundHrmpMessage>>, [PolkadotParachainPrimitivesHrmpChannelId]> & QueryableStorageEntry<ApiType, [PolkadotParachainPrimitivesHrmpChannelId]>;
/**
* Maintains a mapping that can be used to answer the question:
* What paras sent a message at the given block number for a given receiver.
* Invariants:
* Maintains a mapping that can be used to answer the question: What paras sent a message at
* the given block number for a given receiver. Invariants:
* - The inner `Vec<ParaId>` is never empty.
* - The inner `Vec<ParaId>` cannot store two same `ParaId`.
* - The outer vector is sorted ascending by block number and cannot store two items with the same
* block number.
* - The outer vector is sorted ascending by block number and cannot store two items with the
* same block number.
**/
hrmpChannelDigests: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, Vec<u32>]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
@@ -612,8 +625,8 @@ declare module '@polkadot/api-base/types/storage' {
**/
hrmpChannels: AugmentedQuery<ApiType, (arg: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => Observable<Option<PolkadotRuntimeParachainsHrmpHrmpChannel>>, [PolkadotParachainPrimitivesHrmpChannelId]> & QueryableStorageEntry<ApiType, [PolkadotParachainPrimitivesHrmpChannelId]>;
/**
* A set of pending HRMP close channel requests that are going to be closed during the session change.
* Used for checking if a given channel is registered for closure.
* A set of pending HRMP close channel requests that are going to be closed during the session
* change. Used for checking if a given channel is registered for closure.
*
* The set is accompanied by a list for iteration.
*
@@ -624,25 +637,25 @@ declare module '@polkadot/api-base/types/storage' {
hrmpCloseChannelRequestsList: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotParachainPrimitivesHrmpChannelId>>, []> & QueryableStorageEntry<ApiType, []>;
hrmpEgressChannelsIndex: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Ingress/egress indexes allow to find all the senders and receivers given the opposite
* side. I.e.
* Ingress/egress indexes allow to find all the senders and receivers given the opposite side.
* I.e.
*
* (a) ingress index allows to find all the senders for a given recipient.
* (b) egress index allows to find all the recipients for a given sender.
*
* Invariants:
* - for each ingress index entry for `P` each item `I` in the index should present in `HrmpChannels`
* as `(I, P)`.
* - for each egress index entry for `P` each item `E` in the index should present in `HrmpChannels`
* as `(P, E)`.
* - for each ingress index entry for `P` each item `I` in the index should present in
* `HrmpChannels` as `(I, P)`.
* - for each egress index entry for `P` each item `E` in the index should present in
* `HrmpChannels` as `(P, E)`.
* - there should be no other dangling channels in `HrmpChannels`.
* - the vectors are sorted.
**/
hrmpIngressChannelsIndex: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* This mapping tracks how many open channel requests are initiated by a given sender para.
* Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has `(X, _)`
* as the number of `HrmpOpenChannelRequestCount` for `X`.
* Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has
* `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`.
**/
hrmpOpenChannelRequestCount: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
@@ -1223,12 +1236,6 @@ declare module '@polkadot/api-base/types/storage' {
* Lookup from identity to the block number and index of the task.
**/
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
/**
* Storage version of the pallet.
*
* New networks start with last version.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -1534,7 +1541,22 @@ declare module '@polkadot/api-base/types/storage' {
**/
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The map from nominator stash key to the set of stash keys of all validators to nominate.
* The map from nominator stash key to their nomination preferences, namely the validators that
* they wish to support.
*
* Note that the keys of this storage map might become non-decodable in case the
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
* nominators will effectively not-exist, until they re-submit their preferences such that it
* is within the bounds of the newly set `Config::MaxNominations`.
*
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
* number of keys that exist.
*
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
* [`Call::chill_other`] dispatchable by anyone.
**/
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
+33 -36
View File
@@ -1198,6 +1198,13 @@ declare module '@polkadot/api-base/types/submittable' {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
*
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
* calling [`Call::set_emergency_election_result`].
**/
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
/**
* Set a solution in the queue, to be handed out to the client of this pallet in the next
* call to `ElectionProvider::elect`.
@@ -1348,22 +1355,28 @@ declare module '@polkadot/api-base/types/submittable' {
* you to trigger the cleanup immediately for a specific parachain.
*
* Origin must be Root.
*
* Number of inbound and outbound channels for `para` must be provided as witness data of weighing.
**/
forceCleanHrmp: AugmentedSubmittable<(para: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
forceCleanHrmp: AugmentedSubmittable<(para: u32 | AnyNumber | Uint8Array, inbound: u32 | AnyNumber | Uint8Array, outbound: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u32]>;
/**
* Force process HRMP close channel requests.
*
* If there are pending HRMP close channel requests, you can use this
* function process all of those requests immediately.
*
* Total number of closing channels must be provided as witness data of weighing.
**/
forceProcessHrmpClose: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
forceProcessHrmpClose: AugmentedSubmittable<(channels: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Force process HRMP open channel requests.
*
* If there are pending HRMP open channel requests, you can use this
* function process all of those requests immediately.
*
* Total number of opening channels must be provided as witness data of weighing.
**/
forceProcessHrmpOpen: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
forceProcessHrmpOpen: AugmentedSubmittable<(channels: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Accept a pending open channel request from the given sender.
*
@@ -1371,13 +1384,16 @@ declare module '@polkadot/api-base/types/submittable' {
**/
hrmpAcceptOpenChannel: AugmentedSubmittable<(sender: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* This cancels a pending open channel request. It can be canceled be either of the sender
* This cancels a pending open channel request. It can be canceled by either of the sender
* or the recipient for that request. The origin must be either of those.
*
* The cancellation happens immediately. It is not possible to cancel the request if it is
* already accepted.
*
* Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as
* witness data.
**/
hrmpCancelOpenRequest: AugmentedSubmittable<(channelId: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotParachainPrimitivesHrmpChannelId]>;
hrmpCancelOpenRequest: AugmentedSubmittable<(channelId: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array, openRequests: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotParachainPrimitivesHrmpChannelId, u32]>;
/**
* Initiate unilateral closing of a channel. The origin must be either the sender or the
* recipient in the channel being closed.
@@ -3140,14 +3156,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Can be called by the `T::SlashCancelOrigin`.
*
* Parameters: era and indices of the slashes for that era to kill.
*
* # <weight>
* Complexity: O(U + S)
* with U unapplied slashes weighted with U=1000
* and S is the number of slash indices to be canceled.
* - Read: Unapplied Slashes
* - Write: Unapplied Slashes
* # </weight>
**/
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
/**
@@ -3176,6 +3184,11 @@ declare module '@polkadot/api-base/types/submittable' {
*
* If the caller is different than the controller being targeted, the following conditions
* must be met:
*
* * `controller` must belong to a nominator who has become non-decodable,
*
* Or:
*
* * A `ChillThreshold` must be set and checked which defines how close to the max
* nominators or validators we must reach before users can start chilling one-another.
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
@@ -3188,6 +3201,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -3217,11 +3236,6 @@ declare module '@polkadot/api-base/types/submittable' {
* The election process starts multiple blocks before the end of the era.
* If this is called just before a new era is triggered, the election process may not
* have enough blocks to get a result.
*
* # <weight>
* - Weight: O(1)
* - Write: ForceEra
* # </weight>
**/
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
@@ -3246,13 +3260,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Force a current staker to become completely unstaked, immediately.
*
* The dispatch origin must be Root.
*
* # <weight>
* O(S) where S is the number of slashing spans to be removed
* Reads: Bonded, Slashing Spans, Account, Locks
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
* Account, Locks Writes Each: SpanSlash * S
* # </weight>
**/
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
/**
@@ -3288,7 +3295,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - The transaction's complexity is proportional to the size of `targets` (N)
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
* - Both the reads and writes follow a similar pattern.
* # </weight>
**/
@@ -3402,11 +3409,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Set the validators who cannot be slashed (if any).
*
* The dispatch origin must be Root.
*
* # <weight>
* - O(V)
* - Write: Invulnerables
* # </weight>
**/
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
@@ -3538,11 +3540,6 @@ declare module '@polkadot/api-base/types/submittable' {
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Make some on-chain remark and emit event.
*
* # <weight>
* - `O(b)` where b is the length of the remark.
* - 1 event.
* # </weight>
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.8.1' };
+7 -2
View File
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
@@ -575,7 +575,6 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -719,6 +718,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
@@ -730,6 +731,10 @@ declare module '@polkadot/api-base/types/consts' {
* An accepted proposal gets these back. A rejected proposal does not.
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -503,6 +507,10 @@ declare module '@polkadot/api-base/types/errors' {
* The call is not allowed at this point.
**/
CallNotAllowed: AugmentedError<ApiType>;
/**
* The fallback failed
**/
FallbackFailed: AugmentedError<ApiType>;
/**
* `Self::insert_submission` returned an invalid index.
**/
@@ -657,6 +665,10 @@ declare module '@polkadot/api-base/types/errors' {
* The requested maximum message size is 0.
**/
OpenHrmpChannelZeroMessageSize: AugmentedError<ApiType>;
/**
* The provided witness data is wrong.
**/
WrongWitness: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -835,6 +847,10 @@ declare module '@polkadot/api-base/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
paraInclusion: {
/**
* Bitfield consists of zeros only.
**/
BitfieldAllZeros: AugmentedError<ApiType>;
/**
* Multiple bitfields submitted by same validator or validators out of order by index.
**/
@@ -914,10 +930,26 @@ declare module '@polkadot/api-base/types/errors' {
* Scheduled cores out of order.
**/
ScheduledOutOfOrder: AugmentedError<ApiType>;
/**
* A different relay parent was provided compared to the on-chain stored one.
**/
UnexpectedRelayParent: AugmentedError<ApiType>;
/**
* Candidate submitted but para not scheduled.
**/
UnscheduledCandidate: AugmentedError<ApiType>;
/**
* Backed candidates are out of order (core index) or contain duplicates.
**/
UnsortedOrDuplicateBackedCandidates: AugmentedError<ApiType>;
/**
* Dispute statement sets are out of order or contain duplicates.
**/
UnsortedOrDuplicateDisputeStatementSet: AugmentedError<ApiType>;
/**
* Validator indices are out of order or contains duplicates.
**/
UnsortedOrDuplicateValidatorIndices: AugmentedError<ApiType>;
/**
* The validation data hash does not match expected.
**/
@@ -944,6 +976,14 @@ declare module '@polkadot/api-base/types/errors' {
* Disputed candidate that was concluded invalid.
**/
CandidateConcludedInvalid: AugmentedError<ApiType>;
/**
* A dispute statement was invalid.
**/
DisputeInvalid: AugmentedError<ApiType>;
/**
* The ordering of dispute statements was invalid.
**/
DisputeStatementsUnsortedOrDuplicates: AugmentedError<ApiType>;
/**
* The data given to the inherent will result in an overweight block.
**/
+53 -31
View File
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -185,8 +185,29 @@ declare module '@polkadot/api-base/types/storage' {
};
balances: {
/**
* The balance of an account.
* The Balances pallet example of storing the balance of an account.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
* }
* ```
*
* You can also store the balance of an account in the `System` pallet.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = System
* }
* ```
*
* But this comes with tradeoffs, storing account balances in the system pallet stores
* `frame_system` data alongside the account data contrary to storing account balances in the
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
* NOTE: This is only used in the case that this pallet is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
@@ -364,13 +385,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -570,13 +584,12 @@ declare module '@polkadot/api-base/types/storage' {
**/
hrmpChannelContents: AugmentedQuery<ApiType, (arg: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => Observable<Vec<PolkadotCorePrimitivesInboundHrmpMessage>>, [PolkadotParachainPrimitivesHrmpChannelId]> & QueryableStorageEntry<ApiType, [PolkadotParachainPrimitivesHrmpChannelId]>;
/**
* Maintains a mapping that can be used to answer the question:
* What paras sent a message at the given block number for a given receiver.
* Invariants:
* Maintains a mapping that can be used to answer the question: What paras sent a message at
* the given block number for a given receiver. Invariants:
* - The inner `Vec<ParaId>` is never empty.
* - The inner `Vec<ParaId>` cannot store two same `ParaId`.
* - The outer vector is sorted ascending by block number and cannot store two items with the same
* block number.
* - The outer vector is sorted ascending by block number and cannot store two items with the
* same block number.
**/
hrmpChannelDigests: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, Vec<u32>]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
@@ -586,8 +599,8 @@ declare module '@polkadot/api-base/types/storage' {
**/
hrmpChannels: AugmentedQuery<ApiType, (arg: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => Observable<Option<PolkadotRuntimeParachainsHrmpHrmpChannel>>, [PolkadotParachainPrimitivesHrmpChannelId]> & QueryableStorageEntry<ApiType, [PolkadotParachainPrimitivesHrmpChannelId]>;
/**
* A set of pending HRMP close channel requests that are going to be closed during the session change.
* Used for checking if a given channel is registered for closure.
* A set of pending HRMP close channel requests that are going to be closed during the session
* change. Used for checking if a given channel is registered for closure.
*
* The set is accompanied by a list for iteration.
*
@@ -598,25 +611,25 @@ declare module '@polkadot/api-base/types/storage' {
hrmpCloseChannelRequestsList: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotParachainPrimitivesHrmpChannelId>>, []> & QueryableStorageEntry<ApiType, []>;
hrmpEgressChannelsIndex: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Ingress/egress indexes allow to find all the senders and receivers given the opposite
* side. I.e.
* Ingress/egress indexes allow to find all the senders and receivers given the opposite side.
* I.e.
*
* (a) ingress index allows to find all the senders for a given recipient.
* (b) egress index allows to find all the recipients for a given sender.
*
* Invariants:
* - for each ingress index entry for `P` each item `I` in the index should present in `HrmpChannels`
* as `(I, P)`.
* - for each egress index entry for `P` each item `E` in the index should present in `HrmpChannels`
* as `(P, E)`.
* - for each ingress index entry for `P` each item `I` in the index should present in
* `HrmpChannels` as `(I, P)`.
* - for each egress index entry for `P` each item `E` in the index should present in
* `HrmpChannels` as `(P, E)`.
* - there should be no other dangling channels in `HrmpChannels`.
* - the vectors are sorted.
**/
hrmpIngressChannelsIndex: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* This mapping tracks how many open channel requests are initiated by a given sender para.
* Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has `(X, _)`
* as the number of `HrmpOpenChannelRequestCount` for `X`.
* Invariant: `HrmpOpenChannelRequests` should contain the same number of items that has
* `(X, _)` as the number of `HrmpOpenChannelRequestCount` for `X`.
**/
hrmpOpenChannelRequestCount: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
@@ -1139,12 +1152,6 @@ declare module '@polkadot/api-base/types/storage' {
* Lookup from identity to the block number and index of the task.
**/
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
/**
* Storage version of the pallet.
*
* New networks start with last version.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -1379,7 +1386,22 @@ declare module '@polkadot/api-base/types/storage' {
**/
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The map from nominator stash key to the set of stash keys of all validators to nominate.
* The map from nominator stash key to their nomination preferences, namely the validators that
* they wish to support.
*
* Note that the keys of this storage map might become non-decodable in case the
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
* nominators will effectively not-exist, until they re-submit their preferences such that it
* is within the bounds of the newly set `Config::MaxNominations`.
*
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
* number of keys that exist.
*
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
* [`Call::chill_other`] dispatchable by anyone.
**/
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
+33 -36
View File
@@ -1198,6 +1198,13 @@ declare module '@polkadot/api-base/types/submittable' {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
*
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
* calling [`Call::set_emergency_election_result`].
**/
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
/**
* Set a solution in the queue, to be handed out to the client of this pallet in the next
* call to `ElectionProvider::elect`.
@@ -1297,22 +1304,28 @@ declare module '@polkadot/api-base/types/submittable' {
* you to trigger the cleanup immediately for a specific parachain.
*
* Origin must be Root.
*
* Number of inbound and outbound channels for `para` must be provided as witness data of weighing.
**/
forceCleanHrmp: AugmentedSubmittable<(para: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
forceCleanHrmp: AugmentedSubmittable<(para: u32 | AnyNumber | Uint8Array, inbound: u32 | AnyNumber | Uint8Array, outbound: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u32]>;
/**
* Force process HRMP close channel requests.
*
* If there are pending HRMP close channel requests, you can use this
* function process all of those requests immediately.
*
* Total number of closing channels must be provided as witness data of weighing.
**/
forceProcessHrmpClose: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
forceProcessHrmpClose: AugmentedSubmittable<(channels: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Force process HRMP open channel requests.
*
* If there are pending HRMP open channel requests, you can use this
* function process all of those requests immediately.
*
* Total number of opening channels must be provided as witness data of weighing.
**/
forceProcessHrmpOpen: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
forceProcessHrmpOpen: AugmentedSubmittable<(channels: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Accept a pending open channel request from the given sender.
*
@@ -1320,13 +1333,16 @@ declare module '@polkadot/api-base/types/submittable' {
**/
hrmpAcceptOpenChannel: AugmentedSubmittable<(sender: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* This cancels a pending open channel request. It can be canceled be either of the sender
* This cancels a pending open channel request. It can be canceled by either of the sender
* or the recipient for that request. The origin must be either of those.
*
* The cancellation happens immediately. It is not possible to cancel the request if it is
* already accepted.
*
* Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as
* witness data.
**/
hrmpCancelOpenRequest: AugmentedSubmittable<(channelId: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotParachainPrimitivesHrmpChannelId]>;
hrmpCancelOpenRequest: AugmentedSubmittable<(channelId: PolkadotParachainPrimitivesHrmpChannelId | { sender?: any; recipient?: any } | string | Uint8Array, openRequests: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotParachainPrimitivesHrmpChannelId, u32]>;
/**
* Initiate unilateral closing of a channel. The origin must be either the sender or the
* recipient in the channel being closed.
@@ -2551,14 +2567,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Can be called by the `T::SlashCancelOrigin`.
*
* Parameters: era and indices of the slashes for that era to kill.
*
* # <weight>
* Complexity: O(U + S)
* with U unapplied slashes weighted with U=1000
* and S is the number of slash indices to be canceled.
* - Read: Unapplied Slashes
* - Write: Unapplied Slashes
* # </weight>
**/
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
/**
@@ -2587,6 +2595,11 @@ declare module '@polkadot/api-base/types/submittable' {
*
* If the caller is different than the controller being targeted, the following conditions
* must be met:
*
* * `controller` must belong to a nominator who has become non-decodable,
*
* Or:
*
* * A `ChillThreshold` must be set and checked which defines how close to the max
* nominators or validators we must reach before users can start chilling one-another.
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
@@ -2599,6 +2612,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -2628,11 +2647,6 @@ declare module '@polkadot/api-base/types/submittable' {
* The election process starts multiple blocks before the end of the era.
* If this is called just before a new era is triggered, the election process may not
* have enough blocks to get a result.
*
* # <weight>
* - Weight: O(1)
* - Write: ForceEra
* # </weight>
**/
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
@@ -2657,13 +2671,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Force a current staker to become completely unstaked, immediately.
*
* The dispatch origin must be Root.
*
* # <weight>
* O(S) where S is the number of slashing spans to be removed
* Reads: Bonded, Slashing Spans, Account, Locks
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
* Account, Locks Writes Each: SpanSlash * S
* # </weight>
**/
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
/**
@@ -2699,7 +2706,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - The transaction's complexity is proportional to the size of `targets` (N)
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
* - Both the reads and writes follow a similar pattern.
* # </weight>
**/
@@ -2813,11 +2820,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Set the validators who cannot be slashed (if any).
*
* The dispatch origin must be Root.
*
* # <weight>
* - O(V)
* - Write: Invulnerables
* # </weight>
**/
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
@@ -2949,11 +2951,6 @@ declare module '@polkadot/api-base/types/submittable' {
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Make some on-chain remark and emit event.
*
* # <weight>
* - `O(b)` where b is the length of the remark.
* - 1 event.
* # </weight>
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
+58 -3
View File
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
@@ -257,6 +257,26 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
convictionVoting: {
/**
* The maximum number of concurrent votes an account may have.
*
* Also used to compute weight, an overly large value can
* lead to extrinsic with large weight estimation: see `delegate` for instance.
**/
maxVotes: u32 & AugmentedConst<ApiType>;
/**
* The minimum period of vote locking.
*
* It should be no shorter than enactment period to ensure that in the case of an approval,
* those successful voters are locked into the consequences that their votes entail.
**/
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
@@ -665,8 +685,13 @@ declare module '@polkadot/api-base/types/consts' {
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
*
* NOTE: The threshold programmed in this Pallet uses u16, so it does
* not really make sense to have a limit here greater than u16::MAX.
* But also, that is a lot more than you should probably set this value
* to anyway...
**/
maxFriends: u16 & AugmentedConst<ApiType>;
maxFriends: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
@@ -682,6 +707,31 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
referenda: {
/**
* Quantization level for the referendum wakeup scheduler. A higher number will result in
* fewer storage reads/writes needed for smaller voters, but also result in delays to the
* automatic referendum status changes. Explicit servicing instructions are unaffected.
**/
alarmInterval: u32 & AugmentedConst<ApiType>;
/**
* Maximum size of the referendum queue for a single track.
**/
maxQueued: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount to be used as a deposit for a public referendum proposal.
**/
submissionDeposit: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks after submission that a referendum must begin being decided by.
* Once this passes, then anyone may cancel the referendum.
**/
undecidingTimeout: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
* The maximum weight that may be scheduled per block for any dispatchables of less
@@ -747,7 +797,6 @@ declare module '@polkadot/api-base/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
@@ -891,6 +940,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
@@ -902,6 +953,10 @@ declare module '@polkadot/api-base/types/consts' {
* An accepted proposal gets these back. A rejected proposal does not.
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
@@ -219,6 +219,10 @@ declare module '@polkadot/api-base/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -309,6 +313,10 @@ declare module '@polkadot/api-base/types/errors' {
* `seal_call` forwarded this contracts input. It therefore is no longer available.
**/
InputForwarded: AugmentedError<ApiType>;
/**
* Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`.
**/
InvalidCallFlags: AugmentedError<ApiType>;
/**
* A new schedule must have a greater version than the current one.
**/
@@ -381,6 +389,61 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
convictionVoting: {
/**
* The account is already delegating.
**/
AlreadyDelegating: AugmentedError<ApiType>;
/**
* The account currently has votes attached to it and the operation cannot succeed until
* these are removed, either through `unvote` or `reap_vote`.
**/
AlreadyVoting: AugmentedError<ApiType>;
/**
* The class ID supplied is invalid.
**/
BadClass: AugmentedError<ApiType>;
/**
* The class must be supplied since it is not easily determinable from the state.
**/
ClassNeeded: AugmentedError<ApiType>;
/**
* Too high a balance was provided that the account cannot afford.
**/
InsufficientFunds: AugmentedError<ApiType>;
/**
* Maximum number of votes reached.
**/
MaxVotesReached: AugmentedError<ApiType>;
/**
* Delegation to oneself makes no sense.
**/
Nonsense: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action right now but will do in the future.
**/
NoPermissionYet: AugmentedError<ApiType>;
/**
* The account is not currently delegating.
**/
NotDelegating: AugmentedError<ApiType>;
/**
* Poll is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* The given account did not vote on the poll.
**/
NotVoter: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
council: {
/**
* Members are already initialized!
@@ -551,6 +614,10 @@ declare module '@polkadot/api-base/types/errors' {
* The call is not allowed at this point.
**/
CallNotAllowed: AugmentedError<ApiType>;
/**
* The fallback failed
**/
FallbackFailed: AugmentedError<ApiType>;
/**
* `Self::insert_submission` returned an invalid index.
**/
@@ -1089,6 +1156,56 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
referenda: {
/**
* The referendum index provided is invalid in this context.
**/
BadReferendum: AugmentedError<ApiType>;
/**
* The track identifier given was invalid.
**/
BadTrack: AugmentedError<ApiType>;
/**
* There are already a full complement of referendums in progress for this track.
**/
Full: AugmentedError<ApiType>;
/**
* Referendum's decision deposit is already paid.
**/
HaveDeposit: AugmentedError<ApiType>;
/**
* The deposit cannot be refunded since none was made.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The deposit refunder is not the depositor.
**/
NoPermission: AugmentedError<ApiType>;
/**
* There was nothing to do in the advancement.
**/
NothingToDo: AugmentedError<ApiType>;
/**
* Referendum is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* No track exists for the proposal origin.
**/
NoTrack: AugmentedError<ApiType>;
/**
* The queue of the track is empty.
**/
QueueEmpty: AugmentedError<ApiType>;
/**
* Any deposit cannot be refunded until after the decision is over.
**/
Unfinished: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
scheduler: {
/**
* Failed to schedule a call
+67 -1
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletConvictionVotingTally, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
@@ -233,6 +233,20 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
convictionVoting: {
/**
* An account has delegated their vote to another account. \[who, target\]
**/
Delegated: AugmentedEvent<ApiType, [AccountId32, AccountId32]>;
/**
* An \[account\] has cancelled a previous delegation operation.
**/
Undelegated: AugmentedEvent<ApiType, [AccountId32]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
council: {
/**
* A motion was approved by the required threshold.
@@ -680,6 +694,58 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
referenda: {
/**
* A referendum has been approved and its proposal has been scheduled.
**/
Approved: AugmentedEvent<ApiType, [u32]>;
/**
* A referendum has been cancelled.
**/
Cancelled: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
ConfirmAborted: AugmentedEvent<ApiType, [u32]>;
/**
* A referendum has ended its confirmation phase and is ready for approval.
**/
Confirmed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
ConfirmStarted: AugmentedEvent<ApiType, [u32]>;
/**
* The decision deposit has been placed.
**/
DecisionDepositPlaced: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
/**
* The decision deposit has been refunded.
**/
DecisionDepositRefunded: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
/**
* A referendum has moved into the deciding phase.
**/
DecisionStarted: AugmentedEvent<ApiType, [u32, u8, H256, PalletConvictionVotingTally]>;
/**
* A deposit has been slashaed.
**/
DepositSlashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
* A referendum has been killed.
**/
Killed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* A proposal has been rejected by referendum.
**/
Rejected: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* A referendum has being submitted.
**/
Submitted: AugmentedEvent<ApiType, [u32, u8, H256]>;
/**
* A referendum has been timed out without being decided.
**/
TimedOut: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
scheduler: {
/**
* The call for the provided hash was not found so the task has been aborted.
+83 -16
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfo, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -193,8 +193,29 @@ declare module '@polkadot/api-base/types/storage' {
};
balances: {
/**
* The balance of an account.
* The Balances pallet example of storing the balance of an account.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
* }
* ```
*
* You can also store the balance of an account in the `System` pallet.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = System
* }
* ```
*
* But this comes with tradeoffs, storing account balances in the system pallet stores
* `frame_system` data alongside the account data contrary to storing account balances in the
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
* NOTE: This is only used in the case that this pallet is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
@@ -306,6 +327,23 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
convictionVoting: {
/**
* The voting classes which have a non-zero lock requirement and the lock amounts which they
* require. The actual amount locked on behalf of this pallet should always be the maximum of
* this list.
**/
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u8, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* All voting for a particular voter in a particular voting class. We store the balance for the
* number of votes that we have recorded.
**/
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u8 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u8]> & QueryableStorageEntry<ApiType, [AccountId32, u8]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
council: {
/**
* The current members of the collective. This is stored sorted (just by value).
@@ -357,13 +395,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -820,6 +851,33 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
referenda: {
/**
* The number of referenda being decided currently.
**/
decidingCount: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<u32>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
/**
* The next free referendum index, aka the number of referenda started so far.
**/
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Information concerning any given referendum.
*
* TWOX-NOTE: SAFE as indexes are not under an attackers control.
**/
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfo>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
* conviction-weighted approvals.
*
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
**/
trackQueue: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
scheduler: {
/**
* Items to be executed, indexed by the block number that they should be executed on.
@@ -829,12 +887,6 @@ declare module '@polkadot/api-base/types/storage' {
* Lookup from identity to the block number and index of the task.
**/
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
/**
* Storage version of the pallet.
*
* New networks start with last version.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -1115,7 +1167,22 @@ declare module '@polkadot/api-base/types/storage' {
**/
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The map from nominator stash key to the set of stash keys of all validators to nominate.
* The map from nominator stash key to their nomination preferences, namely the validators that
* they wish to support.
*
* Note that the keys of this storage map might become non-decodable in case the
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
* nominators will effectively not-exist, until they re-submit their preferences such that it
* is within the bounds of the newly set `Config::MaxNominations`.
*
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
* number of keys that exist.
*
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
* [`Call::chill_other`] dispatchable by anyone.
**/
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
+225 -40
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletReferendaAtOrAfter, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -985,6 +985,130 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
convictionVoting: {
/**
* Delegate the voting power (with some given conviction) of the sending account for a
* particular class of polls.
*
* The balance delegated is locked for as long as it's delegated, and thereafter for the
* time appropriate for the conviction's lock period.
*
* The dispatch origin of this call must be _Signed_, and the signing account must either:
* - be delegating already; or
* - have no voting activity (if there is, then it will need to be removed/consolidated
* through `reap_vote` or `unvote`).
*
* - `to`: The account whose voting the `target` account's voting power will follow.
* - `class`: The class of polls to delegate. To delegate multiple classes, multiple calls
* to this function are required.
* - `conviction`: The conviction that will be attached to the delegated votes. When the
* account is undelegated, the funds will be locked for the corresponding period.
* - `balance`: The amount of the account's balance to be used in delegating. This must not
* be more than the account's current balance.
*
* Emits `Delegated`.
*
* Weight: `O(R)` where R is the number of polls the voter delegating to has
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
**/
delegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, conviction: PalletConvictionVotingConviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32, PalletConvictionVotingConviction, u128]>;
/**
* Remove a vote for a poll.
*
* If the `target` is equal to the signer, then this function is exactly equivalent to
* `remove_vote`. If not equal to the signer, then the vote must have expired,
* either because the poll was cancelled, because the voter lost the poll or
* because the conviction period is over.
*
* The dispatch origin of this call must be _Signed_.
*
* - `target`: The account of the vote to be removed; this account must have voted for poll
* `index`.
* - `index`: The index of poll of the vote to be removed.
* - `class`: The class of the poll.
*
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
* Weight is calculated for the maximum number of vote.
**/
removeOtherVote: AugmentedSubmittable<(target: AccountId32 | string | Uint8Array, clazz: u8 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u8, u32]>;
/**
* Remove a vote for a poll.
*
* If:
* - the poll was cancelled, or
* - the poll is ongoing, or
* - the poll has ended such that
* - the vote of the account was in opposition to the result; or
* - there was no conviction to the account's vote; or
* - the account made a split vote
* ...then the vote is removed cleanly and a following call to `unlock` may result in more
* funds being available.
*
* If, however, the poll has ended and:
* - it finished corresponding to the vote of the account, and
* - the account made a standard vote with conviction, and
* - the lock period of the conviction is not over
* ...then the lock will be aggregated into the overall account's lock, which may involve
* *overlocking* (where the two locks are combined into a single lock that is the maximum
* of both the amount locked and the time is it locked for).
*
* The dispatch origin of this call must be _Signed_, and the signer must have a vote
* registered for poll `index`.
*
* - `index`: The index of poll of the vote to be removed.
* - `class`: Optional parameter, if given it indicates the class of the poll. For polls
* which have finished or are cancelled, this must be `Some`.
*
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
* Weight is calculated for the maximum number of vote.
**/
removeVote: AugmentedSubmittable<(clazz: Option<u8> | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u8>, u32]>;
/**
* Undelegate the voting power of the sending account for a particular class of polls.
*
* Tokens may be unlocked following once an amount of time consistent with the lock period
* of the conviction with which the delegation was issued.
*
* The dispatch origin of this call must be _Signed_ and the signing account must be
* currently delegating.
*
* - `class`: The class of polls to remove the delegation from.
*
* Emits `Undelegated`.
*
* Weight: `O(R)` where R is the number of polls the voter delegating to has
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
**/
undelegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
/**
* Remove the lock caused prior voting/delegating which has expired within a particluar
* class.
*
* The dispatch origin of this call must be _Signed_.
*
* - `class`: The class of polls to unlock.
* - `target`: The account to remove the lock on.
*
* Weight: `O(R)` with R number of vote of target.
**/
unlock: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32]>;
/**
* Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;
* otherwise it is a vote to keep the status quo.
*
* The dispatch origin of this call must be _Signed_.
*
* - `poll_index`: The index of the poll to vote for.
* - `vote`: The vote configuration.
*
* Weight: `O(R)` where R is the number of polls the voter has voted on.
**/
vote: AugmentedSubmittable<(pollIndex: Compact<u32> | AnyNumber | Uint8Array, vote: PalletConvictionVotingVoteAccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, PalletConvictionVotingVoteAccountVote]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
council: {
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
@@ -1477,6 +1601,13 @@ declare module '@polkadot/api-base/types/submittable' {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
*
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
* calling [`Call::set_emergency_election_result`].
**/
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
/**
* Set a solution in the queue, to be handed out to the client of this pallet in the next
* call to `ElectionProvider::elect`.
@@ -2751,6 +2882,82 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
referenda: {
/**
* Cancel an ongoing referendum.
*
* - `origin`: must be the `CancelOrigin`.
* - `index`: The index of the referendum to be cancelled.
*
* Emits `Cancelled`.
**/
cancel: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Cancel an ongoing referendum and slash the deposits.
*
* - `origin`: must be the `KillOrigin`.
* - `index`: The index of the referendum to be cancelled.
*
* Emits `Killed` and `DepositSlashed`.
**/
kill: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Advance a referendum onto its next logical state. Only used internally.
*
* - `origin`: must be `Root`.
* - `index`: the referendum to be advanced.
**/
nudgeReferendum: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Advance a track onto its next logical state. Only used internally.
*
* - `origin`: must be `Root`.
* - `track`: the track to be advanced.
*
* Action item for when there is now one fewer referendum in the deciding phase and the
* `DecidingCount` is not yet updated. This means that we should either:
* - begin deciding another referendum (and leave `DecidingCount` alone); or
* - decrement `DecidingCount`.
**/
oneFewerDeciding: AugmentedSubmittable<(track: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
/**
* Post the Decision Deposit for a referendum.
*
* - `origin`: must be `Signed` and the account must have funds available for the
* referendum's track's Decision Deposit.
* - `index`: The index of the submitted referendum whose Decision Deposit is yet to be
* posted.
*
* Emits `DecisionDepositPlaced`.
**/
placeDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Refund the Decision Deposit for a closed referendum back to the depositor.
*
* - `origin`: must be `Signed` or `Root`.
* - `index`: The index of a closed referendum whose Decision Deposit has not yet been
* refunded.
*
* Emits `DecisionDepositRefunded`.
**/
refundDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Propose a referendum on a privileged action.
*
* - `origin`: must be `Signed` and the account must have `SubmissionDeposit` funds
* available.
* - `proposal_origin`: The origin from which the proposal should be executed.
* - `proposal_hash`: The hash of the proposal preimage.
* - `enactment_moment`: The moment that the proposal should be enacted.
*
* Emits `Submitted`.
**/
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: PalletReferendaAtOrAfter | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, PalletReferendaAtOrAfter]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
scheduler: {
/**
* Cancel an anonymously scheduled task.
@@ -3203,14 +3410,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Can be called by the `T::SlashCancelOrigin`.
*
* Parameters: era and indices of the slashes for that era to kill.
*
* # <weight>
* Complexity: O(U + S)
* with U unapplied slashes weighted with U=1000
* and S is the number of slash indices to be canceled.
* - Read: Unapplied Slashes
* - Write: Unapplied Slashes
* # </weight>
**/
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
/**
@@ -3239,6 +3438,11 @@ declare module '@polkadot/api-base/types/submittable' {
*
* If the caller is different than the controller being targeted, the following conditions
* must be met:
*
* * `controller` must belong to a nominator who has become non-decodable,
*
* Or:
*
* * A `ChillThreshold` must be set and checked which defines how close to the max
* nominators or validators we must reach before users can start chilling one-another.
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
@@ -3251,6 +3455,12 @@ declare module '@polkadot/api-base/types/submittable' {
* who do not satisfy these requirements.
**/
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force a validator to have at least the minimum commission. This will not affect a
* validator who already has a commission greater than or equal to the minimum. Any account
* can call this.
**/
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
/**
* Force there to be a new era at the end of the next session. After this, it will be
* reset to normal (non-forced) behaviour.
@@ -3280,11 +3490,6 @@ declare module '@polkadot/api-base/types/submittable' {
* The election process starts multiple blocks before the end of the era.
* If this is called just before a new era is triggered, the election process may not
* have enough blocks to get a result.
*
* # <weight>
* - Weight: O(1)
* - Write: ForceEra
* # </weight>
**/
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
@@ -3309,13 +3514,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Force a current staker to become completely unstaked, immediately.
*
* The dispatch origin must be Root.
*
* # <weight>
* O(S) where S is the number of slashing spans to be removed
* Reads: Bonded, Slashing Spans, Account, Locks
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
* Account, Locks Writes Each: SpanSlash * S
* # </weight>
**/
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
/**
@@ -3351,7 +3549,7 @@ declare module '@polkadot/api-base/types/submittable' {
*
* # <weight>
* - The transaction's complexity is proportional to the size of `targets` (N)
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
* - Both the reads and writes follow a similar pattern.
* # </weight>
**/
@@ -3465,11 +3663,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Set the validators who cannot be slashed (if any).
*
* The dispatch origin must be Root.
*
* # <weight>
* - O(V)
* - Write: Invulnerables
* # </weight>
**/
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
/**
@@ -3660,11 +3853,6 @@ declare module '@polkadot/api-base/types/submittable' {
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Make some on-chain remark and emit event.
*
* # <weight>
* - `O(b)` where b is the length of the remark.
* - 1 event.
* # </weight>
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
@@ -4206,21 +4394,18 @@ declare module '@polkadot/api-base/types/submittable' {
**/
cancelApproval: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
/**
* Set an attribute for an asset class or instance.
* Clear an attribute for an asset class or instance.
*
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
* asset `class`.
*
* If the origin is Signed, then funds of signer are reserved according to the formula:
* `MetadataDepositBase + DepositPerByte * (key.len + value.len)` taking into
* account any already reserved funds.
* Any deposit is freed for the asset class owner.
*
* - `class`: The identifier of the asset class whose instance's metadata to set.
* - `instance`: The identifier of the asset instance whose metadata to set.
* - `class`: The identifier of the asset class whose instance's metadata to clear.
* - `maybe_instance`: The identifier of the asset instance whose metadata to clear.
* - `key`: The key of the attribute.
* - `value`: The value to which to set the attribute.
*
* Emits `AttributeSet`.
* Emits `AttributeCleared`.
*
* Weight: `O(1)`
**/
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/rpc-core": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/util": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.2",
"@polkadot/rpc-core": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/util": "^8.4.1",
"rxjs": "^7.5.4"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.8.1' };
@@ -66,6 +66,7 @@ export interface SubmittableResultValue {
internalError?: Error;
status: ExtrinsicStatus;
txHash: Hash;
txIndex?: number;
}
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
+11 -11
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/api": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/types-create": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.2",
"@polkadot/api": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/types-create": "7.8.1",
"@polkadot/util": "^8.4.1",
"@polkadot/util-crypto": "^8.4.1",
"rxjs": "^7.5.4"
},
"devDependencies": {
"@polkadot/api-augment": "7.5.1",
"@polkadot/keyring": "^8.3.3"
"@polkadot/api-augment": "7.8.1",
"@polkadot/keyring": "^8.4.1"
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ function parseJson (json: Record<string, unknown>, chainProperties?: ChainProper
const registry = new TypeRegistry();
const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo;
const latest = getLatestMeta(registry, json);
const lookup = registry.createType('PortableRegistry', { types: latest.types });
const lookup = registry.createType('PortableRegistry', { types: latest.types }, true);
// attach the lookup to the registry - now the types are known
registry.setLookup(lookup);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.8.1' };
+16 -16
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/api": "7.5.1",
"@polkadot/api-augment": "7.5.1",
"@polkadot/api-base": "7.5.1",
"@polkadot/rpc-core": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.2",
"@polkadot/api": "7.8.1",
"@polkadot/api-augment": "7.8.1",
"@polkadot/api-base": "7.8.1",
"@polkadot/rpc-core": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/util": "^8.4.1",
"@polkadot/util-crypto": "^8.4.1",
"rxjs": "^7.5.4"
},
"devDependencies": {
"@polkadot/api": "7.5.1",
"@polkadot/api-augment": "7.5.1",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/rpc-provider": "7.5.1",
"@polkadot/types-support": "7.5.1"
"@polkadot/api": "7.8.1",
"@polkadot/api-augment": "7.8.1",
"@polkadot/rpc-augment": "7.8.1",
"@polkadot/rpc-provider": "7.8.1",
"@polkadot/types-support": "7.8.1"
}
}
+25 -23
View File
@@ -35,29 +35,31 @@ export function bounties (instanceId: string, api: DeriveApi): () => Observable<
const bountyBase = api.query.bounties || api.query.treasury;
return memo(instanceId, (): Observable<DeriveBounties> =>
combineLatest([
bountyBase.bountyCount(),
api.query.council
? api.query.council.proposalCount()
: of(0)
]).pipe(
switchMap(() => combineLatest([
bountyBase.bounties.keys(),
api.derive.council
? api.derive.council.proposals()
: of([])
])),
switchMap(([keys, proposals]): Observable<Result> => {
const ids = keys.map(({ args: [id] }) => id);
bountyBase.bounties
? combineLatest([
bountyBase.bountyCount(),
api.query.council
? api.query.council.proposalCount()
: of(0)
]).pipe(
switchMap(() => combineLatest([
bountyBase.bounties.keys(),
api.derive.council
? api.derive.council.proposals()
: of([])
])),
switchMap(([keys, proposals]): Observable<Result> => {
const ids = keys.map(({ args: [id] }) => id);
return combineLatest([
bountyBase.bounties.multi(ids),
bountyBase.bountyDescriptions.multi(ids),
of(ids),
of(filterBountiesProposals(api, proposals))
]);
}),
map(parseResult)
)
return combineLatest([
bountyBase.bounties.multi(ids),
bountyBase.bountyDescriptions.multi(ids),
of(ids),
of(filterBountiesProposals(api, proposals))
]);
}),
map(parseResult)
)
: of(parseResult([[], [], [], []]))
);
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.8.1' };
+19 -19
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/api-augment": "7.5.1",
"@polkadot/api-base": "7.5.1",
"@polkadot/api-derive": "7.5.1",
"@polkadot/keyring": "^8.3.3",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/rpc-core": "7.5.1",
"@polkadot/rpc-provider": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-augment": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/types-create": "7.5.1",
"@polkadot/types-known": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"@babel/runtime": "^7.17.2",
"@polkadot/api-augment": "7.8.1",
"@polkadot/api-base": "7.8.1",
"@polkadot/api-derive": "7.8.1",
"@polkadot/keyring": "^8.4.1",
"@polkadot/rpc-augment": "7.8.1",
"@polkadot/rpc-core": "7.8.1",
"@polkadot/rpc-provider": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-augment": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/types-create": "7.8.1",
"@polkadot/types-known": "7.8.1",
"@polkadot/util": "^8.4.1",
"@polkadot/util-crypto": "^8.4.1",
"eventemitter3": "^4.0.7",
"rxjs": "^7.5.2"
"rxjs": "^7.5.4"
},
"devDependencies": {
"@polkadot/api-augment": "7.5.1",
"@polkadot/types-support": "7.5.1"
"@polkadot/api-augment": "7.8.1",
"@polkadot/types-support": "7.8.1"
}
}
+3 -1
View File
@@ -213,7 +213,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
} as ApiDecoration<ApiType>;
}
if (!registry.decoratedMeta) {
if (fromEmpty || !registry.decoratedMeta) {
registry.decoratedMeta = expandMetadata(registry.registry, registry.metadata);
}
@@ -275,6 +275,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
}
augmentObject(null, decoratedMeta.consts, this._rx.consts, fromEmpty);
this.emit('decorated');
}
/**
+12 -12
View File
@@ -65,9 +65,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._rpcCore.setRegistrySwap((blockHash: Uint8Array) => this.getBlockRegistry(blockHash));
if (this.hasSubscriptions) {
this._rpcCore.provider.on('disconnected', this.#onProviderDisconnect);
this._rpcCore.provider.on('error', this.#onProviderError);
this._rpcCore.provider.on('connected', this.#onProviderConnect);
this._rpcCore.provider.on('disconnected', () => this.#onProviderDisconnect());
this._rpcCore.provider.on('error', (e: Error) => this.#onProviderError(e));
this._rpcCore.provider.on('connected', () => this.#onProviderConnect());
} else {
l.warn('Api will be available in a limited mode since the provider does not support subscriptions');
}
@@ -85,6 +85,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
* @description Decorates a registry based on the runtime version
*/
private _initRegistry (registry: Registry, chain: Text, version: { specName: Text, specVersion: BN }, metadata: Metadata, chainProps?: ChainProperties): void {
registry.clearCache();
registry.setChainProperties(chainProps || this.registry.getChainProperties());
registry.setKnownTypes(this._options);
registry.register(getSpecTypes(registry, chain, version.specName, version.specVersion));
@@ -284,9 +285,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
thisRegistry.metadata = metadata;
thisRegistry.specVersion = version.specVersion;
// clear the registry types to ensure that we override correctly
this._initRegistry(thisRegistry.registry.init(), this._runtimeChain as Text, version, metadata);
this._injectMetadata(thisRegistry, false);
this._initRegistry(this.registry, this._runtimeChain as Text, version, metadata);
this._injectMetadata(thisRegistry, true);
return true;
})
@@ -380,7 +380,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._unsubscribeUpdates();
}
#onProviderConnect = async (): Promise<void> => {
async #onProviderConnect (): Promise<void> {
this._isConnected.next(true);
this.emit('connected');
@@ -406,15 +406,15 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this.emit('error', error);
}
};
}
#onProviderDisconnect = (): void => {
#onProviderDisconnect (): void {
this._isConnected.next(false);
this._unsubscribeHealth();
this.emit('disconnected');
};
}
#onProviderError = (error: Error): void => {
#onProviderError (error: Error): void {
this.emit('error', error);
};
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.8.1' };
+4 -1
View File
@@ -47,13 +47,16 @@ export class SubmittableResult implements ISubmittableResult {
public readonly txHash: Hash;
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash }: SubmittableResultValue) {
public readonly txIndex?: number;
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }: SubmittableResultValue) {
this.dispatchError = dispatchError || extractError(events);
this.dispatchInfo = dispatchInfo || extractInfo(events);
this.events = events || [];
this.internalError = internalError;
this.status = status;
this.txHash = txHash;
this.txIndex = txIndex;
}
public get isCompleted (): boolean {
+1 -1
View File
@@ -248,7 +248,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
return api.derive.tx.events(blockHash).pipe(
map(({ block, events }): ISubmittableResult =>
this.#transformResult(new SubmittableResult({
events: filterEvents(txHash, block, events, status),
...filterEvents(txHash, block, events, status),
status,
txHash
}))
+1 -1
View File
@@ -81,7 +81,7 @@ export interface ApiOptions extends RegisteredTypes {
throwOnUnknown?: boolean;
}
export type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready';
export type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready' | 'decorated';
export interface SignerOptions extends SignatureOptions {
blockNumber: BN;
+10 -7
View File
@@ -5,14 +5,17 @@ import type { EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@polkadot/
import { l } from './logging';
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): EventRecord[] | undefined {
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): { events?: EventRecord[], txIndex?: number } {
// extrinsics to hashes
for (const [index, x] of extrinsics.entries()) {
for (const [txIndex, x] of extrinsics.entries()) {
if (x.hash.eq(txHash)) {
return allEvents.filter(({ phase }) =>
// only ApplyExtrinsic has the extrinsic index
phase.isApplyExtrinsic && phase.asApplyExtrinsic.eqn(index)
);
return {
events: allEvents.filter(({ phase }) =>
phase.isApplyExtrinsic &&
phase.asApplyExtrinsic.eqn(txIndex)
),
txIndex
};
}
}
@@ -24,5 +27,5 @@ export function filterEvents (txHash: H256, { block: { extrinsics, header } }: S
l.warn(`block ${header.hash.toHex()}: Unable to find extrinsic ${txHash.toHex()} inside ${allHashes.join(', ')}`);
}
return undefined;
return {};
}
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/rpc-core": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.2",
"@polkadot/rpc-core": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/util": "^8.4.1"
}
}
+9 -1
View File
@@ -11,7 +11,7 @@ import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
@@ -68,6 +68,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
};
beefy: {
/**
* Returns hash of the latest BEEFY finalized block as seen by this client.
**/
getFinalizedHead: AugmentedRpc<() => Observable<H256>>;
/**
* Returns the block most recently finalized by BEEFY, alongside side its justification.
**/
@@ -146,6 +150,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Returns the projected time a given contract will be able to sustain paying its rent
**/
rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<BlockNumber>>>;
/**
* Upload new code without instantiating a contract from it
**/
uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<CodeUploadResult>>;
};
engine: {
/**
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.8.1' };
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/rpc-provider": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/util": "^8.3.3",
"rxjs": "^7.5.2"
"@babel/runtime": "^7.17.2",
"@polkadot/rpc-augment": "7.8.1",
"@polkadot/rpc-provider": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/util": "^8.4.1",
"rxjs": "^7.5.4"
},
"devDependencies": {
"@polkadot/keyring": "^8.3.3",
"@polkadot/rpc-augment": "7.5.1"
"@polkadot/keyring": "^8.4.1",
"@polkadot/rpc-augment": "7.8.1"
}
}
+19 -6
View File
@@ -24,6 +24,11 @@ interface StorageChangeSetJSON {
changes: [string, string | null][];
}
type MemoizedRpcInterfaceMethod = Memoized<RpcInterfaceMethod> & {
raw: Memoized<RpcInterfaceMethod>;
meta: DefinitionRpc;
}
const l = logger('rpc-core');
const EMPTY_META = {
@@ -174,14 +179,14 @@ export class RpcCore {
}
}
private _memomize (creator: <T> (isScale: boolean) => (...values: unknown[]) => Observable<T>, def: DefinitionRpc): Memoized<RpcInterfaceMethod> {
private _memomize (creator: <T> (isScale: boolean) => (...values: unknown[]) => Observable<T>, def: DefinitionRpc): MemoizedRpcInterfaceMethod {
const memoOpts = { getInstanceId: () => this.#instanceId };
const memoized = memoize(creator(true) as RpcInterfaceMethod, memoOpts);
memoized.raw = memoize(creator(false), memoOpts);
memoized.meta = def;
return memoized;
return memoized as MemoizedRpcInterfaceMethod;
}
private _formatResult <T> (isScale: boolean, registry: Registry, blockHash: string | Uint8Array | null | undefined, method: string, def: DefinitionRpc, params: Codec[], result: unknown): T {
@@ -193,7 +198,7 @@ export class RpcCore {
private _createMethodSend (section: string, method: string, def: DefinitionRpc): RpcInterfaceMethod {
const rpcName = def.endpoint || `${section}_${method}`;
const hashIndex = def.params.findIndex(({ isHistoric }) => isHistoric);
let memoized: null | Memoized<RpcInterfaceMethod> = null;
let memoized: null | MemoizedRpcInterfaceMethod = null;
// execute the RPC call, doing a registry swap for historic as applicable
const callWithRegistry = async <T> (isScale: boolean, values: unknown[]): Promise<T> => {
@@ -229,7 +234,11 @@ export class RpcCore {
return (): void => {
// delete old results from cache
memoized?.unmemoize(...values);
if (isScale) {
memoized?.unmemoize(...values);
} else {
memoized?.raw.unmemoize(...values);
}
};
}).pipe(
publishReplay(1), // create a Replay(1)
@@ -262,7 +271,7 @@ export class RpcCore {
const subName = `${section}_${subMethod}`;
const unsubName = `${section}_${unsubMethod}`;
const subType = `${section}_${updateType}`;
let memoized: null | Memoized<RpcInterfaceMethod> = null;
let memoized: null | MemoizedRpcInterfaceMethod = null;
const creator = <T> (isScale: boolean) => (...values: unknown[]): Observable<T> => {
return new Observable((observer: Observer<T>): () => void => {
@@ -302,7 +311,11 @@ export class RpcCore {
// Teardown logic
return (): void => {
// Delete from cache, so old results don't hang around
memoized?.unmemoize(...values);
if (isScale) {
memoized?.unmemoize(...values);
} else {
memoized?.raw.unmemoize(...values);
}
// Unsubscribe from provider
subscriptionPromise
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.8.1' };
+12 -12
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/keyring": "^8.3.3",
"@polkadot/types": "7.5.1",
"@polkadot/types-support": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"@polkadot/x-fetch": "^8.3.3",
"@polkadot/x-global": "^8.3.3",
"@polkadot/x-ws": "^8.3.3",
"@babel/runtime": "^7.17.2",
"@polkadot/keyring": "^8.4.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-support": "7.8.1",
"@polkadot/util": "^8.4.1",
"@polkadot/util-crypto": "^8.4.1",
"@polkadot/x-fetch": "^8.4.1",
"@polkadot/x-global": "^8.4.1",
"@polkadot/x-ws": "^8.4.1",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.0",
"nock": "^13.2.2"
"mock-socket": "^9.1.2",
"nock": "^13.2.4"
}
}
+1
View File
@@ -108,6 +108,7 @@ export class LRUCache {
this.#refs.delete(this.#tail.key);
this.#tail = this.#tail.prev;
this.#tail.next = this.#head;
} else {
this.#length += 1;
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.8.1' };
+16 -16
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,26 +30,26 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
},
"dependencies": {
"@babel/core": "^7.16.12",
"@babel/register": "^7.16.9",
"@babel/runtime": "^7.16.7",
"@polkadot/api": "7.5.1",
"@polkadot/api-augment": "7.5.1",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/rpc-provider": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-augment": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/types-create": "7.5.1",
"@polkadot/types-support": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/x-ws": "^8.3.3",
"@babel/core": "^7.17.2",
"@babel/register": "^7.17.0",
"@babel/runtime": "^7.17.2",
"@polkadot/api": "7.8.1",
"@polkadot/api-augment": "7.8.1",
"@polkadot/rpc-augment": "7.8.1",
"@polkadot/rpc-provider": "7.8.1",
"@polkadot/types": "7.8.1",
"@polkadot/types-augment": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/types-create": "7.8.1",
"@polkadot/types-support": "7.8.1",
"@polkadot/util": "^8.4.1",
"@polkadot/x-ws": "^8.4.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.3.1"
},
"devDependencies": {
"@types/websocket": "^1.0.4",
"@types/websocket": "^1.0.5",
"@types/yargs": "^17.0.8"
}
}
+1
View File
@@ -235,6 +235,7 @@ export const typeEncoders: Record<TypeDefInfo, (registry: Registry, definitions:
[TypeDefInfo.Option]: tsOption,
[TypeDefInfo.Plain]: tsPlain,
[TypeDefInfo.Range]: errorUnhandled,
[TypeDefInfo.RangeInclusive]: errorUnhandled,
[TypeDefInfo.Result]: tsResult,
[TypeDefInfo.Set]: tsSet,
[TypeDefInfo.Si]: tsSi,
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.5.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.8.1' };
+5 -1
View File
@@ -174,12 +174,16 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
throw new Error(`TypeDefInfo.Range: Not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.RangeInclusive]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
throw new Error(`TypeDefInfo.RangeInclusive: Not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
throw new Error(`TypeDefInfo.Set: Not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.Si]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
return formatType(registry, definitions, (registry).lookup.getTypeDef(typeDef.type), imports, withShortcut);
return formatType(registry, definitions, registry.lookup.getTypeDef(typeDef.type), imports, withShortcut);
},
[TypeDefInfo.Struct]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/types": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.2",
"@polkadot/types": "7.8.1",
"@polkadot/types-codec": "7.8.1",
"@polkadot/util": "^8.4.1"
}
}
+12 -12
View File
@@ -5,13 +5,13 @@
export default {
/**
* Lookup74: kusama_runtime::ProxyType
* Lookup75: kusama_runtime::ProxyType
**/
KusamaRuntimeProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction']
},
/**
* Lookup104: polkadot_runtime_parachains::disputes::pallet::Event<T>
* Lookup105: polkadot_runtime_parachains::disputes::pallet::Event<T>
**/
PolkadotRuntimeParachainsDisputesPalletEvent: {
_enum: {
@@ -22,19 +22,19 @@ export default {
}
},
/**
* Lookup106: polkadot_runtime_parachains::disputes::DisputeLocation
* Lookup107: polkadot_runtime_parachains::disputes::DisputeLocation
**/
PolkadotRuntimeParachainsDisputesDisputeLocation: {
_enum: ['Local', 'Remote']
},
/**
* Lookup107: polkadot_runtime_parachains::disputes::DisputeResult
* Lookup108: polkadot_runtime_parachains::disputes::DisputeResult
**/
PolkadotRuntimeParachainsDisputesDisputeResult: {
_enum: ['Valid', 'Invalid']
},
/**
* Lookup246: kusama_runtime::SessionKeys
* Lookup248: kusama_runtime::SessionKeys
**/
KusamaRuntimeSessionKeys: {
grandpa: 'SpFinalityGrandpaAppPublic',
@@ -45,11 +45,11 @@ export default {
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
},
/**
* Lookup319: kusama_runtime::OriginCaller
* Lookup321: kusama_runtime::OriginCaller
**/
KusamaRuntimeOriginCaller: {
_enum: {
system: 'FrameSystemRawOrigin',
system: 'FrameSupportDispatchRawOrigin',
__Unused1: 'Null',
__Unused2: 'Null',
__Unused3: 'Null',
@@ -152,7 +152,7 @@ export default {
}
},
/**
* Lookup384: kusama_runtime::NposCompactSolution24
* Lookup386: kusama_runtime::NposCompactSolution24
**/
KusamaRuntimeNposCompactSolution24: {
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
@@ -181,13 +181,13 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup504: polkadot_runtime_parachains::disputes::pallet::Call<T>
* Lookup506: polkadot_runtime_parachains::disputes::pallet::Call<T>
**/
PolkadotRuntimeParachainsDisputesPalletCall: {
_enum: ['force_unfreeze']
},
/**
* Lookup696: polkadot_primitives::v1::DisputeState<N>
* Lookup702: polkadot_primitives::v1::DisputeState<N>
**/
PolkadotPrimitivesV1DisputeState: {
validatorsFor: 'BitVec',
@@ -196,13 +196,13 @@ export default {
concludedAt: 'Option<u32>'
},
/**
* Lookup697: polkadot_runtime_parachains::disputes::pallet::Error<T>
* Lookup703: polkadot_runtime_parachains::disputes::pallet::Error<T>
**/
PolkadotRuntimeParachainsDisputesPalletError: {
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
},
/**
* Lookup732: kusama_runtime::Runtime
* Lookup738: 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 { H256, PerU16 } from '@polkadot/types/interfaces/runtime';
/** @name KusamaRuntimeProxyType (74) */
/** @name KusamaRuntimeProxyType (75) */
export interface KusamaRuntimeProxyType extends Enum {
readonly isAny: boolean;
readonly isNonTransfer: boolean;
@@ -18,7 +18,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction';
}
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (104) */
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (105) */
export interface PolkadotRuntimeParachainsDisputesPalletEvent extends Enum {
readonly isDisputeInitiated: boolean;
readonly asDisputeInitiated: ITuple<[H256, PolkadotRuntimeParachainsDisputesDisputeLocation]>;
@@ -31,21 +31,21 @@ declare module '@polkadot/types/lookup' {
readonly type: 'DisputeInitiated' | 'DisputeConcluded' | 'DisputeTimedOut' | 'Revert';
}
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (106) */
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (107) */
export interface PolkadotRuntimeParachainsDisputesDisputeLocation extends Enum {
readonly isLocal: boolean;
readonly isRemote: boolean;
readonly type: 'Local' | 'Remote';
}
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (107) */
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (108) */
export interface PolkadotRuntimeParachainsDisputesDisputeResult extends Enum {
readonly isValid: boolean;
readonly isInvalid: boolean;
readonly type: 'Valid' | 'Invalid';
}
/** @name KusamaRuntimeSessionKeys (246) */
/** @name KusamaRuntimeSessionKeys (248) */
export interface KusamaRuntimeSessionKeys extends Struct {
readonly grandpa: SpFinalityGrandpaAppPublic;
readonly babe: SpConsensusBabeAppPublic;
@@ -55,10 +55,10 @@ declare module '@polkadot/types/lookup' {
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
}
/** @name KusamaRuntimeOriginCaller (319) */
/** @name KusamaRuntimeOriginCaller (321) */
export interface KusamaRuntimeOriginCaller extends Enum {
readonly isSystem: boolean;
readonly asSystem: FrameSystemRawOrigin;
readonly asSystem: FrameSupportDispatchRawOrigin;
readonly isVoid: boolean;
readonly isCouncil: boolean;
readonly asCouncil: PalletCollectiveRawOrigin;
@@ -71,7 +71,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
}
/** @name KusamaRuntimeNposCompactSolution24 (384) */
/** @name KusamaRuntimeNposCompactSolution24 (386) */
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>]>>;
@@ -99,13 +99,13 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name PolkadotRuntimeParachainsDisputesPalletCall (504) */
/** @name PolkadotRuntimeParachainsDisputesPalletCall (506) */
export interface PolkadotRuntimeParachainsDisputesPalletCall extends Enum {
readonly isForceUnfreeze: boolean;
readonly type: 'ForceUnfreeze';
}
/** @name PolkadotPrimitivesV1DisputeState (696) */
/** @name PolkadotPrimitivesV1DisputeState (702) */
export interface PolkadotPrimitivesV1DisputeState extends Struct {
readonly validatorsFor: BitVec;
readonly validatorsAgainst: BitVec;
@@ -113,7 +113,7 @@ declare module '@polkadot/types/lookup' {
readonly concludedAt: Option<u32>;
}
/** @name PolkadotRuntimeParachainsDisputesPalletError (697) */
/** @name PolkadotRuntimeParachainsDisputesPalletError (703) */
export interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
readonly isDuplicateDisputeStatementSets: boolean;
readonly isAncientDisputeStatement: boolean;
@@ -125,7 +125,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'PotentialSpam' | 'SingleSidedDispute';
}
/** @name KusamaRuntimeRuntime (732) */
/** @name KusamaRuntimeRuntime (738) */
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
+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: '7.5.1' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.8.1' };
+14 -2
View File
@@ -17,7 +17,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { StatementKind } from '@polkadot/types/interfaces/claims';
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
import type { AliveContractInfo, CodeHash, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, 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';
@@ -37,7 +37,7 @@ import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMeta
import type { MmrLeafProof } 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, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
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 { 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';
@@ -197,6 +197,10 @@ declare module '@polkadot/types/types/registry' {
ClassMetadata: ClassMetadata;
CodecHash: CodecHash;
CodeHash: CodeHash;
CodeSource: CodeSource;
CodeUploadRequest: CodeUploadRequest;
CodeUploadResult: CodeUploadResult;
CodeUploadResultValue: CodeUploadResultValue;
CollatorId: CollatorId;
CollatorSignature: CollatorSignature;
CollectiveOrigin: CollectiveOrigin;
@@ -246,6 +250,7 @@ declare module '@polkadot/types/types/registry' {
ContractInfo: ContractInfo;
ContractInstantiateResult: ContractInstantiateResult;
ContractInstantiateResultTo267: ContractInstantiateResultTo267;
ContractInstantiateResultTo299: ContractInstantiateResultTo299;
ContractLayoutArray: ContractLayoutArray;
ContractLayoutCell: ContractLayoutCell;
ContractLayoutEnum: ContractLayoutEnum;
@@ -522,7 +527,10 @@ declare module '@polkadot/types/types/registry' {
InstanceId: InstanceId;
InstanceMetadata: InstanceMetadata;
InstantiateRequest: InstantiateRequest;
InstantiateRequestV1: InstantiateRequestV1;
InstantiateRequestV2: InstantiateRequestV2;
InstantiateReturnValue: InstantiateReturnValue;
InstantiateReturnValueOk: InstantiateReturnValueOk;
InstantiateReturnValueTo267: InstantiateReturnValueTo267;
InstructionV2: InstructionV2;
InstructionWeights: InstructionWeights;
@@ -907,6 +915,7 @@ declare module '@polkadot/types/types/registry' {
Slot: Slot;
SlotNumber: SlotNumber;
SlotRange: SlotRange;
SlotRange10: SlotRange10;
SocietyJudgement: SocietyJudgement;
SocietyVote: SocietyVote;
SolutionOrSnapshotSize: SolutionOrSnapshotSize;
@@ -1073,8 +1082,11 @@ declare module '@polkadot/types/types/registry' {
WildMultiAssetV1: WildMultiAssetV1;
WildMultiAssetV2: WildMultiAssetV2;
WinnersData: WinnersData;
WinnersData10: WinnersData10;
WinnersDataTuple: WinnersDataTuple;
WinnersDataTuple10: WinnersDataTuple10;
WinningData: WinningData;
WinningData10: WinningData10;
WinningDataEntry: WinningDataEntry;
WithdrawReasons: WithdrawReasons;
Xcm: Xcm;
+7 -7
View File
@@ -20,16 +20,16 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"version": "7.8.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/util": "^8.3.3"
"@babel/runtime": "^7.17.2",
"@polkadot/util": "^8.4.1"
},
"devDependencies": {
"@polkadot/types": "7.5.1",
"@polkadot/types-augment": "7.5.1",
"@polkadot/types-support": "7.5.1",
"@polkadot/util-crypto": "^8.3.3"
"@polkadot/types": "7.8.1",
"@polkadot/types-augment": "7.8.1",
"@polkadot/types-support": "7.8.1",
"@polkadot/util-crypto": "^8.4.1"
}
}
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, IU8a, IVec, Registry } from '../types';
import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types';
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
@@ -78,6 +78,26 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
return compareArray(this, other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
return {
inner: this.inspectInner(),
outer: [compactToU8a(this.length)]
};
}
inspectInner (): Inspect[] {
const inner = new Array<Inspect>(this.length);
for (let i = 0; i < this.length; i++) {
inner[i] = this[i].inspect();
}
return inner;
}
/**
* @description Converts the Object to an standard JavaScript Array
*/
@@ -141,18 +161,21 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public toU8a (isBare?: boolean): Uint8Array {
const encoded = this.toU8aInner();
return isBare
? u8aConcat(...encoded)
: u8aConcat(compactToU8a(this.length), ...encoded);
}
public toU8aInner (isBare?: boolean): Uint8Array[] {
const encoded = new Array<Uint8Array>(this.length);
for (let i = 0; i < this.length; i++) {
encoded[i] = this[i].toU8a(isBare);
}
return isBare
? u8aConcat(...encoded)
: u8aConcat(
compactToU8a(this.length),
...encoded
);
return encoded;
}
// Below are methods that we override. When we do a `new Vec(...).map()`,
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types';
import { assert, BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isBn, isHex, isNumber, isString, isU8a, u8aToBn } from '@polkadot/util';
@@ -122,6 +122,15 @@ export abstract class AbstractInt extends BN implements INumber {
);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
return {
outer: [this.toU8a()]
};
}
/**
* @description True if this value is the max of the type
*/
+8 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, BareOpts, Codec, IU8a, Registry } from '../types';
import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types';
/**
* @name Base
@@ -59,6 +59,13 @@ export abstract class Base<T extends Codec> implements Codec {
return this.#raw.eq(other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
return this.#raw.inspect();
}
/**
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
*/
@@ -79,5 +79,13 @@ describe('Compact', (): void => {
(new (Compact.with('u128'))(registry, 12345678987654321n).toBigInt() + 1n) === 12345678987654322n
).toBe(true);
});
it('has a sane inspect', (): void => {
expect(
new (Compact.with(U32))(registry, 0xffff).inspect()
).toEqual({
outer: [new Uint8Array([254, 255, 3, 0])]
});
});
});
});
+10 -1
View File
@@ -3,7 +3,7 @@
import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, AnyNumber, CodecClass, ICompact, INumber, IU8a, Registry } from '../types';
import type { AnyJson, AnyNumber, CodecClass, ICompact, Inspect, INumber, IU8a, Registry } from '../types';
import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util';
@@ -100,6 +100,15 @@ export class Compact<T extends INumber> implements ICompact<T> {
);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
return {
outer: [this.toU8a()]
};
}
/**
* @description Returns a BigInt representation of the number
*/
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IU8a, Registry } from '../types';
import type { AnyJson, Codec, CodecClass, Inspect, IU8a, Registry } from '../types';
/**
* @name DoNotConstruct
@@ -56,6 +56,10 @@ export class DoNotConstruct implements Codec {
throw this.#neverError;
}
inspect (): Inspect {
throw this.#neverError;
}
toHex (): HexString {
throw this.#neverError;
}
@@ -289,6 +289,18 @@ describe('Enum', (): void => {
expect(test.isNone).toBe(true);
expect(test.index).toEqual(1);
});
it('has a sane inspect', (): void => {
expect(
new Enum(
registry,
{ Text, U32 },
'0x0134120000'
).inspect()
).toEqual({
outer: [new Uint8Array([0x01]), new Uint8Array([0x34, 0x12, 0x00, 0x00])]
});
});
});
});
+17 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IEnum, IU8a, Registry } from '../types';
import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types';
import { assert, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
@@ -320,6 +320,22 @@ export class Enum implements IEnum {
return this.value.eq(other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
if (this.isBasic) {
return { outer: [new Uint8Array([this.index])] };
}
const { inner, outer = [] } = this.#raw.inspect();
return {
inner,
outer: [new Uint8Array([this.index]), ...outer]
};
}
/**
* @description Returns a hex string representation of the value
*/
@@ -52,6 +52,14 @@ describe('Int', (): void => {
).toEqual(-123);
});
it('has a sane inspect', (): void => {
expect(
new Int(registry, '0x12', 16).inspect()
).toEqual({
outer: [new Uint8Array([0x12, 0x00])]
});
});
describe('static with', (): void => {
it('allows default toRawType', (): void => {
expect(
+8 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { Codec, IU8a, Registry } from '../types';
import type { Codec, Inspect, IU8a, Registry } from '../types';
import { isNull } from '@polkadot/util';
@@ -51,6 +51,13 @@ export class Null implements Codec {
return other instanceof Null || isNull(other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
return {};
}
/**
* @description Returns a hex string representation of the value
*/
@@ -153,5 +153,13 @@ describe('Option', (): void => {
it('unwrapOrDefault to specified if non-empty', (): void => {
expect(new Option(registry, U32, '1234').unwrapOrDefault().toNumber()).toEqual(1234);
});
it('has a sane inspect', (): void => {
expect(
new Option(registry, U32, '1234').inspect()
).toEqual({
outer: [new Uint8Array([0x01]), new Uint8Array([210, 4, 0, 0])]
});
});
});
});
+17 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IOption, IU8a, Registry } from '../types';
import type { AnyJson, Codec, CodecClass, Inspect, IOption, IU8a, Registry } from '../types';
import { assert, isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util';
@@ -137,6 +137,22 @@ export class Option<T extends Codec> implements IOption<T> {
return this.value.eq(other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
if (this.isNone) {
return { outer: [new Uint8Array([0])] };
}
const { inner, outer = [] } = this.#raw.inspect();
return {
inner,
outer: [new Uint8Array([1]), ...outer]
};
}
/**
* @description Returns a hex string representation of the value
*/
@@ -7,6 +7,7 @@ import type { AnyTupleValue, CodecTo } from '@polkadot/types-codec/types';
import { Metadata, TypeRegistry } from '@polkadot/types';
import { Text, Tuple, U32, U128 } from '@polkadot/types-codec';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { stringToU8a } from '@polkadot/util';
describe('Tuple', (): void => {
const registry = new TypeRegistry();
@@ -119,6 +120,17 @@ describe('Tuple', (): void => {
it('compares against inputs (mismatch)', (): void => {
expect(tuple.eq(['bazzing', 72])).toBe(false);
});
it('has a sane inspect', (): void => {
expect(
tuple.inspect()
).toEqual({
inner: [
{ outer: [new Uint8Array([7 << 2]), stringToU8a('bazzing')] },
{ outer: [new Uint8Array([69, 0, 0, 0])] }
]
});
});
});
describe('toRawType', (): void => {
+11 -8
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyTupleValue, Codec, CodecClass, ITuple, Registry } from '../types';
import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
import { isFunction, isHex, isString, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
@@ -100,6 +100,15 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
: Object.keys(this.#Types);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
return {
inner: this.inspectInner()
};
}
/**
* @description Returns the base runtime type name for this instance
*/
@@ -128,12 +137,6 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public override toU8a (isBare?: boolean): Uint8Array {
const encoded = new Array<Uint8Array>(this.length);
for (let i = 0; i < this.length; i++) {
encoded[i] = this[i].toU8a(isBare);
}
return u8aConcat(...encoded);
return u8aConcat(...this.toU8aInner(isBare));
}
}
@@ -123,6 +123,14 @@ describe('UInt', (): void => {
expect(new UInt(registry, '0x1234567890abcdef', 64).toJSON()).toEqual('0x1234567890abcdef');
});
it('has a sane inspect', (): void => {
expect(
new UInt(registry, '0x12', 16).inspect()
).toEqual({
outer: [new Uint8Array([0x12, 0x00])]
});
});
describe('eq', (): void => {
const test = new UInt(registry, 12345);
+15 -1
View File
@@ -7,7 +7,7 @@ import type { Codec, CodecTo, ITuple } from '@polkadot/types-codec/types';
import { createTypeUnsafe, GenericAccountId as AccountId, Metadata, TypeRegistry } from '@polkadot/types';
import { Text, Vec } from '@polkadot/types-codec';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { randomAsU8a } from '@polkadot/util-crypto';
import { decodeAddress, randomAsU8a } from '@polkadot/util-crypto';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
@@ -175,5 +175,19 @@ describe('Vec', (): void => {
expect(vec).toHaveLength(10);
expect(vec.slice(2, 7)).toHaveLength(5);
});
it('has a sane inspect', (): void => {
const addrs = [
'5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw', '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'
];
const vec = registry.createType('Vec<AccountId>', addrs);
expect(vec.inspect()).toEqual({
inner: addrs.map((a) => ({
outer: [decodeAddress(a)]
})),
outer: [new Uint8Array([3 << 2])]
});
});
});
});
+15 -2
View File
@@ -3,6 +3,7 @@
import { TypeRegistry } from '@polkadot/types';
import { Text, u16, VecFixed } from '@polkadot/types-codec';
import { stringToU8a } from '@polkadot/util';
describe('VecFixed', (): void => {
const registry = new TypeRegistry();
@@ -33,7 +34,7 @@ describe('VecFixed', (): void => {
let test: VecFixed<Text>;
beforeEach((): void => {
test = new (VecFixed.with(Text, 5))(registry, ['1', '2', '3', undefined, '5']);
test = new (VecFixed.with(Text, 5))(registry, ['1', '2', '3', undefined, '56']);
});
it('has a sane string types', (): void => {
@@ -43,7 +44,7 @@ describe('VecFixed', (): void => {
it('has a correct toHex', (): void => {
// each entry length 1 << 2, char as hex (0x31 === `1`), one empty
expect(test.toHex()).toEqual('0x043104320433000435');
expect(test.toHex()).toEqual('0x04310432043300083536');
});
it('has empty Uint8Array when length is 0', (): void => {
@@ -59,5 +60,17 @@ describe('VecFixed', (): void => {
expect(test.encodedLength).toEqual(1 + 5);
expect(test.toU8a()).toEqual(new Uint8Array([20, 104, 101, 108, 108, 111]));
});
it('has a sane inspect', (): void => {
expect(test.inspect()).toEqual({
inner: [
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('3')] },
{ outer: [new Uint8Array([0])] },
{ outer: [new Uint8Array([2 << 2]), stringToU8a('56')] }
]
});
});
});
});
+11 -6
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { Codec, CodecClass, Registry } from '../types';
import type { Codec, CodecClass, Inspect, Registry } from '../types';
import { assert, isU8a, u8aConcat } from '@polkadot/util';
@@ -70,14 +70,19 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
return total;
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
return {
inner: this.inspectInner()
};
}
public override toU8a (): Uint8Array {
// we override, we don't add the length prefix for ourselves, and at the same time we
// ignore isBare on entries, since they should be properly encoded at all times
const encoded = new Array<Uint8Array>(this.length);
for (let i = 0; i < this.length; i++) {
encoded[i] = this[i].toU8a();
}
const encoded = this.toU8aInner();
return encoded.length
? u8aConcat(...encoded)
@@ -5,6 +5,7 @@ import type { CodecClass, ITuple } from '@polkadot/types-codec/types';
import { TypeRegistry } from '@polkadot/types';
import { BTreeMap, Enum, I32, Struct, Text, Tuple, U32 } from '@polkadot/types-codec';
import { stringToU8a } from '@polkadot/util';
const registry = new TypeRegistry();
@@ -187,4 +188,24 @@ describe('BTreeMap', (): void => {
expect(new (BTreeMap.with(Text, Struct.with({ a: U32, b: Text })))(registry).toRawType())
.toBe('BTreeMap<Text,{"a":"u32","b":"Text"}>');
});
it('has a sane inspect', (): void => {
expect(
new (BTreeMap.with(Text, Text))(registry, new Map([
[new Text(registry, '1'), new Text(registry, 'foo')],
[new Text(registry, '2'), new Text(registry, 'bar')],
[new Text(registry, '3'), new Text(registry, 'baz')]
])).inspect()
).toEqual({
inner: [
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('3')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('baz')] }
],
outer: [new Uint8Array([3 << 2])]
});
});
});
@@ -180,4 +180,18 @@ describe('BTreeSet', (): void => {
expect(new (BTreeSet.with(Struct.with({ a: U32, b: Text })))(registry).toRawType())
.toBe('BTreeSet<{"a":"u32","b":"Text"}>');
});
it('has a sane inspect', (): void => {
expect(
new (BTreeSet.with(U32))(registry, [1, 2, 3, 4]).inspect()
).toEqual({
inner: [
{ outer: [new Uint8Array([1, 0, 0, 0])] },
{ outer: [new Uint8Array([2, 0, 0, 0])] },
{ outer: [new Uint8Array([3, 0, 0, 0])] },
{ outer: [new Uint8Array([4, 0, 0, 0])] }
],
outer: [new Uint8Array([4 << 2])]
});
});
});
+17 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, ISet, IU8a, Registry } from '../types';
import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
@@ -138,6 +138,22 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
return compareSet(this, other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
const inner = new Array<Inspect>();
for (const v of this.values()) {
inner.push(v.inspect());
}
return {
inner,
outer: [compactToU8a(this.size)]
};
}
/**
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
*/
@@ -21,12 +21,19 @@ describe('BitVec', (): void => {
).toEqual((test.length - 2) / 2);
});
// FIXME These do not align at all
it.skip('re-encodes to the same input value', (): void => {
it('re-encodes to the same input value', (): void => {
expect(
new BitVec(registry, input).toU8a()
).toEqual(input);
});
});
});
it('has a sane inspect', (): void => {
expect(
new BitVec(registry, '0x0837').inspect()
).toEqual({
outer: [new Uint8Array([0]), new Uint8Array([0x08, 0x37])]
});
});
});
+10 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyU8a, Registry } from '../types';
import type { AnyU8a, Inspect, Registry } from '../types';
import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util';
@@ -57,6 +57,15 @@ export class BitVec extends Raw {
return this.length + compactToU8a(this.#decodedLength).length;
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
return {
outer: [compactToU8a(this.#decodedLength), super.toU8a()]
};
}
public override toHuman (): string {
return `0b${[...this.toU8a(true)].map((d) => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
}
@@ -62,4 +62,12 @@ describe('Bytes', (): void => {
).toEqual(HEX);
});
});
it('has a sane inspect', (): void => {
expect(
new Bytes(registry, '0x12345678').inspect()
).toEqual({
outer: [new Uint8Array([4 << 2]), new Uint8Array([0x12, 0x34, 0x56, 0x78])]
});
});
});
+14 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyU8a, Registry } from '../types';
import type { AnyU8a, Inspect, Registry } from '../types';
import { assert, compactAddLength, compactFromU8a, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util';
@@ -60,6 +60,19 @@ export class Bytes extends Raw {
return this.length + compactToU8a(this.length).length;
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
const clength = compactToU8a(this.length);
return {
outer: this.length
? [clength, super.toU8a()]
: [clength]
};
}
/**
* @description Returns the base runtime type name for this instance
*/
@@ -3,6 +3,7 @@
import { TypeRegistry } from '@polkadot/types';
import { HashMap, Struct, Text, U32 } from '@polkadot/types-codec';
import { stringToU8a } from '@polkadot/util';
const registry = new TypeRegistry();
@@ -13,4 +14,21 @@ describe('HashMap', (): void => {
expect(new (HashMap.with(Text, Struct.with({ a: U32, b: Text })))(registry).toRawType())
.toBe('HashMap<Text,{"a":"u32","b":"Text"}>');
});
it('has a sane inspect', (): void => {
expect(
new (HashMap.with(Text, Text))(registry, new Map([
[new Text(registry, '1'), new Text(registry, 'foo')],
[new Text(registry, '2'), new Text(registry, 'bar')]
])).inspect()
).toEqual({
inner: [
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] }
],
outer: [new Uint8Array([2 << 2])]
});
});
});
+19 -1
View File
@@ -5,6 +5,7 @@ import type { CodecTo } from '@polkadot/types-codec/types';
import { TypeRegistry } from '@polkadot/types';
import { CodecMap, Text, U32 } from '@polkadot/types-codec';
import { stringToU8a } from '@polkadot/util';
const registry = new TypeRegistry();
const mockU32TextMap = new Map<Text, U32>();
@@ -60,7 +61,7 @@ describe('CodecMap', (): void => {
testEncode('toString', mockU32TextMapString);
});
describe('encoding muple values', (): void => {
describe('encoding multiple values', (): void => {
const testEncode = (to: CodecTo, expected: any): void =>
it(`can encode ${to}`, (): void => {
const s = new CodecMap(registry, Text, U32, mockU32U32Map, 'BTreeMap');
@@ -73,4 +74,21 @@ describe('CodecMap', (): void => {
testEncode('toU8a', mockU32U32MapUint8Array);
testEncode('toString', mockU32U32MapString);
});
it('has a sane inspect', (): void => {
expect(
new CodecMap(registry, Text, Text, new Map([
[new Text(registry, '1'), new Text(registry, 'foo')],
[new Text(registry, '2'), new Text(registry, 'bar')]
])).inspect()
).toEqual({
inner: [
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] }
],
outer: [new Uint8Array([2 << 2])]
});
});
});
+19 -2
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IMap, IU8a, Registry } from '../types';
import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
@@ -125,7 +125,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
let len = compactToU8a(this.size).length;
for (const [k, v] of this.entries()) {
len += v.encodedLength + k.encodedLength;
len += k.encodedLength + v.encodedLength;
}
return len;
@@ -152,6 +152,23 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
return compareMap(this, other);
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
const inner = new Array<Inspect>();
for (const [k, v] of this.entries()) {
inner.push(k.inspect());
inner.push(v.inspect());
}
return {
inner,
outer: [compactToU8a(this.size)]
};
}
/**
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
*/
@@ -28,4 +28,13 @@ describe('Range', (): void => {
it('has a sane toRawType representation', (): void => {
expect(range.toRawType()).toEqual('Range<u32>');
});
it('has a sane inspect', (): void => {
expect(range.inspect()).toEqual({
inner: [
{ outer: [new Uint8Array([1, 0, 0, 0])] },
{ outer: [new Uint8Array([2, 0, 0, 0])] }
]
});
});
});
@@ -53,17 +53,3 @@ export class Range<T extends INumber> extends Tuple {
return `${this.#rangeName}<${this.start.toRawType()}>`;
}
}
export class RangeInclusive<T extends INumber = INumber> extends Range<T> {
constructor (registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple) {
super(registry, Type, value, 'RangeInclusive');
}
public static override with <T extends INumber> (Type: CodecClass<T> | string): CodecClass<RangeInclusive<T>> {
return class extends RangeInclusive<T> {
constructor (registry: Registry, value?: AnyTuple) {
super(registry, Type, value);
}
};
}
}
@@ -0,0 +1,20 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyTuple, CodecClass, INumber, Registry } from '../types';
import { Range } from './Range';
export class RangeInclusive<T extends INumber = INumber> extends Range<T> {
constructor (registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple) {
super(registry, Type, value, 'RangeInclusive');
}
public static override with <T extends INumber> (Type: CodecClass<T> | string): CodecClass<RangeInclusive<T>> {
return class extends RangeInclusive<T> {
constructor (registry: Registry, value?: AnyTuple) {
super(registry, Type, value);
}
};
}
}
@@ -58,9 +58,15 @@ describe('U8aFixed', (): void => {
).toEqual(new Uint8Array([1, 2, 3, 4]));
});
it('hash a sane toRawType', (): void => {
it('has a sane toRawType', (): void => {
expect(u8a.toRawType()).toEqual('[u8;4]');
});
it('has a sane inspect', (): void => {
expect(u8a.inspect()).toEqual({
outer: [new Uint8Array([1, 2, 3, 4])]
});
});
});
describe('static with', (): void => {
@@ -49,4 +49,21 @@ describe('WrapperKeepOpaque', (): void => {
expect(u32.unwrap().toNumber()).toEqual(1234567);
});
it('has a sane inspect (non-decodable)', (): void => {
expect(
new ClazzUSize(registry, u8au32).inspect()
).toEqual({
outer: [new Uint8Array([4 << 2]), new Uint8Array([0x87, 0xd6, 0x12, 0x00])]
});
});
it('has a sane inspect (decodable)', (): void => {
expect(
new ClazzU32(registry, u8au32).inspect()
).toEqual({
inner: [{ outer: [new Uint8Array([0x87, 0xd6, 0x12, 0x00])] }],
outer: [new Uint8Array([4 << 2])]
});
});
});
@@ -1,15 +1,17 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyJson, AnyU8a, Codec, CodecClass, Registry } from '../types';
import type { AnyJson, AnyU8a, Codec, CodecClass, Inspect, Registry } from '../types';
import { assertReturn, compactStripLength, isHex, isU8a } from '@polkadot/util';
import { assertReturn, compactAddLength, compactStripLength, compactToU8a, isHex, isU8a } from '@polkadot/util';
import { Raw } from '../native/Raw';
import { typeToConstructor } from '../utils';
import { Bytes } from './Bytes';
function decodeRaw<T extends Codec> (registry: Registry, typeName: CodecClass<T> | string, value?: AnyU8a | Codec): [CodecClass<T>, T | null, AnyU8a] {
type OpaqueName = 'WrapperKeepOpaque' | 'WrapperOpaque';
function decodeRaw<T extends Codec> (registry: Registry, typeName: CodecClass<T> | string, value?: unknown): [CodecClass<T>, T | null, AnyU8a] {
const Type = typeToConstructor(registry, typeName);
if (isU8a(value) || isHex(value)) {
@@ -26,7 +28,7 @@ function decodeRaw<T extends Codec> (registry: Registry, typeName: CodecClass<T>
const instance = new Type(registry, value);
return [Type, instance, instance.toHex()];
return [Type, instance, compactAddLength(instance.toU8a())];
}
export class WrapperKeepOpaque<T extends Codec> extends Bytes {
@@ -34,13 +36,16 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
readonly #decoded: T | null;
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: AnyU8a | Codec) {
readonly #opaqueName: OpaqueName;
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown, opaqueName: OpaqueName = 'WrapperKeepOpaque') {
const [Type, decoded, u8a] = decodeRaw(registry, typeName, value);
super(registry, u8a);
this.#Type = Type;
this.#decoded = decoded;
this.#opaqueName = opaqueName;
}
public static with<T extends Codec> (Type: CodecClass<T> | string): CodecClass<WrapperKeepOpaque<T>> {
@@ -58,6 +63,20 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
return !!this.#decoded;
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
return this.#decoded
? {
inner: [this.#decoded.inspect()],
outer: [compactToU8a(this.length)]
}
: {
outer: [compactToU8a(this.length), this.toU8a(true)]
};
}
/**
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
@@ -71,7 +90,7 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
* @description Returns the base runtime type name for this instance
*/
public override toRawType (): string {
return `WrapperKeepOpaque<${this.registry.getClassName(this.#Type) || (this.#decoded ? this.#decoded.toRawType() : new this.#Type(this.registry).toRawType())}>`;
return `${this.#opaqueName}<${this.registry.getClassName(this.#Type) || (this.#decoded ? this.#decoded.toRawType() : new this.#Type(this.registry).toRawType())}>`;
}
/**
@@ -87,6 +106,6 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
* @description Returns the decoded that the WrapperKeepOpaque represents (if available), throws if non-decodable
*/
public unwrap (): T {
return assertReturn(this.#decoded, 'WrapperKeepOpaque: unwrapping an undecodable value');
return assertReturn(this.#decoded, () => `${this.#opaqueName}: unwrapping an undecodable value`);
}
}
@@ -3,6 +3,7 @@
import { TypeRegistry } from '@polkadot/types';
import { WrapperOpaque } from '@polkadot/types-codec';
import { u8aConcat } from '@polkadot/util';
describe('WrapperOpaque', (): void => {
const registry = new TypeRegistry();
@@ -20,6 +21,12 @@ describe('WrapperOpaque', (): void => {
).toEqual(u8au32);
});
it('u8a encodes a wrapped option correctly', (): void => {
expect(
new WrapperOpaque(registry, 'Option<u32>', 1234567).toU8a()
).toEqual(u8aConcat([5 << 2, 1], u8au32.slice(1)));
});
it('hex encodes a wrapped u32 correctly', (): void => {
expect(
new WrapperOpaque(registry, 'u32', '0x12345678').toHex()
@@ -37,4 +44,13 @@ describe('WrapperOpaque', (): void => {
new WrapperOpaque(registry, 'u32').toRawType()
).toEqual('WrapperOpaque<u32>');
});
it('has a sane inspect', (): void => {
expect(
new WrapperOpaque(registry, 'u32', '0x12345678').inspect()
).toEqual({
inner: [{ outer: [new Uint8Array([0x78, 0x56, 0x34, 0x12])] }],
outer: [new Uint8Array([4 << 2])]
});
});
});
@@ -3,29 +3,14 @@
import type { Codec, CodecClass, Registry } from '../types';
import { compactAddLength, compactStripLength, isU8a } from '@polkadot/util';
import { WrapperKeepOpaque } from './WrapperKeepOpaque';
import { Base } from '../base/Base';
import { typeToConstructor } from '../utils';
function decodeRaw<T extends Codec> (registry: Registry, Type: CodecClass<T> | string, value?: unknown): T {
const Clazz = typeToConstructor<T>(registry, Type);
if (isU8a(value)) {
const [, u8a] = compactStripLength(value);
return new Clazz(registry, u8a);
export class WrapperOpaque<T extends Codec> extends WrapperKeepOpaque<T> {
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown) {
super(registry, typeName, value, 'WrapperOpaque');
}
return new Clazz(registry, value);
}
export class WrapperOpaque<T extends Codec> extends Base<T> {
constructor (registry: Registry, Type: CodecClass<T> | string, value?: unknown) {
super(registry, decodeRaw(registry, Type, value));
}
public static with<T extends Codec> (Type: CodecClass<T> | string): CodecClass<WrapperOpaque<T>> {
public static override with<T extends Codec> (Type: CodecClass<T> | string): CodecClass<WrapperKeepOpaque<T>> {
return class extends WrapperOpaque<T> {
constructor (registry: Registry, value?: unknown) {
super(registry, Type, value);
@@ -34,20 +19,9 @@ export class WrapperOpaque<T extends Codec> extends Base<T> {
}
/**
* @description Returns the base runtime type name for this instance
* @description The inner value for this wrapper, in all cases it _should_ be decodable (unlike KeepOpaque)
*/
public override toRawType (): string {
return `WrapperOpaque<${this.inner.toRawType()}>`;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
public override toU8a (isBare?: boolean): Uint8Array {
const u8a = super.toU8a(isBare);
return isBare
? u8a
: compactAddLength(u8a);
public get inner (): T {
return this.unwrap();
}
}

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