Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4195833d6f | ||
|
|
8f4e62c278 | ||
|
|
2c294af116 | ||
|
|
0f1f3b88b2 | ||
|
|
56b7697dda | ||
|
|
86d7471c76 | ||
|
|
cb7400710b | ||
|
|
59796067e2 | ||
|
|
7920565b97 | ||
|
|
4f0069cac8 | ||
|
|
835070c44f | ||
|
|
5368733353 | ||
|
|
efda09f279 | ||
|
|
af48f19dfa | ||
|
|
a0dd50b3ba | ||
|
|
3e159891c0 | ||
|
|
4b36fa68a5 | ||
|
|
70c9cfa0f0 | ||
|
|
3ce67375e3 | ||
|
|
10d611ba17 | ||
|
|
00acff5956 | ||
|
|
9857abd061 | ||
|
|
e87c830990 | ||
|
|
71063c93d1 | ||
|
|
e037df89e3 | ||
|
|
564d63ce28 | ||
|
|
69db63b6f9 | ||
|
|
2bd81e9d05 | ||
|
|
d267895dd5 | ||
|
|
190e0fcdb1 | ||
|
|
5e83837c5b | ||
|
|
7f949874e6 | ||
|
|
b024d7f63c | ||
|
|
4bc76bb3e5 | ||
|
|
212b43dda2 | ||
|
|
0ba1b318a7 | ||
|
|
2e8e5a93ca | ||
|
|
6101f82000 | ||
|
|
662aef2033 | ||
|
|
0859c470be | ||
|
|
29fe22da43 | ||
|
|
7eef825b38 | ||
|
|
24808fb55d | ||
|
|
9c06ed7a1c | ||
|
|
9560259f55 | ||
|
|
6236838fc8 | ||
|
|
e14eddfee3 | ||
|
|
0927f9ba8c | ||
|
|
a8775fd69d | ||
|
|
363c502ae8 | ||
|
|
d6cc0c30b4 | ||
|
|
5e312973f3 | ||
|
|
17c6262a5e | ||
|
|
0932a9aa7b | ||
|
|
88b44befdf | ||
|
|
e4fb971bec | ||
|
|
5c7c406676 | ||
|
|
709e89b801 | ||
|
|
fd96255d05 | ||
|
|
c212db26b6 | ||
|
|
817aaccbb1 | ||
|
|
bfd5642d64 | ||
|
|
126871bd46 | ||
|
|
714234b7af | ||
|
|
a7a0965d73 | ||
|
|
9b1f9c214b | ||
|
|
ca17955d83 | ||
|
|
9b0d260b33 | ||
|
|
fed2913684 | ||
|
|
fc777377ef | ||
|
|
ce7968f870 | ||
|
|
07594a33b5 | ||
|
|
48620ea7a3 | ||
|
|
f86ace2680 | ||
|
|
0e22308954 | ||
|
|
ae21d13b23 | ||
|
|
b594158275 | ||
|
|
76da6a6af5 | ||
|
|
e1f510f5e9 | ||
|
|
db6c44615f | ||
|
|
4ce01fe16f | ||
|
|
c52576149a | ||
|
|
0b5e4fe1cc | ||
|
|
8404170240 |
+3
-1
@@ -25,4 +25,6 @@
|
||||
4.11.2
|
||||
4.16.2
|
||||
|
||||
5.3.2
|
||||
5.3.2
|
||||
5.5.2
|
||||
5.8.2
|
||||
Vendored
-591
File diff suppressed because one or more lines are too long
+631
File diff suppressed because one or more lines are too long
+1
-1
@@ -10,4 +10,4 @@ plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
|
||||
spec: "@yarnpkg/plugin-version"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.0.0-rc.2.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.0.1.cjs
|
||||
|
||||
@@ -1,5 +1,86 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 5.8.2 Sep 6, 2021
|
||||
|
||||
Contributed:
|
||||
|
||||
- Correct Xcm V1 `MultiLocation` definitions (Thanks to https://github.com/apopiak)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust Kusama Xcm overrides
|
||||
|
||||
|
||||
## 5.8.1 Sep 6, 2021
|
||||
|
||||
Upgrade priority: Low.
|
||||
|
||||
Changes:
|
||||
|
||||
- Add `Auction` to Kusama `ProxyType` definition
|
||||
- Adjust Xcm definitions with latest v1 & v2 types
|
||||
- Support for `scale-info` 1.0 `Range` mapping
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 5.7.1 Aug 29, 2021
|
||||
|
||||
Upgrade priority: Low.
|
||||
|
||||
Changes:
|
||||
|
||||
- Optimize `Vec` construction (no re-create on new arrays)
|
||||
- Adjust output for enums in `toHuman`
|
||||
- Adjust aliases for new parachain module locations
|
||||
- Support for versioned xcm types (Polkadot master)
|
||||
- Add support for `Range` in `PortableRegistry` (used in Metadata 14)
|
||||
- Adjust balances derive for non-existent instances
|
||||
- Ensure Statemint (current) defaults to xcm v0
|
||||
- Add Kusama 9090 upgrade block
|
||||
|
||||
|
||||
## 5.6.1 Aug 23, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of Xcm, preparing for Kusama/Westend 9100
|
||||
|
||||
Contributed:
|
||||
|
||||
- Support 0...N-1 args on `keys/entries` (Thanks to https://github.com/hamidra)
|
||||
|
||||
Changes:
|
||||
|
||||
- Updated XCM types, `AssetId`, `MultiAssets`, `MultiAssetV1`, `AssetInstanceV1`, `XcmOrderV1`
|
||||
- Rename `Null` entry in `MultiLocation` to `Here` (Xcm V1)
|
||||
- Westend 9090 upgrade block
|
||||
- Bump static Substrate, Kusama & Polkadot metadata
|
||||
|
||||
|
||||
## 5.5.2 Aug 19, 2021
|
||||
|
||||
Upgrade priority: Medium. Contains fixes for parachain types, affecting historic block retrieval on Kusama.
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `ValidDisputeStatementKind` enum to latest version
|
||||
- Only enable API health keepalive on connections supporting subscriptions
|
||||
|
||||
|
||||
## 5.5.1 Aug 15, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of TS (`createType` and `bigint` adjustments)
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add `Range` & `RangeInclusive` types (Thanks to https://github.com/c410-f3r)
|
||||
- Always use TS `bigint` type (Thanks to https://github.com/ntduan)
|
||||
|
||||
Changes:
|
||||
|
||||
- Loosen pedantic check not to fail on all-empty values
|
||||
- Extend `createType` auto-TS decoration for `BreeMap`, `BTreeSet`, `HashMap`, `Range`
|
||||
- Add Polkadot 9080 upgrade block
|
||||
|
||||
|
||||
## 5.4.1 Aug 9, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for potential users of NMap.
|
||||
|
||||
+1
-14
@@ -16,18 +16,5 @@ module.exports = {
|
||||
// eslint-disable-next-line sort-keys
|
||||
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
|
||||
},
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/packages/api/build',
|
||||
'<rootDir>/packages/api-contract/build',
|
||||
'<rootDir>/packages/api-derive/build',
|
||||
'<rootDir>/packages/metadata/build',
|
||||
'<rootDir>/packages/rpc-core/build',
|
||||
'<rootDir>/packages/rpc-provider/build',
|
||||
'<rootDir>/packages/typegen/build',
|
||||
'<rootDir>/packages/types/build',
|
||||
'<rootDir>/packages/types-known/build',
|
||||
'<rootDir>/packages/types-support/build'
|
||||
],
|
||||
testTimeout: 30000,
|
||||
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
|
||||
testTimeout: 30000
|
||||
};
|
||||
|
||||
+9
-8
@@ -8,7 +8,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"typescript": "^4.3.5"
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn build:interfaces && polkadot-dev-build-ts",
|
||||
@@ -26,14 +26,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@babel/register": "^7.14.5",
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@polkadot/ts": "^0.4.4",
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/register": "^7.15.3",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/dev": "^0.62.66",
|
||||
"@polkadot/ts": "^0.4.7",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/jest": "^27.0.1",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "5.4.1"
|
||||
"version": "5.8.2",
|
||||
"packageManager": "yarn@3.0.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
@@ -19,10 +19,10 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api": "5.4.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"rxjs": "^7.2.0"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "5.8.2",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"rxjs": "^7.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,27 +4,35 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { TypeDefInfo } from '@polkadot/types/types';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
function stringifyInfo (key: string, value: unknown): unknown {
|
||||
return key === 'info'
|
||||
? TypeDefInfo[value as number]
|
||||
: value;
|
||||
}
|
||||
|
||||
describe('MetaRegistry', (): void => {
|
||||
Object.keys(abis).forEach((abiName) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
const abi = new Abi(abis[abiName]);
|
||||
const json = JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo, 2);
|
||||
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
|
||||
|
||||
try {
|
||||
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(JSON.parse(json)).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
console.error(JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo));
|
||||
|
||||
if (!fs.existsSync(cmpPath)) {
|
||||
fs.writeFileSync(cmpPath, JSON.stringify(abi.registry.metaTypeDefs, null, 2), { flag: 'w' });
|
||||
throw error;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(abi.registry.metaTypeDefs).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
console.error(JSON.stringify(abi.registry.metaTypeDefs));
|
||||
|
||||
throw error;
|
||||
fs.writeFileSync(cmpPath, json, { flag: 'w' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,14 +27,14 @@ const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is
|
||||
const l = logger('Contract');
|
||||
|
||||
function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: unknown[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
|
||||
return (origin: string | AccountId | Uint8Array, options: BigInt | string | number | BN | ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
|
||||
return (origin: string | AccountId | Uint8Array, options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
|
||||
isOptions(options)
|
||||
? fn(origin, options, params)
|
||||
: fn(origin, ...extractOptions(options, params));
|
||||
}
|
||||
|
||||
function createTx <ApiType extends ApiTypes> (fn: (options: ContractOptions, params: unknown[]) => SubmittableExtrinsic<ApiType>): ContractTx<ApiType> {
|
||||
return (options: BigInt | string | number | BN | ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType> =>
|
||||
return (options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions(options, params));
|
||||
@@ -90,7 +90,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
return this.#tx;
|
||||
}
|
||||
|
||||
#getGas = (_gasLimit: BigInt | BN | string | number, isCall = false): BN => {
|
||||
#getGas = (_gasLimit: bigint | BN | string | number, isCall = false): BN => {
|
||||
const gasLimit = bnToBn(_gasLimit);
|
||||
|
||||
return gasLimit.lte(BN_ZERO)
|
||||
|
||||
@@ -10,22 +10,22 @@ import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions
|
||||
|
||||
export interface BlueprintDeploy<ApiType extends ApiTypes> {
|
||||
(options: BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
(value: BigInt | string | number | BN, gasLimit: BigInt | string | number | BN, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
(value: bigint | string | number | BN, gasLimit: bigint | string | number | BN, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
}
|
||||
|
||||
export interface ContractQuery<ApiType extends ApiTypes> {
|
||||
(origin: AccountId | string | Uint8Array, options: ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
|
||||
(origin: AccountId | string | Uint8Array, value: BigInt | BN | string | number, gasLimit: BigInt | BN | string | number, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
|
||||
(origin: AccountId | string | Uint8Array, value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
|
||||
}
|
||||
|
||||
export interface ContractTx<ApiType extends ApiTypes> {
|
||||
(options: ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
(value: BigInt | BN | string | number, gasLimit: BigInt | BN | string | number, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
(value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
}
|
||||
|
||||
export interface ContractGeneric<O, T> {
|
||||
(messageOrId: AbiMessage | string | number, options: O, ...params: unknown[]): T;
|
||||
(messageOrId: AbiMessage | string | number, value: BigInt | BN | string | number, gasLimit: BigInt | BN | string | number, ...params: unknown[]): T;
|
||||
(messageOrId: AbiMessage | string | number, value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): T;
|
||||
}
|
||||
|
||||
export type ContractCallResult<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
|
||||
|
||||
@@ -17,14 +17,14 @@ import { extractOptions, isOptions } from '../util';
|
||||
export const EMPTY_SALT = new Uint8Array();
|
||||
|
||||
export function createBluePrintTx <ApiType extends ApiTypes, R extends SubmittableResult> (fn: (options: BlueprintOptions, params: unknown[]) => SubmittableExtrinsic<ApiType, R>): BlueprintDeploy<ApiType> {
|
||||
return (options: BigInt | string | number | BN | BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
|
||||
return (options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions(options, params));
|
||||
}
|
||||
|
||||
export function createBluePrintWithId <T> (fn: (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: unknown[]) => T): ContractGeneric<BlueprintOptions, T> {
|
||||
return (constructorOrId: AbiConstructor | string | number, options: BigInt | string | number | BN | BlueprintOptions, ...params: unknown[]): T =>
|
||||
return (constructorOrId: AbiConstructor | string | number, options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): T =>
|
||||
isOptions(options)
|
||||
? fn(constructorOrId, options, params)
|
||||
: fn(constructorOrId, ...extractOptions(options, params));
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '5.8.2' };
|
||||
|
||||
@@ -71,12 +71,12 @@ export interface DecodedMessage {
|
||||
}
|
||||
|
||||
export interface BlueprintOptions {
|
||||
gasLimit?: BigInt | string | number | BN;
|
||||
gasLimit?: bigint | string | number | BN;
|
||||
salt?: Uint8Array | string | null;
|
||||
value?: BigInt | string | number | BN;
|
||||
value?: bigint | string | number | BN;
|
||||
}
|
||||
|
||||
export interface ContractOptions {
|
||||
gasLimit?: BigInt | BN | string | number;
|
||||
value?: BigInt | BN | string | number;
|
||||
gasLimit?: bigint | BN | string | number;
|
||||
value?: bigint | BN | string | number;
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ export function applyOnEvent <T> (result: SubmittableResult, types: ContractEven
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function isOptions <T> (options: BigInt | string | number | BN | T): options is T {
|
||||
export function isOptions <T> (options: bigint | string | number | BN | T): options is T {
|
||||
return !(isBn(options) || isBigInt(options) || isNumber(options) || isString(options));
|
||||
}
|
||||
|
||||
export function extractOptions <T extends TOptions> (value: BigInt | string | number | BN, params: unknown[]): [T, unknown[]] {
|
||||
export function extractOptions <T extends TOptions> (value: bigint | string | number | BN, params: unknown[]): [T, unknown[]] {
|
||||
const gasLimit = params.shift() as BN;
|
||||
|
||||
return [{ gasLimit, value } as T, params];
|
||||
|
||||
@@ -2,30 +2,30 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
},
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "Hash"
|
||||
}
|
||||
]
|
||||
@@ -2,20 +2,20 @@
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
@@ -33,15 +33,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -52,45 +52,45 @@
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "Hash",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"Hash\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "Hash"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -104,23 +104,23 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"AccountId\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
@@ -128,7 +128,7 @@
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
@@ -136,13 +136,13 @@
|
||||
"name": "Error",
|
||||
"displayName": "Error",
|
||||
"namespace": "dns::dns",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NameAlreadyExists",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -150,7 +150,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CallerIsNotOwner",
|
||||
"type": "Null"
|
||||
}
|
||||
@@ -158,24 +158,24 @@
|
||||
"type": "{\"_enum\":[\"NameAlreadyExists\",\"CallerIsNotOwner\"]}"
|
||||
}
|
||||
],
|
||||
"info": 7,
|
||||
"info": "Result",
|
||||
"type": "Result<(), Error>"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Error",
|
||||
"namespace": "dns::dns",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NameAlreadyExists",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -183,7 +183,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CallerIsNotOwner",
|
||||
"type": "Null"
|
||||
}
|
||||
@@ -195,10 +195,10 @@
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
@@ -1,25 +1,25 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
@@ -37,15 +37,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -56,45 +56,45 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -106,17 +106,17 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u128\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
@@ -126,15 +126,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -143,18 +143,18 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -162,29 +162,29 @@
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
@@ -192,10 +192,10 @@
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -2,20 +2,20 @@
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
@@ -33,15 +33,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -50,26 +50,26 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -83,36 +83,36 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"AccountId\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
@@ -122,15 +122,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -141,12 +141,12 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
@@ -154,17 +154,17 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u32\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
@@ -174,15 +174,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -191,18 +191,18 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -210,22 +210,22 @@
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -236,21 +236,21 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"bool\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
@@ -258,10 +258,10 @@
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
},
|
||||
{
|
||||
@@ -269,7 +269,7 @@
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
@@ -277,13 +277,13 @@
|
||||
"name": "Error",
|
||||
"displayName": "Error",
|
||||
"namespace": "erc721::erc721",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotOwner",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -291,7 +291,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotApproved",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -299,7 +299,7 @@
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "TokenExists",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -307,7 +307,7 @@
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "TokenNotFound",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -315,7 +315,7 @@
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotInsert",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -323,7 +323,7 @@
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotRemove",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -331,7 +331,7 @@
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotFetchValue",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -339,7 +339,7 @@
|
||||
"ext": {
|
||||
"discriminant": 7
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotAllowed",
|
||||
"type": "Null"
|
||||
}
|
||||
@@ -347,24 +347,24 @@
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}"
|
||||
}
|
||||
],
|
||||
"info": 7,
|
||||
"info": "Result",
|
||||
"type": "Result<(), Error>"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Error",
|
||||
"namespace": "erc721::erc721",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotOwner",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -372,7 +372,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotApproved",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -380,7 +380,7 @@
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "TokenExists",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -388,7 +388,7 @@
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "TokenNotFound",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -396,7 +396,7 @@
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotInsert",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -404,7 +404,7 @@
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotRemove",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -412,7 +412,7 @@
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "CannotFetchValue",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -420,11 +420,11 @@
|
||||
"ext": {
|
||||
"discriminant": 7
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "NotAllowed",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
}
|
||||
]
|
||||
@@ -2,20 +2,20 @@
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
@@ -33,15 +33,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -50,16 +50,16 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -67,20 +67,20 @@
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -89,34 +89,34 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -128,22 +128,22 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"()\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
@@ -154,15 +154,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -171,12 +171,12 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
@@ -184,17 +184,17 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u32\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
@@ -204,15 +204,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -223,41 +223,41 @@
|
||||
{
|
||||
"displayName": "Transaction",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]",
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "transferred_value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u64",
|
||||
"name": "gas_limit"
|
||||
}
|
||||
@@ -266,47 +266,47 @@
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"Transaction\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Transaction",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]",
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "transferred_value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u64",
|
||||
"name": "gas_limit"
|
||||
}
|
||||
@@ -314,28 +314,28 @@
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Vec<u8>\",\"transferred_value\":\"u128\",\"gas_limit\":\"u64\"}"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]"
|
||||
},
|
||||
{
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u64"
|
||||
},
|
||||
{
|
||||
@@ -345,15 +345,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -364,44 +364,44 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"type": "Vec<AccountId>"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "ConfirmationStatus",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Confirmed",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
@@ -414,16 +414,16 @@
|
||||
{
|
||||
"displayName": "ConfirmationStatus",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Confirmed",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
@@ -435,18 +435,18 @@
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": 7,
|
||||
"info": "Result",
|
||||
"type": "Result<(), ()>"
|
||||
},
|
||||
{
|
||||
@@ -454,21 +454,21 @@
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": 7,
|
||||
"info": "Result",
|
||||
"type": "Result<Vec<u8>, ()>"
|
||||
},
|
||||
{
|
||||
@@ -478,37 +478,37 @@
|
||||
"name": "Ok",
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<Vec<u8>>"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": 7,
|
||||
"info": "Result",
|
||||
"type": "Result<Option<Vec<u8>>, ()>"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"info": 11,
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<Vec<u8>>"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u256"
|
||||
}
|
||||
]
|
||||
@@ -1,28 +1,28 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u256"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "Text"
|
||||
}
|
||||
]
|
||||
@@ -1,23 +1,23 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "Variant",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "None",
|
||||
"type": "()"
|
||||
@@ -25,13 +25,13 @@
|
||||
{
|
||||
"displayName": "Weekday",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Monday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -39,7 +39,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Tuesday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -47,7 +47,7 @@
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Wednesday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -55,7 +55,7 @@
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Thursday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -63,7 +63,7 @@
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Friday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -71,7 +71,7 @@
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Saturday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -79,7 +79,7 @@
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Sunday",
|
||||
"type": "Null"
|
||||
}
|
||||
@@ -90,15 +90,15 @@
|
||||
{
|
||||
"displayName": "TupleMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Unsigned"
|
||||
}
|
||||
@@ -109,13 +109,13 @@
|
||||
{
|
||||
"displayName": "NamedMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "value"
|
||||
}
|
||||
@@ -124,10 +124,10 @@
|
||||
"type": "{\"value\":\"i32\"}"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
}
|
||||
@@ -142,47 +142,47 @@
|
||||
{
|
||||
"displayName": "Color",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Red",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Blue",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Green",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Yellow",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
}
|
||||
@@ -191,25 +191,25 @@
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "a"
|
||||
}
|
||||
@@ -227,13 +227,13 @@
|
||||
{
|
||||
"displayName": "Weekday",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Monday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -241,7 +241,7 @@
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Tuesday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -249,7 +249,7 @@
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Wednesday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -257,7 +257,7 @@
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Thursday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -265,7 +265,7 @@
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Friday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -273,7 +273,7 @@
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Saturday",
|
||||
"type": "Null"
|
||||
},
|
||||
@@ -281,7 +281,7 @@
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"name": "Sunday",
|
||||
"type": "Null"
|
||||
}
|
||||
@@ -291,15 +291,15 @@
|
||||
{
|
||||
"displayName": "TupleMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Unsigned"
|
||||
}
|
||||
@@ -309,13 +309,13 @@
|
||||
{
|
||||
"displayName": "NamedMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "value"
|
||||
}
|
||||
@@ -324,10 +324,10 @@
|
||||
"type": "{\"value\":\"i32\"}"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
}
|
||||
@@ -341,47 +341,47 @@
|
||||
{
|
||||
"displayName": "Color",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Red",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Blue",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Green",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Yellow",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
}
|
||||
@@ -390,25 +390,25 @@
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}"
|
||||
},
|
||||
{
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "a"
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
@@ -37,15 +37,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -56,45 +56,45 @@
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": 12,
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -106,17 +106,17 @@
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u128\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
@@ -126,15 +126,15 @@
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": 9,
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
@@ -143,18 +143,18 @@
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
@@ -162,33 +162,33 @@
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": 3,
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": 10,
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "Text"
|
||||
},
|
||||
{
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
@@ -196,10 +196,10 @@
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": 6,
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": 5,
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
@@ -19,16 +19,16 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api": "5.4.1",
|
||||
"@polkadot/rpc-core": "5.4.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"rxjs": "^7.2.0"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "5.8.2",
|
||||
"@polkadot/rpc-core": "5.8.2",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"@polkadot/util-crypto": "^7.3.1",
|
||||
"rxjs": "^7.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/rpc-provider": "5.4.1"
|
||||
"@polkadot/keyring": "^7.3.1",
|
||||
"@polkadot/rpc-provider": "5.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx, QueryableStorageMultiArg } from '@polkadot/api/types';
|
||||
import type { ApiInterfaceRx, QueryableStorageEntry } 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 { DeriveBalancesAccount, DeriveBalancesAccountData } from '../types';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { assert, isFunction } from '@polkadot/util';
|
||||
import { isFunction } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
@@ -39,15 +39,11 @@ function getBalance (api: ApiInterfaceRx, [freeBalance, reservedBalance, frozenF
|
||||
};
|
||||
}
|
||||
|
||||
function calcBalances (api: ApiInterfaceRx, [accountId, [accountNonce, balances]]: [AccountId, Result]): DeriveBalancesAccount {
|
||||
const primary = balances[0];
|
||||
|
||||
assert(primary, 'No balances retrieved for account');
|
||||
|
||||
function calcBalances (api: ApiInterfaceRx, [accountId, [accountNonce, [primary, ...additional]]]: [AccountId, Result]): DeriveBalancesAccount {
|
||||
return {
|
||||
accountId,
|
||||
accountNonce,
|
||||
additional: balances.filter((_, index) => index !== 0).map((b) => getBalance(api, b)),
|
||||
additional: additional.map((b) => getBalance(api, b)),
|
||||
...getBalance(api, primary)
|
||||
};
|
||||
}
|
||||
@@ -66,34 +62,44 @@ function queryBalancesFree (api: ApiInterfaceRx, accountId: AccountId): Observab
|
||||
);
|
||||
}
|
||||
|
||||
function querySystemNonce (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
|
||||
return api.query.system.accountNonce<Index>(accountId).pipe(
|
||||
map((accountNonce): Result => [
|
||||
accountNonce,
|
||||
[[zeroBalance(api), zeroBalance(api), zeroBalance(api), zeroBalance(api)]]
|
||||
])
|
||||
);
|
||||
function queryNonceOnly (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
|
||||
const fill = (nonce: Index): Result => [
|
||||
nonce,
|
||||
[[zeroBalance(api), zeroBalance(api), zeroBalance(api), zeroBalance(api)]]
|
||||
];
|
||||
|
||||
return isFunction(api.query.system.account)
|
||||
? api.query.system.account(accountId).pipe(
|
||||
map(({ nonce }) => fill(nonce))
|
||||
)
|
||||
: isFunction(api.query.system.accountNonce)
|
||||
? api.query.system.accountNonce<Index>(accountId).pipe(
|
||||
map((nonce) => fill(nonce))
|
||||
)
|
||||
: of(fill(api.registry.createType('Index')));
|
||||
}
|
||||
|
||||
function queryBalancesAccount (api: ApiInterfaceRx, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
|
||||
const balances = modules.map(
|
||||
(m): QueryableStorageMultiArg<'rxjs'> => [
|
||||
(api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m].account,
|
||||
accountId
|
||||
]
|
||||
);
|
||||
const balances = modules
|
||||
.map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m]?.account)
|
||||
.filter((q) => isFunction(q))
|
||||
.map((q): [QueryableStorageEntry<'rxjs'>, AccountId] => [q, accountId]);
|
||||
|
||||
const extract = (data: AccountData[]) =>
|
||||
data.map(({ feeFrozen, free, miscFrozen, reserved }): BalanceResult => [free, reserved, feeFrozen, miscFrozen]);
|
||||
const extract = (nonce: Index, data: AccountData[]): Result => [
|
||||
nonce,
|
||||
data.map(({ feeFrozen, free, miscFrozen, reserved }): BalanceResult => [free, reserved, feeFrozen, miscFrozen])
|
||||
];
|
||||
|
||||
// NOTE this is for the first case where we do have instances specified
|
||||
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)])
|
||||
);
|
||||
return balances.length
|
||||
? isFunction(api.query.system.account)
|
||||
? api.queryMulti<[AccountInfo, ...(AccountData[])]>([[api.query.system.account, accountId], ...balances]).pipe(
|
||||
map(([{ nonce }, ...balances]) => extract(nonce, balances))
|
||||
)
|
||||
: api.queryMulti<[Index, ...(AccountData[])]>([[api.query.system.accountNonce, accountId], ...balances]).pipe(
|
||||
map(([nonce, ...balances]) => extract(nonce, balances))
|
||||
)
|
||||
: queryNonceOnly(api, accountId);
|
||||
}
|
||||
|
||||
function querySystemAccount (api: ApiInterfaceRx, accountId: AccountId): Observable<Result> {
|
||||
@@ -140,10 +146,6 @@ function querySystemAccount (api: ApiInterfaceRx, accountId: AccountId): Observa
|
||||
*/
|
||||
export function account (instanceId: string, api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAccount> {
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
|
||||
const empty: Result = [
|
||||
api.registry.createType('Index'),
|
||||
[[zeroBalance(api), zeroBalance(api), zeroBalance(api), zeroBalance(api)]]
|
||||
];
|
||||
|
||||
return memo(instanceId, (address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAccount> =>
|
||||
api.derive.accounts.accountId(address).pipe(
|
||||
@@ -159,11 +161,12 @@ export function account (instanceId: string, api: ApiInterfaceRx): (address: Acc
|
||||
? queryBalancesAccount(api, accountId)
|
||||
: isFunction(api.query.balances?.freeBalance)
|
||||
? queryBalancesFree(api, accountId)
|
||||
: isFunction(api.query.system?.accountNonce)
|
||||
? querySystemNonce(api, accountId)
|
||||
: of(empty)
|
||||
: queryNonceOnly(api, accountId)
|
||||
])
|
||||
: of([api.registry.createType('AccountId'), empty])
|
||||
: of([api.registry.createType('AccountId'), [
|
||||
api.registry.createType('Index'),
|
||||
[[zeroBalance(api), zeroBalance(api), zeroBalance(api), zeroBalance(api)]]
|
||||
]])
|
||||
)
|
||||
),
|
||||
map((result): DeriveBalancesAccount => calcBalances(api, result))
|
||||
|
||||
@@ -73,7 +73,8 @@ function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLock
|
||||
// Calculate the vesting balances,
|
||||
// - offset = balance locked at startingBlock
|
||||
// - perBlock is the unlock amount
|
||||
const { locked: vestingTotal, perBlock, startingBlock } = vesting || api.registry.createType('VestingInfo');
|
||||
const emptyVest = api.registry.createType('VestingInfo');
|
||||
const { locked: vestingTotal, perBlock, startingBlock } = vesting || emptyVest;
|
||||
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);
|
||||
@@ -117,33 +118,29 @@ const isNonNullable = <T>(nullable: T): nullable is NonNullable<T> => !!nullable
|
||||
|
||||
// current (balances, vesting)
|
||||
function queryCurrent (api: ApiInterfaceRx, accountId: AccountId, balanceInstances: string[] = ['balances']): Observable<ResultBalance> {
|
||||
const lockCalls = balanceInstances.map(
|
||||
(m): ApiInterfaceRx['query']['balances']['locks'] | undefined =>
|
||||
(api.derive as DeriveCustomLocks)[m]?.customLocks || api.query[m as 'balances']?.locks
|
||||
const calls = balanceInstances.map((m): ApiInterfaceRx['query']['balances']['locks'] | undefined =>
|
||||
(api.derive as DeriveCustomLocks)[m]?.customLocks || api.query[m as 'balances']?.locks
|
||||
);
|
||||
|
||||
const lockEmpty = lockCalls.map((c) => !c);
|
||||
const lockQueries = lockCalls.filter(isNonNullable).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
|
||||
const lockEmpty = calls.map((c) => !c);
|
||||
const queries = calls.filter(isNonNullable).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
|
||||
|
||||
return (
|
||||
api.query.vesting?.vesting
|
||||
? api.queryMulti<[Option<VestingInfo>, ...BalanceLocks]>([
|
||||
[api.query.vesting.vesting, accountId],
|
||||
...lockQueries
|
||||
])
|
||||
? api.queryMulti<[Option<VestingInfo>, ...BalanceLocks]>([[api.query.vesting.vesting, accountId], ...queries])
|
||||
// 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]
|
||||
)
|
||||
: queries.length
|
||||
? api.queryMulti<[...(Vec<BalanceLock>)[]]>(queries).pipe(
|
||||
map((r): [Option<VestingInfo>, ...BalanceLocks] => [api.registry.createType('Option<VestingInfo>'), ...r])
|
||||
)
|
||||
: of([api.registry.createType('Option<VestingInfo>')] as [Option<VestingInfo>])
|
||||
).pipe(
|
||||
map(([optVesting, ...locks]): ResultBalance => {
|
||||
map(([opt, ...locks]): ResultBalance => {
|
||||
let offset = -1;
|
||||
|
||||
return [optVesting.unwrapOr(null), lockEmpty.map((e) => e ? api.registry.createType('Vec<BalanceLock>') : locks[++offset])];
|
||||
return [
|
||||
opt.unwrapOr(null),
|
||||
lockEmpty.map((e) => e ? api.registry.createType('Vec<BalanceLock>') : locks[++offset])
|
||||
];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '5.8.2' };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Option, u32 } from '@polkadot/types';
|
||||
import type { Option, u32, u64 } from '@polkadot/types';
|
||||
import type { BlockNumber, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces';
|
||||
|
||||
export interface DeriveSessionIndexes {
|
||||
@@ -15,7 +15,7 @@ export interface DeriveSessionIndexes {
|
||||
export interface DeriveSessionInfo extends DeriveSessionIndexes {
|
||||
eraLength: BlockNumber;
|
||||
isEpoch: boolean;
|
||||
sessionLength: BlockNumber;
|
||||
sessionLength: u64;
|
||||
sessionsPerEra: SessionIndex;
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
@@ -19,16 +19,16 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api-derive": "5.4.1",
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/rpc-core": "5.4.1",
|
||||
"@polkadot/rpc-provider": "5.4.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/types-known": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api-derive": "5.8.2",
|
||||
"@polkadot/keyring": "^7.3.1",
|
||||
"@polkadot/rpc-core": "5.8.2",
|
||||
"@polkadot/rpc-provider": "5.8.2",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/types-known": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"@polkadot/util-crypto": "^7.3.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.2.0"
|
||||
"rxjs": "^7.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,17 +143,18 @@ declare module '@polkadot/api/types/consts' {
|
||||
* 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.
|
||||
* 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.
|
||||
* 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>;
|
||||
/**
|
||||
@@ -201,11 +202,11 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
cooloffPeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum period of locking and the period between a proposal being approved and enacted.
|
||||
* The period between a proposal being approved and enacted.
|
||||
*
|
||||
* It should generally be a little more than the unstake period to ensure that
|
||||
* voting stakers have an opportunity to remove themselves from the system in the case where
|
||||
* they are on the losing side of a vote.
|
||||
* voting stakers have an opportunity to remove themselves from the system in the case
|
||||
* where they are on the losing side of a vote.
|
||||
**/
|
||||
enactmentPeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -213,9 +214,9 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
fastTrackVotingPeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Indicator for whether an emergency origin is even allowed to happen. Some chains may want
|
||||
* to set this permanently to `false`, others may want to condition it on things such as
|
||||
* an upgrade having happened recently.
|
||||
* Indicator for whether an emergency origin is even allowed to happen. Some chains may
|
||||
* want to set this permanently to `false`, others may want to condition it on things such
|
||||
* as an upgrade having happened recently.
|
||||
**/
|
||||
instantAllowed: bool & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -241,6 +242,13 @@ declare module '@polkadot/api/types/consts' {
|
||||
* The amount of balance that must be deposited per byte of preimage stored.
|
||||
**/
|
||||
preimageByteDeposit: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum period of vote locking.
|
||||
*
|
||||
* It should be no shorter than enactment period to ensure that in the case of an approval,
|
||||
* those successful voters are locked into the consequences that their votes entail.
|
||||
**/
|
||||
voteLockingPeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* How often (in blocks) to check for new votes.
|
||||
**/
|
||||
@@ -449,8 +457,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
maxSubAccounts: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount held on deposit for a registered subaccount. This should account for the fact
|
||||
* that one storage item's value will increase by the size of an account ID, and there will be
|
||||
* another trie item whose value is the size of an account ID plus 32 bytes.
|
||||
* that one storage item's value will increase by the size of an account ID, and there will
|
||||
* be another trie item whose value is the size of an account ID plus 32 bytes.
|
||||
**/
|
||||
subAccountDeposit: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -503,8 +511,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
};
|
||||
multisig: {
|
||||
/**
|
||||
* The base amount of currency needed to reserve for creating a multisig execution or to store
|
||||
* a dispatch call for later.
|
||||
* The base amount of currency needed to reserve for creating a multisig execution or to
|
||||
* store a dispatch call for later.
|
||||
*
|
||||
* This is held for an additional storage item whose value size is
|
||||
* `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is
|
||||
@@ -530,7 +538,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
/**
|
||||
* The base amount of currency needed to reserve for creating an announcement.
|
||||
*
|
||||
* This is held when a new storage item holding a `Balance` is created (typically 16 bytes).
|
||||
* This is held when a new storage item holding a `Balance` is created (typically 16
|
||||
* bytes).
|
||||
**/
|
||||
announcementDepositBase: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -558,9 +567,9 @@ declare module '@polkadot/api/types/consts' {
|
||||
/**
|
||||
* The amount of currency needed per proxy added.
|
||||
*
|
||||
* This is held for adding 32 bytes plus an instance of `ProxyType` more into a pre-existing
|
||||
* storage value. Thus, when configuring `ProxyDepositFactor` one should take into account
|
||||
* `32 + proxy_type.encode().len()` bytes of data.
|
||||
* This is held for adding 32 bytes plus an instance of `ProxyType` more into a
|
||||
* pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
|
||||
* into account `32 + proxy_type.encode().len()` bytes of data.
|
||||
**/
|
||||
proxyDepositFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -577,9 +586,11 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
configDepositBase: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount of currency needed per additional user when creating a recovery configuration.
|
||||
* The amount of currency needed per additional user when creating a recovery
|
||||
* configuration.
|
||||
*
|
||||
* This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage value.
|
||||
* This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage
|
||||
* value.
|
||||
**/
|
||||
friendDepositFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -603,8 +614,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* The maximum weight that may be scheduled per block for any dispatchables of less priority
|
||||
* than `schedule::HARD_DEADLINE`.
|
||||
* The maximum weight that may be scheduled per block for any dispatchables of less
|
||||
* priority than `schedule::HARD_DEADLINE`.
|
||||
**/
|
||||
maximumWeight: Weight & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -666,8 +677,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
/**
|
||||
* The maximum number of nominators rewarded for each validator.
|
||||
*
|
||||
* For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
|
||||
* their reward. This used to limit the i/o cost for the nominator payout.
|
||||
* For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can
|
||||
* claim their reward. This used to limit the i/o cost for the nominator payout.
|
||||
**/
|
||||
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -722,10 +733,10 @@ declare module '@polkadot/api/types/consts' {
|
||||
};
|
||||
timestamp: {
|
||||
/**
|
||||
* The minimum period between blocks. Beware that this is different to the *expected* period
|
||||
* that the block production apparatus provides. Your chosen consensus system will generally
|
||||
* work with this to determine a sensible block time. e.g. For Aura, it will be double this
|
||||
* period on default settings.
|
||||
* The minimum period between blocks. Beware that this is different to the *expected*
|
||||
* period that the block production apparatus provides. Your chosen consensus system will
|
||||
* generally work with this to determine a sensible block time. e.g. For Aura, it will be
|
||||
* double this period on default settings.
|
||||
**/
|
||||
minimumPeriod: Moment & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -843,7 +854,18 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
utility: {
|
||||
/**
|
||||
* The limit on the number of batched calls.
|
||||
**/
|
||||
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
vesting: {
|
||||
maxVestingSchedules: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum amount transferred to call `vested_transfer`.
|
||||
**/
|
||||
|
||||
@@ -39,7 +39,8 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No provider reference exists to allow a non-zero balance of a non-self-sufficient asset.
|
||||
* No provider reference exists to allow a non-zero balance of a non-self-sufficient
|
||||
* asset.
|
||||
**/
|
||||
NoProvider: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -424,10 +425,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* Identity may not veto a proposal twice
|
||||
**/
|
||||
AlreadyVetoed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Unknown index
|
||||
**/
|
||||
BadIndex: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Preimage already noted
|
||||
**/
|
||||
@@ -452,10 +449,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* Invalid hash
|
||||
**/
|
||||
InvalidHash: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The provided witness data is wrong.
|
||||
**/
|
||||
InvalidWitness: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Maximum number of votes reached.
|
||||
**/
|
||||
@@ -476,26 +469,14 @@ declare module '@polkadot/api/types/errors' {
|
||||
* No external proposal
|
||||
**/
|
||||
NoProposal: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not delegated
|
||||
**/
|
||||
NotDelegated: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account is not currently delegating.
|
||||
**/
|
||||
NotDelegating: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The lock on the account to be unlocked has not yet expired.
|
||||
**/
|
||||
NotExpired: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not imminent
|
||||
**/
|
||||
NotImminent: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The target account does not have a lock.
|
||||
**/
|
||||
NotLocked: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Next external proposal not simple majority
|
||||
**/
|
||||
@@ -680,8 +661,8 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
AmountTooSmall: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The queue for the bid's duration is full and the amount bid is too low to get in through
|
||||
* replacing an existing bid.
|
||||
* The queue for the bid's duration is full and the amount bid is too low to get in
|
||||
* through replacing an existing bid.
|
||||
**/
|
||||
BidTooLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1271,8 +1252,8 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
NoUnlockChunk: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There are too many nominators in the system. Governance needs to adjust the staking settings
|
||||
* to keep things safe for the runtime.
|
||||
* There are too many nominators in the system. Governance needs to adjust the staking
|
||||
* settings to keep things safe for the runtime.
|
||||
**/
|
||||
TooManyNominators: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1280,8 +1261,8 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
TooManyTargets: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There are too many validators in the system. Governance needs to adjust the staking settings
|
||||
* to keep things safe for the runtime.
|
||||
* There are too many validators in the system. Governance needs to adjust the staking
|
||||
* settings to keep things safe for the runtime.
|
||||
**/
|
||||
TooManyValidators: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1541,19 +1522,38 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
utility: {
|
||||
/**
|
||||
* Too many calls batched.
|
||||
**/
|
||||
TooManyCalls: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
vesting: {
|
||||
/**
|
||||
* Amount being transferred is too low to create a vesting schedule.
|
||||
**/
|
||||
AmountLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An existing vesting schedule already exists for this account that cannot be clobbered.
|
||||
* The account already has `MaxVestingSchedules` count of schedules and thus
|
||||
* cannot add another one. Consider merging existing schedules in order to add another.
|
||||
**/
|
||||
ExistingVestingSchedule: AugmentedError<ApiType>;
|
||||
AtMaxVestingSchedules: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Failed to create a new schedule because some parameter was invalid.
|
||||
**/
|
||||
InvalidScheduleParams: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account given is not vesting.
|
||||
**/
|
||||
NotVesting: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An index was out of bounds of the vesting schedules.
|
||||
**/
|
||||
ScheduleIndexOutOfBounds: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
|
||||
@@ -204,8 +204,8 @@ declare module '@polkadot/api/types/events' {
|
||||
* # Params
|
||||
*
|
||||
* - `contract`: The contract that emitted the event.
|
||||
* - `data`: Data supplied by the contract. Metadata generated during contract
|
||||
* compilation is needed to decode it.
|
||||
* - `data`: Data supplied by the contract. Metadata generated during contract compilation
|
||||
* is needed to decode it.
|
||||
**/
|
||||
ContractEmitted: AugmentedEvent<ApiType, [AccountId, Bytes]>;
|
||||
/**
|
||||
@@ -362,17 +362,14 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
Started: AugmentedEvent<ApiType, [ReferendumIndex, VoteThreshold]>;
|
||||
/**
|
||||
* A public proposal has been tabled for referendum vote. \[proposal_index, deposit, depositors\]
|
||||
* A public proposal has been tabled for referendum vote. \[proposal_index, deposit,
|
||||
* depositors\]
|
||||
**/
|
||||
Tabled: AugmentedEvent<ApiType, [PropIndex, Balance, Vec<AccountId>]>;
|
||||
/**
|
||||
* An \[account\] has cancelled a previous delegation operation.
|
||||
**/
|
||||
Undelegated: AugmentedEvent<ApiType, [AccountId]>;
|
||||
/**
|
||||
* An \[account\] has been unlocked successfully.
|
||||
**/
|
||||
Unlocked: AugmentedEvent<ApiType, [AccountId]>;
|
||||
/**
|
||||
* An external proposal has been vetoed. \[who, proposal_hash, until\]
|
||||
**/
|
||||
@@ -653,9 +650,14 @@ declare module '@polkadot/api/types/events' {
|
||||
Announced: AugmentedEvent<ApiType, [AccountId, AccountId, Hash]>;
|
||||
/**
|
||||
* Anonymous account has been created by new proxy with given
|
||||
* disambiguation index and proxy type. \[anonymous, who, proxy_type, disambiguation_index\]
|
||||
* disambiguation index and proxy type. \[anonymous, who, proxy_type,
|
||||
* disambiguation_index\]
|
||||
**/
|
||||
AnonymousCreated: AugmentedEvent<ApiType, [AccountId, AccountId, ProxyType, u16]>;
|
||||
/**
|
||||
* A proxy was added. \[delegator, delegatee, proxy_type, delay\]
|
||||
**/
|
||||
ProxyAdded: AugmentedEvent<ApiType, [AccountId, AccountId, ProxyType, BlockNumber]>;
|
||||
/**
|
||||
* A proxy was executed correctly, with the given \[result\].
|
||||
**/
|
||||
@@ -719,8 +721,8 @@ declare module '@polkadot/api/types/events' {
|
||||
};
|
||||
session: {
|
||||
/**
|
||||
* New session has happened. Note that the argument is the \[session_index\], not the block
|
||||
* number as the type might suggest.
|
||||
* New session has happened. Note that the argument is the \[session_index\], not the
|
||||
* block number as the type might suggest.
|
||||
**/
|
||||
NewSession: AugmentedEvent<ApiType, [SessionIndex]>;
|
||||
/**
|
||||
@@ -1129,7 +1131,7 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
Frozen: AugmentedEvent<ApiType, [ClassId, InstanceId]>;
|
||||
/**
|
||||
* An asset `instace` was issued. \[ class, instance, owner \]
|
||||
* An asset `instance` was issued. \[ class, instance, owner \]
|
||||
**/
|
||||
Issued: AugmentedEvent<ApiType, [ClassId, InstanceId, AccountId]>;
|
||||
/**
|
||||
@@ -1158,7 +1160,7 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
Thawed: AugmentedEvent<ApiType, [ClassId, InstanceId]>;
|
||||
/**
|
||||
* An asset `instace` was transferred. \[ class, instance, from, to \]
|
||||
* An asset `instance` was transferred. \[ class, instance, from, to \]
|
||||
**/
|
||||
Transferred: AugmentedEvent<ApiType, [ClassId, InstanceId, AccountId, AccountId]>;
|
||||
/**
|
||||
@@ -1187,12 +1189,12 @@ declare module '@polkadot/api/types/events' {
|
||||
};
|
||||
vesting: {
|
||||
/**
|
||||
* An \[account\] has become fully vested. No further vesting can happen.
|
||||
* An \[account\] has become fully vested.
|
||||
**/
|
||||
VestingCompleted: AugmentedEvent<ApiType, [AccountId]>;
|
||||
/**
|
||||
* The amount vested has been updated. This could indicate more funds are available. The
|
||||
* balance given is the amount which is left unvested (and thus locked).
|
||||
* The amount vested has been updated. This could indicate a change in funds available.
|
||||
* The balance given is the amount which is left unvested (and thus locked).
|
||||
* \[account, unvested\]
|
||||
**/
|
||||
VestingUpdated: AugmentedEvent<ApiType, [AccountId, Balance]>;
|
||||
|
||||
@@ -94,7 +94,8 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
currentSlot: AugmentedQuery<ApiType, () => Observable<Slot>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The configuration for the current epoch. Should never be `None` as it is initialized in genesis.
|
||||
* The configuration for the current epoch. Should never be `None` as it is initialized in
|
||||
* genesis.
|
||||
**/
|
||||
epochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -916,9 +917,9 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
canceledSlashPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The threshold for when users can start calling `chill_other` for other validators / nominators.
|
||||
* The threshold is compared to the actual number of validators / nominators (`CountFor*`) in
|
||||
* the system compared to the configured max (`Max*Count`).
|
||||
* The threshold for when users can start calling `chill_other` for other validators /
|
||||
* nominators. The threshold is compared to the actual number of validators / nominators
|
||||
* (`CountFor*`) in the system compared to the configured max (`Max*Count`).
|
||||
**/
|
||||
chillThreshold: AugmentedQuery<ApiType, () => Observable<Option<Percent>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -1145,6 +1146,9 @@ declare module '@polkadot/api/types/storage' {
|
||||
eventCount: AugmentedQuery<ApiType, () => Observable<EventIndex>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Events deposited for the current block.
|
||||
*
|
||||
* NOTE: This storage item is explicitly unbounded since it is never intended to be read
|
||||
* from within the runtime.
|
||||
**/
|
||||
events: AugmentedQuery<ApiType, () => Observable<Vec<EventRecord>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -1371,10 +1375,16 @@ declare module '@polkadot/api/types/storage' {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
vesting: {
|
||||
/**
|
||||
* Storage version of the pallet.
|
||||
*
|
||||
* New networks start with latest version, as determined by the genesis build.
|
||||
**/
|
||||
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Information regarding the vesting of a given account.
|
||||
**/
|
||||
vesting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<VestingInfo>>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
|
||||
vesting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<Vec<VestingInfo>>>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
|
||||
+106
-73
@@ -211,8 +211,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `id`: The identifier of the new asset. This must not be currently in use to identify
|
||||
* an existing asset.
|
||||
* - `owner`: The owner of this class of assets. The owner has full superuser permissions
|
||||
* over this asset, but may later change and configure the permissions using `transfer_ownership`
|
||||
* and `set_team`.
|
||||
* over this asset, but may later change and configure the permissions using
|
||||
* `transfer_ownership` and `set_team`.
|
||||
* - `min_balance`: The minimum balance of this new asset that any single account must
|
||||
* have. If an account's balance is reduced below this, then it collapses to zero.
|
||||
*
|
||||
@@ -486,8 +486,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Exactly as `transfer`, except the origin must be root and the source account may be
|
||||
* specified.
|
||||
* # <weight>
|
||||
* - Same as transfer, but additional read and write because the source account is
|
||||
* not assumed to be in the overlay.
|
||||
* - Same as transfer, but additional read and write because the source account is not
|
||||
* assumed to be in the overlay.
|
||||
* # </weight>
|
||||
**/
|
||||
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>]>;
|
||||
@@ -523,9 +523,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin for this call must be `Signed` by the transactor.
|
||||
*
|
||||
* # <weight>
|
||||
* - Dependent on arguments but not critical, given proper implementations for
|
||||
* input config types. See related functions below.
|
||||
* - It contains a limited number of reads and writes internally and no complex computation.
|
||||
* - Dependent on arguments but not critical, given proper implementations for input config
|
||||
* types. See related functions below.
|
||||
* - It contains a limited number of reads and writes internally and no complex
|
||||
* computation.
|
||||
*
|
||||
* Related functions:
|
||||
*
|
||||
@@ -533,8 +534,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Transferring balances to accounts that did not exist before will cause
|
||||
* `T::OnNewAccount::on_new_account` to be called.
|
||||
* - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`.
|
||||
* - `transfer_keep_alive` works the same way as `transfer`, but has an additional
|
||||
* check that the transfer will not kill the origin account.
|
||||
* - `transfer_keep_alive` works the same way as `transfer`, but has an additional check
|
||||
* that the transfer will not kill the origin account.
|
||||
* ---------------------------------
|
||||
* - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
|
||||
* - DB Weight: 1 Read and 1 Write to destination account
|
||||
@@ -557,8 +558,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all
|
||||
* of the funds the account has, causing the sender account to be killed (false), or
|
||||
* transfer everything except at least the existential deposit, which will guarantee to
|
||||
* keep the sender account alive (true).
|
||||
* # <weight>
|
||||
* keep the sender account alive (true). # <weight>
|
||||
* - O(1). Just like transfer, but reading the user's transferable balance first.
|
||||
* #</weight>
|
||||
**/
|
||||
@@ -754,7 +754,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Instantiation is executed as follows:
|
||||
*
|
||||
* - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that code.
|
||||
* - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that
|
||||
* code.
|
||||
* - If the `code_hash` already exists on the chain the underlying `code` will be shared.
|
||||
* - The destination address is computed based on the sender, code_hash and the salt.
|
||||
* - The smart-contract account is created at the computed address.
|
||||
@@ -980,8 +981,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `to`: The account whose voting the `target` account's voting power will follow.
|
||||
* - `conviction`: The conviction that will be attached to the delegated votes. When the
|
||||
* account is undelegated, the funds will be locked for the corresponding period.
|
||||
* - `balance`: The amount of the account's balance to be used in delegating. This must
|
||||
* not be more than the account's current balance.
|
||||
* - `balance`: The amount of the account's balance to be used in delegating. This must not
|
||||
* be more than the account's current balance.
|
||||
*
|
||||
* Emits `Delegated`.
|
||||
*
|
||||
@@ -1118,8 +1119,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin of this call must be _Signed_.
|
||||
*
|
||||
* - `proposal_hash`: The preimage hash of a proposal.
|
||||
* - `proposal_length_upper_bound`: an upper bound on length of the proposal.
|
||||
* Extrinsic is weighted according to this value with no refund.
|
||||
* - `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is
|
||||
* weighted according to this value with no refund.
|
||||
*
|
||||
* This will only work after `VotingPeriod` blocks from the time that the preimage was
|
||||
* noted, if it's the same account doing it. If it's a different account, then it'll only
|
||||
@@ -1280,7 +1281,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Queue size must be provided as witness data.
|
||||
* # </weight>
|
||||
**/
|
||||
submit: AugmentedSubmittable<(solution: RawSolution | { compact?: any; score?: any; round?: any } | string | Uint8Array, numSignedSubmissions: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [RawSolution, u32]>;
|
||||
submit: AugmentedSubmittable<(rawSolution: RawSolution | { compact?: any; score?: any; round?: any } | string | Uint8Array, numSignedSubmissions: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [RawSolution, u32]>;
|
||||
/**
|
||||
* Submit a solution for the unsigned phase.
|
||||
*
|
||||
@@ -1297,7 +1298,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* No deposit or reward is associated with this submission.
|
||||
**/
|
||||
submitUnsigned: AugmentedSubmittable<(solution: RawSolution | { compact?: any; score?: any; round?: any } | string | Uint8Array, witness: SolutionOrSnapshotSize | { voters?: any; targets?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RawSolution, SolutionOrSnapshotSize]>;
|
||||
submitUnsigned: AugmentedSubmittable<(rawSolution: RawSolution | { compact?: any; score?: any; round?: any } | string | Uint8Array, witness: SolutionOrSnapshotSize | { voters?: any; targets?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RawSolution, SolutionOrSnapshotSize]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -1352,9 +1353,9 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* origin is removed as a runner-up.
|
||||
* - `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_member`](Self::remove_member), if replacement runners exists,
|
||||
* they are immediately used. If the prime is renouncing, then no prime will exist until
|
||||
* the next round.
|
||||
* Similar to [`remove_member`](Self::remove_member), 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.
|
||||
*
|
||||
@@ -1768,8 +1769,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
imOnline: {
|
||||
/**
|
||||
* # <weight>
|
||||
* - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len)
|
||||
* and E is length of `heartbeat.network_state.external_address`
|
||||
* - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is
|
||||
* length of `heartbeat.network_state.external_address`
|
||||
* - `O(K)`: decoding of length `K`
|
||||
* - `O(E)`: decoding/encoding of length `E`
|
||||
* - DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,
|
||||
@@ -1851,7 +1852,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
free: AugmentedSubmittable<(index: AccountIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountIndex]>;
|
||||
/**
|
||||
* Freeze an index so it will always point to the sender account. This consumes the deposit.
|
||||
* Freeze an index so it will always point to the sender account. This consumes the
|
||||
* deposit.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and the signing account must have a
|
||||
* non-frozen account `index`.
|
||||
@@ -1977,9 +1979,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Up to one binary search and insert (`O(logS + S)`).
|
||||
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
|
||||
* - One event.
|
||||
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
|
||||
* deposit taken for its lifetime of
|
||||
* `DepositBase + threshold * DepositFactor`.
|
||||
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit
|
||||
* taken for its lifetime of `DepositBase + threshold * DepositFactor`.
|
||||
* ----------------------------------
|
||||
* - DB Weight:
|
||||
* - Read: Multisig Storage, [Caller Account]
|
||||
@@ -2025,9 +2026,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.
|
||||
* - One event.
|
||||
* - The weight of the `call`.
|
||||
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a
|
||||
* deposit taken for its lifetime of
|
||||
* `DepositBase + threshold * DepositFactor`.
|
||||
* - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit
|
||||
* taken for its lifetime of `DepositBase + threshold * DepositFactor`.
|
||||
* -------------------------------
|
||||
* - DB Weight:
|
||||
* - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)
|
||||
@@ -2326,8 +2326,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* `threshold` or more vouches, waited `delay_period` blocks since initiation.
|
||||
*
|
||||
* Parameters:
|
||||
* - `account`: The lost account that you want to claim has been successfully
|
||||
* recovered by you.
|
||||
* - `account`: The lost account that you want to claim has been successfully recovered by
|
||||
* you.
|
||||
*
|
||||
* # <weight>
|
||||
* Key: F (len of friends in config), V (len of vouching friends)
|
||||
@@ -2374,13 +2374,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
* Parameters:
|
||||
* - `friends`: A list of friends you trust to vouch for recovery attempts.
|
||||
* Should be ordered and contain no duplicate values.
|
||||
* - `threshold`: The number of friends that must vouch for a recovery attempt
|
||||
* before the account can be recovered. Should be less than or equal to
|
||||
* the length of the list of friends.
|
||||
* - `delay_period`: The number of blocks after a recovery attempt is initialized
|
||||
* that needs to pass before the account can be recovered.
|
||||
* - `friends`: A list of friends you trust to vouch for recovery attempts. Should be
|
||||
* ordered and contain no duplicate values.
|
||||
* - `threshold`: The number of friends that must vouch for a recovery attempt before the
|
||||
* account can be recovered. Should be less than or equal to the length of the list of
|
||||
* friends.
|
||||
* - `delay_period`: The number of blocks after a recovery attempt is initialized that
|
||||
* needs to pass before the account can be recovered.
|
||||
*
|
||||
* # <weight>
|
||||
* - Key: F (len of friends)
|
||||
@@ -2404,8 +2404,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
* Parameters:
|
||||
* - `account`: The lost account that you want to recover. This account
|
||||
* needs to be recoverable (i.e. have a recovery configuration).
|
||||
* - `account`: The lost account that you want to recover. This account needs to be
|
||||
* recoverable (i.e. have a recovery configuration).
|
||||
*
|
||||
* # <weight>
|
||||
* - One storage read to check that account is recoverable. O(F)
|
||||
@@ -2468,8 +2468,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Parameters:
|
||||
* - `lost`: The lost account that you want to recover.
|
||||
* - `rescuer`: The account trying to rescue the lost account that you
|
||||
* want to vouch for.
|
||||
* - `rescuer`: The account trying to rescue the lost account that you want to vouch for.
|
||||
*
|
||||
* The combination of these two parameters must point to an active recovery
|
||||
* process.
|
||||
@@ -2955,8 +2954,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin for this call must be _Signed_ by the stash, not the controller.
|
||||
*
|
||||
* Use this if there are additional funds in your stash account that you wish to bond.
|
||||
* Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose any limitation
|
||||
* on the amount that can be added.
|
||||
* Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose
|
||||
* any limitation on the amount that can be added.
|
||||
*
|
||||
* Emits `Bonded`.
|
||||
*
|
||||
@@ -3082,8 +3081,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # <weight>
|
||||
* O(S) where S is the number of slashing spans to be removed
|
||||
* Reads: Bonded, Slashing Spans, Account, Locks
|
||||
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Account, Locks
|
||||
* Writes Each: SpanSlash * S
|
||||
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Account, Locks Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
**/
|
||||
forceUnstake: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, u32]>;
|
||||
@@ -3162,7 +3161,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Complexity: O(S) where S is the number of slashing spans on the account.
|
||||
* DB Weight:
|
||||
* - Reads: Stash Account, Bonded, Slashing Spans, Locks
|
||||
* - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Stash Account, Locks
|
||||
* - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Stash Account, Locks
|
||||
* - Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -3214,10 +3214,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Parameters:
|
||||
* - `new_history_depth`: The new history depth you would like to set.
|
||||
* - `era_items_deleted`: The number of items that will be deleted by this dispatch.
|
||||
* This should report all the storage items that will be deleted by clearing old
|
||||
* era history. Needed to report an accurate weight for the dispatch. Trusted by
|
||||
* `Root` to report an accurate number.
|
||||
* - `era_items_deleted`: The number of items that will be deleted by this dispatch. This
|
||||
* should report all the storage items that will be deleted by clearing old era history.
|
||||
* Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an
|
||||
* accurate number.
|
||||
*
|
||||
* Origin must be root.
|
||||
*
|
||||
@@ -3228,7 +3228,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Reads: Current Era, History Depth
|
||||
* - Writes: History Depth
|
||||
* - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs
|
||||
* - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake, ErasStartSessionIndex
|
||||
* - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,
|
||||
* ErasStartSessionIndex
|
||||
* # </weight>
|
||||
**/
|
||||
setHistoryDepth: AugmentedSubmittable<(newHistoryDepth: Compact<EraIndex> | AnyNumber | Uint8Array, eraItemsDeleted: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<EraIndex>, Compact<u32>]>;
|
||||
@@ -3267,10 +3268,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* * `min_nominator_bond`: The minimum active bond needed to be a nominator.
|
||||
* * `min_validator_bond`: The minimum active bond needed to be a validator.
|
||||
* * `max_nominator_count`: The max number of users who can be a nominator at once.
|
||||
* When set to `None`, no limit is enforced.
|
||||
* * `max_validator_count`: The max number of users who can be a validator at once.
|
||||
* When set to `None`, no limit is enforced.
|
||||
* * `max_nominator_count`: The max number of users who can be a nominator at once. When
|
||||
* set to `None`, no limit is enforced.
|
||||
* * `max_validator_count`: The max number of users who can be a validator at once. When
|
||||
* set to `None`, no limit is enforced.
|
||||
*
|
||||
* Origin must be Root to call this function.
|
||||
*
|
||||
@@ -3344,7 +3345,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
};
|
||||
sudo: {
|
||||
/**
|
||||
* Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.
|
||||
* Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo
|
||||
* key.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
@@ -3466,10 +3468,11 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # <weight>
|
||||
* - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`
|
||||
* - 1 storage write (codec `O(C)`).
|
||||
* - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is expensive).
|
||||
* - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is
|
||||
* expensive).
|
||||
* - 1 event.
|
||||
* The weight of this function is dependent on the runtime, but generally this is very expensive.
|
||||
* We will treat this as a full block.
|
||||
* The weight of this function is dependent on the runtime, but generally this is very
|
||||
* expensive. We will treat this as a full block.
|
||||
* # </weight>
|
||||
**/
|
||||
setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
@@ -3480,8 +3483,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `O(C)` where `C` length of `code`
|
||||
* - 1 storage write (codec `O(C)`).
|
||||
* - 1 event.
|
||||
* The weight of this function is dependent on the runtime. We will treat this as a full block.
|
||||
* # </weight>
|
||||
* The weight of this function is dependent on the runtime. We will treat this as a full
|
||||
* block. # </weight>
|
||||
**/
|
||||
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
@@ -3720,7 +3723,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)
|
||||
* - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in `on_finalize`)
|
||||
* - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in
|
||||
* `on_finalize`)
|
||||
* - 1 event handler `on_timestamp_set`. Must be `O(1)`.
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -3873,7 +3877,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Check storage proof for block number `block_number() - StoragePeriod`.
|
||||
* If such block does not exist the proof is expected to be `None`.
|
||||
* # <weight>
|
||||
* - Linear w.r.t the number of indexed transactions in the proved block for random probing.
|
||||
* - Linear w.r.t the number of indexed transactions in the proved block for random
|
||||
* probing.
|
||||
* There's a DB read for each transaction.
|
||||
* Here we assume a maximum of 100 probed transactions.
|
||||
* # </weight>
|
||||
@@ -3890,9 +3895,9 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
renew: AugmentedSubmittable<(block: BlockNumber | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [BlockNumber, u32]>;
|
||||
/**
|
||||
* Index and store data on chain. Minimum data size is 1 bytes, maximum is `MaxTransactionSize`.
|
||||
* Data will be removed after `STORAGE_PERIOD` blocks, unless `renew` is called.
|
||||
* # <weight>
|
||||
* Index and store data on chain. Minimum data size is 1 bytes, maximum is
|
||||
* `MaxTransactionSize`. Data will be removed after `STORAGE_PERIOD` blocks, unless `renew`
|
||||
* is called. # <weight>
|
||||
* - n*log(n) of data size, as all data is pushed to an in-memory trie.
|
||||
* Additionally contains a DB write.
|
||||
* # </weight>
|
||||
@@ -4339,7 +4344,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* May be called from any origin.
|
||||
*
|
||||
* - `calls`: The calls to be dispatched from the same origin.
|
||||
* - `calls`: The calls to be dispatched from the same origin. The number of call must not
|
||||
* exceed the constant: `batched_calls_limit` (available in constant metadata).
|
||||
*
|
||||
* If origin is root then call are dispatch without checking origin filter. (This includes
|
||||
* bypassing `frame_system::Config::BaseCallFilter`).
|
||||
@@ -4361,7 +4367,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* May be called from any origin.
|
||||
*
|
||||
* - `calls`: The calls to be dispatched from the same origin.
|
||||
* - `calls`: The calls to be dispatched from the same origin. The number of call must not
|
||||
* exceed the constant: `batched_calls_limit` (available in constant metadata).
|
||||
*
|
||||
* If origin is root then call are dispatch without checking origin filter. (This includes
|
||||
* bypassing `frame_system::Config::BaseCallFilter`).
|
||||
@@ -4384,11 +4391,12 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* - `source`: The account whose funds should be transferred.
|
||||
* - `target`: The account that should be transferred the vested funds.
|
||||
* - `amount`: The amount of funds to transfer and will be vested.
|
||||
* - `schedule`: The vesting schedule attached to the transfer.
|
||||
*
|
||||
* Emits `VestingCreated`.
|
||||
*
|
||||
* NOTE: This will unlock all schedules through the current block.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)`.
|
||||
* - DbWeight: 4 Reads, 4 Writes
|
||||
@@ -4397,6 +4405,30 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # </weight>
|
||||
**/
|
||||
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]>;
|
||||
/**
|
||||
* Merge two vesting schedules together, creating a new vesting schedule that unlocks over
|
||||
* the highest possible start and end blocks. If both schedules have already started the
|
||||
* current block will be used as the schedule start; with the caveat that if one schedule
|
||||
* is finished by the current block, the other will be treated as the new merged schedule,
|
||||
* unmodified.
|
||||
*
|
||||
* NOTE: If `schedule1_index == schedule2_index` this is a no-op.
|
||||
* NOTE: This will unlock all schedules through the current block prior to merging.
|
||||
* NOTE: If both schedules have ended by the current block, no new schedule will be created
|
||||
* and both will be removed.
|
||||
*
|
||||
* Merged schedule attributes:
|
||||
* - `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,
|
||||
* current_block)`.
|
||||
* - `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`.
|
||||
* - `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
* - `schedule1_index`: index of the first schedule to merge.
|
||||
* - `schedule2_index`: index of the second schedule to merge.
|
||||
**/
|
||||
mergeSchedules: AugmentedSubmittable<(schedule1Index: u32 | AnyNumber | Uint8Array, schedule2Index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Unlock any vested funds of the sender account.
|
||||
*
|
||||
@@ -4418,12 +4450,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
* - `target`: The account that should be transferred the vested funds.
|
||||
* - `amount`: The amount of funds to transfer and will be vested.
|
||||
* - `target`: The account receiving the vested funds.
|
||||
* - `schedule`: The vesting schedule attached to the transfer.
|
||||
*
|
||||
* Emits `VestingCreated`.
|
||||
*
|
||||
* NOTE: This will unlock all schedules through the current block.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)`.
|
||||
* - DbWeight: 3 Reads, 3 Writes
|
||||
|
||||
@@ -332,6 +332,15 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
return true;
|
||||
}
|
||||
|
||||
private _subscribeHealth (): void {
|
||||
// Only enable the health keepalive on WS, not needed on HTTP
|
||||
this.#healthTimer = this.hasSubscriptions
|
||||
? setInterval((): void => {
|
||||
firstValueFrom(this._rpcCore.system.health()).catch(() => undefined);
|
||||
}, KEEPALIVE_INTERVAL)
|
||||
: null;
|
||||
}
|
||||
|
||||
private _unsubscribeHealth (): void {
|
||||
if (this.#healthTimer) {
|
||||
clearInterval(this.#healthTimer);
|
||||
@@ -363,15 +372,13 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
: cryptoWaitReady()
|
||||
]);
|
||||
|
||||
this._subscribeHealth();
|
||||
|
||||
if (hasMeta && !this._isReady && cryptoReady) {
|
||||
this._isReady = true;
|
||||
|
||||
this.emit('ready', this);
|
||||
}
|
||||
|
||||
this.#healthTimer = setInterval((): void => {
|
||||
firstValueFrom(this._rpcCore.system.health()).catch(() => undefined);
|
||||
}, KEEPALIVE_INTERVAL);
|
||||
} catch (_error) {
|
||||
const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`);
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ function types (api: ApiPromise): void {
|
||||
}
|
||||
|
||||
async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
// transfer, also allows for BigInt inputs here
|
||||
// transfer, also allows for bigint inputs here
|
||||
const transfer = api.tx.balances.transfer(pairs.bob.address, 123456789n);
|
||||
|
||||
console.log('transfer casted', transfer as IMethod<AnyTuple>, transfer as IExtrinsic<AnyTuple>);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', version: '5.8.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-core",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
@@ -19,13 +19,13 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/rpc-provider": "5.4.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"rxjs": "^7.2.0"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/rpc-provider": "5.8.2",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"rxjs": "^7.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^7.1.1"
|
||||
"@polkadot/keyring": "^7.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ export class RpcCore {
|
||||
|
||||
subscriptionPromise = this._createSubscriber({ paramsJson, subName, subType, update }, errorHandler);
|
||||
} catch (error) {
|
||||
errorHandler(error);
|
||||
errorHandler(error as Error);
|
||||
}
|
||||
|
||||
// Teardown logic
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '5.8.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-provider",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
@@ -19,19 +19,19 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"@polkadot/x-fetch": "^7.1.1",
|
||||
"@polkadot/x-global": "^7.1.1",
|
||||
"@polkadot/x-ws": "^7.1.1",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"@polkadot/util-crypto": "^7.3.1",
|
||||
"@polkadot/x-fetch": "^7.3.1",
|
||||
"@polkadot/x-global": "^7.3.1",
|
||||
"@polkadot/x-ws": "^7.3.1",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/keyring": "^7.3.1",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.1.1"
|
||||
"nock": "^13.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '5.8.2' };
|
||||
|
||||
@@ -418,7 +418,7 @@ export class WsProvider implements ProviderInterface {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
handler.callback(error, undefined);
|
||||
handler.callback(error as Error, undefined);
|
||||
}
|
||||
|
||||
delete this.#handlers[response.id];
|
||||
@@ -446,7 +446,7 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
handler.callback(null, result);
|
||||
} catch (error) {
|
||||
handler.callback(error, undefined);
|
||||
handler.callback(error as Error, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ interface ReplyDef {
|
||||
};
|
||||
}
|
||||
|
||||
global.WebSocket = WebSocket;
|
||||
global.WebSocket = WebSocket as typeof global.WebSocket;
|
||||
|
||||
export const TEST_WS_URL = 'ws://localhost:9955';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/typegen",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
@@ -26,17 +26,17 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@babel/register": "^7.14.5",
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api": "5.4.1",
|
||||
"@polkadot/rpc-provider": "5.4.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/types-support": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/register": "^7.15.3",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "5.8.2",
|
||||
"@polkadot/rpc-provider": "5.8.2",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/types-support": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.0.1"
|
||||
"yargs": "^17.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.4",
|
||||
|
||||
@@ -54,7 +54,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
const keys = (sub as TypeDef[]).map((def, index): string => {
|
||||
const { info, name = `unknown${index}`, type } = def;
|
||||
const getter = stringUpperFirst(stringCamelCase(name.replace(' ', '_')));
|
||||
const isComplex = [TypeDefInfo.Struct, TypeDefInfo.Tuple, TypeDefInfo.Vec, TypeDefInfo.VecFixed].includes(info);
|
||||
const isComplex = [TypeDefInfo.Result, TypeDefInfo.Struct, TypeDefInfo.Tuple, TypeDefInfo.Vec, TypeDefInfo.VecFixed].includes(info);
|
||||
const asGetter = type === 'Null' || info === TypeDefInfo.DoNotConstruct
|
||||
? ''
|
||||
: createGetter(definitions, `as${getter}`, isComplex ? formatType(registry, definitions, info === TypeDefInfo.Struct ? def : type, imports) : type, imports);
|
||||
@@ -65,6 +65,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
switch (info) {
|
||||
case TypeDefInfo.Compact:
|
||||
case TypeDefInfo.Plain:
|
||||
case TypeDefInfo.Result:
|
||||
case TypeDefInfo.Struct:
|
||||
case TypeDefInfo.Tuple:
|
||||
case TypeDefInfo.Vec:
|
||||
@@ -76,7 +77,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
return '';
|
||||
|
||||
default:
|
||||
throw new Error(`Enum: ${enumName || 'undefined'}: Unhandled type ${TypeDefInfo[info]}`);
|
||||
throw new Error(`Enum: ${enumName || 'undefined'}: Unhandled nested "${TypeDefInfo[info]}" type`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -189,6 +190,7 @@ const encoders: Record<TypeDefInfo, (registry: Registry, definitions: Record<str
|
||||
[TypeDefInfo.Null]: errorUnhandled,
|
||||
[TypeDefInfo.Option]: tsOption,
|
||||
[TypeDefInfo.Plain]: tsPlain,
|
||||
[TypeDefInfo.Range]: errorUnhandled,
|
||||
[TypeDefInfo.Result]: tsResult,
|
||||
[TypeDefInfo.Set]: tsSet,
|
||||
[TypeDefInfo.Si]: tsSi,
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '5.8.2' };
|
||||
|
||||
@@ -129,6 +129,9 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
|
||||
return typeDef.type;
|
||||
},
|
||||
[TypeDefInfo.Range]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Range: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Set: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types-known",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Known type definitions",
|
||||
"main": "index.js",
|
||||
@@ -19,9 +19,9 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/networks": "^7.1.1",
|
||||
"@polkadot/types": "5.4.1",
|
||||
"@polkadot/util": "^7.1.1"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/networks": "^7.3.1",
|
||||
"@polkadot/types": "5.8.2",
|
||||
"@polkadot/util": "^7.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export function getSpecExtensions ({ knownTypes }: Registry, chainName: Text | s
|
||||
/**
|
||||
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
||||
*/
|
||||
export function getSpecTypes ({ knownTypes }: Registry, chainName: Text | string, specName: Text | string, specVersion: BigInt | BN | number): RegistryTypes {
|
||||
export function getSpecTypes ({ knownTypes }: Registry, chainName: Text | string, specName: Text | string, specVersion: bigint | BN | number): RegistryTypes {
|
||||
const _chainName = chainName.toString();
|
||||
const _specName = specName.toString();
|
||||
const _specVersion = bnToBn(specVersion).toNumber();
|
||||
|
||||
@@ -48,6 +48,15 @@ const typesModules: Record<string, OverrideModuleType> = {
|
||||
inclusion: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
paraInclusion: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
paraScheduler: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
paraShared: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
parachains: {
|
||||
Id: 'ParaId'
|
||||
},
|
||||
@@ -81,6 +90,12 @@ const typesModules: Record<string, OverrideModuleType> = {
|
||||
},
|
||||
treasury: {
|
||||
Proposal: 'TreasuryProposal'
|
||||
},
|
||||
xcm: {
|
||||
AssetId: 'XcmAssetId'
|
||||
},
|
||||
xcmPallet: {
|
||||
AssetId: 'XcmAssetId'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '5.8.2' };
|
||||
|
||||
@@ -10,7 +10,7 @@ const sharedTypes = {
|
||||
RawSolution: 'RawSolutionWith24',
|
||||
Keys: 'SessionKeys6',
|
||||
ProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction']
|
||||
}
|
||||
};
|
||||
|
||||
@@ -192,7 +192,13 @@ const versioned: OverrideVersionedType[] = [
|
||||
{
|
||||
minmax: [9010, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
...sharedTypes,
|
||||
AssetInstance: 'AssetInstanceV0',
|
||||
MultiAsset: 'MultiAssetV0',
|
||||
MultiLocation: 'MultiLocationV0',
|
||||
Response: 'ResponseV0',
|
||||
Xcm: 'XcmV0',
|
||||
XcmOrder: 'XcmOrderV0'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -40,7 +40,12 @@ const versioned: OverrideVersionedType[] = [
|
||||
{
|
||||
minmax: [229, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
...sharedTypes,
|
||||
AssetInstance: 'AssetInstanceV0',
|
||||
MultiAsset: 'MultiAssetV0',
|
||||
Response: 'ResponseV0',
|
||||
Xcm: 'XcmV0',
|
||||
XcmOrder: 'XcmOrderV0'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
// these are override types for Polkadot
|
||||
// these are override types for Statemine, Statemint, Westmint
|
||||
const versioned: OverrideVersionedType[] = [
|
||||
{
|
||||
minmax: [0, undefined],
|
||||
@@ -21,7 +21,12 @@ const versioned: OverrideVersionedType[] = [
|
||||
'AssetManager',
|
||||
'Staking'
|
||||
]
|
||||
}
|
||||
},
|
||||
AssetInstance: 'AssetInstanceV0',
|
||||
MultiAsset: 'MultiAssetV0',
|
||||
Response: 'ResponseV0',
|
||||
Xcm: 'XcmV0',
|
||||
XcmOrder: 'XcmOrderV0'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -91,7 +91,12 @@ const versioned: OverrideVersionedType[] = [
|
||||
{
|
||||
minmax: [50, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
...sharedTypes,
|
||||
AssetInstance: 'AssetInstanceV0',
|
||||
MultiAsset: 'MultiAssetV0',
|
||||
Response: 'ResponseV0',
|
||||
Xcm: 'XcmV0',
|
||||
XcmOrder: 'XcmOrderV0'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -13,7 +13,7 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
|
||||
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
|
||||
[6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010], [7668600, 9030],
|
||||
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080]
|
||||
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -8,7 +8,8 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[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], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050]
|
||||
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
|
||||
[6321619, 9080]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -11,7 +11,7 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
||||
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
|
||||
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
|
||||
[6379314, 9080]
|
||||
[6379314, 9080], [6979141, 9090]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types-support",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Supporting files for types, mostly for testing",
|
||||
"main": "index.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-support#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/util": "^7.1.1"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/util": "^7.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
## extraction
|
||||
|
||||
For Substrate & Polkadot (dev chains) -
|
||||
|
||||
`cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev`
|
||||
|
||||
For Kusama -
|
||||
|
||||
`cargo run --release -- purge-chain -y --chain kusama-dev && cargo run --release -- --chain kusama-dev`
|
||||
|
||||
To retrieve the metadata -
|
||||
|
||||
`curl -H "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "state_getMetadata", "params":[]}' http://localhost:9933`
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -130,7 +130,10 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" Events deposited for the current block."
|
||||
" Events deposited for the current block.",
|
||||
"",
|
||||
" NOTE: This storage item is explicitly unbounded since it is never intended to be read",
|
||||
" from within the runtime."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -278,10 +281,11 @@
|
||||
" # <weight>",
|
||||
" - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`",
|
||||
" - 1 storage write (codec `O(C)`).",
|
||||
" - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is expensive).",
|
||||
" - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is",
|
||||
" expensive).",
|
||||
" - 1 event.",
|
||||
" The weight of this function is dependent on the runtime, but generally this is very expensive.",
|
||||
" We will treat this as a full block.",
|
||||
" The weight of this function is dependent on the runtime, but generally this is very",
|
||||
" expensive. We will treat this as a full block.",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -300,8 +304,8 @@
|
||||
" - `O(C)` where `C` length of `code`",
|
||||
" - 1 storage write (codec `O(C)`).",
|
||||
" - 1 event.",
|
||||
" The weight of this function is dependent on the runtime. We will treat this as a full block.",
|
||||
" # </weight>"
|
||||
" The weight of this function is dependent on the runtime. We will treat this as a full",
|
||||
" block. # </weight>"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -499,7 +503,7 @@
|
||||
{
|
||||
"name": "Version",
|
||||
"type": "RuntimeVersion",
|
||||
"value": "0x20706f6c6b61646f743c7061726974792d706f6c6b61646f7400000000822300000000000038df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a05000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0100000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a80100000007000000",
|
||||
"value": "0x20706f6c6b61646f743c7061726974792d706f6c6b61646f74000000008c2300000000000038df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a05000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0100000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a80100000007000000",
|
||||
"docs": [
|
||||
" Get the chain's current version."
|
||||
]
|
||||
@@ -824,8 +828,8 @@
|
||||
"type": "Weight",
|
||||
"value": "0x00806e8774010000",
|
||||
"docs": [
|
||||
" The maximum weight that may be scheduled per block for any dispatchables of less priority",
|
||||
" than `schedule::HARD_DEADLINE`."
|
||||
" The maximum weight that may be scheduled per block for any dispatchables of less",
|
||||
" priority than `schedule::HARD_DEADLINE`."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1068,7 +1072,8 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" The configuration for the current epoch. Should never be `None` as it is initialized in genesis."
|
||||
" The configuration for the current epoch. Should never be `None` as it is initialized in",
|
||||
" genesis."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1242,7 +1247,8 @@
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)",
|
||||
" - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in `on_finalize`)",
|
||||
" - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in",
|
||||
" `on_finalize`)",
|
||||
" - 1 event handler `on_timestamp_set`. Must be `O(1)`.",
|
||||
" # </weight>"
|
||||
]
|
||||
@@ -1255,10 +1261,10 @@
|
||||
"type": "Moment",
|
||||
"value": "0xb80b000000000000",
|
||||
"docs": [
|
||||
" The minimum period between blocks. Beware that this is different to the *expected* period",
|
||||
" that the block production apparatus provides. Your chosen consensus system will generally",
|
||||
" work with this to determine a sensible block time. e.g. For Aura, it will be double this",
|
||||
" period on default settings."
|
||||
" The minimum period between blocks. Beware that this is different to the *expected*",
|
||||
" period that the block production apparatus provides. Your chosen consensus system will",
|
||||
" generally work with this to determine a sensible block time. e.g. For Aura, it will be",
|
||||
" double this period on default settings."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -1431,7 +1437,8 @@
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Freeze an index so it will always point to the sender account. This consumes the deposit.",
|
||||
" Freeze an index so it will always point to the sender account. This consumes the",
|
||||
" deposit.",
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_ and the signing account must have a",
|
||||
" non-frozen account `index`.",
|
||||
@@ -1632,18 +1639,19 @@
|
||||
" The dispatch origin for this call must be `Signed` by the transactor.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - Dependent on arguments but not critical, given proper implementations for",
|
||||
" input config types. See related functions below.",
|
||||
" - It contains a limited number of reads and writes internally and no complex computation.",
|
||||
" - Dependent on arguments but not critical, given proper implementations for input config",
|
||||
" types. See related functions below.",
|
||||
" - It contains a limited number of reads and writes internally and no complex",
|
||||
" computation.",
|
||||
"",
|
||||
" Related functions:",
|
||||
"",
|
||||
" - `ensure_can_withdraw` is always called internally but has a bounded complexity.",
|
||||
" - Transferring balances to accounts that did not exist before will cause",
|
||||
" `T::OnNewAccount::on_new_account` to be called.",
|
||||
" `T::OnNewAccount::on_new_account` to be called.",
|
||||
" - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`.",
|
||||
" - `transfer_keep_alive` works the same way as `transfer`, but has an additional",
|
||||
" check that the transfer will not kill the origin account.",
|
||||
" - `transfer_keep_alive` works the same way as `transfer`, but has an additional check",
|
||||
" that the transfer will not kill the origin account.",
|
||||
" ---------------------------------",
|
||||
" - Base Weight: 73.64 µs, worst case scenario (account created, account removed)",
|
||||
" - DB Weight: 1 Read and 1 Write to destination account",
|
||||
@@ -1708,8 +1716,8 @@
|
||||
" Exactly as `transfer`, except the origin must be root and the source account may be",
|
||||
" specified.",
|
||||
" # <weight>",
|
||||
" - Same as transfer, but additional read and write because the source account is",
|
||||
" not assumed to be in the overlay.",
|
||||
" - Same as transfer, but additional read and write because the source account is not",
|
||||
" assumed to be in the overlay.",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -1766,8 +1774,7 @@
|
||||
" - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all",
|
||||
" of the funds the account has, causing the sender account to be killed (false), or",
|
||||
" transfer everything except at least the existential deposit, which will guarantee to",
|
||||
" keep the sender account alive (true).",
|
||||
" # <weight>",
|
||||
" keep the sender account alive (true). # <weight>",
|
||||
" - O(1). Just like transfer, but reading the user's transferable balance first.",
|
||||
" #</weight>"
|
||||
]
|
||||
@@ -2662,9 +2669,9 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" The threshold for when users can start calling `chill_other` for other validators / nominators.",
|
||||
" The threshold is compared to the actual number of validators / nominators (`CountFor*`) in",
|
||||
" the system compared to the configured max (`Max*Count`)."
|
||||
" The threshold for when users can start calling `chill_other` for other validators /",
|
||||
" nominators. The threshold is compared to the actual number of validators / nominators",
|
||||
" (`CountFor*`) in the system compared to the configured max (`Max*Count`)."
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -2721,8 +2728,8 @@
|
||||
" The dispatch origin for this call must be _Signed_ by the stash, not the controller.",
|
||||
"",
|
||||
" Use this if there are additional funds in your stash account that you wish to bond.",
|
||||
" Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose any limitation",
|
||||
" on the amount that can be added.",
|
||||
" Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose",
|
||||
" any limitation on the amount that can be added.",
|
||||
"",
|
||||
" Emits `Bonded`.",
|
||||
"",
|
||||
@@ -3034,8 +3041,8 @@
|
||||
" # <weight>",
|
||||
" O(S) where S is the number of slashing spans to be removed",
|
||||
" Reads: Bonded, Slashing Spans, Account, Locks",
|
||||
" Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Account, Locks",
|
||||
" Writes Each: SpanSlash * S",
|
||||
" Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,",
|
||||
" Account, Locks Writes Each: SpanSlash * S",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -3161,10 +3168,10 @@
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `new_history_depth`: The new history depth you would like to set.",
|
||||
" - `era_items_deleted`: The number of items that will be deleted by this dispatch.",
|
||||
" This should report all the storage items that will be deleted by clearing old",
|
||||
" era history. Needed to report an accurate weight for the dispatch. Trusted by",
|
||||
" `Root` to report an accurate number.",
|
||||
" - `era_items_deleted`: The number of items that will be deleted by this dispatch. This",
|
||||
" should report all the storage items that will be deleted by clearing old era history.",
|
||||
" Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an",
|
||||
" accurate number.",
|
||||
"",
|
||||
" Origin must be root.",
|
||||
"",
|
||||
@@ -3175,7 +3182,8 @@
|
||||
" - Reads: Current Era, History Depth",
|
||||
" - Writes: History Depth",
|
||||
" - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs",
|
||||
" - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake, ErasStartSessionIndex",
|
||||
" - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,",
|
||||
" ErasStartSessionIndex",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -3204,7 +3212,8 @@
|
||||
" Complexity: O(S) where S is the number of slashing spans on the account.",
|
||||
" DB Weight:",
|
||||
" - Reads: Stash Account, Bonded, Slashing Spans, Locks",
|
||||
" - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Stash Account, Locks",
|
||||
" - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,",
|
||||
" Stash Account, Locks",
|
||||
" - Writes Each: SpanSlash * S",
|
||||
" # </weight>"
|
||||
]
|
||||
@@ -3260,10 +3269,10 @@
|
||||
"",
|
||||
" * `min_nominator_bond`: The minimum active bond needed to be a nominator.",
|
||||
" * `min_validator_bond`: The minimum active bond needed to be a validator.",
|
||||
" * `max_nominator_count`: The max number of users who can be a nominator at once.",
|
||||
" When set to `None`, no limit is enforced.",
|
||||
" * `max_validator_count`: The max number of users who can be a validator at once.",
|
||||
" When set to `None`, no limit is enforced.",
|
||||
" * `max_nominator_count`: The max number of users who can be a nominator at once. When",
|
||||
" set to `None`, no limit is enforced.",
|
||||
" * `max_validator_count`: The max number of users who can be a validator at once. When",
|
||||
" set to `None`, no limit is enforced.",
|
||||
"",
|
||||
" Origin must be Root to call this function.",
|
||||
"",
|
||||
@@ -3463,8 +3472,8 @@
|
||||
"docs": [
|
||||
" The maximum number of nominators rewarded for each validator.",
|
||||
"",
|
||||
" For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim",
|
||||
" their reward. This used to limit the i/o cost for the nominator payout."
|
||||
" For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can",
|
||||
" claim their reward. This used to limit the i/o cost for the nominator payout."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -3604,15 +3613,15 @@
|
||||
{
|
||||
"name": "TooManyNominators",
|
||||
"docs": [
|
||||
" There are too many nominators in the system. Governance needs to adjust the staking settings",
|
||||
" to keep things safe for the runtime."
|
||||
" There are too many nominators in the system. Governance needs to adjust the staking",
|
||||
" settings to keep things safe for the runtime."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TooManyValidators",
|
||||
"docs": [
|
||||
" There are too many validators in the system. Governance needs to adjust the staking settings",
|
||||
" to keep things safe for the runtime."
|
||||
" There are too many validators in the system. Governance needs to adjust the staking",
|
||||
" settings to keep things safe for the runtime."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -3861,8 +3870,8 @@
|
||||
"SessionIndex"
|
||||
],
|
||||
"docs": [
|
||||
" New session has happened. Note that the argument is the \\[session_index\\], not the block",
|
||||
" number as the type might suggest."
|
||||
" New session has happened. Note that the argument is the \\[session_index\\], not the",
|
||||
" block number as the type might suggest."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -4214,8 +4223,8 @@
|
||||
],
|
||||
"docs": [
|
||||
" # <weight>",
|
||||
" - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len)",
|
||||
" and E is length of `heartbeat.network_state.external_address`",
|
||||
" - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is",
|
||||
" length of `heartbeat.network_state.external_address`",
|
||||
" - `O(K)`: decoding of length `K`",
|
||||
" - `O(E)`: decoding/encoding of length `E`",
|
||||
" - DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,",
|
||||
@@ -4784,8 +4793,8 @@
|
||||
" - `to`: The account whose voting the `target` account's voting power will follow.",
|
||||
" - `conviction`: The conviction that will be attached to the delegated votes. When the",
|
||||
" account is undelegated, the funds will be locked for the corresponding period.",
|
||||
" - `balance`: The amount of the account's balance to be used in delegating. This must",
|
||||
" not be more than the account's current balance.",
|
||||
" - `balance`: The amount of the account's balance to be used in delegating. This must not",
|
||||
" be more than the account's current balance.",
|
||||
"",
|
||||
" Emits `Delegated`.",
|
||||
"",
|
||||
@@ -4908,8 +4917,8 @@
|
||||
" The dispatch origin of this call must be _Signed_.",
|
||||
"",
|
||||
" - `proposal_hash`: The preimage hash of a proposal.",
|
||||
" - `proposal_length_upper_bound`: an upper bound on length of the proposal.",
|
||||
" Extrinsic is weighted according to this value with no refund.",
|
||||
" - `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is",
|
||||
" weighted according to this value with no refund.",
|
||||
"",
|
||||
" This will only work after `VotingPeriod` blocks from the time that the preimage was",
|
||||
" noted, if it's the same account doing it. If it's a different account, then it'll only",
|
||||
@@ -5090,7 +5099,8 @@
|
||||
"Vec<AccountId>"
|
||||
],
|
||||
"docs": [
|
||||
" A public proposal has been tabled for referendum vote. \\[proposal_index, deposit, depositors\\]"
|
||||
" A public proposal has been tabled for referendum vote. \\[proposal_index, deposit,",
|
||||
" depositors\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5235,15 +5245,6 @@
|
||||
" \\[proposal_hash, provider, deposit, reaper\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Unlocked",
|
||||
"args": [
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An \\[account\\] has been unlocked successfully."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Blacklisted",
|
||||
"args": [
|
||||
@@ -5260,11 +5261,11 @@
|
||||
"type": "BlockNumber",
|
||||
"value": "0x00270600",
|
||||
"docs": [
|
||||
" The minimum period of locking and the period between a proposal being approved and enacted.",
|
||||
" The period between a proposal being approved and enacted.",
|
||||
"",
|
||||
" It should generally be a little more than the unstake period to ensure that",
|
||||
" voting stakers have an opportunity to remove themselves from the system in the case where",
|
||||
" they are on the losing side of a vote."
|
||||
" voting stakers have an opportunity to remove themselves from the system in the case",
|
||||
" where they are on the losing side of a vote."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5283,6 +5284,17 @@
|
||||
" How often (in blocks) to check for new votes."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "VoteLockingPeriod",
|
||||
"type": "BlockNumber",
|
||||
"value": "0x00270600",
|
||||
"docs": [
|
||||
" The minimum period of vote locking.",
|
||||
"",
|
||||
" It should be no shorter than enactment period to ensure that in the case of an approval,",
|
||||
" those successful voters are locked into the consequences that their votes entail."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MinimumDeposit",
|
||||
"type": "BalanceOf",
|
||||
@@ -5296,9 +5308,9 @@
|
||||
"type": "bool",
|
||||
"value": "0x01",
|
||||
"docs": [
|
||||
" Indicator for whether an emergency origin is even allowed to happen. Some chains may want",
|
||||
" to set this permanently to `false`, others may want to condition it on things such as",
|
||||
" an upgrade having happened recently."
|
||||
" Indicator for whether an emergency origin is even allowed to happen. Some chains may",
|
||||
" want to set this permanently to `false`, others may want to condition it on things such",
|
||||
" as an upgrade having happened recently."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5358,12 +5370,6 @@
|
||||
" Proposal does not exist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "BadIndex",
|
||||
"docs": [
|
||||
" Unknown index"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AlreadyCanceled",
|
||||
"docs": [
|
||||
@@ -5406,12 +5412,6 @@
|
||||
" Identity may not veto a proposal twice"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotDelegated",
|
||||
"docs": [
|
||||
" Not delegated"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DuplicatePreimage",
|
||||
"docs": [
|
||||
@@ -5460,18 +5460,6 @@
|
||||
" No proposals waiting"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotLocked",
|
||||
"docs": [
|
||||
" The target account does not have a lock."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotExpired",
|
||||
"docs": [
|
||||
" The lock on the account to be unlocked has not yet expired."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotVoter",
|
||||
"docs": [
|
||||
@@ -5533,12 +5521,6 @@
|
||||
" Maximum number of votes reached."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "InvalidWitness",
|
||||
"docs": [
|
||||
" The provided witness data is wrong."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TooManyProposals",
|
||||
"docs": [
|
||||
@@ -6639,9 +6621,9 @@
|
||||
" origin is removed as a runner-up.",
|
||||
" - `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_member`](Self::remove_member), if replacement runners exists,",
|
||||
" they are immediately used. If the prime is renouncing, then no prime will exist until",
|
||||
" the next round.",
|
||||
" Similar to [`remove_member`](Self::remove_member), 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.",
|
||||
"",
|
||||
@@ -7721,7 +7703,7 @@
|
||||
"map": {
|
||||
"hasher": "Blake2_128Concat",
|
||||
"key": "AccountId",
|
||||
"value": "VestingInfo",
|
||||
"value": "Vec<VestingInfo>",
|
||||
"linked": false
|
||||
}
|
||||
},
|
||||
@@ -7729,6 +7711,19 @@
|
||||
"docs": [
|
||||
" Information regarding the vesting of a given account."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "StorageVersion",
|
||||
"modifier": "Default",
|
||||
"type": {
|
||||
"plain": "Releases"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" Storage version of the pallet.",
|
||||
"",
|
||||
" New networks start with latest version, as determined by the genesis build."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -7795,12 +7790,13 @@
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" - `target`: The account that should be transferred the vested funds.",
|
||||
" - `amount`: The amount of funds to transfer and will be vested.",
|
||||
" - `target`: The account receiving the vested funds.",
|
||||
" - `schedule`: The vesting schedule attached to the transfer.",
|
||||
"",
|
||||
" Emits `VestingCreated`.",
|
||||
"",
|
||||
" NOTE: This will unlock all schedules through the current block.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)`.",
|
||||
" - DbWeight: 3 Reads, 3 Writes",
|
||||
@@ -7832,11 +7828,12 @@
|
||||
"",
|
||||
" - `source`: The account whose funds should be transferred.",
|
||||
" - `target`: The account that should be transferred the vested funds.",
|
||||
" - `amount`: The amount of funds to transfer and will be vested.",
|
||||
" - `schedule`: The vesting schedule attached to the transfer.",
|
||||
"",
|
||||
" Emits `VestingCreated`.",
|
||||
"",
|
||||
" NOTE: This will unlock all schedules through the current block.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)`.",
|
||||
" - DbWeight: 4 Reads, 4 Writes",
|
||||
@@ -7844,6 +7841,42 @@
|
||||
" - Writes: Vesting Storage, Balances Locks, Target Account, Source Account",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "merge_schedules",
|
||||
"args": [
|
||||
{
|
||||
"name": "schedule1_index",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"name": "schedule2_index",
|
||||
"type": "u32"
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Merge two vesting schedules together, creating a new vesting schedule that unlocks over",
|
||||
" the highest possible start and end blocks. If both schedules have already started the",
|
||||
" current block will be used as the schedule start; with the caveat that if one schedule",
|
||||
" is finished by the current block, the other will be treated as the new merged schedule,",
|
||||
" unmodified.",
|
||||
"",
|
||||
" NOTE: If `schedule1_index == schedule2_index` this is a no-op.",
|
||||
" NOTE: This will unlock all schedules through the current block prior to merging.",
|
||||
" NOTE: If both schedules have ended by the current block, no new schedule will be created",
|
||||
" and both will be removed.",
|
||||
"",
|
||||
" Merged schedule attributes:",
|
||||
" - `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,",
|
||||
" current_block)`.",
|
||||
" - `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`.",
|
||||
" - `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`.",
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" - `schedule1_index`: index of the first schedule to merge.",
|
||||
" - `schedule2_index`: index of the second schedule to merge."
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
@@ -7854,8 +7887,8 @@
|
||||
"Balance"
|
||||
],
|
||||
"docs": [
|
||||
" The amount vested has been updated. This could indicate more funds are available. The",
|
||||
" balance given is the amount which is left unvested (and thus locked).",
|
||||
" The amount vested has been updated. This could indicate a change in funds available.",
|
||||
" The balance given is the amount which is left unvested (and thus locked).",
|
||||
" \\[account, unvested\\]"
|
||||
]
|
||||
},
|
||||
@@ -7865,7 +7898,7 @@
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An \\[account\\] has become fully vested. No further vesting can happen."
|
||||
" An \\[account\\] has become fully vested."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -7877,6 +7910,12 @@
|
||||
"docs": [
|
||||
" The minimum amount transferred to call `vested_transfer`."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MaxVestingSchedules",
|
||||
"type": "u32",
|
||||
"value": "0x1c000000",
|
||||
"docs": []
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
@@ -7887,9 +7926,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ExistingVestingSchedule",
|
||||
"name": "AtMaxVestingSchedules",
|
||||
"docs": [
|
||||
" An existing vesting schedule already exists for this account that cannot be clobbered."
|
||||
" The account already has `MaxVestingSchedules` count of schedules and thus",
|
||||
" cannot add another one. Consider merging existing schedules in order to add another."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -7897,6 +7937,18 @@
|
||||
"docs": [
|
||||
" Amount being transferred is too low to create a vesting schedule."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ScheduleIndexOutOfBounds",
|
||||
"docs": [
|
||||
" An index was out of bounds of the vesting schedules."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "InvalidScheduleParams",
|
||||
"docs": [
|
||||
" Failed to create a new schedule because some parameter was invalid."
|
||||
]
|
||||
}
|
||||
],
|
||||
"index": 25
|
||||
@@ -7918,7 +7970,8 @@
|
||||
"",
|
||||
" May be called from any origin.",
|
||||
"",
|
||||
" - `calls`: The calls to be dispatched from the same origin.",
|
||||
" - `calls`: The calls to be dispatched from the same origin. The number of call must not",
|
||||
" exceed the constant: `batched_calls_limit` (available in constant metadata).",
|
||||
"",
|
||||
" If origin is root then call are dispatch without checking origin filter. (This includes",
|
||||
" bypassing `frame_system::Config::BaseCallFilter`).",
|
||||
@@ -7976,7 +8029,8 @@
|
||||
"",
|
||||
" May be called from any origin.",
|
||||
"",
|
||||
" - `calls`: The calls to be dispatched from the same origin.",
|
||||
" - `calls`: The calls to be dispatched from the same origin. The number of call must not",
|
||||
" exceed the constant: `batched_calls_limit` (available in constant metadata).",
|
||||
"",
|
||||
" If origin is root then call are dispatch without checking origin filter. (This includes",
|
||||
" bypassing `frame_system::Config::BaseCallFilter`).",
|
||||
@@ -8014,8 +8068,24 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"constants": [],
|
||||
"errors": [],
|
||||
"constants": [
|
||||
{
|
||||
"name": "batched_calls_limit",
|
||||
"type": "u32",
|
||||
"value": "0x0cc30000",
|
||||
"docs": [
|
||||
" The limit on the number of batched calls."
|
||||
]
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
{
|
||||
"name": "TooManyCalls",
|
||||
"docs": [
|
||||
" Too many calls batched."
|
||||
]
|
||||
}
|
||||
],
|
||||
"index": 26
|
||||
},
|
||||
{
|
||||
@@ -8627,8 +8697,8 @@
|
||||
"value": "0x80f884b02e0000000000000000000000",
|
||||
"docs": [
|
||||
" The amount held on deposit for a registered subaccount. This should account for the fact",
|
||||
" that one storage item's value will increase by the size of an account ID, and there will be",
|
||||
" another trie item whose value is the size of an account ID plus 32 bytes."
|
||||
" that one storage item's value will increase by the size of an account ID, and there will",
|
||||
" be another trie item whose value is the size of an account ID plus 32 bytes."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -9159,7 +9229,8 @@
|
||||
],
|
||||
"docs": [
|
||||
" Anonymous account has been created by new proxy with given",
|
||||
" disambiguation index and proxy type. \\[anonymous, who, proxy_type, disambiguation_index\\]"
|
||||
" disambiguation index and proxy type. \\[anonymous, who, proxy_type,",
|
||||
" disambiguation_index\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -9172,6 +9243,18 @@
|
||||
"docs": [
|
||||
" An announcement was placed to make a call in the future. \\[real, proxy, call_hash\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ProxyAdded",
|
||||
"args": [
|
||||
"AccountId",
|
||||
"AccountId",
|
||||
"ProxyType",
|
||||
"BlockNumber"
|
||||
],
|
||||
"docs": [
|
||||
" A proxy was added. \\[delegator, delegatee, proxy_type, delay\\]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
@@ -9193,9 +9276,9 @@
|
||||
"docs": [
|
||||
" The amount of currency needed per proxy added.",
|
||||
"",
|
||||
" This is held for adding 32 bytes plus an instance of `ProxyType` more into a pre-existing",
|
||||
" storage value. Thus, when configuring `ProxyDepositFactor` one should take into account",
|
||||
" `32 + proxy_type.encode().len()` bytes of data."
|
||||
" This is held for adding 32 bytes plus an instance of `ProxyType` more into a",
|
||||
" pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take",
|
||||
" into account `32 + proxy_type.encode().len()` bytes of data."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -9221,7 +9304,8 @@
|
||||
"docs": [
|
||||
" The base amount of currency needed to reserve for creating an announcement.",
|
||||
"",
|
||||
" This is held when a new storage item holding a `Balance` is created (typically 16 bytes)."
|
||||
" This is held when a new storage item holding a `Balance` is created (typically 16",
|
||||
" bytes)."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -9424,9 +9508,8 @@
|
||||
" - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.",
|
||||
" - One event.",
|
||||
" - The weight of the `call`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a",
|
||||
" deposit taken for its lifetime of",
|
||||
" `DepositBase + threshold * DepositFactor`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit",
|
||||
" taken for its lifetime of `DepositBase + threshold * DepositFactor`.",
|
||||
" -------------------------------",
|
||||
" - DB Weight:",
|
||||
" - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)",
|
||||
@@ -9488,9 +9571,8 @@
|
||||
" - Up to one binary search and insert (`O(logS + S)`).",
|
||||
" - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.",
|
||||
" - One event.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a",
|
||||
" deposit taken for its lifetime of",
|
||||
" `DepositBase + threshold * DepositFactor`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit",
|
||||
" taken for its lifetime of `DepositBase + threshold * DepositFactor`.",
|
||||
" ----------------------------------",
|
||||
" - DB Weight:",
|
||||
" - Read: Multisig Storage, [Caller Account]",
|
||||
@@ -9605,8 +9687,8 @@
|
||||
"type": "BalanceOf",
|
||||
"value": "0x008c61c52e0000000000000000000000",
|
||||
"docs": [
|
||||
" The base amount of currency needed to reserve for creating a multisig execution or to store",
|
||||
" a dispatch call for later.",
|
||||
" The base amount of currency needed to reserve for creating a multisig execution or to",
|
||||
" store a dispatch call for later.",
|
||||
"",
|
||||
" This is held for an additional storage item whose value size is",
|
||||
" `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is",
|
||||
@@ -10713,7 +10795,7 @@
|
||||
"name": "submit_unsigned",
|
||||
"args": [
|
||||
{
|
||||
"name": "solution",
|
||||
"name": "raw_solution",
|
||||
"type": "RawSolution"
|
||||
},
|
||||
{
|
||||
@@ -10777,7 +10859,7 @@
|
||||
"name": "submit",
|
||||
"args": [
|
||||
{
|
||||
"name": "solution",
|
||||
"name": "raw_solution",
|
||||
"type": "RawSolution"
|
||||
},
|
||||
{
|
||||
@@ -10967,7 +11049,7 @@
|
||||
{
|
||||
"name": "SignedDepositBase",
|
||||
"type": "BalanceOf",
|
||||
"value": "0x00d0ed902e0000000000000000000000",
|
||||
"value": "0x00a0db215d0000000000000000000000",
|
||||
"docs": [
|
||||
" Base deposit for a signed solution."
|
||||
]
|
||||
@@ -10975,7 +11057,7 @@
|
||||
{
|
||||
"name": "SignedDepositByte",
|
||||
"type": "BalanceOf",
|
||||
"value": "0xca9a3b00000000000000000000000000",
|
||||
"value": "0x787d0100000000000000000000000000",
|
||||
"docs": [
|
||||
" Per-byte deposit for a signed solution."
|
||||
]
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -130,7 +130,10 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" Events deposited for the current block."
|
||||
" Events deposited for the current block.",
|
||||
"",
|
||||
" NOTE: This storage item is explicitly unbounded since it is never intended to be read",
|
||||
" from within the runtime."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -278,10 +281,11 @@
|
||||
" # <weight>",
|
||||
" - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`",
|
||||
" - 1 storage write (codec `O(C)`).",
|
||||
" - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is expensive).",
|
||||
" - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is",
|
||||
" expensive).",
|
||||
" - 1 event.",
|
||||
" The weight of this function is dependent on the runtime, but generally this is very expensive.",
|
||||
" We will treat this as a full block.",
|
||||
" The weight of this function is dependent on the runtime, but generally this is very",
|
||||
" expensive. We will treat this as a full block.",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -300,8 +304,8 @@
|
||||
" - `O(C)` where `C` length of `code`",
|
||||
" - 1 storage write (codec `O(C)`).",
|
||||
" - 1 event.",
|
||||
" The weight of this function is dependent on the runtime. We will treat this as a full block.",
|
||||
" # </weight>"
|
||||
" The weight of this function is dependent on the runtime. We will treat this as a full",
|
||||
" block. # </weight>"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -499,7 +503,7 @@
|
||||
{
|
||||
"name": "Version",
|
||||
"type": "RuntimeVersion",
|
||||
"value": "0x106e6f6465387375627374726174652d6e6f64650a0000000b0100000000000034df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a05000000d2bc9897eed08f1503000000f78b278be53f454c02000000ed99c5acb25eedf502000000cbca25e39f14238702000000687ad44ad37f03c201000000bc9d89904f5b923f0100000068b66ba122c93fa70100000037c8bb1350a9a2a80100000091d5df18b0d2cf5801000000ab3c0572291feb8b0100000002000000",
|
||||
"value": "0x106e6f6465387375627374726174652d6e6f64650a0000000b0100000000000034df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a05000000d2bc9897eed08f1503000000f78b278be53f454c02000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000bc9d89904f5b923f0100000068b66ba122c93fa70100000037c8bb1350a9a2a80100000091d5df18b0d2cf5801000000ab3c0572291feb8b0100000002000000",
|
||||
"docs": [
|
||||
" Get the chain's current version."
|
||||
]
|
||||
@@ -572,7 +576,8 @@
|
||||
"",
|
||||
" May be called from any origin.",
|
||||
"",
|
||||
" - `calls`: The calls to be dispatched from the same origin.",
|
||||
" - `calls`: The calls to be dispatched from the same origin. The number of call must not",
|
||||
" exceed the constant: `batched_calls_limit` (available in constant metadata).",
|
||||
"",
|
||||
" If origin is root then call are dispatch without checking origin filter. (This includes",
|
||||
" bypassing `frame_system::Config::BaseCallFilter`).",
|
||||
@@ -630,7 +635,8 @@
|
||||
"",
|
||||
" May be called from any origin.",
|
||||
"",
|
||||
" - `calls`: The calls to be dispatched from the same origin.",
|
||||
" - `calls`: The calls to be dispatched from the same origin. The number of call must not",
|
||||
" exceed the constant: `batched_calls_limit` (available in constant metadata).",
|
||||
"",
|
||||
" If origin is root then call are dispatch without checking origin filter. (This includes",
|
||||
" bypassing `frame_system::Config::BaseCallFilter`).",
|
||||
@@ -668,8 +674,24 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"constants": [],
|
||||
"errors": [],
|
||||
"constants": [
|
||||
{
|
||||
"name": "batched_calls_limit",
|
||||
"type": "u32",
|
||||
"value": "0x73ed0000",
|
||||
"docs": [
|
||||
" The limit on the number of batched calls."
|
||||
]
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
{
|
||||
"name": "TooManyCalls",
|
||||
"docs": [
|
||||
" Too many calls batched."
|
||||
]
|
||||
}
|
||||
],
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
@@ -874,7 +896,8 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" The configuration for the current epoch. Should never be `None` as it is initialized in genesis."
|
||||
" The configuration for the current epoch. Should never be `None` as it is initialized in",
|
||||
" genesis."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1048,7 +1071,8 @@
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)",
|
||||
" - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in `on_finalize`)",
|
||||
" - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in",
|
||||
" `on_finalize`)",
|
||||
" - 1 event handler `on_timestamp_set`. Must be `O(1)`.",
|
||||
" # </weight>"
|
||||
]
|
||||
@@ -1061,10 +1085,10 @@
|
||||
"type": "Moment",
|
||||
"value": "0xdc05000000000000",
|
||||
"docs": [
|
||||
" The minimum period between blocks. Beware that this is different to the *expected* period",
|
||||
" that the block production apparatus provides. Your chosen consensus system will generally",
|
||||
" work with this to determine a sensible block time. e.g. For Aura, it will be double this",
|
||||
" period on default settings."
|
||||
" The minimum period between blocks. Beware that this is different to the *expected*",
|
||||
" period that the block production apparatus provides. Your chosen consensus system will",
|
||||
" generally work with this to determine a sensible block time. e.g. For Aura, it will be",
|
||||
" double this period on default settings."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -1350,7 +1374,8 @@
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Freeze an index so it will always point to the sender account. This consumes the deposit.",
|
||||
" Freeze an index so it will always point to the sender account. This consumes the",
|
||||
" deposit.",
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_ and the signing account must have a",
|
||||
" non-frozen account `index`.",
|
||||
@@ -1551,18 +1576,19 @@
|
||||
" The dispatch origin for this call must be `Signed` by the transactor.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - Dependent on arguments but not critical, given proper implementations for",
|
||||
" input config types. See related functions below.",
|
||||
" - It contains a limited number of reads and writes internally and no complex computation.",
|
||||
" - Dependent on arguments but not critical, given proper implementations for input config",
|
||||
" types. See related functions below.",
|
||||
" - It contains a limited number of reads and writes internally and no complex",
|
||||
" computation.",
|
||||
"",
|
||||
" Related functions:",
|
||||
"",
|
||||
" - `ensure_can_withdraw` is always called internally but has a bounded complexity.",
|
||||
" - Transferring balances to accounts that did not exist before will cause",
|
||||
" `T::OnNewAccount::on_new_account` to be called.",
|
||||
" `T::OnNewAccount::on_new_account` to be called.",
|
||||
" - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`.",
|
||||
" - `transfer_keep_alive` works the same way as `transfer`, but has an additional",
|
||||
" check that the transfer will not kill the origin account.",
|
||||
" - `transfer_keep_alive` works the same way as `transfer`, but has an additional check",
|
||||
" that the transfer will not kill the origin account.",
|
||||
" ---------------------------------",
|
||||
" - Base Weight: 73.64 µs, worst case scenario (account created, account removed)",
|
||||
" - DB Weight: 1 Read and 1 Write to destination account",
|
||||
@@ -1627,8 +1653,8 @@
|
||||
" Exactly as `transfer`, except the origin must be root and the source account may be",
|
||||
" specified.",
|
||||
" # <weight>",
|
||||
" - Same as transfer, but additional read and write because the source account is",
|
||||
" not assumed to be in the overlay.",
|
||||
" - Same as transfer, but additional read and write because the source account is not",
|
||||
" assumed to be in the overlay.",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -1685,8 +1711,7 @@
|
||||
" - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all",
|
||||
" of the funds the account has, causing the sender account to be killed (false), or",
|
||||
" transfer everything except at least the existential deposit, which will guarantee to",
|
||||
" keep the sender account alive (true).",
|
||||
" # <weight>",
|
||||
" keep the sender account alive (true). # <weight>",
|
||||
" - O(1). Just like transfer, but reading the user's transferable balance first.",
|
||||
" #</weight>"
|
||||
]
|
||||
@@ -2068,7 +2093,7 @@
|
||||
"name": "submit_unsigned",
|
||||
"args": [
|
||||
{
|
||||
"name": "solution",
|
||||
"name": "raw_solution",
|
||||
"type": "RawSolution"
|
||||
},
|
||||
{
|
||||
@@ -2132,7 +2157,7 @@
|
||||
"name": "submit",
|
||||
"args": [
|
||||
{
|
||||
"name": "solution",
|
||||
"name": "raw_solution",
|
||||
"type": "RawSolution"
|
||||
},
|
||||
{
|
||||
@@ -2985,9 +3010,9 @@
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" The threshold for when users can start calling `chill_other` for other validators / nominators.",
|
||||
" The threshold is compared to the actual number of validators / nominators (`CountFor*`) in",
|
||||
" the system compared to the configured max (`Max*Count`)."
|
||||
" The threshold for when users can start calling `chill_other` for other validators /",
|
||||
" nominators. The threshold is compared to the actual number of validators / nominators",
|
||||
" (`CountFor*`) in the system compared to the configured max (`Max*Count`)."
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -3044,8 +3069,8 @@
|
||||
" The dispatch origin for this call must be _Signed_ by the stash, not the controller.",
|
||||
"",
|
||||
" Use this if there are additional funds in your stash account that you wish to bond.",
|
||||
" Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose any limitation",
|
||||
" on the amount that can be added.",
|
||||
" Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose",
|
||||
" any limitation on the amount that can be added.",
|
||||
"",
|
||||
" Emits `Bonded`.",
|
||||
"",
|
||||
@@ -3357,8 +3382,8 @@
|
||||
" # <weight>",
|
||||
" O(S) where S is the number of slashing spans to be removed",
|
||||
" Reads: Bonded, Slashing Spans, Account, Locks",
|
||||
" Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Account, Locks",
|
||||
" Writes Each: SpanSlash * S",
|
||||
" Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,",
|
||||
" Account, Locks Writes Each: SpanSlash * S",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -3484,10 +3509,10 @@
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `new_history_depth`: The new history depth you would like to set.",
|
||||
" - `era_items_deleted`: The number of items that will be deleted by this dispatch.",
|
||||
" This should report all the storage items that will be deleted by clearing old",
|
||||
" era history. Needed to report an accurate weight for the dispatch. Trusted by",
|
||||
" `Root` to report an accurate number.",
|
||||
" - `era_items_deleted`: The number of items that will be deleted by this dispatch. This",
|
||||
" should report all the storage items that will be deleted by clearing old era history.",
|
||||
" Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an",
|
||||
" accurate number.",
|
||||
"",
|
||||
" Origin must be root.",
|
||||
"",
|
||||
@@ -3498,7 +3523,8 @@
|
||||
" - Reads: Current Era, History Depth",
|
||||
" - Writes: History Depth",
|
||||
" - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs",
|
||||
" - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake, ErasStartSessionIndex",
|
||||
" - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,",
|
||||
" ErasStartSessionIndex",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
@@ -3527,7 +3553,8 @@
|
||||
" Complexity: O(S) where S is the number of slashing spans on the account.",
|
||||
" DB Weight:",
|
||||
" - Reads: Stash Account, Bonded, Slashing Spans, Locks",
|
||||
" - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Stash Account, Locks",
|
||||
" - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,",
|
||||
" Stash Account, Locks",
|
||||
" - Writes Each: SpanSlash * S",
|
||||
" # </weight>"
|
||||
]
|
||||
@@ -3583,10 +3610,10 @@
|
||||
"",
|
||||
" * `min_nominator_bond`: The minimum active bond needed to be a nominator.",
|
||||
" * `min_validator_bond`: The minimum active bond needed to be a validator.",
|
||||
" * `max_nominator_count`: The max number of users who can be a nominator at once.",
|
||||
" When set to `None`, no limit is enforced.",
|
||||
" * `max_validator_count`: The max number of users who can be a validator at once.",
|
||||
" When set to `None`, no limit is enforced.",
|
||||
" * `max_nominator_count`: The max number of users who can be a nominator at once. When",
|
||||
" set to `None`, no limit is enforced.",
|
||||
" * `max_validator_count`: The max number of users who can be a validator at once. When",
|
||||
" set to `None`, no limit is enforced.",
|
||||
"",
|
||||
" Origin must be Root to call this function.",
|
||||
"",
|
||||
@@ -3786,8 +3813,8 @@
|
||||
"docs": [
|
||||
" The maximum number of nominators rewarded for each validator.",
|
||||
"",
|
||||
" For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim",
|
||||
" their reward. This used to limit the i/o cost for the nominator payout."
|
||||
" For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can",
|
||||
" claim their reward. This used to limit the i/o cost for the nominator payout."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -3927,15 +3954,15 @@
|
||||
{
|
||||
"name": "TooManyNominators",
|
||||
"docs": [
|
||||
" There are too many nominators in the system. Governance needs to adjust the staking settings",
|
||||
" to keep things safe for the runtime."
|
||||
" There are too many nominators in the system. Governance needs to adjust the staking",
|
||||
" settings to keep things safe for the runtime."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TooManyValidators",
|
||||
"docs": [
|
||||
" There are too many validators in the system. Governance needs to adjust the staking settings",
|
||||
" to keep things safe for the runtime."
|
||||
" There are too many validators in the system. Governance needs to adjust the staking",
|
||||
" settings to keep things safe for the runtime."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -4095,8 +4122,8 @@
|
||||
"SessionIndex"
|
||||
],
|
||||
"docs": [
|
||||
" New session has happened. Note that the argument is the \\[session_index\\], not the block",
|
||||
" number as the type might suggest."
|
||||
" New session has happened. Note that the argument is the \\[session_index\\], not the",
|
||||
" block number as the type might suggest."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -4629,8 +4656,8 @@
|
||||
" - `to`: The account whose voting the `target` account's voting power will follow.",
|
||||
" - `conviction`: The conviction that will be attached to the delegated votes. When the",
|
||||
" account is undelegated, the funds will be locked for the corresponding period.",
|
||||
" - `balance`: The amount of the account's balance to be used in delegating. This must",
|
||||
" not be more than the account's current balance.",
|
||||
" - `balance`: The amount of the account's balance to be used in delegating. This must not",
|
||||
" be more than the account's current balance.",
|
||||
"",
|
||||
" Emits `Delegated`.",
|
||||
"",
|
||||
@@ -4753,8 +4780,8 @@
|
||||
" The dispatch origin of this call must be _Signed_.",
|
||||
"",
|
||||
" - `proposal_hash`: The preimage hash of a proposal.",
|
||||
" - `proposal_length_upper_bound`: an upper bound on length of the proposal.",
|
||||
" Extrinsic is weighted according to this value with no refund.",
|
||||
" - `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is",
|
||||
" weighted according to this value with no refund.",
|
||||
"",
|
||||
" This will only work after `VotingPeriod` blocks from the time that the preimage was",
|
||||
" noted, if it's the same account doing it. If it's a different account, then it'll only",
|
||||
@@ -4935,7 +4962,8 @@
|
||||
"Vec<AccountId>"
|
||||
],
|
||||
"docs": [
|
||||
" A public proposal has been tabled for referendum vote. \\[proposal_index, deposit, depositors\\]"
|
||||
" A public proposal has been tabled for referendum vote. \\[proposal_index, deposit,",
|
||||
" depositors\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5080,15 +5108,6 @@
|
||||
" \\[proposal_hash, provider, deposit, reaper\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Unlocked",
|
||||
"args": [
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An \\[account\\] has been unlocked successfully."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Blacklisted",
|
||||
"args": [
|
||||
@@ -5105,11 +5124,11 @@
|
||||
"type": "BlockNumber",
|
||||
"value": "0x002f0d00",
|
||||
"docs": [
|
||||
" The minimum period of locking and the period between a proposal being approved and enacted.",
|
||||
" The period between a proposal being approved and enacted.",
|
||||
"",
|
||||
" It should generally be a little more than the unstake period to ensure that",
|
||||
" voting stakers have an opportunity to remove themselves from the system in the case where",
|
||||
" they are on the losing side of a vote."
|
||||
" voting stakers have an opportunity to remove themselves from the system in the case",
|
||||
" where they are on the losing side of a vote."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5128,6 +5147,17 @@
|
||||
" How often (in blocks) to check for new votes."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "VoteLockingPeriod",
|
||||
"type": "BlockNumber",
|
||||
"value": "0x002f0d00",
|
||||
"docs": [
|
||||
" The minimum period of vote locking.",
|
||||
"",
|
||||
" It should be no shorter than enactment period to ensure that in the case of an approval,",
|
||||
" those successful voters are locked into the consequences that their votes entail."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MinimumDeposit",
|
||||
"type": "BalanceOf",
|
||||
@@ -5141,9 +5171,9 @@
|
||||
"type": "bool",
|
||||
"value": "0x01",
|
||||
"docs": [
|
||||
" Indicator for whether an emergency origin is even allowed to happen. Some chains may want",
|
||||
" to set this permanently to `false`, others may want to condition it on things such as",
|
||||
" an upgrade having happened recently."
|
||||
" Indicator for whether an emergency origin is even allowed to happen. Some chains may",
|
||||
" want to set this permanently to `false`, others may want to condition it on things such",
|
||||
" as an upgrade having happened recently."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5203,12 +5233,6 @@
|
||||
" Proposal does not exist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "BadIndex",
|
||||
"docs": [
|
||||
" Unknown index"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AlreadyCanceled",
|
||||
"docs": [
|
||||
@@ -5251,12 +5275,6 @@
|
||||
" Identity may not veto a proposal twice"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotDelegated",
|
||||
"docs": [
|
||||
" Not delegated"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DuplicatePreimage",
|
||||
"docs": [
|
||||
@@ -5305,18 +5323,6 @@
|
||||
" No proposals waiting"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotLocked",
|
||||
"docs": [
|
||||
" The target account does not have a lock."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotExpired",
|
||||
"docs": [
|
||||
" The lock on the account to be unlocked has not yet expired."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NotVoter",
|
||||
"docs": [
|
||||
@@ -5378,12 +5384,6 @@
|
||||
" Maximum number of votes reached."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "InvalidWitness",
|
||||
"docs": [
|
||||
" The provided witness data is wrong."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TooManyProposals",
|
||||
"docs": [
|
||||
@@ -6484,9 +6484,9 @@
|
||||
" origin is removed as a runner-up.",
|
||||
" - `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_member`](Self::remove_member), if replacement runners exists,",
|
||||
" they are immediately used. If the prime is renouncing, then no prime will exist until",
|
||||
" the next round.",
|
||||
" Similar to [`remove_member`](Self::remove_member), 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.",
|
||||
"",
|
||||
@@ -7617,7 +7617,8 @@
|
||||
"",
|
||||
" Instantiation is executed as follows:",
|
||||
"",
|
||||
" - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that code.",
|
||||
" - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that",
|
||||
" code.",
|
||||
" - If the `code_hash` already exists on the chain the underlying `code` will be shared.",
|
||||
" - The destination address is computed based on the sender, code_hash and the salt.",
|
||||
" - The smart-contract account is created at the computed address.",
|
||||
@@ -7779,8 +7780,8 @@
|
||||
" # Params",
|
||||
"",
|
||||
" - `contract`: The contract that emitted the event.",
|
||||
" - `data`: Data supplied by the contract. Metadata generated during contract",
|
||||
" compilation is needed to decode it."
|
||||
" - `data`: Data supplied by the contract. Metadata generated during contract compilation",
|
||||
" is needed to decode it."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -7800,7 +7801,7 @@
|
||||
{
|
||||
"name": "Schedule",
|
||||
"type": "Schedule",
|
||||
"value": "0x0400000000020000000100008000000010000000001000000001000020000000200000000040000000000200020000008e0f0000b04602009a8c0300a9720000767600005e380000ea5e00000753000097000000579e030088130500b60000007a170000c11100005721000099370000483a0000d0110000d8d12c08bc4300005c430000bb2e0000a942000000260000b72300009c370000ad540000de540000ca5400000354000018550000e553000011550000c053000007540000da540000a0530000e85300008d5400004a690000bd680000a56a000096670000b053000013540000055400006a5500009255000060550000f455000033550000cae32900000000007a332a00000000004041290000000000a6fb5d000000000060c02a0000000000e6d6290000000000065329000000000062002a0000000000d425290000000000b0522a00000000005cb3540000000000b41c1600000000008057640000000000000100000000000008f6380000000000710200000000000078d68a210000000098d6de2a000000007c75640900000000466d6f000000000070baac0000000000ec73de07000000007406000000000000922c190000000000fc9f1d00000000008618ee0900000000450200000000000082dc6108000000003e573102000000002704000000000000cc94430b000000009406e1100000000096fa930800000000dc010000000000009c020000000000001843c12400000000f001000000000000b80200000000000094070000000000008a9b2a0000000000561200000000000046432b0000000000ab0c000000000000c08c260000000000b005000000000000acd2260000000000b005000000000000",
|
||||
"value": "0x040000000002000000010000800000001000000000100000000100002000000020000000004000000000020002000000eb130000ae310000ab370000ba160000bb2b0000222000008c1a0000c83000005200000021e2020044620400151300005c1000005415000042150000f02600000731000070100000d5e3c402001600004016000011160000fb150000e5150000f815000026160000c01600004a16000070160000ac16000091160000cf160000d3160000eb160000f8150000f21600009d1600007a1600005c160000072f00000e250000d22f0000ad2400007c1a0000831600008716000002170000b51600008916000090160000a81600003ee4140000000000de0715000000000020e9140000000000aadd3b0000000000c4ea1400000000004af614000000000074fe14000000000044f714000000000088d614000000000084ee140000000000065f3100000000006276090000000000f0a6310000000000a504000000000000103d260000000000db020000000000007045df1f0000000028135a290000000056f6e60800000000a4bd4300000000003cfe6f000000000032eac2070000000078070000000000006c0f0c00000000001a3c0e0000000000007eb107000000005303000000000000b275fd0700000000c4bed00100000000170500000000000016ed470a000000003677ec24000000009a5c380800000000df02000000000000a2040000000000002888813700000000df02000000000000a0040000000000008b0800000000000028e015000000000085130000000000008a22170000000000b90d0000000000005cbe120000000000b906000000000000a8d6120000000000ba06000000000000",
|
||||
"docs": [
|
||||
" Cost schedule and limits."
|
||||
]
|
||||
@@ -7835,8 +7836,9 @@
|
||||
" 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."
|
||||
" 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."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -7846,10 +7848,10 @@
|
||||
"docs": [
|
||||
" 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."
|
||||
" 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."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -7886,7 +7888,7 @@
|
||||
{
|
||||
"name": "DeletionQueueDepth",
|
||||
"type": "u32",
|
||||
"value": "0x1a040000",
|
||||
"value": "0xed030000",
|
||||
"docs": [
|
||||
" The maximum number of tries that can be queued for deletion."
|
||||
]
|
||||
@@ -8213,7 +8215,8 @@
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.",
|
||||
" Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo",
|
||||
" key.",
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
@@ -8381,8 +8384,8 @@
|
||||
],
|
||||
"docs": [
|
||||
" # <weight>",
|
||||
" - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len)",
|
||||
" and E is length of `heartbeat.network_state.external_address`",
|
||||
" - Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is",
|
||||
" length of `heartbeat.network_state.external_address`",
|
||||
" - `O(K)`: decoding of length `K`",
|
||||
" - `O(E)`: decoding/encoding of length `E`",
|
||||
" - DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,",
|
||||
@@ -9181,8 +9184,8 @@
|
||||
"value": "0x0080f420e6b500000000000000000000",
|
||||
"docs": [
|
||||
" The amount held on deposit for a registered subaccount. This should account for the fact",
|
||||
" that one storage item's value will increase by the size of an account ID, and there will be",
|
||||
" another trie item whose value is the size of an account ID plus 32 bytes."
|
||||
" that one storage item's value will increase by the size of an account ID, and there will",
|
||||
" be another trie item whose value is the size of an account ID plus 32 bytes."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -10446,13 +10449,13 @@
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `friends`: A list of friends you trust to vouch for recovery attempts.",
|
||||
" Should be ordered and contain no duplicate values.",
|
||||
" - `threshold`: The number of friends that must vouch for a recovery attempt",
|
||||
" before the account can be recovered. Should be less than or equal to",
|
||||
" the length of the list of friends.",
|
||||
" - `delay_period`: The number of blocks after a recovery attempt is initialized",
|
||||
" that needs to pass before the account can be recovered.",
|
||||
" - `friends`: A list of friends you trust to vouch for recovery attempts. Should be",
|
||||
" ordered and contain no duplicate values.",
|
||||
" - `threshold`: The number of friends that must vouch for a recovery attempt before the",
|
||||
" account can be recovered. Should be less than or equal to the length of the list of",
|
||||
" friends.",
|
||||
" - `delay_period`: The number of blocks after a recovery attempt is initialized that",
|
||||
" needs to pass before the account can be recovered.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - Key: F (len of friends)",
|
||||
@@ -10484,8 +10487,8 @@
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `account`: The lost account that you want to recover. This account",
|
||||
" needs to be recoverable (i.e. have a recovery configuration).",
|
||||
" - `account`: The lost account that you want to recover. This account needs to be",
|
||||
" recoverable (i.e. have a recovery configuration).",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - One storage read to check that account is recoverable. O(F)",
|
||||
@@ -10520,8 +10523,7 @@
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `lost`: The lost account that you want to recover.",
|
||||
" - `rescuer`: The account trying to rescue the lost account that you",
|
||||
" want to vouch for.",
|
||||
" - `rescuer`: The account trying to rescue the lost account that you want to vouch for.",
|
||||
"",
|
||||
" The combination of these two parameters must point to an active recovery",
|
||||
" process.",
|
||||
@@ -10555,8 +10557,8 @@
|
||||
" `threshold` or more vouches, waited `delay_period` blocks since initiation.",
|
||||
"",
|
||||
" Parameters:",
|
||||
" - `account`: The lost account that you want to claim has been successfully",
|
||||
" recovered by you.",
|
||||
" - `account`: The lost account that you want to claim has been successfully recovered by",
|
||||
" you.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" Key: F (len of friends in config), V (len of vouching friends)",
|
||||
@@ -10733,9 +10735,11 @@
|
||||
"type": "BalanceOf",
|
||||
"value": "0x00203d88792d00000000000000000000",
|
||||
"docs": [
|
||||
" The amount of currency needed per additional user when creating a recovery configuration.",
|
||||
" The amount of currency needed per additional user when creating a recovery",
|
||||
" configuration.",
|
||||
"",
|
||||
" This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage value."
|
||||
" This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage",
|
||||
" value."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -10873,7 +10877,7 @@
|
||||
"map": {
|
||||
"hasher": "Blake2_128Concat",
|
||||
"key": "AccountId",
|
||||
"value": "VestingInfo",
|
||||
"value": "Vec<VestingInfo>",
|
||||
"linked": false
|
||||
}
|
||||
},
|
||||
@@ -10881,6 +10885,19 @@
|
||||
"docs": [
|
||||
" Information regarding the vesting of a given account."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "StorageVersion",
|
||||
"modifier": "Default",
|
||||
"type": {
|
||||
"plain": "Releases"
|
||||
},
|
||||
"fallback": "0x00",
|
||||
"docs": [
|
||||
" Storage version of the pallet.",
|
||||
"",
|
||||
" New networks start with latest version, as determined by the genesis build."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -10947,12 +10964,13 @@
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" - `target`: The account that should be transferred the vested funds.",
|
||||
" - `amount`: The amount of funds to transfer and will be vested.",
|
||||
" - `target`: The account receiving the vested funds.",
|
||||
" - `schedule`: The vesting schedule attached to the transfer.",
|
||||
"",
|
||||
" Emits `VestingCreated`.",
|
||||
"",
|
||||
" NOTE: This will unlock all schedules through the current block.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)`.",
|
||||
" - DbWeight: 3 Reads, 3 Writes",
|
||||
@@ -10984,11 +11002,12 @@
|
||||
"",
|
||||
" - `source`: The account whose funds should be transferred.",
|
||||
" - `target`: The account that should be transferred the vested funds.",
|
||||
" - `amount`: The amount of funds to transfer and will be vested.",
|
||||
" - `schedule`: The vesting schedule attached to the transfer.",
|
||||
"",
|
||||
" Emits `VestingCreated`.",
|
||||
"",
|
||||
" NOTE: This will unlock all schedules through the current block.",
|
||||
"",
|
||||
" # <weight>",
|
||||
" - `O(1)`.",
|
||||
" - DbWeight: 4 Reads, 4 Writes",
|
||||
@@ -10996,6 +11015,42 @@
|
||||
" - Writes: Vesting Storage, Balances Locks, Target Account, Source Account",
|
||||
" # </weight>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "merge_schedules",
|
||||
"args": [
|
||||
{
|
||||
"name": "schedule1_index",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"name": "schedule2_index",
|
||||
"type": "u32"
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Merge two vesting schedules together, creating a new vesting schedule that unlocks over",
|
||||
" the highest possible start and end blocks. If both schedules have already started the",
|
||||
" current block will be used as the schedule start; with the caveat that if one schedule",
|
||||
" is finished by the current block, the other will be treated as the new merged schedule,",
|
||||
" unmodified.",
|
||||
"",
|
||||
" NOTE: If `schedule1_index == schedule2_index` this is a no-op.",
|
||||
" NOTE: This will unlock all schedules through the current block prior to merging.",
|
||||
" NOTE: If both schedules have ended by the current block, no new schedule will be created",
|
||||
" and both will be removed.",
|
||||
"",
|
||||
" Merged schedule attributes:",
|
||||
" - `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,",
|
||||
" current_block)`.",
|
||||
" - `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`.",
|
||||
" - `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`.",
|
||||
"",
|
||||
" The dispatch origin for this call must be _Signed_.",
|
||||
"",
|
||||
" - `schedule1_index`: index of the first schedule to merge.",
|
||||
" - `schedule2_index`: index of the second schedule to merge."
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
@@ -11006,8 +11061,8 @@
|
||||
"Balance"
|
||||
],
|
||||
"docs": [
|
||||
" The amount vested has been updated. This could indicate more funds are available. The",
|
||||
" balance given is the amount which is left unvested (and thus locked).",
|
||||
" The amount vested has been updated. This could indicate a change in funds available.",
|
||||
" The balance given is the amount which is left unvested (and thus locked).",
|
||||
" \\[account, unvested\\]"
|
||||
]
|
||||
},
|
||||
@@ -11017,7 +11072,7 @@
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An \\[account\\] has become fully vested. No further vesting can happen."
|
||||
" An \\[account\\] has become fully vested."
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -11029,6 +11084,12 @@
|
||||
"docs": [
|
||||
" The minimum amount transferred to call `vested_transfer`."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MaxVestingSchedules",
|
||||
"type": "u32",
|
||||
"value": "0x1c000000",
|
||||
"docs": []
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
@@ -11039,9 +11100,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ExistingVestingSchedule",
|
||||
"name": "AtMaxVestingSchedules",
|
||||
"docs": [
|
||||
" An existing vesting schedule already exists for this account that cannot be clobbered."
|
||||
" The account already has `MaxVestingSchedules` count of schedules and thus",
|
||||
" cannot add another one. Consider merging existing schedules in order to add another."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -11049,6 +11111,18 @@
|
||||
"docs": [
|
||||
" Amount being transferred is too low to create a vesting schedule."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ScheduleIndexOutOfBounds",
|
||||
"docs": [
|
||||
" An index was out of bounds of the vesting schedules."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "InvalidScheduleParams",
|
||||
"docs": [
|
||||
" Failed to create a new schedule because some parameter was invalid."
|
||||
]
|
||||
}
|
||||
],
|
||||
"index": 28
|
||||
@@ -11322,8 +11396,8 @@
|
||||
"type": "Weight",
|
||||
"value": "0x00806e8774010000",
|
||||
"docs": [
|
||||
" The maximum weight that may be scheduled per block for any dispatchables of less priority",
|
||||
" than `schedule::HARD_DEADLINE`."
|
||||
" The maximum weight that may be scheduled per block for any dispatchables of less",
|
||||
" priority than `schedule::HARD_DEADLINE`."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -11765,7 +11839,8 @@
|
||||
],
|
||||
"docs": [
|
||||
" Anonymous account has been created by new proxy with given",
|
||||
" disambiguation index and proxy type. \\[anonymous, who, proxy_type, disambiguation_index\\]"
|
||||
" disambiguation index and proxy type. \\[anonymous, who, proxy_type,",
|
||||
" disambiguation_index\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -11778,6 +11853,18 @@
|
||||
"docs": [
|
||||
" An announcement was placed to make a call in the future. \\[real, proxy, call_hash\\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ProxyAdded",
|
||||
"args": [
|
||||
"AccountId",
|
||||
"AccountId",
|
||||
"ProxyType",
|
||||
"BlockNumber"
|
||||
],
|
||||
"docs": [
|
||||
" A proxy was added. \\[delegator, delegatee, proxy_type, delay\\]"
|
||||
]
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
@@ -11799,9 +11886,9 @@
|
||||
"docs": [
|
||||
" The amount of currency needed per proxy added.",
|
||||
"",
|
||||
" This is held for adding 32 bytes plus an instance of `ProxyType` more into a pre-existing",
|
||||
" storage value. Thus, when configuring `ProxyDepositFactor` one should take into account",
|
||||
" `32 + proxy_type.encode().len()` bytes of data."
|
||||
" This is held for adding 32 bytes plus an instance of `ProxyType` more into a",
|
||||
" pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take",
|
||||
" into account `32 + proxy_type.encode().len()` bytes of data."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -11827,7 +11914,8 @@
|
||||
"docs": [
|
||||
" The base amount of currency needed to reserve for creating an announcement.",
|
||||
"",
|
||||
" This is held when a new storage item holding a `Balance` is created (typically 16 bytes)."
|
||||
" This is held when a new storage item holding a `Balance` is created (typically 16",
|
||||
" bytes)."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -12030,9 +12118,8 @@
|
||||
" - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.",
|
||||
" - One event.",
|
||||
" - The weight of the `call`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a",
|
||||
" deposit taken for its lifetime of",
|
||||
" `DepositBase + threshold * DepositFactor`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit",
|
||||
" taken for its lifetime of `DepositBase + threshold * DepositFactor`.",
|
||||
" -------------------------------",
|
||||
" - DB Weight:",
|
||||
" - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)",
|
||||
@@ -12094,9 +12181,8 @@
|
||||
" - Up to one binary search and insert (`O(logS + S)`).",
|
||||
" - I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove.",
|
||||
" - One event.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a",
|
||||
" deposit taken for its lifetime of",
|
||||
" `DepositBase + threshold * DepositFactor`.",
|
||||
" - Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit",
|
||||
" taken for its lifetime of `DepositBase + threshold * DepositFactor`.",
|
||||
" ----------------------------------",
|
||||
" - DB Weight:",
|
||||
" - Read: Multisig Storage, [Caller Account]",
|
||||
@@ -12211,8 +12297,8 @@
|
||||
"type": "BalanceOf",
|
||||
"value": "0x00f01c0adbed01000000000000000000",
|
||||
"docs": [
|
||||
" The base amount of currency needed to reserve for creating a multisig execution or to store",
|
||||
" a dispatch call for later.",
|
||||
" The base amount of currency needed to reserve for creating a multisig execution or to",
|
||||
" store a dispatch call for later.",
|
||||
"",
|
||||
" This is held for an additional storage item whose value size is",
|
||||
" `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is",
|
||||
@@ -13311,8 +13397,8 @@
|
||||
" - `id`: The identifier of the new asset. This must not be currently in use to identify",
|
||||
" an existing asset.",
|
||||
" - `owner`: The owner of this class of assets. The owner has full superuser permissions",
|
||||
" over this asset, but may later change and configure the permissions using `transfer_ownership`",
|
||||
" and `set_team`.",
|
||||
" over this asset, but may later change and configure the permissions using",
|
||||
" `transfer_ownership` and `set_team`.",
|
||||
" - `min_balance`: The minimum balance of this new asset that any single account must",
|
||||
" have. If an account's balance is reduced below this, then it collapses to zero.",
|
||||
"",
|
||||
@@ -14304,7 +14390,8 @@
|
||||
{
|
||||
"name": "NoProvider",
|
||||
"docs": [
|
||||
" No provider reference exists to allow a non-zero balance of a non-self-sufficient asset."
|
||||
" No provider reference exists to allow a non-zero balance of a non-self-sufficient",
|
||||
" asset."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -14969,8 +15056,8 @@
|
||||
{
|
||||
"name": "BidTooLow",
|
||||
"docs": [
|
||||
" The queue for the bid's duration is full and the amount bid is too low to get in through",
|
||||
" replacing an existing bid."
|
||||
" The queue for the bid's duration is full and the amount bid is too low to get in",
|
||||
" through replacing an existing bid."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -15854,7 +15941,7 @@
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An asset `instace` was issued. \\[ class, instance, owner \\]"
|
||||
" An asset `instance` was issued. \\[ class, instance, owner \\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -15866,7 +15953,7 @@
|
||||
"AccountId"
|
||||
],
|
||||
"docs": [
|
||||
" An asset `instace` was transferred. \\[ class, instance, from, to \\]"
|
||||
" An asset `instance` was transferred. \\[ class, instance, from, to \\]"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -16313,9 +16400,9 @@
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
" Index and store data on chain. Minimum data size is 1 bytes, maximum is `MaxTransactionSize`.",
|
||||
" Data will be removed after `STORAGE_PERIOD` blocks, unless `renew` is called.",
|
||||
" # <weight>",
|
||||
" Index and store data on chain. Minimum data size is 1 bytes, maximum is",
|
||||
" `MaxTransactionSize`. Data will be removed after `STORAGE_PERIOD` blocks, unless `renew`",
|
||||
" is called. # <weight>",
|
||||
" - n*log(n) of data size, as all data is pushed to an in-memory trie.",
|
||||
" Additionally contains a DB write.",
|
||||
" # </weight>"
|
||||
@@ -16355,7 +16442,8 @@
|
||||
" Check storage proof for block number `block_number() - StoragePeriod`.",
|
||||
" If such block does not exist the proof is expected to be `None`.",
|
||||
" # <weight>",
|
||||
" - Linear w.r.t the number of indexed transactions in the proved block for random probing.",
|
||||
" - Linear w.r.t the number of indexed transactions in the proved block for random",
|
||||
" probing.",
|
||||
" There's a DB read for each transaction.",
|
||||
" Here we assume a maximum of 100 probed transactions.",
|
||||
" # </weight>"
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-support', version: '5.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-support', version: '5.8.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "5.4.1",
|
||||
"version": "5.8.2",
|
||||
"type": "module",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
@@ -19,15 +19,15 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"rxjs": "^7.2.0"
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/util": "^7.3.1",
|
||||
"@polkadot/util-crypto": "^7.3.1",
|
||||
"rxjs": "^7.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/types-support": "5.4.1",
|
||||
"@polkadot/keyring": "^7.3.1",
|
||||
"@polkadot/types-support": "5.8.2",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9"
|
||||
"bn.js": "^4.12.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
|
||||
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
|
||||
import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
|
||||
import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, BodyId, BodyPart, BodyPartAtLeastProportion, BodyPartFraction, BodyPartMoreThanProportion, DoubleEncodedCall, InboundStatus, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, OutboundStatus, Outcome, PluralityJunction, QueueConfigData, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOrigin, XcmOriginKind, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm';
|
||||
import type { AssetInstance, AssetInstanceV0, AssetInstanceV1, BodyId, BodyPart, DoubleEncodedCall, Fungibility, InboundStatus, InstructionV2, InteriorMultiLocation, Junction, JunctionV0, JunctionV1, JunctionV2, Junctions, JunctionsV1, JunctionsV2, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, NetworkId, OriginKindV0, OriginKindV1, OriginKindV2, OutboundStatus, Outcome, QueryId, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV2Result, VersionMigrationStage, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WildFungibility, WildMultiAsset, WildMultiAssetV1, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmOrder, XcmOrderV0, XcmOrderV1, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm';
|
||||
|
||||
declare module '@polkadot/types/types/registry' {
|
||||
export interface InterfaceTypes {
|
||||
@@ -68,17 +68,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
AccountId: AccountId;
|
||||
AccountId20: AccountId20;
|
||||
AccountId32: AccountId32;
|
||||
AccountId32Junction: AccountId32Junction;
|
||||
AccountIdOf: AccountIdOf;
|
||||
AccountIndex: AccountIndex;
|
||||
AccountIndex64Junction: AccountIndex64Junction;
|
||||
AccountInfo: AccountInfo;
|
||||
AccountInfoWithDualRefCount: AccountInfoWithDualRefCount;
|
||||
AccountInfoWithProviders: AccountInfoWithProviders;
|
||||
AccountInfoWithRefCount: AccountInfoWithRefCount;
|
||||
AccountInfoWithRefCountU8: AccountInfoWithRefCountU8;
|
||||
AccountInfoWithTripleRefCount: AccountInfoWithTripleRefCount;
|
||||
AccountKey20Junction: AccountKey20Junction;
|
||||
AccountStatus: AccountStatus;
|
||||
AccountValidity: AccountValidity;
|
||||
AccountVote: AccountVote;
|
||||
@@ -105,6 +102,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
AssetDetails: AssetDetails;
|
||||
AssetId: AssetId;
|
||||
AssetInstance: AssetInstance;
|
||||
AssetInstanceV0: AssetInstanceV0;
|
||||
AssetInstanceV1: AssetInstanceV1;
|
||||
AssetMetadata: AssetMetadata;
|
||||
AssetOptions: AssetOptions;
|
||||
AssignmentId: AssignmentId;
|
||||
@@ -158,9 +157,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
BlockWeights: BlockWeights;
|
||||
BodyId: BodyId;
|
||||
BodyPart: BodyPart;
|
||||
BodyPartAtLeastProportion: BodyPartAtLeastProportion;
|
||||
BodyPartFraction: BodyPartFraction;
|
||||
BodyPartMoreThanProportion: BodyPartMoreThanProportion;
|
||||
bool: bool;
|
||||
Bool: Bool;
|
||||
Bounty: Bounty;
|
||||
@@ -405,6 +401,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
FunctionMetadataV9: FunctionMetadataV9;
|
||||
FundIndex: FundIndex;
|
||||
FundInfo: FundInfo;
|
||||
Fungibility: Fungibility;
|
||||
Gas: Gas;
|
||||
GiltBid: GiltBid;
|
||||
GlobalValidationData: GlobalValidationData;
|
||||
@@ -479,11 +476,19 @@ declare module '@polkadot/types/types/registry' {
|
||||
InstanceMetadata: InstanceMetadata;
|
||||
InstantiateRequest: InstantiateRequest;
|
||||
InstantiateReturnValue: InstantiateReturnValue;
|
||||
InstructionV2: InstructionV2;
|
||||
InstructionWeights: InstructionWeights;
|
||||
InteriorMultiLocation: InteriorMultiLocation;
|
||||
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
|
||||
InvalidTransaction: InvalidTransaction;
|
||||
Json: Json;
|
||||
Junction: Junction;
|
||||
Junctions: Junctions;
|
||||
JunctionsV1: JunctionsV1;
|
||||
JunctionsV2: JunctionsV2;
|
||||
JunctionV0: JunctionV0;
|
||||
JunctionV1: JunctionV1;
|
||||
JunctionV2: JunctionV2;
|
||||
Justification: Justification;
|
||||
JustificationNotification: JustificationNotification;
|
||||
Justifications: Justifications;
|
||||
@@ -550,12 +555,20 @@ declare module '@polkadot/types/types/registry' {
|
||||
MortalEra: MortalEra;
|
||||
MultiAddress: MultiAddress;
|
||||
MultiAsset: MultiAsset;
|
||||
MultiAssetAbstractFungible: MultiAssetAbstractFungible;
|
||||
MultiAssetAbstractNonFungible: MultiAssetAbstractNonFungible;
|
||||
MultiAssetConcreteFungible: MultiAssetConcreteFungible;
|
||||
MultiAssetConcreteNonFungible: MultiAssetConcreteNonFungible;
|
||||
MultiAssetFilter: MultiAssetFilter;
|
||||
MultiAssetFilterV1: MultiAssetFilterV1;
|
||||
MultiAssetFilterV2: MultiAssetFilterV2;
|
||||
MultiAssets: MultiAssets;
|
||||
MultiAssetsV1: MultiAssetsV1;
|
||||
MultiAssetsV2: MultiAssetsV2;
|
||||
MultiAssetV0: MultiAssetV0;
|
||||
MultiAssetV1: MultiAssetV1;
|
||||
MultiAssetV2: MultiAssetV2;
|
||||
MultiDisputeStatementSet: MultiDisputeStatementSet;
|
||||
MultiLocation: MultiLocation;
|
||||
MultiLocationV0: MultiLocationV0;
|
||||
MultiLocationV1: MultiLocationV1;
|
||||
MultiLocationV2: MultiLocationV2;
|
||||
Multiplier: Multiplier;
|
||||
Multisig: Multisig;
|
||||
MultiSignature: MultiSignature;
|
||||
@@ -590,6 +603,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
OperatingMode: OperatingMode;
|
||||
Origin: Origin;
|
||||
OriginCaller: OriginCaller;
|
||||
OriginKindV0: OriginKindV0;
|
||||
OriginKindV1: OriginKindV1;
|
||||
OriginKindV2: OriginKindV2;
|
||||
OutboundHrmpMessage: OutboundHrmpMessage;
|
||||
OutboundLaneData: OutboundLaneData;
|
||||
OutboundMessageFee: OutboundMessageFee;
|
||||
@@ -656,7 +672,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
PhantomData: PhantomData;
|
||||
Phase: Phase;
|
||||
PhragmenScore: PhragmenScore;
|
||||
PluralityJunction: PluralityJunction;
|
||||
Points: Points;
|
||||
PortableRegistry: PortableRegistry;
|
||||
PortableType: PortableType;
|
||||
@@ -676,6 +691,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
ProxyDefinition: ProxyDefinition;
|
||||
ProxyState: ProxyState;
|
||||
ProxyType: ProxyType;
|
||||
QueryId: QueryId;
|
||||
QueryStatus: QueryStatus;
|
||||
QueueConfigData: QueueConfigData;
|
||||
QueuedParathread: QueuedParathread;
|
||||
Randomness: Randomness;
|
||||
@@ -726,6 +743,12 @@ declare module '@polkadot/types/types/registry' {
|
||||
ReportIdOf: ReportIdOf;
|
||||
ReserveData: ReserveData;
|
||||
ReserveIdentifier: ReserveIdentifier;
|
||||
Response: Response;
|
||||
ResponseV0: ResponseV0;
|
||||
ResponseV1: ResponseV1;
|
||||
ResponseV2: ResponseV2;
|
||||
ResponseV2Error: ResponseV2Error;
|
||||
ResponseV2Result: ResponseV2Result;
|
||||
Retriable: Retriable;
|
||||
RewardDestination: RewardDestination;
|
||||
RewardPoint: RewardPoint;
|
||||
@@ -947,8 +970,11 @@ declare module '@polkadot/types/types/registry' {
|
||||
ValidityAttestation: ValidityAttestation;
|
||||
VecInboundHrmpMessage: VecInboundHrmpMessage;
|
||||
VersionedMultiAsset: VersionedMultiAsset;
|
||||
VersionedMultiAssets: VersionedMultiAssets;
|
||||
VersionedMultiLocation: VersionedMultiLocation;
|
||||
VersionedResponse: VersionedResponse;
|
||||
VersionedXcm: VersionedXcm;
|
||||
VersionMigrationStage: VersionMigrationStage;
|
||||
VestingInfo: VestingInfo;
|
||||
VestingSchedule: VestingSchedule;
|
||||
Vote: Vote;
|
||||
@@ -968,39 +994,33 @@ declare module '@polkadot/types/types/registry' {
|
||||
VrfOutput: VrfOutput;
|
||||
VrfProof: VrfProof;
|
||||
Weight: Weight;
|
||||
WeightLimitV2: WeightLimitV2;
|
||||
WeightMultiplier: WeightMultiplier;
|
||||
WeightPerClass: WeightPerClass;
|
||||
WeightToFeeCoefficient: WeightToFeeCoefficient;
|
||||
WildFungibility: WildFungibility;
|
||||
WildMultiAsset: WildMultiAsset;
|
||||
WildMultiAssetV1: WildMultiAssetV1;
|
||||
WinnersData: WinnersData;
|
||||
WinnersDataTuple: WinnersDataTuple;
|
||||
WinningData: WinningData;
|
||||
WinningDataEntry: WinningDataEntry;
|
||||
WithdrawReasons: WithdrawReasons;
|
||||
Xcm: Xcm;
|
||||
XcmAssetEffects: XcmAssetEffects;
|
||||
XcmAssetId: XcmAssetId;
|
||||
XcmError: XcmError;
|
||||
XcmHrmpChannelAccepted: XcmHrmpChannelAccepted;
|
||||
XcmHrmpChannelClosing: XcmHrmpChannelClosing;
|
||||
XcmHrmpNewChannelOpenRequest: XcmHrmpNewChannelOpenRequest;
|
||||
XcmErrorV0: XcmErrorV0;
|
||||
XcmErrorV1: XcmErrorV1;
|
||||
XcmErrorV2: XcmErrorV2;
|
||||
XcmOrder: XcmOrder;
|
||||
XcmOrderBuyExecution: XcmOrderBuyExecution;
|
||||
XcmOrderDepositAsset: XcmOrderDepositAsset;
|
||||
XcmOrderDepositReserveAsset: XcmOrderDepositReserveAsset;
|
||||
XcmOrderExchangeAsset: XcmOrderExchangeAsset;
|
||||
XcmOrderInitiateReserveWithdraw: XcmOrderInitiateReserveWithdraw;
|
||||
XcmOrderInitiateTeleport: XcmOrderInitiateTeleport;
|
||||
XcmOrderQueryHolding: XcmOrderQueryHolding;
|
||||
XcmOrderV0: XcmOrderV0;
|
||||
XcmOrderV1: XcmOrderV1;
|
||||
XcmOrigin: XcmOrigin;
|
||||
XcmOriginKind: XcmOriginKind;
|
||||
XcmpMessageFormat: XcmpMessageFormat;
|
||||
XcmQueryResponse: XcmQueryResponse;
|
||||
XcmRelayedFrom: XcmRelayedFrom;
|
||||
XcmReserveAssetDeposit: XcmReserveAssetDeposit;
|
||||
XcmResponse: XcmResponse;
|
||||
XcmTeleportAsset: XcmTeleportAsset;
|
||||
XcmTransact: XcmTransact;
|
||||
XcmTransferAsset: XcmTransferAsset;
|
||||
XcmTransferReserveAsset: XcmTransferReserveAsset;
|
||||
XcmWithdrawAsset: XcmWithdrawAsset;
|
||||
XcmV0: XcmV0;
|
||||
XcmV1: XcmV1;
|
||||
XcmV2: XcmV2;
|
||||
XcmVersion: XcmVersion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,10 @@ assert(oo0.divn(123) && [...oo1.values()] && oo2[6].isAscii && oo3.divn(3) && oo
|
||||
const aa0 = registry.createType(' AccountId');
|
||||
const aa1 = registry.createType('BlockAttestations');
|
||||
const aa2 = registry.createType('ExtrinsicEra');
|
||||
const aa3 = registry.createType('VestingInfo');
|
||||
const aa4 = registry.createType('(Vec<ValidatorIndex>, CompactAssignmentsTo257, PhragmenScore, EraIndex)');
|
||||
|
||||
assert(aa0.isAscii && aa1.receipt && aa2.isMortalEra, 'All ok');
|
||||
assert(aa0.isAscii && aa1.receipt && aa2.isMortalEra && aa3.toHuman() && aa4[3].toNumber(), 'All ok');
|
||||
|
||||
// Should be Codec, we don't know this one
|
||||
const bb = registry.createType('Something');
|
||||
@@ -46,35 +48,52 @@ const vv = registry.createType('Vec< Vec< Vec< Vec<u8>> > >');
|
||||
// vec with tuple
|
||||
const vt = registry.createType('Vec<(u8, u16)>');
|
||||
// nested stuff from all-over
|
||||
const vn = registry.createType('Vec<(u32, (u32, u64), Vec<u8>, Vec<(u32, u64)>, [u8;32], [u128;32])>');
|
||||
const vn = registry.createType('Vec<(u32, (u32, u64), Vec<u8>, Vec<u32>, Vec<(u32, u64)>, [u8;32], [u128;32])>');
|
||||
// nested fixed
|
||||
const nf = registry.createType('[[[u8;32];5];3]');
|
||||
// with linkage
|
||||
const tl = registry.createType('(ValidatorPrefsWithCommission, Linkage<AccountId>)');
|
||||
|
||||
assert(ee[0].unwrap().unwrap().divn(123) && vb.unwrap().bitLength() && vv.toHuman() && vn.toHuman() && vt.toHuman(), 'All ok');
|
||||
assert(ee[0].unwrap().unwrap().divn(123) && vb.unwrap().bitLength() && vv.toHuman() && vn[0][3][0].bitLength && vt.toHuman() && nf.toHuman() && tl[1].next, 'All ok');
|
||||
|
||||
// tuple & struct
|
||||
const vs = registry.createType('(u8, {"a":"u32","b":"(u32,u64)"},(u8,u16),{"foo":"Bar"},u16)');
|
||||
// set
|
||||
const st = registry.createType('{"_set": { "A": 1, "B": 2, "C": 4 } }');
|
||||
// enum
|
||||
const en = registry.createType('{"_enum": { "A": 1, "B": 2, "C": 4 } }');
|
||||
|
||||
assert(vs.toHuman() && st.strings && en.index, 'All ok');
|
||||
|
||||
// Should end up as Raw
|
||||
const gg = registry.createType('[ u8 ;678]');
|
||||
|
||||
assert(gg.bitLength, 'All ok');
|
||||
assert(gg.subarray(1), 'All ok');
|
||||
|
||||
// Should end up as VecFixed<u128>
|
||||
const hh = registry.createType('[u128; 32]');
|
||||
// maps and sets
|
||||
const ms = registry.createType('(BTreeSet<u8>, BTreeMap<u16, u32>, HashMap<u64, u128>)');
|
||||
|
||||
assert(hh[0].bitLength(), 'All ok');
|
||||
assert(hh[0].bitLength() && ms[0].strings && ms[1].values && ms[2].keys, 'All ok');
|
||||
|
||||
// tuple! ITuple<[u32, Compact<u64>, u128, Codec]>
|
||||
const tt1 = registry.createType('(u32, Compact< u64 >, u128 , Something)');
|
||||
const tt1 = registry.createType('(u32, Compact<u64>, u128 , Something)');
|
||||
// unwraps into a u32
|
||||
const tt2 = registry.createType('( u32 )');
|
||||
// lots and lots of params
|
||||
const tt4 = registry.createType('(u8,u16,u32,u64,u128,u256,Break,u256,u128,u64,u32,u16,u8)');
|
||||
const tt2 = registry.createType('(((u32)))');
|
||||
// lots and lots of params (indicates recursion limit)
|
||||
const tt4 = registry.createType('(u8,u16,u32,u64,u128,u256,u8,u16,u32,u64,u128,u256,u8,u16,u32,u64,u128,u256)');
|
||||
// empty
|
||||
const tt5 = registry.createType('()');
|
||||
// nested tuples
|
||||
const tt6 = registry.createType('(u8, (u16, (u32, u64, u32)), (u64, u64))');
|
||||
const tt6 = registry.createType('(u8, (u16, (u32, u64, u128)), (u64, u128))');
|
||||
// more nested tuples
|
||||
const tt7 = registry.createType('(((u8, u8), (u8, u8)), u16)');
|
||||
const tt7 = registry.createType('(((u8, u16, u32), (u32, u16, u8)), u128, u256)');
|
||||
// nested tuples with a wrapper
|
||||
const tt8 = registry.createType('(u8, Vec<(u16, u32)>, Option<(u128, u128)>)');
|
||||
// same example as above
|
||||
const tt9 = registry.createType('(u32, (u32, u64), Vec<u8>, Vec<(u32, u64)>, [u8;32], [u128;32])');
|
||||
// tuple with nested fixed
|
||||
const tta = registry.createType('([u8;32], [u16;5])');
|
||||
|
||||
assert(tt1[2].bitLength() && tt2.bitLength() && tt4[3].bitLength() && tt5.isEmpty && tt6[1].toHuman() && tt7.toHuman() && tt8.toHuman() && tt9.toHuman(), 'All ok');
|
||||
assert(tt1[2].bitLength() && tt2.bitLength() && tt4[3].bitLength() && tt5.isEmpty && tt6[1].toHuman() && tt7.toHuman() && tt8.toHuman() && tt9.toHuman() && tta[1][1].bitLength(), 'All ok');
|
||||
|
||||
@@ -15,13 +15,17 @@ import { compareArray } from './utils/compareArray';
|
||||
* specific encoding/decoding on top of the base type.
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export abstract class AbstractArray<T extends Codec> extends Array<T> implements IVec<Codec> {
|
||||
export abstract class AbstractArray<T extends Codec> extends Array<T> implements IVec<T> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
protected constructor (registry: Registry, ...values: T[]) {
|
||||
super(...values);
|
||||
protected constructor (registry: Registry, values: T[]) {
|
||||
super(values.length);
|
||||
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
this[i] = values[i];
|
||||
}
|
||||
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Constructor, Registry } from '../types';
|
||||
import type { AnyJson, Codec, Constructor, ISet, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { compareSet, decodeU8a, sortSet, typeToConstructor } from './utils';
|
||||
const l = logger('BTreeSet');
|
||||
|
||||
/** @internal */
|
||||
function decodeSetFromU8a<V extends Codec = Codec> (registry: Registry, ValClass: Constructor<V>, u8a: Uint8Array): Set<V> {
|
||||
function decodeSetFromU8a<V extends Codec> (registry: Registry, ValClass: Constructor<V>, u8a: Uint8Array): Set<V> {
|
||||
const output = new Set<V>();
|
||||
const [offset, length] = compactFromU8a(u8a);
|
||||
const types = [];
|
||||
@@ -30,7 +30,7 @@ function decodeSetFromU8a<V extends Codec = Codec> (registry: Registry, ValClass
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeSetFromSet<V extends Codec = Codec> (registry: Registry, ValClass: Constructor<V>, value: Set<any> | string[]): Set<V> {
|
||||
function decodeSetFromSet<V extends Codec> (registry: Registry, ValClass: Constructor<V>, value: Set<any> | string[]): Set<V> {
|
||||
const output = new Set<V>();
|
||||
|
||||
value.forEach((val: any) => {
|
||||
@@ -60,7 +60,7 @@ function decodeSetFromSet<V extends Codec = Codec> (registry: Registry, ValClass
|
||||
* @param jsonSet
|
||||
* @internal
|
||||
*/
|
||||
function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constructor<V> | string, value?: Uint8Array | string | string[] | Set<any>): Set<V> {
|
||||
function decodeSet<V extends Codec> (registry: Registry, valType: Constructor<V> | string, value?: Uint8Array | string | string[] | Set<any>): Set<V> {
|
||||
if (!value) {
|
||||
return new Set<V>();
|
||||
}
|
||||
@@ -76,7 +76,7 @@ function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constr
|
||||
throw new Error('BTreeSet: cannot decode type');
|
||||
}
|
||||
|
||||
export class BTreeSet<V extends Codec = Codec> extends Set<V> implements Codec {
|
||||
export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
@@ -125,6 +125,13 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements Codec {
|
||||
return this.size === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The actual set values as a string[]
|
||||
*/
|
||||
public get strings (): string[] {
|
||||
return [...super.values()].map((v) => v.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Compares the value of the input to see if there is a match
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('Date', (): void => {
|
||||
});
|
||||
|
||||
describe('encode', (): void => {
|
||||
const testEncode = (to: 'toBigInt' | 'toBn' | 'toISOString' | 'toNumber' | CodecTo, expected: BigInt | BN | number | string | Uint8Array): void =>
|
||||
const testEncode = (to: 'toBigInt' | 'toBn' | 'toISOString' | 'toNumber' | CodecTo, expected: bigint | BN | number | string | Uint8Array): void =>
|
||||
it(`can encode ${to}`, (): void => {
|
||||
expect(new CodecDate(registry, 421)[to]()).toEqual(expected);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyNumber, Codec, Registry } from '../types';
|
||||
import type { AnyNumber, INumber, Registry } from '../types';
|
||||
import type { UIntBitLength } from './types';
|
||||
|
||||
import { BN, bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util';
|
||||
@@ -33,7 +33,7 @@ function decodeDate (value: CodecDate | Date | AnyNumber): Date {
|
||||
* and has all the methods available that are applicable to any `Date`
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export class CodecDate extends Date implements Codec {
|
||||
export class CodecDate extends Date implements INumber {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
@@ -259,14 +259,15 @@ export class Enum implements IEnum {
|
||||
* @description Checks if the Enum points to a [[Null]] type
|
||||
*/
|
||||
public get isNone (): boolean {
|
||||
return this.isNull;
|
||||
return this.#raw instanceof Null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the Enum points to a [[Null]] type (deprecated, use isNone)
|
||||
* @description Checks if the Enum points to a [[Null]] type
|
||||
* @deprecated use isNone
|
||||
*/
|
||||
public get isNull (): boolean {
|
||||
return this.#raw instanceof Null;
|
||||
return this.isNone;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,7 +332,7 @@ export class Enum implements IEnum {
|
||||
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
||||
*/
|
||||
public toHuman (isExtended?: boolean): AnyJson {
|
||||
return this.#isBasic
|
||||
return this.#isBasic || this.isNone
|
||||
? this.type
|
||||
: { [this.type]: this.#raw.toHuman(isExtended) };
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Constructor, Registry } from '../types';
|
||||
import type { AnyJson, Codec, Constructor, IMap, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { compareMap, decodeU8a, sortMap, typeToConstructor } from './utils';
|
||||
const l = logger('Map');
|
||||
|
||||
/** @internal */
|
||||
function decodeMapFromU8a<K extends Codec = Codec, V extends Codec = Codec> (registry: Registry, KeyClass: Constructor<K>, ValClass: Constructor<V>, u8a: Uint8Array): Map<K, V> {
|
||||
function decodeMapFromU8a<K extends Codec, V extends Codec> (registry: Registry, KeyClass: Constructor<K>, ValClass: Constructor<V>, u8a: Uint8Array): Map<K, V> {
|
||||
const output = new Map<K, V>();
|
||||
const [offset, length] = compactFromU8a(u8a);
|
||||
const types = [];
|
||||
@@ -33,7 +33,7 @@ function decodeMapFromU8a<K extends Codec = Codec, V extends Codec = Codec> (reg
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeMapFromMap<K extends Codec = Codec, V extends Codec = Codec> (registry: Registry, KeyClass: Constructor<K>, ValClass: Constructor<V>, value: Map<any, any>): Map<K, V> {
|
||||
function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry, KeyClass: Constructor<K>, ValClass: Constructor<V>, value: Map<any, any>): Map<K, V> {
|
||||
const output = new Map<K, V>();
|
||||
|
||||
value.forEach((val: any, key: any) => {
|
||||
@@ -75,7 +75,7 @@ function decodeMapFromMap<K extends Codec = Codec, V extends Codec = Codec> (reg
|
||||
* @param jsonMap
|
||||
* @internal
|
||||
*/
|
||||
function decodeMap<K extends Codec = Codec, V extends Codec = Codec> (registry: Registry, keyType: Constructor<K> | string, valType: Constructor<V> | string, value?: Uint8Array | string | Map<any, any>): Map<K, V> {
|
||||
function decodeMap<K extends Codec, V extends Codec> (registry: Registry, keyType: Constructor<K> | string, valType: Constructor<V> | string, value?: Uint8Array | string | Map<any, any>): Map<K, V> {
|
||||
const KeyClass = typeToConstructor(registry, keyType);
|
||||
const ValClass = typeToConstructor(registry, valType);
|
||||
|
||||
@@ -92,7 +92,7 @@ function decodeMap<K extends Codec = Codec, V extends Codec = Codec> (registry:
|
||||
throw new Error('Map: cannot decode type');
|
||||
}
|
||||
|
||||
export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends Map<K, V> implements Codec {
|
||||
export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends Map<K, V> implements IMap<K, V> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import { U32 } from '../primitive';
|
||||
import { Range } from '.';
|
||||
|
||||
describe('Range', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
let range: Range<U32>;
|
||||
|
||||
beforeEach((): void => {
|
||||
const Clazz = Range.with(U32);
|
||||
|
||||
range = new Clazz(
|
||||
registry,
|
||||
[new U32(registry, 1), new U32(registry, 2)]
|
||||
);
|
||||
});
|
||||
|
||||
it('decodes', (): void => {
|
||||
expect(range.toJSON()).toEqual([1, 2]);
|
||||
});
|
||||
|
||||
it('encodes', (): void => {
|
||||
expect(range.toU8a()).toEqual(new Uint8Array([1, 0, 0, 0, 2, 0, 0, 0]));
|
||||
});
|
||||
|
||||
it('has a sane toRawType representation', (): void => {
|
||||
expect(range.toRawType()).toEqual('Range<u32>');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyTuple, Constructor, INumber, Registry } from '../types';
|
||||
|
||||
import { Tuple } from '../codec/Tuple';
|
||||
|
||||
type RangeType = 'Range' | 'RangeInclusive';
|
||||
|
||||
/**
|
||||
* @name Range
|
||||
* @description
|
||||
* Rust `Range<T>` representation
|
||||
*/
|
||||
export class Range<T extends INumber> extends Tuple {
|
||||
#rangeName: RangeType;
|
||||
|
||||
constructor (registry: Registry, Type: Constructor<T> | string, value?: AnyTuple, rangeName: RangeType = 'Range') {
|
||||
super(registry, { end: Type, start: Type }, value);
|
||||
|
||||
this.#rangeName = rangeName;
|
||||
}
|
||||
|
||||
public static override with <T extends INumber> (Types: Constructor<T> | string): Constructor<Range<T>> {
|
||||
return class extends Range<T> {
|
||||
constructor (registry: Registry, value?: AnyTuple) {
|
||||
super(registry, Types, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the starting range value
|
||||
*/
|
||||
public get start (): T {
|
||||
return this[0] as T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the ending range value
|
||||
*/
|
||||
public get end (): T {
|
||||
return this[1] as T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public override toRawType (): string {
|
||||
return `${this.#rangeName}<${this.start.toRawType()}>`;
|
||||
}
|
||||
}
|
||||
|
||||
export class RangeInclusive<T extends INumber = INumber> extends Range<T> {
|
||||
constructor (registry: Registry, type: Constructor<T> | string, value?: AnyTuple) {
|
||||
super(registry, type, value, 'RangeInclusive');
|
||||
}
|
||||
|
||||
public static override with <T extends INumber> (Types: Constructor<T> | string): Constructor<RangeInclusive<T>> {
|
||||
return class extends RangeInclusive<T> {
|
||||
constructor (registry: Registry, value?: AnyTuple) {
|
||||
super(registry, Types, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Codec, Constructor, Registry } from '../types';
|
||||
import type { Codec, Constructor, IResult, Registry } from '../types';
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Enum } from './Enum';
|
||||
* @description
|
||||
* A Result maps to the Rust Result type, that can either wrap a success or error value
|
||||
*/
|
||||
export class Result<O extends Codec, E extends Codec> extends Enum {
|
||||
export class Result<O extends Codec, E extends Codec> extends Enum implements IResult<O, E> {
|
||||
constructor (registry: Registry, Ok: Constructor<O> | string, Err: Constructor<E> | string, value?: unknown) {
|
||||
// NOTE This is order-dependent, Ok (with index 0) needs to be first
|
||||
// eslint-disable-next-line sort-keys
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { Codec, Constructor, Registry } from '../types';
|
||||
import type { Constructor, ISet, Registry } from '../types';
|
||||
|
||||
import { assert, BN, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -18,25 +18,25 @@ function encodeSet (setValues: SetValues, value: string[]): BN {
|
||||
|
||||
/** @internal */
|
||||
function decodeSetArray (setValues: SetValues, value: string[]): string[] {
|
||||
return value.reduce((result, key): string[] => {
|
||||
return value.reduce<string[]>((result, key): string[] => {
|
||||
assert(!isUndefined(setValues[key]), () => `Set: Invalid key '${key}' passed to Set, allowed ${Object.keys(setValues).join(', ')}`);
|
||||
|
||||
result.push(key);
|
||||
|
||||
return result;
|
||||
}, [] as string[]);
|
||||
}, []);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeSetNumber (setValues: SetValues, _value: BN | number): string[] {
|
||||
const bn = bnToBn(_value);
|
||||
const result = Object.keys(setValues).reduce((result, key): string[] => {
|
||||
const result = Object.keys(setValues).reduce<string[]>((result, key): string[] => {
|
||||
if (bn.and(bnToBn(setValues[key])).eq(bnToBn(setValues[key]))) {
|
||||
result.push(key);
|
||||
}
|
||||
|
||||
return result;
|
||||
}, [] as string[]);
|
||||
}, []);
|
||||
|
||||
const computed = encodeSet(setValues, result);
|
||||
|
||||
@@ -74,8 +74,7 @@ function decodeSet (setValues: SetValues, value: string[] | Set<string> | Uint8A
|
||||
* An Set is an array of string values, represented an an encoded type by
|
||||
* a bitwise representation of the values.
|
||||
*/
|
||||
// FIXME This is a prime candidate to extend the JavaScript built-in Set
|
||||
export class CodecSet extends Set<string> implements Codec {
|
||||
export class CodecSet extends Set<string> implements ISet<string> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
@@ -98,13 +97,12 @@ export class CodecSet extends Set<string> implements Codec {
|
||||
super(registry, values, value as undefined, bitLength);
|
||||
|
||||
Object.keys(values).forEach((_key): void => {
|
||||
const name = stringUpperFirst(stringCamelCase(_key));
|
||||
const iskey = `is${name}`;
|
||||
const iskey = `is${stringUpperFirst(stringCamelCase(_key))}`;
|
||||
|
||||
isUndefined(this[iskey as keyof this]) &&
|
||||
Object.defineProperty(this, iskey, {
|
||||
enumerable: true,
|
||||
get: (): boolean => this.strings.includes(_key)
|
||||
get: () => this.strings.includes(_key)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,8 @@ import type { CodecTo } from '../types';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import { Text, U32 } from '../primitive';
|
||||
import { Struct, Vec } from '.';
|
||||
import { TEST_A } from './Struct.data';
|
||||
import { Enum, Struct, Vec } from '.';
|
||||
|
||||
describe('Struct', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
@@ -84,6 +85,30 @@ describe('Struct', (): void => {
|
||||
expect(s.toString()).toBe('{"foo":[{"bar":"1"},{"bar":"2"}]}');
|
||||
});
|
||||
|
||||
it('decodes a previously problematic input', (): void => {
|
||||
let data;
|
||||
|
||||
try {
|
||||
data = new Struct(registry, {
|
||||
a: 'u32',
|
||||
b: 'H256',
|
||||
c: 'H256',
|
||||
swap: Enum.with({
|
||||
A: 'u256',
|
||||
B: 'u256'
|
||||
}),
|
||||
d: Vec.with('u8'),
|
||||
e: 'u8'
|
||||
}, TEST_A);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
expect(data.get('d')).toHaveLength(50000);
|
||||
});
|
||||
|
||||
it('decodes from a Map input', (): void => {
|
||||
const input = new Struct(registry, {
|
||||
a: U32,
|
||||
|
||||
@@ -136,7 +136,7 @@ export class Struct<
|
||||
// input values, mapped by key can be anything (construction)
|
||||
V extends { [K in keyof S]: any } = { [K in keyof S]: any },
|
||||
// type names, mapped by key, name of Class in S
|
||||
E extends { [K in keyof S]: string } = { [K in keyof S]: string }> extends Map<keyof S, Codec> implements IStruct {
|
||||
E extends { [K in keyof S]: string } = { [K in keyof S]: string }> extends Map<keyof S, Codec> implements IStruct<keyof S> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
@@ -147,9 +147,7 @@ export class Struct<
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
constructor (registry: Registry, Types: S, value: V | Map<unknown, unknown> | unknown[] | string = {} as V, jsonMap: Map<keyof S, string> = new Map()) {
|
||||
super(Object.entries(
|
||||
decodeStruct(registry, mapToTypeMap(registry, Types), value, jsonMap)
|
||||
) as [keyof S, Codec][]);
|
||||
super(Object.entries(decodeStruct(registry, mapToTypeMap(registry, Types), value, jsonMap)));
|
||||
|
||||
this.registry = registry;
|
||||
this.#jsonMap = jsonMap;
|
||||
@@ -181,7 +179,7 @@ export class Struct<
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The available keys for this enum
|
||||
* @description The available keys for this struct
|
||||
*/
|
||||
public get defKeys (): string[] {
|
||||
return Object.keys(this.#Types);
|
||||
@@ -207,7 +205,7 @@ export class Struct<
|
||||
*/
|
||||
public get Type (): E {
|
||||
return (Object
|
||||
.entries(this.#Types) as [keyof S, Constructor][])
|
||||
.entries(this.#Types))
|
||||
.reduce((result: E, [key, Type]): E => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
(result as any)[key] = new Type(this.registry).toRawType();
|
||||
@@ -301,9 +299,7 @@ export class Struct<
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public toRawType (): string {
|
||||
return stringify(
|
||||
Struct.typesToMap(this.registry, this.#Types)
|
||||
);
|
||||
return stringify(Struct.typesToMap(this.registry, this.#Types));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { AnyNumber, AnyString, AnyU8a, Codec, Constructor, ITuple, Registry } from '../types';
|
||||
|
||||
import { isHex, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { isFunction, isHex, isString, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from './AbstractArray';
|
||||
import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils';
|
||||
@@ -14,7 +14,9 @@ type TupleConstructors = Constructor[] | {
|
||||
[index: string]: Constructor;
|
||||
};
|
||||
|
||||
type TupleTypes = (Constructor | string)[] | {
|
||||
type TupleType = (Constructor | string);
|
||||
|
||||
type TupleTypes = TupleType[] | {
|
||||
[index: string]: Constructor | string;
|
||||
};
|
||||
|
||||
@@ -52,17 +54,19 @@ function decodeTuple (registry: Registry, _Types: TupleConstructors, value?: Any
|
||||
export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
private _Types: TupleConstructors;
|
||||
|
||||
constructor (registry: Registry, Types: TupleTypes, value?: AnyTuple) {
|
||||
constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTuple) {
|
||||
const Clazzes = Array.isArray(Types)
|
||||
? Types.map((type): Constructor => typeToConstructor(registry, type))
|
||||
: mapToTypeMap(registry, Types);
|
||||
? Types.map((t) => typeToConstructor(registry, t))
|
||||
: isFunction(Types) || isString(Types)
|
||||
? [typeToConstructor(registry, Types)]
|
||||
: mapToTypeMap(registry, Types);
|
||||
|
||||
super(registry, ...decodeTuple(registry, Clazzes, value));
|
||||
super(registry, decodeTuple(registry, Clazzes, value));
|
||||
|
||||
this._Types = Clazzes;
|
||||
}
|
||||
|
||||
public static with (Types: TupleTypes): Constructor<Tuple> {
|
||||
public static with (Types: TupleTypes | TupleType): Constructor<Tuple> {
|
||||
return class extends Tuple {
|
||||
constructor (registry: Registry, value?: AnyTuple) {
|
||||
super(registry, Types, value);
|
||||
|
||||
@@ -25,7 +25,7 @@ export class Vec<T extends Codec> extends AbstractArray<T> {
|
||||
constructor (registry: Registry, Type: Constructor<T> | string, value: Vec<Codec> | Uint8Array | string | unknown[] = []) {
|
||||
const Clazz = typeToConstructor<T>(registry, Type);
|
||||
|
||||
super(registry, ...Vec.decodeVec(registry, Clazz, value));
|
||||
super(registry, Vec.decodeVec(registry, Clazz, value));
|
||||
|
||||
this._Type = Clazz;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
constructor (registry: Registry, Type: Constructor<T> | string, length: number, value: VecFixed<any> | Uint8Array | string | any[] = [] as any[]) {
|
||||
const Clazz = typeToConstructor<T>(registry, Type);
|
||||
|
||||
super(registry, ...decodeVecFixed(registry, Clazz, length, value));
|
||||
super(registry, decodeVecFixed(registry, Clazz, length, value));
|
||||
|
||||
this._Type = Clazz;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ export { Json } from './Json';
|
||||
export { Linkage } from './Linkage';
|
||||
export { CodecMap, CodecMap as Map } from './Map';
|
||||
export { Option } from './Option';
|
||||
export { Range, RangeInclusive } from './Range';
|
||||
export { Raw } from './Raw';
|
||||
export { Result } from './Result';
|
||||
export { CodecSet, CodecSet as Set } from './Set';
|
||||
|
||||
@@ -7,20 +7,11 @@ import type { TypeDef } from './types';
|
||||
|
||||
import { assert, isNumber, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
import { BTreeMap, BTreeSet, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec';
|
||||
import { BTreeMap, BTreeSet, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec';
|
||||
import { Bytes, Null } from '../primitive';
|
||||
import { getTypeDef } from './getTypeDef';
|
||||
import { TypeDefInfo } from './types';
|
||||
|
||||
export function createClass<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K): DetectConstructor<T, K> {
|
||||
return getTypeClass(
|
||||
registry,
|
||||
registry.isLookupType(type)
|
||||
? registry.lookup.getTypeDef(type)
|
||||
: getTypeDef(type)
|
||||
);
|
||||
}
|
||||
|
||||
function getSubDefArray (value: TypeDef): TypeDef[] {
|
||||
assert(value.sub && Array.isArray(value.sub), () => `Expected subtype as TypeDef[] in ${stringify(value)}`);
|
||||
|
||||
@@ -123,6 +114,9 @@ const infoMapping: Record<TypeDefInfo, (registry: Registry, value: TypeDef) => C
|
||||
[TypeDefInfo.Plain]: (registry: Registry, value: TypeDef): Constructor<Codec> =>
|
||||
registry.getOrUnknown(value.type),
|
||||
|
||||
[TypeDefInfo.Range]: (registry: Registry, value: TypeDef): Constructor<Codec> =>
|
||||
(value.type.includes('RangeInclusive') ? RangeInclusive : Range).with(getSubType(value)),
|
||||
|
||||
[TypeDefInfo.Result]: (registry: Registry, value: TypeDef): Constructor<Codec> => {
|
||||
const [Ok, Err] = getTypeClassArray(value);
|
||||
|
||||
@@ -180,14 +174,14 @@ const infoMapping: Record<TypeDefInfo, (registry: Registry, value: TypeDef) => C
|
||||
|
||||
// Returns the type Class for construction
|
||||
export function getTypeClass<T extends Codec = Codec> (registry: Registry, typeDef: TypeDef): Constructor<T> {
|
||||
let Type = registry.get<T>(typeDef.type) as Constructor<T> | undefined;
|
||||
let Type = registry.get(typeDef.type);
|
||||
|
||||
if (Type) {
|
||||
return Type;
|
||||
return Type as Constructor<T>;
|
||||
}
|
||||
|
||||
try {
|
||||
Type = infoMapping[typeDef.info](registry, typeDef) as Constructor<T>;
|
||||
Type = infoMapping[typeDef.info](registry, typeDef);
|
||||
|
||||
assert(Type, 'No class created');
|
||||
|
||||
@@ -198,8 +192,17 @@ export function getTypeClass<T extends Codec = Codec> (registry: Registry, typeD
|
||||
Type.__fallbackType = typeDef.fallbackType;
|
||||
}
|
||||
|
||||
return Type;
|
||||
return Type as Constructor<T>;
|
||||
} catch (error) {
|
||||
throw new Error(`Unable to construct class from ${stringify(typeDef)}: ${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function createClass<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K): DetectConstructor<T, K> {
|
||||
return getTypeClass(
|
||||
registry,
|
||||
registry.isLookupType(type)
|
||||
? registry.lookup.getTypeDef(type)
|
||||
: getTypeDef(type)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { CodecSet, Int } from '../codec';
|
||||
import { createClass, createTypeUnsafe, TypeRegistry } from '.';
|
||||
import { createClass, TypeRegistry } from '.';
|
||||
|
||||
describe('createType', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
@@ -27,7 +27,7 @@ describe('createType', (): void => {
|
||||
|
||||
it('allows creation of a Struct', (): void => {
|
||||
const raw = '{"balance":"Balance","index":"u32"}';
|
||||
const struct = createTypeUnsafe(registry, raw, [{
|
||||
const struct = registry.createTypeUnsafe(raw, [{
|
||||
balance: 1234,
|
||||
index: '0x10'
|
||||
}]);
|
||||
@@ -41,49 +41,49 @@ describe('createType', (): void => {
|
||||
|
||||
it('allows creation of a BTreeMap', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'BTreeMap<Text,u32>', ['0x041c62617a7a696e6745000000']).toString()
|
||||
registry.createTypeUnsafe('BTreeMap<Text,u32>', ['0x041c62617a7a696e6745000000']).toString()
|
||||
).toEqual('{"bazzing":69}');
|
||||
});
|
||||
|
||||
it('allows creation of a BTreeSet', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'BTreeSet<u32>', ['0x1002000000180000001e00000050000000']).toString()
|
||||
registry.createTypeUnsafe('BTreeSet<u32>', ['0x1002000000180000001e00000050000000']).toString()
|
||||
).toEqual('[2,24,30,80]');
|
||||
});
|
||||
|
||||
it('allows creation of a Enum (simple)', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '{"_enum": ["A", "B", "C"]}', [1]).toJSON()
|
||||
registry.createTypeUnsafe('{"_enum": ["A", "B", "C"]}', [1]).toJSON()
|
||||
).toEqual('B');
|
||||
});
|
||||
|
||||
it('allows creation of a Enum (with types)', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '{"_enum": {"A": null, "B": "u32", "C": null} }', [1]).toJSON()
|
||||
registry.createTypeUnsafe('{"_enum": {"A": null, "B": "u32", "C": null} }', [1]).toJSON()
|
||||
).toEqual({ b: 0 });
|
||||
});
|
||||
|
||||
it('allows creation of a Enum (with indexes)', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '{"_enum": {"A": 42, "B": 69, "C": 255} }', [69]).toJSON()
|
||||
registry.createTypeUnsafe('{"_enum": {"A": 42, "B": 69, "C": 255} }', [69]).toJSON()
|
||||
).toEqual('B');
|
||||
});
|
||||
|
||||
it('allows creation of a Result', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'Result<u32,Text>', ['0x011064656667']).toJSON()
|
||||
registry.createTypeUnsafe('Result<u32,Text>', ['0x011064656667']).toJSON()
|
||||
).toEqual({ err: 'defg' });
|
||||
});
|
||||
|
||||
it('allows creation of a Set', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe<CodecSet>(registry, '{"_set": { "A": 1, "B": 2, "C": 4, "D": 8, "E": 16, "G": 32, "H": 64, "I": 128 } }', [1 + 4 + 16 + 64]).strings
|
||||
registry.createTypeUnsafe<CodecSet>('{"_set": { "A": 1, "B": 2, "C": 4, "D": 8, "E": 16, "G": 32, "H": 64, "I": 128 } }', [1 + 4 + 16 + 64]).strings
|
||||
).toEqual(['A', 'C', 'E', 'H']);
|
||||
});
|
||||
|
||||
it('allows creation of a Tuple', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '(Balance,u32)', [[1234, 5678]]).toJSON()
|
||||
registry.createTypeUnsafe('(Balance,u32)', [[1234, 5678]]).toJSON()
|
||||
).toEqual([
|
||||
1234, // '0x000000000000000000000000000004d2',
|
||||
5678
|
||||
@@ -92,13 +92,13 @@ describe('createType', (): void => {
|
||||
|
||||
it('allows creation for a UInt<bitLength>', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'UInt<2048>').toRawType()
|
||||
registry.createType('UInt<2048>').toRawType()
|
||||
).toEqual('u2048');
|
||||
});
|
||||
|
||||
it('fails creation for a UInt<bitLength> where bitLength is not power of 8', (): void => {
|
||||
expect(
|
||||
() => createTypeUnsafe(registry, 'UInt<20>').toRawType()
|
||||
() => registry.createType('UInt<20>').toRawType()
|
||||
).toThrow('UInt<20>: Only support for UInt<bitLength>, where length <= 8192 and a power of 8');
|
||||
});
|
||||
|
||||
@@ -112,44 +112,44 @@ describe('createType', (): void => {
|
||||
|
||||
it('allows creation of a [u8; 8]', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '[u8; 8]', [[0x12, 0x00, 0x23, 0x00, 0x45, 0x00, 0x67, 0x00]]).toHex()
|
||||
registry.createTypeUnsafe('[u8; 8]', [[0x12, 0x00, 0x23, 0x00, 0x45, 0x00, 0x67, 0x00]]).toHex()
|
||||
).toEqual('0x1200230045006700');
|
||||
});
|
||||
|
||||
it('allows creation of a [u16; 4]', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '[u16; 4]', [[0x1200, 0x2300, 0x4500, 0x6700]]).toU8a()
|
||||
registry.createTypeUnsafe('[u16; 4]', [[0x1200, 0x2300, 0x4500, 0x6700]]).toU8a()
|
||||
).toEqual(new Uint8Array([0x00, 0x12, 0x00, 0x23, 0x00, 0x45, 0x00, 0x67]));
|
||||
});
|
||||
|
||||
describe('isPedantic', (): void => {
|
||||
it('correctly decodes Bytes', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'Bytes', ['0x12345678'], { isPedantic: true }).toHex()
|
||||
registry.createTypeUnsafe('Bytes', ['0x12345678'], { isPedantic: true }).toHex()
|
||||
).toEqual('0x12345678');
|
||||
});
|
||||
|
||||
it('correctly decodes Bytes (prefixed)', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'Bytes', [new Uint8Array([4 << 2, 0x12, 0x34, 0x56, 0x78])], { isPedantic: true }).toHex()
|
||||
registry.createTypeUnsafe('Bytes', [new Uint8Array([4 << 2, 0x12, 0x34, 0x56, 0x78])], { isPedantic: true }).toHex()
|
||||
).toEqual('0x12345678');
|
||||
});
|
||||
|
||||
it('correctly decodes Text', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'Text', ['0x70726f7669646572'], { isPedantic: true }).toString()
|
||||
registry.createTypeUnsafe('Text', ['0x70726f7669646572'], { isPedantic: true }).toString()
|
||||
).toEqual('provider');
|
||||
});
|
||||
|
||||
it('correctly decodes Type', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, 'Type', ['0x5665633c75383e'], { isPedantic: true }).toString()
|
||||
registry.createTypeUnsafe('Type', ['0x5665633c75383e'], { isPedantic: true }).toString()
|
||||
).toEqual('Bytes'); // Vec<u8> -> Bytes
|
||||
});
|
||||
|
||||
it('correctly decodes [u16; 4]', (): void => {
|
||||
expect(
|
||||
createTypeUnsafe(registry, '[u16; 4]', ['0x0012002300450067'], { isPedantic: true }).toHex()
|
||||
registry.createTypeUnsafe('[u16; 4]', ['0x0012002300450067'], { isPedantic: true }).toHex()
|
||||
).toEqual('0x0012002300450067');
|
||||
});
|
||||
});
|
||||
@@ -180,12 +180,12 @@ describe('createType', (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
const value = createTypeUnsafe(registry, 'TestComplex', [{
|
||||
const value = registry.createType('TestComplex', {
|
||||
accountId: '0x1234567812345678123456781234567812345678123456781234567812345678',
|
||||
balance: 123,
|
||||
fromSrml: 0,
|
||||
log: [456, 789]
|
||||
}]);
|
||||
});
|
||||
|
||||
expect(value instanceof createClass(registry, 'TestComplex')).toBe(true);
|
||||
});
|
||||
@@ -218,7 +218,7 @@ describe('createType', (): void => {
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const cmpDef: any = createTypeUnsafe(registry, 'TestComplex');
|
||||
const cmpDef: any = registry.createType('TestComplex');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call
|
||||
expect(cmpDef.balance.bitLength()).toEqual(128);
|
||||
@@ -226,7 +226,7 @@ describe('createType', (): void => {
|
||||
registry.register({ Balance: 'u32' });
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const cmpu32: any = createTypeUnsafe(registry, 'TestComplex');
|
||||
const cmpu32: any = registry.createType('TestComplex');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call
|
||||
expect(cmpu32.balance.bitLength()).toEqual(32);
|
||||
|
||||
@@ -12,18 +12,25 @@ import { createClass } from './createClass';
|
||||
|
||||
// With isPedantic, actually check that the encoding matches that supplied. This
|
||||
// is much slower, but verifies that we have the correct types defined
|
||||
function checkInstance (created: Codec, value: Uint8Array): void {
|
||||
function checkInstance (created: Codec, matcher: Uint8Array): void {
|
||||
const u8a = created.toU8a();
|
||||
const rawType = created.toRawType();
|
||||
|
||||
assert(
|
||||
u8aEq(value, u8a) || (
|
||||
// when length-prefixed from hex, just check the actual length
|
||||
const isOk = (
|
||||
// full match, all ok
|
||||
u8aEq(u8a, matcher) ||
|
||||
(
|
||||
// on a length-prefixed type, just check the actual length
|
||||
['Bytes', 'Text', 'Type'].includes(rawType) &&
|
||||
value.length === (created as Bytes).length
|
||||
),
|
||||
() => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(value, 512)} (${value.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`
|
||||
matcher.length === (created as Bytes).length
|
||||
) ||
|
||||
(
|
||||
// when the created is empty and matcher is also empty, let it slide...
|
||||
created.isEmpty &&
|
||||
matcher.every((v) => !v)
|
||||
)
|
||||
);
|
||||
|
||||
assert(isOk, () => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(matcher, 512)} (${matcher.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`);
|
||||
}
|
||||
|
||||
function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false): void {
|
||||
@@ -38,7 +45,7 @@ function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false):
|
||||
|
||||
// Initializes a type with a value. This also checks for fallbacks and in the cases
|
||||
// where isPedantic is specified (storage decoding), also check the format/structure
|
||||
function initType<T extends Codec = Codec, K extends string = string> (registry: Registry, Type: Constructor, params: unknown[] = [], { blockHash, isOptional, isPedantic }: CreateOptions = {}): DetectCodec<T, K> {
|
||||
function initType<T extends Codec> (registry: Registry, Type: Constructor, params: unknown[] = [], { blockHash, isOptional, isPedantic }: CreateOptions = {}): T {
|
||||
const created = new (isOptional ? Option.with(Type) : Type)(registry, ...params);
|
||||
|
||||
checkPedantic(created, params, isPedantic);
|
||||
@@ -59,7 +66,7 @@ export function createTypeUnsafe<T extends Codec = Codec, K extends string = str
|
||||
let firstError: Error | null = null;
|
||||
|
||||
try {
|
||||
Clazz = createClass<T, K>(registry, type);
|
||||
Clazz = createClass(registry, type);
|
||||
|
||||
return initType(registry, Clazz, params, options);
|
||||
} catch (error) {
|
||||
@@ -68,7 +75,7 @@ export function createTypeUnsafe<T extends Codec = Codec, K extends string = str
|
||||
|
||||
if (Clazz && Clazz.__fallbackType) {
|
||||
try {
|
||||
Clazz = createClass<T, K>(registry, Clazz.__fallbackType as unknown as K);
|
||||
Clazz = createClass(registry, Clazz.__fallbackType as unknown as K);
|
||||
|
||||
return initType(registry, Clazz, params, options);
|
||||
} catch {
|
||||
@@ -86,5 +93,5 @@ export function createTypeUnsafe<T extends Codec = Codec, K extends string = str
|
||||
* @param params - The value to instantiate the type with
|
||||
*/
|
||||
export function createType<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K, ...params: unknown[]): DetectCodec<T, K> {
|
||||
return createTypeUnsafe<T, K>(registry, type, params);
|
||||
return createTypeUnsafe(registry, type, params);
|
||||
}
|
||||
|
||||
@@ -133,6 +133,8 @@ const encoders: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef) => st
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
[TypeDefInfo.Plain]: (registry: Registry, typeDef: TypeDef) =>
|
||||
typeDef.displayName || typeDef.type,
|
||||
[TypeDefInfo.Range]: (registry: Registry, typeDef: TypeDef) =>
|
||||
encodeWithParams(registry, typeDef, typeDef.type.includes('RangeInclusive') ? 'RangeInclusive' : 'Range'),
|
||||
[TypeDefInfo.Result]: (registry: Registry, typeDef: TypeDef) =>
|
||||
encodeWithParams(registry, typeDef, 'Result'),
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
@@ -142,6 +142,14 @@ function _decodeFixedVec (value: TypeDef, type: string, _: string, count: number
|
||||
return value;
|
||||
}
|
||||
|
||||
function _decodeRange (value: TypeDef, _: string, subType: string): TypeDef {
|
||||
const Type = getTypeDef(subType);
|
||||
|
||||
value.sub = [Type, Type];
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// decode a tuple
|
||||
function _decodeTuple (value: TypeDef, _: string, subType: string, count: number): TypeDef {
|
||||
value.sub = subType.length === 0
|
||||
@@ -195,6 +203,9 @@ const nestedExtraction: [string, string, TypeDefInfo, (value: TypeDef, type: str
|
||||
['BTreeMap<', '>', TypeDefInfo.BTreeMap, _decodeTuple],
|
||||
['HashMap<', '>', TypeDefInfo.HashMap, _decodeTuple],
|
||||
['Int<', '>', TypeDefInfo.Int, _decodeInt],
|
||||
// Not sure about these, have a specific implementation?
|
||||
['Range<', '>', TypeDefInfo.Tuple, _decodeRange],
|
||||
['RangeInclusive<', '>', TypeDefInfo.Tuple, _decodeRange],
|
||||
['Result<', '>', TypeDefInfo.Result, _decodeTuple],
|
||||
['UInt<', '>', TypeDefInfo.UInt, _decodeUInt],
|
||||
['DoNotConstruct<', '>', TypeDefInfo.DoNotConstruct, _decodeDoNotConstruct]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user