Compare commits

...
101 Commits
Author SHA1 Message Date
github-actions[bot] 2f07e1c45f [CI Skip] release/stable 10.7.3
skip-checks: true
2023-05-28 08:05:22 +00:00
Jaco 39eff81207 10.7.3 (#5660) 2023-05-28 10:56:30 +03:00
github-actions[bot] 19f3c5b16b [CI Skip] bump/beta 10.7.3-1-x
skip-checks: true
2023-05-26 05:13:37 +00:00
Jaco cdd74ea084 .paymentInfo never mutates the existing signature (#5659) 2023-05-26 08:02:18 +03:00
github-actions[bot] 54c96ed975 [CI Skip] bump/beta 10.7.3-0-x
skip-checks: true
2023-05-25 07:41:17 +00:00
Jaco 4e507246e3 jg-bump-deps (#5656) 2023-05-25 10:30:06 +03:00
github-actions[bot] d0e0008399 [CI Skip] release/stable 10.7.2
skip-checks: true
2023-05-21 10:24:18 +00:00
Jaco a6eeba83c1 10.7.2 (#5652) 2023-05-21 13:13:34 +03:00
github-actions[bot] 541eceae82 [CI Skip] bump/beta 10.7.2-3-x
skip-checks: true
2023-05-21 09:48:40 +00:00
Jaco 3d0a1701fa Bump dev & adjust duplicated exports (#5651) 2023-05-21 12:40:07 +03:00
github-actions[bot] 0e46592f4d [CI Skip] bump/beta 10.7.2-2-x
skip-checks: true
2023-05-20 07:55:15 +00:00
polymath-eric a561253de9 Allow unset external signer (#5649) 2023-05-20 10:46:06 +03:00
github-actions[bot] 0c6a4754f0 [CI Skip] bump/beta 10.7.2-1-x
skip-checks: true
2023-05-18 09:08:21 +00:00
Jaco 60dd4e9699 Adjust tsconfig usage (w/ latest dev) (#5648) 2023-05-18 11:59:11 +03:00
github-actions[bot] f10f79c0ac [CI Skip] bump/beta 10.7.2-0-x
skip-checks: true
2023-05-18 05:51:41 +00:00
Jaco 8394c71cfa Bump dev deps (#5647)
* Bump dev deps

* Adjust

* Actual bump, fix tsconfig for typegen
2023-05-18 08:42:41 +03:00
github-actions[bot] dd0bd21d88 [CI Skip] release/stable 10.7.1
skip-checks: true
2023-05-13 09:56:51 +00:00
Jaco 58875b8125 10.7.1 (#5645) 2023-05-13 12:44:17 +03:00
github-actions[bot] 7e0586794a [CI Skip] bump/beta 10.6.2-1-x
skip-checks: true
2023-05-13 08:52:44 +00:00
Jaco d800886ee0 Bump util (#5644) 2023-05-13 11:43:50 +03:00
github-actions[bot] 0bdfc37096 [CI Skip] bump/beta 10.6.2-0-x
skip-checks: true
2023-05-13 08:05:11 +00:00
Jaco db3b3f606b Bump static metadata (#5643) 2023-05-13 10:53:47 +03:00
github-actions[bot] 717043c557 [CI Skip] release/stable 10.6.1
skip-checks: true
2023-05-07 11:40:24 +00:00
Jaco 8cee4c462a 10.6.1 (#5635) 2023-05-07 14:30:10 +03:00
github-actions[bot] f6f1646147 [CI Skip] bump/beta 10.5.2-8-x
skip-checks: true
2023-05-07 11:14:21 +00:00
Jaco dd533f9831 Update static metadata (#5634) 2023-05-07 14:02:37 +03:00
github-actions[bot] 5ba13358a5 [CI Skip] bump/beta 10.5.2-7-x
skip-checks: true
2023-05-07 09:34:16 +00:00
Jaco 3a3680194d Allow conversion of v15 metadata (#5631)
* Allow conversion of v15 metadata

* Don't output toCallsOnly in latest known

* Adjust asV* inside metadata conversions

* typo

* CHANGELOG

* CHANGELOG
2023-05-07 12:25:40 +03:00
github-actions[bot] d436e42bb0 [CI Skip] bump/beta 10.5.2-6-x
skip-checks: true
2023-05-06 09:00:47 +00:00
Jaco d6d1575ba9 Bump dev (#5632) 2023-05-06 11:52:22 +03:00
github-actions[bot] 15e5f4d401 [CI Skip] bump/beta 10.5.2-5-x
skip-checks: true
2023-05-04 12:09:06 +00:00
Jaco f4c2b150d3 Adjust rpc coder types (#5630) 2023-05-04 15:00:43 +03:00
github-actions[bot] c1d727fbe8 [CI Skip] bump/beta 10.5.2-4-x
skip-checks: true
2023-05-02 07:23:00 +00:00
Jaco 475891575b Historic Kusama Scheduler overrides (non-comprehensive) (#5629) 2023-05-02 10:14:17 +03:00
github-actions[bot] 02b7807ba5 [CI Skip] bump/beta 10.5.2-3-x
skip-checks: true
2023-05-02 06:27:33 +00:00
Florian Franzen d15f0b3ac5 metadataMd: use endpoint for rpc and runtime details too (#5628) 2023-05-02 09:17:15 +03:00
github-actions[bot] e8f782e1f2 [CI Skip] bump/beta 10.5.2-2-x
skip-checks: true
2023-05-02 05:39:18 +00:00
Jaco 0f627bed2d Adjust WebSocket check (#5627)
* Adjust WebSocket check

* Deno adjust

* Re-adjust
2023-05-02 08:30:19 +03:00
github-actions[bot] 427cf3e105 [CI Skip] bump/beta 10.5.2-1-x
skip-checks: true
2023-05-01 16:39:54 +00:00
Jaco 9e98f81dc0 Attempt to fix Deno check (#5626)
* Attemp to fix Deno check

* Adjust
2023-05-01 19:30:58 +03:00
github-actions[bot] f98422c42b [CI Skip] bump/beta 10.5.2-0-x
skip-checks: true
2023-05-01 15:25:41 +00:00
Tarik Gul 267c6242a3 Update .nvmrc (#5624)
* Update nvmrc to be inline with package.json engine

* Update to 18.15
2023-05-01 18:16:56 +03:00
github-actions[bot] 94cbbf5356 [CI Skip] release/stable 10.5.1
skip-checks: true
2023-04-29 08:56:34 +00:00
Jaco c1b1ad7843 10.5.1 (#5623) 2023-04-29 11:48:07 +03:00
github-actions[bot] ce5769471f [CI Skip] bump/beta 10.4.2-7-x
skip-checks: true
2023-04-29 06:40:36 +00:00
Jaco 09222d9055 Bump util (#5622)
* Bump util

* Adjust to fix build
2023-04-29 09:31:52 +03:00
github-actions[bot] 9c4554ddb3 [CI Skip] bump/beta 10.4.2-6-x
skip-checks: true
2023-04-28 07:46:21 +00:00
Jaco 1ba4c0c277 Allow switching on/off of isPedantic checks (#5620)
* Allow switching on/off of isPedantic checks

* CHANGELOG

* typos
2023-04-28 10:37:27 +03:00
github-actions[bot] ac46305d15 [CI Skip] bump/beta 10.4.2-5-x
skip-checks: true
2023-04-28 07:33:46 +00:00
Jaco ad59abfc37 Adjust spread usage in types/interfaces (#5610) 2023-04-28 10:23:04 +03:00
github-actions[bot] 5a48ca3a0a [CI Skip] bump/beta 10.4.2-4-x
skip-checks: true
2023-04-28 06:49:19 +00:00
Jaco d3dabadf95 Bump deps (#5619)
* Bump deps

* CHANGELOG
2023-04-28 09:40:45 +03:00
github-actions[bot] 212d0e33ae [CI Skip] bump/beta 10.4.2-3-x
skip-checks: true
2023-04-26 09:49:32 +00:00
Jaco a6adeb739f Bump deps w/ export ordering (#5614) 2023-04-26 12:40:14 +03:00
github-actions[bot] cd440ea3c4 [CI Skip] bump/beta 10.4.2-2-x
skip-checks: true
2023-04-25 06:05:26 +00:00
Jaco eb480d7ce9 Export & spread cleanups on types-known (#5609) 2023-04-25 08:56:37 +03:00
github-actions[bot] 298397f499 [CI Skip] bump/beta 10.4.2-1-x
skip-checks: true
2023-04-23 13:02:37 +00:00
Jaco 6b17bf5a7a Default to hex-only when number bits > native Rust (#5611)
* Default to hex-only when number bits > native Rust

* CHANGELOG

* Add test for > u128 case
2023-04-23 15:53:32 +03:00
github-actions[bot] 3b3da09f33 [CI Skip] bump/beta 10.4.2-0-x
skip-checks: true
2023-04-23 06:21:56 +00:00
Jaco 976d708fae Adjust Deno WebSocket check (#5608) 2023-04-23 09:13:09 +03:00
github-actions[bot] 92c250e9a7 [CI Skip] release/stable 10.4.1
skip-checks: true
2023-04-22 09:56:06 +00:00
Jaco ba43c288fe 10.4.1 (#5607) 2023-04-22 12:47:14 +03:00
github-actions[bot] ef0d1f4e8a [CI Skip] bump/beta 10.3.5-4-x
skip-checks: true
2023-04-22 09:26:11 +00:00
Jaco cc31d1176e Bump static metadata (#5606) 2023-04-22 12:17:06 +03:00
github-actions[bot] b45e0d4e0d [CI Skip] bump/beta 10.3.5-3-x
skip-checks: true
2023-04-22 09:00:43 +00:00
Jaco 3b894da9f2 Adjust AccountId20 detection with partial match (#5605) 2023-04-22 11:48:59 +03:00
github-actions[bot] 83500c05b3 [CI Skip] bump/beta 10.3.5-2-x
skip-checks: true
2023-04-22 08:35:22 +00:00
Jaco c554e5eef7 Bump common (#5604) 2023-04-22 11:26:14 +03:00
Jaco 6b655838a0 Small cleanup to author details (#5599)
* Small cleanup to author details

* CHANGELOG
2023-04-22 11:16:29 +03:00
github-actions[bot] 4bd23463ab [CI Skip] bump/beta 10.3.5-1-x
skip-checks: true
2023-04-21 10:56:23 +00:00
Jaco 9c758cce95 Bump dev (w/ Node 16+ only) (#5603) 2023-04-21 13:47:31 +03:00
github-actions[bot] abdc50f405 [CI Skip] bump/beta 10.3.5-0-x
skip-checks: true
2023-04-20 05:23:47 +00:00
Xiliang Chen b849d50995 no warm for unknown signed extensions (#5601) 2023-04-20 08:14:55 +03:00
github-actions[bot] 3d2307f12a [CI Skip] release/stable 10.3.4
skip-checks: true
2023-04-16 09:27:26 +00:00
Jaco 320135dbe5 Author extract using correct as-at state (#5598)
* Author extract using correct as-at state

* Align header retrieval

* Dedupe

* Deupe

* Adjust

* Remove deprecated events.at

* 10.3.4
2023-04-16 12:18:36 +03:00
github-actions[bot] 074e790bfc [CI Skip] release/stable 10.3.3
skip-checks: true
2023-04-15 11:41:28 +00:00
Jaco d561fc9dc7 10.3.3 (#5596) 2023-04-15 14:31:04 +03:00
rob thijssen 8b37ed6dda nimbus author mapping correction (#5590) 2023-04-15 14:14:41 +03:00
github-actions[bot] d2a7df9e0b [CI Skip] bump/beta 10.3.3-3-x
skip-checks: true
2023-04-15 10:17:04 +00:00
Jaco 66ab71b29e Bump metadata (#5595) 2023-04-15 13:08:25 +03:00
github-actions[bot] 8d2300ca3f [CI Skip] bump/beta 10.3.3-2-x
skip-checks: true
2023-04-14 14:02:47 +00:00
Jaco b4bb6613b1 Skip runtime-only type check (#5593)
* Skip runtime-only type check

* Add CHANGELOG
2023-04-14 16:53:53 +03:00
Branislav Kontur 2389ea16e1 Fungibles runtime api for statemine/statemint/westmint (#5592) 2023-04-14 16:35:26 +03:00
github-actions[bot] e33139919f [CI Skip] bump/beta 10.3.3-1-x
skip-checks: true
2023-04-14 08:26:30 +00:00
Branislav KonturandJaco 4c8e7135de Fungibles runtime api for statemine/statemint/westmint (#5584)
* Fungibles runtime api for statemine/statemint/westmint

* Update packages/types/src/interfaces/fungibles/definitions.ts

* export `./fungibles/definitions.js`

---------

Co-authored-by: Jaco <jacogr@gmail.com>
2023-04-14 11:14:08 +03:00
github-actions[bot] 4115a93ed3 [CI Skip] bump/beta 10.3.3-0-x
skip-checks: true
2023-04-13 10:19:02 +00:00
Jaco a7526ba5f3 Bump dev (#5591)
* Bump dev

* Adjust

* Adjust
2023-04-13 13:10:36 +03:00
github-actions[bot] 8fe02a1434 [CI Skip] release/stable 10.3.2
skip-checks: true
2023-04-10 05:21:37 +00:00
Jaco ac25d0704d 10.3.2 (#5589) 2023-04-10 08:13:16 +03:00
github-actions[bot] 82d0bfc51b [CI Skip] release/stable 10.3.1
skip-checks: true
2023-04-09 09:43:26 +00:00
Jaco 8e514ad511 10.3.1 (#5587) 2023-04-09 12:34:29 +03:00
github-actions[bot] abb45e5fcf [CI Skip] bump/beta 10.2.3-4-x
skip-checks: true
2023-04-09 08:55:04 +00:00
Jaco 71273dbce3 Bump metadata (#5586)
* Bump metadata

* TransactionPaymentApi/4
2023-04-09 11:46:12 +03:00
github-actions[bot] 3d5b69d6e6 [CI Skip] bump/beta 10.2.3-3-x
skip-checks: true
2023-04-07 06:33:03 +00:00
Jaco d51ddc70f9 Add BitVec.toBoolArray() helper function (#5585) 2023-04-07 09:24:11 +03:00
github-actions[bot] 9052f16e0f [CI Skip] bump/beta 10.2.3-2-x
skip-checks: true
2023-04-05 07:30:36 +00:00
Jaco dd19d17b60 Bump deps (#5580) 2023-04-05 10:22:04 +03:00
github-actions[bot] 58ba63069a [CI Skip] bump/beta 10.2.3-1-x
skip-checks: true
2023-04-04 05:38:08 +00:00
Jaco 6206569e5b Update lock wf (#5576) 2023-04-04 08:29:13 +03:00
github-actions[bot] c3bb18fbaf [CI Skip] bump/beta 10.2.3-0-x
skip-checks: true
2023-04-02 07:02:38 +00:00
Jaco 186cfc93b5 Move type-only imports (w/ verbatimModuleSyntax) (#5574) 2023-04-02 09:53:37 +03:00
375 changed files with 88639 additions and 13219 deletions
-25
View File
@@ -1,25 +0,0 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const base = require('@polkadot/dev/config/eslint.cjs');
module.exports = {
...base,
ignorePatterns: [
...base.ignorePatterns,
'/scripts'
],
parserOptions: {
...base.parserOptions,
project: [
'./tsconfig.eslint.json'
]
},
rules: {
...base.rules,
// add override for any (a metric ton of them, initial conversion)
'@typescript-eslint/no-explicit-any': 'off',
// this seems very broken atm, false positives
'@typescript-eslint/unbound-method': 'off'
}
};
+4 -4
View File
@@ -13,13 +13,13 @@ jobs:
- uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836
with:
github-token: ${{ secrets.GH_PAT_BOT }}
issue-lock-inactive-days: '7'
issue-lock-comment: >
issue-inactive-days: '7'
issue-comment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue
if you think you have a related problem or query.
pr-lock-inactive-days: '2'
pr-lock-comment: >
pr-inactive-days: '2'
pr-comment: >
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
+1 -1
View File
@@ -21,5 +21,5 @@ jobs:
- name: ${{ matrix.step }}
if: always()
run: |
yarn install --immutable | grep -v 'YN0013'
yarn install --immutable
yarn ${{ matrix.step }}
+1 -1
View File
@@ -27,5 +27,5 @@ jobs:
node-version: 'lts/*'
- name: ${{ matrix.step }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn install --immutable
yarn ${{ matrix.step }}
+1 -1
View File
@@ -1 +1 @@
14
v18.15
+5
View File
@@ -2,6 +2,11 @@ enableImmutableInstalls: false
enableProgressBars: false
logFilters:
# Discard any "cannot be found in cache" messages
- code: YN0013
level: discard
nodeLinker: node-modules
plugins:
+102
View File
@@ -1,5 +1,107 @@
# CHANGELOG
## 10.7.3 May 28, 2023
Changes:
- Ensure that `.paymentInfo` never mutates the underlying/existing signature
## 10.7.2 May 21, 2023
Contributed:
- Allow `api.setSigner(...)` to clear existing (Thanks to https://github.com/polymath-eric)
Changes:
- Adjust `@polkadot/types-create` exports with no duplicates
## 10.7.1 May 13, 2023
Changes:
- Update to latest Polkadot, Kusama & Substrate metadata
- Add `module` to `package.json` export map (ESM-only)
## 10.6.1 May 7, 2023
Contributed:
- Extract runtime details for custom documentation (Thanks to https://github.com/FlorianFranzen)
Changes:
- Apply historic `Scheduled` types for Kusama (as reported, non-comprehensive)
- Adjust Deno types inside `WsProvider`
- Allow parsing of (experimental) metadata v15
- Update to latest Polkadot, Kusama & Substrate metadata
## 10.5.1 Apr 29, 2023
Changes:
- Default to hex-only in `Int/UInt.toJSON` for > 128-bit values
- Allow for disabling of `isPedantic` storage checks in API options
- Adjust usage of `objectSpread`, default to runtime as required
- Adjust compilation output for `__internal__` class fields
- Update to latest Polkadot, Kusama & Substrate metadata
## 10.4.1 Apr 22, 2023
Contributed:
- Apply `noInitWarn` flag to signed extension warnings (Thanks to https://github.com/xlc)
Changes:
- Adjust `AccountId20` detection with partial match
- Cleanup block author extraction derives
- Update to latest Polkadot, Kusama & Substrate metadata
- Drop support for Node 14 (EOL 30 Apr 2023)
## 10.3.4 Apr 16, 2023
Changes:
- Ensure block author extract uses the correct as-at block construction state
## 10.3.3 Apr 15, 2023
Contributed:
- Add support for Fungibles runtime api (Thanks to https://github.com/bkontur)
- Update Nimbus Collator lookups (Thanks to https://github.com/grenade)
Changes:
- Update to latest Polkadot, Kusama & Substrate metadata
- Minimal support for a `@tsconfig/stricter` setup
## 10.3.2 Apr 10, 2023
Changes:
- Revert throw on MSB BitVec (`toHuman()` output is still incorrect)
## 10.3.1 Apr 9, 2023
Changes:
- Add `BitVec.toBoolArray()` helper function
- Tie down `BitVec` from metadata to only allow (default) Lsb
- Support for `TransactionPaymentApi/4`
- Update to latest Polkadot, Kusama & Substrate metadata
## 10.2.2 Apr 1, 2023
Contributed:
+7 -3
View File
@@ -1,9 +1,9 @@
3422 Jaco 10.2.2 (#5573)
3467 Jaco 10.7.3 (#5660)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
18 Xiliang Chen fix unkown rpc (#5325)
19 Xiliang Chen no warm for unknown signed extensions (#5601)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
14 Nikos Kontakis Bump substrate connect to 0.7.16 (#5307)
11 Ian He HttpProvider support clone() (#3949)
@@ -32,6 +32,7 @@
3 YJ feat: Vote interface as U8a (#1061)
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
2 Branan Riley Add proxy type for Centrifuge (#3940)
2 Branislav Kontur Fungibles runtime api for statemine/statemint/westmint (#5592)
2 Caio Add `Range` and `RangeInclusive` types (#3791)
2 HackFisher Update maxExtrinsic definition (#4703)
2 Jakub Pánik All heads subscription (#1899)
@@ -39,6 +40,7 @@
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
2 MOZGIII Follow-up fix after #4665 (#4666)
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
2 rob thijssen nimbus author mapping correction (#5590)
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)
@@ -62,6 +64,7 @@
1 Drew Stone Update evm definitions to include vicinity (#2279)
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
1 Florian Franzen metadataMd: use endpoint for rpc and runtime details too (#5628)
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)
@@ -95,11 +98,11 @@
1 Paul M Fox Basic BTreeMaps codec support (#1474)
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
1 polymath-eric Allow unset external signer (#5649)
1 Qinxuan Chen Add fp_account::AccountId20 mapping (#5551)
1 qiuhao update DeriveCustom type (#2581)
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
1 Raphael Flechtner fix: typegen disconnect ws on success (#4901)
1 rob thijssen support manta author lookup (#5561)
1 Robert Hambrock update MMR API (#5479)
1 Rocco Musolino remove broken link (#2671)
1 sander2 fix: type generation for nested tuples (#5395)
@@ -111,6 +114,7 @@
1 Sergei Pepyakin INK! -> ink! (#1347)
1 Shunji Zhan small polish (#5276)
1 Stephen Shelton Add transaction-payment runtime API V3 (#5430)
1 Tarik Gul Update .nvmrc (#5624)
1 WoeOm adapt Darwinia, Crab Network types (#3498)
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
1 yjh fix MetadataVersioned.asV12 (#2983)
+2 -2
View File
@@ -1,8 +1,8 @@
# @polkadot/api
This library provides a clean wrapper around all the methods exposed by a Polkadot/Substrate network client and defines all the types exposed by a node. For complete documentation around the classes, interfaces and their use, visit the [documentation portal](https://polkadot.js.org/docs/api/).
This library provides a clean wrapper around all the methods exposed by a Polkadot/Substrate network client and defines all the types exposed by a node. For complete documentation around the interfaces and their use, visit the [documentation portal](https://polkadot.js.org/docs/api/).
If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.md) and [UPGRADING](UPGRADING.md) guides when changing versions.
If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.md) when changing versions.
## tutorials
-201
View File
@@ -1,201 +0,0 @@
# Upgrade guide
This is an upgrade guide for users of the API. It does not attempt to detail each version (the [CHANGELOG](CHANGELOG.md) has all the changes between versions), but rather tries to explain the rationale behind major breaking changes and how users of the API should handle this.
While we try to keep the user-facing interfaces as stable as possible, sometimes you just need to make additions to move forward and improve things down the road, as painful as they may be. Like you, we are also users of the API, and eat our own dog food - and as such, feel any pains introduced first.
## 0.97.1 (and newer)
The 0.97 series lays the groundwork to allow type registration to be ties to a specific chain and a specific Api instance. In the past, 2 Api instances in the same process would share types, which mean that you could not connect to 2 independent chains with different types. This is very problematic for Polkadot chains, where the idea is to connect to multiple chains.
When using the Api, a new `Registry` will be created on using `new Api(...)` or `Api.create(...)` and this will be transparently passed when creating types. In the cases where you create type instances explicitly or create type classes for injection, you would need to make adjustments.
### Type classes
In a number of instances, developers are creating classes and making these available for interacting with their chains. For instance, an example of a custom type could be -
```js
import { Struct, Text, u32 } from '@polkadot/types';
export class Preferences extends Struct {
constructor (value?: ahy) {
super({
name: Text,
id: u32
}, value);
}
...
}
```
In the current iteration, the underlying `@polkadot/types` bases structures now require a `Registry` to be passed as the first parameter. This means that the above signature would be adjusted to -
```js
// the next import is only required for TypeScript
import { Registry } from '@polkadot/types/types';
import { Struct, Text, u32 } from '@polkadot/types';
export class Preferences extends Struct {
constructor (registry: Registry, value?: ahy) {
super(registry, {
name: Text,
id: u32
}, value);
}
...
}
```
Where the type is used or returned from the API, the `Registry` will be automatically passed to class creation.
### createType
Previously, when creating a type instance such as `BlockNumber`, you would do `api.createType('BlockNumber', <initValue>)`, this is unchanged. In the cases where you directly import from `@polkadot/types`, the following pattern is required -
```js
import { createType } from '@polkadot/types';
...
const blockNumber = createType(api.registry, 'BlockNumber', 12345);
```
In some cases, you would want to explicitly pass a `Registry` interface to the API, instead of relying on it explicitly. This is generally applicable in the cases where you want to use the `createType` independently from the API -
```js
import { ApiPromise } from '@polkadot/api';
import { TypeRegistry, createType } from '@polkadot/types';
...
const registry = new TypeRegistry();
const blockNumber = createType(registry, 'BlockNumber', 12345);
const api = await ApiPromise.create({ registry });
```
### Extrinsic metadata
In some applications, the undocumented `findFunction` has been used to determine the Api has the metadata for a specific extrinsic. The has been exposed on top of `GenericCall`, and it typically used in applications such as signers. Along with the compulsory registry, the above functions have been moved to the `Registry` itself, so if you previously had -
```js
const { meta, method, section } = GenericCall.findFunction(extrinsic.callIndex);
```
You need to change it to -
```js
const { meta, method, section } = registry.findMetaCall(extrinsic.callIndex);
```
## 0.90.1 (and newer), from 0.81.1 (and older)
The 0.90.1 release caters for the [Kusama network](https://kusama.network/) and pulls in all the changes to support [Substrate 2.x](https://github.com/paritytech/substrate), all while maintaining backwards compatibility to allow operation on networks such as [Polkadot's Alexander](https://polkadot.network/).
To support the network and the new transaction formats, a number of changes were made to how extrinsics are handled and signed. In addition, as support for ongoing work where type definitions are to be supplied by the actual node metadata, the foundation has been laid to move to type definitions as opposed to classes for runtime types.
### Modules
The first thing to be aware of is breakages when connecting to any new network, here older networks such as Alex are unaffected - the node metadata defines exactly what is available to the chain, so endpoints that worked yesterday still works today.
There will no doubt be breakages in using calls to now non-existent endpoints (as populated by the metadata) if you are upgrading your nodes to Substrate 2.x. Substrate 2.x has had a number of internal changes, where new modules and features are introduced (such as `babe` and `technicalCommittee`), some modules have been renamed (such as `contract` -> `contracts`) and modules such as `session` has been reworked to a large degree.
To cater for both 1.x and 2.x support, the [@polkadot/api-derive](packages/api-derive) endpoints, do feature detection for the node type and should continue working as-is. Additionally, a number of new derives have been added, specifically around elections.
### Type renames
To better align with the actual types from the metadata, and avoid (too much) context switching, some types from the `@polkadot/types` have been renamed. These include -
- `Vector` -> `Vec`
- `U{8|16|32|64|128|256}` have been removed, only the lowercase version of these remain, i.e. `u32`.
### Type usage
The [@polkadot/api](packages/api) has always handled the conversion of types for parameters when making calls or queries. For example, when making a transfer to `BOB` (address), any of the following is valid -
- `api.tx.balances.transfer(BOB, 12345)` - value specified as a number
- `api.tx.balances.transfer(BOB, '12345')` - value specified as a string
- `api.tx.balances.transfer(BOB, '0x3039')` - value specified as a hex
- `api.tx.balances.transfer(BOB, new BN(12345))` - value specified as a [BN](https://github.com/indutny/bn.js/)
Internally the API will take the input and convert the value into a `Balance`, serialize it using the SCALE codec and transfer it to the node. In some cases users would construct the `Balance` type manually, by importing the class and calling `new` on it. This last approach has now been removed, and where classes are still available (limited reach), discouraged.
First the rationale behind this - in all cases Substrate is very flexible, so while Polkadot (and the Substrate base), define `type Balance = u128`, this can be different between chains. (This also applies to the majority of built-in supported types). As such, type construction should be done via the actual registered types.
```js
// this is applicable everywhere, import the type creator, using the registry
import { createType } from '@polkadot/types';
// construct the Balance, of type Balance (type is inferred and available with TS)
const value = createType('Balance', 12345);
// use value here as you normally would
...
```
The impact of this will be noticeable, if you have been importing the old-style type classes from `@polkadot/types`, those imports are not available anymore. For creation, just pass everything through the `createType`.
If a TypeScript user, you can find the updated type (it is a type definition only, not a class), under `@polkadot/types/interfaces`. To do type casting, using interfaces -
```js
// import the TypeScript runtime interfaces we wish to use
import { Balance, Hash } from '@polkadot/types/interfaces';
// import the primitives we wish to use
import { createType, Compact, Vec, u32 } from '@polkadot/types';
// define an interface we want to use inside our code
interface MyProps {
balance: Compact<Balance>;
changes: Vec<Hash>;
counter?: u32;
}
// assign something to this structure
const props = {
balance: createType('Compact<Balance>', 12345),
changes: createType('Vec<Hash>', []) // empty for now
};
```
### Type definitions
One of the major pain points in working with a custom Substrate node is the definition of types to cater for chains. There are 2 approaches: defining types via a JSON format or extending your own classes in TypeScript (or JS) and injecting these. For the latter category, there are some impacts in the way you define these.
If using JSON definitions, nothing changes, your types are still defined as -
```json
{
"MyStruct": {
"balance": "Compact<Balance>",
"values": "Vec<AccountId>",
"counter": "u32"
}
}
```
For the definition of any structures using the Substrate specific types as classes, some adjustments are needed. Since the base modules types are now not available in classes, however it is needed for definitions, the following approach is encouraged -
```js
// import the ClassOf, it works the same as `createType` (along with type detection)
// and acts as a replacement for the direct import and use of specific classes
import { ClassOf, Struct, u32 } from '@polkadot/types';
export class MyStruct extends Struct {
constructor (value?: any) {
super({
balance: ClassOf('Compact<Balance>'),
values: ClassOf('Vec<AccountId>'),
counter: u32
}, value);
}
}
```
Internally the [@polkadot/types](packages/types) package now only defines classes where there are specific encoding logic applied. For all other types, the definitions are done via a JSON-like format and then the TypeScript definitions are generated from these. (In a world where nodes inject types and the type definitions are not needed, this functionality will be useful to allow TS developers to auto-generate type definitions based on what the node defines.)
### Signing transactions (Signer interface)
For users of the API signer interfaces (such as extensions and mobile signers), the interfaces have undergone some changes to cater for the extrinsic v2 format as defined by Substrate. If you are only supporting current chains (e.g. Alexander), no changes are required, however the old `sign` interface does not support chains such as Kusama, so all users are encouraged to upgrade to the new `signPayload` interface.
This has already been implemented in both the [polkadot-js extension](https://github.com/polkadot-js/extension/blob/5f22f67d558655c605eb6f6beecef6826ed6c159/packages/extension/src/page/Signer.ts#L16v) as well as the [simple single signer](https://github.com/polkadot-js/api/blob/d56905d1b566be6f17eb570ac01448378fc91b67/packages/api/test/util/SingleAccountSigner.ts#L37).
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2017-2023 @polkadot/dev authors & contributors
// SPDX-License-Identifier: Apache-2.0
import baseConfig from '@polkadot/dev/config/eslint';
export default [
...baseConfig,
{
rules: {
// add override for any (a metric ton of them, initial conversion)
'@typescript-eslint/no-explicit-any': 'off',
// we generally use this in isFunction, not via calling
'@typescript-eslint/unbound-method': 'off'
}
}
];
+7 -7
View File
@@ -14,17 +14,17 @@
},
"sideEffects": false,
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"versions": {
"git": "10.2.2",
"npm": "10.2.2"
"git": "10.7.3",
"npm": "10.7.3"
},
"workspaces": [
"packages/*"
],
"scripts": {
"build": "yarn build:interfaces && polkadot-dev-build-ts",
"build:before": "(cd packages/typegen && polkadot-dev-copy-dir scripts build/scripts)",
"build:before": "polkadot-dev-copy-dir --cd packages/typegen scripts build",
"build:interfaces": "node --loader @polkadot/dev-ts packages/typegen/scripts/polkadot-types-internal-interfaces.mjs",
"build:metadata": "yarn build:interfaces && polkadot-dev-run-test packages/types/src/metadata/v14",
"build:release": "polkadot-ci-ghact-build",
@@ -40,11 +40,11 @@
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@polkadot/dev": "^0.72.29",
"@polkadot/dev": "^0.75.10",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^18.15.11"
"@types/node": "^20.2.5"
},
"resolutions": {
"typescript": "^5.0.3"
"typescript": "^5.0.4"
}
}
+9 -9
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "API generated augmentation",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
@@ -18,15 +18,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "10.2.2",
"@polkadot/rpc-augment": "10.2.2",
"@polkadot/types": "10.2.2",
"@polkadot/types-augment": "10.2.2",
"@polkadot/types-codec": "10.2.2",
"@polkadot/util": "^11.1.3",
"tslib": "^2.5.0"
"@polkadot/api-base": "10.7.3",
"@polkadot/rpc-augment": "10.7.3",
"@polkadot/types": "10.7.3",
"@polkadot/types-augment": "10.7.3",
"@polkadot/types-codec": "10.7.3",
"@polkadot/util": "^12.2.1",
"tslib": "^2.5.2"
}
}
+6 -2
View File
@@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Bytes, Option, Vec, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec, ITuple } from '@polkadot/types-codec/types';
import type { Perbill, Permill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, KusamaRuntimeHoldReason, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, KusamaRuntimeRuntimeHoldReason, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
@@ -448,7 +448,7 @@ declare module '@polkadot/api-base/types/consts' {
/**
* The identifier of the hold reason.
**/
holdReason: KusamaRuntimeHoldReason & AugmentedConst<ApiType>;
holdReason: KusamaRuntimeRuntimeHoldReason & AugmentedConst<ApiType>;
/**
* The number of blocks between consecutive attempts to dequeue bids and create receipts.
*
@@ -700,6 +700,10 @@ declare module '@polkadot/api-base/types/consts' {
maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* The maximum number of scheduled calls in the queue for a single block.
*
* NOTE:
* + Dependent pallets' benchmarks might require a higher limit for the setting. Set a
* higher limit under `runtime-benchmarks` feature.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
+1 -9
View File
@@ -914,9 +914,6 @@ declare module '@polkadot/api-base/types/errors' {
* The portion supplied is beyond the value of the receipt.
**/
PortionTooBig: AugmentedError<ApiType>;
Release1: AugmentedError<ApiType>;
Release2: AugmentedError<ApiType>;
Tah: AugmentedError<ApiType>;
/**
* The thaw throttle has been reached for this period.
**/
@@ -1299,11 +1296,6 @@ declare module '@polkadot/api-base/types/errors' {
* Para is not registered in our system.
**/
NotRegistered: AugmentedError<ApiType>;
/**
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
* is disabled.
**/
PvfCheckDisabled: AugmentedError<ApiType>;
/**
* The given validator already has cast a vote.
**/
@@ -2106,7 +2098,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
Filtered: AugmentedError<ApiType>;
/**
* The unlock operation cannot succeed because there are still users of the lock.
* The unlock operation cannot succeed because there are still consumers of the lock.
**/
InUse: AugmentedError<ApiType>;
/**
+17
View File
@@ -75,6 +75,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -112,6 +116,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
@@ -626,6 +634,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -663,6 +675,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
@@ -1008,6 +1024,7 @@ declare module '@polkadot/api-base/types/events' {
Deregistered: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
Registered: AugmentedEvent<ApiType, [paraId: u32, manager: AccountId32], { paraId: u32, manager: AccountId32 }>;
Reserved: AugmentedEvent<ApiType, [paraId: u32, who: AccountId32], { paraId: u32, who: AccountId32 }>;
Swapped: AugmentedEvent<ApiType, [paraId: u32, otherId: u32], { paraId: u32, otherId: u32 }>;
/**
* Generic event
**/
+12 -11
View File
@@ -11,7 +11,7 @@ import type { BTreeSet, Bytes, Null, Option, Struct, U8aFixed, Vec, WrapperOpaqu
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeHoldReason, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletConvictionVotingVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsDisputesSlashingPendingSlashes, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeRuntimeHoldReason, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletConvictionVotingVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsDisputesSlashingPendingSlashes, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -207,7 +207,7 @@ declare module '@polkadot/api-base/types/storage' {
* Holds on account balances.
**/
holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<{
readonly id: KusamaRuntimeHoldReason;
readonly id: KusamaRuntimeRuntimeHoldReason;
readonly amount: u128;
} & Struct>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
@@ -370,6 +370,10 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
dmp: {
/**
* The number to multiply the base delivery fee by.
**/
deliveryFeeFactor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* A mapping that stores the downward message queue MQC head for each para.
*
@@ -409,6 +413,8 @@ declare module '@polkadot/api-base/types/storage' {
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
*
* Always sorted by score.
**/
queuedSolution: AugmentedQuery<ApiType, () => Observable<Option<PalletElectionProviderMultiPhaseReadySolution>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -994,15 +1000,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
@@ -2111,6 +2108,10 @@ declare module '@polkadot/api-base/types/storage' {
* of our versions we informed them of.
**/
versionNotifyTargets: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => Observable<Option<ITuple<[u64, SpWeightsWeightV2Weight, u32]>>>, [u32, XcmVersionedMultiLocation]> & QueryableStorageEntry<ApiType, [u32, XcmVersionedMultiLocation]>;
/**
* Global suspension state of the XCM executor.
**/
xcmExecutionSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
+1 -1
View File
@@ -369,7 +369,7 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/3 */
/** 0x37c8bb1350a9a2a8/4 */
transactionPaymentApi: {
/**
* The transaction fee details
+16 -18
View File
@@ -11,7 +11,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, bool, u128, u16, u32, u64,
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsClaimPermission, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpPerbill, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4InherentData, PolkadotPrimitivesV4PvfCheckStatement, PolkadotPrimitivesV4ValidatorAppSignature, PolkadotPrimitivesVstagingAsyncBackingParams, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeParachainsDisputesSlashingDisputeProof, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsClaimPermission, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpPerbill, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4InherentData, PolkadotPrimitivesV4PvfCheckStatement, PolkadotPrimitivesV4ValidatorAppSignature, PolkadotPrimitivesVstagingAsyncBackingParams, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeParachainsDisputesSlashingDisputeProof, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
@@ -589,6 +589,10 @@ declare module '@polkadot/api-base/types/submittable' {
* Set the dispute post conclusion acceptance period.
**/
setDisputePostConclusionAcceptancePeriod: AugmentedSubmittable<(updated: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Set PVF executor parameters.
**/
setExecutorParams: AugmentedSubmittable<(updated: PolkadotPrimitivesV4ExecutorParams) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV4ExecutorParams]>;
/**
* Set the parachain validator-group rotation frequency
**/
@@ -948,12 +952,6 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
dmp: {
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
@@ -3495,7 +3493,6 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Make some on-chain remark.
*
* ## Complexity
* - `O(1)`
**/
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
@@ -3505,16 +3502,10 @@ declare module '@polkadot/api-base/types/submittable' {
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code.
*
* ## Complexity
* - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`
**/
setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code without doing any checks of the given `code`.
*
* ## Complexity
* - `O(C)` where `C` length of `code`
**/
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
@@ -3877,22 +3868,29 @@ declare module '@polkadot/api-base/types/submittable' {
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable.
**/
forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
/**
* Ask a location to notify us regarding their XCM version and any changes to it.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we should subscribe for XCM version notifications.
**/
forceSubscribeVersionNotify: AugmentedSubmittable<(location: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation]>;
/**
* Set or unset the global suspension state of the XCM executor.
*
* - `origin`: Must be an origin specified by AdminOrigin.
* - `suspended`: `true` to suspend, `false` to resume.
**/
forceSuspension: AugmentedSubmittable<(suspended: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [bool]>;
/**
* Require that a particular destination should no longer notify us regarding any XCM
* version changes.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we are currently subscribed for XCM version
* notifications which we no longer desire.
**/
@@ -3901,7 +3899,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Extoll that a particular destination can be communicated with through a particular
* version of XCM.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The destination that is being described.
* - `xcm_version`: The latest version of XCM that `location` supports.
**/
+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: '10.2.2' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.7.3' };
@@ -179,6 +179,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
council: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
crowdloan: {
/**
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
@@ -660,6 +670,10 @@ declare module '@polkadot/api-base/types/consts' {
maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* The maximum number of scheduled calls in the queue for a single block.
*
* NOTE:
* + Dependent pallets' benchmarks might require a higher limit for the setting. Set a
* higher limit under `runtime-benchmarks` feature.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
@@ -783,6 +797,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
technicalCommittee: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks. Beware that this is different to the *expected*
+32 -6
View File
@@ -1232,11 +1232,6 @@ declare module '@polkadot/api-base/types/errors' {
* Para is not registered in our system.
**/
NotRegistered: AugmentedError<ApiType>;
/**
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
* is disabled.
**/
PvfCheckDisabled: AugmentedError<ApiType>;
/**
* The given validator already has cast a vote.
**/
@@ -1308,6 +1303,37 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
parasSlashing: {
/**
* The given slashing report is valid but already previously reported.
**/
DuplicateSlashingReport: AugmentedError<ApiType>;
/**
* The candidate hash is invalid.
**/
InvalidCandidateHash: AugmentedError<ApiType>;
/**
* The key ownership proof is invalid.
**/
InvalidKeyOwnershipProof: AugmentedError<ApiType>;
/**
* The session index is too old or invalid.
**/
InvalidSessionIndex: AugmentedError<ApiType>;
/**
* There is no pending slash for the given validator index and time
* slot.
**/
InvalidValidatorIndex: AugmentedError<ApiType>;
/**
* The validator index does not match the validator id.
**/
ValidatorIndexIdMismatch: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
phragmenElection: {
/**
* Duplicated candidate submission.
@@ -2028,7 +2054,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
Filtered: AugmentedError<ApiType>;
/**
* The unlock operation cannot succeed because there are still users of the lock.
* The unlock operation cannot succeed because there are still consumers of the lock.
**/
InUse: AugmentedError<ApiType>;
/**
@@ -75,6 +75,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -112,6 +116,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
@@ -926,6 +934,7 @@ declare module '@polkadot/api-base/types/events' {
Deregistered: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
Registered: AugmentedEvent<ApiType, [paraId: u32, manager: AccountId32], { paraId: u32, manager: AccountId32 }>;
Reserved: AugmentedEvent<ApiType, [paraId: u32, who: AccountId32], { paraId: u32, who: AccountId32 }>;
Swapped: AugmentedEvent<ApiType, [paraId: u32, otherId: u32], { paraId: u32, otherId: u32 }>;
/**
* Generic event
**/
+25 -10
View File
@@ -11,7 +11,7 @@ import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool,
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 { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletReferendaReferendumInfo, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletReferendaReferendumInfo, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsDisputesSlashingPendingSlashes, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -469,6 +469,10 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
dmp: {
/**
* The number to multiply the base delivery fee by.
**/
deliveryFeeFactor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* A mapping that stores the downward message queue MQC head for each para.
*
@@ -508,6 +512,8 @@ declare module '@polkadot/api-base/types/storage' {
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
*
* Always sorted by score.
**/
queuedSolution: AugmentedQuery<ApiType, () => Observable<Option<PalletElectionProviderMultiPhaseReadySolution>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -946,15 +952,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
@@ -1267,6 +1264,20 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
parasSlashing: {
/**
* Validators pending dispute slashes.
**/
unappliedSlashes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotRuntimeParachainsDisputesSlashingPendingSlashes>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/**
* `ValidatorSetCount` per session.
**/
validatorSetCounts: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
phragmenElection: {
/**
* The present candidate list. A current member or runner-up can never enter this vector
@@ -2054,6 +2065,10 @@ declare module '@polkadot/api-base/types/storage' {
* of our versions we informed them of.
**/
versionNotifyTargets: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => Observable<Option<ITuple<[u64, SpWeightsWeightV2Weight, u32]>>>, [u32, XcmVersionedMultiLocation]> & QueryableStorageEntry<ApiType, [u32, XcmVersionedMultiLocation]>;
/**
* Global suspension state of the XCM executor.
**/
xcmExecutionSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
+1 -1
View File
@@ -369,7 +369,7 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/3 */
/** 0x37c8bb1350a9a2a8/4 */
transactionPaymentApi: {
/**
* The transaction fee details
+23 -72
View File
@@ -11,7 +11,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, bool, u128, u16, u32, u64,
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsClaimPermission, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpPerbill, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4InherentData, PolkadotPrimitivesV4PvfCheckStatement, PolkadotPrimitivesV4ValidatorAppSignature, PolkadotPrimitivesVstagingAsyncBackingParams, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsClaimPermission, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpPerbill, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4InherentData, PolkadotPrimitivesV4PvfCheckStatement, PolkadotPrimitivesV4ValidatorAppSignature, PolkadotPrimitivesVstagingAsyncBackingParams, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeParachainsDisputesSlashingDisputeProof, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
@@ -589,6 +589,10 @@ declare module '@polkadot/api-base/types/submittable' {
* Set the dispute post conclusion acceptance period.
**/
setDisputePostConclusionAcceptancePeriod: AugmentedSubmittable<(updated: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Set PVF executor parameters.
**/
setExecutorParams: AugmentedSubmittable<(updated: PolkadotPrimitivesV4ExecutorParams) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV4ExecutorParams]>;
/**
* Set the parachain validator-group rotation frequency
**/
@@ -903,33 +907,6 @@ declare module '@polkadot/api-base/types/submittable' {
* - `P2` is proposal-count (code-bounded)
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
*
* May be called by any signed account in order to finish voting and close the proposal.
*
* If called before the end of the voting period it will only close the vote if it is
* has enough votes to be approved or disapproved.
*
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
* proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
*
* ## Complexity
* - `O(B + M + P1 + P2)` where:
* - `B` is `proposal` size in bytes (length-fee-bounded)
* - `M` is members-count (code- and governance-bounded)
* - `P1` is the complexity of `proposal` preimage.
* - `P2` is proposal-count (code-bounded)
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current
* state.
@@ -1365,12 +1342,6 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
dmp: {
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
@@ -2408,6 +2379,13 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
parasSlashing: {
reportDisputeLostUnsigned: AugmentedSubmittable<(disputeProof: PolkadotRuntimeParachainsDisputesSlashingDisputeProof | { timeSlot?: any; kind?: any; validatorIndex?: any; validatorId?: any } | string | Uint8Array, keyOwnerProof: SpSessionMembershipProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotRuntimeParachainsDisputesSlashingDisputeProof, SpSessionMembershipProof]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
phragmenElection: {
/**
* Clean all voters who are defunct (i.e. they do not serve any purpose at all). The
@@ -3348,7 +3326,6 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Make some on-chain remark.
*
* ## Complexity
* - `O(1)`
**/
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
@@ -3358,16 +3335,10 @@ declare module '@polkadot/api-base/types/submittable' {
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code.
*
* ## Complexity
* - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`
**/
setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code without doing any checks of the given `code`.
*
* ## Complexity
* - `O(C)` where `C` length of `code`
**/
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
@@ -3411,33 +3382,6 @@ declare module '@polkadot/api-base/types/submittable' {
* - `P2` is proposal-count (code-bounded)
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
*
* May be called by any signed account in order to finish voting and close the proposal.
*
* If called before the end of the voting period it will only close the vote if it is
* has enough votes to be approved or disapproved.
*
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
* proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
*
* ## Complexity
* - `O(B + M + P1 + P2)` where:
* - `B` is `proposal` size in bytes (length-fee-bounded)
* - `M` is members-count (code- and governance-bounded)
* - `P1` is the complexity of `proposal` preimage.
* - `P2` is proposal-count (code-bounded)
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current
* state.
@@ -4043,22 +3987,29 @@ declare module '@polkadot/api-base/types/submittable' {
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable.
**/
forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
/**
* Ask a location to notify us regarding their XCM version and any changes to it.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we should subscribe for XCM version notifications.
**/
forceSubscribeVersionNotify: AugmentedSubmittable<(location: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation]>;
/**
* Set or unset the global suspension state of the XCM executor.
*
* - `origin`: Must be an origin specified by AdminOrigin.
* - `suspended`: `true` to suspend, `false` to resume.
**/
forceSuspension: AugmentedSubmittable<(suspended: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [bool]>;
/**
* Require that a particular destination should no longer notify us regarding any XCM
* version changes.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we are currently subscribed for XCM version
* notifications which we no longer desire.
**/
@@ -4067,7 +4018,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Extoll that a particular destination can be communicated with through a particular
* version of XCM.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The destination that is being described.
* - `xcm_version`: The latest version of XCM that `location` supports.
**/
@@ -41,6 +41,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
allianceMotion: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
assets: {
/**
* The amount of funds that must be reserved when creating a new approval.
@@ -199,6 +209,10 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec;
};
contracts: {
/**
* Fallback value to limit the storage deposit if it's not being set by the caller.
**/
defaultDepositLimit: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance a caller has to pay for each byte of storage.
*
@@ -284,6 +298,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
council: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
@@ -998,6 +1022,10 @@ declare module '@polkadot/api-base/types/consts' {
maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* The maximum number of scheduled calls in the queue for a single block.
*
* NOTE:
* + Dependent pallets' benchmarks might require a higher limit for the setting. Set a
* higher limit under `runtime-benchmarks` feature.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
@@ -1117,6 +1145,36 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
statement: {
/**
* Cost of data byte used for priority calculation.
**/
byteCost: u128 & AugmentedConst<ApiType>;
/**
* Maximum data bytes allowed per account.
**/
maxAllowedBytes: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of statements allowed per account.
**/
maxAllowedStatements: u32 & AugmentedConst<ApiType>;
/**
* Minimum data bytes allowed per account.
**/
minAllowedBytes: u32 & AugmentedConst<ApiType>;
/**
* Minimum number of statements allowed per account.
**/
minAllowedStatements: u32 & AugmentedConst<ApiType>;
/**
* Min balance for priority statements.
**/
statementCost: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
stateTrieMigration: {
/**
* Maximal number of bytes that a key can have.
@@ -1181,6 +1239,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
technicalCommittee: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks. Beware that this is different to the *expected*
+14 -3
View File
@@ -160,6 +160,20 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
assetRate: {
/**
* The given asset ID already has an assigned conversion rate and cannot be re-created.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* The given asset ID is unknown.
**/
UnknownAssetId: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
assets: {
/**
* The asset-account already exists.
@@ -1465,9 +1479,6 @@ declare module '@polkadot/api-base/types/errors' {
* The portion supplied is beyond the value of the receipt.
**/
PortionTooBig: AugmentedError<ApiType>;
Release1: AugmentedError<ApiType>;
Release2: AugmentedError<ApiType>;
Tah: AugmentedError<ApiType>;
/**
* The thaw throttle has been reached for this period.
**/
+37 -2
View File
@@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedEvent } 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, Perbill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletConvictionVotingTally, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNftsAttributeNamespace, PalletNftsPalletAttributes, PalletNftsPriceWithDirection, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletContractsOrigin, PalletConvictionVotingTally, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNftsAttributeNamespace, PalletNftsPalletAttributes, PalletNftsPriceWithDirection, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpStatementStoreStatement, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -109,6 +109,15 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
assetRate: {
AssetRateCreated: AugmentedEvent<ApiType, [assetId: u32, rate: u128], { assetId: u32, rate: u128 }>;
AssetRateRemoved: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
AssetRateUpdated: AugmentedEvent<ApiType, [assetId: u32, old: u128, new_: u128], { assetId: u32, old: u128, new_: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
assets: {
/**
* Accounts were destroyed for given asset.
@@ -142,6 +151,10 @@ declare module '@polkadot/api-base/types/events' {
* Some asset `asset_id` was thawed.
**/
AssetThawed: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* Some account `who` was blocked.
**/
Blocked: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some assets were destroyed.
**/
@@ -190,6 +203,10 @@ declare module '@polkadot/api-base/types/events' {
* Some account `who` was thawed.
**/
Thawed: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some account `who` was created with a deposit from `depositor`.
**/
Touched: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32, depositor: AccountId32], { assetId: u32, who: AccountId32, depositor: AccountId32 }>;
/**
* Some assets were transferred.
**/
@@ -237,6 +254,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -274,6 +295,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
@@ -365,7 +390,7 @@ declare module '@polkadot/api-base/types/events' {
* calls. This is because on failure all storage changes including events are
* rolled back.
**/
Called: AugmentedEvent<ApiType, [caller: AccountId32, contract: AccountId32], { caller: AccountId32, contract: AccountId32 }>;
Called: AugmentedEvent<ApiType, [caller: PalletContractsOrigin, contract: AccountId32], { caller: PalletContractsOrigin, contract: AccountId32 }>;
/**
* A code with the specified hash was removed.
**/
@@ -1629,6 +1654,16 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
statement: {
/**
* A new statement is submitted
**/
NewStatement: AugmentedEvent<ApiType, [account: AccountId32, statement: SpStatementStoreStatement], { account: AccountId32, statement: SpStatementStoreStatement }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
stateTrieMigration: {
/**
* The auto migration task finished.
+14 -9
View File
@@ -85,6 +85,18 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assetRate: {
/**
* Maps an asset to its fixed point representation in the native balance.
*
* E.g. `native_amount = asset_amount * ConversionRateToNative::<T>::get(asset_id)`
**/
conversionRateToNative: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u128>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assets: {
/**
* The holdings of a specific account for a specific asset.
@@ -574,6 +586,8 @@ declare module '@polkadot/api-base/types/storage' {
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
*
* Always sorted by score.
**/
queuedSolution: AugmentedQuery<ApiType, () => Observable<Option<PalletElectionProviderMultiPhaseReadySolution>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -1138,15 +1152,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
@@ -324,7 +324,7 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37c8bb1350a9a2a8/3 */
/** 0x37c8bb1350a9a2a8/4 */
transactionPaymentApi: {
/**
* The transaction fee details
+80 -101
View File
@@ -39,12 +39,6 @@ declare module '@polkadot/api-base/types/submittable' {
* Must be called by a Fellow.
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved, or whose voting period has ended.
*
* Must be called by a Fellow.
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disband the Alliance, remove all active members and unreserve deposits.
*
@@ -145,33 +139,6 @@ declare module '@polkadot/api-base/types/submittable' {
* - `P2` is proposal-count (code-bounded)
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
*
* May be called by any signed account in order to finish voting and close the proposal.
*
* If called before the end of the voting period it will only close the vote if it is
* has enough votes to be approved or disapproved.
*
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
* proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
*
* ## Complexity
* - `O(B + M + P1 + P2)` where:
* - `B` is `proposal` size in bytes (length-fee-bounded)
* - `M` is members-count (code- and governance-bounded)
* - `P1` is the complexity of `proposal` preimage.
* - `P2` is proposal-count (code-bounded)
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current
* state.
@@ -258,6 +225,33 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
assetRate: {
/**
* Initialize a conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
create: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array, rate: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u128]>;
/**
* Remove an existing conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
remove: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Update the conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
update: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array, rate: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u128]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
assets: {
/**
* Approve an amount of asset for transfer by a delegated third-party account.
@@ -282,6 +276,19 @@ declare module '@polkadot/api-base/types/submittable' {
* Weight: `O(1)`
**/
approveTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
/**
* Disallow further unprivileged transfers of an asset `id` to and from an account `who`.
*
* Origin must be Signed and the sender should be the Freezer of the asset `id`.
*
* - `id`: The identifier of the account's asset.
* - `who`: The account to be unblocked.
*
* Emits `Blocked`.
*
* Weight: `O(1)`
**/
block: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
/**
* Reduce the balance of `who` by as much as possible up to `amount` assets of `id`.
*
@@ -512,7 +519,9 @@ declare module '@polkadot/api-base/types/submittable' {
**/
forceTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, Compact<u128>]>;
/**
* Disallow further unprivileged transfers from an account.
* Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`
* must already exist as an entry in `Account`s of the asset. If you want to freeze an
* account that does not have an entry, use `touch_other` first.
*
* Origin must be Signed and the sender should be the Freezer of the asset `id`.
*
@@ -552,16 +561,31 @@ declare module '@polkadot/api-base/types/submittable' {
**/
mint: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
/**
* Return the deposit (if any) of an asset account.
* Return the deposit (if any) of an asset account or a consumer reference (if any) of an
* account.
*
* The origin must be Signed.
*
* - `id`: The identifier of the asset for the account to be created.
* - `id`: The identifier of the asset for which the caller would like the deposit
* refunded.
* - `allow_burn`: If `true` then assets may be destroyed in order to complete the refund.
*
* Emits `Refunded` event when successful.
**/
refund: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, allowBurn: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, bool]>;
/**
* Return the deposit (if any) of a target asset account. Useful if you are the depositor.
*
* The origin must be Signed and either the account owner, depositor, or asset `Admin`. In
* order to burn a non-zero balance of the asset, the caller must be the account and should
* use `refund`.
*
* - `id`: The identifier of the asset for the account holding a deposit.
* - `who`: The account to refund.
*
* Emits `Refunded` event when successful.
**/
refundOther: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
/**
* Set the metadata for an asset.
*
@@ -626,7 +650,7 @@ declare module '@polkadot/api-base/types/submittable' {
**/
startDestroy: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Allow unprivileged transfers from an account again.
* Allow unprivileged transfers to and from an account again.
*
* Origin must be Signed and the sender should be the Admin of the asset `id`.
*
@@ -662,6 +686,19 @@ declare module '@polkadot/api-base/types/submittable' {
* Emits `Touched` event when successful.
**/
touch: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Create an asset account for `who`.
*
* A deposit will be taken from the signer account.
*
* - `origin`: Must be Signed by `Freezer` or `Admin` of the asset `id`; the signer account
* must have sufficient funds for a deposit to be taken.
* - `id`: The identifier of the asset for the account to be created.
* - `who`: The account to be created.
*
* Emits `Touched` event when successful.
**/
touchOther: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
/**
* Move some assets from the sender account to another.
*
@@ -1506,33 +1543,6 @@ declare module '@polkadot/api-base/types/submittable' {
* - `P2` is proposal-count (code-bounded)
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
*
* May be called by any signed account in order to finish voting and close the proposal.
*
* If called before the end of the voting period it will only close the vote if it is
* has enough votes to be approved or disapproved.
*
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
* proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
*
* ## Complexity
* - `O(B + M + P1 + P2)` where:
* - `B` is `proposal` size in bytes (length-fee-bounded)
* - `M` is members-count (code- and governance-bounded)
* - `P1` is the complexity of `proposal` preimage.
* - `P2` is proposal-count (code-bounded)
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current
* state.
@@ -4613,7 +4623,7 @@ declare module '@polkadot/api-base/types/submittable' {
* NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned
* unless the `origin` falls below _existential deposit_ and gets removed as dust.
**/
bond: AugmentedSubmittable<(controller: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, payee: PalletStakingRewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>, PalletStakingRewardDestination]>;
bond: AugmentedSubmittable<(value: Compact<u128> | AnyNumber | Uint8Array, payee: PalletStakingRewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, PalletStakingRewardDestination]>;
/**
* Add some extra amount that have appeared in the stash `free_balance` into the balance up
* for staking.
@@ -4825,7 +4835,10 @@ declare module '@polkadot/api-base/types/submittable' {
**/
scaleValidatorCount: AugmentedSubmittable<(factor: Percent | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Percent]>;
/**
* (Re-)set the controller of a stash.
* (Re-)sets the controller of a stash to the stash itself. This function previously
* accepted a `controller` argument to set the controller to an account other than the
* stash itself. This functionality has now been removed, now only setting the controller
* to the stash, if it is not already.
*
* Effects will be felt instantly (as soon as this function is completed successfully).
*
@@ -4837,7 +4850,7 @@ declare module '@polkadot/api-base/types/submittable' {
* - Contains a limited number of reads.
* - Writes are limited to the `origin` account key.
**/
setController: AugmentedSubmittable<(controller: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
setController: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Set the validators who cannot be slashed (if any).
*
@@ -5076,7 +5089,6 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Make some on-chain remark.
*
* ## Complexity
* - `O(1)`
**/
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
@@ -5086,16 +5098,10 @@ declare module '@polkadot/api-base/types/submittable' {
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code.
*
* ## Complexity
* - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`
**/
setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the new runtime code without doing any checks of the given `code`.
*
* ## Complexity
* - `O(C)` where `C` length of `code`
**/
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
@@ -5139,33 +5145,6 @@ declare module '@polkadot/api-base/types/submittable' {
* - `P2` is proposal-count (code-bounded)
**/
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: SpWeightsWeightV2Weight | { refTime?: any; proofSize?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, SpWeightsWeightV2Weight, Compact<u32>]>;
/**
* Close a vote that is either approved, disapproved or whose voting period has ended.
*
* May be called by any signed account in order to finish voting and close the proposal.
*
* If called before the end of the voting period it will only close the vote if it is
* has enough votes to be approved or disapproved.
*
* If called after the end of the voting period abstentions are counted as rejections
* unless there is a prime member set and the prime member cast an approval.
*
* If the close operation completes successfully with disapproval, the transaction fee will
* be waived. Otherwise execution of the approved operation will be charged to the caller.
*
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
* proposal.
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
*
* ## Complexity
* - `O(B + M + P1 + P2)` where:
* - `B` is `proposal` size in bytes (length-fee-bounded)
* - `M` is members-count (code- and governance-bounded)
* - `P1` is the complexity of `proposal` preimage.
* - `P2` is proposal-count (code-bounded)
**/
closeOldWeight: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
/**
* Disapprove a proposal, close, and remove it from the system, regardless of its current
* state.
+1
View File
@@ -7,6 +7,7 @@
},
"exclude": [
"**/*.spec.ts",
"**/mod.ts",
"**/kusama/*.ts",
"**/polkadot/*.ts"
],
@@ -1,22 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/kusama/*.spec.ts"
],
"references": [
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../api-augment/tsconfig.kusama.json" },
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
+7 -7
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-base#readme",
"license": "Apache-2.0",
@@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.2.2",
"@polkadot/types": "10.2.2",
"@polkadot/util": "^11.1.3",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
"@polkadot/rpc-core": "10.7.3",
"@polkadot/types": "10.7.3",
"@polkadot/util": "^12.2.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.2"
}
}
+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: '10.2.2' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.7.3' };
+2 -2
View File
@@ -13,7 +13,7 @@ export interface ApiInterfaceRx {
call: QueryableCalls<'rxjs'>;
consts: QueryableConsts<'rxjs'>;
extrinsicType: number;
genesisHash?: Hash;
genesisHash?: Hash | undefined;
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
@@ -22,7 +22,7 @@ export interface ApiInterfaceRx {
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
tx: SubmittableExtrinsics<'rxjs'>;
signer?: Signer;
signer?: Signer | undefined;
callAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableCalls<'rxjs'>>;
queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableStorage<'rxjs'>>;
+1 -2
View File
@@ -3,8 +3,7 @@
import type { Observable } from 'rxjs';
import type { AnyFunction, AnyJson, Callback, DefinitionRpc } from '@polkadot/types/types';
import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base.js';
import type { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base.js';
export type { AugmentedRpc } from '@polkadot/rpc-core/types';
+4 -4
View File
@@ -40,13 +40,13 @@ export type SubmittablePaymentResult<ApiType extends ApiTypes> =
: Promise<RuntimeDispatchInfo>;
export interface SubmittableResultValue {
dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo;
dispatchError?: DispatchError | undefined;
dispatchInfo?: DispatchInfo | undefined;
events?: EventRecord[];
internalError?: Error;
internalError?: Error | undefined;
status: ExtrinsicStatus;
txHash: Hash;
txIndex?: number;
txIndex?: number | undefined;
blockNumber?: BlockNumber;
}
+3
View File
@@ -5,6 +5,9 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/mod.ts"
],
"references": [
{ "path": "../rpc-core/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" }
+12 -12
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"license": "Apache-2.0",
@@ -18,20 +18,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.2.2",
"@polkadot/types": "10.2.2",
"@polkadot/types-codec": "10.2.2",
"@polkadot/types-create": "10.2.2",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
"@polkadot/api": "10.7.3",
"@polkadot/types": "10.7.3",
"@polkadot/types-codec": "10.7.3",
"@polkadot/types-create": "10.7.3",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.2"
},
"devDependencies": {
"@polkadot/api-augment": "10.2.2",
"@polkadot/keyring": "^11.1.3"
"@polkadot/api-augment": "10.7.3",
"@polkadot/keyring": "^12.2.1"
}
}
+5 -2
View File
@@ -93,10 +93,13 @@ describe('Abi', (): void => {
const abi = new Abi(abiJson);
const registryJson = stringifyJson(abi.registry);
const cmpFile = path.join(cmpPath, `${abiName}.test.json`);
const cmpText = fs.readFileSync(cmpFile, 'utf-8');
try {
expect(JSON.parse(registryJson)).toEqual(JSON.parse(cmpText));
expect(
JSON.parse(registryJson)
).toEqual(
JSON.parse(fs.readFileSync(cmpFile, 'utf-8'))
);
} catch (error) {
if (process.env.GITHUB_REPOSITORY) {
console.error(registryJson);
+1 -1
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { WeightV2 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { ApiBase } from '@polkadot/api/base';
import { isFunction } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
+3 -3
View File
@@ -1,18 +1,18 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN_ZERO, isUndefined } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Contract } from './Contract.js';
@@ -23,7 +23,7 @@ export interface BlueprintConstructor<ApiType extends ApiTypes> {
}
export class BlueprintSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
readonly contract?: Contract<ApiType>;
readonly contract?: Contract<ApiType> | undefined;
constructor (result: ISubmittableResult, contract?: Contract<ApiType>) {
super(result);
+8 -8
View File
@@ -1,19 +1,19 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Codec } from '@polkadot/types-codec/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Blueprint } from './Blueprint.js';
@@ -25,10 +25,10 @@ export interface CodeConstructor<ApiType extends ApiTypes> {
}
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
readonly blueprint?: Blueprint<ApiType>;
readonly contract?: Contract<ApiType>;
readonly blueprint?: Blueprint<ApiType> | undefined;
readonly contract?: Contract<ApiType> | undefined;
constructor (result: ISubmittableResult, blueprint?: Blueprint<ApiType>, contract?: Contract<ApiType>) {
constructor (result: ISubmittableResult, blueprint?: Blueprint<ApiType> | undefined, contract?: Contract<ApiType> | undefined) {
super(result);
this.blueprint = blueprint;
@@ -77,14 +77,14 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
encodeSalt(salt)
).withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
records.reduce<[Blueprint<ApiType> | undefined, Contract<ApiType> | undefined]>(([blueprint, contract], { event }) =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, (event as unknown as { data: [Codec, AccountId] }).data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, (event as unknown as { data: [AccountId] }).data[0], this._decorateMethod), contract]
: [blueprint, contract],
[])
) || []))
[undefined, undefined])
) || [undefined, undefined]))
);
};
}
+3 -3
View File
@@ -1,21 +1,21 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { Bytes } from '@polkadot/types';
import type { AccountId, ContractExecResult, EventRecord, Weight, WeightV2 } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent, WeightAll } from '../types.js';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types.js';
import { map } from 'rxjs';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN, BN_HUNDRED, BN_ONE, BN_ZERO, isUndefined, logger } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { convertWeight, withMeta } from './util.js';
@@ -42,7 +42,7 @@ function createTx <ApiType extends ApiTypes> (meta: AbiMessage, fn: (options: Co
}
export class ContractSubmittableResult extends SubmittableResult {
readonly contractEvents?: DecodedEvent[];
readonly contractEvents?: DecodedEvent[] | undefined;
constructor (result: ISubmittableResult, contractEvents?: DecodedEvent[]) {
super(result);
+2 -1
View File
@@ -1,7 +1,8 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApiBase } from '@polkadot/api/base';
import type { ApiBase } from '@polkadot/api/base';
import { TypeRegistry } from '@polkadot/types';
const registry = new TypeRegistry();
+2
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all named
export { Abi } from './Abi/index.js';
export { packageInfo } from './packageInfo.js';
// all starred
export * from './promise/index.js';
export * from './rx/index.js';
@@ -5,9 +5,11 @@
import '@polkadot/api-augment';
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs';
import { ApiPromise } from '@polkadot/api';
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' };
+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: '10.2.2' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.7.3' };
+3 -2
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { ApiPromise, toPromiseMethod } from '@polkadot/api';
import { toPromiseMethod } from '@polkadot/api';
import { Abi } from '../Abi/index.js';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintPromise extends Blueprint<'promise'> {
+3 -2
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiRx } from '@polkadot/api';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { ApiRx, toRxMethod } from '@polkadot/api';
import { toRxMethod } from '@polkadot/api';
import { Abi } from '../Abi/index.js';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintRx extends Blueprint<'rxjs'> {
File diff suppressed because it is too large Load Diff
@@ -5,7 +5,7 @@ export { default as delegator } from './delegator.json' assert { type: 'json' };
export { default as dns } from './dns.json' assert { type: 'json' };
export { default as erc20 } from './erc20.json' assert { type: 'json' };
export { default as erc721 } from './erc721.json' assert { type: 'json' };
export { default as flipper } from './flipper.json' assert { type: 'json' };
export { default as flipperBundle } from './flipper.contract.json' assert { type: 'json' };
export { default as flipper } from './flipper.json' assert { type: 'json' };
export { default as incrementer } from './incrementer.json' assert { type: 'json' };
export { default as multisigPlain } from './multisig_plain.json' assert { type: 'json' };
@@ -4,5 +4,6 @@
import { createVersionedExport } from '../util.js';
import * as v0 from './v0/index.js';
import * as v3 from './v3/index.js';
import * as v4 from './v4/index.js';
export default createVersionedExport({ v0, v3 });
export default createVersionedExport({ v0, v3, v4 });
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { default as events } from './events.contract.json' assert { type: 'json' };
+1 -1
View File
@@ -86,6 +86,6 @@ export interface WeightAll {
v1Weight: BN;
v2Weight: {
refTime: BN;
proofSize?: BN;
proofSize?: BN | undefined;
};
}
+3 -4
View File
@@ -6,11 +6,10 @@
"rootDir": "./src"
},
"exclude": [
"**/test/**/*.json",
"**/test/**/*.ts",
"**/test/**/*.wasm",
"**/checkTypes.manual.ts",
"**/test/**/*",
"**/*.spec.ts",
"**/checkTypes.manual.ts",
"**/mod.ts",
"mock.ts"
],
"references": [
+17 -17
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"license": "Apache-2.0",
@@ -18,25 +18,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.2.2",
"@polkadot/api-augment": "10.2.2",
"@polkadot/api-base": "10.2.2",
"@polkadot/rpc-core": "10.2.2",
"@polkadot/types": "10.2.2",
"@polkadot/types-codec": "10.2.2",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
"@polkadot/api": "10.7.3",
"@polkadot/api-augment": "10.7.3",
"@polkadot/api-base": "10.7.3",
"@polkadot/rpc-core": "10.7.3",
"@polkadot/types": "10.7.3",
"@polkadot/types-codec": "10.7.3",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.2"
},
"devDependencies": {
"@polkadot/api": "10.2.2",
"@polkadot/api-augment": "10.2.2",
"@polkadot/rpc-augment": "10.2.2",
"@polkadot/rpc-provider": "10.2.2",
"@polkadot/types-support": "10.2.2"
"@polkadot/api": "10.7.3",
"@polkadot/api-augment": "10.7.3",
"@polkadot/rpc-augment": "10.7.3",
"@polkadot/rpc-provider": "10.7.3",
"@polkadot/types-support": "10.7.3"
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ export function _flags (instanceId: string, api: DeriveApi): () => Observable<Fl
map((values: Codec[]): FlagsIntermediate => {
let resultIndex = -1;
for (let i = 0; i < calls.length; i++) {
for (let i = 0, count = calls.length; i < count; i++) {
if (isFunction(calls[i])) {
results[i] = values[++resultIndex];
}
+2 -2
View File
@@ -4,8 +4,8 @@
export * from './accountId.js';
export * from './flags.js';
export * from './idAndIndex.js';
export * from './idToIndex.js';
export * from './identity.js';
export * from './indexToId.js';
export * from './idToIndex.js';
export * from './indexes.js';
export * from './indexToId.js';
export * from './info.js';
+1 -1
View File
@@ -34,7 +34,7 @@ function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable<string
export function info (instanceId: string, api: DeriveApi): (address?: AccountIndex | AccountId | Address | Uint8Array | string | null) => Observable<DeriveAccountInfo> {
return memo(instanceId, (address?: AccountIndex | AccountId | Address | Uint8Array | string | null): Observable<DeriveAccountInfo> =>
api.derive.accounts.idAndIndex(address).pipe(
switchMap(([accountId, accountIndex]): Observable<[Partial<DeriveAccountInfo>, DeriveAccountRegistration, string?]> =>
switchMap(([accountId, accountIndex]): Observable<[Partial<DeriveAccountInfo>, DeriveAccountRegistration, string | undefined]> =>
combineLatest([
of({ accountId, accountIndex }),
api.derive.accounts.identity(accountId),
+17 -17
View File
@@ -3,22 +3,22 @@
import type { AccountId, AccountIndex, RegistrationJudgement } from '@polkadot/types/interfaces';
export type AccountIdAndIndex = [AccountId?, AccountIndex?];
export type AccountIdAndIndex = [AccountId | undefined, AccountIndex | undefined];
export type AccountIndexes = Record<string, AccountIndex>;
export interface DeriveAccountRegistration {
display?: string;
displayParent?: string;
email?: string;
image?: string;
legal?: string;
other?: Record<string, string>;
parent?: AccountId;
pgp?: string;
riot?: string;
twitter?: string;
web?: string;
display?: string | undefined;
displayParent?: string | undefined;
email?: string | undefined;
image?: string | undefined;
legal?: string | undefined;
other?: Record<string, string> | undefined;
parent?: AccountId | undefined;
pgp?: string | undefined;
riot?: string | undefined;
twitter?: string | undefined;
web?: string | undefined;
judgements: RegistrationJudgement[];
}
@@ -30,14 +30,14 @@ export interface DeriveAccountFlags {
}
export interface DeriveAccountInfo {
accountId?: AccountId;
accountIndex?: AccountIndex;
accountId?: AccountId | undefined;
accountIndex?: AccountIndex | undefined;
identity: DeriveAccountRegistration;
nickname?: string;
nickname?: string | undefined;
}
export interface DeriveHasIdentity {
display?: string;
display?: string | undefined;
hasIdentity: boolean;
parentId?: string;
parentId?: string | undefined;
}
+1 -4
View File
@@ -8,7 +8,4 @@ export * from './votingBalances.js';
const votingBalance = all;
export {
all,
votingBalance
};
export { all, votingBalance };
@@ -3,6 +3,7 @@
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { ApiPromise } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
import type { Bytes, Option, StorageKey } from '@polkadot/types';
import type { Bounty, BountyIndex, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
@@ -11,8 +12,6 @@ import type { DeriveApi, DeriveCollectiveProposal } from '../types.js';
import { firstValueFrom, of } from 'rxjs';
import { ApiPromise } from '@polkadot/api';
import { BountyFactory } from '../test/bountyFactory.js';
import { BytesFactory } from '../test/bytesFactory.js';
import { createApiWithAugmentations } from '../test/helpers.js';
+1 -1
View File
@@ -119,7 +119,7 @@ function injectFunctions (instanceId: string, api: DeriveApi, derives: DeriveCus
)
));
for (let i = 0; i < names.length; i++) {
for (let i = 0, count = names.length; i < count; i++) {
const name = names[i];
isIncluded(name) &&
+1 -1
View File
@@ -34,7 +34,7 @@ export function getBlock (instanceId: string, api: DeriveApi): (hash: Uint8Array
combineLatest([
of(signedBlock),
queryAt.system.events(),
getAuthorDetails(signedBlock.block.header, queryAt)
getAuthorDetails(api, signedBlock.block.header, blockHash)
])
),
map(([signedBlock, events, [, validators, author]]) =>
+4 -7
View File
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, switchMap } from 'rxjs';
import { map, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
@@ -27,12 +27,9 @@ import { getAuthorDetails } from './util.js';
*/
export function getHeader (instanceId: string, api: DeriveApi): (blockHash: Uint8Array | string) => Observable<HeaderExtended> {
return memo(instanceId, (blockHash: Uint8Array | string): Observable<HeaderExtended> =>
combineLatest([
api.rpc.chain.getHeader(blockHash),
api.queryAt(blockHash)
]).pipe(
switchMap(([header, queryAt]) =>
getAuthorDetails(header, queryAt)
api.rpc.chain.getHeader(blockHash).pipe(
switchMap((header) =>
getAuthorDetails(api, header, blockHash)
),
map(([header, validators, author]) =>
createHeaderExtended((validators || header).registry, header, validators, author)
+1 -1
View File
@@ -4,9 +4,9 @@
export * from './bestNumber.js';
export * from './bestNumberFinalized.js';
export * from './bestNumberLag.js';
export * from './getHeader.js';
export * from './getBlock.js';
export * from './getBlockByNumber.js';
export * from './getHeader.js';
export * from './subscribeFinalizedHeads.js';
export * from './subscribeNewBlocks.js';
export * from './subscribeNewHeads.js';
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of, switchMap } from 'rxjs';
import { map, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
@@ -28,13 +28,7 @@ export function subscribeNewHeads (instanceId: string, api: DeriveApi): () => Ob
return memo(instanceId, (): Observable<HeaderExtended> =>
api.rpc.chain.subscribeNewHeads().pipe(
switchMap((header) =>
combineLatest([
of(header),
api.queryAt(header.hash)
])
),
switchMap(([header, queryAt]) =>
getAuthorDetails(header, queryAt)
getAuthorDetails(api, header)
),
map(([header, validators, author]): HeaderExtended => {
header.createdAtHash = header.hash;
+56 -12
View File
@@ -4,16 +4,20 @@
import type { Observable } from 'rxjs';
import type { QueryableStorage } from '@polkadot/api-base/types';
import type { Compact, Vec } from '@polkadot/types';
import type { AccountId, Address, BlockNumber, Header } from '@polkadot/types/interfaces';
import type { AccountId, BlockNumber, Header } from '@polkadot/types/interfaces';
import type { SpCoreSr25519Public } from '@polkadot/types/lookup';
import type { Codec, IOption } from '@polkadot/types/types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of } from 'rxjs';
import { combineLatest, map, mergeMap, of, switchMap } from 'rxjs';
import { memo, unwrapBlockNumber } from '../util/index.js';
export type BlockNumberDerive = (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber>;
type OptionMapping = IOption<{ account: AccountId } & Codec>;
type OptionNimbus = IOption<{ nimbus: SpCoreSr25519Public } & Codec>;
export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): BlockNumberDerive {
return (instanceId: string, api: DeriveApi) =>
memo(instanceId, () =>
@@ -23,8 +27,9 @@ export function createBlockNumberDerive <T extends { number: Compact<BlockNumber
);
}
export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxjs'>): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
const validators = queryAt.session
/** @internal */
function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs'>): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
const validators = queryAt.session?.validators
? queryAt.session.validators()
: of(null);
@@ -37,23 +42,43 @@ export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxj
if (loggedAuthor) {
// use the author mapping pallet, if available (ie: moonbeam, moonriver), to map session (nimbus) key to author (collator/validator) key
if (queryAt.authorMapping && queryAt.authorMapping.mappingWithDeposit) {
if (queryAt.authorMapping?.mappingWithDeposit) {
return combineLatest([
of(header),
validators,
queryAt.authorMapping.mappingWithDeposit<IOption<{ account: AccountId } & Codec>>(loggedAuthor)
.pipe(map((opt) => opt.unwrapOr({ account: null }).account))
queryAt.authorMapping.mappingWithDeposit<OptionMapping>(loggedAuthor).pipe(
map((o) =>
o.unwrapOr({ account: null }).account
)
)
]);
}
// fall back to session pallet, if available (ie: manta, calamari), to map session (nimbus) key to author (collator/validator) key
if (queryAt.session && queryAt.session.queuedKeys) {
// fall back to session and parachain staking pallets, if available (ie: manta, calamari), to map session (nimbus) key to author (collator) key
if (queryAt.parachainStaking?.selectedCandidates && queryAt.session?.nextKeys) {
const loggedHex = loggedAuthor.toHex();
return combineLatest([
of(header),
validators,
queryAt.session.queuedKeys<[AccountId, { nimbus: Address }][]>().pipe(
map((queuedKeys) => queuedKeys.find((sessionKey) => sessionKey[1].nimbus.toHex() === loggedAuthor.toHex())),
map((sessionKey) => (sessionKey) ? sessionKey[0] : null)
queryAt.parachainStaking.selectedCandidates<Vec<AccountId>>().pipe(
mergeMap((selectedCandidates) =>
combineLatest([
of(selectedCandidates),
queryAt.session.nextKeys.multi<OptionNimbus>(selectedCandidates).pipe(
map((nextKeys) =>
nextKeys.findIndex((o) =>
o.unwrapOrDefault().nimbus.toHex() === loggedHex
)
)
)
])
),
map(([selectedCandidates, index]) =>
index === -1
? null
: selectedCandidates[index]
)
)
]);
}
@@ -66,3 +91,22 @@ export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxj
of(null)
]);
}
export function getAuthorDetails (api: DeriveApi, header: Header, blockHash?: Uint8Array | string): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
// For on-chain state, we need to retrieve it as per the start
// of the block being constructed, i.e. session validators would
// be at the point of the block construction, not when all operations
// has been supplied.
//
// However for the first block (no parentHash available), we would
// just use the as-is
return api.queryAt(
header.parentHash.isEmpty
? blockHash || header.hash
: header.parentHash
).pipe(
switchMap((queryAt) =>
getAuthorDetailsWithAt(header, queryAt)
)
);
}
+5 -5
View File
@@ -23,7 +23,7 @@ export interface DeriveDemocracyLock {
export interface DeriveProposalImage extends AtBlock {
balance: Balance;
proposal?: Call;
proposal?: Call | undefined;
proposalHash?: HexString;
proposalLen?: number;
proposer: AccountId;
@@ -32,27 +32,27 @@ export interface DeriveProposalImage extends AtBlock {
export interface DeriveDispatch extends AtBlock {
index: ReferendumIndex;
imageHash: HexString;
image?: DeriveProposalImage;
image?: DeriveProposalImage | undefined;
}
export interface DeriveProposal {
balance?: Balance;
index: PropIndex;
image?: DeriveProposalImage;
image?: DeriveProposalImage | undefined;
imageHash: Hash;
proposer: AccountId;
seconds: Vec<AccountId>;
}
export interface DeriveProposalExternal {
image?: DeriveProposalImage;
image?: DeriveProposalImage | undefined;
imageHash: HexString;
threshold: PalletDemocracyVoteThreshold;
}
export interface DeriveReferendum {
index: ReferendumIndex;
image?: DeriveProposalImage;
image?: DeriveProposalImage | undefined;
imageHash: HexString;
status: PalletDemocracyReferendumStatus | ReferendumInfoTo239;
}
+2 -2
View File
@@ -7,14 +7,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import type { ExactDerive } from './index.js';
import { from, Observable } from 'rxjs';
import { ApiRx } from '@polkadot/api';
import { MockProvider } from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types/create';
import { ExactDerive } from './index.js';
const testFunction = (api: ApiRx): any => {
return <S extends keyof ExactDerive, M extends keyof (typeof api.derive[S])>(section: S, method: M, inputs: any[]): void => {
describe(`derive.${section}.${method as string}`, (): void => {
+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: '10.2.2' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.7.3' };
+5 -5
View File
@@ -7,10 +7,10 @@ import type { PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletS
export interface DeriveSociety {
bids: PalletSocietyBid[];
defender?: AccountId;
defender?: AccountId | undefined;
hasDefender: boolean;
head?: AccountId;
founder?: AccountId;
head?: AccountId | undefined;
founder?: AccountId | undefined;
maxMembers: u32;
pot: BalanceOf;
}
@@ -28,6 +28,6 @@ export interface DeriveSocietyMember {
isSuspended: boolean;
payouts: [BlockNumber, Balance][];
strikes: StrikeCount;
vote?: PalletSocietyVote;
vouching?: PalletSocietyVouchingStatus;
vote?: PalletSocietyVote | undefined;
vouching?: PalletSocietyVouchingStatus | undefined;
}
+1 -1
View File
@@ -3,13 +3,13 @@
export * from './account.js';
export * from './currentPoints.js';
export * from './electedInfo.js';
export * from './erasExposure.js';
export * from './erasHistoric.js';
export * from './erasPoints.js';
export * from './erasPrefs.js';
export * from './erasRewards.js';
export * from './erasSlashes.js';
export * from './electedInfo.js';
export * from './keys.js';
export * from './overview.js';
export * from './ownExposure.js';
@@ -1,10 +1,11 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApiPromise } from '@polkadot/api';
import type { ApiPromise } from '@polkadot/api';
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import type { Codec, Constructor, InterfaceTypes, Registry } from '@polkadot/types/types';
import { Option, StorageKey } from '@polkadot/types';
import { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import { Codec, Constructor, InterfaceTypes, Registry } from '@polkadot/types/types';
export class BountyFactory {
readonly #api: ApiPromise;
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Bytes } from '@polkadot/types';
import { Registry } from '@polkadot/types/types';
import type { Bytes } from '@polkadot/types';
import type { Registry } from '@polkadot/types/types';
export class BytesFactory {
#registry: Registry;
@@ -3,9 +3,8 @@
import type { ApiPromise } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
import { Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import { Registry } from '@polkadot/types/types';
import type { Proposal, ProposalIndex } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
export class ProposalFactory {
readonly #api: ApiPromise;
@@ -12,7 +12,7 @@ export function createHeaderExtended (registry: Registry, header?: Header, valid
const HeaderBase = registry.createClass('Header');
class Implementation extends HeaderBase implements HeaderExtended {
readonly #author?: AccountId;
readonly #author?: AccountId | undefined;
constructor (registry: Registry, header?: Header, validators?: AccountId[] | null, author?: AccountId | null) {
super(registry, header);
@@ -36,7 +36,7 @@ export function createSignedBlockExtended (registry: Registry, block?: SignedBlo
const SignedBlockBase = registry.createClass('SignedBlock');
class Implementation extends SignedBlockBase implements SignedBlockExtended {
readonly #author?: AccountId;
readonly #author?: AccountId | undefined;
readonly #events: EventRecord[];
readonly #extrinsics: TxWithEvent[];
+2 -2
View File
@@ -14,8 +14,8 @@ export interface SignedBlockExtended extends SignedBlock {
}
export interface TxWithEvent {
dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo;
dispatchError?: DispatchError | undefined;
dispatchInfo?: DispatchInfo | undefined;
events: Event[];
extrinsic: Extrinsic;
}
+1 -1
View File
@@ -3,7 +3,7 @@
import type { AccountId, Digest } from '@polkadot/types/interfaces';
export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined {
export function extractAuthor (digest: Digest, sessionValidators: AccountId[]): AccountId | undefined {
const [citem] = digest.logs.filter((e) => e.isConsensus);
const [pitem] = digest.logs.filter((e) => e.isPreRuntime);
const [sitem] = digest.logs.filter((e) => e.isSeal);
+1 -1
View File
@@ -9,8 +9,8 @@ import type { BN } from '@polkadot/util';
import type { ExactDerive } from './derive.js';
export * from './accounts/types.js';
export * from './balances/types.js';
export * from './bagsList/types.js';
export * from './balances/types.js';
export * from './council/types.js';
export * from './crowdloan/types.js';
export * from './democracy/types.js';
@@ -8,7 +8,7 @@ import type { ApprovalFlag } from '@polkadot/types/interfaces/elections';
export function approvalFlagsToBools (flags: Vec<ApprovalFlag> | ApprovalFlag[]): boolean[] {
const bools: boolean[] = [];
for (let i = 0; i < flags.length; i++) {
for (let i = 0, count = flags.length; i < count; i++) {
const str = flags[i].toString(2);
// read from lowest bit to highest
+2
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all named
export { drr, memo } from '@polkadot/rpc-core';
// all starred
export * from './approvalFlagsToBools.js';
export * from './blockNumber.js';
export * from './cache.js';
+1
View File
@@ -8,6 +8,7 @@
"exclude": [
"**/test/*",
"**/checkTypes.manual.ts",
"**/mod.ts",
"**/*.spec.ts"
],
"references": [
+21 -21
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"license": "Apache-2.0",
@@ -18,29 +18,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.2.2",
"version": "10.7.3",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "10.2.2",
"@polkadot/api-base": "10.2.2",
"@polkadot/api-derive": "10.2.2",
"@polkadot/keyring": "^11.1.3",
"@polkadot/rpc-augment": "10.2.2",
"@polkadot/rpc-core": "10.2.2",
"@polkadot/rpc-provider": "10.2.2",
"@polkadot/types": "10.2.2",
"@polkadot/types-augment": "10.2.2",
"@polkadot/types-codec": "10.2.2",
"@polkadot/types-create": "10.2.2",
"@polkadot/types-known": "10.2.2",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"eventemitter3": "^5.0.0",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
"@polkadot/api-augment": "10.7.3",
"@polkadot/api-base": "10.7.3",
"@polkadot/api-derive": "10.7.3",
"@polkadot/keyring": "^12.2.1",
"@polkadot/rpc-augment": "10.7.3",
"@polkadot/rpc-core": "10.7.3",
"@polkadot/rpc-provider": "10.7.3",
"@polkadot/types": "10.7.3",
"@polkadot/types-augment": "10.7.3",
"@polkadot/types-codec": "10.7.3",
"@polkadot/types-create": "10.7.3",
"@polkadot/types-known": "10.7.3",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"eventemitter3": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.2"
},
"devDependencies": {
"@polkadot/api-augment": "10.2.2",
"@polkadot/types-support": "10.2.2"
"@polkadot/api-augment": "10.7.3",
"@polkadot/types-support": "10.7.3"
}
}
+29 -24
View File
@@ -4,7 +4,7 @@
import type { Observable } from 'rxjs';
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { StorageKey, Text, u64 } from '@polkadot/types';
import type { Metadata, StorageKey, Text, u64 } from '@polkadot/types';
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
import type { StorageEntry } from '@polkadot/types/primitive/types';
@@ -12,6 +12,7 @@ import type { AnyFunction, AnyJson, AnyTuple, CallFunction, Codec, DefinitionCal
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../submittable/types.js';
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types/index.js';
import type { AllDerives } from '../util/decorate.js';
import type { VersionedRegistry } from './types.js';
import { BehaviorSubject, combineLatest, from, map, of, switchMap, tap, toArray } from 'rxjs';
@@ -19,14 +20,14 @@ import { BehaviorSubject, combineLatest, from, map, of, switchMap, tap, toArray
import { getAvailableDerives } from '@polkadot/api-derive';
import { memo, RpcCore } from '@polkadot/rpc-core';
import { WsProvider } from '@polkadot/rpc-provider';
import { expandMetadata, GenericExtrinsic, Metadata, typeDefinitions, TypeRegistry } from '@polkadot/types';
import { expandMetadata, GenericExtrinsic, typeDefinitions, TypeRegistry } from '@polkadot/types';
import { getSpecRuntime } from '@polkadot/types-known';
import { arrayChunk, arrayFlatten, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
import { blake2AsHex } from '@polkadot/util-crypto';
import { createSubmittable } from '../submittable/index.js';
import { augmentObject } from '../util/augmentObject.js';
import { AllDerives, decorateDeriveSections } from '../util/decorate.js';
import { decorateDeriveSections } from '../util/decorate.js';
import { extractStorageArgs } from '../util/validate.js';
import { Events } from './Events.js';
import { findCall, findError } from './find.js';
@@ -40,7 +41,7 @@ interface MetaDecoration {
}
interface FullDecoration<ApiType extends ApiTypes> {
createdAt?: Uint8Array;
createdAt?: Uint8Array | undefined;
decoratedApi: ApiDecoration<ApiType>;
decoratedMeta: DecoratedMeta;
}
@@ -138,19 +139,22 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this._rx.queryAt = (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) =>
from(this.at(blockHash, knownVersion)).pipe(map((a) => a.rx.query));
this._rx.registry = this.#registry;
this._decorateMethod = decorateMethod;
this._options = options;
this._type = type;
const thisProvider = options.source
const provider = options.source
? options.source._rpcCore.provider.isClonable
? options.source._rpcCore.provider.clone()
: options.source._rpcCore.provider
: (options.provider || new WsProvider());
this._decorateMethod = decorateMethod;
this._options = options;
this._type = type;
// The RPC interface decorates the known interfaces on init
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc) as (RpcCore & RpcInterface);
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, {
isPedantic: this._options.isPedantic,
provider,
userRpc: this._options.rpc
}) as (RpcCore & RpcInterface);
this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected);
this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
}
@@ -318,7 +322,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// we try and create mappings to runtime names via a hash mapping)
const sectionMap: Record<string, boolean> = {};
for (let i = 0; i < methods.length; i++) {
for (let i = 0, count = methods.length; i < count; i++) {
const [section] = methods[i].split('_');
sectionMap[section] = true;
@@ -327,7 +331,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// convert the actual section names into an easy name lookup
const sections = Object.keys(sectionMap);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
const nameA = stringUpperFirst(sections[i]);
const nameB = `${nameA}Api`;
@@ -343,8 +347,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const hasResults = exposed.length !== 0;
const allKnown = [...this._rpcCore.mapping.entries()];
const allKeys: string[] = [];
const count = allKnown.length;
for (let i = 0; i < allKnown.length; i++) {
for (let i = 0; i < count; i++) {
const [, { alias, endpoint, method, pubsub, section }] = allKnown[i];
allKeys.push(`${section}_${method}`);
@@ -374,7 +379,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// loop through all entries we have (populated in decorate) and filter as required
// only remove when we have results and method missing, or with no results if optional
for (let i = 0; i < allKnown.length; i++) {
for (let i = 0; i < count; i++) {
const [k, { method, section }] = allKnown[i];
if (hasResults && !exposed.includes(k) && k !== 'rpc_methods') {
@@ -407,7 +412,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return fn;
};
for (let s = 0; s < rpc.sections.length; s++) {
for (let s = 0, scount = rpc.sections.length; s < scount; s++) {
const section = rpc.sections[s];
if (!Object.prototype.hasOwnProperty.call(out, section)) {
@@ -416,7 +421,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const decorateInternal = (method: string) =>
decorateFn(section, method);
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const method = methods[m];
// skip subscriptions where we have a non-subscribe interface
@@ -442,13 +447,13 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const entries = Object.entries(additional);
for (let j = 0; j < entries.length; j++) {
for (let j = 0, ecount = entries.length; j < ecount; j++) {
const [key, defs] = entries[j];
if (result[key]) {
// we have this one already, step through for new versions or
// new methods and add those as applicable
for (let k = 0; k < defs.length; k++) {
for (let k = 0, dcount = defs.length; k < dcount; k++) {
const def = defs[k];
const prev = result[key].find(({ version }) => def.version === version);
@@ -474,7 +479,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// options > chain/spec > built-in, apply in reverse order with
// methods overriding previous definitions (or interleave missing)
for (let i = 0; i < defValues.length; i++) {
for (let i = 0, count = defValues.length; i < count; i++) {
this._addRuntimeDef(result, defValues[i].runtime);
}
@@ -496,7 +501,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this.#runtimeLog[implName] = true;
for (let i = 0; i < sections.length; i++) {
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, secs] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const rtApi = apis.find(([a]) => a.eq(sectionHash));
@@ -516,7 +521,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
named[section] = {};
}
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
@@ -556,7 +561,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const modules = Object.keys(named);
for (let i = 0; i < modules.length; i++) {
for (let i = 0, count = modules.length; i < count; i++) {
lazyMethod(result, modules[i], lazySection);
}
@@ -641,7 +646,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const sections = Object.keys(tx);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
lazyMethod(result, sections[i], lazySection);
}
@@ -672,7 +677,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const sections = Object.keys(query);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
lazyMethod(result, sections[i], lazySection);
}
+3 -3
View File
@@ -97,7 +97,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
registry.knownTypes.typesAlias = getSpecAlias(registry, chain, version.specName);
}
registry.setMetadata(metadata, undefined, objectSpread<ExtDef>({}, getSpecExtensions(registry, chain, version.specName), this._options.signedExtensions));
registry.setMetadata(metadata, undefined, objectSpread<ExtDef>({}, getSpecExtensions(registry, chain, version.specName), this._options.signedExtensions), this._options.noInitWarn);
}
/**
@@ -265,11 +265,11 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
const sections = Object.keys(source.rpc);
const rpcs: string[] = [];
for (let s = 0; s < sections.length; s++) {
for (let s = 0, scount = sections.length; s < scount; s++) {
const section = sections[s];
const methods = Object.keys((source.rpc as unknown as Record<string, Record<string, unknown>>)[section]);
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
rpcs.push(`${section}_${methods[m]}`);
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
/**
* @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
*/
public setSigner (signer: Signer): void {
public setSigner (signer: Signer | undefined): void {
this._rx.signer = signer;
}
+3
View File
@@ -3,11 +3,14 @@
import '@polkadot/rpc-augment';
// all external
export { Keyring } from '@polkadot/keyring';
export { HttpProvider, ScProvider, WsProvider } from '@polkadot/rpc-provider';
// all named
export { packageInfo } from './packageInfo.js';
export { SubmittableResult } from './submittable/index.js';
// all starred
export * from './promise/index.js';
export * from './rx/index.js';
+3 -3
View File
@@ -6,17 +6,17 @@
import '@polkadot/api-augment';
import type { HeaderExtended } from '@polkadot/api-derive/types';
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs';
import type { StorageKey } from '@polkadot/types';
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
import type { FrameSystemAccountInfo } from '@polkadot/types/lookup';
import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types';
import type { SubmittableResult } from './index.js';
import { ApiPromise } from '@polkadot/api';
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create';
import { SubmittableResult } from './index.js';
const registry = new TypeRegistry();
async function calls (api: ApiPromise): Promise<void> {
+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: '10.2.2' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.7.3' };
+2 -1
View File
@@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import type { ApiOptions, UnsubscribePromise } from '../types/index.js';
import type { CombinatorCallback, CombinatorFunction } from './Combinator.js';
import { objectSpread } from '@polkadot/util';
import { ApiBase } from '../base/index.js';
import { Combinator, CombinatorCallback, CombinatorFunction } from './Combinator.js';
import { Combinator } from './Combinator.js';
import { promiseTracker, toPromiseMethod } from './decorateMethod.js';
/**
+2 -1
View File
@@ -21,7 +21,7 @@ describe('Combinator', (): void => {
fns = [];
});
it('it triggers on all values', async (): Promise<void> => {
it('triggers on all values', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
let count = 0;
const combinator = new Combinator(
@@ -90,6 +90,7 @@ describe('Combinator', (): void => {
});
});
// eslint-disable-next-line jest/expect-expect
it('unsubscribes as required', async (): Promise<void> => {
await new Promise<void>((resolve) => {
// eslint-disable-next-line @typescript-eslint/require-await
+2 -2
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Observable, Subscription } from 'rxjs';
import type { Callback, Codec } from '@polkadot/types/types';
import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types/index.js';
import { catchError, EMPTY, Subscription, tap } from 'rxjs';
import { catchError, EMPTY, tap } from 'rxjs';
import { isFunction, nextTick } from '@polkadot/util';
+1
View File
@@ -87,6 +87,7 @@ describe('ApiPromise', (): void => {
await api.disconnect();
});
// eslint-disable-next-line jest/expect-expect
it('Create API instance will error on failure to await ready', async (): Promise<void> => {
class ErrorApiPromise extends ApiPromise {
constructor () {
+3 -2
View File
@@ -1,9 +1,10 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { ApiOptions } from '../types/index.js';
import { from, Observable } from 'rxjs';
import { from } from 'rxjs';
import { objectSpread } from '@polkadot/util';
@@ -13,7 +14,7 @@ import { toRxMethod } from './decorateMethod.js';
/**
* # @polkadot/api/rx
*
* ## Overview
* ## Overview
*
* @name ApiRx
*

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