Compare commits

...
82 Commits
Author SHA1 Message Date
Github Actions 999dc6f8a5 [CI Skip] release/stable 3.7.3
skip-checks: true
2021-02-02 16:37:56 +00:00
Jaco Greeff 724574afe7 3.7.3 (w/ Polkadot 27 upgrade blocks) (#3139) 2021-02-02 17:29:43 +01:00
Github Actions 0352a30b6b [CI Skip] release/beta 3.7.3-1
skip-checks: true
2021-02-02 10:14:04 +00:00
Jaco Greeff 41b4cd5c55 Adjust known-types to use @polkadot/networks (#3138) 2021-02-02 11:06:52 +01:00
Github Actions 89f16f3123 [CI Skip] release/beta 3.7.3-0
skip-checks: true
2021-02-02 09:22:19 +00:00
Jaco Greeff 261a4eede3 Add 26 checkpoint for Polkadot (#3137) 2021-02-02 10:15:17 +01:00
Github Actions f623b382f7 [CI Skip] release/stable 3.7.2
skip-checks: true
2021-02-02 07:50:56 +00:00
Jaco Greeff 51537c619a Adjust Keys fro 28 (#3135)
* Adjust Keys fro 28

* 3.7.2
2021-02-02 08:41:24 +01:00
Github Actions 3df943572f [CI Skip] release/beta 3.7.2-0
skip-checks: true
2021-02-01 20:22:53 +00:00
Jaco Greeff aa10804f6f Westend upgrade block for 48 (#3134) 2021-02-01 21:13:58 +01:00
Github Actions 981407f00f [CI Skip] release/stable 3.7.1
skip-checks: true
2021-02-01 08:07:42 +00:00
Jaco Greeff 74f7098e0a 3.7 (#3131)
* 3.7

* Update CHANGELOG.md
2021-02-01 08:58:59 +01:00
Github Actions c2e46bf16d [CI Skip] release/beta 3.6.5-12
skip-checks: true
2021-01-31 11:55:30 +00:00
Jaco Greeff 78b26d2d40 Allow .slice on Vec types (#3130)
* Allow .slice on Vec types

* Apply suggestions from code review

* Update packages/types/src/codec/AbstractArray.ts
2021-01-31 12:48:05 +01:00
Github Actions e4d5be85f6 [CI Skip] release/beta 3.6.5-11
skip-checks: true
2021-01-31 10:12:00 +00:00
Jaco Greeff 23b5601eeb Use MultiAddress as the default type (#3123)
* Use MultiAddress as the default type

* Update tests

* Update tests
2021-01-31 11:02:54 +01:00
Github Actions 859679ce09 [CI Skip] release/beta 3.6.5-10
skip-checks: true
2021-01-31 08:38:26 +00:00
Jaco Greeff 71543c2351 Bump common (#3129) 2021-01-31 09:31:29 +01:00
Github Actions edae5057c8 [CI Skip] release/beta 3.6.5-9
skip-checks: true
2021-01-29 14:07:58 +00:00
Thibaut Sardan 8dd450ded4 no subscription for http (#3127) 2021-01-29 14:59:09 +01:00
Github Actions bc2061723e [CI Skip] release/beta 3.6.5-8
skip-checks: true
2021-01-29 10:58:08 +00:00
Jaco Greeff 5753e37307 Correctly use RelayChainBlockNumber in PersistedValidationData (#3126) 2021-01-29 11:48:46 +01:00
Github Actions e74da70a9d [CI Skip] release/beta 3.6.5-7
skip-checks: true
2021-01-28 18:35:59 +00:00
Jaco Greeff 737bbc225a Add Slot type (#3120) 2021-01-28 19:26:27 +01:00
Github Actions 9313551559 [CI Skip] release/beta 3.6.5-6
skip-checks: true
2021-01-28 15:41:03 +00:00
Jaco Greeff 5b8f53f050 Fix Kusama types order 2021-01-28 16:33:11 +01:00
Github Actions 7358e4715b [CI Skip] release/beta 3.6.5-5
skip-checks: true
2021-01-28 15:05:20 +00:00
Jaco Greeff a9005d86d6 Types for Polkadot 28+ (#3119)
* Types for Polkadot 28+

* Linting
2021-01-28 15:57:32 +01:00
Github Actions 788c05d86e [CI Skip] release/beta 3.6.5-4
skip-checks: true
2021-01-28 08:57:47 +00:00
Jaco Greeff de6ba69631 Add Kusama 2027 upgrade block (#3116) 2021-01-28 09:50:12 +01:00
Github Actions 4153fed250 [CI Skip] release/beta 3.6.5-3
skip-checks: true
2021-01-27 16:41:40 +00:00
Jaco Greeff c68b89831e Rococo MultiAddress for master (#3114) 2021-01-27 17:34:35 +01:00
Github Actions 01c9c5ed53 [CI Skip] release/beta 3.6.5-2
skip-checks: true
2021-01-27 09:30:20 +00:00
Jaco Greeff 573fb135a7 Updata parachain proposal type (#3111) 2021-01-27 10:22:25 +01:00
Github Actions 0ee7256e37 [CI Skip] release/beta 3.6.5-1
skip-checks: true
2021-01-26 20:00:28 +00:00
Jaco Greeff 9829ee558c Update CandidateDescriptor type (#3110)
* Update CandidateDescriptor type

* Add additional Cumulus missing types

* Add missing StorageProof

* trailing , :(
2021-01-26 20:51:23 +01:00
Github Actions 34b563dd48 [CI Skip] release/beta 3.6.5-0
skip-checks: true
2021-01-25 17:24:21 +00:00
Antoine Estienne f6bb200146 Adapted to display moonbeam author (#3108)
* adapted to display moonbeam author

* refactor and lint

* removed comments
2021-01-25 18:16:41 +01:00
Github Actions af36e3a52c [CI Skip] release/stable 3.6.4
skip-checks: true
2021-01-25 16:06:53 +00:00
Jaco Greeff c50c7ae6ef Remove capabilities detection log (#3107) 2021-01-25 16:59:14 +01:00
Github Actions 61739d5ba1 [CI Skip] release/stable 3.6.3
skip-checks: true
2021-01-24 16:09:21 +00:00
Jaco Greeff 34c4a6055e Jg refs (#3103)
* Remove global ref, use x-global

* Bump common
2021-01-24 17:00:49 +01:00
Github Actions 27dabdaf52 [CI Skip] release/stable 3.6.2
skip-checks: true
2021-01-24 15:18:34 +00:00
Jaco Greeff 2ee3242f41 Remove global ref, use x-global (#3102) 2021-01-24 16:11:43 +01:00
Github Actions 67ae9627af [CI Skip] release/stable 3.6.1
skip-checks: true
2021-01-24 13:00:12 +00:00
Jaco Greeff 29f7e12df6 3.6 (#3101) 2021-01-24 13:52:53 +01:00
Github Actions a4bb2c8268 [CI Skip] release/beta 3.5.2-16
skip-checks: true
2021-01-24 11:40:20 +00:00
Jaco Greeff 6521c5f533 Bump common (#3100) 2021-01-24 12:33:04 +01:00
Github Actions 6925c18821 [CI Skip] release/beta 3.5.2-15
skip-checks: true
2021-01-24 10:31:50 +00:00
Jaco Greeff 9269d94677 Bump common (#3099)
* Bump common

* Undefined value

* Test for undefined
2021-01-24 11:23:23 +01:00
Github Actions d438814ad6 [CI Skip] release/beta 3.5.2-14
skip-checks: true
2021-01-23 15:56:13 +00:00
Jaco Greeff bc205a350b Fix ChainProperties JSON decoding 2021-01-23 16:47:22 +01:00
Github Actions 6bf6fddd28 [CI Skip] release/beta 3.5.2-13
skip-checks: true
2021-01-23 13:53:50 +00:00
Jaco Greeff 23f8eb9713 Return locks for extended balance instances (#3097) 2021-01-23 14:45:17 +01:00
Github Actions 8ab3097328 [CI Skip] release/beta 3.5.2-12
skip-checks: true
2021-01-23 12:44:02 +00:00
Jaco Greeff 644d0e6c2e Change registry.chainToekn to registry.chainTokens (#3096) 2021-01-23 13:36:30 +01:00
Github Actions 6a69fdfbbf [CI Skip] release/beta 3.5.2-11
skip-checks: true
2021-01-23 11:24:22 +00:00
Jaco Greeff 16e9a64941 Allow multiples in system.properties (decimals, tokens) (#3093)
* Allow multiples in syste.propertis (decimals, tokens)

* registry.chain{Decimals, Token} returns array values

* Bump common

* AbstractInt format with first decimal/token

* Adjust ss58Format consistency

* u8 decimals/format

* cleanups

* More slight weidness

* Adjust all t u32

* Cleanup properties format from Codec
2021-01-23 12:16:10 +01:00
Github Actions f3cbc070ea [CI Skip] release/beta 3.5.2-10
skip-checks: true
2021-01-22 23:07:31 +00:00
Jaco Greeff df22526229 Bump deps (#3095) 2021-01-22 23:58:53 +01:00
Github Actions 3739bdaa89 [CI Skip] release/beta 3.5.2-9
skip-checks: true
2021-01-22 21:31:40 +00:00
Jaco Greeff 1f55f38bd2 Introduce instances, apply to balance derives (multi-result) (#3094)
* Introducce instances, apply to balance derives (multi-result)

* Nonce extraction

* Optimize
2021-01-22 22:24:10 +01:00
Github Actions c9deb0d88f [CI Skip] release/beta 3.5.2-8
skip-checks: true
2021-01-22 16:29:02 +00:00
Jaco Greeff eecfb39463 Bump common (#3092) 2021-01-22 17:21:33 +01:00
Github Actions 51bb27da42 [CI Skip] release/beta 3.5.2-7
skip-checks: true
2021-01-22 08:21:12 +00:00
Jaco Greeff 9c0d296e87 typegen dedup (#3089) 2021-01-22 09:12:29 +01:00
Github Actions 0793e0bf8c [CI Skip] release/beta 3.5.2-6
skip-checks: true
2021-01-21 21:45:15 +00:00
Jaco Greeff e9ad88d50e Register all types for error generation (#3088)
* Register all types for error generation

* type for ExtraTypes
2021-01-21 22:37:37 +01:00
Github Actions fbe24c04b8 [CI Skip] release/beta 3.5.2-5
skip-checks: true
2021-01-21 10:08:55 +00:00
Jaco Greeff 8a7d4d3be3 Bump metadata (#3085)
* Bump metadata

* linting
2021-01-21 11:01:31 +01:00
Github Actions 61c9a3bb93 [CI Skip] release/beta 3.5.2-4
skip-checks: true
2021-01-21 08:39:46 +00:00
Jaco Greeff 3721a11f34 Add errors/events Md interface endpoints (#3084) 2021-01-21 09:31:40 +01:00
Github Actions 21039dec1f [CI Skip] release/beta 3.5.2-3
skip-checks: true
2021-01-19 21:54:16 +00:00
Jaco Greeff 1393f565d8 Paras validator index alias (#3079) 2021-01-19 22:46:49 +01:00
Jaco Greeff 1530e55f9d Disallow primitive singular registration (#3077) 2021-01-19 22:46:29 +01:00
Github Actions c982505f73 [CI Skip] release/beta 3.5.2-2
skip-checks: true
2021-01-19 21:15:33 +00:00
Jaco Greeff ec8c0d3e8b Move x-rxjs into common (#3078)
* Moe x-rxjs into common

* yarn

* jest config

* Pull in new pubslished x-rxjs
2021-01-19 22:08:03 +01:00
Github Actions 8cb0269676 [CI Skip] release/beta 3.5.2-1
skip-checks: true
2021-01-19 12:27:07 +00:00
Jaco Greeff 27f460cfe3 Add payment_queryFeeDetails (#3076) 2021-01-19 13:18:23 +01:00
Jaco Greeff e98e8d6a0d Type capability detection (#3075)
* Type capability detection

* re-add Observable export

* Remove unused exports

* Decorate capabilities

* log capabilities

* Detect capabilities for historic

* Re-add logging

* Log

* Rework ValidatorPrefs types
2021-01-19 13:15:18 +01:00
Github Actions 2f94662837 [CI Skip] release/beta 3.5.2-0
skip-checks: true
2021-01-19 10:49:10 +00:00
Jaco Greeff d46d6a9acd Add ValidatorPrefs w/ blocked flag (#3073) 2021-01-19 11:41:23 +01:00
99 changed files with 2634 additions and 1547 deletions
+6 -1
View File
@@ -9,4 +9,9 @@
3.2.2
3.2.3
3.3.2
3.3.2
3.6.2
3.6.3
3.6.4
3.7.2
3.7.3
+57
View File
@@ -1,5 +1,62 @@
# CHANGELOG
## 3.7.3 Feb 2, 2021
Changes:
- Added Polkadot upgrade block for runtime 27 (known checkpoint optimization)
## 3.7.2 Feb 2, 2021
Changes:
- Adjusted the `Keys` type for the 28 runtime on Kusama, Polkadot & Westend
## 3.7.1 Feb 1, 2021
Upgrade priority: Low. However recommended for current Substrate master, Polkadot and Rococo users and those wishing to support the upcoming Polkadot 28 runtime with the new `MultiAddress`.
- **Breaking change** As indicated in the 3.5.1 release notes, the `Address`/`LookupSource` defaults have now been adjusted for `MultiAddress`. If your chain does not use these types, explicitly add the correct `Address`/`LookupSource` types. This new extensible format is mean to cater for all address types into the future, removing a lot of discrepancies between chains.
Contributed:
- Extraction of the block author on Moonbeam (Thanks to https://github.com/joelamouche)
- Cleanup logs with HTTP providers, no subs (Thanks to https://github.com/Tbaut)
Changes:
- Allow `.slice` operator on the `Vec` type
- Apply `MultiAddress` as a default
- Adds support for the upcoming Polkadot 28 and Kusama 2028 runtimes
- Add checkpoint for Kusama 2027 upgrade
- Update all parachain types (as per latest Rococo)
- Correctly use relay blockNumber in parachain validation data
- remove information log for capabilities detection (creates confusion)
- Remove explicit references to `global`, use the `x-global` detection
- Remove explicit `module` in `package.json` (exports map available)
## 3.6.1 Jan 24, 2020
Upgrade priority: Medium if not already on at least 3.3.1. The next upgrade of Kusama/Polkadot requires it.
- **Breaking change** To support chains with multiple tokens, such as bridges, the `ChainProperties` type now returns an array of tokens and decimals (instead of singular values) in the `token{Decimals, Symbol}` getters. Additionally, this means that the `registry` interfaces has been changes, to `registry.chainDecimals: number[]` and `registry.chainTokens: string[]`. Where used the `[0]` index will return the first value if only interested in a single, for a straight conversion.
Changes:
- Allow for the detection of on-chain capabilities as available (e.g. `AccountData`, `ValidatorPrefs`)
- Cater for multiple tokens and decimals in the chain the chain `system.properties` (as per the chain specification)
- Add a `instances: { [key]: [module1, module2] }` definition in teh bundle types, allowing for multiple instances (e.g. Balances)
- Adjust the `api-derive` for balances to retrieve values via `instances` as well as across multiple modules
- Ensure all types are registered for all metadata typegen steps
- Add `rpc.payment.queryFeeDetails` RPC endpoint
- Update types & metadata to latest Substrate
- Move the `@polkadot/x-rxjs` package into the common repo
- Allow doc generation for errors/events (markdown outputs)
## 3.5.1 Jan 18, 2020
Upgrade priority: Low. Recommended for parachain developers.
+2 -4
View File
@@ -13,8 +13,7 @@ module.exports = Object.assign({}, config, {
'@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1',
'@polkadot/types-known(.*)$': '<rootDir>/packages/types-known/src/$1',
// eslint-disable-next-line sort-keys
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1',
'@polkadot/x-rxjs(.*)$': '<rootDir>/packages/x-rxjs/src/$1'
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
},
modulePathIgnorePatterns: [
'<rootDir>/packages/api/build',
@@ -25,8 +24,7 @@ module.exports = Object.assign({}, config, {
'<rootDir>/packages/rpc-provider/build',
'<rootDir>/packages/typegen/build',
'<rootDir>/packages/types/build',
'<rootDir>/packages/types-known/build',
'<rootDir>/packages/x-rxjs/build'
'<rootDir>/packages/types-known/build'
],
resolver: '@polkadot/dev/config/jest-resolver.cjs'
});
+1 -1
View File
@@ -34,5 +34,5 @@
"@types/jest": "^26.0.20",
"copyfiles": "^2.4.1"
},
"version": "3.5.1"
"version": "3.7.3"
}
+5 -6
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/api-contract",
"version": "3.5.1",
"version": "3.7.3",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
@@ -14,10 +13,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.5.1",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/x-rxjs": "3.5.1",
"@polkadot/api": "3.7.3",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/x-rxjs": "^5.5.2",
"bn.js": "^4.11.9"
}
}
+9 -10
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/api-derive",
"version": "3.5.1",
"version": "3.7.3",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
@@ -14,16 +13,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.5.1",
"@polkadot/rpc-core": "3.5.1",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/util-crypto": "^5.3.1",
"@polkadot/x-rxjs": "3.5.1",
"@polkadot/api": "3.7.3",
"@polkadot/rpc-core": "3.7.3",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/util-crypto": "^5.5.2",
"@polkadot/x-rxjs": "^5.5.2",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^5.3.1",
"@polkadot/rpc-provider": "3.5.1"
"@polkadot/keyring": "^5.5.2",
"@polkadot/rpc-provider": "3.7.3"
}
}
+52 -25
View File
@@ -1,24 +1,24 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { ApiInterfaceRx, QueryableStorageMultiArg } from '@polkadot/api/types';
import type { AccountData, AccountId, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces';
import type { ITuple } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveBalancesAccount } from '../types';
import type { DeriveBalancesAccount, DeriveBalancesAccountData } from '../types';
import { isFunction } from '@polkadot/util';
import { assert, isFunction } from '@polkadot/util';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { memo } from '../util';
type Result = [Balance, Balance, Balance, Balance, Index];
type BalanceResult = [Balance, Balance, Balance, Balance];
function calcBalances (api: ApiInterfaceRx, [accountId, [freeBalance, reservedBalance, frozenFee, frozenMisc, accountNonce]]: [AccountId, Result]): DeriveBalancesAccount {
type Result = [Index, BalanceResult[]];
function getBalance (api: ApiInterfaceRx, [freeBalance, reservedBalance, frozenFee, frozenMisc]: BalanceResult): DeriveBalancesAccountData {
return {
accountId,
accountNonce,
freeBalance,
frozenFee,
frozenMisc,
@@ -27,6 +27,19 @@ function calcBalances (api: ApiInterfaceRx, [accountId, [freeBalance, reservedBa
};
}
function calcBalances (api: ApiInterfaceRx, [accountId, [accountNonce, balances]]: [AccountId, Result]): DeriveBalancesAccount {
const primary = balances[0];
assert(primary, 'No balances retrieved for account');
return {
accountId,
accountNonce,
additional: balances.filter((_, index) => index !== 0).map((b) => getBalance(api, b)),
...getBalance(api, primary)
};
}
// old
function queryBalancesFree (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
return api.queryMulti<[Balance, Balance, Index]>([
@@ -34,21 +47,25 @@ function queryBalancesFree (api: ApiInterfaceRx, accountId: AccountId): Observab
[api.query.balances.reservedBalance, accountId],
[api.query.system.accountNonce, accountId]
]).pipe(
map(([freeBalance, reservedBalance, accountNonce]): Result =>
[freeBalance, reservedBalance, api.registry.createType('Balance'), api.registry.createType('Balance'), accountNonce]
)
map(([freeBalance, reservedBalance, accountNonce]): Result => [
accountNonce,
[[freeBalance, reservedBalance, api.registry.createType('Balance'), api.registry.createType('Balance')]]
])
);
}
function queryBalancesAccount (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
return api.queryMulti<[AccountData, Index]>([
[api.query.balances.account, accountId],
[api.query.system.accountNonce, accountId]
]).pipe(
map(([{ feeFrozen, free, miscFrozen, reserved }, accountNonce]): Result =>
[free, reserved, feeFrozen, miscFrozen, accountNonce]
function queryBalancesAccount (api: ApiInterfaceRx, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
const balances = modules.map((m): QueryableStorageMultiArg<'rxjs'> => [api.query[m].account, accountId]);
const extract = (data: AccountData[]) =>
data.map(({ feeFrozen, free, miscFrozen, reserved }): BalanceResult => [free, reserved, feeFrozen, miscFrozen]);
return isFunction(api.query.system.account)
? api.queryMulti<[AccountInfo, ...(AccountData[])]>([[api.query.system.account, accountId], ...balances]).pipe(
map(([{ nonce }, ...balances]): Result => [nonce, extract(balances)])
)
);
: api.queryMulti<[Index, ...(AccountData[])]>([[api.query.system.accountNonce, accountId], ...balances]).pipe(
map(([nonce, ...balances]): Result => [nonce, extract(balances)])
);
}
function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
@@ -60,7 +77,7 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Re
: (infoOrTuple as [Index, AccountData])[1];
const accountNonce = (infoOrTuple as AccountInfo).nonce || (infoOrTuple as [Index, AccountData])[0];
return [free, reserved, feeFrozen, miscFrozen, accountNonce];
return [accountNonce, [[free, reserved, feeFrozen, miscFrozen]]];
})
);
}
@@ -81,19 +98,29 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Re
* ```
*/
export function account (instanceId: string, api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAccount> {
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
return memo(instanceId, (address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAccount> =>
api.derive.accounts.accountId(address).pipe(
switchMap((accountId): Observable<[AccountId, Result]> =>
(accountId
? combineLatest([
of(accountId),
isFunction(api.query.system.account)
? queryCurrent(api, accountId)
: isFunction(api.query.balances.account)
? queryBalancesAccount(api, accountId)
: queryBalancesFree(api, accountId)
balanceInstances
? queryBalancesAccount(api, accountId, balanceInstances)
: isFunction(api.query.system.account)
? queryCurrent(api, accountId)
: isFunction(api.query.balances.account)
? queryBalancesAccount(api, accountId)
: queryBalancesFree(api, accountId)
])
: of([
api.registry.createType('AccountId'),
[
api.registry.createType('Index'),
[[api.registry.createType('Balance'), api.registry.createType('Balance'), api.registry.createType('Balance'), api.registry.createType('Balance')]]
]
])
: of([api.registry.createType('AccountId'), [api.registry.createType('Balance'), api.registry.createType('Balance'), api.registry.createType('Balance'), api.registry.createType('Balance'), api.registry.createType('Index')]])
)
),
map((result): DeriveBalancesAccount => calcBalances(api, result))
+54 -36
View File
@@ -1,21 +1,23 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { ApiInterfaceRx, QueryableStorageMultiArg } from '@polkadot/api/types';
import type { Option, Vec } from '@polkadot/types';
import type { AccountId, AccountIndex, Address, Balance, BalanceLock, BalanceLockTo212, BlockNumber, VestingInfo, VestingSchedule } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveBalancesAccount, DeriveBalancesAll } from '../types';
import type { DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData } from '../types';
import BN from 'bn.js';
import { bnMax, isFunction } from '@polkadot/util';
import { bnMax } from '@polkadot/util';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { memo } from '../util';
type ResultBalance = [VestingInfo | null, (BalanceLock | BalanceLockTo212)[]];
type BalanceLocksEntry = Vec<BalanceLock | BalanceLockTo212>;
type BalanceLocks = BalanceLocksEntry[];
type ResultBalance = [VestingInfo | null, ((BalanceLock | BalanceLockTo212)[])[]];
type Result = [DeriveBalancesAccount, BlockNumber, ResultBalance];
interface AllLocked {
@@ -50,8 +52,21 @@ function calcLocked (api: ApiInterfaceRx, bestNumber: BlockNumber, locks: (Balan
return { allLocked, lockedBalance, lockedBreakdown, vestingLocked };
}
function calcBalances (api: ApiInterfaceRx, [{ accountId, accountNonce, freeBalance, frozenFee, frozenMisc, reservedBalance, votingBalance }, bestNumber, [vesting, locks]]: Result): DeriveBalancesAll {
function calcShared (api: ApiInterfaceRx, bestNumber: BlockNumber, data: DeriveBalancesAccountData, locks: (BalanceLock | BalanceLockTo212)[]): DeriveBalancesAllAccountData {
const { allLocked, lockedBalance, lockedBreakdown, vestingLocked } = calcLocked(api, bestNumber, locks);
const availableBalance = api.registry.createType('Balance', allLocked ? 0 : bnMax(new BN(0), data.freeBalance.sub(lockedBalance)));
return {
...data,
availableBalance,
lockedBalance,
lockedBreakdown,
vestingLocked
};
}
function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLocks]]: Result): DeriveBalancesAll {
const shared = calcShared(api, bestNumber, data, allLocks[0]);
// Calculate the vesting balances,
// - offset = balance locked at startingBlock
// - perBlock is the unlock amount
@@ -59,29 +74,21 @@ function calcBalances (api: ApiInterfaceRx, [{ accountId, accountNonce, freeBala
const isStarted = bestNumber.gt(startingBlock);
const vestedNow = isStarted ? perBlock.mul(bestNumber.sub(startingBlock)) : new BN(0);
const vestedBalance = vestedNow.gt(vestingTotal) ? vestingTotal : api.registry.createType('Balance', vestedNow);
const isVesting = isStarted && !vestingLocked.isZero();
const vestedClaimable = api.registry.createType('Balance', isVesting ? vestingLocked.sub(vestingTotal.sub(vestedBalance)) : 0);
const availableBalance = api.registry.createType('Balance', allLocked ? 0 : bnMax(new BN(0), freeBalance.sub(lockedBalance)));
const isVesting = isStarted && !shared.vestingLocked.isZero();
const vestedClaimable = api.registry.createType('Balance', isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : 0);
const vestingEndBlock = api.registry.createType('BlockNumber', isVesting ? vestingTotal.div(perBlock).add(startingBlock) : 0);
return {
accountId,
accountNonce,
availableBalance,
freeBalance,
frozenFee,
frozenMisc,
...shared,
accountId: data.accountId,
accountNonce: data.accountNonce,
additional: allLocks.filter((_, index) => index !== 0).map((l, index) => calcShared(api, bestNumber, data.additional[index], l)),
isVesting,
lockedBalance,
lockedBreakdown,
reservedBalance,
vestedBalance,
vestedClaimable,
vestingEndBlock,
vestingLocked,
vestingPerBlock: perBlock,
vestingTotal,
votingBalance
vestingTotal
};
}
@@ -100,28 +107,37 @@ function queryOld (api: ApiInterfaceRx, accountId: AccountId): Observable<Result
vestingNew = api.registry.createType('VestingInfo', { locked, perBlock, startingBlock });
}
return [vestingNew, locks];
return [vestingNew, [locks]];
})
);
}
// current (balances vesting)
function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<ResultBalance> {
// current (balances, vesting)
function queryCurrent (api: ApiInterfaceRx, accountId: AccountId, balanceInstances: string[] = ['balances']): Observable<ResultBalance> {
const lockCalls = balanceInstances.map((m) => api.query[m].locks);
const lockEmpty = lockCalls.map((c) => !c);
const lockQueries = lockCalls.filter((c) => c).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
return (
api.query.vesting?.vesting
? api.queryMulti<[Vec<BalanceLock>, Option<VestingInfo>]>([
[api.query.balances.locks, accountId],
[api.query.vesting.vesting, accountId]
? api.queryMulti<[Option<VestingInfo>, ...BalanceLocks]>([
[api.query.vesting.vesting, accountId],
...lockQueries
])
: api.query.balances.locks(accountId).pipe(
map((locks): [Vec<BalanceLock>, Option<VestingInfo>] =>
[locks, api.registry.createType('Option<VestingInfo>')]
// TODO We need to check module instances here as well, not only the balances module
: lockQueries.length
? api.queryMulti<[...(Vec<BalanceLock>)[]]>(lockQueries).pipe(
map((locks): [Option<VestingInfo>, ...BalanceLocks] =>
[api.registry.createType('Option<VestingInfo>'), ...locks]
)
)
)
: of([api.registry.createType('Option<VestingInfo>')] as [Option<VestingInfo>])
).pipe(
map(([locks, optVesting]): ResultBalance =>
[optVesting.unwrapOr(null), locks]
)
map(([optVesting, ...locks]): ResultBalance => {
let offset = -1;
return [optVesting.unwrapOr(null), lockEmpty.map((e) => e ? api.registry.createType('Vec<BalanceLock>') : locks[++offset])];
})
);
}
@@ -141,6 +157,8 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Re
* ```
*/
export function all (instanceId: string, api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAll> {
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
return memo(instanceId, (address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAll> =>
api.derive.balances.account(address).pipe(
switchMap((account): Observable<Result> =>
@@ -148,11 +166,11 @@ export function all (instanceId: string, api: ApiInterfaceRx): (address: Account
? combineLatest([
of(account),
api.derive.chain.bestNumber(),
isFunction(api.query.system.account) || isFunction(api.query.balances.account)
? queryCurrent(api, account.accountId)
api.query.system?.account || api.query.balances?.account
? queryCurrent(api, account.accountId, balanceInstances)
: queryOld(api, account.accountId)
])
: of([account, api.registry.createType('BlockNumber'), [null, api.registry.createType('Vec<BalanceLock>')]])
: of([account, api.registry.createType('BlockNumber'), [null, []]])
)
),
map((result): DeriveBalancesAll => calcBalances(api, result))
@@ -10,7 +10,7 @@ import type { DeriveStakingQuery } from './types';
import BN from 'bn.js';
import { isFunction } from '@polkadot/util';
import { BN_BILLION, BN_ZERO, isFunction } from '@polkadot/util';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
@@ -18,29 +18,27 @@ import { memo } from '../util';
type ErasResult = [{ unwrapOr: (value: BN) => BN }, DeriveEraPoints[], DeriveEraPrefs[], DeriveEraRewards[]];
const ZERO = new BN(0);
const MIN_ONE = new BN(-1);
const COMM_DIV = new BN(1_000_000_000);
function parseRewards (api: ApiInterfaceRx, stashId: AccountId, [, erasPoints, erasPrefs, erasRewards]: ErasResult, exposures: DeriveStakerExposure[]): DeriveStakerReward[] {
return exposures.map(({ era, isEmpty, isValidator, nominating, validators: eraValidators }): DeriveStakerReward => {
const { eraPoints, validators: allValPoints } = erasPoints.find((p) => p.era.eq(era)) || { eraPoints: ZERO, validators: {} };
const { eraPoints, validators: allValPoints } = erasPoints.find((p) => p.era.eq(era)) || { eraPoints: BN_ZERO, validators: {} };
const { eraReward } = erasRewards.find((r) => r.era.eq(era)) || { eraReward: api.registry.createType('Balance') };
const { validators: allValPrefs } = erasPrefs.find((p) => p.era.eq(era)) || { validators: {} as DeriveEraValPrefs };
const validators: Record<string, DeriveStakerRewardValidator> = {};
const stakerId = stashId.toString();
Object.entries(eraValidators).forEach(([validatorId, exposure]): void => {
const valPoints = allValPoints[validatorId] || ZERO;
const valComm = allValPrefs[validatorId]?.commission.unwrap() || ZERO;
const valPoints = allValPoints[validatorId] || BN_ZERO;
const valComm = allValPrefs[validatorId]?.commission.unwrap() || BN_ZERO;
const expTotal = exposure.total.unwrap();
let avail = ZERO;
let avail = BN_ZERO;
let value: BN | undefined;
if (!(expTotal.isZero() || valPoints.isZero() || eraPoints.isZero())) {
avail = eraReward.mul(valPoints).div(eraPoints);
const valCut = valComm.mul(avail).div(COMM_DIV);
const valCut = valComm.mul(avail).div(BN_BILLION);
let staked: BN;
if (validatorId === stakerId) {
@@ -50,10 +48,10 @@ function parseRewards (api: ApiInterfaceRx, stashId: AccountId, [, erasPoints, e
staked = stakerExp
? stakerExp.value.unwrap()
: ZERO;
: BN_ZERO;
}
value = avail.sub(valCut).imul(staked).div(expTotal).iadd(validatorId === stakerId ? valCut : ZERO);
value = avail.sub(valCut).imul(staked).div(expTotal).iadd(validatorId === stakerId ? valCut : BN_ZERO);
}
validators[validatorId] = {
@@ -181,7 +179,7 @@ export function _stakerRewards (instanceId: string, api: ApiInterfaceRx): (accou
return withActive
? of(rewards)
: filterRewards(api, eras, { migrateEra: erasResult[0].unwrapOr(ZERO), rewards, stakingLedger });
: filterRewards(api, eras, { migrateEra: erasResult[0].unwrapOr(BN_ZERO), rewards, stakingLedger });
})
)
);
+6 -8
View File
@@ -4,19 +4,17 @@
import type { AccountId, Digest } from '@polkadot/types/interfaces';
export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined {
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime');
const [citem] = digest.logs.filter(({ type }) => type === 'Consensus');
// extract from the substrate 2.0 PreRuntime digest
if (pitem) {
const [engine, data] = pitem.asPreRuntime;
if (citem) {
const [engine, data] = citem.asConsensus;
return engine.extractAuthor(data, sessionValidators);
} else {
const [citem] = digest.logs.filter(({ type }) => type === 'Consensus');
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime');
// extract author from the consensus (substrate 1.0, digest)
if (citem) {
const [engine, data] = citem.asConsensus;
if (pitem) {
const [engine, data] = pitem.asPreRuntime;
return engine.extractAuthor(data, sessionValidators);
}
+15 -8
View File
@@ -13,9 +13,7 @@ export * from './parachains/types';
export * from './session/types';
export * from './staking/types';
export interface DeriveBalancesAccount {
accountId: AccountId;
accountNonce: Index;
export interface DeriveBalancesAccountData {
freeBalance: Balance;
frozenFee: Balance;
frozenMisc: Balance;
@@ -23,16 +21,25 @@ export interface DeriveBalancesAccount {
votingBalance: Balance;
}
export interface DeriveBalancesAll extends DeriveBalancesAccount {
isVesting: boolean;
export interface DeriveBalancesAccount extends DeriveBalancesAccountData {
accountId: AccountId;
accountNonce: Index;
additional: DeriveBalancesAccountData[];
}
export interface DeriveBalancesAllAccountData extends DeriveBalancesAccountData {
availableBalance: Balance;
lockedBalance: Balance;
lockedBreakdown: (BalanceLock | BalanceLockTo212)[];
availableBalance: Balance;
votingBalance: Balance;
vestingLocked: Balance;
}
export interface DeriveBalancesAll extends DeriveBalancesAccount, DeriveBalancesAllAccountData {
additional: DeriveBalancesAllAccountData[];
isVesting: boolean;
vestedBalance: Balance;
vestedClaimable: Balance;
vestingEndBlock: BlockNumber;
vestingLocked: Balance;
vestingPerBlock: Balance;
vestingTotal: Balance;
}
+11 -12
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/api",
"version": "3.5.1",
"version": "3.7.3",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
"module": "index.mjs",
"sideEffects": [
"./detectPackage.js",
"./detectPackage.mjs"
@@ -17,16 +16,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api-derive": "3.5.1",
"@polkadot/keyring": "^5.3.1",
"@polkadot/metadata": "3.5.1",
"@polkadot/rpc-core": "3.5.1",
"@polkadot/rpc-provider": "3.5.1",
"@polkadot/types": "3.5.1",
"@polkadot/types-known": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/util-crypto": "^5.3.1",
"@polkadot/x-rxjs": "3.5.1",
"@polkadot/api-derive": "3.7.3",
"@polkadot/keyring": "^5.5.2",
"@polkadot/metadata": "3.7.3",
"@polkadot/rpc-core": "3.7.3",
"@polkadot/rpc-provider": "3.7.3",
"@polkadot/types": "3.7.3",
"@polkadot/types-known": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/util-crypto": "^5.5.2",
"@polkadot/x-rxjs": "^5.5.2",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
}
+66 -25
View File
@@ -3,11 +3,12 @@
import type { Vec, u16, u32, u64, u8 } from '@polkadot/types';
import type { Codec } from '@polkadot/types/types';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight } from '@polkadot/types/interfaces/runtime';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { EraIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { BlockWeights } from '@polkadot/types/interfaces/system';
import type { BlockLength, BlockWeights } from '@polkadot/types/interfaces/system';
import type { ApiTypes } from '@polkadot/api/types';
declare module '@polkadot/api/types/consts' {
@@ -17,6 +18,9 @@ declare module '@polkadot/api/types/consts' {
/**
* The number of **slots** that an epoch takes. We couple sessions to
* epochs, i.e. we start a new session once the new epoch begins.
* NOTE: Currently it is not possible to change the epoch duration
* after the chain has started. Attempting to do so will brick block
* production.
**/
epochDuration: u64 & AugmentedConst<ApiType>;
/**
@@ -49,6 +53,10 @@ declare module '@polkadot/api/types/consts' {
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: BlockNumber & AugmentedConst<ApiType>;
/**
* Bounty duration in blocks.
**/
bountyUpdatePeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* Minimum value for a bounty.
**/
@@ -64,6 +72,40 @@ declare module '@polkadot/api/types/consts' {
};
contracts: {
[key: string]: Codec;
/**
* The maximum number of tries that can be queued for deletion.
**/
deletionQueueDepth: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of weight that can be consumed per block for lazy trie removal.
**/
deletionWeightLimit: Weight & AugmentedConst<ApiType>;
/**
* The balance every contract needs to deposit to stay alive indefinitely.
*
* This is different from the [`Self::TombstoneDeposit`] because this only needs to be
* deposited while the contract is alive. Costs for additional storage are added to
* this base cost.
*
* This is a simple way to ensure that contracts with empty storage eventually get deleted by
* making them pay rent. This creates an incentive to remove them early in order to save rent.
**/
depositPerContract: BalanceOf & AugmentedConst<ApiType>;
/**
* The balance a contract needs to deposit per storage byte to stay alive indefinitely.
*
* Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day,
* then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent.
* But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000,
* then it would pay 500 BU/day.
**/
depositPerStorageByte: BalanceOf & AugmentedConst<ApiType>;
/**
* The balance a contract needs to deposit per storage item to stay alive indefinitely.
*
* It works the same as [`Self::DepositPerStorageByte`] but for storage items.
**/
depositPerStorageItem: BalanceOf & AugmentedConst<ApiType>;
/**
* The maximum nesting level of a call/instantiate stack. A reasonable default
* value is 100.
@@ -74,19 +116,13 @@ declare module '@polkadot/api/types/consts' {
**/
maxValueSize: u32 & AugmentedConst<ApiType>;
/**
* Price of a byte of storage per one block interval. Should be greater than 0.
**/
rentByteFee: BalanceOf & AugmentedConst<ApiType>;
/**
* The amount of funds a contract should deposit in order to offset
* the cost of one byte.
* The fraction of the deposit that should be used as rent per block.
*
* Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day,
* then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent.
* But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000,
* then it would pay 500 BU/day.
* When a contract hasn't enough balance deposited to stay alive indefinitely it needs
* to pay per block for the storage it consumes that is not covered by the deposit.
* This determines how high this rent payment is per block as a fraction of the deposit.
**/
rentDepositOffset: BalanceOf & AugmentedConst<ApiType>;
rentFraction: Perbill & AugmentedConst<ApiType>;
/**
* Number of block delay an extrinsic claim surcharge has.
*
@@ -94,15 +130,6 @@ declare module '@polkadot/api/types/consts' {
* for current_block - delay
**/
signedClaimHandicap: BlockNumber & AugmentedConst<ApiType>;
/**
* A size offset for an contract. A just created account with untouched storage will have that
* much of storage from the perspective of the state rent.
*
* This is a simple way to ensure that contracts with empty storage eventually get deleted
* by making them pay rent. This creates an incentive to remove them early in order to save
* rent.
**/
storageSizeOffset: u32 & AugmentedConst<ApiType>;
/**
* Reward that is received by the party whose touch has led
* to removal of a contract.
@@ -159,7 +186,8 @@ declare module '@polkadot/api/types/consts' {
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
moduleId: LockIdentifier & AugmentedConst<ApiType>;
termDuration: BlockNumber & AugmentedConst<ApiType>;
votingBond: BalanceOf & AugmentedConst<ApiType>;
votingBondBase: BalanceOf & AugmentedConst<ApiType>;
votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
};
identity: {
[key: string]: Codec;
@@ -199,6 +227,11 @@ declare module '@polkadot/api/types/consts' {
**/
deposit: BalanceOf & AugmentedConst<ApiType>;
};
lottery: {
[key: string]: Codec;
maxCalls: u32 & AugmentedConst<ApiType>;
moduleId: ModuleId & AugmentedConst<ApiType>;
};
multisig: {
[key: string]: Codec;
/**
@@ -343,11 +376,15 @@ declare module '@polkadot/api/types/consts' {
system: {
[key: string]: Codec;
/**
* The maximum number of blocks to allow in mortal eras.
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
**/
blockHashCount: BlockNumber & AugmentedConst<ApiType>;
/**
* The weight configuration (limits & base values) for each class of extrinsics and block.
* The maximum length of a block (in bytes).
**/
blockLength: BlockLength & AugmentedConst<ApiType>;
/**
* Block & extrinsics weights: base values and limits.
**/
blockWeights: BlockWeights & AugmentedConst<ApiType>;
/**
@@ -362,6 +399,10 @@ declare module '@polkadot/api/types/consts' {
* an identifier of the chain.
**/
ss58Prefix: u8 & AugmentedConst<ApiType>;
/**
* Get the chain's current version.
**/
version: RuntimeVersion & AugmentedConst<ApiType>;
};
timestamp: {
[key: string]: Codec;
+61 -5
View File
@@ -11,6 +11,14 @@ declare module '@polkadot/api/types/errors' {
* Transfer amount should be non-zero.
**/
AmountZero: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
BadMetadata: AugmentedError<ApiType>;
/**
* Some internal state is broken.
**/
BadState: AugmentedError<ApiType>;
/**
* Invalid witness data given.
**/
@@ -179,6 +187,13 @@ declare module '@polkadot/api/types/errors' {
* The code supplied to `put_code` exceeds the limit specified in the current schedule.
**/
CodeTooLarge: AugmentedError<ApiType>;
/**
* A contract could not be evicted because it has enough balance to pay rent.
*
* This can be returned from [`Module::claim_surcharge`] because the target
* contract has enough balance to pay for its rent.
**/
ContractNotEvictable: AugmentedError<ApiType>;
/**
* Contract trapped during execution.
**/
@@ -187,6 +202,14 @@ declare module '@polkadot/api/types/errors' {
* Input passed to a contract API function failed to decode as expected type.
**/
DecodingFailed: AugmentedError<ApiType>;
/**
* Removal of a contract failed because the deletion queue is full.
*
* This can happen when either calling [`Module::claim_surcharge`] or `seal_terminate`.
* The queue is filled by deleting contracts and emptied by a fixed amount each block.
* Trying again during another block is the only way to resolve this issue.
**/
DeletionQueueFull: AugmentedError<ApiType>;
/**
* The topics passed to `seal_deposit_events` contains at least one duplicate.
**/
@@ -229,6 +252,12 @@ declare module '@polkadot/api/types/errors' {
* its contructor. No contracts are allowed to exist below that threshold.
**/
NewContractNotFunded: AugmentedError<ApiType>;
/**
* The chain does not provide a chain extension. Calling the chain extension results
* in this error. Note that this usually shouldn't happen as deploying such contracts
* is rejected.
**/
NoChainExtension: AugmentedError<ApiType>;
/**
* The contract that was called is either no contract at all (a plain account)
* or is a tombstone.
@@ -256,6 +285,13 @@ declare module '@polkadot/api/types/errors' {
* of a tombstone.
**/
ReentranceDenied: AugmentedError<ApiType>;
/**
* A storage modification exhausted the 32bit type that holds the storage size.
*
* This can either happen when the accumulated storage in bytes is too large or
* when number of storage items is too large.
**/
StorageExhausted: AugmentedError<ApiType>;
/**
* The amount of topics passed to `seal_deposit_events` exceeds the limit.
**/
@@ -468,10 +504,6 @@ declare module '@polkadot/api/types/errors' {
* Candidate does not have enough funds.
**/
InsufficientCandidateFunds: AugmentedError<ApiType>;
/**
* The provided count of number of candidates is incorrect.
**/
InvalidCandidateCount: AugmentedError<ApiType>;
/**
* The renouncing origin presented a wrong `Renouncing` parameter.
**/
@@ -484,6 +516,10 @@ declare module '@polkadot/api/types/errors' {
* The provided count of number of votes is incorrect.
**/
InvalidVoteCount: AugmentedError<ApiType>;
/**
* The provided count of number of candidates is incorrect.
**/
InvalidWitnessData: AugmentedError<ApiType>;
/**
* Cannot vote with stake less than minimum balance.
**/
@@ -515,7 +551,7 @@ declare module '@polkadot/api/types/errors' {
/**
* Runner cannot re-submit candidacy.
**/
RunnerSubmit: AugmentedError<ApiType>;
RunnerUpSubmit: AugmentedError<ApiType>;
/**
* Cannot vote more than candidates.
**/
@@ -752,6 +788,10 @@ declare module '@polkadot/api/types/errors' {
* This user has already vouched for this recovery
**/
AlreadyVouched: AugmentedError<ApiType>;
/**
* Some internal state is broken.
**/
BadState: AugmentedError<ApiType>;
/**
* The friend must wait until the delay period to vouch for this recovery
**/
@@ -830,6 +870,10 @@ declare module '@polkadot/api/types/errors' {
* Invalid ownership proof.
**/
InvalidProof: AugmentedError<ApiType>;
/**
* Key setting account is not live, so it's impossible to associate keys.
**/
NoAccount: AugmentedError<ApiType>;
/**
* No associated validator ID for account.
**/
@@ -928,6 +972,14 @@ declare module '@polkadot/api/types/errors' {
* Controller is already paired.
**/
AlreadyPaired: AugmentedError<ApiType>;
/**
* Internal state has become somehow corrupted and the operation cannot continue.
**/
BadState: AugmentedError<ApiType>;
/**
* A nomination target was supplied that was blocked or otherwise not a validator.
**/
BadTarget: AugmentedError<ApiType>;
/**
* The call is not allowed at the given time due to restrictions of election period.
**/
@@ -1043,6 +1095,10 @@ declare module '@polkadot/api/types/errors' {
* The snapshot data of the current window is missing.
**/
SnapshotUnavailable: AugmentedError<ApiType>;
/**
* Too many nomination targets supplied.
**/
TooManyTargets: AugmentedError<ApiType>;
};
sudo: {
[key: string]: AugmentedError<ApiType>;
+46 -12
View File
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { Bytes, Option, Vec, bool, u16, u32 } from '@polkadot/types';
import type { Bytes, Option, Vec, bool, u16, u32, u8 } from '@polkadot/types';
import type { ITuple } from '@polkadot/types/types';
import type { TAssetBalance } from '@polkadot/types/interfaces/assets';
import type { BalanceStatus } from '@polkadot/types/interfaces/balances';
@@ -11,6 +11,7 @@ import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/demo
import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
import type { AuthorityList } from '@polkadot/types/interfaces/grandpa';
import type { RegistrarIndex } from '@polkadot/types/interfaces/identity';
import type { CallIndex } from '@polkadot/types/interfaces/lottery';
import type { Kind, OpaqueTimeSlot } from '@polkadot/types/interfaces/offences';
import type { ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountId, AccountIndex, AssetId, Balance, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime';
@@ -26,6 +27,14 @@ declare module '@polkadot/api/types/events' {
export interface AugmentedEvents<ApiType> {
assets: {
[key: string]: AugmentedEvent<ApiType>;
/**
* Some asset `asset_id` was frozen. \[asset_id\]
**/
AssetFrozen: AugmentedEvent<ApiType, [AssetId]>;
/**
* Some asset `asset_id` was thawed. \[asset_id\]
**/
AssetThawed: AugmentedEvent<ApiType, [AssetId]>;
/**
* Some assets were destroyed. \[asset_id, owner, balance\]
**/
@@ -58,6 +67,10 @@ declare module '@polkadot/api/types/events' {
* The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\]
**/
MaxZombiesChanged: AugmentedEvent<ApiType, [AssetId, u32]>;
/**
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals\]
**/
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8]>;
/**
* The owner changed \[asset_id, owner\]
**/
@@ -309,7 +322,10 @@ declare module '@polkadot/api/types/events' {
elections: {
[key: string]: AugmentedEvent<ApiType>;
/**
* A candidate was slashed due to failing to obtain a seat as member or runner-up
* A \[candidate\] was slashed by \[amount\] due to failing to obtain a seat as member or
* runner-up.
*
* Note that old members and runners-up are also candidates.
**/
CandidateSlashed: AugmentedEvent<ApiType, [AccountId, Balance]>;
/**
@@ -326,10 +342,6 @@ declare module '@polkadot/api/types/events' {
* `EmptyTerm`.
**/
MemberKicked: AugmentedEvent<ApiType, [AccountId]>;
/**
* A \[member\] has renounced their candidacy.
**/
MemberRenounced: AugmentedEvent<ApiType, [AccountId]>;
/**
* A new term with \[new_members\]. This indicates that enough candidates existed to run the
* election, not that enough have has been elected. The inner value must be examined for
@@ -338,14 +350,13 @@ declare module '@polkadot/api/types/events' {
**/
NewTerm: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId, Balance]>>]>;
/**
* A seat holder (member or runner-up) was slashed due to failing to retaining their position.
* Someone has renounced their candidacy.
**/
Renounced: AugmentedEvent<ApiType, [AccountId]>;
/**
* A \[seat holder\] was slashed by \[amount\] by being forcefully removed from the set.
**/
SeatHolderSlashed: AugmentedEvent<ApiType, [AccountId, Balance]>;
/**
* A voter was reported with the the report being successful or not.
* \[voter, reporter, success\]
**/
VoterReported: AugmentedEvent<ApiType, [AccountId, AccountId, bool]>;
};
grandpa: {
[key: string]: AugmentedEvent<ApiType>;
@@ -437,6 +448,25 @@ declare module '@polkadot/api/types/events' {
**/
IndexFrozen: AugmentedEvent<ApiType, [AccountIndex, AccountId]>;
};
lottery: {
[key: string]: AugmentedEvent<ApiType>;
/**
* A new set of calls have been set!
**/
CallsUpdated: AugmentedEvent<ApiType, []>;
/**
* A lottery has been started!
**/
LotteryStarted: AugmentedEvent<ApiType, []>;
/**
* A ticket has been bought!
**/
TicketBought: AugmentedEvent<ApiType, [AccountId, CallIndex]>;
/**
* A winner has been chosen!
**/
Winner: AugmentedEvent<ApiType, [AccountId, Balance]>;
};
multisig: {
[key: string]: AugmentedEvent<ApiType>;
/**
@@ -622,6 +652,10 @@ declare module '@polkadot/api/types/events' {
* \[era_index, validator_payout, remainder\]
**/
EraPayout: AugmentedEvent<ApiType, [EraIndex, Balance, Balance]>;
/**
* A nominator has been kicked from a validator. \[nominator, stash\]
**/
Kicked: AugmentedEvent<ApiType, [AccountId, AccountId]>;
/**
* An old slashing report from a prior era was discarded because it could
* not be processed. \[session_index\]
+71 -13
View File
@@ -3,18 +3,19 @@
import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
import type { AssetBalance, AssetDetails } from '@polkadot/types/interfaces/assets';
import type { AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets';
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy';
import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity';
import type { AuthIndex } from '@polkadot/types/interfaces/imOnline';
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
import type { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences';
import type { ProxyAnnouncement, ProxyDefinition } from '@polkadot/types/interfaces/proxy';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
@@ -22,7 +23,7 @@ import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber,
import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SeatHolder, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking';
import type { AccountInfo, ConsumedWeight, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
@@ -42,6 +43,10 @@ declare module '@polkadot/api/types/storage' {
* Details of an asset.
**/
asset: AugmentedQuery<ApiType, (arg: AssetId | AnyNumber | Uint8Array) => Observable<Option<AssetDetails>>, [AssetId]> & QueryableStorageEntry<ApiType, [AssetId]>;
/**
* Metadata of an asset.
**/
metadata: AugmentedQuery<ApiType, (arg: AssetId | AnyNumber | Uint8Array) => Observable<AssetMetadata>, [AssetId]> & QueryableStorageEntry<ApiType, [AssetId]>;
};
authorship: {
[key: string]: QueryableStorageEntry<ApiType>;
@@ -96,6 +101,10 @@ declare module '@polkadot/api/types/storage' {
* execution context should always yield zero.
**/
lateness: AugmentedQuery<ApiType, () => Observable<BlockNumber>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Next epoch authorities.
**/
nextAuthorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Next epoch configuration, if changed.
**/
@@ -197,6 +206,13 @@ declare module '@polkadot/api/types/storage' {
* Current cost schedule for contracts.
**/
currentSchedule: AugmentedQuery<ApiType, () => Observable<Schedule>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Evicted contracts that await child trie deletion.
*
* Child trie deletion is a heavy operation depending on the amount of storage items
* stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
**/
deletionQueue: AugmentedQuery<ApiType, () => Observable<Vec<DeletedContract>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A mapping from an original code hash to the original code, untouched by instrumentation.
**/
@@ -310,28 +326,37 @@ declare module '@polkadot/api/types/storage' {
elections: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
* The present candidate list. Sorted based on account-id. A current member or runner-up
* can never enter this vector and is always implicitly assumed to be a candidate.
* The present candidate list. A current member or runner-up can never enter this vector
* and is always implicitly assumed to be a candidate.
*
* Second element is the deposit.
*
* Invariant: Always sorted based on account id.
**/
candidates: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>, []> & QueryableStorageEntry<ApiType, []>;
candidates: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AccountId, BalanceOf]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The total number of vote rounds that have happened, excluding the upcoming one.
**/
electionRounds: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current elected membership. Sorted based on account id.
* The current elected members.
*
* Invariant: Always sorted based on account id.
**/
members: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AccountId, BalanceOf]>>>, []> & QueryableStorageEntry<ApiType, []>;
members: AugmentedQuery<ApiType, () => Observable<Vec<SeatHolder>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current runners_up. Sorted based on low to high merit (worse to best).
* The current reserved runners-up.
*
* Invariant: Always sorted based on rank (worse to best). Upon removal of a member, the
* last (i.e. _best_) runner-up will be replaced.
**/
runnersUp: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AccountId, BalanceOf]>>>, []> & QueryableStorageEntry<ApiType, []>;
runnersUp: AugmentedQuery<ApiType, () => Observable<Vec<SeatHolder>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Votes and locked stake of a particular voter.
*
* TWOX-NOTE: SAFE as `AccountId` is a crypto hash
* TWOX-NOTE: SAFE as `AccountId` is a crypto hash.
**/
voting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<ITuple<[BalanceOf, Vec<AccountId>]>>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
voting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Voter>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
};
grandpa: {
[key: string]: QueryableStorageEntry<ApiType>;
@@ -426,6 +451,34 @@ declare module '@polkadot/api/types/storage' {
**/
accounts: AugmentedQuery<ApiType, (arg: AccountIndex | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId, BalanceOf, bool]>>>, [AccountIndex]> & QueryableStorageEntry<ApiType, [AccountIndex]>;
};
lottery: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
* The calls stored in this pallet to be used in an active lottery if configured
* by `Config::ValidateCall`.
**/
callIndices: AugmentedQuery<ApiType, () => Observable<Vec<CallIndex>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The configuration for the current lottery.
**/
lottery: AugmentedQuery<ApiType, () => Observable<Option<LotteryConfig>>, []> & QueryableStorageEntry<ApiType, []>;
lotteryIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Users who have purchased a ticket. (Lottery Index, Tickets Purchased)
**/
participants: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<ITuple<[u32, Vec<CallIndex>]>>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
/**
* Each ticket's owner.
*
* May have residual storage from previous lotteries. Use `TicketsCount` to see which ones
* are actually valid ticket mappings.
**/
tickets: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<AccountId>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Total number of tickets sold.
**/
ticketsCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
};
mmr: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
@@ -817,7 +870,7 @@ declare module '@polkadot/api/types/storage' {
* True if network has been upgraded to this version.
* Storage version of the pallet.
*
* This is set to v3.0.0 for new networks.
* This is set to v5.0.0 for new networks.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -912,6 +965,11 @@ declare module '@polkadot/api/types/storage' {
* Hash of the previous block.
**/
parentHash: AugmentedQuery<ApiType, () => Observable<Hash>, []> & QueryableStorageEntry<ApiType, []>;
/**
* True if we have upgraded so that AccountInfo contains two types of `RefCount`. False
* (default) if not.
**/
upgradedToDualRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* True if we have upgraded so that `type RefCount` is `u32`. False (default) if not.
**/
+5 -1
View File
@@ -15,7 +15,7 @@ import type { EthAccount, EthCallRequest, EthFilter, EthLog, EthReceipt, EthRich
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
import type { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state';
@@ -316,6 +316,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
localStorageSet: AugmentedRpc<(kind: StorageKind | '__UNUSED' | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => Observable<Null>>;
};
payment: {
/**
* Query the detailed fee of a given encoded extrinsic
**/
queryFeeDetails: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<FeeDetails>>;
/**
* Retrieves the fee information for an encoded extrinsic
**/
+224 -164
View File
@@ -1,20 +1,20 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64 } from '@polkadot/types';
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types';
import type { AnyNumber, ITuple } from '@polkadot/types/types';
import type { TAssetBalance } from '@polkadot/types/interfaces/assets';
import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
import type { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts';
import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
import type { DefunctVoter, Renouncing } from '@polkadot/types/interfaces/elections';
import type { Renouncing } from '@polkadot/types/interfaces/elections';
import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity';
import type { Heartbeat } from '@polkadot/types/interfaces/imOnline';
import type { ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountId, AccountIndex, Address, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime';
import type { Period, Priority } from '@polkadot/types/interfaces/scheduler';
import type { Keys } from '@polkadot/types/interfaces/session';
import type { SocietyJudgement } from '@polkadot/types/interfaces/society';
@@ -46,7 +46,7 @@ declare module '@polkadot/api/types/submittable' {
* Weight: `O(1)`
* Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
**/
burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Issue a new class of fungible assets from a public origin.
*
@@ -72,7 +72,7 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, u32, TAssetBalance]>;
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, u32, TAssetBalance]>;
/**
* Destroy a class of fungible assets owned by the sender.
*
@@ -109,7 +109,7 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<u32>, Compact<TAssetBalance>]>;
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<u32>, Compact<TAssetBalance>]>;
/**
* Destroy a class of fungible assets.
*
@@ -144,7 +144,7 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status
* of `source`; Account pre-existence of `dest`.
**/
forceTransfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, Compact<TAssetBalance>]>;
forceTransfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, Compact<TAssetBalance>]>;
/**
* Disallow further unprivileged transfers from an account.
*
@@ -157,7 +157,19 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
freeze: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
freeze: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
/**
* Disallow further unprivileged transfers for the asset class.
*
* Origin must be Signed and the sender should be the Freezer of the asset `id`.
*
* - `id`: The identifier of the asset to be frozen.
*
* Emits `Frozen`.
*
* Weight: `O(1)`
**/
freezeAsset: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/**
* Mint assets of a particular class.
*
@@ -172,8 +184,47 @@ declare module '@polkadot/api/types/submittable' {
* Weight: `O(1)`
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
**/
mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Set the maximum number of zombie accounts for an asset.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* Funds of sender are reserved according to the formula:
* `AssetDepositBase + AssetDepositPerZombie * max_zombies` taking into account
* any already reserved funds.
*
* - `id`: The identifier of the asset to update zombie count.
* - `max_zombies`: The new number of zombies allowed for this asset.
*
* Emits `MaxZombiesChanged`.
*
* Weight: `O(1)`
**/
setMaxZombies: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
/**
* Set the metadata for an asset.
*
* NOTE: There is no `unset_metadata` call. Simply pass an empty name, symbol,
* and 0 decimals to this function to remove the metadata of an asset and
* return your deposit.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* Funds of sender are reserved according to the formula:
* `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into
* account any already reserved funds.
*
* - `id`: The identifier of the asset to update.
* - `name`: The user friendly name of this asset. Limited in length by `StringLimit`.
* - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`.
* - `decimals`: The number of decimals this asset uses to represent one unit.
*
* Emits `MaxZombiesChanged`.
*
* Weight: `O(1)`
**/
setMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, name: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, decimals: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Bytes, Bytes, u8]>;
/**
* Change the Issuer, Admin and Freezer of an asset.
*
@@ -188,7 +239,7 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
setTeam: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, issuer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, freezer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, LookupSource]>;
setTeam: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, issuer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, LookupSource]>;
/**
* Allow unprivileged transfers from an account again.
*
@@ -201,7 +252,19 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
thaw: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
thaw: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
/**
* Allow unprivileged transfers for the asset again.
*
* Origin must be Signed and the sender should be the Admin of the asset `id`.
*
* - `id`: The identifier of the asset to be frozen.
*
* Emits `Thawed`.
*
* Weight: `O(1)`
**/
thawAsset: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/**
* Move some assets from the sender account to another.
*
@@ -222,7 +285,7 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status
* of sender; Account pre-existence of `target`.
**/
transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Change the Owner of an asset.
*
@@ -235,7 +298,7 @@ declare module '@polkadot/api/types/submittable' {
*
* Weight: `O(1)`
**/
transferOwnership: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
transferOwnership: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
};
authorship: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
@@ -275,7 +338,7 @@ declare module '@polkadot/api/types/submittable' {
* not assumed to be in the overlay.
* # </weight>
**/
forceTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, LookupSource, Compact<Balance>]>;
forceTransfer: AugmentedSubmittable<(source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, LookupSource, Compact<Balance>]>;
/**
* Set the balances of a given account.
*
@@ -296,7 +359,7 @@ declare module '@polkadot/api/types/submittable' {
* - DB Weight: 1 Read, 1 Write to `who`
* # </weight>
**/
setBalance: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, newFree: Compact<Balance> | AnyNumber | Uint8Array, newReserved: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>, Compact<Balance>]>;
setBalance: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, newFree: Compact<Balance> | AnyNumber | Uint8Array, newReserved: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>, Compact<Balance>]>;
/**
* Transfer some liquid free balance to another account.
*
@@ -326,7 +389,7 @@ declare module '@polkadot/api/types/submittable' {
* - Origin account is already in memory, so no DB operations for them.
* # </weight>
**/
transfer: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>]>;
transfer: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>]>;
/**
* Same as the [`transfer`] call, but with a check that the transfer will not kill the
* origin account.
@@ -340,7 +403,7 @@ declare module '@polkadot/api/types/submittable' {
* - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already)
* #</weight>
**/
transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>]>;
transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<Balance>]>;
};
bounties: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
@@ -378,7 +441,7 @@ declare module '@polkadot/api/types/submittable' {
* - O(1).
* # </weight>
**/
awardBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BountyIndex>, LookupSource]>;
awardBounty: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BountyIndex>, LookupSource]>;
/**
* Claim the payout from an awarded bounty after payout delay.
*
@@ -441,7 +504,7 @@ declare module '@polkadot/api/types/submittable' {
* - O(1).
* # </weight>
**/
proposeCurator: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BountyIndex>, LookupSource, Compact<BalanceOf>]>;
proposeCurator: AugmentedSubmittable<(bountyId: Compact<BountyIndex> | AnyNumber | Uint8Array, curator: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BountyIndex>, LookupSource, Compact<BalanceOf>]>;
/**
* Unassign curator from a bounty.
*
@@ -475,13 +538,17 @@ declare module '@polkadot/api/types/submittable' {
* * If no account exists and the call value is not less than `existential_deposit`,
* a regular account will be created and any value will be transferred.
**/
call: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, gasLimit: Compact<Gas> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, Compact<Gas>, Bytes]>;
call: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, gasLimit: Compact<Gas> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, Compact<Gas>, Bytes]>;
/**
* Allows block producers to claim a small reward for evicting a contract. If a block producer
* fails to do so, a regular users will be allowed to claim the reward.
* Allows block producers to claim a small reward for evicting a contract. If a block
* producer fails to do so, a regular users will be allowed to claim the reward.
*
* If contract is not evicted as a result of this call, no actions are taken and
* the sender is not eligible for the reward.
* In case of a successful eviction no fees are charged from the sender. However, the
* reward is capped by the total amount of rent that was payed by the contract while
* it was alive.
*
* If contract is not evicted as a result of this call, [`Error::ContractNotEvictable`]
* is returned and the sender is not eligible for the reward.
**/
claimSurcharge: AugmentedSubmittable<(dest: AccountId | string | Uint8Array, auxSender: Option<AccountId> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, Option<AccountId>]>;
/**
@@ -986,6 +1053,19 @@ declare module '@polkadot/api/types/submittable' {
};
elections: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Clean all voters who are defunct (i.e. they do not serve any purpose at all). The
* deposit of the removed voters are returned.
*
* This is an root function to be used only for cleaning the state.
*
* The dispatch origin of this call must be root.
*
* # <weight>
* The total number of voters and those that are defunct must be provided as witness data.
* # </weight>
**/
cleanDefunctVoters: AugmentedSubmittable<(numVoters: u32 | AnyNumber | Uint8Array, numDefunct: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
/**
* Remove a particular member from the set. This is effective immediately and the bond of
* the outgoing member is slashed.
@@ -993,125 +1073,59 @@ declare module '@polkadot/api/types/submittable' {
* If a runner-up is available, then the best runner-up will be removed and replaces the
* outgoing member. Otherwise, a new phragmen election is started.
*
* The dispatch origin of this call must be root.
*
* Note that this does not affect the designated block number of the next election.
*
* # <weight>
* If we have a replacement:
* - Base weight: 50.93 µs
* - State reads:
* - RunnersUp.len()
* - Members, RunnersUp (remove_and_replace_member)
* - State writes:
* - Members, RunnersUp (remove_and_replace_member)
* Else, since this is a root call and will go into phragmen, we assume full block for now.
* If we have a replacement, we use a small weight. Else, since this is a root call and
* will go into phragmen, we assume full block for now.
* # </weight>
**/
removeMember: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, bool]>;
removeMember: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, bool]>;
/**
* Remove `origin` as a voter. This removes the lock and returns the bond.
* Remove `origin` as a voter.
*
* # <weight>
* Base weight: 36.8 µs
* All state access is from do_remove_voter.
* State reads:
* - Voting
* - [AccountData(who)]
* State writes:
* - Voting
* - Locks
* - [AccountData(who)]
* # </weight>
* This removes the lock and returns the deposit.
*
* The dispatch origin of this call must be signed and be a voter.
**/
removeVoter: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Renounce one's intention to be a candidate for the next election round. 3 potential
* outcomes exist:
* - `origin` is a candidate and not elected in any set. In this case, the bond is
*
* - `origin` is a candidate and not elected in any set. In this case, the deposit is
* unreserved, returned and origin is removed as a candidate.
* - `origin` is a current runner-up. In this case, the bond is unreserved, returned and
* - `origin` is a current runner-up. In this case, the deposit is unreserved, returned and
* origin is removed as a runner-up.
* - `origin` is a current member. In this case, the bond is unreserved and origin is
* - `origin` is a current member. In this case, the deposit is unreserved and origin is
* removed as a member, consequently not being a candidate for the next round anymore.
* Similar to [`remove_voter`], if replacement runners exists, they are immediately used.
* <weight>
* If a candidate is renouncing:
* Base weight: 17.28 µs
* Complexity of candidate_count: 0.235 µs
* State reads:
* - Candidates
* - [AccountBalance(who) (unreserve)]
* State writes:
* - Candidates
* - [AccountBalance(who) (unreserve)]
* If member is renouncing:
* Base weight: 46.25 µs
* State reads:
* - Members, RunnersUp (remove_and_replace_member),
* - [AccountData(who) (unreserve)]
* State writes:
* - Members, RunnersUp (remove_and_replace_member),
* - [AccountData(who) (unreserve)]
* If runner is renouncing:
* Base weight: 46.25 µs
* State reads:
* - RunnersUp (remove_and_replace_member),
* - [AccountData(who) (unreserve)]
* State writes:
* - RunnersUp (remove_and_replace_member),
* - [AccountData(who) (unreserve)]
* </weight>
* Similar to [`remove_members`], if replacement runners exists, they are immediately used.
* If the prime is renouncing, then no prime will exist until the next round.
*
* The dispatch origin of this call must be signed, and have one of the above roles.
*
* # <weight>
* The type of renouncing must be provided as witness data.
* # </weight>
**/
renounceCandidacy: AugmentedSubmittable<(renouncing: Renouncing | { Member: any } | { RunnerUp: any } | { Candidate: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Renouncing]>;
/**
* Report `target` for being an defunct voter. In case of a valid report, the reporter is
* rewarded by the bond amount of `target`. Otherwise, the reporter itself is removed and
* their bond is slashed.
* Submit oneself for candidacy. A fixed amount of deposit is recorded.
*
* A defunct voter is defined to be:
* - a voter whose current submitted votes are all invalid. i.e. all of them are no
* longer a candidate nor an active member or a runner-up.
* All candidates are wiped at the end of the term. They either become a member/runner-up,
* or leave the system while their deposit is slashed.
*
* The dispatch origin of this call must be signed.
*
* The origin must provide the number of current candidates and votes of the reported target
* for the purpose of accurate weight calculation.
* ### Warning
*
* Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]
* to get their deposit back. Losing the spot in an election will always lead to a slash.
*
* # <weight>
* No Base weight based on min square analysis.
* Complexity of candidate_count: 1.755 µs
* Complexity of vote_count: 18.51 µs
* State reads:
* - Voting(reporter)
* - Candidate.len()
* - Voting(Target)
* - Candidates, Members, RunnersUp (is_defunct_voter)
* State writes:
* - Lock(reporter || target)
* - [AccountBalance(reporter)] + AccountBalance(target)
* - Voting(reporter || target)
* Note: the db access is worse with respect to db, which is when the report is correct.
* # </weight>
**/
reportDefunctVoter: AugmentedSubmittable<(defunct: DefunctVoter | { who?: any; voteCount?: any; candidateCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [DefunctVoter]>;
/**
* Submit oneself for candidacy.
*
* A candidate will either:
* - Lose at the end of the term and forfeit their deposit.
* - Win and become a member. Members will eventually get their stash back.
* - Become a runner-up. Runners-ups are reserved members in case one gets forcefully
* removed.
*
* # <weight>
* Base weight = 33.33 µs
* Complexity of candidate_count: 0.375 µs
* State reads:
* - Candidates
* - Members
* - RunnersUp
* - [AccountBalance(who)]
* State writes:
* - [AccountBalance(who)]
* - Candidates
* The number of current candidates must be provided as witness data.
* # </weight>
**/
submitCandidacy: AugmentedSubmittable<(candidateCount: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
@@ -1119,28 +1133,25 @@ declare module '@polkadot/api/types/submittable' {
* Vote for a set of candidates for the upcoming round of election. This can be called to
* set the initial votes, or update already existing votes.
*
* Upon initial voting, `value` units of `who`'s balance is locked and a bond amount is
* reserved.
* Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is
* reserved. The deposit is based on the number of votes and can be updated over time.
*
* The `votes` should:
* - not be empty.
* - be less than the number of possible candidates. Note that all current members and
* runners-up are also automatically candidates for the next round.
*
* It is the responsibility of the caller to not place all of their balance into the lock
* and keep some for further transactions.
* If `value` is more than `who`'s total balance, then the maximum of the two is used.
*
* The dispatch origin of this call must be signed.
*
* ### Warning
*
* It is the responsibility of the caller to **NOT** place all of their balance into the
* lock and keep some for further operations.
*
* # <weight>
* Base weight: 47.93 µs
* State reads:
* - Candidates.len() + Members.len() + RunnersUp.len()
* - Voting (is_voter)
* - Lock
* - [AccountBalance(who) (unreserve + total_balance)]
* State writes:
* - Voting
* - Lock
* - [AccountBalance(who) (unreserve -- only when creating a new voter)]
* We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less.
* # </weight>
**/
vote: AugmentedSubmittable<(votes: Vec<AccountId> | (AccountId | string | Uint8Array)[], value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId>, Compact<BalanceOf>]>;
@@ -1204,7 +1215,7 @@ declare module '@polkadot/api/types/submittable' {
* The dispatch origin for this call must be _Signed_ and the sender must have a registered
* sub identity of `sub`.
**/
addSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Data]>;
addSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Data]>;
/**
* Cancel a previous request.
*
@@ -1267,7 +1278,7 @@ declare module '@polkadot/api/types/submittable' {
* - One event.
* # </weight>
**/
killIdentity: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
killIdentity: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
/**
* Provide a judgement for an account's identity.
*
@@ -1289,7 +1300,7 @@ declare module '@polkadot/api/types/submittable' {
* - One event.
* # </weight>
**/
provideJudgement: AugmentedSubmittable<(regIndex: Compact<RegistrarIndex> | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<RegistrarIndex>, LookupSource, IdentityJudgement]>;
provideJudgement: AugmentedSubmittable<(regIndex: Compact<RegistrarIndex> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<RegistrarIndex>, LookupSource, IdentityJudgement]>;
/**
* Remove the sender as a sub-account.
*
@@ -1312,14 +1323,14 @@ declare module '@polkadot/api/types/submittable' {
* The dispatch origin for this call must be _Signed_ and the sender must have a registered
* sub identity of `sub`.
**/
removeSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
removeSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
/**
* Alter the associated name of the given sub-account.
*
* The dispatch origin for this call must be _Signed_ and the sender must have a registered
* sub identity of `sub`.
**/
renameSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Data]>;
renameSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Data]>;
/**
* Request a judgement from a registrar.
*
@@ -1568,6 +1579,52 @@ declare module '@polkadot/api/types/submittable' {
**/
transfer: AugmentedSubmittable<(updated: AccountId | string | Uint8Array, index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, AccountIndex]>;
};
lottery: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Buy a ticket to enter the lottery.
*
* This extrinsic acts as a passthrough function for `call`. In all
* situations where `call` alone would succeed, this extrinsic should
* succeed.
*
* If `call` is successful, then we will attempt to purchase a ticket,
* which may fail silently. To detect success of a ticket purchase, you
* should listen for the `TicketBought` event.
*
* This extrinsic must be called by a signed origin.
**/
buyTicket: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
/**
* Set calls in storage which can be used to purchase a lottery ticket.
*
* This function only matters if you use the `ValidateCall` implementation
* provided by this pallet, which uses storage to determine the valid calls.
*
* This extrinsic must be called by the Manager origin.
**/
setCalls: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
/**
* Start a lottery using the provided configuration.
*
* This extrinsic must be called by the `ManagerOrigin`.
*
* Parameters:
*
* * `price`: The cost of a single ticket.
* * `length`: How long the lottery should run for starting at the current block.
* * `delay`: How long after the lottery end we should wait before picking a winner.
* * `repeat`: If the lottery should repeat when completed.
**/
startLottery: AugmentedSubmittable<(price: BalanceOf | AnyNumber | Uint8Array, length: BlockNumber | AnyNumber | Uint8Array, delay: BlockNumber | AnyNumber | Uint8Array, repeat: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [BalanceOf, BlockNumber, BlockNumber, bool]>;
/**
* If a lottery is repeating, you can use this to stop the repeat.
* The lottery will continue to run to completion.
*
* This extrinsic must be called by the `ManagerOrigin`.
**/
stopRepeat: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
};
multisig: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
@@ -2481,7 +2538,7 @@ declare module '@polkadot/api/types/submittable' {
* Total Complexity: O(M + logM + C)
* # </weight>
**/
vote: AugmentedSubmittable<(candidate: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, bool]>;
vote: AugmentedSubmittable<(candidate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, bool]>;
/**
* As a member, vouch for someone to join society by placing a bid on their behalf.
*
@@ -2556,7 +2613,7 @@ declare module '@polkadot/api/types/submittable' {
* - Write: Bonded, Payee, [Origin Account], Locks, Ledger
* # </weight>
**/
bond: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
bond: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
/**
* Add some extra amount that have appeared in the stash `free_balance` into the balance up
* for staking.
@@ -2676,6 +2733,22 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
increaseValidatorCount: AugmentedSubmittable<(additional: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Remove the given nominations from the calling validator.
*
* Effects will be felt at the beginning of the next era.
*
* The dispatch origin for this call must be _Signed_ by the controller, not the stash.
* And, it can be only called when [`EraElectionStatus`] is `Closed`. The controller
* account should represent a validator.
*
* - `who`: A list of nominator stash accounts who are nominating this validator which
* should no longer be nominating this validator.
*
* Note: Making this call only makes sense if you first set the validator preferences to
* block any further nominations.
**/
kick: AugmentedSubmittable<(who: Vec<LookupSource> | (LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<LookupSource>]>;
/**
* Declare the desire to nominate `targets` for the origin controller.
*
@@ -2697,7 +2770,7 @@ declare module '@polkadot/api/types/submittable' {
* - Writes: Validators, Nominators
* # </weight>
**/
nominate: AugmentedSubmittable<(targets: Vec<LookupSource> | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<LookupSource>]>;
nominate: AugmentedSubmittable<(targets: Vec<LookupSource> | (LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<LookupSource>]>;
/**
* Pay out all the stakers behind a single validator for a single era.
*
@@ -2730,9 +2803,9 @@ declare module '@polkadot/api/types/submittable' {
**/
payoutStakers: AugmentedSubmittable<(validatorStash: AccountId | string | Uint8Array, era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, EraIndex]>;
/**
* Remove all data structure concerning a staker/stash once its balance is zero.
* Remove all data structure concerning a staker/stash once its balance is at the minimum.
* This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone
* and the target `stash` must have no funds left.
* and the target `stash` must have no funds left beyond the ED.
*
* This can be called from any origin.
*
@@ -2792,7 +2865,7 @@ declare module '@polkadot/api/types/submittable' {
* - Write: Bonded, Ledger New Controller, Ledger Old Controller
* # </weight>
**/
setController: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
setController: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
/**
* Set `HistoryDepth` value. This function will delete any history information
* when `HistoryDepth` is reduced.
@@ -3025,7 +3098,7 @@ declare module '@polkadot/api/types/submittable' {
* - One DB change.
* # </weight>
**/
setKey: AugmentedSubmittable<(updated: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
setKey: AugmentedSubmittable<(updated: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
/**
* Authenticates the sudo key and dispatches a function call with `Root` origin.
*
@@ -3052,7 +3125,7 @@ declare module '@polkadot/api/types/submittable' {
* - Weight of derivative `call` execution + 10,000.
* # </weight>
**/
sudoAs: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Call]>;
sudoAs: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Call]>;
/**
* Authenticates the sudo key and dispatches a function call with `Root` origin.
* This function does not check the weight of the call, and instead allows the
@@ -3167,19 +3240,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight>
**/
setStorage: AugmentedSubmittable<(items: Vec<KeyValue> | (KeyValue)[]) => SubmittableExtrinsic<ApiType>, [Vec<KeyValue>]>;
/**
* Kill the sending account, assuming there are no references outstanding and the composite
* data is equal to its default value.
*
* # <weight>
* - `O(1)`
* - 1 storage read and deletion.
* --------------------
* Base Weight: 8.626 µs
* No DB Read or Write operations because caller is already in overlay
* # </weight>
**/
suicide: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
};
technicalCommittee: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
@@ -3552,7 +3612,7 @@ declare module '@polkadot/api/types/submittable' {
* - DbWrites: `ProposalCount`, `Proposals`, `origin account`
* # </weight>
**/
proposeSpend: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, LookupSource]>;
proposeSpend: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, LookupSource]>;
/**
* Reject a proposed spend. The original deposit will be slashed.
*
@@ -3643,7 +3703,7 @@ declare module '@polkadot/api/types/submittable' {
* - Writes: Vesting Storage, Balances Locks, Target Account, Source Account
* # </weight>
**/
forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, LookupSource, VestingInfo]>;
forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, LookupSource, VestingInfo]>;
/**
* Unlock any vested funds of the sender account.
*
@@ -3677,7 +3737,7 @@ declare module '@polkadot/api/types/submittable' {
* - Writes: Vesting Storage, Balances Locks, Target Account
* # </weight>
**/
vestOther: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
vestOther: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource]>;
/**
* Create a vested transfer.
*
@@ -3696,7 +3756,7 @@ declare module '@polkadot/api/types/submittable' {
* - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]
* # </weight>
**/
vestedTransfer: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, VestingInfo]>;
vestedTransfer: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, VestingInfo]>;
};
}
+32 -9
View File
@@ -14,12 +14,13 @@ import { Metadata } from '@polkadot/metadata';
import { TypeRegistry } from '@polkadot/types/create';
import { LATEST_EXTRINSIC_VERSION } from '@polkadot/types/extrinsic/Extrinsic';
import { getSpecAlias, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
import { assert, BN_ZERO, logger, u8aEq, u8aToU8a } from '@polkadot/util';
import { assert, BN_ZERO, logger, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
import { cryptoWaitReady } from '@polkadot/util-crypto';
import { of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { Decorate } from './Decorate';
import { detectedCapabilities } from './util';
const KEEPALIVE_INTERVAL = 15000;
const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO };
@@ -36,10 +37,6 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) {
super(options, type, decorateMethod);
if (!this.hasSubscriptions) {
l.warn('Api will be available in a limited mode since the provider does not support subscriptions');
}
// all injected types added to the registry for overrides
this.registry.setKnownTypes(options);
@@ -63,9 +60,14 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._rx.signer = options.signer;
this._rpcCore.setRegistrySwap((hash: string | Uint8Array) => this.getBlockRegistry(hash));
this._rpcCore.provider.on('disconnected', this.#onProviderDisconnect);
this._rpcCore.provider.on('error', this.#onProviderError);
this._rpcCore.provider.on('connected', this.#onProviderConnect);
if (this.hasSubscriptions) {
this._rpcCore.provider.on('disconnected', this.#onProviderDisconnect);
this._rpcCore.provider.on('error', this.#onProviderError);
this._rpcCore.provider.on('connected', this.#onProviderConnect);
} else {
l.warn('Api will be available in a limited mode since the provider does not support subscriptions');
}
// If the provider was instantiated earlier, and has already emitted a
// 'connected' event, then the `on('connected')` won't fire anymore. To
@@ -135,6 +137,11 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
// nothing has been found, construct new
const metadata = await this._rpcCore.state.getMetadata(header.parentHash).toPromise();
const registry = this._initRegistry(new TypeRegistry(), this._runtimeChain as Text, version, metadata);
// For now, since this is new we ignore the capability lookups (this could be useful once proven)
// this._detectCapabilities(registry, blockHash);
// add our new registry
const result = { isDefault: false, lastBlockHash, metadata, metadataConsts: null, registry, specVersion: version.specVersion };
this.#registries.push(result);
@@ -180,6 +187,19 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
return [source.genesisHash, source.runtimeMetadata];
}
private _detectCapabilities (registry?: Registry, blockHash?: string | Uint8Array): void {
detectedCapabilities(this._rx, blockHash)
.toPromise()
.then((types): void => {
if (Object.keys(types).length) {
(registry || this.registry).register(types as Record<string, string>);
l.debug(`Capabilities detected${blockHash ? ` (${u8aToHex(u8aToU8a(blockHash))})` : ''}: ${JSON.stringify(types)}`);
}
})
.catch(l.error);
}
// subscribe to metadata updates, inject the types on changes
private _subscribeUpdates (): void {
if (this.#updateSub || !this.hasSubscriptions) {
@@ -212,6 +232,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
// clear the registry types to ensure that we override correctly
this._initRegistry(thisRegistry.registry.init(), this._runtimeChain as Text, version, metadata);
this.injectMetadata(metadata, false, thisRegistry.registry);
this._detectCapabilities(thisRegistry.registry);
return true;
})
@@ -277,9 +298,11 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this._rx.extrinsicType = this._extrinsicType;
this._rx.genesisHash = this._genesisHash;
this._rx.runtimeVersion = this._runtimeVersion;
this._rx.runtimeVersion = this._runtimeVersion as RuntimeVersion; // must be set here
// inject metadata and adjust the types as detected
this.injectMetadata(metadata, true);
this._detectCapabilities();
// derive is last, since it uses the decorated rx
this._rx.derive = this._decorateDeriveRx(this._rxDecorateMethod);
+74
View File
@@ -0,0 +1,74 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool } from '@polkadot/types';
import type { Releases } from '@polkadot/types/interfaces';
import type { InterfaceTypes } from '@polkadot/types/types';
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, take } from '@polkadot/x-rxjs/operators';
// the order and types needs to map with the all array setup below
type Extracted = [bool | null, bool | null, Releases | null];
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
type DetectedValues = keyof InterfaceTypes;
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithProviders',
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
}
function mapCapabilities ([systemRefcount32, systemRefcountDual, stakingVersion]: Extracted): Partial<DetectedTypes> {
const types: Partial<DetectedTypes> = {};
// AccountInfo
if (systemRefcountDual && systemRefcountDual.isTrue) {
types.AccountInfo = 'AccountInfoWithProviders';
} else if (systemRefcount32 && systemRefcount32.isTrue) {
types.AccountInfo = 'AccountInfoWithRefCount';
}
// ValidatorPrefs
if (stakingVersion) {
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
} else {
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
}
}
return types;
}
/**
* @description Query the chain for the specific capabilities
*/
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
const all = [
api.query.system?.upgradedToU32RefCount,
api.query.system?.upgradedToDualRefCount,
api.query.staking?.storageVersion
];
const included = all.map((c) => !!c);
const filtered = all.filter((_, index) => included[index]);
return (
filtered.length
? blockHash
? combineLatest(filtered.map((c) => c.at(blockHash)))
: api.queryMulti(filtered)
: of([])
).pipe(
map((results): Partial<DetectedTypes> => {
let offset = -1;
return mapCapabilities(
included.map((isIncluded) => isIncluded ? results[++offset] : null) as Extracted
);
}),
take(1)
);
}
+1 -1
View File
@@ -12,7 +12,7 @@ import { hexToU8a } from '@polkadot/util';
import { SingleAccountSigner } from '../../test/util';
import { ApiPromise } from '.';
const TRANSFER_SIG = '0x7a10e5ed9a14284eca7bea53f81631981dddda5a3d2dee973b136475947264801465726e4829ae3994d9058df638d959d4e043c7f1924299546790dda1dea20a';
const TRANSFER_SIG = '0x54f39e43f32376a5ab6cdfd4d0ce57802aa9ff85514a7ffa9f2a949078f02beca16af87427c45fe60d54aa847fd241d127ed39e21b101806f6b1f50f7a82500b';
describe('ApiPromise', (): void => {
const registry = new TypeRegistry();
+1 -1
View File
@@ -81,7 +81,7 @@ export interface ApiInterfaceRx {
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
runtimeVersion?: RuntimeVersion;
runtimeVersion: RuntimeVersion;
query: QueryableStorage<'rxjs'>;
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
+6 -7
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/metadata",
"version": "3.5.1",
"version": "3.7.3",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
"module": "index.mjs",
"sideEffects": [
"./detectPackage.js",
"./detectPackage.mjs"
@@ -17,13 +16,13 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.5.1",
"@polkadot/types-known": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/util-crypto": "^5.3.1",
"@polkadot/types": "3.7.3",
"@polkadot/types-known": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/util-crypto": "^5.5.2",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^5.3.1"
"@polkadot/keyring": "^5.5.2"
}
}
@@ -15,6 +15,7 @@ const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
registry.register({ Address: 'IndicesLookupSource', LookupSource: 'IndicesLookupSource' });
const extrinsics = decorateExtrinsics(registry, metadata.asLatest, metadata.version);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+7 -8
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/rpc-core",
"version": "3.5.1",
"version": "3.7.3",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
@@ -14,13 +13,13 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/metadata": "3.5.1",
"@polkadot/rpc-provider": "3.5.1",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/x-rxjs": "3.5.1"
"@polkadot/metadata": "3.7.3",
"@polkadot/rpc-provider": "3.7.3",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/x-rxjs": "^5.5.2"
},
"devDependencies": {
"@polkadot/keyring": "^5.3.1"
"@polkadot/keyring": "^5.5.2"
}
}
+10 -10
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/rpc-provider",
"version": "3.5.1",
"version": "3.7.3",
"description": "Transport providers for the API",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
@@ -14,18 +13,19 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/util-crypto": "^5.3.1",
"@polkadot/x-fetch": "^5.3.1",
"@polkadot/x-ws": "^5.3.1",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/util-crypto": "^5.5.2",
"@polkadot/x-fetch": "^5.5.2",
"@polkadot/x-global": "^5.5.2",
"@polkadot/x-ws": "^5.5.2",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
},
"devDependencies": {
"@polkadot/keyring": "^5.3.1",
"@polkadot/metadata": "3.5.1",
"@polkadot/keyring": "^5.5.2",
"@polkadot/metadata": "3.7.3",
"mock-socket": "^9.0.3",
"nock": "^13.0.5"
"nock": "^13.0.7"
}
}
+2 -1
View File
@@ -8,6 +8,7 @@ import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, Pro
import EventEmitter from 'eventemitter3';
import { assert, isChildClass, isNull, isUndefined, logger } from '@polkadot/util';
import { xglobal } from '@polkadot/x-global';
import { WebSocket } from '@polkadot/x-ws';
import { RpcCoder } from '../coder';
@@ -160,7 +161,7 @@ export class WsProvider implements ProviderInterface {
public async connect (): Promise<void> {
try {
this.#endpointIndex = (this.#endpointIndex + 1) % this.#endpoints.length;
this.#websocket = typeof global.WebSocket !== 'undefined' && isChildClass(global.WebSocket, WebSocket)
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket, WebSocket)
? new WebSocket(this.#endpoints[this.#endpointIndex])
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - WS may be an instance of w3cwebsocket, which supports headers
+7 -8
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/typegen",
"version": "3.5.1",
"version": "3.7.3",
"description": "Type generation scripts",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.js",
@@ -23,17 +22,17 @@
"@babel/core": "^7.12.10",
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@polkadot/api": "3.5.1",
"@polkadot/metadata": "3.5.1",
"@polkadot/rpc-provider": "3.5.1",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/api": "3.7.3",
"@polkadot/metadata": "3.7.3",
"@polkadot/rpc-provider": "3.7.3",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"handlebars": "^4.7.6",
"websocket": "^1.0.33",
"yargs": "^16.2.0"
},
"devDependencies": {
"@types/websocket": "^1.0.1",
"@types/yargs": "^15.0.12"
"@types/yargs": "^15.0.13"
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ function generate (metaHex: string, pkg: string | undefined, output: string, isS
: {};
generateDefaultConsts(path.join(process.cwd(), output, 'augment-api-consts.ts'), metaHex, extraTypes, isStrict);
generateDefaultErrors(path.join(process.cwd(), output, 'augment-api-errors.ts'), metaHex, isStrict);
generateDefaultErrors(path.join(process.cwd(), output, 'augment-api-errors.ts'), metaHex, extraTypes, isStrict);
generateDefaultEvents(path.join(process.cwd(), output, 'augment-api-events.ts'), metaHex, extraTypes, isStrict);
generateDefaultQuery(path.join(process.cwd(), output, 'augment-api-query.ts'), metaHex, extraTypes, isStrict);
generateDefaultRpc(path.join(process.cwd(), output, 'augment-api-rpc.ts'), extraTypes);
+8 -14
View File
@@ -1,23 +1,23 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/metadata/Metadata';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import { stringCamelCase } from '@polkadot/util';
import { compareName, createImports, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util';
import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util';
const template = readTemplate('consts');
const generateForMetaTemplate = Handlebars.compile(template);
/** @internal */
function generateForMeta (meta: Metadata, dest: string, extraTypes: Record<string, Record<string, { types: Record<string, any> }>>, isStrict: boolean): void {
function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean): void {
writeFile(dest, (): string => {
const allTypes: Record<string, Record<string, { types: Record<string, unknown> }>> = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const allTypes = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const imports = createImports(allTypes);
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
@@ -74,14 +74,8 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: Record<strin
// Call `generateForMeta()` with current static metadata
/** @internal */
export function generateDefaultConsts (dest = 'packages/api/src/augment/consts.ts', data = staticData, extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}, isStrict = false): void {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
export function generateDefaultConsts (dest = 'packages/api/src/augment/consts.ts', data?: string, extraTypes: ExtraTypes = {}, isStrict = false): void {
const { metadata } = initMeta(data, extraTypes);
return generateForMeta(metadata, dest, extraTypes, isStrict);
}
+6 -9
View File
@@ -1,14 +1,14 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/metadata/Metadata';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import { stringCamelCase } from '@polkadot/util';
import { compareName, createImports, readTemplate, writeFile } from '../util';
import { compareName, createImports, initMeta, readTemplate, writeFile } from '../util';
const template = readTemplate('errors');
const generateForMetaTemplate = Handlebars.compile(template);
@@ -50,11 +50,8 @@ function generateForMeta (meta: Metadata, dest: string, isStrict: boolean): void
// Call `generateForMeta()` with current static metadata
/** @internal */
export function generateDefaultErrors (dest = 'packages/api/src/augment/errors.ts', data = staticData, isStrict = false): void {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
export function generateDefaultErrors (dest = 'packages/api/src/augment/errors.ts', data?: string, extraTypes: ExtraTypes = {}, isStrict = false): void {
const { metadata } = initMeta(data, extraTypes);
return generateForMeta(metadata, dest, isStrict);
}
+8 -14
View File
@@ -1,23 +1,23 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/metadata/Metadata';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import { stringCamelCase } from '@polkadot/util';
import { compareName, createImports, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util';
import { compareName, createImports, formatType, initMeta, readTemplate, setImports, writeFile } from '../util';
const template = readTemplate('events');
const generateForMetaTemplate = Handlebars.compile(template);
/** @internal */
function generateForMeta (meta: Metadata, dest: string, extraTypes: Record<string, Record<string, { types: Record<string, any> }>>, isStrict: boolean): void {
function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean): void {
writeFile(dest, (): string => {
const allTypes: Record<string, Record<string, { types: Record<string, unknown> }>> = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const allTypes = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const imports = createImports(allTypes);
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
@@ -67,14 +67,8 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: Record<strin
// Call `generateForMeta()` with current static metadata
/** @internal */
export function generateDefaultEvents (dest = 'packages/api/src/augment/events.ts', data = staticData, extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}, isStrict = false): void {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
export function generateDefaultEvents (dest = 'packages/api/src/augment/events.ts', data?: string, extraTypes: ExtraTypes = {}, isStrict = false): void {
const { metadata } = initMeta(data, extraTypes);
return generateForMeta(metadata, dest, extraTypes, isStrict);
}
+7 -14
View File
@@ -1,19 +1,18 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/metadata/Metadata';
import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata';
import type { Registry } from '@polkadot/types/types';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import { stringCamelCase } from '@polkadot/util';
import { compareName, createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, TypeImports, writeFile } from '../util';
import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, TypeImports, writeFile } from '../util';
import { ModuleTypes } from '../util/imports';
// From a storage entry metadata, we return [args, returnType]
@@ -67,9 +66,9 @@ const template = readTemplate('query');
const generateForMetaTemplate = Handlebars.compile(template);
/** @internal */
function generateForMeta (registry: Registry, meta: Metadata, dest: string, extraTypes: Record<string, Record<string, { types: Record<string, any> }>>, isStrict: boolean): void {
function generateForMeta (registry: Registry, meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean): void {
writeFile(dest, (): string => {
const allTypes: Record<string, Record<string, { types: Record<string, any> }>> = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const allTypes: ExtraTypes = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const imports = createImports(allTypes);
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
@@ -130,14 +129,8 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
// Call `generateForMeta()` with current static metadata
/** @internal */
export function generateDefaultQuery (dest = 'packages/api/src/augment/query.ts', data = staticData, extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}, isStrict = false): void {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
export function generateDefaultQuery (dest = 'packages/api/src/augment/query.ts', data?: string, extraTypes: ExtraTypes = {}, isStrict = false): void {
const { metadata, registry } = initMeta(data, extraTypes);
return generateForMeta(registry, metadata, dest, extraTypes, isStrict);
}
+7 -8
View File
@@ -1,14 +1,15 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TypeRegistry } from '@polkadot/types/create';
import type { Definitions } from '@polkadot/types/types';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefinitions from '@polkadot/types/interfaces/definitions';
import { createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util';
import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util';
interface ItemDef {
args: string;
@@ -29,9 +30,9 @@ const template = readTemplate('rpc');
const generateRpcTypesTemplate = Handlebars.compile(template);
/** @internal */
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}): void {
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: ExtraTypes = {}): void {
writeFile(dest, (): string => {
const allTypes: Record<string, Record<string, { types: Record<string, any> }>> = { '@polkadot/types/interfaces': importDefinitions, ...extraTypes };
const allTypes: ExtraTypes = { '@polkadot/types/interfaces': importDefinitions, ...extraTypes };
const imports = createImports(allTypes);
const definitions = imports.definitions as Record<string, Definitions>;
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
@@ -141,10 +142,8 @@ export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Rec
});
}
export function generateDefaultRpc (dest = 'packages/api/src/augment/rpc.ts', extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}): void {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
export function generateDefaultRpc (dest = 'packages/api/src/augment/rpc.ts', extraTypes: ExtraTypes = {}): void {
const { registry } = initMeta(undefined, extraTypes);
generateRpcTypes(
registry,
+7 -14
View File
@@ -1,18 +1,17 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/metadata/Metadata';
import type { Registry } from '@polkadot/types/types';
import type { ExtraTypes } from './types';
import Handlebars from 'handlebars';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import { Text } from '@polkadot/types/primitive';
import { stringCamelCase } from '@polkadot/util';
import { compareName, createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util';
import { compareName, createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util';
const MAPPED_NAMES: Record<string, string> = {
new: 'updated'
@@ -28,9 +27,9 @@ const template = readTemplate('tx');
const generateForMetaTemplate = Handlebars.compile(template);
/** @internal */
function generateForMeta (registry: Registry, meta: Metadata, dest: string, extraTypes: Record<string, Record<string, { types: Record<string, any> }>>, isStrict: boolean): void {
function generateForMeta (registry: Registry, meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean): void {
writeFile(dest, (): string => {
const allTypes: Record<string, Record<string, { types: Record<string, any> }>> = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const allTypes: ExtraTypes = { '@polkadot/types/interfaces': defaultDefs, ...extraTypes };
const imports = createImports(allTypes);
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
@@ -93,14 +92,8 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
// Call `generateForMeta()` with current static metadata
/** @internal */
export function generateDefaultTx (dest = 'packages/api/src/augment/tx.ts', data = staticData, extraTypes: Record<string, Record<string, { types: Record<string, any> }>> = {}, isStrict = false): void {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
export function generateDefaultTx (dest = 'packages/api/src/augment/tx.ts', data?: string, extraTypes: ExtraTypes = {}, isStrict = false): void {
const { metadata, registry } = initMeta(data, extraTypes);
return generateForMeta(registry, metadata, dest, extraTypes, isStrict);
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
export type ExtraTypes = Record<string, Record<string, { types: Record<string, any> }>>;
+2
View File
@@ -275,6 +275,7 @@ function addEvents (metadata: MetadataLatest): string {
const args = func.args.map((type): string => '`' + type.toString() + '`').join(', ');
return {
interface: '`' + `api.events.${stringCamelCase(meta.name)}.${methodName}.is` + '`',
name: `${methodName}(${args})`,
...(func.documentation.length && { summary: func.documentation })
};
@@ -296,6 +297,7 @@ function addErrors (metadata: MetadataLatest): string {
items: moduleMetadata.errors
.sort(sortByName)
.map((error) => ({
interface: '`' + `api.errors.${stringCamelCase(moduleMetadata.name)}.${error.name.toString()}.is` + '`',
name: error.name.toString(),
...(error.documentation.length && { summary: error.documentation })
})),
+1
View File
@@ -6,6 +6,7 @@ export * from './docs';
export * from './file';
export * from './formatting';
export * from './imports';
export * from './initMeta';
export * from './register';
export const compareName = (a: { name: { toString(): string } }, b: { name: { toString(): string } }): number =>
+27
View File
@@ -0,0 +1,27 @@
// Copyright 2017-2021 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ExtraTypes } from '../generate/types';
import { Metadata } from '@polkadot/metadata/Metadata';
import staticData from '@polkadot/metadata/static';
import { TypeRegistry } from '@polkadot/types/create';
import { registerDefinitions } from './register';
interface Result {
metadata: Metadata;
registry: TypeRegistry;
}
export function initMeta (data = staticData, extraTypes: ExtraTypes = {}): Result {
const registry = new TypeRegistry();
registerDefinitions(registry, extraTypes);
const metadata = new Metadata(registry, data);
registry.setMetadata(metadata);
return { metadata, registry };
}
+4 -4
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/types-known",
"version": "3.5.1",
"version": "3.7.3",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"module": "index.mjs",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
@@ -14,8 +13,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/types": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/networks": "^5.5.2",
"@polkadot/types": "3.7.3",
"@polkadot/util": "^5.5.2",
"bn.js": "^4.11.9"
},
"devDependencies": {
+9
View File
@@ -36,15 +36,24 @@ const typesModules: Record<string, OverrideModuleType> = {
identity: {
Judgement: 'IdentityJudgement'
},
inclusion: {
ValidatorIndex: 'ParaValidatorIndex'
},
parachains: {
Id: 'ParaId'
},
parasScheduler: {
ValidatorIndex: 'ParaValidatorIndex'
},
proposeParachain: {
Proposal: 'ParachainProposal'
},
proxy: {
Announcement: 'ProxyAnnouncement'
},
scheduler: {
ValidatorIndex: 'ParaValidatorIndex'
},
society: {
Judgement: 'SocietyJudgement',
Vote: 'SocietyVote'
+37 -13
View File
@@ -6,19 +6,30 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = {
AccountInfo: 'AccountInfoWithProviders',
Address: 'MultiAddress',
Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement']
},
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
};
const addrIndicesTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
Keys: 'SessionKeys5',
LookupSource: 'IndicesLookupSource',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement']
}
};
const indicesTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
LookupSource: 'IndicesLookupSource'
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
const versioned: OverrideVersionedType[] = [
@@ -26,7 +37,7 @@ const versioned: OverrideVersionedType[] = [
// 1020 is first CC3
minmax: [1019, 1031],
types: {
...indicesTypes,
...addrIndicesTypes,
BalanceLock: 'BalanceLockTo212',
CompactAssignments: 'CompactAssignmentsTo257',
DispatchError: 'DispatchErrorTo198',
@@ -46,7 +57,7 @@ const versioned: OverrideVersionedType[] = [
{
minmax: [1032, 1042],
types: {
...indicesTypes,
...addrIndicesTypes,
BalanceLock: 'BalanceLockTo212',
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
@@ -66,7 +77,7 @@ const versioned: OverrideVersionedType[] = [
// actual at 1045 (1043-1044 is dev)
minmax: [1043, 1045],
types: {
...indicesTypes,
...addrIndicesTypes,
BalanceLock: 'BalanceLockTo212',
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
@@ -86,6 +97,7 @@ const versioned: OverrideVersionedType[] = [
types: {
// Indices optional, not in transaction
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
Multiplier: 'Fixed64',
@@ -101,6 +113,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [1055, 1056],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
Multiplier: 'Fixed64',
@@ -115,6 +128,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [1057, 1061],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
OpenTip: 'OpenTipTo225',
@@ -126,6 +140,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [1062, 2012],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225',
RefCount: 'RefCountTo259',
@@ -136,6 +151,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [2013, 2022],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
RefCount: 'RefCountTo259',
RewardDestination: 'RewardDestinationTo257'
@@ -145,11 +161,19 @@ const versioned: OverrideVersionedType[] = [
minmax: [2023, 2024],
types: {
...sharedTypes,
...addrAccountIdTypes,
RefCount: 'RefCountTo259'
}
},
{
minmax: [2025, undefined],
minmax: [2025, 2027],
types: {
...sharedTypes,
...addrAccountIdTypes
}
},
{
minmax: [2028, undefined],
types: {
...sharedTypes
}
@@ -7,14 +7,7 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
const versioned: OverrideVersionedType[] = [
{
minmax: [0, 99],
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
},
{
minmax: [100, undefined],
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
+1 -9
View File
@@ -8,21 +8,13 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
// these are override types for Polkadot
const versioned: OverrideVersionedType[] = [
{
minmax: [0, 259],
minmax: [0, 260],
types: {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
LookupSource: 'IndicesLookupSource'
}
},
{
minmax: [260, 260],
types: {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
}
},
{
minmax: [261, undefined],
types: {
+24 -5
View File
@@ -6,14 +6,23 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = {
AccountInfo: 'AccountInfoWithProviders',
Address: 'MultiAddress',
Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: {
// was: SudoBalances
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'Unused', 'IdentityJudgement']
},
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
};
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
ProxyType: {
// was: SudoBalances
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'Unused', 'IdentityJudgement']
}
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
// these are override types for Polkadot
@@ -22,6 +31,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [0, 12],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225',
RefCount: 'RefCountTo259',
@@ -32,6 +42,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [13, 22],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
RefCount: 'RefCountTo259',
RewardDestination: 'RewardDestinationTo257'
@@ -41,11 +52,19 @@ const versioned: OverrideVersionedType[] = [
minmax: [23, 24],
types: {
...sharedTypes,
...addrAccountIdTypes,
RefCount: 'RefCountTo259'
}
},
{
minmax: [25, undefined],
minmax: [25, 27],
types: {
...sharedTypes,
...addrAccountIdTypes
}
},
{
minmax: [28, undefined],
types: {
...sharedTypes
}
+20 -5
View File
@@ -9,10 +9,10 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
/* eslint-disable sort-keys */
const sharedTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
AccountInfo: 'AccountInfoWithProviders',
Address: 'MultiAddress',
FullIdentification: '()', // No staking, only session (as per config)
LookupSource: 'AccountId',
LookupSource: 'MultiAddress',
Keys: 'SessionKeys6'
};
@@ -21,7 +21,10 @@ const versioned: OverrideVersionedType[] = [
minmax: [0, 9],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
CompactAssignments: 'CompactAssignmentsTo257',
LookupSource: 'AccountId',
RefCount: 'RefCountTo259',
RewardDestination: 'RewardDestinationTo257',
Keys: 'SessionKeys5'
@@ -31,11 +34,23 @@ const versioned: OverrideVersionedType[] = [
minmax: [10, 12],
types: {
...sharedTypes,
Keys: 'SessionKeys5'
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId'
}
},
{
minmax: [13, undefined],
minmax: [13, 201],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
LookupSource: 'AccountId'
}
},
{
minmax: [202, undefined],
types: {
...sharedTypes
}
+26 -6
View File
@@ -6,14 +6,23 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
AccountInfo: 'AccountInfoWithProviders',
Address: 'MultiAddress',
Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: {
// was: SudoBalances
_enum: ['Any', 'NonTransfer', 'Staking', 'Unused', 'IdentityJudgement']
}
},
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
};
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
LookupSource: 'AccountId',
Keys: 'SessionKeys5',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
const versioned: OverrideVersionedType[] = [
@@ -21,6 +30,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [1, 2],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
@@ -33,6 +43,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [3, 22],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225',
RefCount: 'RefCountTo259',
@@ -43,6 +54,7 @@ const versioned: OverrideVersionedType[] = [
minmax: [23, 42],
types: {
...sharedTypes,
...addrAccountIdTypes,
CompactAssignments: 'CompactAssignmentsTo257',
RefCount: 'RefCountTo259',
RewardDestination: 'RewardDestinationTo257'
@@ -52,11 +64,19 @@ const versioned: OverrideVersionedType[] = [
minmax: [43, 44],
types: {
...sharedTypes,
...addrAccountIdTypes,
RefCount: 'RefCountTo259'
}
},
{
minmax: [45, undefined],
minmax: [45, 47],
types: {
...sharedTypes,
...addrAccountIdTypes
}
},
{
minmax: [48, undefined],
types: {
...sharedTypes
}
@@ -1,10 +1,62 @@
// Copyright 2017-2021 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { assert, u8aEq } from '@polkadot/util';
import all from '.';
interface TestDef {
genesisHash: string;
network: string;
versions: [number, [number, number]][];
}
const TESTS: TestDef[] = [
{
genesisHash: '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe',
network: 'kusama',
versions: [
[0, [0, 1020]],
[17, [901442, 1045]]
]
},
{
genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3',
network: 'polkadot',
versions: [
[0, [0, 0]],
[19, [2436698, 26]]
]
},
{
genesisHash: '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e',
network: 'westend',
versions: [
[0, [214356, 4]],
[23, [4207800, 48]]
]
}
];
describe('upgrades', (): void => {
it('is valid', (): void => {
expect(all).toBeDefined();
TESTS.forEach(({ genesisHash, network, versions }): void => {
describe(network, (): void => {
const chain = all.find((n) => n.network === network);
assert(chain, `Unable to find the entry for ${network}`);
it('has a valid genesisHash', (): void => {
expect(u8aEq(chain.genesisHash, genesisHash)).toBe(true);
});
versions.forEach(([index, [blockNumber, specVersion]]): void => {
it(`has a valid entry at index ${index}`, (): void => {
const version = chain.versions[index];
expect(version.blockNumber.eqn(blockNumber)).toBe(true);
expect(version.specVersion.eqn(specVersion)).toBe(true);
});
});
});
});
});
+16 -8
View File
@@ -6,14 +6,22 @@ import type { ChainUpgradesRaw } from './types';
import BN from 'bn.js';
import networks from '@polkadot/networks';
import { assert, hexToU8a } from '@polkadot/util';
import kusama from './kusama';
import polkadot from './polkadot';
import westend from './westend';
// testnets are not available in the networks map
const NET_EXTRA: Record<string, { genesisHash: string[] }> = {
westend: {
genesisHash: ['0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e']
}
};
/** @internal */
function checkOrder (network: string, versions: [number, number][]): [number, number][] {
function checkOrder (network: string, versions: ChainUpgradesRaw): [number, number][] {
const ooo = versions.filter((curr, index): boolean => {
const prev = versions[index - 1];
@@ -28,9 +36,13 @@ function checkOrder (network: string, versions: [number, number][]): [number, nu
}
/** @internal */
function rawToFinal (network: string, { genesisHash, versions }: ChainUpgradesRaw): ChainUpgrades {
function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades {
const chain = networks.find((n) => n.network === network) || NET_EXTRA[network];
assert(chain, `Unable to find info for chain ${network}`);
return {
genesisHash: hexToU8a(genesisHash),
genesisHash: hexToU8a(chain.genesisHash[0]),
network,
versions: checkOrder(network, versions).map(([blockNumber, specVersion]) => ({
blockNumber: new BN(blockNumber),
@@ -40,10 +52,6 @@ function rawToFinal (network: string, { genesisHash, versions }: ChainUpgradesRa
}
// Type overrides for specific spec types & versions as given in runtimeVersion
const upgrades: ChainUpgrades[] = [
rawToFinal('kusama', kusama),
rawToFinal('polkadot', polkadot),
rawToFinal('westend', westend)
];
const upgrades = Object.entries({ kusama, polkadot, westend }).map(mapRaw);
export default upgrades;
+10 -13
View File
@@ -3,18 +3,15 @@
import type { ChainUpgradesRaw } from './types';
const upgrades: ChainUpgradesRaw = {
genesisHash: '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe',
versions: [
[0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
[67651, 1025], [82191, 1027], [83238, 1028], [101503, 1029], [203466, 1030],
[295787, 1031], [461692, 1032], [504329, 1033], [569327, 1038], [587687, 1039],
[653183, 1040], [693488, 1042], [901442, 1045], [1375086, 1050], [1445458, 1051],
[1472960, 1052], [1475648, 1053], [1491596, 1054], [1574408, 1055], [2064961, 1058],
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026]
]
};
const upgrades: ChainUpgradesRaw = [
[0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
[67651, 1025], [82191, 1027], [83238, 1028], [101503, 1029], [203466, 1030],
[295787, 1031], [461692, 1032], [504329, 1033], [569327, 1038], [587687, 1039],
[653183, 1040], [693488, 1042], [901442, 1045], [1375086, 1050], [1445458, 1051],
[1472960, 1052], [1475648, 1053], [1491596, 1054], [1574408, 1055], [2064961, 1058],
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027]
];
export default upgrades;
@@ -3,14 +3,12 @@
import type { ChainUpgradesRaw } from './types';
const upgrades: ChainUpgradesRaw = {
genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3',
versions: [
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25]
]
};
const upgrades: ChainUpgradesRaw = [
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
[3613564, 27]
];
export default upgrades;
+1 -4
View File
@@ -1,7 +1,4 @@
// Copyright 2017-2021 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
export interface ChainUpgradesRaw {
genesisHash: string;
versions: [number, number][];
}
export type ChainUpgradesRaw = [number, number][];
+7 -10
View File
@@ -3,15 +3,12 @@
import type { ChainUpgradesRaw } from './types';
const upgrades: ChainUpgradesRaw = {
genesisHash: '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e',
versions: [
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
[2549864, 45], [3925782, 46], [3925843, 47]
]
};
const upgrades: ChainUpgradesRaw = [
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48]
];
export default upgrades;
+6 -7
View File
@@ -1,9 +1,8 @@
{
"name": "@polkadot/types",
"version": "3.5.1",
"version": "3.7.3",
"description": "Implementation of the Parity codec",
"main": "index.js",
"module": "index.mjs",
"sideEffects": [
"./detectPackage.js",
"./detectPackage.mjs"
@@ -17,14 +16,14 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/metadata": "3.5.1",
"@polkadot/util": "^5.3.1",
"@polkadot/util-crypto": "^5.3.1",
"@polkadot/x-rxjs": "3.5.1",
"@polkadot/metadata": "3.7.3",
"@polkadot/util": "^5.5.2",
"@polkadot/util-crypto": "^5.5.2",
"@polkadot/x-rxjs": "^5.5.2",
"@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^5.3.1"
"@polkadot/keyring": "^5.5.2"
}
}
+56 -6
View File
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types';
import type { AssetBalance, AssetDetails, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { AssetBalance, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
@@ -31,22 +31,22 @@ import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lotter
import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MultiAsset, MultiLocation, NetworkId, NewBidder, NewBidderOption, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains';
import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, NewBidder, NewBidderOption, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { Approvals } from '@polkadot/types/interfaces/poll';
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { AccountInfo, AccountInfoWithProviders, AccountInfoWithRefCount, ApplyExtrinsicResult, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { AccountInfo, AccountInfoWithProviders, AccountInfoWithRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClass, PerDispatchClassU32, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
@@ -88,6 +88,7 @@ declare module '@polkadot/types/types/registry' {
'Compact<NominatorIndex>': Compact<NominatorIndex>;
'Compact<OffchainAccuracy>': Compact<OffchainAccuracy>;
'Compact<ParaId>': Compact<ParaId>;
'Compact<ParaValidatorIndex>': Compact<ParaValidatorIndex>;
'Compact<Perbill>': Compact<Perbill>;
'Compact<Percent>': Compact<Percent>;
'Compact<Permill>': Compact<Permill>;
@@ -108,6 +109,7 @@ declare module '@polkadot/types/types/registry' {
'Compact<SetId>': Compact<SetId>;
'Compact<SetIndex>': Compact<SetIndex>;
'Compact<SiLookupTypeId>': Compact<SiLookupTypeId>;
'Compact<Slot>': Compact<Slot>;
'Compact<SlotNumber>': Compact<SlotNumber>;
'Compact<SpanIndex>': Compact<SpanIndex>;
'Compact<StrikeCount>': Compact<StrikeCount>;
@@ -168,6 +170,7 @@ declare module '@polkadot/types/types/registry' {
'Option<AssetDetails>': Option<AssetDetails>;
'Option<AssetId>': Option<AssetId>;
'Option<AssetInstance>': Option<AssetInstance>;
'Option<AssetMetadata>': Option<AssetMetadata>;
'Option<AssetOptions>': Option<AssetOptions>;
'Option<AssignmentId>': Option<AssignmentId>;
'Option<AssignmentKind>': Option<AssignmentKind>;
@@ -200,6 +203,7 @@ declare module '@polkadot/types/types/registry' {
'Option<Block>': Option<Block>;
'Option<BlockAttestations>': Option<BlockAttestations>;
'Option<BlockHash>': Option<BlockHash>;
'Option<BlockLength>': Option<BlockLength>;
'Option<BlockNumber>': Option<BlockNumber>;
'Option<BlockWeights>': Option<BlockWeights>;
'Option<bool>': Option<bool>;
@@ -390,6 +394,7 @@ declare module '@polkadot/types/types/registry' {
'Option<ExtrinsicsWeight>': Option<ExtrinsicsWeight>;
'Option<ExtrinsicUnknown>': Option<ExtrinsicUnknown>;
'Option<ExtrinsicV4>': Option<ExtrinsicV4>;
'Option<FeeDetails>': Option<FeeDetails>;
'Option<Fixed128>': Option<Fixed128>;
'Option<Fixed64>': Option<Fixed64>;
'Option<FixedI128>': Option<FixedI128>;
@@ -459,6 +464,7 @@ declare module '@polkadot/types/types/registry' {
'Option<InboundHrmpMessage>': Option<InboundHrmpMessage>;
'Option<InboundHrmpMessages>': Option<InboundHrmpMessages>;
'Option<IncludedBlocks>': Option<IncludedBlocks>;
'Option<InclusionFee>': Option<InclusionFee>;
'Option<IncomingParachain>': Option<IncomingParachain>;
'Option<IncomingParachainDeploy>': Option<IncomingParachainDeploy>;
'Option<IncomingParachainFixed>': Option<IncomingParachainFixed>;
@@ -501,6 +507,8 @@ declare module '@polkadot/types/types/registry' {
'Option<MemberCount>': Option<MemberCount>;
'Option<MembershipProof>': Option<MembershipProof>;
'Option<MessageIngestionType>': Option<MessageIngestionType>;
'Option<MessagingStateSnapshot>': Option<MessagingStateSnapshot>;
'Option<MessagingStateSnapshotEgressEntry>': Option<MessagingStateSnapshotEgressEntry>;
'Option<MetadataAll>': Option<MetadataAll>;
'Option<MetadataLatest>': Option<MetadataLatest>;
'Option<MetadataV10>': Option<MetadataV10>;
@@ -574,6 +582,7 @@ declare module '@polkadot/types/types/registry' {
'Option<ParathreadClaim>': Option<ParathreadClaim>;
'Option<ParathreadClaimQueue>': Option<ParathreadClaimQueue>;
'Option<ParathreadEntry>': Option<ParathreadEntry>;
'Option<ParaValidatorIndex>': Option<ParaValidatorIndex>;
'Option<Pays>': Option<Pays>;
'Option<Peer>': Option<Peer>;
'Option<PeerEndpoint>': Option<PeerEndpoint>;
@@ -585,6 +594,7 @@ declare module '@polkadot/types/types/registry' {
'Option<Perbill>': Option<Perbill>;
'Option<Percent>': Option<Percent>;
'Option<PerDispatchClass>': Option<PerDispatchClass>;
'Option<PerDispatchClassU32>': Option<PerDispatchClassU32>;
'Option<Period>': Option<Period>;
'Option<Permill>': Option<Permill>;
'Option<PermissionLatest>': Option<PermissionLatest>;
@@ -675,6 +685,7 @@ declare module '@polkadot/types/types/registry' {
'Option<Scheduling>': Option<Scheduling>;
'Option<Seal>': Option<Seal>;
'Option<SealV0>': Option<SealV0>;
'Option<SeatHolder>': Option<SeatHolder>;
'Option<SeedOf>': Option<SeedOf>;
'Option<SessionIndex>': Option<SessionIndex>;
'Option<SessionInfo>': Option<SessionInfo>;
@@ -711,6 +722,7 @@ declare module '@polkadot/types/types/registry' {
'Option<SlashingSpans>': Option<SlashingSpans>;
'Option<SlashingSpansTo204>': Option<SlashingSpansTo204>;
'Option<SlashJournalEntry>': Option<SlashJournalEntry>;
'Option<Slot>': Option<Slot>;
'Option<SlotNumber>': Option<SlotNumber>;
'Option<SlotRange>': Option<SlotRange>;
'Option<SocietyJudgement>': Option<SocietyJudgement>;
@@ -752,11 +764,13 @@ declare module '@polkadot/types/types/registry' {
'Option<StorageMetadataV11>': Option<StorageMetadataV11>;
'Option<StorageMetadataV12>': Option<StorageMetadataV12>;
'Option<StorageMetadataV9>': Option<StorageMetadataV9>;
'Option<StorageProof>': Option<StorageProof>;
'Option<StoredPendingChange>': Option<StoredPendingChange>;
'Option<StoredState>': Option<StoredState>;
'Option<StrikeCount>': Option<StrikeCount>;
'Option<SubId>': Option<SubId>;
'Option<SyncState>': Option<SyncState>;
'Option<SystemInherentData>': Option<SystemInherentData>;
'Option<SystemOrigin>': Option<SystemOrigin>;
'Option<Tally>': Option<Tally>;
'Option<TaskAddress>': Option<TaskAddress>;
@@ -806,8 +820,11 @@ declare module '@polkadot/types/types/registry' {
'Option<ValidatorPrefs>': Option<ValidatorPrefs>;
'Option<ValidatorPrefsTo145>': Option<ValidatorPrefsTo145>;
'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>;
'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>;
'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>;
'Option<ValidatorSignature>': Option<ValidatorSignature>;
'Option<ValidityAttestation>': Option<ValidityAttestation>;
'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>;
'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>;
'Option<VersionedMultiLocation>': Option<VersionedMultiLocation>;
'Option<VersionedXcm>': Option<VersionedXcm>;
@@ -815,6 +832,7 @@ declare module '@polkadot/types/types/registry' {
'Option<VestingSchedule>': Option<VestingSchedule>;
'Option<Vote>': Option<Vote>;
'Option<VoteIndex>': Option<VoteIndex>;
'Option<Voter>': Option<Voter>;
'Option<VoterInfo>': Option<VoterInfo>;
'Option<Votes>': Option<Votes>;
'Option<VotesTo230>': Option<VotesTo230>;
@@ -874,6 +892,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<AssetDetails>': Vec<AssetDetails>;
'Vec<AssetId>': Vec<AssetId>;
'Vec<AssetInstance>': Vec<AssetInstance>;
'Vec<AssetMetadata>': Vec<AssetMetadata>;
'Vec<AssetOptions>': Vec<AssetOptions>;
'Vec<AssignmentId>': Vec<AssignmentId>;
'Vec<AssignmentKind>': Vec<AssignmentKind>;
@@ -906,6 +925,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<Block>': Vec<Block>;
'Vec<BlockAttestations>': Vec<BlockAttestations>;
'Vec<BlockHash>': Vec<BlockHash>;
'Vec<BlockLength>': Vec<BlockLength>;
'Vec<BlockNumber>': Vec<BlockNumber>;
'Vec<BlockWeights>': Vec<BlockWeights>;
'Vec<bool>': Vec<bool>;
@@ -1096,6 +1116,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<ExtrinsicsWeight>': Vec<ExtrinsicsWeight>;
'Vec<ExtrinsicUnknown>': Vec<ExtrinsicUnknown>;
'Vec<ExtrinsicV4>': Vec<ExtrinsicV4>;
'Vec<FeeDetails>': Vec<FeeDetails>;
'Vec<Fixed128>': Vec<Fixed128>;
'Vec<Fixed64>': Vec<Fixed64>;
'Vec<FixedI128>': Vec<FixedI128>;
@@ -1165,6 +1186,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<InboundHrmpMessage>': Vec<InboundHrmpMessage>;
'Vec<InboundHrmpMessages>': Vec<InboundHrmpMessages>;
'Vec<IncludedBlocks>': Vec<IncludedBlocks>;
'Vec<InclusionFee>': Vec<InclusionFee>;
'Vec<IncomingParachain>': Vec<IncomingParachain>;
'Vec<IncomingParachainDeploy>': Vec<IncomingParachainDeploy>;
'Vec<IncomingParachainFixed>': Vec<IncomingParachainFixed>;
@@ -1207,6 +1229,8 @@ declare module '@polkadot/types/types/registry' {
'Vec<MemberCount>': Vec<MemberCount>;
'Vec<MembershipProof>': Vec<MembershipProof>;
'Vec<MessageIngestionType>': Vec<MessageIngestionType>;
'Vec<MessagingStateSnapshot>': Vec<MessagingStateSnapshot>;
'Vec<MessagingStateSnapshotEgressEntry>': Vec<MessagingStateSnapshotEgressEntry>;
'Vec<MetadataAll>': Vec<MetadataAll>;
'Vec<MetadataLatest>': Vec<MetadataLatest>;
'Vec<MetadataV10>': Vec<MetadataV10>;
@@ -1280,6 +1304,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<ParathreadClaim>': Vec<ParathreadClaim>;
'Vec<ParathreadClaimQueue>': Vec<ParathreadClaimQueue>;
'Vec<ParathreadEntry>': Vec<ParathreadEntry>;
'Vec<ParaValidatorIndex>': Vec<ParaValidatorIndex>;
'Vec<Pays>': Vec<Pays>;
'Vec<Peer>': Vec<Peer>;
'Vec<PeerEndpoint>': Vec<PeerEndpoint>;
@@ -1291,6 +1316,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<Perbill>': Vec<Perbill>;
'Vec<Percent>': Vec<Percent>;
'Vec<PerDispatchClass>': Vec<PerDispatchClass>;
'Vec<PerDispatchClassU32>': Vec<PerDispatchClassU32>;
'Vec<Period>': Vec<Period>;
'Vec<Permill>': Vec<Permill>;
'Vec<PermissionLatest>': Vec<PermissionLatest>;
@@ -1381,6 +1407,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<Scheduling>': Vec<Scheduling>;
'Vec<Seal>': Vec<Seal>;
'Vec<SealV0>': Vec<SealV0>;
'Vec<SeatHolder>': Vec<SeatHolder>;
'Vec<SeedOf>': Vec<SeedOf>;
'Vec<SessionIndex>': Vec<SessionIndex>;
'Vec<SessionInfo>': Vec<SessionInfo>;
@@ -1417,6 +1444,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<SlashingSpans>': Vec<SlashingSpans>;
'Vec<SlashingSpansTo204>': Vec<SlashingSpansTo204>;
'Vec<SlashJournalEntry>': Vec<SlashJournalEntry>;
'Vec<Slot>': Vec<Slot>;
'Vec<SlotNumber>': Vec<SlotNumber>;
'Vec<SlotRange>': Vec<SlotRange>;
'Vec<SocietyJudgement>': Vec<SocietyJudgement>;
@@ -1458,11 +1486,13 @@ declare module '@polkadot/types/types/registry' {
'Vec<StorageMetadataV11>': Vec<StorageMetadataV11>;
'Vec<StorageMetadataV12>': Vec<StorageMetadataV12>;
'Vec<StorageMetadataV9>': Vec<StorageMetadataV9>;
'Vec<StorageProof>': Vec<StorageProof>;
'Vec<StoredPendingChange>': Vec<StoredPendingChange>;
'Vec<StoredState>': Vec<StoredState>;
'Vec<StrikeCount>': Vec<StrikeCount>;
'Vec<SubId>': Vec<SubId>;
'Vec<SyncState>': Vec<SyncState>;
'Vec<SystemInherentData>': Vec<SystemInherentData>;
'Vec<SystemOrigin>': Vec<SystemOrigin>;
'Vec<Tally>': Vec<Tally>;
'Vec<TaskAddress>': Vec<TaskAddress>;
@@ -1512,8 +1542,11 @@ declare module '@polkadot/types/types/registry' {
'Vec<ValidatorPrefs>': Vec<ValidatorPrefs>;
'Vec<ValidatorPrefsTo145>': Vec<ValidatorPrefsTo145>;
'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>;
'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>;
'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>;
'Vec<ValidatorSignature>': Vec<ValidatorSignature>;
'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>;
'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>;
'Vec<VersionedMultiLocation>': Vec<VersionedMultiLocation>;
'Vec<VersionedXcm>': Vec<VersionedXcm>;
@@ -1521,6 +1554,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<VestingSchedule>': Vec<VestingSchedule>;
'Vec<Vote>': Vec<Vote>;
'Vec<VoteIndex>': Vec<VoteIndex>;
'Vec<Voter>': Vec<Voter>;
'Vec<VoterInfo>': Vec<VoterInfo>;
'Vec<Votes>': Vec<Votes>;
'Vec<VotesTo230>': Vec<VotesTo230>;
@@ -1580,6 +1614,7 @@ declare module '@polkadot/types/types/registry' {
AssetDetails: AssetDetails;
AssetId: AssetId;
AssetInstance: AssetInstance;
AssetMetadata: AssetMetadata;
AssetOptions: AssetOptions;
AssignmentId: AssignmentId;
AssignmentKind: AssignmentKind;
@@ -1612,6 +1647,7 @@ declare module '@polkadot/types/types/registry' {
Block: Block;
BlockAttestations: BlockAttestations;
BlockHash: BlockHash;
BlockLength: BlockLength;
BlockNumber: BlockNumber;
BlockWeights: BlockWeights;
bool: bool;
@@ -1802,6 +1838,7 @@ declare module '@polkadot/types/types/registry' {
ExtrinsicsWeight: ExtrinsicsWeight;
ExtrinsicUnknown: ExtrinsicUnknown;
ExtrinsicV4: ExtrinsicV4;
FeeDetails: FeeDetails;
Fixed128: Fixed128;
Fixed64: Fixed64;
FixedI128: FixedI128;
@@ -1871,6 +1908,7 @@ declare module '@polkadot/types/types/registry' {
InboundHrmpMessage: InboundHrmpMessage;
InboundHrmpMessages: InboundHrmpMessages;
IncludedBlocks: IncludedBlocks;
InclusionFee: InclusionFee;
IncomingParachain: IncomingParachain;
IncomingParachainDeploy: IncomingParachainDeploy;
IncomingParachainFixed: IncomingParachainFixed;
@@ -1913,6 +1951,8 @@ declare module '@polkadot/types/types/registry' {
MemberCount: MemberCount;
MembershipProof: MembershipProof;
MessageIngestionType: MessageIngestionType;
MessagingStateSnapshot: MessagingStateSnapshot;
MessagingStateSnapshotEgressEntry: MessagingStateSnapshotEgressEntry;
MetadataAll: MetadataAll;
MetadataLatest: MetadataLatest;
MetadataV10: MetadataV10;
@@ -1986,6 +2026,7 @@ declare module '@polkadot/types/types/registry' {
ParathreadClaim: ParathreadClaim;
ParathreadClaimQueue: ParathreadClaimQueue;
ParathreadEntry: ParathreadEntry;
ParaValidatorIndex: ParaValidatorIndex;
Pays: Pays;
Peer: Peer;
PeerEndpoint: PeerEndpoint;
@@ -1997,6 +2038,7 @@ declare module '@polkadot/types/types/registry' {
Perbill: Perbill;
Percent: Percent;
PerDispatchClass: PerDispatchClass;
PerDispatchClassU32: PerDispatchClassU32;
Period: Period;
Permill: Permill;
PermissionLatest: PermissionLatest;
@@ -2087,6 +2129,7 @@ declare module '@polkadot/types/types/registry' {
Scheduling: Scheduling;
Seal: Seal;
SealV0: SealV0;
SeatHolder: SeatHolder;
SeedOf: SeedOf;
SessionIndex: SessionIndex;
SessionInfo: SessionInfo;
@@ -2123,6 +2166,7 @@ declare module '@polkadot/types/types/registry' {
SlashingSpans: SlashingSpans;
SlashingSpansTo204: SlashingSpansTo204;
SlashJournalEntry: SlashJournalEntry;
Slot: Slot;
SlotNumber: SlotNumber;
SlotRange: SlotRange;
SocietyJudgement: SocietyJudgement;
@@ -2164,11 +2208,13 @@ declare module '@polkadot/types/types/registry' {
StorageMetadataV11: StorageMetadataV11;
StorageMetadataV12: StorageMetadataV12;
StorageMetadataV9: StorageMetadataV9;
StorageProof: StorageProof;
StoredPendingChange: StoredPendingChange;
StoredState: StoredState;
StrikeCount: StrikeCount;
SubId: SubId;
SyncState: SyncState;
SystemInherentData: SystemInherentData;
SystemOrigin: SystemOrigin;
Tally: Tally;
TaskAddress: TaskAddress;
@@ -2218,8 +2264,11 @@ declare module '@polkadot/types/types/registry' {
ValidatorPrefs: ValidatorPrefs;
ValidatorPrefsTo145: ValidatorPrefsTo145;
ValidatorPrefsTo196: ValidatorPrefsTo196;
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
ValidatorSignature: ValidatorSignature;
ValidityAttestation: ValidityAttestation;
VecInboundHrmpMessage: VecInboundHrmpMessage;
VersionedMultiAsset: VersionedMultiAsset;
VersionedMultiLocation: VersionedMultiLocation;
VersionedXcm: VersionedXcm;
@@ -2227,6 +2276,7 @@ declare module '@polkadot/types/types/registry' {
VestingSchedule: VestingSchedule;
Vote: Vote;
VoteIndex: VoteIndex;
Voter: Voter;
VoterInfo: VoterInfo;
Votes: Votes;
VotesTo230: VotesTo230;
@@ -159,4 +159,11 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
public includes (check: unknown): boolean {
return this.some((value: T) => value.eq(check));
}
/**
* @description Returns a slice of an array
*/
public slice (start?: number, end?: number): T[] {
return this.toArray().slice(start, end);
}
}
+7 -5
View File
@@ -7,7 +7,7 @@ import type { UIntBitLength } from './types';
import BN from 'bn.js';
import { assert, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util';
import { assert, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util';
export const DEFAULT_UINT_BITS = 64;
@@ -18,9 +18,9 @@ const MUL_P = new BN(1_00_00);
const FORMATTERS: [string, BN][] = [
['Perquintill', new BN(1_000_000_000_000)],
['Perbill', new BN(1_000_000_000)],
['Permill', new BN(1_000_000)],
['Percent', new BN(100)]
['Perbill', BN_BILLION],
['Permill', BN_MILLION],
['Percent', BN_HUNDRED]
];
function toPercentage (value: BN, divisor: BN): string {
@@ -179,7 +179,9 @@ export abstract class AbstractInt extends BN implements Codec {
if (rawType === 'Balance') {
return this.isMax()
? 'everything'
: formatBalance(this, { decimals: this.registry.chainDecimals, withSi: true, withUnit: this.registry.chainToken });
// FIXME In the case of multiples we need some way of detecting which instance this belongs
// to. as it stands we will always format (incorrectly) against the first token defined
: formatBalance(this, { decimals: this.registry.chainDecimals[0], withSi: true, withUnit: this.registry.chainTokens[0] });
}
const [, divisor] = FORMATTERS.find(([type]) => type === rawType) || [];
+1 -1
View File
@@ -389,7 +389,7 @@ describe('Enum', (): void => {
expect(test.toHex()).toEqual(
'0x' +
'00' + // index
'ff' + // Address indicating an embedded AccountId
'00' + // MultiAddress indicating an embedded AccountId
'0001020304050607080910111213141516171819202122232425262728293031' // AccountId
);
});
+8 -2
View File
@@ -4,7 +4,7 @@
import type { H256 } from '../interfaces/runtime';
import type { AnyJson, Codec, Registry } from '../types';
import { isUndefined } from '@polkadot/util';
import { isFunction, isUndefined } from '@polkadot/util';
import { compareMap } from './utils';
@@ -79,7 +79,13 @@ export class Json extends Map<string, any> implements Codec {
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
public toHuman (): Record<string, AnyJson> {
return this.toJSON();
return [...this.entries()].reduce((json: Record<string, AnyJson>, [key, value]): Record<string, AnyJson> => {
json[key] = isFunction((value as Codec).toHuman)
? (value as Codec).toHuman()
: value as AnyJson;
return json;
}, {});
}
/**
+10
View File
@@ -6,6 +6,7 @@ import type { Codec, CodecTo } from '../types';
import { Metadata } from '@polkadot/metadata';
import rpcMetadata from '@polkadot/metadata/static';
import { randomAsU8a } from '@polkadot/util-crypto';
import { createTypeUnsafe, TypeRegistry } from '../create';
import { GenericAccountId as AccountId } from '../generic';
@@ -170,5 +171,14 @@ describe('Vec', (): void => {
expect(vec.indexOf(myId)).toEqual(2);
});
it('allows a slice operator', (): void => {
const vec = registry.createType('Vec<AccountId>', [
randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a(), randomAsU8a()
]);
expect(vec).toHaveLength(10);
expect(vec.slice(2, 7)).toHaveLength(5);
});
});
});
+32 -14
View File
@@ -104,10 +104,9 @@ function extractProperties (registry: Registry, metadata: Metadata): ChainProper
return original;
}
return registry.createType('ChainProperties', {
...(original || {}),
ss58Format
});
const { tokenDecimals, tokenSymbol } = original || {};
return registry.createType('ChainProperties', { ss58Format, tokenDecimals, tokenSymbol });
}
export class TypeRegistry implements Registry {
@@ -160,10 +159,16 @@ export class TypeRegistry implements Registry {
return this;
}
public get chainDecimals (): number {
return this.#chainProperties?.tokenDecimals.isSome
? this.#chainProperties.tokenDecimals.unwrap().toNumber()
: 12;
public get chainDecimals (): number[] {
if (this.#chainProperties?.tokenDecimals.isSome) {
const allDecimals = this.#chainProperties.tokenDecimals.unwrap();
if (allDecimals.length) {
return allDecimals.map((b) => b.toNumber());
}
}
return [12];
}
public get chainSS58 (): number | undefined {
@@ -172,10 +177,16 @@ export class TypeRegistry implements Registry {
: undefined;
}
public get chainToken (): string {
return this.#chainProperties?.tokenSymbol.isSome
? this.#chainProperties.tokenSymbol.unwrap().toString()
: formatBalance.getDefaults().unit;
public get chainTokens (): string[] {
if (this.#chainProperties?.tokenSymbol.isSome) {
const allTokens = this.#chainProperties.tokenSymbol.unwrap();
if (allTokens.length) {
return allTokens.map((s) => s.toString());
}
}
return [formatBalance.getDefaults().unit];
}
public get knownTypes (): RegisteredTypes {
@@ -268,8 +279,12 @@ export class TypeRegistry implements Registry {
: undefined;
}
public getDefinition (name: string): string | undefined {
return this.#definitions.get(name);
public getDefinition (typeName: string): string | undefined {
return this.#definitions.get(typeName);
}
public getModuleInstances (specName: string, moduleName: string): string[] | undefined {
return this.#knownTypes?.typesBundle?.spec?.[specName]?.instances?.[moduleName];
}
public getOrThrow <T extends Codec = Codec> (name: string, msg?: string): Constructor<T> {
@@ -316,6 +331,7 @@ export class TypeRegistry implements Registry {
this.#classes.set(arg1.name, arg1);
} else if (isString(arg1)) {
assert(isFunction(arg2), `Expected class definition passed to '${arg1}' registration`);
assert(arg1 !== arg2.toString(), `Unable to register circular ${arg1} === ${arg1}`);
this.#classes.set(arg1, arg2);
} else {
@@ -333,6 +349,8 @@ export class TypeRegistry implements Registry {
? type
: JSON.stringify(type);
assert(name !== def, `Unable to register circular ${name} === ${def}`);
// we already have this type, remove the classes registered for it
if (this.#classes.has(name)) {
this.#classes.delete(name);
@@ -20,7 +20,7 @@ describe('Extrinsic', (): void => {
'0x' +
'5d02' + // length
'84' + // V4, signing bit set
'ff' + // lookup, AccountId of sender follows
'00' + // MultiAddress, AccountId of sender follows
'fcc4910cb536b4333db4bccb40e2cf6427b4766518e754b91e70c97e4a87dbb3' + // sender
'00' + // multisig, type ed25519
'd99ffe3e610ad234e1414bda5831395a6df9098bf80b01561ce89a5065ae89d5' + // sig first 32
@@ -29,7 +29,7 @@ describe('Extrinsic', (): void => {
'1101' + // nonce, compact 68
'0700ac23fc06' + // tip, 0.03 KSM
'0600' + // balances.transfer (on Kusama this was 0400, changed here to match metadata)
'ff' + // lookup, AccountId of recipient follows
'00' + // MultiAddress, AccountId of recipient follows
'495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718' + // recipient
'0bc01eb1fc185f' // value, 104.560 KSM
);
@@ -38,7 +38,7 @@ describe('Extrinsic', (): void => {
expect(extrinsic.nonce.toNumber()).toEqual(68);
expect(extrinsic.tip.toHuman()).toEqual('30.0000 mUnit');
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 0]));
expect(extrinsic.args[0].toHex()).toEqual('0xff495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718');
expect(extrinsic.args[0].toHex()).toEqual('0x00495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718');
expect(extrinsic.args[1].toHuman()).toEqual('104.5609 Unit');
});
});
@@ -19,7 +19,7 @@ describe('SignerPayload', (): void => {
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
nonce: '0x00001234',
signedExtensions: ['CheckNonce', 'CheckWeight'],
specVersion: '0x00000006',
@@ -36,7 +36,7 @@ describe('SignerPayload', (): void => {
blockNumber: '0x231d30',
era: registry.createType('ExtrinsicEra', { current: 2301232, period: 200 }),
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: registry.createType('Call', '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'),
method: registry.createType('Call', '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'),
nonce: 0x1234,
signedExtensions: ['CheckNonce'],
tip: 0x5678,
@@ -48,7 +48,7 @@ describe('SignerPayload', (): void => {
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
nonce: '0x00001234',
signedExtensions: ['CheckNonce'],
specVersion: '0x00000000',
@@ -32,7 +32,7 @@ describe('ExtrinsicSignatureV4', (): void => {
const u8a = new Uint8Array([
// signer as an AccountIndex
0x09,
0x01, 0x08, // 4 << 2
// signature type
0x01,
// signature
@@ -65,7 +65,7 @@ describe('ExtrinsicSignatureV4', (): void => {
).toHex()
).toEqual(
'0x' +
'ff' +
'00' + // MultiAddress
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
'01' +
'4242424242424242424242424242424242424242424242424242424242424242' +
@@ -93,7 +93,7 @@ describe('ExtrinsicSignatureV4', (): void => {
).toEqual(
'0x' +
// Address = AccountId
// 'ff' +
// '00' +
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
// This is a prefix-less signature, anySignture as opposed to Multi above
// '01' +
+6 -2
View File
@@ -19,12 +19,16 @@ describe('Call', (): void => {
args: [],
callIndex: [6, 1] // balances.setBalance
}).toU8a()
).toEqual(new Uint8Array([6, 1, 0, 0, 0]));
).toEqual(
new Uint8Array([6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
);
});
it('handles creation from a hex value properly', (): void => {
expect(
new Call(registry, '0x0601').toU8a()
).toEqual(new Uint8Array([6, 1, 0, 0, 0])); // balances.setBalance
).toEqual(
new Uint8Array([6, 1, 1, 110, 7, 17, 0, 0, 0])
); // balances.setBalance
});
});
@@ -0,0 +1,83 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '../create';
describe('ChainProperties', (): void => {
const registry = new TypeRegistry();
it('decodes from a null value (setting defaults)', (): void => {
expect(
[...registry.createType('ChainProperties', null).keys()]
).toEqual(['ss58Format', 'tokenDecimals', 'tokenSymbol']);
});
it('decodes from an actual JSON', (): void => {
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', JSON.parse('{"ss58Format":2,"tokenDecimals":12,"tokenSymbol":"KSM"}'));
expect(ss58Format.unwrap().eq(2)).toBe(true);
expect(tokenDecimals.unwrap().eq([12])).toBe(true);
expect(tokenSymbol.unwrap().eq(['KSM'])).toBe(true);
});
it('decodes from an actual object (multiple tokens)', (): void => {
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', {
ss58Format: undefined,
tokenDecimals: [10, 12],
tokenSymbol: ['pDOT', 'pKSM']
});
expect(ss58Format.isNone).toBe(true);
expect(tokenDecimals.unwrap().eq([10, 12])).toBe(true);
expect(tokenSymbol.unwrap().eq(['pDOT', 'pKSM'])).toBe(true);
});
it('decodes from an object, flagged for non-existent ss58Format', (): void => {
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', { tokenSymbol: 'DEV' });
expect(ss58Format.isNone).toBe(true);
expect(tokenDecimals.isNone).toBe(true);
expect(tokenSymbol.isSome).toBe(true);
});
it('decodes from a ChainProperties object', (): void => {
const original = registry.createType('ChainProperties', {
ss58Format: 2,
tokenDecimals: 15,
tokenSymbol: 'KSM'
});
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', original);
expect(ss58Format.unwrap().eq(2)).toBe(true);
expect(tokenDecimals.unwrap().eq([15])).toBe(true);
expect(tokenSymbol.unwrap().eq(['KSM'])).toBe(true);
});
it('has a sane toHuman', (): void => {
expect(
registry.createType('ChainProperties', {
ss58Format: 42,
tokenDecimals: registry.createType('u32', 9),
tokenSymbol: ['Unit', 'Aux1']
}).toHuman()
).toEqual({
ss58Format: '42',
tokenDecimals: ['9'],
tokenSymbol: ['Unit', 'Aux1']
});
});
it('has a sane toHuman', (): void => {
expect(
registry.createType('ChainProperties', {
ss58Format: 2,
tokenDecimals: [registry.createType('u32', 12), 8],
tokenSymbol: ['KSM', 'BTC']
}).toHuman()
).toEqual({
ss58Format: '2',
tokenDecimals: ['12', '8'],
tokenSymbol: ['KSM', 'BTC']
});
});
});
@@ -0,0 +1,84 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Codec, Registry } from '../types';
import { isFunction, isNull, isUndefined } from '@polkadot/util';
import { Json } from '../codec/Json';
import { Option } from '../codec/Option';
import { Vec } from '../codec/Vec';
import { Text } from '../primitive/Text';
import { u32 } from '../primitive/U32';
function createValue (registry: Registry, type: string, value: unknown, asArray = true): Option<Codec> {
// We detect codec here as well - when found, generally this is constructed from itself
if (value && isFunction((value as Option<Codec>).unwrapOrDefault)) {
return value as Option<Codec>;
}
return registry.createType(
type as 'Option<u32>',
asArray
? isNull(value) || isUndefined(value)
? null
: Array.isArray(value)
? value
: [value]
: value
);
}
function decodeValue (registry: Registry, key: string, value: unknown): unknown {
return key === 'ss58Format'
? createValue(registry, 'Option<u32>', value, false)
: key === 'tokenDecimals'
? createValue(registry, 'Option<Vec<u32>>' as 'Vec<u32>', value)
: key === 'tokenSymbol'
? createValue(registry, 'Option<Vec<Text>>' as 'Vec<Text>', value)
: value;
}
function decode (registry: Registry, value?: Map<string, unknown> | Record<string, unknown> | null): Record<string, unknown> {
return (
// allow decoding from a map as well (ourselves)
value && isFunction((value as Map<string, unknown>).entries)
? [...(value as Map<string, unknown>).entries()]
: Object.entries(value || {})
).reduce((all: Record<string, unknown>, [key, value]) => {
all[key] = decodeValue(registry, key, value);
return all;
}, {
ss58Format: registry.createType('Option<u32>'),
tokenDecimals: registry.createType('Option<Vec<u32>>' as 'Vec<u32>'),
tokenSymbol: registry.createType('Option<Vec<Text>>' as 'Vec<Text>')
});
}
export class GenericChainProperties extends Json {
constructor (registry: Registry, value?: Map<string, unknown> | Record<string, unknown> | null) {
super(registry, decode(registry, value));
}
/**
* @description The chain ss58Format
*/
public get ss58Format (): Option<u32> {
return this.get('ss58Format') as Option<u32>;
}
/**
* @description The decimals for each of the tokens
*/
public get tokenDecimals (): Option<Vec<u32>> {
return this.get('tokenDecimals') as Option<Vec<u32>>;
}
/**
* @description The symbols for the tokens
*/
public get tokenSymbol (): Option<Vec<Text>> {
return this.get('tokenSymbol') as Option<Vec<Text>>;
}
}
@@ -88,6 +88,10 @@ export class GenericConsensusEngineId extends u32 {
return this.registry.createType('AccountId', bytes);
}
private _getH160Author (bytes: Bytes): AccountId {
return this.registry.createType('AccountId', bytes);
}
/**
* @description From the input bytes, decode into an author
*/
@@ -104,6 +108,11 @@ export class GenericConsensusEngineId extends u32 {
return this._getPowAuthor(bytes);
}
// Moonbeam is neither Aura nor Babe nor Pow and uses h160 addresses
if (bytes.length === 20) {
return this._getH160Author(bytes);
}
return undefined;
}
@@ -9,7 +9,7 @@ describe('LookupSource', (): void => {
const testDecode = (type: string, input: LookupSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void =>
it(`can decode from ${type}`, (): void => {
const a = registry.createType('Address', input);
const a = registry.createType('IndicesLookupSource', input);
expect(a.toString()).toBe(expected);
});
@@ -18,19 +18,19 @@ describe('LookupSource', (): void => {
it('equals on AccountId', (): void => {
const addr = '5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo';
expect(registry.createType('LookupSource', addr).eq(addr)).toBe(true);
expect(registry.createType('IndicesLookupSource', addr).eq(addr)).toBe(true);
});
it('equals on AccountIndex', (): void => {
// see the test below - these are equivalent (with different prefix encoding)
expect(registry.createType('LookupSource', '2jpAFn').eq('25GUyv')).toBe(true);
expect(registry.createType('IndicesLookupSource', '2jpAFn').eq('25GUyv')).toBe(true);
});
});
describe('decoding', (): void => {
testDecode(
'Address',
registry.createType('LookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'),
registry.createType('IndicesLookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'),
'5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'
);
testDecode(
@@ -40,7 +40,7 @@ describe('LookupSource', (): void => {
);
testDecode(
'AccountIndex (mixed prefixes)',
registry.createType('LookupSource', '2jpAFn'),
registry.createType('IndicesLookupSource', '2jpAFn'),
// NOTE Expected adress here is encoded with prefix 42, input above with 68
'25GUyv'
);
@@ -95,7 +95,7 @@ describe('LookupSource', (): void => {
describe('encoding', (): void => {
const testEncode = (to: 'toHex' | 'toString' | 'toU8a', expected: string | Uint8Array): void =>
it(`can encode ${to}`, (): void => {
const a = registry.createType('Address', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF');
const a = registry.createType('IndicesLookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF');
expect(a[to]()).toEqual(expected);
});
+1
View File
@@ -7,6 +7,7 @@ export { GenericAccountId } from './AccountId';
export { GenericAccountIndex } from './AccountIndex';
export { GenericBlock } from './Block';
export { GenericCall } from './Call';
export { GenericChainProperties } from './ChainProperties';
export { GenericConsensusEngineId } from './ConsensusEngineId';
export { GenericEvent, GenericEventData } from './Event';
export { GenericLookupSource } from './LookupSource';
@@ -26,6 +26,12 @@ export default {
zombies: 'u32',
accounts: 'u32'
},
AssetMetadata: {
deposit: 'TAssetDepositBalance',
name: 'Vec<u8>',
symbol: 'Vec<u8>',
decimals: 'u8'
},
TAssetBalance: 'u64',
TAssetDepositBalance: 'BalanceOf'
}
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Struct, bool, u32, u64 } from '@polkadot/types';
import type { Bytes, Struct, bool, u32, u64, u8 } from '@polkadot/types';
import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime';
/** @name AssetBalance */
@@ -25,6 +25,14 @@ export interface AssetDetails extends Struct {
readonly accounts: u32;
}
/** @name AssetMetadata */
export interface AssetMetadata extends Struct {
readonly deposit: TAssetDepositBalance;
readonly name: Bytes;
readonly symbol: Bytes;
readonly decimals: u8;
}
/** @name TAssetBalance */
export interface TAssetBalance extends u64 {}
@@ -0,0 +1,20 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '../../create';
const KILT = '0x8d01d51627af4cb8414b6ad454e7204424e7e8489738c5fabe20cee3256bd69b7534d12b2798b04e574d05fb8a4b163745b1e610fb75de59399271bd57e49738506a7a93ee0038dd6a1b3bfbb58f747a7b2052058620839a8e2d03f5a43b48ca6000c66a00299600004412f5d19eed1a0cbafadd3b050b6e87fbcdff0a4b2ab0dce498d2180f7d7fe40000000000000000000000000000000000000000000000000000000000000000000000200318f49e207f03cfdce586301014700e2c25930041585f078d434d6125b40443fe11fd292d13a410000008004c5f0ec2d17a76153ff51817f12d9cfc3c7f0400c106807ff6802ca40549562ffe6b52b99b82732a11693a9f94e719eb6091a28361553b7e1d6f8071c05107fa3ba69c860039b5eaf97de7405f1b96f158678ce0581618e4cb00ed8020617372d0786928a794bc2168d93a97c9934583395972b4d4ab49c99242035380947dbbbf1d13550ebd1c60bdad2e6e4905e72acf2135a3ecf9539b14ac336a1e8048b33fdf9c46b272d66e2467dba4fa4709dd3e560183d5ef462c8bdf09aa14e58083a5a2c804e9dbc8839a7d520a726c0518a82ff872d1ec2932c1142866c945648090bbb5b7644e54d533f3630580cb8074409ddcc510eab64ecc32216c912ac87a8071959a3ccb6903f9fb571c5eb87649e1a4d7fc095b7a9d88fd6941dadf0d251280ba7052563c97b91cccc3a3762e0a8d73a0fd2018bd63932fdf6e6dfb8e998705807970bd80ad702930fe83ab570956c242563c1ea2560e5bed94456168ded1ec2e801c3452fb59635b2a0def7e3a91cd071d57beb4d92294484ee948728d72a8a2ed80974da04ec2f2a432413995b1c30d9903e6c69b63d25ea3564c3fd604513c045480365249e4644cac1c396b92b70c2d8daa355a87236ca6ff3fdcf0e0039351fa911501802100803d7774397092a7bd12ebb498311ea37c46eeeec8460cbf88e03f55bfa109817f80f2ce141c02c934f343545350b70e54c8c2a0bb12f886462797399672b145ff0cad019e0da05ca59913bc38a8630590f2627c014180412934e1ef5da416397acfe5b81b2c604c81fd696fabcb082451b88dd46feafc585f078d434d6125b40443fe11fd292d13a410000008008077b468c9a59a67ed7ae15442240aba9ae23e7b632fe6e5bdb97b2b40b4aa10a135037f0006de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385a50200005000008000000800000000200000000400000500000005000000580200002c010000000020030004000000286bee0000000004000000040000000500000000000000000000000000000000000000000000000000000000000000000000000800000000200000040000000400000000040000b004000000000000000000001400000004000000040000000000000000000000000a000000000000000000000000000000000000009901801804800fcf38b60d2719964e4c4cc392848e51c8ce99e85efc57368586ed54938b6bf180aebb1dfa081e0f528a33c48cc0d64717ff2e6de6f73e001bc0c608d24f5b79b7809ee0a05d790e73768b384a037678e8cdc4fcfcb90ca782824c5119294de00fdb0000';
describe('SystemInherentData', (): void => {
const registry = new TypeRegistry();
registry.register({ BlockNumber: 'u64' });
it('can decode Kilt', (): void => {
const value = registry.createType('SystemInherentData', KILT);
console.log(JSON.stringify(value.toHuman(), null, 2));
expect(value).toBeTruthy();
});
});
@@ -13,7 +13,6 @@ import slotTypes from './slots';
const proposeTypes = {
ParachainProposal: {
proposer: 'AccountId',
validationCode: 'ValidationCode',
genesisHead: 'HeadData',
validators: 'Vec<ValidatorId>',
name: 'Bytes',
@@ -103,7 +102,8 @@ export default {
persistedValidationDataHash: 'Hash',
povHash: 'Hash',
erasureRoot: 'Hash',
signature: 'CollatorSignature'
signature: 'CollatorSignature',
paraHead: 'Hash'
},
CandidateHash: 'Hash',
CandidatePendingAvailability: {
@@ -241,15 +241,16 @@ export default {
claim: 'ParathreadClaim',
retries: 'u32'
},
ParaValidatorIndex: 'u32',
PersistedValidationData: {
parentHead: 'HeadData',
blockNumber: 'BlockNumber',
blockNumber: 'RelayChainBlockNumber',
relayStorageRoot: 'Hash',
hrmpMqcHeads: 'Vec<(u32, Hash)>',
dmqMqcHead: 'Hash',
maxPovSize: 'u32'
},
RelayChainBlockNumber: 'BlockNumber',
RelayChainBlockNumber: 'u32',
QueuedParathread: {
claim: 'ParathreadEntry',
coreOffset: 'u32'
@@ -276,10 +277,10 @@ export default {
noShowSlots: 'u32',
neededApprovals: 'u32'
},
SessionInfoValidatorGroup: 'Vec<u32>', // ValidatorIndex (u16 in staking)
SessionInfoValidatorGroup: 'Vec<ParaValidatorIndex>',
SignedAvailabilityBitfield: {
payload: 'BitVec',
validatorIndex: 'u32', // ValidatorIndex for inclusion
validatorIndex: 'ParaValidatorIndex',
signature: 'ValidatorSignature'
},
SignedAvailabilityBitfields: 'Vec<SignedAvailabilityBitfield>',
@@ -518,6 +519,18 @@ export default {
InitiateTeleport: 'InitiateTeleport',
QueryHolding: 'QueryHolding'
}
}
},
MessagingStateSnapshot: {
relayDispatchQueueSize: '(u32, u32)',
egressChannels: 'Vec<MessagingStateSnapshotEgressEntry>'
},
MessagingStateSnapshotEgressEntry: '(ParaId, AbridgedHrmpChannel)',
SystemInherentData: {
validationData: 'PersistedValidationData',
relayChainState: 'StorageProof',
downwardMessages: 'Vec<InboundDownwardMessage>',
horizontalMessages: 'BTreeMap<ParaId, VecInboundHrmpMessage>'
},
VecInboundHrmpMessage: 'Vec<InboundHrmpMessage>'
}
} as Definitions;
@@ -4,7 +4,7 @@
import type { BTreeMap, BitVec, Bytes, Compact, Enum, Option, Struct, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { ITuple } from '@polkadot/types/types';
import type { Signature } from '@polkadot/types/interfaces/extrinsics';
import type { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime';
import type { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, StorageProof, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime';
import type { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session';
/** @name AbridgedCandidateReceipt */
@@ -176,6 +176,7 @@ export interface CandidateDescriptor extends Struct {
readonly povHash: Hash;
readonly erasureRoot: Hash;
readonly signature: CollatorSignature;
readonly paraHead: Hash;
}
/** @name CandidateHash */
@@ -443,6 +444,15 @@ export interface MessageIngestionType extends Struct {
readonly horizontalMessages: BTreeMap<ParaId, InboundHrmpMessages>;
}
/** @name MessagingStateSnapshot */
export interface MessagingStateSnapshot extends Struct {
readonly relayDispatchQueueSize: ITuple<[u32, u32]>;
readonly egressChannels: Vec<MessagingStateSnapshotEgressEntry>;
}
/** @name MessagingStateSnapshotEgressEntry */
export interface MessagingStateSnapshotEgressEntry extends ITuple<[ParaId, AbridgedHrmpChannel]> {}
/** @name MultiAsset */
export interface MultiAsset extends Enum {
readonly isNone: boolean;
@@ -538,7 +548,6 @@ export interface ParachainDispatchOrigin extends Enum {
/** @name ParachainProposal */
export interface ParachainProposal extends Struct {
readonly proposer: AccountId;
readonly validationCode: ValidationCode;
readonly genesisHead: HeadData;
readonly validators: Vec<ValidatorId>;
readonly name: Bytes;
@@ -587,10 +596,13 @@ export interface ParathreadEntry extends Struct {
readonly retries: u32;
}
/** @name ParaValidatorIndex */
export interface ParaValidatorIndex extends u32 {}
/** @name PersistedValidationData */
export interface PersistedValidationData extends Struct {
readonly parentHead: HeadData;
readonly blockNumber: BlockNumber;
readonly blockNumber: RelayChainBlockNumber;
readonly relayStorageRoot: Hash;
readonly hrmpMqcHeads: Vec<ITuple<[u32, Hash]>>;
readonly dmqMqcHead: Hash;
@@ -617,7 +629,7 @@ export interface RegisteredParachainInfo extends Struct {
}
/** @name RelayChainBlockNumber */
export interface RelayChainBlockNumber extends BlockNumber {}
export interface RelayChainBlockNumber extends u32 {}
/** @name RelayedFrom */
export interface RelayedFrom extends Struct {
@@ -668,12 +680,12 @@ export interface SessionInfo extends Struct {
}
/** @name SessionInfoValidatorGroup */
export interface SessionInfoValidatorGroup extends Vec<u32> {}
export interface SessionInfoValidatorGroup extends Vec<ParaValidatorIndex> {}
/** @name SignedAvailabilityBitfield */
export interface SignedAvailabilityBitfield extends Struct {
readonly payload: BitVec;
readonly validatorIndex: u32;
readonly validatorIndex: ParaValidatorIndex;
readonly signature: ValidatorSignature;
}
@@ -714,6 +726,14 @@ export interface Statement extends Enum {
/** @name SubId */
export interface SubId extends u32 {}
/** @name SystemInherentData */
export interface SystemInherentData extends Struct {
readonly validationData: PersistedValidationData;
readonly relayChainState: StorageProof;
readonly downwardMessages: Vec<InboundDownwardMessage>;
readonly horizontalMessages: BTreeMap<ParaId, VecInboundHrmpMessage>;
}
/** @name TeleportAsset */
export interface TeleportAsset extends Struct {
readonly assets: Vec<MultiAsset>;
@@ -772,6 +792,9 @@ export interface ValidityAttestation extends Enum {
readonly asExplicit: ValidatorSignature;
}
/** @name VecInboundHrmpMessage */
export interface VecInboundHrmpMessage extends Vec<InboundHrmpMessage> {}
/** @name VersionedMultiAsset */
export interface VersionedMultiAsset extends Enum {
readonly isV0: boolean;
@@ -6,26 +6,43 @@
import type { Definitions } from '../../types';
const QUERY_PARAMS = [
{
name: 'extrinsic',
type: 'Bytes'
},
{
name: 'at',
type: 'BlockHash',
isHistoric: true,
isOptional: true
}
];
export default {
rpc: {
queryInfo: {
description: 'Retrieves the fee information for an encoded extrinsic',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
name: 'at',
type: 'BlockHash',
isHistoric: true,
isOptional: true
}
],
params: QUERY_PARAMS,
type: 'RuntimeDispatchInfo'
},
queryFeeDetails: {
description: 'Query the detailed fee of a given encoded extrinsic',
params: QUERY_PARAMS,
type: 'FeeDetails'
}
},
types: {
FeeDetails: {
inclusionFee: 'Option<InclusionFee>'
// skipped in serde
// tip: 'Balance'
},
InclusionFee: {
baseFee: 'Balance',
lenFee: 'Balance',
adjustedWeightFee: 'Balance'
},
RuntimeDispatchInfo: {
weight: 'Weight',
class: 'DispatchClass',
+13 -1
View File
@@ -1,10 +1,22 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Struct } from '@polkadot/types';
import type { Option, Struct } from '@polkadot/types';
import type { Balance, Weight } from '@polkadot/types/interfaces/runtime';
import type { DispatchClass } from '@polkadot/types/interfaces/system';
/** @name FeeDetails */
export interface FeeDetails extends Struct {
readonly inclusionFee: Option<InclusionFee>;
}
/** @name InclusionFee */
export interface InclusionFee extends Struct {
readonly baseFee: Balance;
readonly lenFee: Balance;
readonly adjustedWeightFee: Balance;
}
/** @name RuntimeDispatchInfo */
export interface RuntimeDispatchInfo extends Struct {
readonly weight: Weight;
@@ -29,7 +29,7 @@ export default {
AccountId: 'GenericAccountId',
AccountIdOf: 'AccountId',
AccountIndex: 'GenericAccountIndex',
Address: 'LookupSource',
Address: 'MultiAddress',
AssetId: 'u32',
Balance: 'UInt<128, Balance>',
BalanceOf: 'Balance',
@@ -82,7 +82,7 @@ export default {
KeyValue: '(StorageKey, StorageData)',
KeyTypeId: 'u32',
LockIdentifier: '[u8; 8]',
LookupSource: 'IndicesLookupSource',
LookupSource: 'MultiAddress',
LookupTarget: 'AccountId',
ModuleId: 'LockIdentifier',
MultiAddress: 'GenericMultiAddress',
@@ -117,7 +117,11 @@ export default {
block: 'Block',
justification: 'Justification'
},
Slot: 'u64',
StorageData: 'Bytes',
StorageProof: {
trieNodes: 'Vec<Bytes>'
},
TransactionPriority: 'u64',
ValidatorId: 'AccountId',
ValidatorIdOf: 'ValidatorId',
+10 -2
View File
@@ -17,7 +17,7 @@ export interface AccountIdOf extends AccountId {}
export interface AccountIndex extends GenericAccountIndex {}
/** @name Address */
export interface Address extends LookupSource {}
export interface Address extends MultiAddress {}
/** @name AssetId */
export interface AssetId extends u32 {}
@@ -157,7 +157,7 @@ export interface KeyValue extends ITuple<[StorageKey, StorageData]> {}
export interface LockIdentifier extends U8aFixed {}
/** @name LookupSource */
export interface LookupSource extends IndicesLookupSource {}
export interface LookupSource extends MultiAddress {}
/** @name LookupTarget */
export interface LookupTarget extends AccountId {}
@@ -255,9 +255,17 @@ export interface SignedBlock extends Struct {
readonly justification: Justification;
}
/** @name Slot */
export interface Slot extends u64 {}
/** @name StorageData */
export interface StorageData extends Bytes {}
/** @name StorageProof */
export interface StorageProof extends Struct {
readonly trieNodes: Vec<Bytes>;
}
/** @name TransactionPriority */
export interface TransactionPriority extends u64 {}
@@ -14,72 +14,86 @@ const deprecated = {
}
};
const phragmen = {
CompactAssignments: {
votes1: 'Vec<(NominatorIndexCompact, ValidatorIndexCompact)>',
votes2: 'Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>',
votes3: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>',
votes4: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>',
votes5: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>',
votes6: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>',
votes7: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>',
votes8: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>',
votes9: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>',
votes10: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>',
votes11: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>',
votes12: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>',
votes13: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>',
votes14: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>',
votes15: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>',
votes16: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>'
},
CompactAssignmentsTo257: {
votes1: 'Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>',
votes2: 'Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>',
votes3: 'Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>',
votes4: 'Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>',
votes5: 'Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>',
votes6: 'Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>',
votes7: 'Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>',
votes8: 'Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>',
votes9: 'Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>',
votes10: 'Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>',
votes11: 'Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>',
votes12: 'Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>',
votes13: 'Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>',
votes14: 'Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>',
votes15: 'Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>',
votes16: 'Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>'
},
CompactScore: '(ValidatorIndex, OffchainAccuracy)',
CompactScoreCompact: '(ValidatorIndexCompact, OffchainAccuracyCompact)',
ElectionCompute: {
_enum: ['OnChain', 'Signed', 'Authority']
},
ElectionResult: {
compute: 'ElectionCompute',
slotStake: 'Balance',
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, Exposure)>'
},
ElectionScore: '[u128; 3]',
ElectionSize: {
validators: 'Compact<ValidatorIndex>',
nominators: 'Compact<NominatorIndex>'
},
ElectionStatus: {
_enum: {
Close: 'Null',
Open: 'BlockNumber'
}
},
SeatHolder: {
who: 'AccountId',
stake: 'Balance',
deposit: 'Balance'
},
Voter: {
votes: 'Vec<AccountId>',
stake: 'Balance',
deposit: 'Balance'
}
};
export default {
rpc: {},
types: {
...deprecated,
...phragmen,
ActiveEraInfo: {
index: 'EraIndex',
start: 'Option<Moment>'
},
CompactAssignments: {
votes1: 'Vec<(NominatorIndexCompact, ValidatorIndexCompact)>',
votes2: 'Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>',
votes3: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>',
votes4: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>',
votes5: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>',
votes6: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>',
votes7: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>',
votes8: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>',
votes9: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>',
votes10: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>',
votes11: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>',
votes12: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>',
votes13: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>',
votes14: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>',
votes15: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>',
votes16: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>'
},
CompactAssignmentsTo257: {
votes1: 'Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>',
votes2: 'Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>',
votes3: 'Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>',
votes4: 'Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>',
votes5: 'Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>',
votes6: 'Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>',
votes7: 'Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>',
votes8: 'Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>',
votes9: 'Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>',
votes10: 'Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>',
votes11: 'Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>',
votes12: 'Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>',
votes13: 'Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>',
votes14: 'Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>',
votes15: 'Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>',
votes16: 'Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>'
},
CompactScore: '(ValidatorIndex, OffchainAccuracy)',
CompactScoreCompact: '(ValidatorIndexCompact, OffchainAccuracyCompact)',
ElectionCompute: {
_enum: ['OnChain', 'Signed', 'Authority']
},
ElectionResult: {
compute: 'ElectionCompute',
slotStake: 'Balance',
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, Exposure)>'
},
ElectionScore: '[u128; 3]',
ElectionSize: {
validators: 'Compact<ValidatorIndex>',
nominators: 'Compact<NominatorIndex>'
},
ElectionStatus: {
_enum: {
Close: 'Null',
Open: 'BlockNumber'
}
},
EraIndex: 'u32',
EraRewardPoints: {
total: 'RewardPoint',
@@ -190,9 +204,14 @@ export default {
},
ValidatorIndex: 'u16',
ValidatorIndexCompact: 'Compact<ValidatorIndex>',
ValidatorPrefs: {
ValidatorPrefs: 'ValidatorPrefsWithCommission',
ValidatorPrefsWithCommission: {
commission: 'Compact<Perbill>'
},
ValidatorPrefsWithBlocked: {
commission: 'Compact<Perbill>',
blocked: 'bool'
},
ValidatorPrefsTo196: {
validatorPayment: 'Compact<Balance>'
},
+26 -3
View File
@@ -180,6 +180,13 @@ export interface RewardDestinationTo257 extends Enum {
/** @name RewardPoint */
export interface RewardPoint extends u32 {}
/** @name SeatHolder */
export interface SeatHolder extends Struct {
readonly who: AccountId;
readonly stake: Balance;
readonly deposit: Balance;
}
/** @name SlashingSpans */
export interface SlashingSpans extends Struct {
readonly spanIndex: SpanIndex;
@@ -262,9 +269,7 @@ export interface ValidatorIndex extends u16 {}
export interface ValidatorIndexCompact extends Compact<ValidatorIndex> {}
/** @name ValidatorPrefs */
export interface ValidatorPrefs extends Struct {
readonly commission: Compact<Perbill>;
}
export interface ValidatorPrefs extends ValidatorPrefsWithCommission {}
/** @name ValidatorPrefsTo145 */
export interface ValidatorPrefsTo145 extends Struct {
@@ -277,4 +282,22 @@ export interface ValidatorPrefsTo196 extends Struct {
readonly validatorPayment: Compact<Balance>;
}
/** @name ValidatorPrefsWithBlocked */
export interface ValidatorPrefsWithBlocked extends Struct {
readonly commission: Compact<Perbill>;
readonly blocked: bool;
}
/** @name ValidatorPrefsWithCommission */
export interface ValidatorPrefsWithCommission extends Struct {
readonly commission: Compact<Perbill>;
}
/** @name Voter */
export interface Voter extends Struct {
readonly votes: Vec<AccountId>;
readonly stake: Balance;
readonly deposit: Balance;
}
export type PHANTOM_STAKING = 'staking';
@@ -1,34 +0,0 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '../../create';
describe('ChainProperties', (): void => {
const registry = new TypeRegistry();
it('decodes from a null value', (): void => {
expect(
[...registry.createType('ChainProperties', null).entries()]
).toEqual([]);
});
it('decodes from an actual object', (): void => {
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', {
ss58Format: 2,
tokenDecimals: 15,
tokenSymbol: 'KSM'
});
expect(ss58Format.unwrap().eq(2)).toBe(true);
expect(tokenDecimals.unwrap().eq(15)).toBe(true);
expect(tokenSymbol.unwrap().eq('KSM')).toBe(true);
});
it('decodes from an object, flagged for non-existent ss58Format', (): void => {
const { ss58Format, tokenDecimals, tokenSymbol } = registry.createType('ChainProperties', { tokenSymbol: 'DEV' });
expect(ss58Format.isNone).toBe(true);
expect(tokenDecimals.isNone).toBe(true);
expect(tokenSymbol.isSome).toBe(true);
});
});
@@ -146,16 +146,15 @@ export default {
data: 'AccountData'
},
ApplyExtrinsicResult: 'Result<DispatchOutcome, TransactionValidityError>',
BlockLength: {
max: 'PerDispatchClassU32'
},
BlockWeights: {
baseBlock: 'Weight',
maxBlock: 'Weight',
perClass: 'PerDispatchClass'
},
ChainProperties: {
ss58Format: 'Option<u8>',
tokenDecimals: 'Option<u32>',
tokenSymbol: 'Option<Text>'
},
ChainProperties: 'GenericChainProperties',
ChainType: {
_enum: {
Development: 'Null',
@@ -301,6 +300,11 @@ export default {
operational: 'WeightPerClass',
mandatory: 'WeightPerClass'
},
PerDispatchClassU32: {
normal: 'u32',
operational: 'u32',
mandatory: 'u32'
},
Phase: {
_enum: {
ApplyExtrinsic: 'u32',
+14 -6
View File
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Bytes, Compact, Enum, GenericEvent, HashMap, Option, Result, Struct, Text, U8aFixed, Vec, bool, i32, u32, u64, u8 } from '@polkadot/types';
import type { Bytes, Compact, Enum, GenericChainProperties, GenericEvent, HashMap, Option, Result, Struct, Text, U8aFixed, Vec, bool, i32, u32, u64, u8 } from '@polkadot/types';
import type { ITuple } from '@polkadot/types/types';
import type { AccountData } from '@polkadot/types/interfaces/balances';
import type { AccountId, BlockNumber, Digest, Hash, Index, Pays, Weight } from '@polkadot/types/interfaces/runtime';
@@ -32,6 +32,11 @@ export interface ApplyExtrinsicResult extends Result<DispatchOutcome, Transactio
readonly asOk: DispatchOutcome;
}
/** @name BlockLength */
export interface BlockLength extends Struct {
readonly max: PerDispatchClassU32;
}
/** @name BlockWeights */
export interface BlockWeights extends Struct {
readonly baseBlock: Weight;
@@ -40,11 +45,7 @@ export interface BlockWeights extends Struct {
}
/** @name ChainProperties */
export interface ChainProperties extends Struct {
readonly ss58Format: Option<u8>;
readonly tokenDecimals: Option<u32>;
readonly tokenSymbol: Option<Text>;
}
export interface ChainProperties extends GenericChainProperties {}
/** @name ChainType */
export interface ChainType extends Enum {
@@ -266,6 +267,13 @@ export interface PerDispatchClass extends Struct {
readonly mandatory: WeightPerClass;
}
/** @name PerDispatchClassU32 */
export interface PerDispatchClassU32 extends Struct {
readonly normal: u32;
readonly operational: u32;
readonly mandatory: u32;
}
/** @name Phase */
export interface Phase extends Enum {
readonly isApplyExtrinsic: boolean;
+1
View File
@@ -13,4 +13,5 @@ export * from './extrinsic';
export * from './interfaces';
export * from './registry';
// used inside augmented definitions
export type { Observable } from '@polkadot/x-rxjs';
+5 -3
View File
@@ -47,6 +47,7 @@ export type DeriveCustom = Record<string, Record<string, (instanceId: string, ap
export interface OverrideBundleDefinition {
alias?: Record<string, OverrideModuleType>;
derives?: DeriveCustom;
instances?: Record<string, string[]>;
rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
types?: OverrideVersionedType[];
}
@@ -81,9 +82,9 @@ export interface RegisteredTypes {
}
export interface Registry {
readonly chainDecimals: number;
readonly chainDecimals: number[];
readonly chainSS58: number | undefined;
readonly chainToken: string;
readonly chainTokens: string[];
readonly knownTypes: RegisteredTypes;
readonly signedExtensions: string[];
@@ -98,7 +99,8 @@ export interface Registry {
get <T extends Codec = Codec> (name: string, withUnknown?: boolean): Constructor<T> | undefined;
getChainProperties (): ChainProperties | undefined;
getClassName (clazz: Constructor): string | undefined;
getDefinition (name: string): string | undefined;
getDefinition (typeName: string): string | undefined;
getModuleInstances (specName: string, moduleName: string): string[] | undefined;
getOrThrow <T extends Codec = Codec> (name: string, msg?: string): Constructor<T>;
getOrUnknown <T extends Codec = Codec> (name: string): Constructor<T>;
setKnownTypes (types: RegisteredTypes): void;
-201
View File
@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-5
View File
@@ -1,5 +0,0 @@
# @polkadot/x-rxjs
This is a small wrapper around rjx to make it friendly to both Node.js (from .mjs as well as .cjs) as well as bundlers using both esm and cjs modules.
This need wil disappear, once rxjs supports export maps.
-18
View File
@@ -1,18 +0,0 @@
{
"name": "@polkadot/x-rxjs",
"version": "3.5.1",
"description": "A pass-through interface for RxJs (allowing node + mjs usage)",
"main": "index.js",
"sideEffects": false,
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
"contributors": [],
"license": "Apache-2.0",
"repository": "github:polkadot-js/api",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/x-rxjs#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"rxjs": "^6.6.3"
}
}
-4
View File
@@ -1,4 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from 'rxjs';
-74
View File
@@ -1,74 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
// This is not great, but while having esm files, rxjs doesn't quite play nicely with
// Node.js mjs files. (Hopefully this improves in 7.0, although no exports map as of yet)
//
// Generated via s/export \{ (.*) \} from .*/exports.$1 = rxjs.$1;/ on rxjs/_esm
// This is or our builder
// @polkadot/dev: exports-node
const rxjs = require('rxjs');
exports.Observable = rxjs.Observable;
exports.ConnectableObservable = rxjs.ConnectableObservable;
exports.GroupedObservable = rxjs.GroupedObservable;
exports.observable = rxjs.observable;
exports.Subject = rxjs.Subject;
exports.BehaviorSubject = rxjs.BehaviorSubject;
exports.ReplaySubject = rxjs.ReplaySubject;
exports.AsyncSubject = rxjs.AsyncSubject;
exports.asap = rxjs.asap;
exports.asapScheduler = rxjs.asapScheduler;
exports.async = rxjs.async;
exports.asyncScheduler = rxjs.asyncScheduler;
exports.queue = rxjs.queue;
exports.queueScheduler = rxjs.queueScheduler;
exports.animationFrame = rxjs.animationFrame;
exports.animationFrameScheduler = rxjs.animationFrameScheduler;
exports.VirtualTimeScheduler = rxjs.VirtualTimeScheduler;
exports.VirtualAction = rxjs.VirtualAction;
exports.Scheduler = rxjs.Scheduler;
exports.Subscription = rxjs.Subscription;
exports.Subscriber = rxjs.Subscriber;
exports.Notification = rxjs.Notification;
exports.NotificationKind = rxjs.NotificationKind;
exports.pipe = rxjs.pipe;
exports.noop = rxjs.noop;
exports.identity = rxjs.identity;
exports.isObservable = rxjs.isObservable;
exports.ArgumentOutOfRangeError = rxjs.ArgumentOutOfRangeError;
exports.EmptyError = rxjs.EmptyError;
exports.ObjectUnsubscribedError = rxjs.ObjectUnsubscribedError;
exports.UnsubscriptionError = rxjs.UnsubscriptionError;
exports.TimeoutError = rxjs.TimeoutError;
exports.bindCallback = rxjs.bindCallback;
exports.bindNodeCallback = rxjs.bindNodeCallback;
exports.combineLatest = rxjs.combineLatest;
exports.concat = rxjs.concat;
exports.defer = rxjs.defer;
exports.empty = rxjs.empty;
exports.forkJoin = rxjs.forkJoin;
exports.from = rxjs.from;
exports.fromEvent = rxjs.fromEvent;
exports.fromEventPattern = rxjs.fromEventPattern;
exports.generate = rxjs.generate;
exports.iif = rxjs.iif;
exports.interval = rxjs.interval;
exports.merge = rxjs.merge;
exports.never = rxjs.never;
exports.of = rxjs.of;
exports.onErrorResumeNext = rxjs.onErrorResumeNext;
exports.pairs = rxjs.pairs;
exports.partition = rxjs.partition;
exports.race = rxjs.race;
exports.range = rxjs.range;
exports.throwError = rxjs.throwError;
exports.timer = rxjs.timer;
exports.using = rxjs.using;
exports.zip = rxjs.zip;
exports.scheduled = rxjs.scheduled;
exports.EMPTY = rxjs.EMPTY;
exports.NEVER = rxjs.NEVER;
exports.config = rxjs.config;
-4
View File
@@ -1,4 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { animationFrame, animationFrameScheduler, ArgumentOutOfRangeError, asap, asapScheduler, async, asyncScheduler, AsyncSubject, BehaviorSubject, bindCallback, bindNodeCallback, combineLatest, concat, config, ConnectableObservable, defer, EMPTY, empty, EmptyError, forkJoin, from, fromEvent, fromEventPattern, generate, GroupedObservable, identity, iif, interval, isObservable, merge, NEVER, never, noop, Notification, NotificationKind, ObjectUnsubscribedError, Observable, observable, of, onErrorResumeNext, pairs, partition, pipe, queue, queueScheduler, race, range, ReplaySubject, scheduled, Scheduler, Subject, Subscriber, Subscription, throwError, TimeoutError, timer, UnsubscriptionError, using, VirtualAction, VirtualTimeScheduler, zip } from 'rxjs/_esm5/index.js';
-4
View File
@@ -1,4 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from 'rxjs/operators';
-117
View File
@@ -1,117 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
// This is not great, but while having esm files, rxjs doesn't quite play nicely with
// Node.js mjs files. (Hopefully this improves in 7.0, although no exports map as of yet)
//
// Generated via s/export \{ (.*) \} from .*/exports.$1 = rxjs.$1;/ on rxjs/_esm
// This is or our builder, to add the correct exports entry
// @polkadot/dev: exports-node
const operators = require('rxjs/operators');
exports.audit = operators.audit;
exports.auditTime = operators.auditTime;
exports.buffer = operators.buffer;
exports.bufferCount = operators.bufferCount;
exports.bufferTime = operators.bufferTime;
exports.bufferToggle = operators.bufferToggle;
exports.bufferWhen = operators.bufferWhen;
exports.catchError = operators.catchError;
exports.combineAll = operators.combineAll;
exports.combineLatest = operators.combineLatest;
exports.concat = operators.concat;
exports.concatAll = operators.concatAll;
exports.concatMap = operators.concatMap;
exports.concatMapTo = operators.concatMapTo;
exports.count = operators.count;
exports.debounce = operators.debounce;
exports.debounceTime = operators.debounceTime;
exports.defaultIfEmpty = operators.defaultIfEmpty;
exports.delay = operators.delay;
exports.delayWhen = operators.delayWhen;
exports.dematerialize = operators.dematerialize;
exports.distinct = operators.distinct;
exports.distinctUntilChanged = operators.distinctUntilChanged;
exports.distinctUntilKeyChanged = operators.distinctUntilKeyChanged;
exports.elementAt = operators.elementAt;
exports.endWith = operators.endWith;
exports.every = operators.every;
exports.exhaust = operators.exhaust;
exports.exhaustMap = operators.exhaustMap;
exports.expand = operators.expand;
exports.filter = operators.filter;
exports.finalize = operators.finalize;
exports.find = operators.find;
exports.findIndex = operators.findIndex;
exports.first = operators.first;
exports.groupBy = operators.groupBy;
exports.ignoreElements = operators.ignoreElements;
exports.isEmpty = operators.isEmpty;
exports.last = operators.last;
exports.map = operators.map;
exports.mapTo = operators.mapTo;
exports.materialize = operators.materialize;
exports.max = operators.max;
exports.merge = operators.merge;
exports.mergeAll = operators.mergeAll;
exports.mergeMap = operators.mergeMap;
exports.flatMap = operators.flatMap;
exports.mergeMapTo = operators.mergeMapTo;
exports.mergeScan = operators.mergeScan;
exports.min = operators.min;
exports.multicast = operators.multicast;
exports.observeOn = operators.observeOn;
exports.onErrorResumeNext = operators.onErrorResumeNext;
exports.pairwise = operators.pairwise;
exports.partition = operators.partition;
exports.pluck = operators.pluck;
exports.publish = operators.publish;
exports.publishBehavior = operators.publishBehavior;
exports.publishLast = operators.publishLast;
exports.publishReplay = operators.publishReplay;
exports.race = operators.race;
exports.reduce = operators.reduce;
exports.repeat = operators.repeat;
exports.repeatWhen = operators.repeatWhen;
exports.retry = operators.retry;
exports.retryWhen = operators.retryWhen;
exports.refCount = operators.refCount;
exports.sample = operators.sample;
exports.sampleTime = operators.sampleTime;
exports.scan = operators.scan;
exports.sequenceEqual = operators.sequenceEqual;
exports.share = operators.share;
exports.shareReplay = operators.shareReplay;
exports.single = operators.single;
exports.skip = operators.skip;
exports.skipLast = operators.skipLast;
exports.skipUntil = operators.skipUntil;
exports.skipWhile = operators.skipWhile;
exports.startWith = operators.startWith;
exports.subscribeOn = operators.subscribeOn;
exports.switchAll = operators.switchAll;
exports.switchMap = operators.switchMap;
exports.switchMapTo = operators.switchMapTo;
exports.take = operators.take;
exports.takeLast = operators.takeLast;
exports.takeUntil = operators.takeUntil;
exports.takeWhile = operators.takeWhile;
exports.tap = operators.tap;
exports.throttle = operators.throttle;
exports.throttleTime = operators.throttleTime;
exports.throwIfEmpty = operators.throwIfEmpty;
exports.timeInterval = operators.timeInterval;
exports.timeout = operators.timeout;
exports.timeoutWith = operators.timeoutWith;
exports.timestamp = operators.timestamp;
exports.toArray = operators.toArray;
exports.window = operators.window;
exports.windowCount = operators.windowCount;
exports.windowTime = operators.windowTime;
exports.windowToggle = operators.windowToggle;
exports.windowWhen = operators.windowWhen;
exports.withLatestFrom = operators.withLatestFrom;
exports.zip = operators.zip;
exports.zipAll = operators.zipAll;
-4
View File
@@ -1,4 +0,0 @@
// Copyright 2017-2021 @polkadot/x-rxjs authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { audit, auditTime, buffer, bufferCount, bufferTime, bufferToggle, bufferWhen, catchError, combineAll, combineLatest, concat, concatAll, concatMap, concatMapTo, count, debounce, debounceTime, defaultIfEmpty, delay, delayWhen, dematerialize, distinct, distinctUntilChanged, distinctUntilKeyChanged, elementAt, endWith, every, exhaust, exhaustMap, expand, filter, finalize, find, findIndex, first, flatMap, groupBy, ignoreElements, isEmpty, last, map, mapTo, materialize, max, merge, mergeAll, mergeMap, mergeMapTo, mergeScan, min, multicast, observeOn, onErrorResumeNext, pairwise, partition, pluck, publish, publishBehavior, publishLast, publishReplay, race, reduce, refCount, repeat, repeatWhen, retry, retryWhen, sample, sampleTime, scan, sequenceEqual, share, shareReplay, single, skip, skipLast, skipUntil, skipWhile, startWith, subscribeOn, switchAll, switchMap, switchMapTo, take, takeLast, takeUntil, takeWhile, tap, throttle, throttleTime, throwIfEmpty, timeInterval, timeout, timeoutWith, timestamp, toArray, window, windowCount, windowTime, windowToggle, windowWhen, withLatestFrom, zip, zipAll } from 'rxjs/_esm5/operators/index.js';
+1 -3
View File
@@ -27,9 +27,7 @@
"@polkadot/types/package-info.json": ["packages/types/package.json"],
"@polkadot/types/*": ["packages/types/src/*"],
"@polkadot/types-known": ["packages/types-known/src"],
"@polkadot/types-known/*": ["packages/types-known/src/*"],
"@polkadot/x-rxjs": ["packages/x-rxjs/src"],
"@polkadot/x-rxjs/*": ["packages/x-rxjs/src/*"],
"@polkadot/types-known/*": ["packages/types-known/src/*"]
},
"skipLibCheck": true,
"typeRoots": [
+162 -143
View File
@@ -1622,46 +1622,46 @@ __metadata:
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/x-rxjs": 3.5.1
"@polkadot/api": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/x-rxjs": ^5.5.2
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api-derive@3.5.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@3.7.3, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.5.1
"@polkadot/keyring": ^5.3.1
"@polkadot/rpc-core": 3.5.1
"@polkadot/rpc-provider": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/util-crypto": ^5.3.1
"@polkadot/x-rxjs": 3.5.1
"@polkadot/api": 3.7.3
"@polkadot/keyring": ^5.5.2
"@polkadot/rpc-core": 3.7.3
"@polkadot/rpc-provider": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/util-crypto": ^5.5.2
"@polkadot/x-rxjs": ^5.5.2
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api@3.5.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@3.7.3, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/api-derive": 3.5.1
"@polkadot/keyring": ^5.3.1
"@polkadot/metadata": 3.5.1
"@polkadot/rpc-core": 3.5.1
"@polkadot/rpc-provider": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/types-known": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/util-crypto": ^5.3.1
"@polkadot/x-rxjs": 3.5.1
"@polkadot/api-derive": 3.7.3
"@polkadot/keyring": ^5.5.2
"@polkadot/metadata": 3.7.3
"@polkadot/rpc-core": 3.7.3
"@polkadot/rpc-provider": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/types-known": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/util-crypto": ^5.5.2
"@polkadot/x-rxjs": ^5.5.2
bn.js: ^4.11.9
eventemitter3: ^4.0.7
languageName: unknown
@@ -1758,73 +1758,74 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/keyring@npm:^5.3.1":
version: 5.3.1
resolution: "@polkadot/keyring@npm:5.3.1"
"@polkadot/keyring@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/keyring@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/util": 5.3.1
"@polkadot/util-crypto": 5.3.1
"@polkadot/util": 5.5.2
"@polkadot/util-crypto": 5.5.2
peerDependencies:
"@polkadot/util": 5.3.1
"@polkadot/util-crypto": 5.3.1
checksum: 8cbef9e4a9359b0602cc45584aafbcdebbea83b640a78e719e3d6ebaf2c1d323dfdef9f9344d9cc6201a1660bbdbff58b1aacf2fafbb51520cbc161ea9fbaff6
"@polkadot/util": 5.5.2
"@polkadot/util-crypto": 5.5.2
checksum: 7b21d5e92c34edf4bd619168af7381e43775c82996d9be6bd22a86b136da816ba2352dfb79b563b6f939ff823c2955c8fa00c4d6828c382437d22a07a72bfd74
languageName: node
linkType: hard
"@polkadot/metadata@3.5.1, @polkadot/metadata@workspace:packages/metadata":
"@polkadot/metadata@3.7.3, @polkadot/metadata@workspace:packages/metadata":
version: 0.0.0-use.local
resolution: "@polkadot/metadata@workspace:packages/metadata"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.3.1
"@polkadot/types": 3.5.1
"@polkadot/types-known": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/util-crypto": ^5.3.1
"@polkadot/keyring": ^5.5.2
"@polkadot/types": 3.7.3
"@polkadot/types-known": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/util-crypto": ^5.5.2
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/networks@npm:5.3.1":
version: 5.3.1
resolution: "@polkadot/networks@npm:5.3.1"
"@polkadot/networks@npm:5.5.2, @polkadot/networks@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/networks@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
checksum: 8d18f7a1776d17b9494c79a131c14bc6c2a8272e43eeb0a71d68700637b151b58e4905bf920e09f0f49c9ebc0bbb59d122e323136f1a38f655b851a5a8ab8fbd
checksum: 8203fb953a8fca6e0a9bf7863c8d8262c714c2aed32f1dfedc0af08ee3c4224a51de56be832b6def94517d7cddcb33ca0a318bb8940500fd73cfc009404a4a6f
languageName: node
linkType: hard
"@polkadot/rpc-core@3.5.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@3.7.3, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.3.1
"@polkadot/metadata": 3.5.1
"@polkadot/rpc-provider": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/x-rxjs": 3.5.1
"@polkadot/keyring": ^5.5.2
"@polkadot/metadata": 3.7.3
"@polkadot/rpc-provider": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/x-rxjs": ^5.5.2
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@3.5.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@3.7.3, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.3.1
"@polkadot/metadata": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/util-crypto": ^5.3.1
"@polkadot/x-fetch": ^5.3.1
"@polkadot/x-ws": ^5.3.1
"@polkadot/keyring": ^5.5.2
"@polkadot/metadata": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/util-crypto": ^5.5.2
"@polkadot/x-fetch": ^5.5.2
"@polkadot/x-global": ^5.5.2
"@polkadot/x-ws": ^5.5.2
bn.js: ^4.11.9
eventemitter3: ^4.0.7
mock-socket: ^9.0.3
nock: ^13.0.5
nock: ^13.0.7
languageName: unknown
linkType: soft
@@ -1844,13 +1845,13 @@ __metadata:
"@babel/core": ^7.12.10
"@babel/register": ^7.12.10
"@babel/runtime": ^7.12.5
"@polkadot/api": 3.5.1
"@polkadot/metadata": 3.5.1
"@polkadot/rpc-provider": 3.5.1
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/api": 3.7.3
"@polkadot/metadata": 3.7.3
"@polkadot/rpc-provider": 3.7.3
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@types/websocket": ^1.0.1
"@types/yargs": ^15.0.12
"@types/yargs": ^15.0.13
handlebars: ^4.7.6
websocket: ^1.0.33
yargs: ^16.2.0
@@ -1863,42 +1864,43 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-known@3.5.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@3.7.3, @polkadot/types-known@workspace:packages/types-known":
version: 0.0.0-use.local
resolution: "@polkadot/types-known@workspace:packages/types-known"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/types": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/networks": ^5.5.2
"@polkadot/types": 3.7.3
"@polkadot/util": ^5.5.2
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/types@3.5.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@3.7.3, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/keyring": ^5.3.1
"@polkadot/metadata": 3.5.1
"@polkadot/util": ^5.3.1
"@polkadot/util-crypto": ^5.3.1
"@polkadot/x-rxjs": 3.5.1
"@polkadot/keyring": ^5.5.2
"@polkadot/metadata": 3.7.3
"@polkadot/util": ^5.5.2
"@polkadot/util-crypto": ^5.5.2
"@polkadot/x-rxjs": ^5.5.2
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/util-crypto@npm:5.3.1, @polkadot/util-crypto@npm:^5.3.1":
version: 5.3.1
resolution: "@polkadot/util-crypto@npm:5.3.1"
"@polkadot/util-crypto@npm:5.5.2, @polkadot/util-crypto@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/util-crypto@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/networks": 5.3.1
"@polkadot/util": 5.3.1
"@polkadot/wasm-crypto": ^3.1.1
"@polkadot/x-randomvalues": 5.3.1
"@polkadot/networks": 5.5.2
"@polkadot/util": 5.5.2
"@polkadot/wasm-crypto": ^3.2.2
"@polkadot/x-randomvalues": 5.5.2
base-x: ^3.0.8
blakejs: ^1.1.0
bn.js: ^4.11.9
@@ -1910,113 +1912,130 @@ __metadata:
tweetnacl: ^1.0.3
xxhashjs: ^0.2.2
peerDependencies:
"@polkadot/util": 5.3.1
checksum: db67cefaa5cadbad8eaf6b68e56ac29661d1b91a6f0911791a07c363a5d66c343cfdb89fd732ca8b2c24516b2911373ccdc5fb74e451c2f53d3458f575e8546a
"@polkadot/util": 5.5.2
checksum: ba1e67ecfdacc3818d0146cdc83ae720506d4803cd95c45b324479896050ddd264f98f3ceb573e0754d19aac6e9272bbbe3945eff4d2fd1088e605a36e5fdb6f
languageName: node
linkType: hard
"@polkadot/util@npm:5.3.1, @polkadot/util@npm:^5.3.1":
version: 5.3.1
resolution: "@polkadot/util@npm:5.3.1"
"@polkadot/util@npm:5.5.2, @polkadot/util@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/util@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/x-textdecoder": 5.3.1
"@polkadot/x-textencoder": 5.3.1
"@polkadot/x-textdecoder": 5.5.2
"@polkadot/x-textencoder": 5.5.2
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
camelcase: ^5.3.1
ip-regex: ^4.2.0
checksum: 4cb048507ac4d49227f7183faf764bb07b8445cf4ac79106664b15287499d4e0aa76530eed0dc234940a86b3355808a6c705d1fd07e0db1c6cc5f19dd4dd3119
ip-regex: ^4.3.0
checksum: ed44349e0484962f58b34a411d7217684bcacad461a306f0164e75deb8c239dfd2f36f8c1490ccaa5e3d3fe11f81fb69be717f170155e27c1d68f259c4e6ad64
languageName: node
linkType: hard
"@polkadot/wasm-crypto-asmjs@npm:^3.1.1":
version: 3.1.1
resolution: "@polkadot/wasm-crypto-asmjs@npm:3.1.1"
"@polkadot/wasm-crypto-asmjs@npm:^3.2.2":
version: 3.2.2
resolution: "@polkadot/wasm-crypto-asmjs@npm:3.2.2"
dependencies:
"@babel/runtime": ^7.12.5
checksum: 6f8f10452e89ba7e3cabbd38f521cd379180c6efec644a79b7e39c04eb00dbba50a121a695cfc02578ec123c3139ce2aa128b193f11ed49e1e9f624685350e8a
checksum: ddeaf412f1312ee4a045d2c94046af3b800330ee8b64e6c89f9a40abb93270a4d7fa19141107a45b84f7f24c93d1ed3c16d3c552c2e3ecdea7662dd0348a46e5
languageName: node
linkType: hard
"@polkadot/wasm-crypto-wasm@npm:^3.1.1":
version: 3.1.1
resolution: "@polkadot/wasm-crypto-wasm@npm:3.1.1"
"@polkadot/wasm-crypto-wasm@npm:^3.2.2":
version: 3.2.2
resolution: "@polkadot/wasm-crypto-wasm@npm:3.2.2"
dependencies:
"@babel/runtime": ^7.12.5
checksum: f96eda239fa4632359983ef12d776268ed2f16a12cc888e594f3ca43f09b42cc389ad248bbccb99b801b59ad672e2961a9e3dff9377ede067588d4de541df6fa
checksum: 12ff0ea3c30c731269a1428e92a2e9d9f34ff2cbc5bc5d97a1d762c9fa85acc2027fe44eadc293971976137bd79c508de68b465fffe728d4e557d8f4221efb9e
languageName: node
linkType: hard
"@polkadot/wasm-crypto@npm:^3.1.1":
version: 3.1.1
resolution: "@polkadot/wasm-crypto@npm:3.1.1"
"@polkadot/wasm-crypto@npm:^3.2.2":
version: 3.2.2
resolution: "@polkadot/wasm-crypto@npm:3.2.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/wasm-crypto-asmjs": ^3.1.1
"@polkadot/wasm-crypto-wasm": ^3.1.1
"@polkadot/wasm-crypto-asmjs": ^3.2.2
"@polkadot/wasm-crypto-wasm": ^3.2.2
peerDependencies:
"@polkadot/util": "*"
"@polkadot/x-randomvalues": "*"
checksum: a7b3d029d88669ea9775c8cfe166a44a06ba243283c03fa0547bf4c6144c5440260a0bd1a6acc9c67b57ab707c406d681a2e52af5e7da3ebe8bb4fdeff071c66
checksum: 9940cff288e7f027566b16531f92dce560e7f18f6abdae5f1ca41e752aa5c05b7fd1208900c6ee5032d7f0822ee8f425107b84ed9f4c647aa17d1268f27ce30d
languageName: node
linkType: hard
"@polkadot/x-fetch@npm:^5.3.1":
version: 5.3.1
resolution: "@polkadot/x-fetch@npm:5.3.1"
"@polkadot/x-fetch@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/x-fetch@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/x-global": 5.5.2
"@types/node-fetch": ^2.5.8
node-fetch: ^2.6.1
checksum: db2e12c97d5cd1c64e8dec868ddd75f121c7a412943d1b48b0759e262763120bc1623e2d8770542b94a3a473323e4f1e1a85ec8996dac0e75749f5cdc6e46d4e
languageName: node
linkType: hard
"@polkadot/x-global@npm:5.5.2, @polkadot/x-global@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/x-global@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@types/node-fetch": ^2.5.8
node-fetch: ^2.6.1
checksum: 7a0408e9ae106b1625fb193cad7c8e5e2a1a80d1f103eaa5d1fc3234563d22c2e98cbbe1a6bc17a50793fe8012c2c57a962de3207735bf956fd7594bbbdcd4b3
checksum: 7b89e9d1e47d8bd314754e5dc84a2010420edee4a5fad495392f87d72a0f37118a7cc7ba441fde0392bf3c58241def9b9103766ef23fb50065f4d9bd9f1a4382
languageName: node
linkType: hard
"@polkadot/x-randomvalues@npm:5.3.1":
version: 5.3.1
resolution: "@polkadot/x-randomvalues@npm:5.3.1"
"@polkadot/x-randomvalues@npm:5.5.2":
version: 5.5.2
resolution: "@polkadot/x-randomvalues@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
checksum: 2a4cf1b746bfd4f84ed473dac53780dd9e15b7dd5528cad300c6eb4ba35793fb7cd8862065e236110b14e90a0ada06f47d7998a935c57509c62edda87610b42e
"@polkadot/x-global": 5.5.2
checksum: efdf4d21e90bc14de13e243fb268a568bf799dced767dba25dfe54ad10d6e040c7970f43722b2fd8fe3caefba07ac4ccd0a2d86bc8ee586ad06e7fb208ac5fd3
languageName: node
linkType: hard
"@polkadot/x-rxjs@3.5.1, @polkadot/x-rxjs@workspace:packages/x-rxjs":
version: 0.0.0-use.local
resolution: "@polkadot/x-rxjs@workspace:packages/x-rxjs"
"@polkadot/x-rxjs@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/x-rxjs@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
rxjs: ^6.6.3
languageName: unknown
linkType: soft
"@polkadot/x-textdecoder@npm:5.3.1":
version: 5.3.1
resolution: "@polkadot/x-textdecoder@npm:5.3.1"
dependencies:
"@babel/runtime": ^7.12.5
checksum: e6388d73224007426461923c24506759aaf24d34f86d147707e146902febddbe9e477717a187694381cff8248a0c260075fed16ae0b901d4766b1929e28bdc6e
checksum: a523a49c1472474ebe80f0b2724cff4b864099b624e13e399a772c7cfa7baf1173d5fcaafd539ab6b88dc24d9826fafb8df4ba8401caade582fa2943b6e31b07
languageName: node
linkType: hard
"@polkadot/x-textencoder@npm:5.3.1":
version: 5.3.1
resolution: "@polkadot/x-textencoder@npm:5.3.1"
"@polkadot/x-textdecoder@npm:5.5.2":
version: 5.5.2
resolution: "@polkadot/x-textdecoder@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
checksum: 8131133c82016e7ce7abdd72667c656f3c067e909ece9b8f497d6ffba78a84d86efbabf8833d1fec3acf29dda33ce460d8d7b44b52cc4a85a8330a9609e3a772
"@polkadot/x-global": 5.5.2
checksum: 167a99fb2d21da65292d3111ca46e41f94b3776caaeff86aae7b3633b8861df8011973a21703876e50da46a58024aaff42b66125f51b4503423a3f823db7846b
languageName: node
linkType: hard
"@polkadot/x-ws@npm:^5.3.1":
version: 5.3.1
resolution: "@polkadot/x-ws@npm:5.3.1"
"@polkadot/x-textencoder@npm:5.5.2":
version: 5.5.2
resolution: "@polkadot/x-textencoder@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/x-global": 5.5.2
checksum: a2e5a653639131c9e915260ee452ee10435a464242f6304ce9a78f1427d73c70955f6c7964a2c06a6e75123a624bc8203c5ccc1297a97f7306c85456d07d8c86
languageName: node
linkType: hard
"@polkadot/x-ws@npm:^5.5.2":
version: 5.5.2
resolution: "@polkadot/x-ws@npm:5.5.2"
dependencies:
"@babel/runtime": ^7.12.5
"@polkadot/x-global": 5.5.2
"@types/websocket": ^1.0.1
websocket: ^1.0.33
checksum: 8a2105dd7fa91eebd987960c96b052f5f008e6d62039120dbd75b7d375674679e551dc66505091c96e9472fd2c392a5fba8d34f440c4b706f4f355e049d3371a
checksum: b17ff626a73b73b87207fa24c0245fa5dfed32375b37b46413388b15cdaf978dffaea2e785eab29bd6ea4557c1695a54f83a538d922d3aa9074fa1721896ded7
languageName: node
linkType: hard
@@ -2274,12 +2293,12 @@ __metadata:
languageName: node
linkType: hard
"@types/yargs@npm:^15.0.0, @types/yargs@npm:^15.0.12":
version: 15.0.12
resolution: "@types/yargs@npm:15.0.12"
"@types/yargs@npm:^15.0.0, @types/yargs@npm:^15.0.13":
version: 15.0.13
resolution: "@types/yargs@npm:15.0.13"
dependencies:
"@types/yargs-parser": "*"
checksum: b67cf9e8f25865a6d6e72196fe7f47c6f328d2b7a54ed9fa0e60f9693abb332fec1a826f90310804f231bca28a2f71367956b3be2fdba2d4bf316f0394d84f4d
checksum: fa1a5b0a07dbbff1657a27d1191d586632412d170321000f6f417f279547a8c191d7058dbf4d4187c188a5a1aeb2473ddb25fe316b206fccdfe1de6fad976619
languageName: node
linkType: hard
@@ -5862,10 +5881,10 @@ fsevents@~2.1.2:
languageName: node
linkType: hard
"ip-regex@npm:^4.2.0":
version: 4.2.0
resolution: "ip-regex@npm:4.2.0"
checksum: 9e376018e64da89756e27d3f1b3313abc85291b5d1b5b9878f26b3934ecb04fa512116bf66b6dcd9553ba0b88af4feaaedbccd86f0ba6c05e464642ccb8504c5
"ip-regex@npm:^4.3.0":
version: 4.3.0
resolution: "ip-regex@npm:4.3.0"
checksum: 4f44f34dcfe5cfae3b79bac4b25bec81ea007c24a66a30a3a17d01eebde4fa98bb531f207590ee16e1e4721b4f8ad12f6a64ed9f49bcb4587ff13ebb7cc984a5
languageName: node
linkType: hard
@@ -7670,15 +7689,15 @@ fsevents@~2.1.2:
languageName: node
linkType: hard
"nock@npm:^13.0.5":
version: 13.0.5
resolution: "nock@npm:13.0.5"
"nock@npm:^13.0.7":
version: 13.0.7
resolution: "nock@npm:13.0.7"
dependencies:
debug: ^4.1.0
json-stringify-safe: ^5.0.1
lodash.set: ^4.3.2
propagate: ^2.0.0
checksum: 2000952241d9f78491bd2770a5186b530eddef8710d219917b078e8c1b329abbdb88bcfb3dfd6bf093e860287ad8da7dd4136fbd2a8c1f42a7b56e3b071807f2
checksum: db77afdd757bb9f5496783a9f7cc30eb0664195c469d0b01e2e956545e6c08b24482a4a3fcdf4eef1713da30baa880bde244bac6c546733d5b3a59c6838d24b1
languageName: node
linkType: hard