Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f13a634e5 | ||
|
|
40af520fe7 | ||
|
|
1e506e0f8c | ||
|
|
96ea5803d4 | ||
|
|
7d99459f50 | ||
|
|
8fa090f435 | ||
|
|
d3c60d197c | ||
|
|
ad8550f7f5 | ||
|
|
a899aa439d | ||
|
|
e0e075b350 | ||
|
|
34ff14547e | ||
|
|
681a80d456 | ||
|
|
ed5f2673ce | ||
|
|
43e87603e2 | ||
|
|
d056416b47 | ||
|
|
1bcf94131d | ||
|
|
17b607b6c3 | ||
|
|
5a16d1dd8b | ||
|
|
144b74306a | ||
|
|
16b9fa956d | ||
|
|
b6af4b9877 | ||
|
|
3f368e721d | ||
|
|
22b4257636 | ||
|
|
ca7a631032 | ||
|
|
da5bbd17af | ||
|
|
b58f3f5c3e | ||
|
|
8c30194f59 | ||
|
|
dc9ec37490 | ||
|
|
5175e77eec | ||
|
|
9553c5467c | ||
|
|
a1f07e3274 | ||
|
|
58deb2eb14 | ||
|
|
83caad7f1b | ||
|
|
26c3cc9126 | ||
|
|
1a231dfb0d | ||
|
|
712d0425d0 | ||
|
|
eaa5db517f | ||
|
|
88c3850d1b | ||
|
|
943df72ae9 | ||
|
|
67ab11a036 | ||
|
|
c87ef7526b | ||
|
|
bccf2d52ad | ||
|
|
be6dbdd3e4 | ||
|
|
3c34ee9897 | ||
|
|
9ad97813e3 | ||
|
|
028f04e47f | ||
|
|
4974c9247f | ||
|
|
1ffe6a11bf | ||
|
|
19699ea445 | ||
|
|
d98ccfb12a | ||
|
|
41cb056b0f | ||
|
|
48bda0bdea | ||
|
|
1b393c7b67 | ||
|
|
f52e518b7b | ||
|
|
08970cff88 | ||
|
|
6d38ca6453 | ||
|
|
60db4bc66b | ||
|
|
0661237b28 | ||
|
|
6ccac712a8 | ||
|
|
3d4877940c | ||
|
|
70fc95ef27 | ||
|
|
463f65d25c | ||
|
|
09d176c82e | ||
|
|
fce96baf3d | ||
|
|
c6785c533f | ||
|
|
64de021149 | ||
|
|
de9e17a1a0 | ||
|
|
987bccea2e | ||
|
|
1434b86b8f | ||
|
|
a398b2201f | ||
|
|
f015837c38 | ||
|
|
5b51588995 | ||
|
|
7383e521e5 | ||
|
|
b10f05786c | ||
|
|
a212351528 | ||
|
|
55c01af260 | ||
|
|
1cf6ffad2b | ||
|
|
00d0ab9de1 | ||
|
|
b38e60a9a7 | ||
|
|
29f7e46439 | ||
|
|
fa0add8564 | ||
|
|
5bec38c404 | ||
|
|
43b66b6507 | ||
|
|
7e370b3a23 | ||
|
|
2b270a3c9f | ||
|
|
cf0d9a2d3f | ||
|
|
5d70622819 | ||
|
|
fcebdb6d6f | ||
|
|
3d020b5159 | ||
|
|
530d1bcd03 | ||
|
|
a4151c2941 | ||
|
|
a801d30fb6 | ||
|
|
1fe9b605dd | ||
|
|
ecfd822d94 | ||
|
|
a5e4d68993 | ||
|
|
ca5c002d37 | ||
|
|
6e28760da4 | ||
|
|
a253c4edb5 | ||
|
|
7c96525d35 | ||
|
|
3f0457efc2 | ||
|
|
bfb241d995 | ||
|
|
314ad8c3f2 | ||
|
|
aa85371f82 | ||
|
|
d0a08dadd9 | ||
|
|
eeff764345 | ||
|
|
4870ec4f40 | ||
|
|
1c3cfbfa0c | ||
|
|
3c9b7de6c7 | ||
|
|
22e5488f16 | ||
|
|
b37887993e | ||
|
|
75361cb0ff | ||
|
|
894992bc4c | ||
|
|
d955fab169 | ||
|
|
580d225387 | ||
|
|
d48f59e48d | ||
|
|
108b49ea03 | ||
|
|
9295349886 | ||
|
|
a51658ffac | ||
|
|
47f08e9e04 | ||
|
|
7906ae63dc | ||
|
|
0e76271dba | ||
|
|
e117619e34 | ||
|
|
67b416fe80 | ||
|
|
78dbfa46fa | ||
|
|
01db9261d5 | ||
|
|
674c38b384 | ||
|
|
0700e824eb | ||
|
|
0362eaf472 | ||
|
|
696b3964e6 | ||
|
|
5d0c2eed7b | ||
|
|
e4c3289ad8 | ||
|
|
4449bdae6f | ||
|
|
064957db81 | ||
|
|
ccd89ef0a6 | ||
|
|
47beb5f41f | ||
|
|
9f205392a3 | ||
|
|
adce7ccbee | ||
|
|
b83b3a9437 | ||
|
|
147dbcf24f | ||
|
|
2afff1b41f |
+3
-1
@@ -1,4 +1,4 @@
|
||||
26
|
||||
27
|
||||
1.4.2
|
||||
1.6.2
|
||||
1.11.2
|
||||
@@ -17,3 +17,5 @@
|
||||
3.9.2
|
||||
3.9.3
|
||||
3.10.2
|
||||
4.0.2
|
||||
4.0.3
|
||||
|
||||
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-2.4.0.cjs
|
||||
yarnPath: .yarn/releases/yarn-2.4.1.cjs
|
||||
|
||||
+118
@@ -1,5 +1,123 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 4.5.1 Apr 12, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
|
||||
|
||||
Changes:
|
||||
|
||||
- Update parachain types as per latest Polkadot
|
||||
- Cater for `Keys` with `BEEFY` session keys
|
||||
- Update `Keys` injection to allow for on-chain type detection
|
||||
- Update `Westend` known upgrade points for runtime 50
|
||||
- Align types with latest Substrate master
|
||||
- Adjust keepalive `system_health` timer
|
||||
|
||||
|
||||
## 4.4.1 Apr 5, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
|
||||
|
||||
Changes:
|
||||
|
||||
- Add `ServiceQuality` type for Cumulus
|
||||
- Adjust XCM MultiLocation type (X5 to X8 junctions)
|
||||
- Add Polkadot 29 upgrade block
|
||||
|
||||
|
||||
## 4.3.1 Mar 29, 2021
|
||||
|
||||
Upgrade priority: Low.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Fix documentation on ABI parameters (Thanks to https://github.com/vminkov)
|
||||
|
||||
Changes:
|
||||
|
||||
- Warn on usage of deprecated contract interfaces
|
||||
- Update `ParaInfo` type
|
||||
- Council should be optional in treasury derives
|
||||
- Allow extraction of session derives indexes with no staking
|
||||
|
||||
|
||||
## 4.2.1 Mar 22, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended when tracking the latest updates from Substrate.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Fix contract even decoding on Substrate 3 (Thanks to https://github.com/vminkov)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `Extender{Header, SignedBlock}` types to ensure at-block `Header` types are used
|
||||
- Explicit definition for new Rococo triple refcount `AccountData` types
|
||||
- Convert metadata private class fields to ES-private
|
||||
- Adjust `SignedBlock` type for new `justifications` field
|
||||
- Optimize society derive for multi accounts
|
||||
- Bump metadata to latest substrate version
|
||||
|
||||
|
||||
## 4.1.1 Mar 15, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended when tracking the latest updates from Substrate.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix author extraction for last block in a session
|
||||
- Expand `SignerPayload` to inject/expose custom signed extensions
|
||||
- `ConsensusEngineId` formats non-Ascii engines correctly
|
||||
- Allow `getBlock/Header` derives to use as-at registry (instead of latest)
|
||||
- Cleanup `RpcCore` augmentation (removing TS warnings on typegen chains)
|
||||
- Add upgrade block for Kusama 2029
|
||||
- Ensure that type alias overrides also apply to map keys
|
||||
- Check type generation against fallbacks (build-time only sanity check)
|
||||
- Add `mmr_generateProof` RPC
|
||||
- Align types with latest substrate master
|
||||
- Apply latest Polkadot auctions/crowdloan/parachains/slots types
|
||||
|
||||
|
||||
## 4.0.3 Mar 8, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended if you use the API to sync the full chain, most notably Polkadot.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Re-add unused historical `SudoBalances` to `ProxyType` (Thanks to https://github.com/emostov)
|
||||
|
||||
|
||||
## 4.0.2 Mar 8, 2021
|
||||
|
||||
Upgrade priority: High. Required if you are using 4.0.1 in a Node.js environment.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix import from `@polkadot/x-rxjs` in Node environments (From common)
|
||||
- Add correct types for `Phase` is new validator elections module
|
||||
|
||||
|
||||
## 4.0.1 Mar 7, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users wanting to keep updated with chain changes.
|
||||
|
||||
**Important** In the 4.0 version the default package type has been changed to ESM modules by default. This should not affect usage, however since the output formats changed, a new major version is required.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Expose `unknownTypes` on the registry interface (Thanks to https://github.com/ii-ii-ii)
|
||||
|
||||
Changes:
|
||||
|
||||
- Build to ESM by default (with cjs versions via export map)
|
||||
- Enum `.toSON()` now encodes all keys as `camelCase` (aligning with the output from Substrate)
|
||||
- Add `createdAtHash?: Hash` to `Codec` interface (filled-in by storage retrievals)
|
||||
- Expose the source hash as `wamHash` on Abi parsed instances
|
||||
- Use `parentHash` when creating mortal era (handles frequent forks better)
|
||||
- Add `AccountInfoWithTripleRefCount` to cater for latest Substrate
|
||||
- Add upgrade block for Westend 49
|
||||
|
||||
|
||||
## 3.11.1 Feb 28, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users wanting to keep updated with chain changes.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
const config = require('@polkadot/dev/config/jest.cjs');
|
||||
|
||||
module.exports = Object.assign({}, config, {
|
||||
module.exports = {
|
||||
...config,
|
||||
moduleNameMapper: {
|
||||
'@polkadot/api-(contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
|
||||
// eslint-disable-next-line sort-keys
|
||||
@@ -26,5 +27,5 @@ module.exports = Object.assign({}, config, {
|
||||
'<rootDir>/packages/types/build',
|
||||
'<rootDir>/packages/types-known/build'
|
||||
],
|
||||
resolver: '@polkadot/dev/config/jest-resolver.cjs'
|
||||
});
|
||||
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
|
||||
};
|
||||
+8
-8
@@ -8,7 +8,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"typescript": "^4.1.5"
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn build:interfaces && polkadot-dev-build-ts",
|
||||
@@ -25,14 +25,14 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/register": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@polkadot/dev": "^0.61.30",
|
||||
"@polkadot/ts": "^0.3.59",
|
||||
"@babel/core": "^7.13.15",
|
||||
"@babel/register": "^7.13.14",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/dev": "^0.62.7",
|
||||
"@polkadot/ts": "^0.3.62",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/jest": "^26.0.22",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "3.11.1"
|
||||
"version": "4.5.1"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Abi } from '@polkadot/api-contract';
|
||||
|
||||
const wsProvider = new WsProvider(<...Node Url...>);
|
||||
const api = await ApiPromise.create({ provider: wsProvider });
|
||||
const abi = new Abi(api.registry, <...JSON ABI...>);
|
||||
const abi = new Abi(<...JSON ABI...>, api.registry.getChainProperties());
|
||||
|
||||
api.tx.contracts
|
||||
.call(<contract addr>, <value>, <max gas>, abi.messages.<method name>(<...params...>))
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,11 +16,11 @@
|
||||
"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.13.8",
|
||||
"@polkadot/api": "3.11.1",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/x-rxjs": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.5.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/x-rxjs": "^6.1.1",
|
||||
"bn.js": "^4.11.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
interface JSONAbi {
|
||||
source: {
|
||||
compiler: string,
|
||||
hash: string,
|
||||
language: string,
|
||||
wasm: string
|
||||
},
|
||||
spec: {
|
||||
messages: {
|
||||
name: string[] | string
|
||||
@@ -27,4 +35,18 @@ describe('Abi', (): void => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const bundle = abis.ink_flipperBundle as JSONAbi;
|
||||
const abi = new Abi(bundle as any);
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
// the Codec hash
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasm.hash.toHex());
|
||||
|
||||
// the hash as per the actual Abi
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasmHash.toHex());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
|
||||
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { EventRecord, Hash } from '@polkadot/types/interfaces';
|
||||
import type { EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, BlueprintOptions } from '../types';
|
||||
import type { MapConstructorExec } from './types';
|
||||
|
||||
import { SubmittableResult } from '@polkadot/api';
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { assert, compactAddLength, isFunction, isUndefined, isWasm, stringCamelCase, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, compactAddLength, isFunction, isUndefined, isWasm, logger, stringCamelCase, u8aToU8a } from '@polkadot/util';
|
||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
@@ -20,6 +20,8 @@ import { Blueprint } from './Blueprint';
|
||||
import { Contract } from './Contract';
|
||||
import { createBluePrintTx, EMPTY_SALT, encodeSalt } from './util';
|
||||
|
||||
const l = logger('Code');
|
||||
|
||||
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
|
||||
public readonly blueprint?: Blueprint<ApiType>;
|
||||
public readonly contract?: Contract<ApiType>;
|
||||
@@ -55,18 +57,8 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Deploy the code bundle, creating a Blueprint.
|
||||
* @deprecated Use the `code.tx.<constructor>(...) format to put code and deploy
|
||||
*/
|
||||
public createBlueprint (): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> {
|
||||
return this.api.tx.contracts
|
||||
.putCode(compactAddLength(this.code))
|
||||
.withResultTransform((result: ISubmittableResult) =>
|
||||
new CodeSubmittableResult(result, applyOnEvent(result, ['CodeStored'], ([record]: EventRecord[]) =>
|
||||
new Blueprint<ApiType>(this.api, this.abi, record.event.data[0] as Hash, this._decorateMethod)
|
||||
))
|
||||
);
|
||||
public get tx (): MapConstructorExec<ApiType> {
|
||||
return this.#tx;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,26 +66,26 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
* @deprecated Use the `code.tx.<constructor>(...) format to put code and deploy
|
||||
*/
|
||||
public createContract (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> {
|
||||
return this.#instantiate(constructorOrId, options, params);
|
||||
}
|
||||
l.warn('.createContract is deprecated, use code.tx.<constructorName>(...) instead (where code refers to this instance)');
|
||||
|
||||
public get tx (): MapConstructorExec<ApiType> {
|
||||
return this.#tx;
|
||||
return this.#instantiate(constructorOrId, options, params);
|
||||
}
|
||||
|
||||
#instantiate = (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
return isFunction(this.api.tx.contracts.instantiateWithCode)
|
||||
? this.#instantiateSingle(constructorOrId, options, params)
|
||||
: this.#instantiateBatch(constructorOrId, options, params);
|
||||
? this.#instantiateCurrent(constructorOrId, options, params)
|
||||
: this.#instantiatePrev(constructorOrId, options, params);
|
||||
}
|
||||
|
||||
#instantiateSingle = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
#instantiateCurrent = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
return this.api.tx.contracts
|
||||
.instantiateWithCode(value, gasLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt))
|
||||
.withResultTransform(this.#transformEvents);
|
||||
}
|
||||
|
||||
#instantiateBatch = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
#instantiatePrev = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
assert(isFunction(this.api.tx.utility?.batch), 'Your chain does not include the utility pallet, for contracts v2 deployment, this is required');
|
||||
|
||||
const encodedSalt = encodeSalt(salt);
|
||||
const withSalt = this.api.tx.contracts.instantiate.meta.args.length === 5;
|
||||
const encoded = this.abi.findConstructor(constructorOrId).toU8a(params, withSalt ? EMPTY_SALT : encodedSalt);
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Base } from './Base';
|
||||
// As per Rust, 5 * GAS_PER_SEC
|
||||
const MAX_CALL_GAS = new BN(5_000_000_000_000).subn(1);
|
||||
const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is most probably due to a runtime configuration.';
|
||||
|
||||
const l = logger('Contract');
|
||||
|
||||
function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: CodecArg[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
|
||||
@@ -39,11 +40,14 @@ function createTx <ApiType extends ApiTypes> (fn: (options: ContractOptions, par
|
||||
: fn(...extractOptions(options, params));
|
||||
}
|
||||
|
||||
function createWithId <T> (fn: (messageOrId: AbiMessage | string | number, options: ContractOptions, params: CodecArg[]) => T): ContractGeneric<ContractOptions, T> {
|
||||
return (messageOrId: AbiMessage | string | number, options: BigInt | string | number | BN | ContractOptions, ...params: CodecArg[]): T =>
|
||||
isOptions(options)
|
||||
function createWithId <T> (fn: (messageOrId: AbiMessage | string | number, options: ContractOptions, params: CodecArg[]) => T, warn?: string): ContractGeneric<ContractOptions, T> {
|
||||
return (messageOrId: AbiMessage | string | number, options: BigInt | string | number | BN | ContractOptions, ...params: CodecArg[]): T => {
|
||||
warn && l.warn(warn);
|
||||
|
||||
return isOptions(options)
|
||||
? fn(messageOrId, options, params)
|
||||
: fn(messageOrId, ...extractOptions(options, params));
|
||||
};
|
||||
}
|
||||
|
||||
export class ContractSubmittableResult extends SubmittableResult {
|
||||
@@ -109,8 +113,8 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
super(api, abi, decorateMethod);
|
||||
|
||||
this.address = this.registry.createType('AccountId', address);
|
||||
this.exec = createWithId(this.#exec);
|
||||
this.read = createWithId(this.#read);
|
||||
this.exec = createWithId(this.#exec, '.exec is deprecated, use contract.tx.<messageName>(...) instead (where contract refers to this instance)');
|
||||
this.read = createWithId(this.#read, '.read is deprecated, use contract.query.<messageName>(...) instead (where contract refers to this instance)');
|
||||
|
||||
this.abi.messages.forEach((m): void => {
|
||||
const messageName = stringCamelCase(m.identifier);
|
||||
@@ -156,7 +160,8 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
return this.api.tx.contracts
|
||||
.call(this.address, value, this.#getGas(gasLimit), this.abi.findMessage(messageOrId).toU8a(params))
|
||||
.withResultTransform((result: ISubmittableResult) =>
|
||||
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractExecution'], (records: EventRecord[]) =>
|
||||
// ContractEmitted is the current generation, ContractExecution is the previous generation
|
||||
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
|
||||
records
|
||||
.map(({ event: { data: [, data] } }): DecodedEvent | null => {
|
||||
try {
|
||||
|
||||
@@ -37,7 +37,9 @@ async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<v
|
||||
}
|
||||
|
||||
async function main (): Promise<void> {
|
||||
const api = await ApiPromise.create();
|
||||
const api = await ApiPromise.create({
|
||||
hasher: (data: Uint8Array): Uint8Array => data
|
||||
});
|
||||
const pairs = createTestPairs();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '4.5.1' };
|
||||
|
||||
@@ -12,7 +12,7 @@ import BN from 'bn.js';
|
||||
import { createTypeUnsafe } from '@polkadot/types/create';
|
||||
import { isBigInt, isBn, isNumber, isString } from '@polkadot/util';
|
||||
|
||||
type ContractEvents = 'CodeStored' | 'ContractExecution' | 'Instantiated';
|
||||
type ContractEvents = 'CodeStored' | 'ContractEmitted' | 'ContractExecution' | 'Instantiated';
|
||||
|
||||
type TOptions = BlueprintOptions | ContractOptions;
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"info": 6,
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
@@ -6,5 +6,6 @@ export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as flipperBundle } from './flipper.contract.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,17 +16,17 @@
|
||||
"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.13.8",
|
||||
"@polkadot/api": "3.11.1",
|
||||
"@polkadot/rpc-core": "3.11.1",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/util-crypto": "^5.9.2",
|
||||
"@polkadot/x-rxjs": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.5.1",
|
||||
"@polkadot/rpc-core": "4.5.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/util-crypto": "^6.1.1",
|
||||
"@polkadot/x-rxjs": "^6.1.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.9.2",
|
||||
"@polkadot/rpc-provider": "3.11.1"
|
||||
"@polkadot/keyring": "^6.1.1",
|
||||
"@polkadot/rpc-provider": "4.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,12 @@ type BalanceResult = [Balance, Balance, Balance, Balance];
|
||||
|
||||
type Result = [Index, BalanceResult[]];
|
||||
|
||||
type DeriveCustomAccount = ApiInterfaceRx['derive'] & {
|
||||
[custom: string]: {
|
||||
customAccount?: ApiInterfaceRx['query']['balances']['account']
|
||||
}
|
||||
}
|
||||
|
||||
function getBalance (api: ApiInterfaceRx, [freeBalance, reservedBalance, frozenFee, frozenMisc]: BalanceResult): DeriveBalancesAccountData {
|
||||
return {
|
||||
freeBalance,
|
||||
@@ -55,7 +61,13 @@ function queryBalancesFree (api: ApiInterfaceRx, accountId: AccountId): Observab
|
||||
}
|
||||
|
||||
function queryBalancesAccount (api: ApiInterfaceRx, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
|
||||
const balances = modules.map((m): QueryableStorageMultiArg<'rxjs'> => [api.query[m].account, accountId]);
|
||||
const balances = modules.map(
|
||||
(m): QueryableStorageMultiArg<'rxjs'> => [
|
||||
(api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m].account,
|
||||
accountId
|
||||
]
|
||||
);
|
||||
|
||||
const extract = (data: AccountData[]) =>
|
||||
data.map(({ feeFrozen, free, miscFrozen, reserved }): BalanceResult => [free, reserved, feeFrozen, miscFrozen]);
|
||||
|
||||
@@ -75,9 +87,11 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Re
|
||||
const { feeFrozen, free, miscFrozen, reserved } = (infoOrTuple as AccountInfo).nonce
|
||||
? (infoOrTuple as AccountInfo).data
|
||||
: (infoOrTuple as [Index, AccountData])[1];
|
||||
const accountNonce = (infoOrTuple as AccountInfo).nonce || (infoOrTuple as [Index, AccountData])[0];
|
||||
|
||||
return [accountNonce, [[free, reserved, feeFrozen, miscFrozen]]];
|
||||
return [
|
||||
(infoOrTuple as AccountInfo).nonce || (infoOrTuple as [Index, AccountData])[0],
|
||||
[[free, reserved, feeFrozen, miscFrozen]]
|
||||
];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAl
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { bnMax } from '@polkadot/util';
|
||||
import { bnMax, isFunction } from '@polkadot/util';
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
@@ -27,6 +27,12 @@ interface AllLocked {
|
||||
vestingLocked: Balance
|
||||
}
|
||||
|
||||
type DeriveCustomLocks = ApiInterfaceRx['derive'] & {
|
||||
[custom: string]: {
|
||||
customLocks?: ApiInterfaceRx['query']['balances']['locks']
|
||||
}
|
||||
}
|
||||
|
||||
const VESTING_ID = '0x76657374696e6720';
|
||||
|
||||
function calcLocked (api: ApiInterfaceRx, bestNumber: BlockNumber, locks: (BalanceLock | BalanceLockTo212)[]): AllLocked {
|
||||
@@ -54,11 +60,10 @@ function calcLocked (api: ApiInterfaceRx, bestNumber: BlockNumber, locks: (Balan
|
||||
|
||||
function calcShared (api: ApiInterfaceRx, bestNumber: BlockNumber, data: DeriveBalancesAccountData, locks: (BalanceLock | BalanceLockTo212)[]): DeriveBalancesAllAccountData {
|
||||
const { allLocked, lockedBalance, lockedBreakdown, vestingLocked } = calcLocked(api, bestNumber, locks);
|
||||
const availableBalance = api.registry.createType('Balance', allLocked ? 0 : bnMax(new BN(0), data.freeBalance.sub(lockedBalance)));
|
||||
|
||||
return {
|
||||
...data,
|
||||
availableBalance,
|
||||
availableBalance: api.registry.createType('Balance', allLocked ? 0 : bnMax(new BN(0), data.freeBalance.sub(lockedBalance))),
|
||||
lockedBalance,
|
||||
lockedBreakdown,
|
||||
vestingLocked
|
||||
@@ -75,8 +80,6 @@ function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLock
|
||||
const vestedNow = isStarted ? perBlock.mul(bestNumber.sub(startingBlock)) : new BN(0);
|
||||
const vestedBalance = vestedNow.gt(vestingTotal) ? vestingTotal : api.registry.createType('Balance', vestedNow);
|
||||
const isVesting = isStarted && !shared.vestingLocked.isZero();
|
||||
const vestedClaimable = api.registry.createType('Balance', isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : 0);
|
||||
const vestingEndBlock = api.registry.createType('BlockNumber', isVesting ? vestingTotal.div(perBlock).add(startingBlock) : 0);
|
||||
|
||||
return {
|
||||
...shared,
|
||||
@@ -85,8 +88,8 @@ function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLock
|
||||
additional: allLocks.filter((_, index) => index !== 0).map((l, index) => calcShared(api, bestNumber, data.additional[index], l)),
|
||||
isVesting,
|
||||
vestedBalance,
|
||||
vestedClaimable,
|
||||
vestingEndBlock,
|
||||
vestedClaimable: api.registry.createType('Balance', isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : 0),
|
||||
vestingEndBlock: api.registry.createType('BlockNumber', isVesting ? vestingTotal.div(perBlock).add(startingBlock) : 0),
|
||||
vestingPerBlock: perBlock,
|
||||
vestingTotal
|
||||
};
|
||||
@@ -112,11 +115,17 @@ function queryOld (api: ApiInterfaceRx, accountId: AccountId): Observable<Result
|
||||
);
|
||||
}
|
||||
|
||||
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) => api.query[m].locks);
|
||||
const lockCalls = 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((c) => c).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
|
||||
const lockQueries = lockCalls.filter(isNonNullable).map((c): QueryableStorageMultiArg<'rxjs'> => [c, accountId]);
|
||||
|
||||
return (
|
||||
api.query.vesting?.vesting
|
||||
@@ -166,7 +175,7 @@ export function all (instanceId: string, api: ApiInterfaceRx): (address: Account
|
||||
? combineLatest([
|
||||
of(account),
|
||||
api.derive.chain.bestNumber(),
|
||||
api.query.system?.account || api.query.balances?.account
|
||||
isFunction(api.query.system?.account) || isFunction(api.query.balances?.account)
|
||||
? queryCurrent(api, account.accountId, balanceInstances)
|
||||
: queryOld(api, account.accountId)
|
||||
])
|
||||
|
||||
@@ -37,12 +37,16 @@ export function bounties (instanceId: string, api: ApiInterfaceRx): () => Observ
|
||||
return memo(instanceId, (): Observable<DeriveBounties> =>
|
||||
combineLatest([
|
||||
bountyBase.bountyCount<BountyIndex>(),
|
||||
api.query.council ? api.query.council.proposalCount<ProposalIndex>() : of(0)
|
||||
api.query.council
|
||||
? api.query.council.proposalCount<ProposalIndex>()
|
||||
: of(0)
|
||||
]).pipe(
|
||||
switchMap(() =>
|
||||
combineLatest([
|
||||
bountyBase.bounties.keys<[BountyIndex]>(),
|
||||
api.derive.council ? api.derive.council.proposals() : of([])
|
||||
api.derive.council
|
||||
? api.derive.council.proposals()
|
||||
: of([])
|
||||
])
|
||||
),
|
||||
switchMap(([keys, proposals]): Observable<Result> => {
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { SignedBlockExtended } from '../type/types';
|
||||
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { catchError, map } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { SignedBlockExtended } from '../type';
|
||||
import { createSignedBlockExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ export function getBlock (instanceId: string, api: ApiInterfaceRx): (hash: Uint8
|
||||
: of([])
|
||||
]).pipe(
|
||||
map(([signedBlock, events, validators]): SignedBlockExtended =>
|
||||
new SignedBlockExtended(api.registry, signedBlock, events, validators)
|
||||
createSignedBlockExtended(api.registry, signedBlock, events, validators)
|
||||
),
|
||||
catchError((): Observable<undefined> =>
|
||||
// where rpc.chain.getHeader throws, we will land here - it can happen that
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { catchError, map } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { HeaderExtended } from '../type';
|
||||
import { createHeaderExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ export function getHeader (instanceId: string, api: ApiInterfaceRx): (hash: Uint
|
||||
: of([])
|
||||
]).pipe(
|
||||
map(([header, validators]): HeaderExtended =>
|
||||
new HeaderExtended(api.registry, header, validators)
|
||||
createHeaderExtended(header.registry, header, validators)
|
||||
),
|
||||
catchError((): Observable<undefined> =>
|
||||
// where rpc.chain.getHeader throws, we will land here - it can happen that
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { AccountId, EventRecord, SignedBlock } from '@polkadot/types/interfaces';
|
||||
import type { Vec } from '@polkadot/types';
|
||||
import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { HeaderExtended, SignedBlockExtended } from '../type/types';
|
||||
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { SignedBlockExtended } from '../type';
|
||||
import { createSignedBlockExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
@@ -18,17 +20,17 @@ import { memo } from '../util';
|
||||
export function subscribeNewBlocks (instanceId: string, api: ApiInterfaceRx): () => Observable<SignedBlockExtended> {
|
||||
return memo(instanceId, (): Observable<SignedBlockExtended> =>
|
||||
api.derive.chain.subscribeNewHeads().pipe(
|
||||
switchMap((header): Observable<[SignedBlock, EventRecord[], AccountId[] | undefined]> => {
|
||||
const blockHash = header.hash;
|
||||
switchMap((header): Observable<[SignedBlock, Vec<EventRecord>, HeaderExtended]> => {
|
||||
const blockHash = header.createdAtHash || header.hash;
|
||||
|
||||
return combineLatest(
|
||||
api.rpc.chain.getBlock(blockHash),
|
||||
api.query.system.events.at(blockHash),
|
||||
of(header.validators)
|
||||
of(header)
|
||||
);
|
||||
}),
|
||||
map(([block, events, validators]) =>
|
||||
new SignedBlockExtended(api.registry, block, events, validators)
|
||||
map(([block, events, header]) =>
|
||||
createSignedBlockExtended(block.registry, block, events, header.validators)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { map } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { HeaderExtended } from '../type';
|
||||
import { createHeaderExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
@@ -29,10 +30,13 @@ export function subscribeNewHeads (instanceId: string, api: ApiInterfaceRx): ()
|
||||
api.rpc.chain.subscribeNewHeads(),
|
||||
api.query.session
|
||||
? api.query.session.validators()
|
||||
: of([])
|
||||
: of(undefined)
|
||||
]).pipe(
|
||||
map(([header, validators]): HeaderExtended =>
|
||||
new HeaderExtended(api.registry, header, validators)
|
||||
)
|
||||
));
|
||||
map(([header, validators]): HeaderExtended => {
|
||||
header.createdAtHash = header.hash;
|
||||
|
||||
return createHeaderExtended(header.registry, header, validators);
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ function parse ([proposals, images, optDepositors]: Result): DeriveProposal[] {
|
||||
|
||||
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveProposal[]> {
|
||||
return memo(instanceId, (): Observable<DeriveProposal[]> =>
|
||||
api.query.democracy?.publicProps && api.query.democracy?.preimages
|
||||
isFunction(api.query.democracy?.publicProps) && isFunction(api.query.democracy?.preimages)
|
||||
? api.query.democracy.publicProps<Proposals>().pipe(
|
||||
switchMap((proposals) =>
|
||||
combineLatest([
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '4.5.1' };
|
||||
|
||||
@@ -13,7 +13,7 @@ import { map } from '@polkadot/x-rxjs/operators';
|
||||
import { memo } from '../util';
|
||||
|
||||
// parse into Indexes
|
||||
function parse ([activeEra, activeEraStart, currentEra, currentIndex, validatorCount]: [EraIndex, Option<Moment>, EraIndex, SessionIndex, u32]): DeriveSessionIndexes {
|
||||
function parse ([currentIndex, activeEra, activeEraStart, currentEra, validatorCount]: [SessionIndex, EraIndex, Option<Moment>, EraIndex, u32]): DeriveSessionIndexes {
|
||||
return {
|
||||
activeEra,
|
||||
activeEraStart,
|
||||
@@ -24,42 +24,57 @@ function parse ([activeEra, activeEraStart, currentEra, currentIndex, validatorC
|
||||
}
|
||||
|
||||
// query based on latest
|
||||
function query (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
|
||||
return api.queryMulti<[Option<ActiveEraInfo>, Option<EraIndex>, SessionIndex, u32]>([
|
||||
function queryStaking (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
|
||||
return api.queryMulti<[SessionIndex, Option<ActiveEraInfo>, Option<EraIndex>, u32]>([
|
||||
api.query.session.currentIndex,
|
||||
api.query.staking.activeEra,
|
||||
api.query.staking.currentEra,
|
||||
api.query.session.currentIndex,
|
||||
api.query.staking.validatorCount
|
||||
]).pipe(
|
||||
map(([activeOpt, currentEra, currentIndex, validatorCount]): DeriveSessionIndexes => {
|
||||
map(([currentIndex, activeOpt, currentEra, validatorCount]): DeriveSessionIndexes => {
|
||||
const { index, start } = activeOpt.unwrapOrDefault();
|
||||
|
||||
return parse([
|
||||
currentIndex,
|
||||
index,
|
||||
start,
|
||||
currentEra.unwrapOrDefault(),
|
||||
currentIndex,
|
||||
validatorCount
|
||||
]);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// query based on latest
|
||||
function querySession (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
|
||||
return api.query.session.currentIndex().pipe(
|
||||
map((currentIndex): DeriveSessionIndexes => parse([
|
||||
currentIndex,
|
||||
api.registry.createType('EraIndex'),
|
||||
api.registry.createType('Option<Moment>'),
|
||||
api.registry.createType('EraIndex'),
|
||||
api.registry.createType('u32')
|
||||
]))
|
||||
);
|
||||
}
|
||||
|
||||
// empty set when none is available
|
||||
function empty (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
|
||||
return of(parse([
|
||||
api.registry.createType('SessionIndex', 1),
|
||||
api.registry.createType('EraIndex'),
|
||||
api.registry.createType('Option<Moment>'),
|
||||
api.registry.createType('EraIndex'),
|
||||
api.registry.createType('SessionIndex', 1),
|
||||
api.registry.createType('u32')
|
||||
]));
|
||||
}
|
||||
|
||||
export function indexes (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionIndexes> {
|
||||
return memo(instanceId, (): Observable<DeriveSessionIndexes> =>
|
||||
api.query.session && api.query.staking
|
||||
? query(api)
|
||||
api.query.session
|
||||
? api.query.staking
|
||||
? queryStaking(api)
|
||||
: querySession(api)
|
||||
: empty(api)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { bool, Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { DeriveSocietyMember } from '../types';
|
||||
|
||||
@@ -12,28 +10,13 @@ import { map } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
type Result = [Vec<ITuple<[BlockNumber, Balance]>>, StrikeCount, Option<SocietyVote>, bool, Option<VouchingStatus>];
|
||||
|
||||
/**
|
||||
* @description Get the member info for a society
|
||||
*/
|
||||
export function member (instanceId: string, api: ApiInterfaceRx): (accountId: AccountId) => Observable<DeriveSocietyMember> {
|
||||
return memo(instanceId, (accountId: AccountId): Observable<DeriveSocietyMember> =>
|
||||
api.queryMulti<Result>([
|
||||
[api.query.society.payouts, accountId],
|
||||
[api.query.society.strikes, accountId],
|
||||
[api.query.society.defenderVotes, accountId],
|
||||
[api.query.society.suspendedMembers, accountId],
|
||||
[api.query.society.vouching, accountId]
|
||||
]).pipe(
|
||||
map(([payouts, strikes, defenderVotes, suspended, vouching]: Result): DeriveSocietyMember => ({
|
||||
accountId,
|
||||
isSuspended: suspended.isTrue,
|
||||
payouts,
|
||||
strikes,
|
||||
vote: defenderVotes.unwrapOr(undefined),
|
||||
vouching: vouching.unwrapOr(undefined)
|
||||
}))
|
||||
api.derive.society._members([accountId]).pipe(
|
||||
map(([result]) => result)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,28 +2,51 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { bool, Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { DeriveSocietyMember } from '../types';
|
||||
|
||||
import { combineLatest } from '@polkadot/x-rxjs';
|
||||
import { switchMap } from '@polkadot/x-rxjs/operators';
|
||||
import { combineLatest, of } from '@polkadot/x-rxjs';
|
||||
import { map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
type Result = [AccountId[], Vec<ITuple<[BlockNumber, Balance]>>[], StrikeCount[], Option<SocietyVote>[], bool[], Option<VouchingStatus>[]];
|
||||
|
||||
export function _members (instanceId: string, api: ApiInterfaceRx): (accountIds: AccountId[]) => Observable<DeriveSocietyMember[]> {
|
||||
return memo(instanceId, (accountIds: AccountId[]): Observable<DeriveSocietyMember[]> =>
|
||||
combineLatest<Result>([
|
||||
of(accountIds),
|
||||
api.query.society.payouts.multi(accountIds),
|
||||
api.query.society.strikes.multi(accountIds),
|
||||
api.query.society.defenderVotes.multi(accountIds),
|
||||
api.query.society.suspendedMembers.multi(accountIds),
|
||||
api.query.society.vouching.multi(accountIds)
|
||||
]).pipe(
|
||||
map(([accountIds, payouts, strikes, defenderVotes, suspended, vouching]) =>
|
||||
accountIds.map((accountId, index) => ({
|
||||
accountId,
|
||||
isDefenderVoter: defenderVotes[index].isSome,
|
||||
isSuspended: suspended[index].isTrue,
|
||||
payouts: payouts[index],
|
||||
strikes: strikes[index],
|
||||
vote: defenderVotes[index].unwrapOr(undefined),
|
||||
vouching: vouching[index].unwrapOr(undefined)
|
||||
}))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Get the member info for a society
|
||||
*/
|
||||
export function members (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSocietyMember[]> {
|
||||
return memo(instanceId, (): Observable<DeriveSocietyMember[]> =>
|
||||
api.query.society.members<AccountId[]>().pipe(
|
||||
switchMap((members): Observable<DeriveSocietyMember[]> =>
|
||||
combineLatest(
|
||||
members.map((accountId): Observable<DeriveSocietyMember> =>
|
||||
api.derive.society.member(accountId)
|
||||
)
|
||||
)
|
||||
)
|
||||
switchMap((members) => api.derive.society._members(members))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,16 +5,41 @@ import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
|
||||
import { map } from '@polkadot/x-rxjs/operators';
|
||||
import { map, startWith, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { drr, memo } from '../util';
|
||||
|
||||
function onBondedEvent (api: ApiInterfaceRx): Observable<number> {
|
||||
let current = Date.now();
|
||||
|
||||
return api.query.system.events().pipe(
|
||||
map((events): number => {
|
||||
current = events.filter(({ event, phase }): boolean => {
|
||||
try {
|
||||
return phase.isApplyExtrinsic &&
|
||||
event.section === 'staking' &&
|
||||
event.method === 'Bonded';
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
? Date.now()
|
||||
: current;
|
||||
|
||||
return current;
|
||||
}),
|
||||
startWith(current),
|
||||
drr({ skipTimeout: true })
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Retrieve the list of all validator stashes
|
||||
*/
|
||||
export function stashes (instanceId: string, api: ApiInterfaceRx): () => Observable<AccountId[]> {
|
||||
return memo(instanceId, (): Observable<AccountId[]> =>
|
||||
api.query.staking.validators.keys().pipe(
|
||||
onBondedEvent(api).pipe(
|
||||
switchMap(() => api.query.staking.validators.keys()),
|
||||
map((keys) => keys.map(({ args: [validatorId] }) => validatorId).filter((a) => a))
|
||||
)
|
||||
);
|
||||
|
||||
@@ -61,7 +61,9 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a
|
||||
|
||||
return combineLatest([
|
||||
api.query.treasury.proposals.multi<Option<TreasuryProposal>>(allIds),
|
||||
api.derive.council.proposals()
|
||||
api.derive.council
|
||||
? api.derive.council.proposals()
|
||||
: of([] as DeriveCollectiveProposal[])
|
||||
]).pipe(
|
||||
map(([allProposals, councilProposals]: [Option<TreasuryProposal>[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals =>
|
||||
parseResult(api, { allIds, allProposals, approvalIds, councilProposals, proposalCount })
|
||||
|
||||
@@ -33,10 +33,19 @@ function nextNonce (api: ApiInterfaceRx, address: string): Observable<Index> {
|
||||
function signingHeader (api: ApiInterfaceRx): Observable<Header> {
|
||||
return combineLatest([
|
||||
api.rpc.chain.getHeader(),
|
||||
api.rpc.chain.getFinalizedHead().pipe(
|
||||
switchMap((hash) => api.rpc.chain.getHeader(hash))
|
||||
)
|
||||
api.rpc.chain.getFinalizedHead()
|
||||
]).pipe(
|
||||
switchMap(([bestHeader, finHash]) =>
|
||||
// retrieve the headers - in the case of the current block, we use the parent
|
||||
// to minimize (not completely remove) the impact that forks do have on the system
|
||||
// (when at genesis, just return the current header as the last known)
|
||||
bestHeader.parentHash.isEmpty
|
||||
? of([bestHeader, bestHeader])
|
||||
: combineLatest([
|
||||
api.rpc.chain.getHeader(bestHeader.parentHash),
|
||||
api.rpc.chain.getHeader(finHash)
|
||||
])
|
||||
),
|
||||
map(([current, finalized]) =>
|
||||
// determine the hash to use, current when lag > max, else finalized
|
||||
current.number.unwrap().sub(finalized.number.unwrap()).gt(MAX_FINALITY_LAG)
|
||||
|
||||
@@ -2,43 +2,41 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId, Header } from '@polkadot/types/interfaces';
|
||||
import type { Constructor, Registry } from '@polkadot/types/types';
|
||||
|
||||
import { Struct } from '@polkadot/types';
|
||||
import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { HeaderExtended } from './types';
|
||||
|
||||
import { extractAuthor } from './util';
|
||||
|
||||
// We can ignore the properties, added via Struct.with
|
||||
const _Header = Struct.with(runtimeTypes.types.Header as any) as Constructor<Header>;
|
||||
export function createHeaderExtended (registry: Registry, header?: Header, validators?: AccountId[]): HeaderExtended {
|
||||
// an instance of the base extrinsic for us to extend
|
||||
const HeaderBase = registry.createClass('Header');
|
||||
|
||||
/**
|
||||
* @name HeaderExtended
|
||||
* @description
|
||||
* A [[Block]] header with an additional `author` field that indicates the block author
|
||||
*/
|
||||
export class HeaderExtended extends _Header {
|
||||
readonly #author?: AccountId;
|
||||
readonly #validators?: AccountId[];
|
||||
class Implementation extends HeaderBase implements HeaderExtended {
|
||||
readonly #author?: AccountId;
|
||||
readonly #validators?: AccountId[];
|
||||
|
||||
constructor (registry: Registry, header?: Header, validators?: AccountId[]) {
|
||||
super(registry, header);
|
||||
constructor (registry: Registry, header?: Header, validators?: AccountId[]) {
|
||||
super(registry, header);
|
||||
|
||||
this.#author = extractAuthor(this.digest, validators);
|
||||
this.#validators = validators;
|
||||
this.#author = extractAuthor(this.digest, validators);
|
||||
this.#validators = validators;
|
||||
this.createdAtHash = header?.createdAtHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the author for the block
|
||||
*/
|
||||
public get author (): AccountId | undefined {
|
||||
return this.#author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the validators for the block
|
||||
*/
|
||||
public get validators (): AccountId[] | undefined {
|
||||
return this.#validators;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the author for the block
|
||||
*/
|
||||
public get author (): AccountId | undefined {
|
||||
return this.#author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the validators for the block
|
||||
*/
|
||||
public get validators (): AccountId[] | undefined {
|
||||
return this.#validators;
|
||||
}
|
||||
return new Implementation(registry, header, validators);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId, DispatchError, DispatchInfo, Event, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces';
|
||||
import type { Constructor, Registry } from '@polkadot/types/types';
|
||||
|
||||
import { Struct } from '@polkadot/types';
|
||||
import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions';
|
||||
import type { AccountId, DispatchError, DispatchInfo, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { SignedBlockExtended, TxWithEvent } from './types';
|
||||
|
||||
import { extractAuthor } from './util';
|
||||
|
||||
// We can ignore the properties, added via Struct.with
|
||||
const _SignedBlock = Struct.with(runtimeTypes.types.SignedBlock as any) as Constructor<SignedBlock>;
|
||||
|
||||
interface TxWithEvent {
|
||||
dispatchError?: DispatchError;
|
||||
dispatchInfo?: DispatchInfo;
|
||||
events: Event[];
|
||||
extrinsic: Extrinsic;
|
||||
}
|
||||
|
||||
function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWithEvent[] {
|
||||
return extrinsics.map((extrinsic, index): TxWithEvent => {
|
||||
let dispatchError: DispatchError | undefined;
|
||||
@@ -43,42 +31,45 @@ function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWith
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @name SignedBlockExtended
|
||||
* @description
|
||||
* A [[Block]] header with an additional `author` field that indicates the block author
|
||||
*/
|
||||
export class SignedBlockExtended extends _SignedBlock {
|
||||
readonly #author?: AccountId;
|
||||
readonly #events: EventRecord[];
|
||||
readonly #extrinsics: TxWithEvent[];
|
||||
export function createSignedBlockExtended (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]): SignedBlockExtended {
|
||||
// an instance of the base extrinsic for us to extend
|
||||
const SignedBlockBase = registry.createClass('SignedBlock');
|
||||
|
||||
constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], sessionValidators?: AccountId[]) {
|
||||
super(registry, block);
|
||||
class Implementation extends SignedBlockBase implements SignedBlockExtended {
|
||||
readonly #author?: AccountId;
|
||||
readonly #events: EventRecord[];
|
||||
readonly #extrinsics: TxWithEvent[];
|
||||
|
||||
this.#author = extractAuthor(this.block.header.digest, sessionValidators);
|
||||
this.#events = events || ([] as EventRecord[]);
|
||||
this.#extrinsics = mapExtrinsics(this.block.extrinsics, this.#events);
|
||||
constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]) {
|
||||
super(registry, block);
|
||||
|
||||
this.#author = extractAuthor(this.block.header.digest, validators);
|
||||
this.#events = events || ([] as EventRecord[]);
|
||||
this.#extrinsics = mapExtrinsics(this.block.extrinsics, this.#events);
|
||||
this.createdAtHash = block?.createdAtHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the author for the block
|
||||
*/
|
||||
public get author (): AccountId | undefined {
|
||||
return this.#author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the events associated with the block
|
||||
*/
|
||||
public get events (): EventRecord[] {
|
||||
return this.#events;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the extrinsics and their events, mapped
|
||||
*/
|
||||
public get extrinsics (): TxWithEvent[] {
|
||||
return this.#extrinsics;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the author for the block
|
||||
*/
|
||||
public get author (): AccountId | undefined {
|
||||
return this.#author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the events associated with the block
|
||||
*/
|
||||
public get events (): EventRecord[] {
|
||||
return this.#events;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the extrinsics and their events, mapped
|
||||
*/
|
||||
public get extrinsics (): TxWithEvent[] {
|
||||
return this.#extrinsics;
|
||||
}
|
||||
return new Implementation(registry, block, events, validators);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { HeaderExtended } from './HeaderExtended';
|
||||
export { SignedBlockExtended } from './SignedBlockExtended';
|
||||
export { createHeaderExtended } from './HeaderExtended';
|
||||
export { createSignedBlockExtended } from './SignedBlockExtended';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId, DispatchError, DispatchInfo, Event, EventRecord, Extrinsic, Header, SignedBlock } from '@polkadot/types/interfaces';
|
||||
|
||||
export interface HeaderExtended extends Header {
|
||||
readonly author: AccountId | undefined;
|
||||
readonly validators: AccountId[] | undefined;
|
||||
}
|
||||
|
||||
export interface SignedBlockExtended extends SignedBlock {
|
||||
readonly author: AccountId | undefined;
|
||||
readonly events: EventRecord[];
|
||||
readonly extrinsics: TxWithEvent[];
|
||||
}
|
||||
|
||||
export interface TxWithEvent {
|
||||
dispatchError?: DispatchError;
|
||||
dispatchInfo?: DispatchInfo;
|
||||
events: Event[];
|
||||
extrinsic: Extrinsic;
|
||||
}
|
||||
@@ -5,20 +5,43 @@ import type { AccountId, Digest } from '@polkadot/types/interfaces';
|
||||
|
||||
export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined {
|
||||
const [citem] = digest.logs.filter(({ type }) => type === 'Consensus');
|
||||
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime');
|
||||
const [sitem] = digest.logs.filter(({ type }) => type === 'Seal');
|
||||
|
||||
if (citem) {
|
||||
const [engine, data] = citem.asConsensus;
|
||||
let accountId: AccountId | undefined;
|
||||
|
||||
return engine.extractAuthor(data, sessionValidators);
|
||||
} else {
|
||||
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime');
|
||||
|
||||
if (pitem) {
|
||||
// This is critical to be first for BABE (before Consensus)
|
||||
// If not first, we end up dropping the author at session-end
|
||||
if (pitem) {
|
||||
try {
|
||||
const [engine, data] = pitem.asPreRuntime;
|
||||
|
||||
return engine.extractAuthor(data, sessionValidators);
|
||||
accountId = engine.extractAuthor(data, sessionValidators);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
if (!accountId && citem) {
|
||||
try {
|
||||
const [engine, data] = citem.asConsensus;
|
||||
|
||||
accountId = engine.extractAuthor(data, sessionValidators);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
// SEAL, still used in e.g. Kulupu for pow
|
||||
if (!accountId && sitem) {
|
||||
try {
|
||||
const [engine, data] = sitem.asSeal;
|
||||
|
||||
accountId = engine.extractAuthor(data, sessionValidators);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './elections/types';
|
||||
export * from './parachains/types';
|
||||
export * from './session/types';
|
||||
export * from './staking/types';
|
||||
export * from './type/types';
|
||||
|
||||
export interface DeriveBalancesAccountData {
|
||||
freeBalance: Balance;
|
||||
@@ -107,6 +108,7 @@ export interface DeriveSocietyCandidate {
|
||||
|
||||
export interface DeriveSocietyMember {
|
||||
accountId: AccountId;
|
||||
isDefenderVoter: boolean;
|
||||
isSuspended: boolean;
|
||||
payouts: [BlockNumber, Balance][];
|
||||
strikes: StrikeCount;
|
||||
|
||||
+14
-13
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,17 +16,17 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@polkadot/api-derive": "3.11.1",
|
||||
"@polkadot/keyring": "^5.9.2",
|
||||
"@polkadot/metadata": "3.11.1",
|
||||
"@polkadot/rpc-core": "3.11.1",
|
||||
"@polkadot/rpc-provider": "3.11.1",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/types-known": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/util-crypto": "^5.9.2",
|
||||
"@polkadot/x-rxjs": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api-derive": "4.5.1",
|
||||
"@polkadot/keyring": "^6.1.1",
|
||||
"@polkadot/metadata": "4.5.1",
|
||||
"@polkadot/rpc-core": "4.5.1",
|
||||
"@polkadot/rpc-provider": "4.5.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/types-known": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/util-crypto": "^6.1.1",
|
||||
"@polkadot/x-rxjs": "^6.1.1",
|
||||
"bn.js": "^4.11.9",
|
||||
"eventemitter3": "^4.0.7"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { Vec, u16, u32, u64, u8 } from '@polkadot/types';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, Moment, PalletId, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SessionIndex } from '@polkadot/types/interfaces/session';
|
||||
import type { EraIndex } from '@polkadot/types/interfaces/staking';
|
||||
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
|
||||
@@ -16,11 +16,9 @@ declare module '@polkadot/api/types/consts' {
|
||||
babe: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
* The number of **slots** that an epoch takes. We couple sessions to
|
||||
* epochs, i.e. we start a new session once the new epoch begins.
|
||||
* NOTE: Currently it is not possible to change the epoch duration
|
||||
* after the chain has started. Attempting to do so will brick block
|
||||
* production.
|
||||
* The amount of time, in slots, that each epoch should last.
|
||||
* NOTE: Currently it is not possible to change the epoch duration after
|
||||
* the chain has started. Attempting to do so will brick block production.
|
||||
**/
|
||||
epochDuration: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -205,11 +203,57 @@ declare module '@polkadot/api/types/consts' {
|
||||
candidacyBond: BalanceOf & AugmentedConst<ApiType>;
|
||||
desiredMembers: u32 & AugmentedConst<ApiType>;
|
||||
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
|
||||
moduleId: LockIdentifier & AugmentedConst<ApiType>;
|
||||
palletId: LockIdentifier & AugmentedConst<ApiType>;
|
||||
termDuration: BlockNumber & AugmentedConst<ApiType>;
|
||||
votingBondBase: BalanceOf & AugmentedConst<ApiType>;
|
||||
votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
};
|
||||
gilt: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
* Portion of the queue which is free from ordering and just a FIFO.
|
||||
*
|
||||
* Must be no greater than `MaxQueueLen`.
|
||||
**/
|
||||
fifoQueueLen: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of blocks between consecutive attempts to issue more gilts in an effort to
|
||||
* get to the target amount to be frozen.
|
||||
*
|
||||
* A larger value results in fewer storage hits each block, but a slower period to get to
|
||||
* the target.
|
||||
**/
|
||||
intakePeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum amount of bids that can be turned into issued gilts each block. A larger
|
||||
* value here means less of the block available for transactions should there be a glut of
|
||||
* bids to make into gilts to reach the target.
|
||||
**/
|
||||
maxIntakeBids: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum number of items that may be in each duration queue.
|
||||
**/
|
||||
maxQueueLen: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum amount of funds that may be offered to freeze for a gilt. Note that this
|
||||
* does not actually limit the amount which may be frozen in a gilt since gilts may be
|
||||
* split up in order to satisfy the desired amount of funds under gilts.
|
||||
*
|
||||
* It should be at least big enough to ensure that there is no possible storage spam attack
|
||||
* or queue-filling attack.
|
||||
**/
|
||||
minFreeze: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The base period for the duration queues. This is the common multiple across all
|
||||
* supported freezing durations that can be bid upon.
|
||||
**/
|
||||
period: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Number of duration queues in total. This sets the maximum duration supported, which is
|
||||
* this value multiplied by `Period`.
|
||||
**/
|
||||
queueCount: u32 & AugmentedConst<ApiType>;
|
||||
};
|
||||
identity: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
@@ -251,7 +295,7 @@ declare module '@polkadot/api/types/consts' {
|
||||
lottery: {
|
||||
[key: string]: Codec;
|
||||
maxCalls: u32 & AugmentedConst<ApiType>;
|
||||
moduleId: ModuleId & AugmentedConst<ApiType>;
|
||||
palletId: PalletId & AugmentedConst<ApiType>;
|
||||
};
|
||||
multisig: {
|
||||
[key: string]: Codec;
|
||||
@@ -272,15 +316,20 @@ declare module '@polkadot/api/types/consts' {
|
||||
proxy: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
* `AnnouncementDepositBase` metadata shadow.
|
||||
* 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).
|
||||
**/
|
||||
announcementDepositBase: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* `AnnouncementDepositFactor` metadata shadow.
|
||||
* The amount of currency needed per announcement made.
|
||||
*
|
||||
* This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)
|
||||
* into a pre-existing storage value.
|
||||
**/
|
||||
announcementDepositFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* `MaxPending` metadata shadow.
|
||||
* The maximum amount of time-delayed announcements that are allowed to be pending.
|
||||
**/
|
||||
maxPending: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -289,10 +338,17 @@ declare module '@polkadot/api/types/consts' {
|
||||
maxProxies: u16 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The base amount of currency needed to reserve for creating a proxy.
|
||||
*
|
||||
* This is held for an additional storage item whose value size is
|
||||
* `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
|
||||
**/
|
||||
proxyDepositBase: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
proxyDepositFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
};
|
||||
@@ -325,6 +381,10 @@ declare module '@polkadot/api/types/consts' {
|
||||
* The number of blocks between membership challenges.
|
||||
**/
|
||||
challengePeriod: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum candidate intake per round.
|
||||
**/
|
||||
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of times a member may vote the wrong way (or not at all, when they are a skeptic)
|
||||
* before they become suspended.
|
||||
@@ -333,7 +393,7 @@ declare module '@polkadot/api/types/consts' {
|
||||
/**
|
||||
* The societies's module id
|
||||
**/
|
||||
moduleId: ModuleId & AugmentedConst<ApiType>;
|
||||
palletId: PalletId & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount of incentive paid within each period. Doesn't include VoterTip.
|
||||
**/
|
||||
@@ -355,21 +415,9 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
bondingDuration: EraIndex & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of blocks before the end of the era from which election submissions are allowed.
|
||||
*
|
||||
* Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
|
||||
* be used.
|
||||
*
|
||||
* This is bounded by being within the last session. Hence, setting it to a value more than the
|
||||
* length of a session will be pointless.
|
||||
* Maximum number of nominations per nominator.
|
||||
**/
|
||||
electionLookahead: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum number of balancing iterations to run in the offchain submission.
|
||||
*
|
||||
* If set to 0, balance_solution will not be executed at all.
|
||||
**/
|
||||
maxIterations: u32 & AugmentedConst<ApiType>;
|
||||
maxNominations: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of nominators rewarded for each validator.
|
||||
*
|
||||
@@ -377,10 +425,6 @@ declare module '@polkadot/api/types/consts' {
|
||||
* their reward. This used to limit the i/o cost for the nominator payout.
|
||||
**/
|
||||
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The threshold of improvement that should be provided for a new solution to be accepted.
|
||||
**/
|
||||
minSolutionScoreBump: Perbill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Number of sessions per era.
|
||||
**/
|
||||
@@ -478,7 +522,7 @@ declare module '@polkadot/api/types/consts' {
|
||||
/**
|
||||
* The treasury's module id, used for deriving its sovereign account ID.
|
||||
**/
|
||||
moduleId: ModuleId & AugmentedConst<ApiType>;
|
||||
palletId: PalletId & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Fraction of a proposal's value that should be bonded in order to place the proposal.
|
||||
* An accepted proposal gets these back. A rejected proposal does not.
|
||||
@@ -496,7 +540,7 @@ declare module '@polkadot/api/types/consts' {
|
||||
vesting: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
* The minimum amount to be transferred to create a new vesting schedule.
|
||||
* The minimum amount transferred to call `vested_transfer`.
|
||||
**/
|
||||
minVestedTransfer: BalanceOf & AugmentedConst<ApiType>;
|
||||
};
|
||||
|
||||
@@ -7,18 +7,10 @@ declare module '@polkadot/api/types/errors' {
|
||||
export interface AugmentedErrors<ApiType> {
|
||||
assets: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Transfer amount should be non-zero.
|
||||
**/
|
||||
AmountZero: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid metadata given.
|
||||
**/
|
||||
BadMetadata: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Some internal state is broken.
|
||||
**/
|
||||
BadState: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid witness data given.
|
||||
**/
|
||||
@@ -47,22 +39,26 @@ declare module '@polkadot/api/types/errors' {
|
||||
* The signing account has no permission to do the operation.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No provider reference exists to allow a non-zero balance of a non-self-sufficient asset.
|
||||
**/
|
||||
NoProvider: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A mint operation lead to an overflow.
|
||||
**/
|
||||
Overflow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist.
|
||||
* No approval exists that would allow the transfer.
|
||||
**/
|
||||
RefsLeft: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many zombie accounts in use.
|
||||
**/
|
||||
TooManyZombies: AugmentedError<ApiType>;
|
||||
Unapproved: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given asset ID is unknown.
|
||||
**/
|
||||
Unknown: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The source account would not survive the transfer and it needs to stay alive.
|
||||
**/
|
||||
WouldDie: AugmentedError<ApiType>;
|
||||
};
|
||||
authorship: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
@@ -95,6 +91,21 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
UnclesAlreadySet: AugmentedError<ApiType>;
|
||||
};
|
||||
babe: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A given equivocation report is valid but already previously reported.
|
||||
**/
|
||||
DuplicateOffenceReport: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An equivocation proof provided as part of an equivocation report is invalid.
|
||||
**/
|
||||
InvalidEquivocationProof: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A key ownership proof provided as part of an equivocation report is invalid.
|
||||
**/
|
||||
InvalidKeyOwnershipProof: AugmentedError<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -585,6 +596,42 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
UnableToVote: AugmentedError<ApiType>;
|
||||
};
|
||||
gilt: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The amount of the bid is less than the minimum allowed.
|
||||
**/
|
||||
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.
|
||||
**/
|
||||
BidTooLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The duration is the bid is greater than the number of queues.
|
||||
**/
|
||||
DurationTooBig: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The duration of the bid is less than one.
|
||||
**/
|
||||
DurationTooSmall: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Gilt not yet at expiry date.
|
||||
**/
|
||||
NotExpired: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given bid for retraction is not found.
|
||||
**/
|
||||
NotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not the owner of the gilt.
|
||||
**/
|
||||
NotOwner: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Gilt index is unknown.
|
||||
**/
|
||||
Unknown: AugmentedError<ApiType>;
|
||||
};
|
||||
grandpa: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -696,6 +743,64 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
InvalidKey: AugmentedError<ApiType>;
|
||||
};
|
||||
indices: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The index was not available.
|
||||
**/
|
||||
InUse: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The index was not already assigned.
|
||||
**/
|
||||
NotAssigned: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The index is assigned to another account.
|
||||
**/
|
||||
NotOwner: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The source and destination accounts are identical.
|
||||
**/
|
||||
NotTransfer: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The index is permanent and may not be freed/changed.
|
||||
**/
|
||||
Permanent: AugmentedError<ApiType>;
|
||||
};
|
||||
lottery: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A lottery has already ended.
|
||||
**/
|
||||
AlreadyEnded: AugmentedError<ApiType>;
|
||||
/**
|
||||
* You are already participating in the lottery with this call.
|
||||
**/
|
||||
AlreadyParticipating: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Failed to encode calls
|
||||
**/
|
||||
EncodingFailed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A lottery is already in progress.
|
||||
**/
|
||||
InProgress: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The call is not valid for an open lottery.
|
||||
**/
|
||||
InvalidCall: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A lottery has not been configured.
|
||||
**/
|
||||
NotConfigured: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An overflow has occurred.
|
||||
**/
|
||||
Overflow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many calls for a single lottery.
|
||||
**/
|
||||
TooManyCalls: AugmentedError<ApiType>;
|
||||
};
|
||||
multisig: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1000,10 +1105,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* A nomination target was supplied that was blocked or otherwise not a validator.
|
||||
**/
|
||||
BadTarget: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The call is not allowed at the given time due to restrictions of election period.
|
||||
**/
|
||||
CallNotAllowed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Duplicate index.
|
||||
**/
|
||||
@@ -1060,61 +1161,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* Can not rebond without unlocking chunks.
|
||||
**/
|
||||
NoUnlockChunk: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Error while building the assignment type from the compact. This can happen if an index
|
||||
* is invalid, or if the weights _overflow_.
|
||||
**/
|
||||
OffchainElectionBogusCompact: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The submitted result has unknown edges that are not among the presented winners.
|
||||
**/
|
||||
OffchainElectionBogusEdge: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The election size is invalid.
|
||||
**/
|
||||
OffchainElectionBogusElectionSize: AugmentedError<ApiType>;
|
||||
/**
|
||||
* One of the submitted nominators has an edge to which they have not voted on chain.
|
||||
**/
|
||||
OffchainElectionBogusNomination: AugmentedError<ApiType>;
|
||||
/**
|
||||
* One of the submitted nominators is not an active nominator on chain.
|
||||
**/
|
||||
OffchainElectionBogusNominator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The claimed score does not match with the one computed from the data.
|
||||
**/
|
||||
OffchainElectionBogusScore: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A self vote must only be originated from a validator to ONLY themselves.
|
||||
**/
|
||||
OffchainElectionBogusSelfVote: AugmentedError<ApiType>;
|
||||
/**
|
||||
* One of the submitted winners is not an active candidate on chain (index is out of range
|
||||
* in snapshot).
|
||||
**/
|
||||
OffchainElectionBogusWinner: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Incorrect number of winners were presented.
|
||||
**/
|
||||
OffchainElectionBogusWinnerCount: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The submitted result is received out of the open window.
|
||||
**/
|
||||
OffchainElectionEarlySubmission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* One of the submitted nominators has an edge which is submitted before the last non-zero
|
||||
* slash of the target.
|
||||
**/
|
||||
OffchainElectionSlashedNomination: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The submitted result is not as good as the one stored on chain.
|
||||
**/
|
||||
OffchainElectionWeakSubmission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The snapshot data of the current window is missing.
|
||||
**/
|
||||
SnapshotUnavailable: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many nomination targets supplied.
|
||||
**/
|
||||
@@ -1197,6 +1243,17 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
WrongProposalWeight: AugmentedError<ApiType>;
|
||||
};
|
||||
technicalMembership: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Already a member.
|
||||
**/
|
||||
AlreadyMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
};
|
||||
tips: {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -9,12 +9,13 @@ import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/coll
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
|
||||
import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
|
||||
import type { ActiveIndex } from '@polkadot/types/interfaces/gilt';
|
||||
import type { AuthorityList } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { RegistrarIndex } from '@polkadot/types/interfaces/identity';
|
||||
import type { CallIndex } from '@polkadot/types/interfaces/lottery';
|
||||
import type { Kind, OpaqueTimeSlot } from '@polkadot/types/interfaces/offences';
|
||||
import type { ProxyType } from '@polkadot/types/interfaces/proxy';
|
||||
import type { AccountId, AccountIndex, AssetId, Balance, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime';
|
||||
import type { TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session';
|
||||
import type { ElectionCompute, EraIndex } from '@polkadot/types/interfaces/staking';
|
||||
@@ -27,10 +28,25 @@ declare module '@polkadot/api/types/events' {
|
||||
export interface AugmentedEvents<ApiType> {
|
||||
assets: {
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
/**
|
||||
* An approval for account `delegate` was cancelled by `owner`.
|
||||
* \[id, owner, delegate\]
|
||||
**/
|
||||
ApprovalCancelled: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId]>;
|
||||
/**
|
||||
* (Additional) funds have been approved for transfer to a destination account.
|
||||
* \[asset_id, source, delegate, amount\]
|
||||
**/
|
||||
ApprovedTransfer: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
|
||||
/**
|
||||
* Some asset `asset_id` was frozen. \[asset_id\]
|
||||
**/
|
||||
AssetFrozen: AugmentedEvent<ApiType, [AssetId]>;
|
||||
/**
|
||||
* An asset has had its attributes changed by the `Force` origin.
|
||||
* \[id\]
|
||||
**/
|
||||
AssetStatusChanged: AugmentedEvent<ApiType, [AssetId]>;
|
||||
/**
|
||||
* Some asset `asset_id` was thawed. \[asset_id\]
|
||||
**/
|
||||
@@ -51,10 +67,6 @@ declare module '@polkadot/api/types/events' {
|
||||
* Some asset class was force-created. \[asset_id, owner\]
|
||||
**/
|
||||
ForceCreated: AugmentedEvent<ApiType, [AssetId, AccountId]>;
|
||||
/**
|
||||
* Some assets was transferred by an admin. \[asset_id, from, to, amount\]
|
||||
**/
|
||||
ForceTransferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
|
||||
/**
|
||||
* Some account `who` was frozen. \[asset_id, who\]
|
||||
**/
|
||||
@@ -64,13 +76,13 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
Issued: AugmentedEvent<ApiType, [AssetId, AccountId, TAssetBalance]>;
|
||||
/**
|
||||
* The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\]
|
||||
* Metadata has been cleared for an asset. \[asset_id\]
|
||||
**/
|
||||
MaxZombiesChanged: AugmentedEvent<ApiType, [AssetId, u32]>;
|
||||
MetadataCleared: AugmentedEvent<ApiType, [AssetId]>;
|
||||
/**
|
||||
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals\]
|
||||
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\]
|
||||
**/
|
||||
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8]>;
|
||||
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8, bool]>;
|
||||
/**
|
||||
* The owner changed \[asset_id, owner\]
|
||||
**/
|
||||
@@ -87,6 +99,12 @@ declare module '@polkadot/api/types/events' {
|
||||
* Some assets were transferred. \[asset_id, from, to, amount\]
|
||||
**/
|
||||
Transferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
|
||||
/**
|
||||
* An `amount` was transferred in its entirety from `owner` to `destination` by
|
||||
* the approved `delegate`.
|
||||
* \[id, owner, delegate, destination\]
|
||||
**/
|
||||
TransferredApproved: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, AccountId, TAssetBalance]>;
|
||||
};
|
||||
balances: {
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
@@ -415,6 +433,29 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
SeatHolderSlashed: AugmentedEvent<ApiType, [AccountId, Balance]>;
|
||||
};
|
||||
gilt: {
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
/**
|
||||
* A bid was successfully placed.
|
||||
* \[ who, amount, duration \]
|
||||
**/
|
||||
BidPlaced: AugmentedEvent<ApiType, [AccountId, BalanceOf, u32]>;
|
||||
/**
|
||||
* A bid was successfully removed (before being accepted as a gilt).
|
||||
* \[ who, amount, duration \]
|
||||
**/
|
||||
BidRetracted: AugmentedEvent<ApiType, [AccountId, BalanceOf, u32]>;
|
||||
/**
|
||||
* A bid was accepted as a gilt. The balance may not be released until expiry.
|
||||
* \[ index, expiry, who, amount \]
|
||||
**/
|
||||
GiltIssued: AugmentedEvent<ApiType, [ActiveIndex, BlockNumber, AccountId, BalanceOf]>;
|
||||
/**
|
||||
* An expired gilt has been thawed.
|
||||
* \[ index, who, original_amount, additional_amount \]
|
||||
**/
|
||||
GiltThawed: AugmentedEvent<ApiType, [ActiveIndex, AccountId, BalanceOf, BalanceOf]>;
|
||||
};
|
||||
grandpa: {
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
/**
|
||||
@@ -728,13 +769,9 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
Slash: AugmentedEvent<ApiType, [AccountId, Balance]>;
|
||||
/**
|
||||
* A new solution for the upcoming election has been stored. \[compute\]
|
||||
* A new set of stakers was elected.
|
||||
**/
|
||||
SolutionStored: AugmentedEvent<ApiType, [ElectionCompute]>;
|
||||
/**
|
||||
* A new set of stakers was elected with the given \[compute\].
|
||||
**/
|
||||
StakingElection: AugmentedEvent<ApiType, [ElectionCompute]>;
|
||||
StakingElection: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* An account has unbonded this amount. \[stash, amount\]
|
||||
**/
|
||||
@@ -782,6 +819,10 @@ declare module '@polkadot/api/types/events' {
|
||||
* A new \[account\] was created.
|
||||
**/
|
||||
NewAccount: AugmentedEvent<ApiType, [AccountId]>;
|
||||
/**
|
||||
* On on-chain remark happened. \[origin, remark_hash\]
|
||||
**/
|
||||
Remarked: AugmentedEvent<ApiType, [AccountId, Hash]>;
|
||||
};
|
||||
technicalCommittee: {
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
|
||||
@@ -3,15 +3,16 @@
|
||||
|
||||
import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
|
||||
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
|
||||
import type { AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets';
|
||||
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets';
|
||||
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
|
||||
import type { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
|
||||
import type { BabeAuthorityWeight, BabeEpochConfiguration, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
|
||||
import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
|
||||
import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
|
||||
import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy';
|
||||
import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
|
||||
import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt';
|
||||
import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity';
|
||||
import type { AuthIndex } from '@polkadot/types/interfaces/imOnline';
|
||||
@@ -23,7 +24,7 @@ import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber,
|
||||
import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, ReadySolution, RewardDestination, RoundSnapshot, SeatHolder, SlashingSpans, SolutionOrSnapshotSize, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ActiveEraInfo, ElectionPhase, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, ReadySolution, RewardDestination, RoundSnapshot, SeatHolder, SlashingSpans, SolutionOrSnapshotSize, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { AccountInfo, ConsumedWeight, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system';
|
||||
import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
@@ -39,6 +40,11 @@ declare module '@polkadot/api/types/storage' {
|
||||
* The number of units of assets held by any given account.
|
||||
**/
|
||||
account: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<AssetBalance>, [AssetId, AccountId]> & QueryableStorageEntry<ApiType, [AssetId, AccountId]>;
|
||||
/**
|
||||
* Approved balance transfers. First balance is the amount approved for transfer. Second
|
||||
* is the amount of `T::Currency` reserved for storing this.
|
||||
**/
|
||||
approvals: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AssetApprovalKey | { owner?: any; delegate?: any } | string | Uint8Array) => Observable<Option<AssetApproval>>, [AssetId, AssetApprovalKey]> & QueryableStorageEntry<ApiType, [AssetId, AssetApprovalKey]>;
|
||||
/**
|
||||
* Details of an asset.
|
||||
**/
|
||||
@@ -79,10 +85,22 @@ declare module '@polkadot/api/types/storage' {
|
||||
* Current slot number.
|
||||
**/
|
||||
currentSlot: AugmentedQuery<ApiType, () => Observable<Slot>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The configuration for the current epoch. Should never be `None` as it is initialized in genesis.
|
||||
**/
|
||||
epochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Current epoch index.
|
||||
**/
|
||||
epochIndex: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The block numbers when the last and current epoch have started, respectively `N-1` and
|
||||
* `N`.
|
||||
* NOTE: We track this is in order to annotate the block number when a given pool of
|
||||
* entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in
|
||||
* slots, which may be skipped, the block numbers may not line up with the slot numbers.
|
||||
**/
|
||||
epochStart: AugmentedQuery<ApiType, () => Observable<ITuple<[BlockNumber, BlockNumber]>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The slot at which the first epoch actually started. This is 0
|
||||
* until the first block of the chain.
|
||||
@@ -106,13 +124,18 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
nextAuthorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Next epoch configuration, if changed.
|
||||
* The configuration for the next epoch, `None` if the config will not change
|
||||
* (you can fallback to `EpochConfig` instead in that case).
|
||||
**/
|
||||
nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Next epoch randomness.
|
||||
**/
|
||||
nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Pending epoch configuration change that will be applied when the next epoch is enacted.
|
||||
**/
|
||||
pendingEpochConfigChange: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The epoch randomness for the *current* epoch.
|
||||
*
|
||||
@@ -328,7 +351,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* Current phase.
|
||||
**/
|
||||
currentPhase: AugmentedQuery<ApiType, () => Observable<Phase>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
currentPhase: AugmentedQuery<ApiType, () => Observable<ElectionPhase>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Desired number of targets to elect for this round.
|
||||
*
|
||||
@@ -396,6 +419,29 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
voting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Voter>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
|
||||
};
|
||||
gilt: {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
/**
|
||||
* The currently active gilts, indexed according to the order of creation.
|
||||
**/
|
||||
active: AugmentedQuery<ApiType, (arg: ActiveIndex | AnyNumber | Uint8Array) => Observable<Option<ActiveGilt>>, [ActiveIndex]> & QueryableStorageEntry<ApiType, [ActiveIndex]>;
|
||||
/**
|
||||
* Information relating to the gilts currently active.
|
||||
**/
|
||||
activeTotal: AugmentedQuery<ApiType, () => Observable<ActiveGiltsTotal>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The queues of bids ready to become gilts. Indexed by duration (in `Period`s).
|
||||
**/
|
||||
queues: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<GiltBid>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The totals of items and balances within each queue. Saves a lot of storage reads in the
|
||||
* case of sparsely packed queues.
|
||||
*
|
||||
* The vector is indexed by duration in `Period`s, offset by one, so information on the queue
|
||||
* whose duration is one `Period` would be storage `0`.
|
||||
**/
|
||||
queueTotals: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u32, BalanceOf]>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
};
|
||||
grandpa: {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
/**
|
||||
@@ -464,12 +510,17 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]> & QueryableStorageEntry<ApiType, [SessionIndex, ValidatorId]>;
|
||||
/**
|
||||
* The block number after which it's ok to send heartbeats in current session.
|
||||
* The block number after which it's ok to send heartbeats in the current
|
||||
* session.
|
||||
*
|
||||
* At the beginning of each session we set this to a value that should
|
||||
* fall roughly in the middle of the session duration.
|
||||
* The idea is to first wait for the validators to produce a block
|
||||
* in the current session, so that the heartbeat later on will not be necessary.
|
||||
* At the beginning of each session we set this to a value that should fall
|
||||
* roughly in the middle of the session duration. The idea is to first wait for
|
||||
* the validators to produce a block in the current session, so that the
|
||||
* heartbeat later on will not be necessary.
|
||||
*
|
||||
* This value will only be used as a fallback if we fail to get a proper session
|
||||
* progress estimate from `NextSessionRotation`, as those estimates should be
|
||||
* more accurate then the value we calculate for `HeartbeatAfter`.
|
||||
**/
|
||||
heartbeatAfter: AugmentedQuery<ApiType, () => Observable<BlockNumber>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -771,13 +822,6 @@ declare module '@polkadot/api/types/storage' {
|
||||
* The earliest era for which we have a pending, unapplied slash.
|
||||
**/
|
||||
earliestUnappliedSlash: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Flag to control the execution of the offchain election. When `Open(_)`, we accept
|
||||
* solutions to be submitted.
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
eraElectionStatus: AugmentedQuery<ApiType, () => Observable<ElectionStatus>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Rewards for the last `HISTORY_DEPTH` eras.
|
||||
* If reward hasn't been set or has been removed then 0 reward is returned.
|
||||
@@ -852,13 +896,6 @@ declare module '@polkadot/api/types/storage' {
|
||||
* invulnerables) and restricted to testnets.
|
||||
**/
|
||||
invulnerables: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* True if the current **planned** session is final. Note that this does not take era
|
||||
* forcing into account.
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
isCurrentSessionFinal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Map from all (unlocked) "controller" accounts to the info regarding the staking.
|
||||
**/
|
||||
@@ -879,20 +916,6 @@ declare module '@polkadot/api/types/storage' {
|
||||
* Where the reward payment should be made. Keyed by stash.
|
||||
**/
|
||||
payee: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<RewardDestination>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
|
||||
/**
|
||||
* The next validator set. At the end of an era, if this is available (potentially from the
|
||||
* result of an offchain worker), it is immediately used. Otherwise, the on-chain election
|
||||
* is executed.
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
queuedElected: AugmentedQuery<ApiType, () => Observable<Option<ElectionResult>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The score of the current [`QueuedElected`].
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
queuedScore: AugmentedQuery<ApiType, () => Observable<Option<ElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Slashing spans for stash accounts.
|
||||
**/
|
||||
@@ -903,20 +926,6 @@ declare module '@polkadot/api/types/storage' {
|
||||
* The rest of the slashed value is handled by the `Slash`.
|
||||
**/
|
||||
slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Snapshot of nominators at the beginning of the current election window. This should only
|
||||
* have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
snapshotNominators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Snapshot of validators at the beginning of the current election window. This should only
|
||||
* have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
|
||||
*
|
||||
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
|
||||
**/
|
||||
snapshotValidators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Records information about the maximum slash of a stash within a slashing span,
|
||||
* as well as how much reward has been paid out.
|
||||
@@ -926,7 +935,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
* True if network has been upgraded to this version.
|
||||
* Storage version of the pallet.
|
||||
*
|
||||
* This is set to v5.0.0 for new networks.
|
||||
* This is set to v6.0.0 for new networks.
|
||||
**/
|
||||
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -1022,10 +1031,10 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
parentHash: AugmentedQuery<ApiType, () => Observable<Hash>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* True if we have upgraded so that AccountInfo contains two types of `RefCount`. False
|
||||
* True if we have upgraded so that AccountInfo contains three types of `RefCount`. False
|
||||
* (default) if not.
|
||||
**/
|
||||
upgradedToDualRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
upgradedToTripleRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* True if we have upgraded so that `type RefCount` is `u32`. False (default) if not.
|
||||
**/
|
||||
|
||||
@@ -14,6 +14,7 @@ import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
|
||||
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
@@ -133,7 +134,7 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
|
||||
/**
|
||||
* Instructs the manual-seal authorship task to finalize a block
|
||||
**/
|
||||
finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification | string | Uint8Array) => Observable<bool>>;
|
||||
finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification) => Observable<bool>>;
|
||||
};
|
||||
eth: {
|
||||
/**
|
||||
@@ -315,6 +316,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
|
||||
**/
|
||||
subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;
|
||||
};
|
||||
mmr: {
|
||||
/**
|
||||
* Generate MMR proof for given leaf index.
|
||||
**/
|
||||
generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
|
||||
};
|
||||
net: {
|
||||
/**
|
||||
* Returns true if client is actively listening for network connections. Otherwise false.
|
||||
|
||||
+255
-120
@@ -3,22 +3,23 @@
|
||||
|
||||
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types/types';
|
||||
import type { TAssetBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AssetDestroyWitness, TAssetBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { BabeEquivocationProof, NextConfigDescriptor } from '@polkadot/types/interfaces/babe';
|
||||
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
|
||||
import type { CodeHash, Schedule } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
|
||||
import type { Renouncing } from '@polkadot/types/interfaces/elections';
|
||||
import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { ActiveIndex } from '@polkadot/types/interfaces/gilt';
|
||||
import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity';
|
||||
import type { Heartbeat } from '@polkadot/types/interfaces/imOnline';
|
||||
import type { ProxyType } from '@polkadot/types/interfaces/proxy';
|
||||
import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Perquintill, Weight } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Period, Priority } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { Keys } from '@polkadot/types/interfaces/session';
|
||||
import type { SocietyJudgement } from '@polkadot/types/interfaces/society';
|
||||
import type { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RawSolution, RewardDestination, SolutionOrSnapshotSize, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
|
||||
import type { EraIndex, RawSolution, RewardDestination, SolutionOrSnapshotSize, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
|
||||
import type { Key } from '@polkadot/types/interfaces/system';
|
||||
import type { BountyIndex } from '@polkadot/types/interfaces/treasury';
|
||||
import type { Timepoint } from '@polkadot/types/interfaces/utility';
|
||||
@@ -29,6 +30,29 @@ declare module '@polkadot/api/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType> {
|
||||
assets: {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
/**
|
||||
* Approve an amount of asset for transfer by a delegated third-party account.
|
||||
*
|
||||
* Origin must be Signed.
|
||||
*
|
||||
* Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account
|
||||
* for the purpose of holding the approval. If some non-zero amount of assets is already
|
||||
* approved from signing account to `delegate`, then it is topped up or unreserved to
|
||||
* meet the right value.
|
||||
*
|
||||
* NOTE: The signing account does not need to own `amount` of assets at the point of
|
||||
* making this call.
|
||||
*
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `delegate`: The account to delegate permission to transfer asset.
|
||||
* - `amount`: The amount of asset that may be transferred by `delegate`. If there is
|
||||
* already an approval in place, then this acts additively.
|
||||
*
|
||||
* Emits `ApprovedTransfer` on success.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
approveTransfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Reduce the balance of `who` by as much as possible up to `amount` assets of `id`.
|
||||
*
|
||||
@@ -47,24 +71,50 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
|
||||
**/
|
||||
burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Cancel all of some asset approved for delegated transfer by a third-party account.
|
||||
*
|
||||
* Origin must be Signed and there must be an approval in place between signer and
|
||||
* `delegate`.
|
||||
*
|
||||
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
|
||||
*
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `delegate`: The account delegated permission to transfer asset.
|
||||
*
|
||||
* Emits `ApprovalCancelled` on success.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
cancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
|
||||
/**
|
||||
* Clear the metadata for an asset.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `id`.
|
||||
*
|
||||
* Any deposit is freed for the asset owner.
|
||||
*
|
||||
* - `id`: The identifier of the asset to clear.
|
||||
*
|
||||
* Emits `MetadataCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
|
||||
/**
|
||||
* Issue a new class of fungible assets from a public origin.
|
||||
*
|
||||
* This new asset class has no assets initially.
|
||||
* This new asset class has no assets initially and its owner is the origin.
|
||||
*
|
||||
* The origin must be Signed and the sender must have sufficient funds free.
|
||||
*
|
||||
* Funds of sender are reserved according to the formula:
|
||||
* `AssetDepositBase + AssetDepositPerZombie * max_zombies`.
|
||||
* Funds of sender are reserved by `AssetDeposit`.
|
||||
*
|
||||
* Parameters:
|
||||
* - `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`.
|
||||
* - `max_zombies`: The total number of accounts which may hold assets in this class yet
|
||||
* have no existential deposit.
|
||||
* - `admin`: The admin of this class of assets. The admin is the initial address of each
|
||||
* member of the asset class's admin 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.
|
||||
*
|
||||
@@ -72,20 +122,79 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, u32, TAssetBalance]>;
|
||||
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, TAssetBalance]>;
|
||||
/**
|
||||
* Destroy a class of fungible assets owned by the sender.
|
||||
* Destroy a class of fungible assets.
|
||||
*
|
||||
* The origin must be Signed and the sender must be the owner of the asset `id`.
|
||||
* The origin must conform to `ForceOrigin` or must be Signed and the sender must be the
|
||||
* owner of the asset `id`.
|
||||
*
|
||||
* - `id`: The identifier of the asset to be destroyed. This must identify an existing
|
||||
* asset.
|
||||
*
|
||||
* Emits `Destroyed` event when successful.
|
||||
*
|
||||
* Weight: `O(z)` where `z` is the number of zombie accounts.
|
||||
* Weight: `O(c + p + a)` where:
|
||||
* - `c = (witness.accounts - witness.sufficients)`
|
||||
* - `s = witness.sufficients`
|
||||
* - `a = witness.approvals`
|
||||
**/
|
||||
destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
|
||||
destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, witness: AssetDestroyWitness | { accounts?: any; sufficients?: any; approvals?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, AssetDestroyWitness]>;
|
||||
/**
|
||||
* Alter the attributes of a given asset.
|
||||
*
|
||||
* Origin must be `ForceOrigin`.
|
||||
*
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `owner`: The new Owner of this asset.
|
||||
* - `issuer`: The new Issuer of this asset.
|
||||
* - `admin`: The new Admin of this asset.
|
||||
* - `freezer`: The new Freezer of this asset.
|
||||
* - `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.
|
||||
* - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient
|
||||
* value to account for the state bloat associated with its balance storage. If set to
|
||||
* `true`, then non-zero balances may be stored without a `consumer` reference (and thus
|
||||
* an ED in the Balances pallet or whatever else is used to control user-account state
|
||||
* growth).
|
||||
* - `is_frozen`: Whether this asset class is frozen except for permissioned/admin
|
||||
* instructions.
|
||||
*
|
||||
* Emits `AssetStatusChanged` with the identity of the asset.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceAssetStatus: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array, isSufficient: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, LookupSource, LookupSource, Compact<TAssetBalance>, bool, bool]>;
|
||||
/**
|
||||
* Cancel all of some asset approved for delegated transfer by a third-party account.
|
||||
*
|
||||
* Origin must be either ForceOrigin or Signed origin with the signer being the Admin
|
||||
* account of the asset `id`.
|
||||
*
|
||||
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
|
||||
*
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `delegate`: The account delegated permission to transfer asset.
|
||||
*
|
||||
* Emits `ApprovalCancelled` on success.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceCancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource]>;
|
||||
/**
|
||||
* Clear the metadata for an asset.
|
||||
*
|
||||
* Origin must be ForceOrigin.
|
||||
*
|
||||
* Any deposit is returned.
|
||||
*
|
||||
* - `id`: The identifier of the asset to clear.
|
||||
*
|
||||
* Emits `MetadataCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceClearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
|
||||
/**
|
||||
* Issue a new class of fungible assets from a privileged origin.
|
||||
*
|
||||
@@ -109,20 +218,24 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<u32>, Compact<TAssetBalance>]>;
|
||||
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, isSufficient: bool | boolean | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, bool, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Destroy a class of fungible assets.
|
||||
* Force the metadata for an asset to some value.
|
||||
*
|
||||
* The origin must conform to `ForceOrigin`.
|
||||
* Origin must be ForceOrigin.
|
||||
*
|
||||
* - `id`: The identifier of the asset to be destroyed. This must identify an existing
|
||||
* asset.
|
||||
* Any deposit is left alone.
|
||||
*
|
||||
* Emits `Destroyed` event when successful.
|
||||
* - `id`: The identifier of the asset to update.
|
||||
* - `name`: The user friendly name of this asset. Limited in length by `StringLimit`.
|
||||
* - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`.
|
||||
* - `decimals`: The number of decimals this asset uses to represent one unit.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
* Emits `MetadataSet`.
|
||||
*
|
||||
* Weight: `O(N + S)` where N and S are the length of the name and symbol respectively.
|
||||
**/
|
||||
forceDestroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
|
||||
forceSetMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, name: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, decimals: u8 | AnyNumber | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Bytes, Bytes, u8, bool]>;
|
||||
/**
|
||||
* Move some assets from one account to another.
|
||||
*
|
||||
@@ -185,30 +298,9 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
|
||||
**/
|
||||
mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Set the maximum number of zombie accounts for an asset.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `id`.
|
||||
*
|
||||
* Funds of sender are reserved according to the formula:
|
||||
* `AssetDepositBase + AssetDepositPerZombie * max_zombies` taking into account
|
||||
* any already reserved funds.
|
||||
*
|
||||
* - `id`: The identifier of the asset to update zombie count.
|
||||
* - `max_zombies`: The new number of zombies allowed for this asset.
|
||||
*
|
||||
* Emits `MaxZombiesChanged`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setMaxZombies: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
|
||||
/**
|
||||
* Set the metadata for an asset.
|
||||
*
|
||||
* NOTE: There is no `unset_metadata` call. Simply pass an empty name, symbol,
|
||||
* and 0 decimals to this function to remove the metadata of an asset and
|
||||
* return your deposit.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `id`.
|
||||
*
|
||||
* Funds of sender are reserved according to the formula:
|
||||
@@ -220,7 +312,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`.
|
||||
* - `decimals`: The number of decimals this asset uses to represent one unit.
|
||||
*
|
||||
* Emits `MaxZombiesChanged`.
|
||||
* Emits `MetadataSet`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
@@ -286,12 +378,54 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* of sender; Account pre-existence of `target`.
|
||||
**/
|
||||
transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Transfer some asset balance from a previously delegated account to some third-party
|
||||
* account.
|
||||
*
|
||||
* Origin must be Signed and there must be an approval in place by the `owner` to the
|
||||
* signer.
|
||||
*
|
||||
* If the entire amount approved for transfer is transferred, then any deposit previously
|
||||
* reserved by `approve_transfer` is unreserved.
|
||||
*
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `owner`: The account which previously approved for a transfer of at least `amount` and
|
||||
* from which the asset balance will be withdrawn.
|
||||
* - `destination`: The account to which the asset balance of `amount` will be transferred.
|
||||
* - `amount`: The amount of assets to transfer.
|
||||
*
|
||||
* Emits `TransferredApproved` on success.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transferApproved: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, destination: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Move some assets from the sender account to another, keeping the sender account alive.
|
||||
*
|
||||
* Origin must be Signed.
|
||||
*
|
||||
* - `id`: The identifier of the asset to have some amount transferred.
|
||||
* - `target`: The account to be credited.
|
||||
* - `amount`: The amount by which the sender's balance of assets should be reduced and
|
||||
* `target`'s balance increased. The amount actually transferred may be slightly greater in
|
||||
* the case that the transfer would otherwise take the sender balance above zero but below
|
||||
* the minimum balance. Must be greater than zero.
|
||||
*
|
||||
* Emits `Transferred` with the actual amount transferred. If this takes the source balance
|
||||
* to below the minimum for the asset, then the amount transferred is increased to take it
|
||||
* to zero.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
* Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status
|
||||
* of sender; Account pre-existence of `target`.
|
||||
**/
|
||||
transferKeepAlive: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
|
||||
/**
|
||||
* Change the Owner of an asset.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `id`.
|
||||
*
|
||||
* - `id`: The identifier of the asset to be frozen.
|
||||
* - `id`: The identifier of the asset.
|
||||
* - `owner`: The new Owner of this asset.
|
||||
*
|
||||
* Emits `OwnerChanged`.
|
||||
@@ -309,6 +443,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
};
|
||||
babe: {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
/**
|
||||
* Plan an epoch config change. The epoch config change is recorded and will be enacted on
|
||||
* the next call to `enact_epoch_change`. The config will be activated one epoch after.
|
||||
* Multiple calls to this method will replace any existing planned config change that had
|
||||
* not been enacted yet.
|
||||
**/
|
||||
planConfigChange: AugmentedSubmittable<(config: NextConfigDescriptor | { V0: any } | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NextConfigDescriptor]>;
|
||||
/**
|
||||
* Report authority equivocation/misbehavior. This method will verify
|
||||
* the equivocation proof and validate the given key ownership proof
|
||||
@@ -571,7 +712,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* * `gas_limit`: The gas limit enforced when executing the constructor.
|
||||
* * `code`: The contract code to deploy in raw bytes.
|
||||
* * `data`: The input data to pass to the contract constructor.
|
||||
* * `salt`: Used for the address derivation. See [`Self::contract_address`].
|
||||
* * `salt`: Used for the address derivation. See [`Pallet::contract_address`].
|
||||
*
|
||||
* Instantiation is executed as follows:
|
||||
*
|
||||
@@ -586,7 +727,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
/**
|
||||
* Updates the schedule for metering contracts.
|
||||
*
|
||||
* The schedule must have a greater version than the stored schedule.
|
||||
* The schedule's version cannot be less than the version of the stored schedule.
|
||||
* If a schedule does not change the instruction weights the version does not
|
||||
* need to be increased. Therefore we allow storing a schedule that has the same
|
||||
* version as the stored one.
|
||||
**/
|
||||
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Schedule]>;
|
||||
};
|
||||
@@ -1187,6 +1331,54 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
vote: AugmentedSubmittable<(votes: Vec<AccountId> | (AccountId | string | Uint8Array)[], value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId>, Compact<BalanceOf>]>;
|
||||
};
|
||||
gilt: {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
/**
|
||||
* Place a bid for a gilt to be issued.
|
||||
*
|
||||
* Origin must be Signed, and account must have at least `amount` in free balance.
|
||||
*
|
||||
* - `amount`: The amount of the bid; these funds will be reserved. If the bid is
|
||||
* successfully elevated into an issued gilt, then these funds will continue to be
|
||||
* reserved until the gilt expires. Must be at least `MinFreeze`.
|
||||
* - `duration`: The number of periods for which the funds will be locked if the gilt is
|
||||
* issued. It will expire only after this period has elapsed after the point of issuance.
|
||||
* Must be greater than 1 and no more than `QueueCount`.
|
||||
*
|
||||
* Complexities:
|
||||
* - `Queues[duration].len()` (just take max).
|
||||
**/
|
||||
placeBid: AugmentedSubmittable<(amount: Compact<BalanceOf> | AnyNumber | Uint8Array, duration: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, u32]>;
|
||||
/**
|
||||
* Retract a previously placed bid.
|
||||
*
|
||||
* Origin must be Signed, and the account should have previously issued a still-active bid
|
||||
* of `amount` for `duration`.
|
||||
*
|
||||
* - `amount`: The amount of the previous bid.
|
||||
* - `duration`: The duration of the previous bid.
|
||||
**/
|
||||
retractBid: AugmentedSubmittable<(amount: Compact<BalanceOf> | AnyNumber | Uint8Array, duration: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, u32]>;
|
||||
/**
|
||||
* Set target proportion of gilt-funds.
|
||||
*
|
||||
* Origin must be `AdminOrigin`.
|
||||
*
|
||||
* - `target`: The target proportion of effective issued funds that should be under gilts
|
||||
* at any one time.
|
||||
**/
|
||||
setTarget: AugmentedSubmittable<(target: Compact<Perquintill> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<Perquintill>]>;
|
||||
/**
|
||||
* Remove an active but expired gilt. Reserved funds under gilt are freed and balance is
|
||||
* adjusted to ensure that the funds grow or shrink to maintain the equivalent proportion
|
||||
* of effective total issued funds.
|
||||
*
|
||||
* Origin must be Signed and the account must be the owner of the gilt of the given index.
|
||||
*
|
||||
* - `index`: The index of the gilt to be thawed.
|
||||
**/
|
||||
thaw: AugmentedSubmittable<(index: Compact<ActiveIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<ActiveIndex>]>;
|
||||
};
|
||||
grandpa: {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
/**
|
||||
@@ -1905,7 +2097,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option<ProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, Option<ProxyType>, Call]>;
|
||||
/**
|
||||
* Dispatch the given `call` from an account that the sender is authorised for through
|
||||
* Dispatch the given `call` from an account that the sender is authorized for through
|
||||
* `add_proxy`.
|
||||
*
|
||||
* Removes any corresponding announcement(s).
|
||||
@@ -2962,70 +3154,6 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # </weight>
|
||||
**/
|
||||
setValidatorCount: AugmentedSubmittable<(updated: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
/**
|
||||
* Submit an election result to the chain. If the solution:
|
||||
*
|
||||
* 1. is valid.
|
||||
* 2. has a better score than a potentially existing solution on chain.
|
||||
*
|
||||
* then, it will be _put_ on chain.
|
||||
*
|
||||
* A solution consists of two pieces of data:
|
||||
*
|
||||
* 1. `winners`: a flat vector of all the winners of the round.
|
||||
* 2. `assignments`: the compact version of an assignment vector that encodes the edge
|
||||
* weights.
|
||||
*
|
||||
* Both of which may be computed using _phragmen_, or any other algorithm.
|
||||
*
|
||||
* Additionally, the submitter must provide:
|
||||
*
|
||||
* - The `score` that they claim their solution has.
|
||||
*
|
||||
* Both validators and nominators will be represented by indices in the solution. The
|
||||
* indices should respect the corresponding types ([`ValidatorIndex`] and
|
||||
* [`NominatorIndex`]). Moreover, they should be valid when used to index into
|
||||
* [`SnapshotValidators`] and [`SnapshotNominators`]. Any invalid index will cause the
|
||||
* solution to be rejected. These two storage items are set during the election window and
|
||||
* may be used to determine the indices.
|
||||
*
|
||||
* A solution is valid if:
|
||||
*
|
||||
* 0. It is submitted when [`EraElectionStatus`] is `Open`.
|
||||
* 1. Its claimed score is equal to the score computed on-chain.
|
||||
* 2. Presents the correct number of winners.
|
||||
* 3. All indexes must be value according to the snapshot vectors. All edge values must
|
||||
* also be correct and should not overflow the granularity of the ratio type (i.e. 256
|
||||
* or billion).
|
||||
* 4. For each edge, all targets are actually nominated by the voter.
|
||||
* 5. Has correct self-votes.
|
||||
*
|
||||
* A solutions score is consisted of 3 parameters:
|
||||
*
|
||||
* 1. `min { support.total }` for each support of a winner. This value should be maximized.
|
||||
* 2. `sum { support.total }` for each support of a winner. This value should be minimized.
|
||||
* 3. `sum { support.total^2 }` for each support of a winner. This value should be
|
||||
* minimized (to ensure less variance)
|
||||
*
|
||||
* # <weight>
|
||||
* The transaction is assumed to be the longest path, a better solution.
|
||||
* - Initial solution is almost the same.
|
||||
* - Worse solution is retraced in pre-dispatch-checks which sets its own weight.
|
||||
* # </weight>
|
||||
**/
|
||||
submitElectionSolution: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ValidatorIndex>, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>;
|
||||
/**
|
||||
* Unsigned version of `submit_election_solution`.
|
||||
*
|
||||
* Note that this must pass the [`ValidateUnsigned`] check which only allows transactions
|
||||
* from the local node to be included. In other words, only the block author can include a
|
||||
* transaction in the block.
|
||||
*
|
||||
* # <weight>
|
||||
* See [`submit_election_solution`].
|
||||
* # </weight>
|
||||
**/
|
||||
submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ValidatorIndex>, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>;
|
||||
/**
|
||||
* Schedule a portion of the stash to be unlocked ready for transfer out after the bond
|
||||
* period ends. If this leaves an amount actively bonded less than
|
||||
@@ -3080,7 +3208,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Write: Nominators, Validators
|
||||
* # </weight>
|
||||
**/
|
||||
validate: AugmentedSubmittable<(prefs: ValidatorPrefs | { commission?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ValidatorPrefs]>;
|
||||
validate: AugmentedSubmittable<(prefs: ValidatorPrefs | { commission?: any; blocked?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [ValidatorPrefs]>;
|
||||
/**
|
||||
* Remove any unlocked chunks from the `unlocking` queue from our management.
|
||||
*
|
||||
@@ -3207,11 +3335,18 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)`
|
||||
* - Base Weight: 0.665 µs, independent of remark length.
|
||||
* - No DB operations.
|
||||
* # </weight>
|
||||
**/
|
||||
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Make some on-chain remark and emit event.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(b)` where b is the length of the remark.
|
||||
* - 1 event.
|
||||
* # </weight>
|
||||
**/
|
||||
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Set the new changes trie configuration.
|
||||
*
|
||||
@@ -3739,7 +3874,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Unlock any vested funds of the sender account.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and the sender must have funds still
|
||||
* locked under this module.
|
||||
* locked under this pallet.
|
||||
*
|
||||
* Emits either `VestingCompleted` or `VestingUpdated`.
|
||||
*
|
||||
@@ -3757,7 +3892,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
*
|
||||
* - `target`: The account whose vested funds should be unlocked. Must have funds still
|
||||
* locked under this module.
|
||||
* locked under this pallet.
|
||||
*
|
||||
* Emits either `VestingCompleted` or `VestingUpdated`.
|
||||
*
|
||||
|
||||
@@ -79,7 +79,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
protected _rpc?: DecoratedRpc<ApiType, RpcInterface>;
|
||||
|
||||
protected _rpcCore: RpcCore;
|
||||
protected _rpcCore: RpcCore & RpcInterface;
|
||||
|
||||
protected _runtimeChain?: Text;
|
||||
|
||||
@@ -136,6 +136,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
this.#instanceId = `${++instanceCounter}`;
|
||||
this.#registry = options.source?.registry || options.registry || new TypeRegistry();
|
||||
this._rx.registry = this.#registry;
|
||||
|
||||
const thisProvider = options.source
|
||||
? options.source._rpcCore.provider.clone()
|
||||
@@ -144,10 +145,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
this._decorateMethod = decorateMethod;
|
||||
this._options = options;
|
||||
this._type = type;
|
||||
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc);
|
||||
|
||||
// The RPC interface decorates the known interfaces on init
|
||||
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc) as (RpcCore & RpcInterface);
|
||||
this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected);
|
||||
this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
|
||||
this._rx.registry = this.#registry;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,7 +283,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
});
|
||||
}
|
||||
|
||||
protected _decorateRpc<ApiType extends ApiTypes> (rpc: RpcCore, decorateMethod: DecorateMethod<ApiType>, input: Partial<DecoratedRpc<ApiType, RpcInterface>> = {}): DecoratedRpc<ApiType, RpcInterface> {
|
||||
protected _decorateRpc<ApiType extends ApiTypes> (rpc: RpcCore & RpcInterface, decorateMethod: DecorateMethod<ApiType>, input: Partial<DecoratedRpc<ApiType, RpcInterface>> = {}): DecoratedRpc<ApiType, RpcInterface> {
|
||||
return rpc.sections.reduce((out, _sectionName): DecoratedRpc<ApiType, RpcInterface> => {
|
||||
const sectionName = _sectionName as keyof DecoratedRpc<ApiType, RpcInterface>;
|
||||
|
||||
@@ -492,9 +494,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
)
|
||||
),
|
||||
tap((keys): void => {
|
||||
keys.length === PAGE_SIZE
|
||||
? startSubject.next(keys[PAGE_SIZE - 1].toHex())
|
||||
: startSubject.complete();
|
||||
setTimeout((): void => {
|
||||
keys.length === PAGE_SIZE
|
||||
? startSubject.next(keys[PAGE_SIZE - 1].toHex())
|
||||
: startSubject.complete();
|
||||
}, 0);
|
||||
}),
|
||||
toArray(), // toArray since we want to startSubject to be completed
|
||||
map((keysArr: StorageKey[][]) => arrayFlatten(keysArr))
|
||||
|
||||
@@ -18,10 +18,10 @@ import { cryptoWaitReady } from '@polkadot/util-crypto';
|
||||
import { of } from '@polkadot/x-rxjs';
|
||||
import { map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { detectedCapabilities } from './capabilities';
|
||||
import { Decorate } from './Decorate';
|
||||
import { detectedCapabilities } from './util';
|
||||
|
||||
const KEEPALIVE_INTERVAL = 15000;
|
||||
const KEEPALIVE_INTERVAL = 10000;
|
||||
const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO };
|
||||
|
||||
const l = logger('api/init');
|
||||
@@ -139,7 +139,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
// nothing has been found, construct new
|
||||
const metadata = await this._rpcCore.state.getMetadata(header.parentHash).toPromise();
|
||||
const registry = this._initRegistry(new TypeRegistry(), this._runtimeChain as Text, version, metadata);
|
||||
const registry = this._initRegistry(new TypeRegistry(blockHash), this._runtimeChain as Text, version, metadata);
|
||||
|
||||
// For now, since this is new we ignore the capability lookups (this could be useful once proven)
|
||||
// this._detectCapabilities(registry, blockHash);
|
||||
@@ -321,7 +321,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
}
|
||||
|
||||
this.#healthTimer = setInterval((): void => {
|
||||
this._rpcCore.system.health().toPromise().catch(() => null);
|
||||
this._rpcCore.system.health().toPromise().catch((error) => l.warn(`Health keepalive check failed: ${(error as Error).message}`));
|
||||
}, KEEPALIVE_INTERVAL);
|
||||
} catch (_error) {
|
||||
const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`);
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { bool, Raw, u32 } from '@polkadot/types';
|
||||
import type { Releases } from '@polkadot/types/interfaces';
|
||||
import type { InterfaceTypes } from '@polkadot/types/types';
|
||||
|
||||
import { assert, compactFromU8a } from '@polkadot/util';
|
||||
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
|
||||
import { map, take } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
// the order and types needs to map with the all array setup below
|
||||
type ExtractedQ = [bool | null, bool | null, bool | null, Releases | null];
|
||||
|
||||
type ExtractedR = [Raw | null];
|
||||
|
||||
type ExtractedC = [u32 | null, u32 | null];
|
||||
|
||||
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
|
||||
|
||||
type DetectedValues = keyof InterfaceTypes;
|
||||
|
||||
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
|
||||
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithDualRefCount' | 'AccountInfoWithTripleRefCount',
|
||||
Keys: 'SessionKeys1' | 'SessionKeys2' | 'SessionKeys3' | 'SessionKeys4' | 'SessionKeys5' | 'SessionKeys6' | 'SessionKeys7' | 'SessionKeys8' | 'SessionKeys9' | 'SessionKeys10';
|
||||
RefCount: 'u8' | 'u32',
|
||||
SlotRange: Record<string, unknown>;
|
||||
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
|
||||
WinningData: string;
|
||||
}
|
||||
|
||||
interface AvailableMap<T> {
|
||||
filtered: T[];
|
||||
included: boolean[];
|
||||
original: T[];
|
||||
}
|
||||
|
||||
interface Constants {
|
||||
accountIdLength: number;
|
||||
}
|
||||
|
||||
const NumberMap = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
|
||||
|
||||
function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot, slotRangeCount]: ExtractedC, [systemRefcount32, systemRefcountDual, systemRefcountTriple, stakingVersion]: ExtractedQ, [keys]: ExtractedR): Partial<DetectedTypes> {
|
||||
const types: Partial<DetectedTypes> = {};
|
||||
|
||||
// AccountInfo
|
||||
if (systemRefcountTriple && systemRefcountTriple.isTrue) {
|
||||
types.AccountInfo = 'AccountInfoWithTripleRefCount';
|
||||
} else if (systemRefcountDual && systemRefcountDual.isTrue) {
|
||||
types.AccountInfo = 'AccountInfoWithDualRefCount';
|
||||
} else {
|
||||
types.AccountInfo = 'AccountInfoWithRefCount';
|
||||
|
||||
if (!systemRefcount32 || systemRefcount32.isFalse) {
|
||||
types.RefCount = 'u8';
|
||||
}
|
||||
}
|
||||
|
||||
// ValidatorPrefs
|
||||
if (stakingVersion) {
|
||||
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
|
||||
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
|
||||
} else {
|
||||
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
|
||||
}
|
||||
}
|
||||
|
||||
// Keys
|
||||
if (keys) {
|
||||
try {
|
||||
const [offset, numItems] = compactFromU8a(keys);
|
||||
const tupleLength = (keys.length - offset) / numItems.toNumber();
|
||||
const numIds = tupleLength / accountIdLength;
|
||||
const numIdsRound = Math.floor(numIds);
|
||||
|
||||
assert(numIds >= 2 && numIds <= 11, `Detected ${numIds} in Keys, should be >= 2 and <= 11`);
|
||||
|
||||
if (numIdsRound !== numIds) {
|
||||
// Beefy?
|
||||
if ((((numIdsRound - 1) * accountIdLength) + 33) === tupleLength) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
types.Keys = `SessionKeys${numIdsRound - 1}B`;
|
||||
} else {
|
||||
assert(false, `Expected integer number of keys, found ${numIds.toFixed(2)}`);
|
||||
}
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
types.Keys = `SessionKeys${numIds - 1}`;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// auctions
|
||||
if (leasePeriodsPerSlot && slotRangeCount) {
|
||||
const _enum: string[] = [];
|
||||
|
||||
for (let i = 0; leasePeriodsPerSlot.gtn(i); i++) {
|
||||
for (let j = i; leasePeriodsPerSlot.gtn(j); j++) {
|
||||
_enum.push(`${NumberMap[i]}${NumberMap[j]}`);
|
||||
}
|
||||
}
|
||||
|
||||
types.SlotRange = { _enum };
|
||||
types.WinningData = `[WinningDataEntry; ${slotRangeCount.toNumber()}]`;
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
function filterEntries <T> (original: T[]): AvailableMap<T> {
|
||||
const included = original.map((c) => !!c);
|
||||
const filtered = original.filter((_, index) => included[index]);
|
||||
|
||||
return { filtered, included, original };
|
||||
}
|
||||
|
||||
function extractResults <R, T = unknown> (results: unknown[], map: AvailableMap<T>): R {
|
||||
let offset = -1;
|
||||
|
||||
return map.included.map((isIncluded) =>
|
||||
isIncluded
|
||||
? results[++offset]
|
||||
: null
|
||||
) as unknown as R;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Query the chain for the specific capabilities
|
||||
*/
|
||||
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
|
||||
const consts = filterEntries([
|
||||
api.consts.auctions?.leasePeriodsPerSlot,
|
||||
api.consts.auctions?.slotRangeCount
|
||||
]);
|
||||
const queries = filterEntries([
|
||||
api.query.system?.upgradedToU32RefCount,
|
||||
api.query.system?.upgradedToDualRefCount,
|
||||
api.query.system?.upgradedToTripleRefCount,
|
||||
api.query.staking?.storageVersion
|
||||
]);
|
||||
const raws = filterEntries([
|
||||
api.query.session?.queuedKeys
|
||||
]);
|
||||
|
||||
return combineLatest([
|
||||
consts.filtered.length
|
||||
? blockHash
|
||||
// FIXME consts don't have .at as of yet...
|
||||
? of([])
|
||||
: of(consts.filtered)
|
||||
: of([]),
|
||||
queries.filtered.length
|
||||
? blockHash
|
||||
? combineLatest(queries.filtered.map((c) => c.at(blockHash)))
|
||||
: api.queryMulti(queries.filtered)
|
||||
: of([]),
|
||||
raws.filtered.length
|
||||
? blockHash
|
||||
? combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key(), blockHash)))
|
||||
: combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key())))
|
||||
: of([])
|
||||
]).pipe(
|
||||
map(([cResults, qResults, rResults]): Partial<DetectedTypes> =>
|
||||
mapCapabilities(
|
||||
{
|
||||
accountIdLength: api.registry.createType('AccountId').encodedLength
|
||||
},
|
||||
extractResults<ExtractedC>(cResults, consts),
|
||||
extractResults<ExtractedQ>(qResults, queries),
|
||||
extractResults<ExtractedR>(rResults, raws)
|
||||
)
|
||||
),
|
||||
take(1)
|
||||
);
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { bool } from '@polkadot/types';
|
||||
import type { Releases } from '@polkadot/types/interfaces';
|
||||
import type { InterfaceTypes } from '@polkadot/types/types';
|
||||
|
||||
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
|
||||
import { map, take } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
// the order and types needs to map with the all array setup below
|
||||
type Extracted = [bool | null, bool | null, Releases | null];
|
||||
|
||||
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
|
||||
|
||||
type DetectedValues = keyof InterfaceTypes;
|
||||
|
||||
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
|
||||
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithProviders',
|
||||
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
|
||||
}
|
||||
|
||||
function mapCapabilities ([systemRefcount32, systemRefcountDual, stakingVersion]: Extracted): Partial<DetectedTypes> {
|
||||
const types: Partial<DetectedTypes> = {};
|
||||
|
||||
// AccountInfo
|
||||
if (systemRefcountDual && systemRefcountDual.isTrue) {
|
||||
types.AccountInfo = 'AccountInfoWithProviders';
|
||||
} else if (systemRefcount32 && systemRefcount32.isTrue) {
|
||||
types.AccountInfo = 'AccountInfoWithRefCount';
|
||||
}
|
||||
|
||||
// ValidatorPrefs
|
||||
if (stakingVersion) {
|
||||
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
|
||||
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
|
||||
} else {
|
||||
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
|
||||
}
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Query the chain for the specific capabilities
|
||||
*/
|
||||
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
|
||||
const all = [
|
||||
api.query.system?.upgradedToU32RefCount,
|
||||
api.query.system?.upgradedToDualRefCount,
|
||||
api.query.staking?.storageVersion
|
||||
];
|
||||
const included = all.map((c) => !!c);
|
||||
const filtered = all.filter((_, index) => included[index]);
|
||||
|
||||
return (
|
||||
filtered.length
|
||||
? blockHash
|
||||
? combineLatest(filtered.map((c) => c.at(blockHash)))
|
||||
: api.queryMulti(filtered)
|
||||
: of([])
|
||||
).pipe(
|
||||
map((results): Partial<DetectedTypes> => {
|
||||
let offset = -1;
|
||||
|
||||
return mapCapabilities(
|
||||
included.map((isIncluded) => isIncluded ? results[++offset] : null) as Extracted
|
||||
);
|
||||
}),
|
||||
take(1)
|
||||
);
|
||||
}
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
// Simple non-runnable checks to test type definitions in the editor itself
|
||||
|
||||
import type { HeaderExtended } from '@polkadot/api-derive/types';
|
||||
import type { StorageKey } from '@polkadot/types';
|
||||
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
|
||||
import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types';
|
||||
|
||||
import { ApiPromise } from '@polkadot/api';
|
||||
import { HeaderExtended } from '@polkadot/api-derive';
|
||||
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', version: '4.5.1' };
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/metadata",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Helpers to extract information from runtime metadata",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"repository": "github:polkadot-js/api",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -15,14 +16,14 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/types-known": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/util-crypto": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/types-known": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/util-crypto": "^6.1.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.9.2"
|
||||
"@polkadot/keyring": "^6.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,18 +33,18 @@ export class MetadataVersioned extends Struct {
|
||||
}, value as Map<unknown, unknown>);
|
||||
}
|
||||
|
||||
private _assertVersion (version: number): boolean {
|
||||
#assertVersion = (version: number): boolean => {
|
||||
assert(this.version <= version, `Cannot convert metadata from v${this.version} to v${version}`);
|
||||
|
||||
return this.version === version;
|
||||
}
|
||||
};
|
||||
|
||||
private _getVersion<T extends MetaMapped, F extends MetaMapped> (version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T {
|
||||
#getVersion = <T extends MetaMapped, F extends MetaMapped>(version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T => {
|
||||
const asCurr = `asV${version}` as MetaAsX;
|
||||
const asPrev = `asV${version - 1}` as MetaAsX;
|
||||
|
||||
if (this._assertVersion(version)) {
|
||||
return this._metadata[asCurr] as T;
|
||||
if (this.#assertVersion(version)) {
|
||||
return this.#metadata()[asCurr] as T;
|
||||
}
|
||||
|
||||
if (!this.#converted.has(version)) {
|
||||
@@ -52,6 +52,13 @@ export class MetadataVersioned extends Struct {
|
||||
}
|
||||
|
||||
return this.#converted.get(version) as T;
|
||||
};
|
||||
|
||||
/**
|
||||
* @description the metadata wrapped
|
||||
*/
|
||||
#metadata = (): MetadataAll => {
|
||||
return this.get('metadata') as MetadataAll;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,30 +75,30 @@ export class MetadataVersioned extends Struct {
|
||||
* @description Returns the wrapped metadata as a V9 object
|
||||
*/
|
||||
public get asV9 (): MetadataV9 {
|
||||
this._assertVersion(9);
|
||||
this.#assertVersion(9);
|
||||
|
||||
return this._metadata.asV9;
|
||||
return this.#metadata().asV9;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the wrapped values as a V10 object
|
||||
*/
|
||||
public get asV10 (): MetadataV10 {
|
||||
return this._getVersion(10, toV10);
|
||||
return this.#getVersion(10, toV10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the wrapped values as a V11 object
|
||||
*/
|
||||
public get asV11 (): MetadataV11 {
|
||||
return this._getVersion(11, toV11);
|
||||
return this.#getVersion(11, toV11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the wrapped values as a V12 object
|
||||
*/
|
||||
public get asV12 (): MetadataV12 {
|
||||
return this._getVersion(12, toV12);
|
||||
return this.#getVersion(12, toV12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +106,7 @@ export class MetadataVersioned extends Struct {
|
||||
*/
|
||||
public get asLatest (): MetadataLatest {
|
||||
// This is non-existent & latest - applied here to do the module-specific type conversions
|
||||
return this._getVersion(13, toLatest);
|
||||
return this.#getVersion(13, toLatest);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,18 +116,11 @@ export class MetadataVersioned extends Struct {
|
||||
return this.get('magicNumber') as MagicNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description the metadata wrapped
|
||||
*/
|
||||
private get _metadata (): MetadataAll {
|
||||
return this.get('metadata') as MetadataAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description the metadata version this structure represents
|
||||
*/
|
||||
public get version (): number {
|
||||
return this._metadata.index;
|
||||
return this.#metadata().index;
|
||||
}
|
||||
|
||||
public getUniqTypes (throwError: boolean): string[] {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/metadata authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '4.5.1' };
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { Codec, Registry } from '@polkadot/types/types';
|
||||
import type { MetadataInterface } from '../types';
|
||||
|
||||
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
|
||||
import { assert, hexToU8a, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { Metadata } from '../Metadata';
|
||||
import { getUniqTypes } from './getUniqTypes';
|
||||
@@ -47,19 +48,25 @@ export function toLatest<Modules extends Codec> (registry: Registry, version: nu
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function defaultValues (registry: Registry, rpcData: string, withThrow = true): void {
|
||||
export function defaultValues (registry: Registry, rpcData: string, withThrow = true, withFallbackCheck = false): void {
|
||||
describe('storage with default values', (): void => {
|
||||
const metadata = new Metadata(registry, rpcData);
|
||||
|
||||
metadata.asLatest.modules.filter(({ storage }): boolean => storage.isSome).forEach((mod): void => {
|
||||
mod.storage.unwrap().items.forEach(({ fallback, name, type }): void => {
|
||||
const inner = unwrapStorageType(type);
|
||||
mod.storage.unwrap().items.forEach(({ fallback, modifier, name, type }): void => {
|
||||
const inner = unwrapStorageType(type, modifier.isOptional);
|
||||
const location = `${mod.name.toString()}.${name.toString()}: ${inner}`;
|
||||
|
||||
it(`creates default types for ${location}`, (): void => {
|
||||
expect((): void => {
|
||||
try {
|
||||
registry.createType(inner, fallback);
|
||||
const type = registry.createType(inner, hexToU8a(fallback.toHex()));
|
||||
|
||||
if (withFallbackCheck) {
|
||||
const [hexType, hexOrig] = [u8aToHex(type.toU8a()), u8aToHex(fallback.toU8a(true))];
|
||||
|
||||
assert(hexType === hexOrig, `Fallback does not match (${((hexOrig.length - 2) / 2) - ((hexType.length - 2) / 2)} bytes missing): ${hexType} !== ${hexOrig}`);
|
||||
}
|
||||
} catch (error) {
|
||||
const message = `${location}:: ${(error as Error).message}`;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -14,5 +14,5 @@ describe('MetadataV12 (substrate)', (): void => {
|
||||
|
||||
toLatest(registry, 12, substrateData);
|
||||
|
||||
defaultValues(registry, substrateData);
|
||||
defaultValues(registry, substrateData, true, true);
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -20,22 +20,24 @@ const KNOWN_ORIGINS: Record<string, string> = {
|
||||
* Find and apply the correct type override
|
||||
* @internal
|
||||
**/
|
||||
function setTypeOverride (sectionTypes: OverrideModuleType, type: Type): void {
|
||||
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased));
|
||||
function setTypeOverride (sectionTypes: OverrideModuleType, ...types: Type[]): void {
|
||||
types.forEach((type): void => {
|
||||
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased));
|
||||
|
||||
if (override) {
|
||||
type.setOverride(sectionTypes[override]);
|
||||
} else {
|
||||
// FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)
|
||||
const orig = type.toString();
|
||||
const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string =>
|
||||
[['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string =>
|
||||
result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);
|
||||
if (override) {
|
||||
type.setOverride(sectionTypes[override]);
|
||||
} else {
|
||||
// FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)
|
||||
const orig = type.toString();
|
||||
const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string =>
|
||||
[['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string =>
|
||||
result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);
|
||||
|
||||
if (orig !== alias) {
|
||||
type.setOverride(alias);
|
||||
if (orig !== alias) {
|
||||
type.setOverride(alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,18 +83,14 @@ function convertEvents (registry: Registry, events: EventMetadataV12[], sectionT
|
||||
function convertStorage (registry: Registry, { items, prefix }: StorageMetadataV12, sectionTypes: OverrideModuleType): StorageMetadataLatest {
|
||||
return registry.createType('StorageMetadataLatest', {
|
||||
items: items.map((s): StorageEntryMetadataLatest => {
|
||||
let resultType: Type;
|
||||
|
||||
if (s.type.isMap) {
|
||||
resultType = s.type.asMap.value;
|
||||
} else if (s.type.isDoubleMap) {
|
||||
resultType = s.type.asDoubleMap.value;
|
||||
if (s.type.isDoubleMap) {
|
||||
setTypeOverride(sectionTypes, s.type.asDoubleMap.value, s.type.asDoubleMap.key1, s.type.asDoubleMap.key2);
|
||||
} else if (s.type.isMap) {
|
||||
setTypeOverride(sectionTypes, s.type.asMap.value, s.type.asMap.key);
|
||||
} else {
|
||||
resultType = s.type.asPlain;
|
||||
setTypeOverride(sectionTypes, s.type.asPlain);
|
||||
}
|
||||
|
||||
setTypeOverride(sectionTypes, resultType);
|
||||
|
||||
return registry.createType('StorageEntryMetadataLatest', s);
|
||||
}),
|
||||
prefix
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-core",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,14 +16,14 @@
|
||||
"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.13.8",
|
||||
"@polkadot/metadata": "3.11.1",
|
||||
"@polkadot/rpc-provider": "3.11.1",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/x-rxjs": "^5.9.2"
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/metadata": "4.5.1",
|
||||
"@polkadot/rpc-provider": "4.5.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/x-rxjs": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.9.2"
|
||||
"@polkadot/keyring": "^6.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
|
||||
|
||||
import { createTestPairs } from '@polkadot/keyring/testingPairs';
|
||||
import { MockProvider } from '@polkadot/rpc-provider/mock';
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
@@ -9,11 +11,11 @@ import { RpcCore } from '.';
|
||||
|
||||
describe('Cached Observables', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
let rpc: RpcCore;
|
||||
let rpc: RpcCore & RpcInterface;
|
||||
const keyring = createTestPairs();
|
||||
|
||||
beforeEach((): void => {
|
||||
rpc = new RpcCore('123', registry, new MockProvider(registry));
|
||||
rpc = new RpcCore('123', registry, new MockProvider(registry)) as (RpcCore & RpcInterface);
|
||||
});
|
||||
|
||||
it('creates a single observable for subscriptions (multiple calls)', (): void => {
|
||||
|
||||
@@ -79,7 +79,7 @@ function isTreatAsHex (key: StorageKey): boolean {
|
||||
* const rpc = new Rpc(provider);
|
||||
* ```
|
||||
*/
|
||||
export class RpcCore implements RpcInterface {
|
||||
export class RpcCore {
|
||||
#instanceId: string;
|
||||
|
||||
#registryDefault: Registry;
|
||||
@@ -94,42 +94,6 @@ export class RpcCore implements RpcInterface {
|
||||
|
||||
public readonly sections: string[] = [];
|
||||
|
||||
// Ok, this is quite horrible - we really should not be using the ! here, but we are actually assigning
|
||||
// these via the createInterfaces inside the constructor. However... this is not quite visible. The reason
|
||||
// why we don't do for individual assignments is to allow user-defined RPCs to also be defined
|
||||
|
||||
public readonly author!: RpcInterface['author'];
|
||||
|
||||
public readonly babe!: RpcInterface['babe'];
|
||||
|
||||
public readonly chain!: RpcInterface['chain'];
|
||||
|
||||
public readonly childstate!: RpcInterface['childstate'];
|
||||
|
||||
public readonly contracts!: RpcInterface['contracts'];
|
||||
|
||||
public readonly engine!: RpcInterface['engine'];
|
||||
|
||||
public readonly eth!: RpcInterface['eth'];
|
||||
|
||||
public readonly grandpa!: RpcInterface['grandpa'];
|
||||
|
||||
public readonly net!: RpcInterface['net'];
|
||||
|
||||
public readonly offchain!: RpcInterface['offchain'];
|
||||
|
||||
public readonly payment!: RpcInterface['payment'];
|
||||
|
||||
public readonly rpc!: RpcInterface['rpc'];
|
||||
|
||||
public readonly state!: RpcInterface['state'];
|
||||
|
||||
public readonly syncstate!: RpcInterface['syncstate'];
|
||||
|
||||
public readonly system!: RpcInterface['system'];
|
||||
|
||||
public readonly web3!: RpcInterface['web3'];
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Default constructor for the Api Object
|
||||
@@ -148,6 +112,7 @@ export class RpcCore implements RpcInterface {
|
||||
// these are the base keys (i.e. part of jsonrpc)
|
||||
this.sections.push(...sectionNames);
|
||||
|
||||
// decorate all interfaces, defined and user on this instance
|
||||
this.addUserInterfaces(userRpc);
|
||||
}
|
||||
|
||||
@@ -187,7 +152,7 @@ export class RpcCore implements RpcInterface {
|
||||
this.sections.forEach((sectionName): void => {
|
||||
(this as Record<string, unknown>)[sectionName as Section] ||= {};
|
||||
|
||||
const section = this[sectionName as Section] as Record<string, unknown>;
|
||||
const section = (this as Record<string, unknown>)[sectionName as Section] as Record<string, unknown>;
|
||||
|
||||
Object
|
||||
.entries({
|
||||
@@ -244,17 +209,17 @@ export class RpcCore implements RpcInterface {
|
||||
|
||||
// execute the RPC call, doing a registry swap for historic as applicable
|
||||
const callWithRegistry = async (outputAs: OutputType, values: any[]): Promise<Codec | Codec[]> => {
|
||||
const hash = hashIndex === -1
|
||||
? undefined
|
||||
const blockHash = hashIndex === -1
|
||||
? null
|
||||
: values[hashIndex] as Uint8Array;
|
||||
const { registry } = hash && this.#getBlockRegistry
|
||||
? await this.#getBlockRegistry(hash)
|
||||
const { registry } = blockHash && this.#getBlockRegistry
|
||||
? await this.#getBlockRegistry(blockHash)
|
||||
: { registry: this.#registryDefault };
|
||||
const params = this._formatInputs(registry, def, values);
|
||||
const params = this._formatInputs(registry, null, def, values);
|
||||
const data = await this.provider.send(rpcName, params.map((param): AnyJson => param.toJSON())) as AnyJson;
|
||||
|
||||
return outputAs === 'scale'
|
||||
? this._formatOutput(registry, method, def, params, data)
|
||||
? this._formatOutput(registry, blockHash, method, def, params, data)
|
||||
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', data);
|
||||
};
|
||||
|
||||
@@ -324,7 +289,7 @@ export class RpcCore implements RpcInterface {
|
||||
};
|
||||
|
||||
try {
|
||||
const params = this._formatInputs(registry, def, values);
|
||||
const params = this._formatInputs(registry, null, def, values);
|
||||
const paramsJson = params.map((param): AnyJson => param.toJSON());
|
||||
|
||||
const update = (error?: Error | null, result?: any): void => {
|
||||
@@ -337,7 +302,7 @@ export class RpcCore implements RpcInterface {
|
||||
try {
|
||||
observer.next(
|
||||
outputAs === 'scale'
|
||||
? this._formatOutput(registry, method, def, params, result)
|
||||
? this._formatOutput(registry, null, method, def, params, result)
|
||||
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', result)
|
||||
);
|
||||
} catch (error) {
|
||||
@@ -372,8 +337,8 @@ export class RpcCore implements RpcInterface {
|
||||
return memoized;
|
||||
}
|
||||
|
||||
private _formatInputs (registry: Registry, def: DefinitionRpc, inputs: any[]): Codec[] {
|
||||
const reqArgCount = def.params.filter(({ isOptional }): boolean => !isOptional).length;
|
||||
private _formatInputs (registry: Registry, blockHash: Uint8Array | string | null | undefined, def: DefinitionRpc, inputs: any[]): Codec[] {
|
||||
const reqArgCount = def.params.filter(({ isOptional }) => !isOptional).length;
|
||||
const optText = reqArgCount === def.params.length
|
||||
? ''
|
||||
: ` (${def.params.length - reqArgCount} optional)`;
|
||||
@@ -381,25 +346,25 @@ export class RpcCore implements RpcInterface {
|
||||
assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
|
||||
|
||||
return inputs.map((input, index): Codec =>
|
||||
createTypeUnsafe(registry, def.params[index].type, [input])
|
||||
createTypeUnsafe(registry, def.params[index].type, [input], { blockHash })
|
||||
);
|
||||
}
|
||||
|
||||
private _formatOutput (registry: Registry, method: string, rpc: DefinitionRpc, params: Codec[], result?: any): Codec | Codec[] {
|
||||
private _formatOutput (registry: Registry, blockHash: Uint8Array | string | null | undefined, method: string, rpc: DefinitionRpc, params: Codec[], result?: any): Codec | Codec[] {
|
||||
if (rpc.type === 'StorageData') {
|
||||
const key = params[0] as StorageKey;
|
||||
|
||||
return this._formatStorageData(registry, key, result);
|
||||
return this._formatStorageData(registry, blockHash, key, result);
|
||||
} else if (rpc.type === 'StorageChangeSet') {
|
||||
const keys = params[0] as Vec<StorageKey>;
|
||||
|
||||
return keys
|
||||
? this._formatStorageSet(registry, keys, (result as StorageChangeSetJSON).changes)
|
||||
? this._formatStorageSet(registry, (result as StorageChangeSetJSON).block, keys, (result as StorageChangeSetJSON).changes)
|
||||
: registry.createType('StorageChangeSet', result);
|
||||
} else if (rpc.type === 'Vec<StorageChangeSet>') {
|
||||
const mapped = (result as StorageChangeSetJSON[]).map(({ block, changes }): [Hash, Codec[]] => [
|
||||
registry.createType('Hash', block),
|
||||
this._formatStorageSet(registry, params[0] as Vec<StorageKey>, changes)
|
||||
this._formatStorageSet(registry, block, params[0] as Vec<StorageKey>, changes)
|
||||
]);
|
||||
|
||||
// we only query at a specific block, not a range - flatten
|
||||
@@ -408,10 +373,10 @@ export class RpcCore implements RpcInterface {
|
||||
: mapped as unknown as Codec[];
|
||||
}
|
||||
|
||||
return createTypeUnsafe(registry, rpc.type, [result]);
|
||||
return createTypeUnsafe(registry, rpc.type, [result], { blockHash });
|
||||
}
|
||||
|
||||
private _formatStorageData (registry: Registry, key: StorageKey, value: string | null): Codec {
|
||||
private _formatStorageData (registry: Registry, blockHash: Uint8Array | string | null | undefined, key: StorageKey, value: string | null): Codec {
|
||||
const isEmpty = isNull(value);
|
||||
|
||||
// we convert to Uint8Array since it maps to the raw encoding, all
|
||||
@@ -422,10 +387,10 @@ export class RpcCore implements RpcInterface {
|
||||
? value
|
||||
: u8aToU8a(value);
|
||||
|
||||
return this._newType(registry, key, input, isEmpty);
|
||||
return this._newType(registry, blockHash, key, input, isEmpty);
|
||||
}
|
||||
|
||||
private _formatStorageSet (registry: Registry, keys: Vec<StorageKey>, changes: [string, string | null][]): Codec[] {
|
||||
private _formatStorageSet (registry: Registry, blockHash: string, keys: Vec<StorageKey>, changes: [string, string | null][]): Codec[] {
|
||||
// For StorageChangeSet, the changes has the [key, value] mappings
|
||||
const withCache = keys.length !== 1;
|
||||
|
||||
@@ -434,13 +399,13 @@ export class RpcCore implements RpcInterface {
|
||||
// - Codec - There is a valid value, non-empty
|
||||
// - null - The storage key is empty
|
||||
return keys.reduce((results: Codec[], key: StorageKey, index): Codec[] => {
|
||||
results.push(this._formatStorageSetEntry(registry, key, changes, withCache, index));
|
||||
results.push(this._formatStorageSetEntry(registry, blockHash, key, changes, withCache, index));
|
||||
|
||||
return results;
|
||||
}, []);
|
||||
}
|
||||
|
||||
private _formatStorageSetEntry (registry: Registry, key: StorageKey, changes: [string, string | null][], witCache: boolean, entryIndex: number): Codec {
|
||||
private _formatStorageSetEntry (registry: Registry, blockHash: string, key: StorageKey, changes: [string, string | null][], witCache: boolean, entryIndex: number): Codec {
|
||||
const hexKey = key.toHex();
|
||||
const found = changes.find(([key]) => key === hexKey);
|
||||
|
||||
@@ -461,10 +426,10 @@ export class RpcCore implements RpcInterface {
|
||||
// will increase memory beyond what is allowed.
|
||||
this.#storageCache.set(hexKey, value);
|
||||
|
||||
return this._newType(registry, key, input, isEmpty, entryIndex);
|
||||
return this._newType(registry, blockHash, key, input, isEmpty, entryIndex);
|
||||
}
|
||||
|
||||
private _newType (registry: Registry, key: StorageKey, input: string | Uint8Array | null, isEmpty: boolean, entryIndex = -1): Codec {
|
||||
private _newType (registry: Registry, blockHash: Uint8Array | string | null | undefined, key: StorageKey, input: string | Uint8Array | null, isEmpty: boolean, entryIndex = -1): Codec {
|
||||
// single return value (via state.getStorage), decode the value based on the
|
||||
// outputType that we have specified. Fallback to Raw on nothing
|
||||
const type = key.outputType || 'Raw';
|
||||
@@ -478,13 +443,19 @@ export class RpcCore implements RpcInterface {
|
||||
|
||||
if (!isEmpty) {
|
||||
try {
|
||||
inner = createTypeUnsafe(registry, type, [input], { isPedantic: true });
|
||||
inner = createTypeUnsafe(registry, type, [input], { blockHash, isPedantic: true });
|
||||
} catch (error) {
|
||||
l.error(`Unable to decode storage ${key.section || 'unknown'}.${key.method || 'unknown'}:${entryNum}`, (error as Error).message);
|
||||
}
|
||||
}
|
||||
|
||||
return new Option(registry, createClass(registry, type), inner);
|
||||
const option = new Option(registry, createClass(registry, type), inner);
|
||||
|
||||
if (blockHash) {
|
||||
option.createdAtHash = registry.createType('Hash', blockHash);
|
||||
}
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -494,11 +465,11 @@ export class RpcCore implements RpcInterface {
|
||||
? hexToU8a(meta.fallback.toHex())
|
||||
: undefined
|
||||
: input
|
||||
], { isPedantic: true });
|
||||
], { blockHash, isPedantic: true });
|
||||
} catch (error) {
|
||||
l.error(`Unable to decode storage ${key.section || 'unknown'}.${key.method || 'unknown'}:${entryNum}`, (error as Error).message);
|
||||
|
||||
return registry.createType('Raw', input);
|
||||
return createTypeUnsafe(registry, 'Raw', [input], { blockHash });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.5.1' };
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
|
||||
import { MockProvider } from '@polkadot/rpc-provider/mock';
|
||||
@@ -11,10 +12,10 @@ import { RpcCore } from '.';
|
||||
|
||||
describe('replay', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
let rpc: RpcCore;
|
||||
let rpc: RpcCore & RpcInterface;
|
||||
|
||||
beforeEach((): void => {
|
||||
rpc = new RpcCore('653', registry, new MockProvider(registry));
|
||||
rpc = new RpcCore('653', registry, new MockProvider(registry)) as (RpcCore & RpcInterface);
|
||||
});
|
||||
|
||||
it('subscribes via the rpc section', (done): void => {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-provider",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,20 +16,20 @@
|
||||
"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.13.8",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/util-crypto": "^5.9.2",
|
||||
"@polkadot/x-fetch": "^5.9.2",
|
||||
"@polkadot/x-global": "^5.9.2",
|
||||
"@polkadot/x-ws": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/util-crypto": "^6.1.1",
|
||||
"@polkadot/x-fetch": "^6.1.1",
|
||||
"@polkadot/x-global": "^6.1.1",
|
||||
"@polkadot/x-ws": "^6.1.1",
|
||||
"bn.js": "^4.11.9",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.9.2",
|
||||
"@polkadot/metadata": "3.11.1",
|
||||
"@polkadot/keyring": "^6.1.1",
|
||||
"@polkadot/metadata": "4.5.1",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.9"
|
||||
"nock": "^13.0.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.5.1' };
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
{
|
||||
"name": "@polkadot/typegen",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.js",
|
||||
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.js",
|
||||
"polkadot-types-from-defs": "./scripts/polkadot-types-from-defs.js",
|
||||
"polkadot-types-internal-interfaces": "./scripts/polkadot-types-internal-interfaces.js",
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.js"
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.cjs",
|
||||
"polkadot-types-from-defs": "./scripts/polkadot-types-from-defs.cjs",
|
||||
"polkadot-types-internal-interfaces": "./scripts/polkadot-types-internal-interfaces.cjs",
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"repository": "github:polkadot-js/api",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -22,20 +23,20 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/register": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@polkadot/api": "3.11.1",
|
||||
"@polkadot/metadata": "3.11.1",
|
||||
"@polkadot/rpc-provider": "3.11.1",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@babel/core": "^7.13.15",
|
||||
"@babel/register": "^7.13.14",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.5.1",
|
||||
"@polkadot/metadata": "4.5.1",
|
||||
"@polkadot/rpc-provider": "4.5.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.33",
|
||||
"yargs": "^16.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.1",
|
||||
"@types/yargs": "^16.0.0"
|
||||
"@types/websocket": "^1.0.2",
|
||||
"@types/yargs": "^16.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -7,8 +7,10 @@
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../extractChain').main;
|
||||
main = require('../extractChain.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
+3
-1
@@ -7,8 +7,10 @@
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromChain').main;
|
||||
main = require('../fromChain.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
+3
-1
@@ -7,8 +7,10 @@
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromDefs').main;
|
||||
main = require('../fromDefs.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
+3
-1
@@ -7,8 +7,10 @@
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../interfacesTs').main;
|
||||
main = require('../interfacesTs.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
+3
-1
@@ -7,8 +7,10 @@
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../metadataMd').main;
|
||||
main = require('../metadataMd.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '4.5.1' };
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/types-known",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,10 +16,10 @@
|
||||
"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.13.8",
|
||||
"@polkadot/networks": "^5.9.2",
|
||||
"@polkadot/types": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/networks": "^6.1.1",
|
||||
"@polkadot/types": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -6,7 +6,10 @@ import type { OverrideModuleType } from '@polkadot/types/types';
|
||||
// type overrides for modules (where duplication between modules exist)
|
||||
const typesModules: Record<string, OverrideModuleType> = {
|
||||
assets: {
|
||||
Balance: 'TAssetBalance'
|
||||
Approval: 'AssetApproval',
|
||||
ApprovalKey: 'AssetApprovalKey',
|
||||
Balance: 'TAssetBalance',
|
||||
DestroyWitness: 'AssetDestroyWitness'
|
||||
},
|
||||
babe: {
|
||||
EquivocationProof: 'BabeEquivocationProof'
|
||||
@@ -17,6 +20,9 @@ const typesModules: Record<string, OverrideModuleType> = {
|
||||
contracts: {
|
||||
StorageKey: 'ContractStorageKey'
|
||||
},
|
||||
electionProviderMultiPhase: {
|
||||
Phase: 'ElectionPhase'
|
||||
},
|
||||
ethereum: {
|
||||
Block: 'EthBlock',
|
||||
Header: 'EthHeader',
|
||||
@@ -54,6 +60,9 @@ const typesModules: Record<string, OverrideModuleType> = {
|
||||
scheduler: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
shared: {
|
||||
ValidatorIndex: 'ParaValidatorIndex'
|
||||
},
|
||||
society: {
|
||||
Judgement: 'SocietyJudgement',
|
||||
Vote: 'SocietyVote'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/dev authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '3.11.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '4.5.1' };
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
const sharedTypes = {
|
||||
AccountInfo: 'AccountInfoWithProviders',
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Address: 'MultiAddress',
|
||||
Keys: 'SessionKeys6',
|
||||
Keys: 'SessionKeys7B',
|
||||
LookupSource: 'MultiAddress',
|
||||
ProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
|
||||
@@ -47,7 +47,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
ReferendumInfo: 'ReferendumInfoTo239',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
SlashingSpans: 'SlashingSpansTo204',
|
||||
StakingLedger: 'StakingLedgerTo223',
|
||||
Votes: 'VotesTo230',
|
||||
@@ -66,7 +65,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
ReferendumInfo: 'ReferendumInfoTo239',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
SlashingSpans: 'SlashingSpansTo204',
|
||||
StakingLedger: 'StakingLedgerTo223',
|
||||
Votes: 'VotesTo230',
|
||||
@@ -86,7 +84,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
ReferendumInfo: 'ReferendumInfoTo239',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
StakingLedger: 'StakingLedgerTo223',
|
||||
Votes: 'VotesTo230',
|
||||
Weight: 'u32'
|
||||
@@ -104,7 +101,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
ReferendumInfo: 'ReferendumInfoTo239',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
StakingLedger: 'StakingLedgerTo240',
|
||||
Weight: 'u32'
|
||||
}
|
||||
@@ -119,7 +115,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
Multiplier: 'Fixed64',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
StakingLedger: 'StakingLedgerTo240',
|
||||
Weight: 'u32'
|
||||
}
|
||||
@@ -132,8 +127,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
DispatchInfo: 'DispatchInfoTo244',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -143,8 +137,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -153,8 +146,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...sharedTypes,
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -173,7 +165,14 @@ const versioned: OverrideVersionedType[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [2028, undefined],
|
||||
minmax: [2028, 2029],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [2030, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
{
|
||||
minmax: [261, undefined],
|
||||
types: {
|
||||
AccountInfo: 'AccountInfoWithProviders',
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Address: 'MultiAddress',
|
||||
LookupSource: 'MultiAddress'
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
const sharedTypes = {
|
||||
AccountInfo: 'AccountInfoWithProviders',
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Address: 'MultiAddress',
|
||||
Keys: 'SessionKeys6',
|
||||
Keys: 'SessionKeys7B',
|
||||
LookupSource: 'MultiAddress',
|
||||
ProxyType: {
|
||||
_enum: {
|
||||
@@ -16,7 +16,7 @@ const sharedTypes = {
|
||||
NonTransfer: 1,
|
||||
Governance: 2,
|
||||
Staking: 3,
|
||||
// SudoBalances: 4,
|
||||
UnusedSudoBalances: 4,
|
||||
IdentityJudgement: 5,
|
||||
CancelProxy: 6
|
||||
}
|
||||
@@ -41,8 +41,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -51,8 +50,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...sharedTypes,
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -71,7 +69,14 @@ const versioned: OverrideVersionedType[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [28, undefined],
|
||||
minmax: [28, 29],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [30, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
}
|
||||
|
||||
@@ -9,11 +9,8 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
const sharedTypes = {
|
||||
AccountInfo: 'AccountInfoWithProviders',
|
||||
Address: 'MultiAddress',
|
||||
FullIdentification: '()', // No staking, only session (as per config)
|
||||
LookupSource: 'MultiAddress',
|
||||
Keys: 'SessionKeys6'
|
||||
Keys: 'SessionKeys7B'
|
||||
};
|
||||
|
||||
const versioned: OverrideVersionedType[] = [
|
||||
@@ -21,12 +18,27 @@ const versioned: OverrideVersionedType[] = [
|
||||
minmax: [0, 200],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Address: 'AccountId',
|
||||
LookupSource: 'AccountId'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [201, undefined],
|
||||
minmax: [201, 214],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
AccountInfo: 'AccountInfoWithDualRefCount'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [215, 228],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [229, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
}
|
||||
|
||||
@@ -6,15 +6,10 @@
|
||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
const sharedTypes = {
|
||||
AccountInfo: 'AccountInfoWithProviders',
|
||||
Address: 'MultiAddress',
|
||||
Keys: 'SessionKeys6',
|
||||
LookupSource: 'MultiAddress',
|
||||
Keys: 'SessionKeys7B',
|
||||
ProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy'
|
||||
]
|
||||
},
|
||||
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
|
||||
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
|
||||
}
|
||||
};
|
||||
|
||||
const addrAccountIdTypes = {
|
||||
@@ -35,7 +30,6 @@ const versioned: OverrideVersionedType[] = [
|
||||
Multiplier: 'Fixed64',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257',
|
||||
Weight: 'u32'
|
||||
}
|
||||
},
|
||||
@@ -46,8 +40,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
OpenTip: 'OpenTipTo225',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -56,8 +49,7 @@ const versioned: OverrideVersionedType[] = [
|
||||
...sharedTypes,
|
||||
...addrAccountIdTypes,
|
||||
CompactAssignments: 'CompactAssignmentsTo257',
|
||||
RefCount: 'RefCountTo259',
|
||||
RewardDestination: 'RewardDestinationTo257'
|
||||
RefCount: 'RefCountTo259'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -76,7 +68,23 @@ const versioned: OverrideVersionedType[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [48, undefined],
|
||||
minmax: [48, 49],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 50 was supposed to have Beefy, didn't
|
||||
minmax: [50, 50],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [51, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
|
||||
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
|
||||
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
|
||||
[6137912, 2028]
|
||||
[6137912, 2028], [6561855, 2029]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -8,7 +8,7 @@ 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]
|
||||
[3613564, 27], [3899547, 28], [4345767, 29]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -8,7 +8,8 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
|
||||
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
|
||||
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
|
||||
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48]
|
||||
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
||||
[5124076, 50]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "3.11.1",
|
||||
"version": "4.5.1",
|
||||
"type": "module",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.mjs"
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -15,15 +16,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.13.8",
|
||||
"@polkadot/metadata": "3.11.1",
|
||||
"@polkadot/util": "^5.9.2",
|
||||
"@polkadot/util-crypto": "^5.9.2",
|
||||
"@polkadot/x-rxjs": "^5.9.2",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/metadata": "4.5.1",
|
||||
"@polkadot/util": "^6.1.1",
|
||||
"@polkadot/util-crypto": "^6.1.1",
|
||||
"@polkadot/x-rxjs": "^6.1.1",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^5.9.2"
|
||||
"@polkadot/keyring": "^6.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types';
|
||||
import type { AssetBalance, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
|
||||
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
|
||||
import type { BeefyNextAuthoritySet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { DeployData, FundIndex, FundInfo, LastContribution } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||
@@ -30,24 +31,25 @@ import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudg
|
||||
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
|
||||
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
|
||||
import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
|
||||
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, NewBidder, NewBidderOption, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains';
|
||||
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExchangeAsset, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, InvalidDisputeStatementKind, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiDisputeStatementSet, MultiLocation, NetworkId, NewBidder, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains';
|
||||
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { Approvals } from '@polkadot/types/interfaces/poll';
|
||||
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
|
||||
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
|
||||
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardDestinationTo257, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithProviders, AccountInfoWithRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
|
||||
@@ -120,6 +122,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Compact<TAssetBalance>': Compact<TAssetBalance>;
|
||||
'Compact<TAssetDepositBalance>': Compact<TAssetDepositBalance>;
|
||||
'Compact<TransactionPriority>': Compact<TransactionPriority>;
|
||||
'Compact<TrieIndex>': Compact<TrieIndex>;
|
||||
'Compact<u128>': Compact<u128>;
|
||||
'Compact<U128>': Compact<U128>;
|
||||
'Compact<u16>': Compact<u16>;
|
||||
@@ -137,6 +140,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Compact<USize>': Compact<USize>;
|
||||
'Compact<ValidatorCount>': Compact<ValidatorCount>;
|
||||
'Compact<ValidatorIndex>': Compact<ValidatorIndex>;
|
||||
'Compact<ValidatorSetId>': Compact<ValidatorSetId>;
|
||||
'Compact<VoteIndex>': Compact<VoteIndex>;
|
||||
'Compact<VoteWeight>': Compact<VoteWeight>;
|
||||
'Compact<Weight>': Compact<Weight>;
|
||||
@@ -152,8 +156,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<AccountIndex>': Option<AccountIndex>;
|
||||
'Option<AccountIndex64Junction>': Option<AccountIndex64Junction>;
|
||||
'Option<AccountInfo>': Option<AccountInfo>;
|
||||
'Option<AccountInfoWithDualRefCount>': Option<AccountInfoWithDualRefCount>;
|
||||
'Option<AccountInfoWithProviders>': Option<AccountInfoWithProviders>;
|
||||
'Option<AccountInfoWithRefCount>': Option<AccountInfoWithRefCount>;
|
||||
'Option<AccountInfoWithTripleRefCount>': Option<AccountInfoWithTripleRefCount>;
|
||||
'Option<AccountKey20Junction>': Option<AccountKey20Junction>;
|
||||
'Option<AccountStatus>': Option<AccountStatus>;
|
||||
'Option<AccountValidity>': Option<AccountValidity>;
|
||||
@@ -173,7 +179,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
|
||||
'Option<ApprovalFlag>': Option<ApprovalFlag>;
|
||||
'Option<Approvals>': Option<Approvals>;
|
||||
'Option<AssetApproval>': Option<AssetApproval>;
|
||||
'Option<AssetApprovalKey>': Option<AssetApprovalKey>;
|
||||
'Option<AssetBalance>': Option<AssetBalance>;
|
||||
'Option<AssetDestroyWitness>': Option<AssetDestroyWitness>;
|
||||
'Option<AssetDetails>': Option<AssetDetails>;
|
||||
'Option<AssetId>': Option<AssetId>;
|
||||
'Option<AssetInstance>': Option<AssetInstance>;
|
||||
@@ -194,6 +203,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<AvailabilityBitfieldRecord>': Option<AvailabilityBitfieldRecord>;
|
||||
'Option<BabeAuthorityWeight>': Option<BabeAuthorityWeight>;
|
||||
'Option<BabeBlockWeight>': Option<BabeBlockWeight>;
|
||||
'Option<BabeEpochConfiguration>': Option<BabeEpochConfiguration>;
|
||||
'Option<BabeEquivocationProof>': Option<BabeEquivocationProof>;
|
||||
'Option<BabeWeight>': Option<BabeWeight>;
|
||||
'Option<BackedCandidate>': Option<BackedCandidate>;
|
||||
@@ -203,6 +213,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<BalanceOf>': Option<BalanceOf>;
|
||||
'Option<Balances>': Option<Balances>;
|
||||
'Option<BalanceStatus>': Option<BalanceStatus>;
|
||||
'Option<BeefyKey>': Option<BeefyKey>;
|
||||
'Option<BeefyNextAuthoritySet>': Option<BeefyNextAuthoritySet>;
|
||||
'Option<Bid>': Option<Bid>;
|
||||
'Option<Bidder>': Option<Bidder>;
|
||||
'Option<BidKind>': Option<BidKind>;
|
||||
@@ -295,7 +307,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<DefunctVoter>': Option<DefunctVoter>;
|
||||
'Option<Delegations>': Option<Delegations>;
|
||||
'Option<DeletedContract>': Option<DeletedContract>;
|
||||
'Option<DeployData>': Option<DeployData>;
|
||||
'Option<DepositAsset>': Option<DepositAsset>;
|
||||
'Option<DepositReserveAsset>': Option<DepositReserveAsset>;
|
||||
'Option<Digest>': Option<Digest>;
|
||||
@@ -312,6 +323,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<DispatchResult>': Option<DispatchResult>;
|
||||
'Option<DispatchResultOf>': Option<DispatchResultOf>;
|
||||
'Option<DispatchResultTo198>': Option<DispatchResultTo198>;
|
||||
'Option<DisputeStatement>': Option<DisputeStatement>;
|
||||
'Option<DisputeStatementSet>': Option<DisputeStatementSet>;
|
||||
'Option<DoNotConstruct>': Option<DoNotConstruct>;
|
||||
'Option<DoubleMapTypeLatest>': Option<DoubleMapTypeLatest>;
|
||||
'Option<DoubleMapTypeV10>': Option<DoubleMapTypeV10>;
|
||||
@@ -323,11 +336,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<EcdsaSignature>': Option<EcdsaSignature>;
|
||||
'Option<Ed25519Signature>': Option<Ed25519Signature>;
|
||||
'Option<ElectionCompute>': Option<ElectionCompute>;
|
||||
'Option<ElectionPhase>': Option<ElectionPhase>;
|
||||
'Option<ElectionResult>': Option<ElectionResult>;
|
||||
'Option<ElectionScore>': Option<ElectionScore>;
|
||||
'Option<ElectionSize>': Option<ElectionSize>;
|
||||
'Option<ElectionStatus>': Option<ElectionStatus>;
|
||||
'Option<EncodedFinalityProofs>': Option<EncodedFinalityProofs>;
|
||||
'Option<EncodedJustification>': Option<EncodedJustification>;
|
||||
'Option<EpochAuthorship>': Option<EpochAuthorship>;
|
||||
'Option<EraIndex>': Option<EraIndex>;
|
||||
'Option<EraPoints>': Option<EraPoints>;
|
||||
@@ -387,6 +402,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<ExitReason>': Option<ExitReason>;
|
||||
'Option<ExitRevert>': Option<ExitRevert>;
|
||||
'Option<ExitSucceed>': Option<ExitSucceed>;
|
||||
'Option<ExplicitDisputeStatement>': Option<ExplicitDisputeStatement>;
|
||||
'Option<Exposure>': Option<Exposure>;
|
||||
'Option<ExtendedBalance>': Option<ExtendedBalance>;
|
||||
'Option<Extrinsic>': Option<Extrinsic>;
|
||||
@@ -427,6 +443,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<FundInfo>': Option<FundInfo>;
|
||||
'Option<Gas>': Option<Gas>;
|
||||
'Option<GiltBid>': Option<GiltBid>;
|
||||
'Option<GlobalValidationData>': Option<GlobalValidationData>;
|
||||
'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>;
|
||||
'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>;
|
||||
'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>;
|
||||
@@ -486,11 +503,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<InitiateReserveWithdraw>': Option<InitiateReserveWithdraw>;
|
||||
'Option<InitiateTeleport>': Option<InitiateTeleport>;
|
||||
'Option<InstructionWeights>': Option<InstructionWeights>;
|
||||
'Option<InvalidDisputeStatementKind>': Option<InvalidDisputeStatementKind>;
|
||||
'Option<InvalidTransaction>': Option<InvalidTransaction>;
|
||||
'Option<Json>': Option<Json>;
|
||||
'Option<Junction>': Option<Junction>;
|
||||
'Option<Justification>': Option<Justification>;
|
||||
'Option<JustificationNotification>': Option<JustificationNotification>;
|
||||
'Option<Justifications>': Option<Justifications>;
|
||||
'Option<Key>': Option<Key>;
|
||||
'Option<KeyOwnerProof>': Option<KeyOwnerProof>;
|
||||
'Option<Keys>': Option<Keys>;
|
||||
@@ -529,6 +548,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<MetadataV11>': Option<MetadataV11>;
|
||||
'Option<MetadataV12>': Option<MetadataV12>;
|
||||
'Option<MetadataV9>': Option<MetadataV9>;
|
||||
'Option<MmrLeafProof>': Option<MmrLeafProof>;
|
||||
'Option<ModuleConstantMetadataLatest>': Option<ModuleConstantMetadataLatest>;
|
||||
'Option<ModuleConstantMetadataV10>': Option<ModuleConstantMetadataV10>;
|
||||
'Option<ModuleConstantMetadataV11>': Option<ModuleConstantMetadataV11>;
|
||||
@@ -546,16 +566,17 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<MortalEra>': Option<MortalEra>;
|
||||
'Option<MultiAddress>': Option<MultiAddress>;
|
||||
'Option<MultiAsset>': Option<MultiAsset>;
|
||||
'Option<MultiDisputeStatementSet>': Option<MultiDisputeStatementSet>;
|
||||
'Option<MultiLocation>': Option<MultiLocation>;
|
||||
'Option<Multiplier>': Option<Multiplier>;
|
||||
'Option<Multisig>': Option<Multisig>;
|
||||
'Option<MultiSignature>': Option<MultiSignature>;
|
||||
'Option<MultiSigner>': Option<MultiSigner>;
|
||||
'Option<NetworkId>': Option<NetworkId>;
|
||||
'Option<NetworkState>': Option<NetworkState>;
|
||||
'Option<NetworkStatePeerset>': Option<NetworkStatePeerset>;
|
||||
'Option<NetworkStatePeersetInfo>': Option<NetworkStatePeersetInfo>;
|
||||
'Option<NewBidder>': Option<NewBidder>;
|
||||
'Option<NewBidderOption>': Option<NewBidderOption>;
|
||||
'Option<NextAuthority>': Option<NextAuthority>;
|
||||
'Option<NextConfigDescriptor>': Option<NextConfigDescriptor>;
|
||||
'Option<NextConfigDescriptorV1>': Option<NextConfigDescriptorV1>;
|
||||
@@ -584,11 +605,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<OriginKind>': Option<OriginKind>;
|
||||
'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>;
|
||||
'Option<Owner>': Option<Owner>;
|
||||
'Option<PalletId>': Option<PalletId>;
|
||||
'Option<PalletsOrigin>': Option<PalletsOrigin>;
|
||||
'Option<PalletVersion>': Option<PalletVersion>;
|
||||
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
|
||||
'Option<ParachainInherentData>': Option<ParachainInherentData>;
|
||||
'Option<ParachainProposal>': Option<ParachainProposal>;
|
||||
'Option<ParachainsInherentData>': Option<ParachainsInherentData>;
|
||||
'Option<ParaGenesisArgs>': Option<ParaGenesisArgs>;
|
||||
'Option<ParaId>': Option<ParaId>;
|
||||
'Option<ParaInfo>': Option<ParaInfo>;
|
||||
@@ -627,7 +650,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<Points>': Option<Points>;
|
||||
'Option<Precommits>': Option<Precommits>;
|
||||
'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
|
||||
'Option<PrefabWasmModuleReserved>': Option<PrefabWasmModuleReserved>;
|
||||
'Option<PrefixedStorageKey>': Option<PrefixedStorageKey>;
|
||||
'Option<PreimageStatus>': Option<PreimageStatus>;
|
||||
'Option<PreimageStatusAvailable>': Option<PreimageStatusAvailable>;
|
||||
@@ -687,7 +709,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<ReserveAssetDeposit>': Option<ReserveAssetDeposit>;
|
||||
'Option<Retriable>': Option<Retriable>;
|
||||
'Option<RewardDestination>': Option<RewardDestination>;
|
||||
'Option<RewardDestinationTo257>': Option<RewardDestinationTo257>;
|
||||
'Option<RewardPoint>': Option<RewardPoint>;
|
||||
'Option<RoundSnapshot>': Option<RoundSnapshot>;
|
||||
'Option<RoundState>': Option<RoundState>;
|
||||
@@ -709,18 +730,25 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<SealV0>': Option<SealV0>;
|
||||
'Option<SeatHolder>': Option<SeatHolder>;
|
||||
'Option<SeedOf>': Option<SeedOf>;
|
||||
'Option<ServiceQuality>': Option<ServiceQuality>;
|
||||
'Option<SessionIndex>': Option<SessionIndex>;
|
||||
'Option<SessionInfo>': Option<SessionInfo>;
|
||||
'Option<SessionInfoValidatorGroup>': Option<SessionInfoValidatorGroup>;
|
||||
'Option<SessionKeys1>': Option<SessionKeys1>;
|
||||
'Option<SessionKeys10>': Option<SessionKeys10>;
|
||||
'Option<SessionKeys10B>': Option<SessionKeys10B>;
|
||||
'Option<SessionKeys2>': Option<SessionKeys2>;
|
||||
'Option<SessionKeys3>': Option<SessionKeys3>;
|
||||
'Option<SessionKeys4>': Option<SessionKeys4>;
|
||||
'Option<SessionKeys5>': Option<SessionKeys5>;
|
||||
'Option<SessionKeys6>': Option<SessionKeys6>;
|
||||
'Option<SessionKeys6B>': Option<SessionKeys6B>;
|
||||
'Option<SessionKeys7>': Option<SessionKeys7>;
|
||||
'Option<SessionKeys7B>': Option<SessionKeys7B>;
|
||||
'Option<SessionKeys8>': Option<SessionKeys8>;
|
||||
'Option<SessionKeys8B>': Option<SessionKeys8B>;
|
||||
'Option<SessionKeys9>': Option<SessionKeys9>;
|
||||
'Option<SessionKeys9B>': Option<SessionKeys9B>;
|
||||
'Option<SetId>': Option<SetId>;
|
||||
'Option<SetIndex>': Option<SetIndex>;
|
||||
'Option<SiField>': Option<SiField>;
|
||||
@@ -728,6 +756,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<SignedAvailabilityBitfield>': Option<SignedAvailabilityBitfield>;
|
||||
'Option<SignedAvailabilityBitfields>': Option<SignedAvailabilityBitfields>;
|
||||
'Option<SignedBlock>': Option<SignedBlock>;
|
||||
'Option<SignedBlockWithJustification>': Option<SignedBlockWithJustification>;
|
||||
'Option<SignedBlockWithJustifications>': Option<SignedBlockWithJustifications>;
|
||||
'Option<SignerPayload>': Option<SignerPayload>;
|
||||
'Option<SigningContext>': Option<SigningContext>;
|
||||
'Option<SiLookupTypeId>': Option<SiLookupTypeId>;
|
||||
@@ -811,6 +841,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<TransientValidationData>': Option<TransientValidationData>;
|
||||
'Option<TreasuryProposal>': Option<TreasuryProposal>;
|
||||
'Option<TrieId>': Option<TrieId>;
|
||||
'Option<TrieIndex>': Option<TrieIndex>;
|
||||
'Option<Type>': Option<Type>;
|
||||
'Option<u128>': Option<u128>;
|
||||
'Option<U128>': Option<U128>;
|
||||
@@ -847,7 +878,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>;
|
||||
'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>;
|
||||
'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>;
|
||||
'Option<ValidatorSetId>': Option<ValidatorSetId>;
|
||||
'Option<ValidatorSignature>': Option<ValidatorSignature>;
|
||||
'Option<ValidDisputeStatementKind>': Option<ValidDisputeStatementKind>;
|
||||
'Option<ValidityAttestation>': Option<ValidityAttestation>;
|
||||
'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>;
|
||||
'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>;
|
||||
@@ -896,8 +929,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<AccountIndex>': Vec<AccountIndex>;
|
||||
'Vec<AccountIndex64Junction>': Vec<AccountIndex64Junction>;
|
||||
'Vec<AccountInfo>': Vec<AccountInfo>;
|
||||
'Vec<AccountInfoWithDualRefCount>': Vec<AccountInfoWithDualRefCount>;
|
||||
'Vec<AccountInfoWithProviders>': Vec<AccountInfoWithProviders>;
|
||||
'Vec<AccountInfoWithRefCount>': Vec<AccountInfoWithRefCount>;
|
||||
'Vec<AccountInfoWithTripleRefCount>': Vec<AccountInfoWithTripleRefCount>;
|
||||
'Vec<AccountKey20Junction>': Vec<AccountKey20Junction>;
|
||||
'Vec<AccountStatus>': Vec<AccountStatus>;
|
||||
'Vec<AccountValidity>': Vec<AccountValidity>;
|
||||
@@ -917,7 +952,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
|
||||
'Vec<ApprovalFlag>': Vec<ApprovalFlag>;
|
||||
'Vec<Approvals>': Vec<Approvals>;
|
||||
'Vec<AssetApproval>': Vec<AssetApproval>;
|
||||
'Vec<AssetApprovalKey>': Vec<AssetApprovalKey>;
|
||||
'Vec<AssetBalance>': Vec<AssetBalance>;
|
||||
'Vec<AssetDestroyWitness>': Vec<AssetDestroyWitness>;
|
||||
'Vec<AssetDetails>': Vec<AssetDetails>;
|
||||
'Vec<AssetId>': Vec<AssetId>;
|
||||
'Vec<AssetInstance>': Vec<AssetInstance>;
|
||||
@@ -938,6 +976,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<AvailabilityBitfieldRecord>': Vec<AvailabilityBitfieldRecord>;
|
||||
'Vec<BabeAuthorityWeight>': Vec<BabeAuthorityWeight>;
|
||||
'Vec<BabeBlockWeight>': Vec<BabeBlockWeight>;
|
||||
'Vec<BabeEpochConfiguration>': Vec<BabeEpochConfiguration>;
|
||||
'Vec<BabeEquivocationProof>': Vec<BabeEquivocationProof>;
|
||||
'Vec<BabeWeight>': Vec<BabeWeight>;
|
||||
'Vec<BackedCandidate>': Vec<BackedCandidate>;
|
||||
@@ -947,6 +986,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<BalanceOf>': Vec<BalanceOf>;
|
||||
'Vec<Balances>': Vec<Balances>;
|
||||
'Vec<BalanceStatus>': Vec<BalanceStatus>;
|
||||
'Vec<BeefyKey>': Vec<BeefyKey>;
|
||||
'Vec<BeefyNextAuthoritySet>': Vec<BeefyNextAuthoritySet>;
|
||||
'Vec<Bid>': Vec<Bid>;
|
||||
'Vec<Bidder>': Vec<Bidder>;
|
||||
'Vec<BidKind>': Vec<BidKind>;
|
||||
@@ -1039,7 +1080,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<DefunctVoter>': Vec<DefunctVoter>;
|
||||
'Vec<Delegations>': Vec<Delegations>;
|
||||
'Vec<DeletedContract>': Vec<DeletedContract>;
|
||||
'Vec<DeployData>': Vec<DeployData>;
|
||||
'Vec<DepositAsset>': Vec<DepositAsset>;
|
||||
'Vec<DepositReserveAsset>': Vec<DepositReserveAsset>;
|
||||
'Vec<Digest>': Vec<Digest>;
|
||||
@@ -1056,6 +1096,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<DispatchResult>': Vec<DispatchResult>;
|
||||
'Vec<DispatchResultOf>': Vec<DispatchResultOf>;
|
||||
'Vec<DispatchResultTo198>': Vec<DispatchResultTo198>;
|
||||
'Vec<DisputeStatement>': Vec<DisputeStatement>;
|
||||
'Vec<DisputeStatementSet>': Vec<DisputeStatementSet>;
|
||||
'Vec<DoNotConstruct>': Vec<DoNotConstruct>;
|
||||
'Vec<DoubleMapTypeLatest>': Vec<DoubleMapTypeLatest>;
|
||||
'Vec<DoubleMapTypeV10>': Vec<DoubleMapTypeV10>;
|
||||
@@ -1067,11 +1109,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<EcdsaSignature>': Vec<EcdsaSignature>;
|
||||
'Vec<Ed25519Signature>': Vec<Ed25519Signature>;
|
||||
'Vec<ElectionCompute>': Vec<ElectionCompute>;
|
||||
'Vec<ElectionPhase>': Vec<ElectionPhase>;
|
||||
'Vec<ElectionResult>': Vec<ElectionResult>;
|
||||
'Vec<ElectionScore>': Vec<ElectionScore>;
|
||||
'Vec<ElectionSize>': Vec<ElectionSize>;
|
||||
'Vec<ElectionStatus>': Vec<ElectionStatus>;
|
||||
'Vec<EncodedFinalityProofs>': Vec<EncodedFinalityProofs>;
|
||||
'Vec<EncodedJustification>': Vec<EncodedJustification>;
|
||||
'Vec<EpochAuthorship>': Vec<EpochAuthorship>;
|
||||
'Vec<EraIndex>': Vec<EraIndex>;
|
||||
'Vec<EraPoints>': Vec<EraPoints>;
|
||||
@@ -1131,6 +1175,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<ExitReason>': Vec<ExitReason>;
|
||||
'Vec<ExitRevert>': Vec<ExitRevert>;
|
||||
'Vec<ExitSucceed>': Vec<ExitSucceed>;
|
||||
'Vec<ExplicitDisputeStatement>': Vec<ExplicitDisputeStatement>;
|
||||
'Vec<Exposure>': Vec<Exposure>;
|
||||
'Vec<ExtendedBalance>': Vec<ExtendedBalance>;
|
||||
'Vec<Extrinsic>': Vec<Extrinsic>;
|
||||
@@ -1171,6 +1216,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<FundInfo>': Vec<FundInfo>;
|
||||
'Vec<Gas>': Vec<Gas>;
|
||||
'Vec<GiltBid>': Vec<GiltBid>;
|
||||
'Vec<GlobalValidationData>': Vec<GlobalValidationData>;
|
||||
'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>;
|
||||
'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>;
|
||||
'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>;
|
||||
@@ -1230,11 +1276,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<InitiateReserveWithdraw>': Vec<InitiateReserveWithdraw>;
|
||||
'Vec<InitiateTeleport>': Vec<InitiateTeleport>;
|
||||
'Vec<InstructionWeights>': Vec<InstructionWeights>;
|
||||
'Vec<InvalidDisputeStatementKind>': Vec<InvalidDisputeStatementKind>;
|
||||
'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
|
||||
'Vec<Json>': Vec<Json>;
|
||||
'Vec<Junction>': Vec<Junction>;
|
||||
'Vec<Justification>': Vec<Justification>;
|
||||
'Vec<JustificationNotification>': Vec<JustificationNotification>;
|
||||
'Vec<Justifications>': Vec<Justifications>;
|
||||
'Vec<Key>': Vec<Key>;
|
||||
'Vec<KeyOwnerProof>': Vec<KeyOwnerProof>;
|
||||
'Vec<Keys>': Vec<Keys>;
|
||||
@@ -1273,6 +1321,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<MetadataV11>': Vec<MetadataV11>;
|
||||
'Vec<MetadataV12>': Vec<MetadataV12>;
|
||||
'Vec<MetadataV9>': Vec<MetadataV9>;
|
||||
'Vec<MmrLeafProof>': Vec<MmrLeafProof>;
|
||||
'Vec<ModuleConstantMetadataLatest>': Vec<ModuleConstantMetadataLatest>;
|
||||
'Vec<ModuleConstantMetadataV10>': Vec<ModuleConstantMetadataV10>;
|
||||
'Vec<ModuleConstantMetadataV11>': Vec<ModuleConstantMetadataV11>;
|
||||
@@ -1290,16 +1339,17 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<MortalEra>': Vec<MortalEra>;
|
||||
'Vec<MultiAddress>': Vec<MultiAddress>;
|
||||
'Vec<MultiAsset>': Vec<MultiAsset>;
|
||||
'Vec<MultiDisputeStatementSet>': Vec<MultiDisputeStatementSet>;
|
||||
'Vec<MultiLocation>': Vec<MultiLocation>;
|
||||
'Vec<Multiplier>': Vec<Multiplier>;
|
||||
'Vec<Multisig>': Vec<Multisig>;
|
||||
'Vec<MultiSignature>': Vec<MultiSignature>;
|
||||
'Vec<MultiSigner>': Vec<MultiSigner>;
|
||||
'Vec<NetworkId>': Vec<NetworkId>;
|
||||
'Vec<NetworkState>': Vec<NetworkState>;
|
||||
'Vec<NetworkStatePeerset>': Vec<NetworkStatePeerset>;
|
||||
'Vec<NetworkStatePeersetInfo>': Vec<NetworkStatePeersetInfo>;
|
||||
'Vec<NewBidder>': Vec<NewBidder>;
|
||||
'Vec<NewBidderOption>': Vec<NewBidderOption>;
|
||||
'Vec<NextAuthority>': Vec<NextAuthority>;
|
||||
'Vec<NextConfigDescriptor>': Vec<NextConfigDescriptor>;
|
||||
'Vec<NextConfigDescriptorV1>': Vec<NextConfigDescriptorV1>;
|
||||
@@ -1328,11 +1378,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<OriginKind>': Vec<OriginKind>;
|
||||
'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>;
|
||||
'Vec<Owner>': Vec<Owner>;
|
||||
'Vec<PalletId>': Vec<PalletId>;
|
||||
'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
|
||||
'Vec<PalletVersion>': Vec<PalletVersion>;
|
||||
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
|
||||
'Vec<ParachainInherentData>': Vec<ParachainInherentData>;
|
||||
'Vec<ParachainProposal>': Vec<ParachainProposal>;
|
||||
'Vec<ParachainsInherentData>': Vec<ParachainsInherentData>;
|
||||
'Vec<ParaGenesisArgs>': Vec<ParaGenesisArgs>;
|
||||
'Vec<ParaId>': Vec<ParaId>;
|
||||
'Vec<ParaInfo>': Vec<ParaInfo>;
|
||||
@@ -1371,7 +1423,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<Points>': Vec<Points>;
|
||||
'Vec<Precommits>': Vec<Precommits>;
|
||||
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
|
||||
'Vec<PrefabWasmModuleReserved>': Vec<PrefabWasmModuleReserved>;
|
||||
'Vec<PrefixedStorageKey>': Vec<PrefixedStorageKey>;
|
||||
'Vec<PreimageStatus>': Vec<PreimageStatus>;
|
||||
'Vec<PreimageStatusAvailable>': Vec<PreimageStatusAvailable>;
|
||||
@@ -1431,7 +1482,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<ReserveAssetDeposit>': Vec<ReserveAssetDeposit>;
|
||||
'Vec<Retriable>': Vec<Retriable>;
|
||||
'Vec<RewardDestination>': Vec<RewardDestination>;
|
||||
'Vec<RewardDestinationTo257>': Vec<RewardDestinationTo257>;
|
||||
'Vec<RewardPoint>': Vec<RewardPoint>;
|
||||
'Vec<RoundSnapshot>': Vec<RoundSnapshot>;
|
||||
'Vec<RoundState>': Vec<RoundState>;
|
||||
@@ -1453,18 +1503,25 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<SealV0>': Vec<SealV0>;
|
||||
'Vec<SeatHolder>': Vec<SeatHolder>;
|
||||
'Vec<SeedOf>': Vec<SeedOf>;
|
||||
'Vec<ServiceQuality>': Vec<ServiceQuality>;
|
||||
'Vec<SessionIndex>': Vec<SessionIndex>;
|
||||
'Vec<SessionInfo>': Vec<SessionInfo>;
|
||||
'Vec<SessionInfoValidatorGroup>': Vec<SessionInfoValidatorGroup>;
|
||||
'Vec<SessionKeys1>': Vec<SessionKeys1>;
|
||||
'Vec<SessionKeys10>': Vec<SessionKeys10>;
|
||||
'Vec<SessionKeys10B>': Vec<SessionKeys10B>;
|
||||
'Vec<SessionKeys2>': Vec<SessionKeys2>;
|
||||
'Vec<SessionKeys3>': Vec<SessionKeys3>;
|
||||
'Vec<SessionKeys4>': Vec<SessionKeys4>;
|
||||
'Vec<SessionKeys5>': Vec<SessionKeys5>;
|
||||
'Vec<SessionKeys6>': Vec<SessionKeys6>;
|
||||
'Vec<SessionKeys6B>': Vec<SessionKeys6B>;
|
||||
'Vec<SessionKeys7>': Vec<SessionKeys7>;
|
||||
'Vec<SessionKeys7B>': Vec<SessionKeys7B>;
|
||||
'Vec<SessionKeys8>': Vec<SessionKeys8>;
|
||||
'Vec<SessionKeys8B>': Vec<SessionKeys8B>;
|
||||
'Vec<SessionKeys9>': Vec<SessionKeys9>;
|
||||
'Vec<SessionKeys9B>': Vec<SessionKeys9B>;
|
||||
'Vec<SetId>': Vec<SetId>;
|
||||
'Vec<SetIndex>': Vec<SetIndex>;
|
||||
'Vec<SiField>': Vec<SiField>;
|
||||
@@ -1472,6 +1529,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<SignedAvailabilityBitfield>': Vec<SignedAvailabilityBitfield>;
|
||||
'Vec<SignedAvailabilityBitfields>': Vec<SignedAvailabilityBitfields>;
|
||||
'Vec<SignedBlock>': Vec<SignedBlock>;
|
||||
'Vec<SignedBlockWithJustification>': Vec<SignedBlockWithJustification>;
|
||||
'Vec<SignedBlockWithJustifications>': Vec<SignedBlockWithJustifications>;
|
||||
'Vec<SignerPayload>': Vec<SignerPayload>;
|
||||
'Vec<SigningContext>': Vec<SigningContext>;
|
||||
'Vec<SiLookupTypeId>': Vec<SiLookupTypeId>;
|
||||
@@ -1555,6 +1614,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<TransientValidationData>': Vec<TransientValidationData>;
|
||||
'Vec<TreasuryProposal>': Vec<TreasuryProposal>;
|
||||
'Vec<TrieId>': Vec<TrieId>;
|
||||
'Vec<TrieIndex>': Vec<TrieIndex>;
|
||||
'Vec<Type>': Vec<Type>;
|
||||
'Vec<u128>': Vec<u128>;
|
||||
'Vec<U128>': Vec<U128>;
|
||||
@@ -1591,7 +1651,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>;
|
||||
'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>;
|
||||
'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>;
|
||||
'Vec<ValidatorSetId>': Vec<ValidatorSetId>;
|
||||
'Vec<ValidatorSignature>': Vec<ValidatorSignature>;
|
||||
'Vec<ValidDisputeStatementKind>': Vec<ValidDisputeStatementKind>;
|
||||
'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
|
||||
'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>;
|
||||
'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>;
|
||||
@@ -1640,8 +1702,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
AccountIndex: AccountIndex;
|
||||
AccountIndex64Junction: AccountIndex64Junction;
|
||||
AccountInfo: AccountInfo;
|
||||
AccountInfoWithDualRefCount: AccountInfoWithDualRefCount;
|
||||
AccountInfoWithProviders: AccountInfoWithProviders;
|
||||
AccountInfoWithRefCount: AccountInfoWithRefCount;
|
||||
AccountInfoWithTripleRefCount: AccountInfoWithTripleRefCount;
|
||||
AccountKey20Junction: AccountKey20Junction;
|
||||
AccountStatus: AccountStatus;
|
||||
AccountValidity: AccountValidity;
|
||||
@@ -1661,7 +1725,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
ApplyExtrinsicResult: ApplyExtrinsicResult;
|
||||
ApprovalFlag: ApprovalFlag;
|
||||
Approvals: Approvals;
|
||||
AssetApproval: AssetApproval;
|
||||
AssetApprovalKey: AssetApprovalKey;
|
||||
AssetBalance: AssetBalance;
|
||||
AssetDestroyWitness: AssetDestroyWitness;
|
||||
AssetDetails: AssetDetails;
|
||||
AssetId: AssetId;
|
||||
AssetInstance: AssetInstance;
|
||||
@@ -1682,6 +1749,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
AvailabilityBitfieldRecord: AvailabilityBitfieldRecord;
|
||||
BabeAuthorityWeight: BabeAuthorityWeight;
|
||||
BabeBlockWeight: BabeBlockWeight;
|
||||
BabeEpochConfiguration: BabeEpochConfiguration;
|
||||
BabeEquivocationProof: BabeEquivocationProof;
|
||||
BabeWeight: BabeWeight;
|
||||
BackedCandidate: BackedCandidate;
|
||||
@@ -1691,6 +1759,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
BalanceOf: BalanceOf;
|
||||
Balances: Balances;
|
||||
BalanceStatus: BalanceStatus;
|
||||
BeefyKey: BeefyKey;
|
||||
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
|
||||
Bid: Bid;
|
||||
Bidder: Bidder;
|
||||
BidKind: BidKind;
|
||||
@@ -1783,7 +1853,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
DefunctVoter: DefunctVoter;
|
||||
Delegations: Delegations;
|
||||
DeletedContract: DeletedContract;
|
||||
DeployData: DeployData;
|
||||
DepositAsset: DepositAsset;
|
||||
DepositReserveAsset: DepositReserveAsset;
|
||||
Digest: Digest;
|
||||
@@ -1800,6 +1869,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
DispatchResult: DispatchResult;
|
||||
DispatchResultOf: DispatchResultOf;
|
||||
DispatchResultTo198: DispatchResultTo198;
|
||||
DisputeStatement: DisputeStatement;
|
||||
DisputeStatementSet: DisputeStatementSet;
|
||||
DoNotConstruct: DoNotConstruct;
|
||||
DoubleMapTypeLatest: DoubleMapTypeLatest;
|
||||
DoubleMapTypeV10: DoubleMapTypeV10;
|
||||
@@ -1811,11 +1882,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
EcdsaSignature: EcdsaSignature;
|
||||
Ed25519Signature: Ed25519Signature;
|
||||
ElectionCompute: ElectionCompute;
|
||||
ElectionPhase: ElectionPhase;
|
||||
ElectionResult: ElectionResult;
|
||||
ElectionScore: ElectionScore;
|
||||
ElectionSize: ElectionSize;
|
||||
ElectionStatus: ElectionStatus;
|
||||
EncodedFinalityProofs: EncodedFinalityProofs;
|
||||
EncodedJustification: EncodedJustification;
|
||||
EpochAuthorship: EpochAuthorship;
|
||||
EraIndex: EraIndex;
|
||||
EraPoints: EraPoints;
|
||||
@@ -1875,6 +1948,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ExitReason: ExitReason;
|
||||
ExitRevert: ExitRevert;
|
||||
ExitSucceed: ExitSucceed;
|
||||
ExplicitDisputeStatement: ExplicitDisputeStatement;
|
||||
Exposure: Exposure;
|
||||
ExtendedBalance: ExtendedBalance;
|
||||
Extrinsic: Extrinsic;
|
||||
@@ -1915,6 +1989,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
FundInfo: FundInfo;
|
||||
Gas: Gas;
|
||||
GiltBid: GiltBid;
|
||||
GlobalValidationData: GlobalValidationData;
|
||||
GlobalValidationSchedule: GlobalValidationSchedule;
|
||||
GrandpaEquivocation: GrandpaEquivocation;
|
||||
GrandpaEquivocationProof: GrandpaEquivocationProof;
|
||||
@@ -1974,11 +2049,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
InitiateReserveWithdraw: InitiateReserveWithdraw;
|
||||
InitiateTeleport: InitiateTeleport;
|
||||
InstructionWeights: InstructionWeights;
|
||||
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
|
||||
InvalidTransaction: InvalidTransaction;
|
||||
Json: Json;
|
||||
Junction: Junction;
|
||||
Justification: Justification;
|
||||
JustificationNotification: JustificationNotification;
|
||||
Justifications: Justifications;
|
||||
Key: Key;
|
||||
KeyOwnerProof: KeyOwnerProof;
|
||||
Keys: Keys;
|
||||
@@ -2017,6 +2094,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
MetadataV11: MetadataV11;
|
||||
MetadataV12: MetadataV12;
|
||||
MetadataV9: MetadataV9;
|
||||
MmrLeafProof: MmrLeafProof;
|
||||
ModuleConstantMetadataLatest: ModuleConstantMetadataLatest;
|
||||
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
|
||||
ModuleConstantMetadataV11: ModuleConstantMetadataV11;
|
||||
@@ -2034,16 +2112,17 @@ declare module '@polkadot/types/types/registry' {
|
||||
MortalEra: MortalEra;
|
||||
MultiAddress: MultiAddress;
|
||||
MultiAsset: MultiAsset;
|
||||
MultiDisputeStatementSet: MultiDisputeStatementSet;
|
||||
MultiLocation: MultiLocation;
|
||||
Multiplier: Multiplier;
|
||||
Multisig: Multisig;
|
||||
MultiSignature: MultiSignature;
|
||||
MultiSigner: MultiSigner;
|
||||
NetworkId: NetworkId;
|
||||
NetworkState: NetworkState;
|
||||
NetworkStatePeerset: NetworkStatePeerset;
|
||||
NetworkStatePeersetInfo: NetworkStatePeersetInfo;
|
||||
NewBidder: NewBidder;
|
||||
NewBidderOption: NewBidderOption;
|
||||
NextAuthority: NextAuthority;
|
||||
NextConfigDescriptor: NextConfigDescriptor;
|
||||
NextConfigDescriptorV1: NextConfigDescriptorV1;
|
||||
@@ -2072,11 +2151,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
OriginKind: OriginKind;
|
||||
OutboundHrmpMessage: OutboundHrmpMessage;
|
||||
Owner: Owner;
|
||||
PalletId: PalletId;
|
||||
PalletsOrigin: PalletsOrigin;
|
||||
PalletVersion: PalletVersion;
|
||||
ParachainDispatchOrigin: ParachainDispatchOrigin;
|
||||
ParachainInherentData: ParachainInherentData;
|
||||
ParachainProposal: ParachainProposal;
|
||||
ParachainsInherentData: ParachainsInherentData;
|
||||
ParaGenesisArgs: ParaGenesisArgs;
|
||||
ParaId: ParaId;
|
||||
ParaInfo: ParaInfo;
|
||||
@@ -2115,7 +2196,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
Points: Points;
|
||||
Precommits: Precommits;
|
||||
PrefabWasmModule: PrefabWasmModule;
|
||||
PrefabWasmModuleReserved: PrefabWasmModuleReserved;
|
||||
PrefixedStorageKey: PrefixedStorageKey;
|
||||
PreimageStatus: PreimageStatus;
|
||||
PreimageStatusAvailable: PreimageStatusAvailable;
|
||||
@@ -2175,7 +2255,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
ReserveAssetDeposit: ReserveAssetDeposit;
|
||||
Retriable: Retriable;
|
||||
RewardDestination: RewardDestination;
|
||||
RewardDestinationTo257: RewardDestinationTo257;
|
||||
RewardPoint: RewardPoint;
|
||||
RoundSnapshot: RoundSnapshot;
|
||||
RoundState: RoundState;
|
||||
@@ -2197,18 +2276,25 @@ declare module '@polkadot/types/types/registry' {
|
||||
SealV0: SealV0;
|
||||
SeatHolder: SeatHolder;
|
||||
SeedOf: SeedOf;
|
||||
ServiceQuality: ServiceQuality;
|
||||
SessionIndex: SessionIndex;
|
||||
SessionInfo: SessionInfo;
|
||||
SessionInfoValidatorGroup: SessionInfoValidatorGroup;
|
||||
SessionKeys1: SessionKeys1;
|
||||
SessionKeys10: SessionKeys10;
|
||||
SessionKeys10B: SessionKeys10B;
|
||||
SessionKeys2: SessionKeys2;
|
||||
SessionKeys3: SessionKeys3;
|
||||
SessionKeys4: SessionKeys4;
|
||||
SessionKeys5: SessionKeys5;
|
||||
SessionKeys6: SessionKeys6;
|
||||
SessionKeys6B: SessionKeys6B;
|
||||
SessionKeys7: SessionKeys7;
|
||||
SessionKeys7B: SessionKeys7B;
|
||||
SessionKeys8: SessionKeys8;
|
||||
SessionKeys8B: SessionKeys8B;
|
||||
SessionKeys9: SessionKeys9;
|
||||
SessionKeys9B: SessionKeys9B;
|
||||
SetId: SetId;
|
||||
SetIndex: SetIndex;
|
||||
SiField: SiField;
|
||||
@@ -2216,6 +2302,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
SignedAvailabilityBitfield: SignedAvailabilityBitfield;
|
||||
SignedAvailabilityBitfields: SignedAvailabilityBitfields;
|
||||
SignedBlock: SignedBlock;
|
||||
SignedBlockWithJustification: SignedBlockWithJustification;
|
||||
SignedBlockWithJustifications: SignedBlockWithJustifications;
|
||||
SignerPayload: SignerPayload;
|
||||
SigningContext: SigningContext;
|
||||
SiLookupTypeId: SiLookupTypeId;
|
||||
@@ -2299,6 +2387,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
TransientValidationData: TransientValidationData;
|
||||
TreasuryProposal: TreasuryProposal;
|
||||
TrieId: TrieId;
|
||||
TrieIndex: TrieIndex;
|
||||
Type: Type;
|
||||
u128: u128;
|
||||
U128: U128;
|
||||
@@ -2335,7 +2424,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
ValidatorPrefsTo196: ValidatorPrefsTo196;
|
||||
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
|
||||
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
|
||||
ValidatorSetId: ValidatorSetId;
|
||||
ValidatorSignature: ValidatorSignature;
|
||||
ValidDisputeStatementKind: ValidDisputeStatementKind;
|
||||
ValidityAttestation: ValidityAttestation;
|
||||
VecInboundHrmpMessage: VecInboundHrmpMessage;
|
||||
VersionedMultiAsset: VersionedMultiAsset;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Registry } from '../types';
|
||||
|
||||
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
@@ -18,6 +18,8 @@ import { compareArray } from './utils';
|
||||
export abstract class AbstractArray<T extends Codec> extends Array<T> implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
protected constructor (registry: Registry, ...values: T[]) {
|
||||
super(...values);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyNumber, Codec, Registry } from '../types';
|
||||
import type { UIntBitLength } from './types';
|
||||
|
||||
@@ -67,6 +67,8 @@ function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegati
|
||||
export abstract class AbstractInt extends BN implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
readonly #bitLength: UIntBitLength;
|
||||
|
||||
readonly #isSigned: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
@@ -79,6 +79,8 @@ function decodeSet<V extends Codec = Codec> (registry: Registry, valType: Constr
|
||||
export class BTreeSet<V extends Codec = Codec> extends Set<V> implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
readonly #ValClass: Constructor<V>;
|
||||
|
||||
constructor (registry: Registry, valType: Constructor<V> | keyof InterfaceTypes, rawValue?: Uint8Array | string | string[] | Set<any>) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, BareOpts, Codec, Registry } from '../types';
|
||||
|
||||
/**
|
||||
@@ -11,6 +11,8 @@ import type { AnyJson, BareOpts, Codec, Registry } from '../types';
|
||||
export abstract class Base<T extends Codec> implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
protected readonly _raw: T;
|
||||
|
||||
protected constructor (registry: Registry, value: T) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces';
|
||||
import type { CodecHash, Hash } from '../interfaces';
|
||||
import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types';
|
||||
import type { CompactEncodable, UIntBitLength } from './types';
|
||||
|
||||
@@ -22,6 +22,8 @@ import { typeToConstructor } from './utils';
|
||||
export class Compact<T extends CompactEncodable> implements ICompact<T> {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
readonly #Type: Constructor<T>;
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyNumber, Codec, Registry } from '../types';
|
||||
import type { UIntBitLength } from './types';
|
||||
|
||||
@@ -24,6 +24,8 @@ const BITLENGTH: UIntBitLength = 64;
|
||||
export class CodecDate extends Date implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
constructor (registry: Registry, value: CodecDate | Date | AnyNumber = 0) {
|
||||
super(CodecDate.decodeDate(value));
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('Enum', (): void => {
|
||||
{ Text, U32 },
|
||||
new Uint8Array([1, 2 << 2, 49, 50])
|
||||
).toString()
|
||||
).toEqual('{"U32":3289352}');
|
||||
).toEqual('{"u32":3289352}');
|
||||
});
|
||||
|
||||
it('decodes from a JSON input (lowercase)', (): void => {
|
||||
@@ -43,7 +43,7 @@ describe('Enum', (): void => {
|
||||
).toEqual('some text value');
|
||||
});
|
||||
|
||||
it('decodes reusing instanciated inputs', (): void => {
|
||||
it('decodes reusing instantiated inputs', (): void => {
|
||||
const foo = new Text(registry, 'bar');
|
||||
|
||||
expect(
|
||||
@@ -144,8 +144,8 @@ describe('Enum', (): void => {
|
||||
class C extends Null { }
|
||||
const Test = Enum.with({ A, B, C });
|
||||
|
||||
expect(new Test(registry).toJSON()).toEqual({ A: null });
|
||||
expect(new Test(registry, 1234, 1).toJSON()).toEqual({ B: 1234 });
|
||||
expect(new Test(registry).toJSON()).toEqual({ a: null });
|
||||
expect(new Test(registry, 1234, 1).toJSON()).toEqual({ b: 1234 });
|
||||
expect(new Test(registry, 0x1234, 1).toU8a()).toEqual(new Uint8Array([1, 0x34, 0x12, 0x00, 0x00]));
|
||||
expect(new Test(registry, 0x1234, 1).toU8a(true)).toEqual(new Uint8Array([0x34, 0x12, 0x00, 0x00]));
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces';
|
||||
import type { CodecHash, Hash } from '../interfaces';
|
||||
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
|
||||
|
||||
import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
@@ -99,7 +99,7 @@ function createFromValue (registry: Registry, def: TypesDef, index = 0, value?:
|
||||
}
|
||||
|
||||
function decodeFromJSON (registry: Registry, def: TypesDef, key: string, value?: any): Decoded {
|
||||
// JSON comes in the form of { "<type (lowercased)>": "<value for type>" }, here we
|
||||
// JSON comes in the form of { "<type (camelCase)>": "<value for type>" }, here we
|
||||
// additionally force to lower to ensure forward compat
|
||||
const keys = Object.keys(def).map((k) => k.toLowerCase());
|
||||
const keyLower = key.toLowerCase();
|
||||
@@ -166,6 +166,8 @@ function decodeEnum (registry: Registry, def: TypesDef, value?: any, index?: num
|
||||
export class Enum implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
readonly #def: TypesDef;
|
||||
|
||||
readonly #entryIndex: number;
|
||||
@@ -343,7 +345,7 @@ export class Enum implements Codec {
|
||||
public toJSON (): AnyJson {
|
||||
return this.#isBasic
|
||||
? this.type
|
||||
: { [this.type]: this.#raw.toJSON() };
|
||||
: { [stringCamelCase(this.type)]: this.#raw.toJSON() };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecHash } from '../interfaces/runtime';
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Registry } from '../types';
|
||||
|
||||
import { isFunction, isUndefined } from '@polkadot/util';
|
||||
@@ -24,6 +24,8 @@ function decodeJson (value?: Record<string, unknown> | null): [string, any][] {
|
||||
export class Json extends Map<string, any> implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: Hash;
|
||||
|
||||
constructor (registry: Registry, value?: Record<string, unknown> | null) {
|
||||
const decoded = decodeJson(value);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('Linkage', (): void => {
|
||||
// prefs sanity check
|
||||
expect(
|
||||
registry.createType(
|
||||
'ValidatorPrefs',
|
||||
'ValidatorPrefsWithCommission',
|
||||
'0x0284d717'
|
||||
).toHuman()
|
||||
).toEqual(PREFS);
|
||||
@@ -33,7 +33,7 @@ describe('Linkage', (): void => {
|
||||
// actual check
|
||||
expect(
|
||||
registry.createType(
|
||||
'(ValidatorPrefs, Linkage<AccountId>)' as 'u32',
|
||||
'(ValidatorPrefsWithCommission, Linkage<AccountId>)' as 'u32',
|
||||
'0x0284d7170001da30b68f54f686f586ddb29de12b682dd8bd1404566fb8a8db5dec20aa5b6b36'
|
||||
).toHuman()
|
||||
).toEqual([PREFS, LINKA]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user