Adjust object index typings (#5671)
* Adjust object index typings * CHANGELOG * Remove dot-notation overrides * Align overrides * Ordering * Revert lint formatting changes * Bump common
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# CHANGELOG
|
||||
|
||||
## master
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust object index access for stricter tsconfig settings
|
||||
|
||||
|
||||
## 10.8.1 Jun 5, 2023
|
||||
|
||||
Contributed:
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
import baseConfig from '@polkadot/dev/config/eslint';
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
// see the tsconfig.eslint.json for explanation
|
||||
'packages/api-augment/src/kusama/*.ts',
|
||||
'packages/api-augment/src/polkadot/*.ts'
|
||||
]
|
||||
},
|
||||
...baseConfig,
|
||||
{
|
||||
rules: {
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
"test:one": "polkadot-dev-run-test --env node"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.75.16",
|
||||
"@polkadot/dev": "^0.75.19",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/node": "^20.2.5"
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-augment": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"dependencies": {
|
||||
"@polkadot/rpc-core": "10.8.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
|
||||
@@ -22,16 +22,17 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/api": "10.8.1",
|
||||
"@polkadot/api-augment": "10.8.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/types-create": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "10.8.1",
|
||||
"@polkadot/keyring": "^12.2.2"
|
||||
"@polkadot/keyring": "^12.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ describe('Abi', (): void => {
|
||||
JSON.parse(fs.readFileSync(cmpFile, 'utf-8'))
|
||||
);
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
if (process.env['GITHUB_REPOSITORY']) {
|
||||
console.error(registryJson);
|
||||
|
||||
throw error;
|
||||
@@ -114,8 +114,8 @@ describe('Abi', (): void => {
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const abi = new Abi(abis.ink_v0_flipperBundle);
|
||||
const bundle = abis.ink_v0_flipperBundle as unknown as JSONAbi;
|
||||
const abi = new Abi(abis['ink_v0_flipperBundle']);
|
||||
const bundle = abis['ink_v0_flipperBundle'] as unknown as JSONAbi;
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
@@ -12,6 +12,12 @@ import { assertReturn, compactAddLength, compactStripLength, isBn, isNumber, isO
|
||||
|
||||
import { convertVersions, enumVersions } from './toLatest.js';
|
||||
|
||||
interface AbiJson {
|
||||
version?: string;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
const l = logger('Abi');
|
||||
|
||||
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
|
||||
@@ -26,12 +32,12 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
|
||||
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
|
||||
}
|
||||
|
||||
function getLatestMeta (registry: Registry, json: Record<string, unknown>): ContractMetadataLatest {
|
||||
function getLatestMeta (registry: Registry, json: AbiJson): ContractMetadataLatest {
|
||||
// this is for V1, V2, V3
|
||||
const vx = enumVersions.find((v) => isObject(json[v]));
|
||||
|
||||
// this was added in V4
|
||||
const jsonVersion = json.version as string;
|
||||
const jsonVersion = json.version;
|
||||
|
||||
if (!vx && jsonVersion && !enumVersions.find((v) => v === `V${jsonVersion}`)) {
|
||||
throw new Error(`Unable to handle version ${jsonVersion}`);
|
||||
@@ -56,7 +62,7 @@ function getLatestMeta (registry: Registry, json: Record<string, unknown>): Cont
|
||||
function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataLatest, ContractProjectInfo] {
|
||||
const registry = new TypeRegistry();
|
||||
const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo;
|
||||
const latest = getLatestMeta(registry, json);
|
||||
const latest = getLatestMeta(registry, json as unknown as AbiJson);
|
||||
const lookup = registry.createType('PortableRegistry', { types: latest.types }, true);
|
||||
|
||||
// attach the lookup to the registry - now the types are known
|
||||
|
||||
@@ -10,7 +10,7 @@ import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest, v4ToLatest } from './to
|
||||
|
||||
describe('v0ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V0: abis.ink_v0_erc20 });
|
||||
const contract = registry.createType('ContractMetadata', { V0: abis['ink_v0_erc20'] });
|
||||
const latest = v0ToLatest(registry, contract.asV0);
|
||||
|
||||
it('has the correct constructors', (): void => {
|
||||
@@ -52,7 +52,7 @@ describe('v0ToLatest', (): void => {
|
||||
|
||||
describe('v1ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_flipper.V1 });
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_flipper']['V1'] });
|
||||
const latest = v1ToLatest(registry, contract.asV1);
|
||||
|
||||
it('has the correct constructors', (): void => {
|
||||
@@ -68,7 +68,7 @@ describe('v1ToLatest', (): void => {
|
||||
});
|
||||
|
||||
it('has the correct messages with namespaced method name', (): void => {
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_psp22.V1 });
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_psp22']['V1'] });
|
||||
const latest = v1ToLatest(registry, contract.asV1);
|
||||
|
||||
expect(
|
||||
@@ -87,7 +87,7 @@ describe('v1ToLatest', (): void => {
|
||||
|
||||
describe('v2ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V2: abis.ink_v2_flipper.V2 });
|
||||
const contract = registry.createType('ContractMetadata', { V2: abis['ink_v2_flipper']['V2'] });
|
||||
const latest = v2ToLatest(registry, contract.asV2);
|
||||
|
||||
it('has the correct constructor flag', (): void => {
|
||||
@@ -99,7 +99,7 @@ describe('v2ToLatest', (): void => {
|
||||
|
||||
describe('v3ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_flipper.V3 });
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_flipper']['V3'] });
|
||||
const latest = v3ToLatest(registry, contract.asV3);
|
||||
|
||||
it('has the correct constructor flags', (): void => {
|
||||
@@ -112,7 +112,7 @@ describe('v3ToLatest', (): void => {
|
||||
});
|
||||
|
||||
it('has the correct messages', (): void => {
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_traitErc20.V3 });
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_traitErc20']['V3'] });
|
||||
const latest = v3ToLatest(registry, contract.asV3);
|
||||
|
||||
expect(
|
||||
@@ -125,7 +125,7 @@ describe('v3ToLatest', (): void => {
|
||||
|
||||
describe('v4ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V4: abis.ink_v4_flipperContract });
|
||||
const contract = registry.createType('ContractMetadata', { V4: abis['ink_v4_flipperContract'] });
|
||||
const latest = v4ToLatest(registry, contract.asV4);
|
||||
|
||||
it('has the correct constructor flags', (): void => {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/api-augment';
|
||||
@@ -97,7 +97,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
: convertWeight(
|
||||
this.api.consts.system.blockWeights
|
||||
? (this.api.consts.system.blockWeights as unknown as { maxBlock: WeightV2 }).maxBlock
|
||||
: this.api.consts.system.maximumBlockWeight as Weight
|
||||
: this.api.consts.system['maximumBlockWeight'] as Weight
|
||||
).v1Weight.muln(64).div(BN_HUNDRED)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import '@polkadot/api-augment';
|
||||
|
||||
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
import type { TestKeyringMapSubstrate } from '@polkadot/keyring/testingPairs';
|
||||
|
||||
import { ApiPromise } from '@polkadot/api';
|
||||
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
|
||||
@@ -13,21 +13,21 @@ import { createTestPairs } from '@polkadot/keyring/testingPairs';
|
||||
|
||||
import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' };
|
||||
|
||||
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
|
||||
|
||||
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
|
||||
await blueprint.tx.new({ gasLimit: 456, value: 123 }, 42).signAndSend(pairs.bob);
|
||||
await blueprint.tx['new']({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
|
||||
await blueprint.tx['new']({ gasLimit: 456, value: 123 }, 42).signAndSend(pairs.bob);
|
||||
}
|
||||
|
||||
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
async function checkContract (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
|
||||
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
|
||||
|
||||
// queries
|
||||
await contract.query.get(pairs.alice.address, {});
|
||||
await contract.query['get'](pairs.alice.address, {});
|
||||
|
||||
// execute
|
||||
await contract.tx.inc({ gasLimit: 1234 }, 123).signAndSend(pairs.eve);
|
||||
await contract.tx['inc']({ gasLimit: 1234 }, 123).signAndSend(pairs.eve);
|
||||
}
|
||||
|
||||
async function main (): Promise<void> {
|
||||
|
||||
@@ -7,10 +7,14 @@ import user from './user/index.js';
|
||||
|
||||
const all: Record<string, Record<string, unknown>> = {};
|
||||
|
||||
Object.entries({ ink, solang, user }).forEach(([type, abis]) =>
|
||||
Object.entries(abis).forEach(([name, abi]): void => {
|
||||
all[`${type}_${name}`] = abi;
|
||||
})
|
||||
);
|
||||
Object
|
||||
.entries({ ink, solang, user })
|
||||
.forEach(([type, abis]) =>
|
||||
Object
|
||||
.entries(abis)
|
||||
.forEach(([name, abi]): void => {
|
||||
all[`${type}_${name}`] = abi;
|
||||
})
|
||||
);
|
||||
|
||||
export default all;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-create/tsconfig.build.json" }
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"@polkadot/rpc-core": "10.8.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ export function _flags (instanceId: string, api: DeriveApi): () => Observable<Fl
|
||||
return memo(instanceId, (): Observable<FlagsIntermediate> => {
|
||||
const results: unknown[] = [undefined, [], [], [], undefined];
|
||||
const calls = [
|
||||
(api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections)?.members,
|
||||
(api.query.elections || api.query['phragmenElection'] || api.query['electionsPhragmen'])?.members,
|
||||
api.query.council?.members,
|
||||
api.query.technicalCommittee?.members,
|
||||
api.query.society?.members,
|
||||
|
||||
@@ -15,13 +15,13 @@ import { memo } from '../util/index.js';
|
||||
|
||||
function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable<string | undefined> {
|
||||
return ((
|
||||
accountId && api.query.nicks?.nameOf
|
||||
? api.query.nicks.nameOf(accountId)
|
||||
accountId && api.query['nicks']?.['nameOf']
|
||||
? api.query['nicks']['nameOf'](accountId)
|
||||
: of(undefined)
|
||||
) as Observable<Option<ITuple<[Bytes, Balance]>> | undefined>).pipe(
|
||||
map((nameOf): string | undefined =>
|
||||
nameOf?.isSome
|
||||
? u8aToString(nameOf.unwrap()[0]).substring(0, (api.consts.nicks.maxLength as u32).toNumber())
|
||||
? u8aToString(nameOf.unwrap()[0]).substring(0, (api.consts['nicks']['maxLength'] as u32).toNumber())
|
||||
: undefined
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { QueryableStorage } from '@polkadot/api-base/types';
|
||||
import type { DeriveApi } from '../types.js';
|
||||
|
||||
export function getQueryInterface (api: DeriveApi): QueryableStorage<'rxjs'>['voterBagsList'] {
|
||||
export function getQueryInterface (api: DeriveApi): DeriveApi['query']['voterList'] {
|
||||
return (
|
||||
// latest substrate (latest always first)
|
||||
api.query.voterBagsList ||
|
||||
// latest substrate & polkadot
|
||||
api.query.voterList ||
|
||||
// previous substrate
|
||||
api.query.bagsList ||
|
||||
// latest polkadot
|
||||
api.query.voterList
|
||||
api.query['voterBagsList'] ||
|
||||
api.query['bagsList']
|
||||
);
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ function calcBalances (api: DeriveApi, [accountId, [accountNonce, [primary, ...a
|
||||
// old
|
||||
function queryBalancesFree (api: DeriveApi, accountId: AccountId): Observable<Result> {
|
||||
return combineLatest([
|
||||
api.query.balances.freeBalance<Balance>(accountId),
|
||||
api.query.balances.reservedBalance<Balance>(accountId),
|
||||
api.query.system.accountNonce<Index>(accountId)
|
||||
api.query.balances['freeBalance']<Balance>(accountId),
|
||||
api.query.balances['reservedBalance']<Balance>(accountId),
|
||||
api.query.system['accountNonce']<Index>(accountId)
|
||||
]).pipe(
|
||||
map(([freeBalance, reservedBalance, accountNonce]): Result => [
|
||||
accountNonce,
|
||||
@@ -71,8 +71,8 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable<Resul
|
||||
? api.query.system.account(accountId).pipe(
|
||||
map(({ nonce }) => fill(nonce))
|
||||
)
|
||||
: isFunction(api.query.system.accountNonce)
|
||||
? api.query.system.accountNonce<Index>(accountId).pipe(
|
||||
: isFunction(api.query.system['accountNonce'])
|
||||
? api.query.system['accountNonce']<Index>(accountId).pipe(
|
||||
map((nonce) => fill(nonce))
|
||||
)
|
||||
: of(fill(api.registry.createType('Index')));
|
||||
@@ -80,7 +80,7 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable<Resul
|
||||
|
||||
function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
|
||||
const balances = modules
|
||||
.map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m]?.account)
|
||||
.map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m as 'balances']?.account)
|
||||
.filter((q) => isFunction(q));
|
||||
|
||||
const extract = (nonce: Index, data: AccountData[]): Result => [
|
||||
@@ -98,7 +98,7 @@ function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: st
|
||||
map(([{ nonce }, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
|
||||
)
|
||||
: combineLatest([
|
||||
api.query.system.accountNonce<Index>(accountId),
|
||||
api.query.system['accountNonce']<Index>(accountId),
|
||||
...balances.map((c) => c(accountId))
|
||||
]).pipe(
|
||||
map(([nonce, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
|
||||
@@ -164,7 +164,7 @@ export function account (instanceId: string, api: DeriveApi): (address: AccountI
|
||||
? querySystemAccount(api, accountId)
|
||||
: isFunction(api.query.balances?.account)
|
||||
? queryBalancesAccount(api, accountId)
|
||||
: isFunction(api.query.balances?.freeBalance)
|
||||
: isFunction(api.query.balances?.['freeBalance'])
|
||||
? queryBalancesFree(api, accountId)
|
||||
: queryNonceOnly(api, accountId)
|
||||
])
|
||||
|
||||
@@ -116,7 +116,7 @@ function calcBalances (api: DeriveApi, result: Result): DeriveBalancesAll {
|
||||
function queryOld (api: DeriveApi, accountId: AccountId | string): Observable<ResultBalance> {
|
||||
return combineLatest([
|
||||
api.query.balances.locks(accountId),
|
||||
api.query.balances.vesting<Option<VestingSchedule>>(accountId)
|
||||
api.query.balances['vesting']<Option<VestingSchedule>>(accountId)
|
||||
]).pipe(
|
||||
map(([locks, optVesting]): ResultBalance => {
|
||||
let vestingNew = null;
|
||||
|
||||
@@ -42,11 +42,11 @@ function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs
|
||||
|
||||
if (loggedAuthor) {
|
||||
// use the author mapping pallet, if available (ie: moonbeam, moonriver), to map session (nimbus) key to author (collator/validator) key
|
||||
if (queryAt.authorMapping?.mappingWithDeposit) {
|
||||
if (queryAt['authorMapping']?.['mappingWithDeposit']) {
|
||||
return combineLatest([
|
||||
of(header),
|
||||
validators,
|
||||
queryAt.authorMapping.mappingWithDeposit<OptionMapping>(loggedAuthor).pipe(
|
||||
queryAt['authorMapping']['mappingWithDeposit']<OptionMapping>(loggedAuthor).pipe(
|
||||
map((o) =>
|
||||
o.unwrapOr({ account: null }).account
|
||||
)
|
||||
@@ -55,13 +55,13 @@ function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs
|
||||
}
|
||||
|
||||
// fall back to session and parachain staking pallets, if available (ie: manta, calamari), to map session (nimbus) key to author (collator) key
|
||||
if (queryAt.parachainStaking?.selectedCandidates && queryAt.session?.nextKeys) {
|
||||
if (queryAt['parachainStaking']?.['selectedCandidates'] && queryAt.session?.nextKeys) {
|
||||
const loggedHex = loggedAuthor.toHex();
|
||||
|
||||
return combineLatest([
|
||||
of(header),
|
||||
validators,
|
||||
queryAt.parachainStaking.selectedCandidates<Vec<AccountId>>().pipe(
|
||||
queryAt['parachainStaking']['selectedCandidates']<Vec<AccountId>>().pipe(
|
||||
mergeMap((selectedCandidates) =>
|
||||
combineLatest([
|
||||
of(selectedCandidates),
|
||||
|
||||
@@ -15,18 +15,18 @@ type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN, BN];
|
||||
function queryConstants (api: DeriveApi): Observable<ResultV2> {
|
||||
return of([
|
||||
// deprecated
|
||||
api.consts.contracts.callBaseFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts.contractFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts.creationFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts.transactionBaseFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts.transactionByteFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts.transferFee || api.registry.createType('Balance'),
|
||||
api.consts.contracts['callBaseFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['contractFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['creationFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['transactionBaseFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['transactionByteFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['transferFee'] || api.registry.createType('Balance'),
|
||||
|
||||
// current
|
||||
api.consts.contracts.rentByteFee,
|
||||
api.consts.contracts.rentDepositOffset,
|
||||
api.consts.contracts.surchargeReward,
|
||||
api.consts.contracts.tombstoneDeposit
|
||||
api.consts.contracts['rentByteFee'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['rentDepositOffset'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['surchargeReward'] || api.registry.createType('Balance'),
|
||||
api.consts.contracts['tombstoneDeposit'] || api.registry.createType('Balance')
|
||||
]) as unknown as Observable<ResultV2>;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,22 +21,22 @@ function isVoter (value: VoteEntry): value is PalletElectionsPhragmenVoter {
|
||||
}
|
||||
|
||||
function retrieveStakeOf (elections: QueryableModuleStorage<'rxjs'>): Observable<[AccountId, Balance][]> {
|
||||
return elections.stakeOf.entries<Balance, [AccountId]>().pipe(
|
||||
return elections['stakeOf'].entries<Balance, [AccountId]>().pipe(
|
||||
map((entries) =>
|
||||
entries.map(([{ args: [accountId] }, stake]) => [accountId, stake])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function retrieveVoteOf (elections: QueryableModuleStorage<'rxjs'>): Observable<[AccountId, AccountId[]][]> {
|
||||
return elections.votesOf.entries<Vec<AccountId>, [AccountId]>().pipe(
|
||||
function retrieveVoteOf (elections: DeriveApi['query']['elections']): Observable<[AccountId, AccountId[]][]> {
|
||||
return elections['votesOf'].entries<Vec<AccountId>, [AccountId]>().pipe(
|
||||
map((entries) =>
|
||||
entries.map(([{ args: [accountId] }, votes]) => [accountId, votes])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function retrievePrev (api: DeriveApi, elections: QueryableModuleStorage<'rxjs'>): Observable<DeriveCouncilVotes> {
|
||||
function retrievePrev (api: DeriveApi, elections: DeriveApi['query']['elections']): Observable<DeriveCouncilVotes> {
|
||||
return combineLatest([
|
||||
retrieveStakeOf(elections),
|
||||
retrieveVoteOf(elections)
|
||||
@@ -63,7 +63,7 @@ function retrievePrev (api: DeriveApi, elections: QueryableModuleStorage<'rxjs'>
|
||||
);
|
||||
}
|
||||
|
||||
function retrieveCurrent (elections: QueryableModuleStorage<'rxjs'>): Observable<DeriveCouncilVotes> {
|
||||
function retrieveCurrent (elections: DeriveApi['query']['elections']): Observable<DeriveCouncilVotes> {
|
||||
return elections.voting.entries<VoteEntry, [AccountId]>().pipe(
|
||||
map((entries): DeriveCouncilVotes =>
|
||||
entries.map(([{ args: [accountId] }, value]): [AccountId, DeriveCouncilVote] => [
|
||||
@@ -77,11 +77,11 @@ function retrieveCurrent (elections: QueryableModuleStorage<'rxjs'>): Observable
|
||||
}
|
||||
|
||||
export function votes (instanceId: string, api: DeriveApi): () => Observable<DeriveCouncilVotes> {
|
||||
const elections = api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections;
|
||||
const elections = api.query.elections || api.query['phragmenElection'] || api.query['electionsPhragmen'];
|
||||
|
||||
return memo(instanceId, (): Observable<DeriveCouncilVotes> =>
|
||||
elections
|
||||
? elections.stakeOf
|
||||
? elections['stakeOf']
|
||||
? retrievePrev(api, elections)
|
||||
: retrieveCurrent(elections)
|
||||
: of([])
|
||||
|
||||
@@ -35,7 +35,7 @@ function createChildKey (info: AllInfo): string {
|
||||
|
||||
export function childKey (instanceId: string, api: DeriveApi): (paraId: string | number | BN) => Observable<string | null> {
|
||||
return memo(instanceId, (paraId: string | number | BN): Observable<string | null> =>
|
||||
api.query.crowdloan.funds<Option<PolkadotRuntimeCommonCrowdloanFundInfo>>(paraId).pipe(
|
||||
api.query['crowdloan']['funds']<Option<PolkadotRuntimeCommonCrowdloanFundInfo>>(paraId).pipe(
|
||||
map((optInfo) =>
|
||||
optInfo.isSome
|
||||
? createChildKey(optInfo.unwrap())
|
||||
|
||||
@@ -53,7 +53,7 @@ function isBounded (call: FrameSupportPreimagesBounded | FrameSupportScheduleMay
|
||||
}
|
||||
|
||||
function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
|
||||
return api.query.democracy.dispatchQueue<Vec<ITuple<[BlockNumber, Hash, ReferendumIndex]>>>().pipe(
|
||||
return api.query.democracy['dispatchQueue']<Vec<ITuple<[BlockNumber, Hash, ReferendumIndex]>>>().pipe(
|
||||
switchMap((dispatches) =>
|
||||
combineLatest([
|
||||
of(dispatches),
|
||||
@@ -142,7 +142,7 @@ export function dispatchQueue (instanceId: string, api: DeriveApi): () => Observ
|
||||
return memo(instanceId, (): Observable<DeriveDispatch[]> =>
|
||||
isFunction(api.query.scheduler?.agenda)
|
||||
? queryScheduler(api)
|
||||
: api.query.democracy.dispatchQueue
|
||||
: api.query.democracy['dispatchQueue']
|
||||
? queryQueue(api)
|
||||
: of([])
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
|
||||
type OldPreimage = ITuple<PreimageInfo>;
|
||||
|
||||
function isDemocracyPreimage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): imageOpt is Option<PreimageStatus> {
|
||||
return !!imageOpt && !api.query.democracy.dispatchQueue;
|
||||
return !!imageOpt && !api.query.democracy['dispatchQueue'];
|
||||
}
|
||||
|
||||
function constructProposal (api: DeriveApi, [bytes, proposer, balance, at]: PreimageInfo): DeriveProposalImage {
|
||||
@@ -79,7 +79,7 @@ function parseImage (api: DeriveApi, [proposalHash, status, bytes]: [HexString,
|
||||
function getDemocracyImages (api: DeriveApi, bounded: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> {
|
||||
const hashes = bounded.map((b) => getImageHashBounded(b));
|
||||
|
||||
return api.query.democracy.preimages.multi<Option<PreimageStatus>>(hashes).pipe(
|
||||
return api.query.democracy['preimages'].multi<Option<PreimageStatus>>(hashes).pipe(
|
||||
map((images): (DeriveProposalImage | undefined)[] =>
|
||||
images.map((imageOpt) => parseDemocracy(api, imageOpt))
|
||||
)
|
||||
@@ -127,7 +127,7 @@ function getImages (api: DeriveApi, bounded: (FrameSupportPreimagesBounded | Uin
|
||||
export function preimages (instanceId: string, api: DeriveApi): (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]) => Observable<(DeriveProposalImage | undefined)[]> {
|
||||
return memo(instanceId, (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> =>
|
||||
hashes.length
|
||||
? isFunction(api.query.democracy.preimages)
|
||||
? isFunction(api.query.democracy['preimages'])
|
||||
? getDemocracyImages(api, hashes)
|
||||
: isFunction(api.query.preimage.preimageFor)
|
||||
? getImages(api, hashes)
|
||||
|
||||
@@ -23,7 +23,6 @@ type Result = [Proposals, (DeriveProposalImage | undefined)[], Depositors[]];
|
||||
|
||||
function isNewDepositors (depositors: ITuple<[Vec<AccountId>, Balance]> | ITuple<[Balance, Vec<AccountId>]>): depositors is ITuple<[Vec<AccountId>, Balance]> {
|
||||
// Detect balance...
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
return isFunction((depositors[1] as Balance).mul);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ type VotingDirect = PalletDemocracyVoteVoting['asDirect'];
|
||||
type VotingDirectVote = VotingDirect['votes'][0];
|
||||
|
||||
function votesPrev (api: DeriveApi, referendumId: BN): Observable<DeriveReferendumVote[]> {
|
||||
return api.query.democracy.votersFor<Vec<AccountId>>(referendumId).pipe(
|
||||
return api.query.democracy['votersFor']<Vec<AccountId>>(referendumId).pipe(
|
||||
switchMap((votersFor): Observable<[Vec<AccountId>, Vote[], DeriveBalancesAccount[]]> =>
|
||||
combineLatest([
|
||||
of(votersFor),
|
||||
votersFor.length
|
||||
? api.query.democracy.voteOf.multi<Vote>(
|
||||
? api.query.democracy['voteOf'].multi<Vote>(
|
||||
votersFor.map((accountId): [BN | number, AccountId] =>
|
||||
[referendumId, accountId]
|
||||
)
|
||||
|
||||
@@ -47,20 +47,22 @@ function sortAccounts ([, balanceA]: [AccountId32, Balance], [, balanceB]: [Acco
|
||||
function getConstants (api: DeriveApi, elections: string | null): Partial<DeriveElectionsInfo> {
|
||||
return elections
|
||||
? {
|
||||
candidacyBond: api.consts[elections].candidacyBond as Balance,
|
||||
desiredRunnersUp: api.consts[elections].desiredRunnersUp as u32,
|
||||
desiredSeats: api.consts[elections].desiredMembers as u32,
|
||||
termDuration: api.consts[elections].termDuration as BlockNumber,
|
||||
votingBond: api.consts[elections].votingBond as Balance
|
||||
candidacyBond: api.consts[elections as 'elections'].candidacyBond as Balance,
|
||||
desiredRunnersUp: api.consts[elections as 'elections'].desiredRunnersUp as u32,
|
||||
desiredSeats: api.consts[elections as 'elections'].desiredMembers as u32,
|
||||
termDuration: api.consts[elections as 'elections'].termDuration as BlockNumber,
|
||||
votingBond: api.consts[elections as 'elections']['votingBond'] as Balance,
|
||||
votingBondBase: api.consts[elections as 'elections'].votingBondBase as Balance,
|
||||
votingBondFactor: api.consts[elections as 'elections'].votingBondFactor as Balance
|
||||
}
|
||||
: {};
|
||||
}
|
||||
|
||||
function getModules (api: DeriveApi): [string, string | null] {
|
||||
const [council] = api.registry.getModuleInstances(api.runtimeVersion.specName, 'council') || ['council'];
|
||||
const elections = api.query.phragmenElection
|
||||
const elections = api.query['phragmenElection']
|
||||
? 'phragmenElection'
|
||||
: api.query.electionsPhragmen
|
||||
: api.query['electionsPhragmen']
|
||||
? 'electionsPhragmen'
|
||||
: api.query.elections
|
||||
? 'elections'
|
||||
@@ -72,9 +74,9 @@ function getModules (api: DeriveApi): [string, string | null] {
|
||||
function queryAll (api: DeriveApi, council: string, elections: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> {
|
||||
return api.queryMulti<[Vec<AccountId32>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([
|
||||
api.query[council as 'council'].members,
|
||||
api.query[elections as 'phragmenElection'].candidates,
|
||||
api.query[elections as 'phragmenElection'].members,
|
||||
api.query[elections as 'phragmenElection'].runnersUp
|
||||
api.query[elections as 'elections'].candidates,
|
||||
api.query[elections as 'elections'].members,
|
||||
api.query[elections as 'elections'].runnersUp
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,6 @@ export interface DeriveElectionsInfo {
|
||||
voteCount?: VoteIndex;
|
||||
voterCount?: SetIndex;
|
||||
votingBond?: Balance;
|
||||
votingBondBase?: Balance;
|
||||
votingBondFactor?: Balance;
|
||||
}
|
||||
|
||||
@@ -75,16 +75,16 @@ function parse (id: ParaId, [active, retryQueue, selectedThreads, didUpdate, inf
|
||||
|
||||
export function info (instanceId: string, api: DeriveApi): (id: ParaId | number) => Observable<DeriveParachainFull | null> {
|
||||
return memo(instanceId, (id: ParaId | number): Observable<DeriveParachainFull | null> =>
|
||||
api.query.registrar && api.query.parachains
|
||||
api.query['registrar'] && api.query['parachains']
|
||||
? api.queryMulti<Result>([
|
||||
api.query.registrar.active,
|
||||
api.query.registrar.retryQueue,
|
||||
api.query.registrar.selectedThreads,
|
||||
api.query.parachains.didUpdate,
|
||||
[api.query.registrar.paras, id],
|
||||
[api.query.registrar.pendingSwap, id],
|
||||
[api.query.parachains.heads, id],
|
||||
[api.query.parachains.relayDispatchQueue, id]
|
||||
api.query['registrar']['active'],
|
||||
api.query['registrar']['retryQueue'],
|
||||
api.query['registrar']['selectedThreads'],
|
||||
api.query['parachains']['didUpdate'],
|
||||
[api.query['registrar']['paras'], id],
|
||||
[api.query['registrar']['pendingSwap'], id],
|
||||
[api.query['parachains']['heads'], id],
|
||||
[api.query['parachains']['relayDispatchQueue'], id]
|
||||
])
|
||||
.pipe(
|
||||
map((result: Result): DeriveParachainFull | null =>
|
||||
|
||||
@@ -16,12 +16,12 @@ import { didUpdateToBool } from './util.js';
|
||||
type Result = [
|
||||
ParaId[],
|
||||
DidUpdate,
|
||||
RelayDispatchQueueSize[],
|
||||
ParaInfoResult[],
|
||||
PendingSwap[],
|
||||
RelayDispatchQueueSize[]
|
||||
PendingSwap[]
|
||||
];
|
||||
|
||||
function parse ([ids, didUpdate, infos, pendingSwaps, relayDispatchQueueSizes]: Result): DeriveParachain[] {
|
||||
function parse ([ids, didUpdate, relayDispatchQueueSizes, infos, pendingSwaps]: Result): DeriveParachain[] {
|
||||
return ids.map((id, index): DeriveParachain => ({
|
||||
didUpdate: didUpdateToBool(didUpdate, id),
|
||||
id,
|
||||
@@ -33,15 +33,15 @@ function parse ([ids, didUpdate, infos, pendingSwaps, relayDispatchQueueSizes]:
|
||||
|
||||
export function overview (instanceId: string, api: DeriveApi): () => Observable<DeriveParachain[]> {
|
||||
return memo(instanceId, (): Observable<DeriveParachain[]> =>
|
||||
api.query.registrar?.parachains && api.query.parachains
|
||||
? api.query.registrar.parachains<ParaId[]>().pipe(
|
||||
api.query['registrar']?.['parachains'] && api.query['parachains']
|
||||
? api.query['registrar']['parachains']<ParaId[]>().pipe(
|
||||
switchMap((paraIds) =>
|
||||
combineLatest([
|
||||
of(paraIds),
|
||||
api.query.parachains.didUpdate<DidUpdate>(),
|
||||
api.query.registrar.paras.multi<ParaInfoResult>(paraIds),
|
||||
api.query.registrar.pendingSwap.multi<PendingSwap>(paraIds),
|
||||
api.query.parachains.relayDispatchQueueSize.multi<RelayDispatchQueueSize>(paraIds)
|
||||
api.query['parachains']['didUpdate']<DidUpdate>(),
|
||||
api.query['parachains']['relayDispatchQueueSize'].multi<RelayDispatchQueueSize>(paraIds),
|
||||
api.query['registrar']['paras'].multi<ParaInfoResult>(paraIds),
|
||||
api.query['registrar']['pendingSwap'].multi<PendingSwap>(paraIds)
|
||||
])
|
||||
),
|
||||
map(parse)
|
||||
|
||||
@@ -19,7 +19,7 @@ export function erasHistoric (instanceId: string, api: DeriveApi): (withActive?:
|
||||
api.query.staking.activeEra(),
|
||||
api.consts.staking.historyDepth
|
||||
? of(api.consts.staking.historyDepth)
|
||||
: api.query.staking.historyDepth<u32>()
|
||||
: api.query.staking['historyDepth']<u32>()
|
||||
]).pipe(
|
||||
map(([activeEraOpt, historyDepth]): EraIndex[] => {
|
||||
const result: EraIndex[] = [];
|
||||
|
||||
@@ -38,8 +38,8 @@ export function keysMulti (instanceId: string, api: DeriveApi): (stashIds: (Uint
|
||||
switchMap((queuedKeys) =>
|
||||
combineLatest([
|
||||
of(queuedKeys),
|
||||
api.consts.session?.dedupKeyPrefix
|
||||
? api.query.session.nextKeys.multi(stashIds.map((s) => [api.consts.session.dedupKeyPrefix, s]))
|
||||
api.consts['session']?.['dedupKeyPrefix']
|
||||
? api.query.session.nextKeys.multi(stashIds.map((s) => [api.consts['session']['dedupKeyPrefix'], s]))
|
||||
: combineLatest(stashIds.map((s) => api.query.session.nextKeys(s)))
|
||||
])
|
||||
),
|
||||
|
||||
@@ -18,7 +18,7 @@ export function nextElected (instanceId: string, api: DeriveApi): () => Observab
|
||||
switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)),
|
||||
map((keys) => keys.map(({ args: [, accountId] }) => accountId))
|
||||
)
|
||||
: api.query.staking.currentElected<AccountId[]>()
|
||||
: api.query.staking['currentElected']<AccountId[]>()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { ApiPromise } from '@polkadot/api';
|
||||
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
|
||||
import type { Codec, Constructor, InterfaceTypes, Registry } from '@polkadot/types/types';
|
||||
import type { Codec, CodecClass, InterfaceTypes, Registry } from '@polkadot/types/types';
|
||||
|
||||
import { Option, StorageKey } from '@polkadot/types';
|
||||
|
||||
@@ -29,7 +29,7 @@ export class BountyFactory {
|
||||
this.#registry.createType('Bounty');
|
||||
|
||||
public optionOf = <T extends Codec>(value: T): Option<T> => {
|
||||
const typeName = this.#registry.getClassName(value.constructor as Constructor<T>);
|
||||
const typeName = this.#registry.getClassName(value.constructor as CodecClass<T>);
|
||||
|
||||
return new Option<T>(this.#registry, typeName as keyof InterfaceTypes, value);
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"@polkadot/api-augment": "10.8.1",
|
||||
"@polkadot/api-base": "10.8.1",
|
||||
"@polkadot/api-derive": "10.8.1",
|
||||
"@polkadot/keyring": "^12.2.2",
|
||||
"@polkadot/keyring": "^12.3.1",
|
||||
"@polkadot/rpc-augment": "10.8.1",
|
||||
"@polkadot/rpc-core": "10.8.1",
|
||||
"@polkadot/rpc-provider": "10.8.1",
|
||||
@@ -33,8 +33,8 @@
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/types-create": "10.8.1",
|
||||
"@polkadot/types-known": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"eventemitter3": "^5.0.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/api-augment';
|
||||
@@ -404,7 +404,10 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
const decorateFn = (section: string, method: string): unknown => {
|
||||
const source = rpc[section as 'chain'][method as 'getHeader'];
|
||||
const fn = decorateMethod(source, { methodName: method }) as Record<string, unknown>;
|
||||
const fn = decorateMethod(source, { methodName: method }) as {
|
||||
meta: unknown;
|
||||
raw: unknown;
|
||||
};
|
||||
|
||||
fn.meta = source.meta;
|
||||
fn.raw = decorateMethod(source.raw, { methodName: method }) as unknown;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import '@polkadot/api-augment';
|
||||
|
||||
import type { HeaderExtended } from '@polkadot/api-derive/types';
|
||||
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
import type { TestKeyringMapSubstrate } from '@polkadot/keyring/testingPairs';
|
||||
import type { StorageKey } from '@polkadot/types';
|
||||
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
|
||||
import type { FrameSystemAccountInfo } from '@polkadot/types/lookup';
|
||||
@@ -35,7 +35,7 @@ async function calls (api: ApiPromise): Promise<void> {
|
||||
function consts (api: ApiPromise): void {
|
||||
// constants has actual value & metadata
|
||||
console.log(
|
||||
api.consts.foo.bar,
|
||||
api.consts['notIn']['augmentation'],
|
||||
api.consts.balances.existentialDeposit.toNumber(),
|
||||
api.consts.balances.existentialDeposit.meta.docs.map((s) => s.toString()).join(''),
|
||||
api.consts.system.blockWeights.maxBlock.refTime.toNumber()
|
||||
@@ -59,10 +59,10 @@ function errors (api: ApiPromise): void {
|
||||
console.log(api.errors.vesting.AmountLow.is(someError));
|
||||
|
||||
// non-existing error, existing module
|
||||
console.log(api.errors.vesting.Something.is(someError));
|
||||
console.log(api.errors.vesting['NonAugmented'].is(someError));
|
||||
|
||||
// something random
|
||||
console.log(api.errors.something.Random.is(someError));
|
||||
console.log(api.errors['thisIsNot']['Augmented'].is(someError));
|
||||
}
|
||||
|
||||
function events (api: ApiPromise): void {
|
||||
@@ -97,20 +97,20 @@ function events (api: ApiPromise): void {
|
||||
}
|
||||
|
||||
// something random, just codec[]
|
||||
if (api.events.something.Random.is(event)) {
|
||||
if (api.events['not']['Augmented'].is(event)) {
|
||||
const [a, b] = event.data;
|
||||
|
||||
console.log(a.toHuman(), b.toHuman());
|
||||
}
|
||||
}
|
||||
|
||||
async function query (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
async function query (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
|
||||
const intentions = await api.query.staking.bonded();
|
||||
|
||||
console.log('intentions:', intentions);
|
||||
|
||||
// api.query.*.* is well-typed
|
||||
const bar = await api.query.foo.bar(); // bar is Codec (unknown module)
|
||||
const bar = await api.query['notIn']['augmentation'](); // bar is Codec (unknown module)
|
||||
const bal = await api.query.balances.totalIssuance(); // bal is Balance
|
||||
const bal2 = await api.query.balances.totalIssuance('WRONG_ARG'); // bal2 is Codec (wrong args)
|
||||
const override = await api.query.balances.totalIssuance<Header>(); // override is still available
|
||||
@@ -119,7 +119,7 @@ async function query (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const oldBal = await api.query.balances.totalIssuance.at('abcd');
|
||||
|
||||
// For older queries we can cast with `<Balance>` (newer chain have multi typed)
|
||||
const multia = await api.query.balances.freeBalance.multi<Balance>([pairs.alice.address, pairs.bob.address]);
|
||||
const multia = await api.query.balances['freeBalance'].multi<Balance>([pairs.alice.address, pairs.bob.address]);
|
||||
const multib = await api.query.system.account.multi([pairs.alice.address, pairs.bob.address]);
|
||||
|
||||
await api.query.system.account(pairs.alice.address);
|
||||
@@ -157,7 +157,7 @@ async function queryExtra (api: ApiPromise): Promise<void> {
|
||||
await api.query.assets.approvals.keys(123, 'blah');
|
||||
await api.query.assets.account.keys(123);
|
||||
await api.query.assets.account.entries(123);
|
||||
await api.query.assets.blah.keys();
|
||||
await api.query.assets['notAugmented'].keys();
|
||||
|
||||
// is
|
||||
const key = {} as StorageKey;
|
||||
@@ -170,7 +170,7 @@ async function queryExtra (api: ApiPromise): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function queryMulti (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
async function queryMulti (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
|
||||
// check multi for unsub
|
||||
const multiUnsub = await api.queryMulti([
|
||||
[api.query.staking.validators],
|
||||
@@ -185,7 +185,7 @@ async function queryMulti (api: ApiPromise, pairs: TestKeyringMap): Promise<void
|
||||
const multiRes = await api.queryMulti([
|
||||
[api.query.system.account, pairs.eve.address],
|
||||
// older chains only
|
||||
[api.query.system.accountNonce, pairs.eve.address]
|
||||
[api.query.system['accountNonce'], pairs.eve.address]
|
||||
]);
|
||||
|
||||
console.log(multiRes);
|
||||
@@ -241,7 +241,7 @@ function types (api: ApiPromise): void {
|
||||
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, u32.toNumber(), f32.toNumber(), api.createType('AccountData'), raw.subarray(0, 10));
|
||||
}
|
||||
|
||||
async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
async function tx (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
|
||||
// transfer, also allows for bigint inputs here
|
||||
const transfer = api.tx.balances.transfer(pairs.bob.address, BigInt(123456789));
|
||||
|
||||
@@ -251,7 +251,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
console.log('hash:', (await transfer.signAndSend(pairs.alice)).toHex());
|
||||
|
||||
// passing options, but waiting for hash
|
||||
const nonce = await api.query.system.accountNonce<Index>(pairs.alice.address);
|
||||
const nonce = await api.query.system['accountNonce']<Index>(pairs.alice.address);
|
||||
|
||||
(await api.tx.balances
|
||||
.transfer(pairs.bob.address, 12345)
|
||||
@@ -264,7 +264,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
.signAndSend(pairs.alice, ({ status }: SubmittableResult) => console.log(status.type));
|
||||
|
||||
// with options and the callback
|
||||
const nonce2 = await api.query.system.accountNonce(pairs.alice.address);
|
||||
const nonce2 = await api.query.system['accountNonce'](pairs.alice.address);
|
||||
const unsub2 = await api.tx.balances
|
||||
.transfer(pairs.bob.address, 12345)
|
||||
.signAndSend(pairs.alice, { nonce: nonce2 }, ({ status }: SubmittableResult): void => {
|
||||
@@ -280,7 +280,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
await second.signAndSend('123', (result) => console.log(result));
|
||||
|
||||
// it handles enum inputs correctly
|
||||
await api.tx.democracy.proxyVote(123, { Split: { nay: 456, yay: 123 } }).signAndSend(pairs.alice);
|
||||
await api.tx.democracy['proxyVote'](123, { Split: { nay: 456, yay: 123 } }).signAndSend(pairs.alice);
|
||||
|
||||
// is
|
||||
if (api.tx.balances.transfer.is(second)) {
|
||||
@@ -295,7 +295,7 @@ async function at (api: ApiPromise): Promise<void> {
|
||||
const apiAt = await api.at('0x1234');
|
||||
|
||||
// get old balances
|
||||
console.log(await apiAt.query.balances.freeBalance('0x1234'));
|
||||
console.log(await apiAt.query.balances['freeBalance']('0x1234'));
|
||||
|
||||
// get some constants
|
||||
console.log(apiAt.consts.balances.existentialDeposit);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
|
||||
import type { Callback, Codec, Constructor, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
|
||||
import type { Callback, Codec, CodecClass, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
|
||||
import type { Registry } from '@polkadot/types-codec/types';
|
||||
import type { ApiBase } from '../base/index.js';
|
||||
import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js';
|
||||
@@ -83,7 +83,7 @@ function optionsOrNonce (partialOptions: Partial<SignerOptions> = {}): Partial<S
|
||||
: partialOptions;
|
||||
}
|
||||
|
||||
export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): Constructor<SubmittableExtrinsic<ApiType>> {
|
||||
export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): CodecClass<SubmittableExtrinsic<ApiType>> {
|
||||
// an instance of the base extrinsic for us to extend
|
||||
const ExtrinsicBase = api.registry.createClass('Extrinsic');
|
||||
|
||||
|
||||
@@ -18,55 +18,55 @@ describe('extractStorageArgs', (): void => {
|
||||
|
||||
it('validates no-arg plain', (): void => {
|
||||
expect(
|
||||
extractStorageArgs(registry, storage.timestamp.now, [])
|
||||
).toEqual([storage.timestamp.now, []]);
|
||||
extractStorageArgs(registry, storage['timestamp']['now'], [])
|
||||
).toEqual([storage['timestamp']['now'], []]);
|
||||
});
|
||||
|
||||
it('validates no-arg plain (with undefined, undefined)', (): void => {
|
||||
expect(
|
||||
extractStorageArgs(registry, storage.timestamp.now, [undefined, undefined])
|
||||
).toEqual([storage.timestamp.now, []]);
|
||||
extractStorageArgs(registry, storage['timestamp']['now'], [undefined, undefined])
|
||||
).toEqual([storage['timestamp']['now'], []]);
|
||||
});
|
||||
|
||||
it('validates no-arg plain (failing when there are args)', (): void => {
|
||||
expect(
|
||||
() => extractStorageArgs(registry, storage.timestamp.now, [123, 456])
|
||||
() => extractStorageArgs(registry, storage['timestamp']['now'], [123, 456])
|
||||
).toThrow('timestamp.now() does not take any arguments, 2 found');
|
||||
});
|
||||
|
||||
it('validates map, 1 arg', (): void => {
|
||||
expect(
|
||||
extractStorageArgs(registry, storage.staking.payee, ['abc'])
|
||||
).toEqual([storage.staking.payee, ['abc']]);
|
||||
extractStorageArgs(registry, storage['staking']['payee'], ['abc'])
|
||||
).toEqual([storage['staking']['payee'], ['abc']]);
|
||||
});
|
||||
|
||||
it('validates map, 1 arg (failing with no args)', (): void => {
|
||||
expect(
|
||||
() => extractStorageArgs(registry, storage.staking.payee, [])
|
||||
() => extractStorageArgs(registry, storage['staking']['payee'], [])
|
||||
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 0 found');
|
||||
});
|
||||
|
||||
it('validates map, 1 arg (failing with more args)', (): void => {
|
||||
expect(
|
||||
() => extractStorageArgs(registry, storage.staking.payee, ['abc', 'def'])
|
||||
() => extractStorageArgs(registry, storage['staking']['payee'], ['abc', 'def'])
|
||||
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 2 found');
|
||||
});
|
||||
|
||||
it('validates doublemap, 2 args', (): void => {
|
||||
expect(
|
||||
extractStorageArgs(registry, storage.staking.erasStakers, [1, '0x1234'])
|
||||
).toEqual([storage.staking.erasStakers, [1, '0x1234']]);
|
||||
extractStorageArgs(registry, storage['staking']['erasStakers'], [1, '0x1234'])
|
||||
).toEqual([storage['staking']['erasStakers'], [1, '0x1234']]);
|
||||
});
|
||||
|
||||
it('validates doublemap, 2 args (failing with no args)', (): void => {
|
||||
expect(
|
||||
() => extractStorageArgs(registry, storage.staking.erasStakers, [])
|
||||
() => extractStorageArgs(registry, storage['staking']['erasStakers'], [])
|
||||
).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 0 found');
|
||||
});
|
||||
|
||||
it('validates doublemap, 2 args (failing with 1 arg)', (): void => {
|
||||
expect(
|
||||
() => extractStorageArgs(registry, storage.staking.erasStakers, [123])
|
||||
() => extractStorageArgs(registry, storage['staking']['erasStakers'], [123])
|
||||
).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 1 found');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"**/test/**/*"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../api-derive/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"@polkadot/rpc-core": "10.8.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
"@polkadot/rpc-augment": "10.8.1",
|
||||
"@polkadot/rpc-provider": "10.8.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^12.2.2",
|
||||
"@polkadot/keyring": "^12.3.1",
|
||||
"@polkadot/rpc-augment": "10.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('Api', (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
expect(isFunction((rpc as unknown as Record<string, Record<string, boolean>>).testing.foo)).toBe(true);
|
||||
expect(isFunction((rpc as unknown as { testing: { foo: boolean } }).testing.foo)).toBe(true);
|
||||
expect(rpc.sections.includes('testing')).toBe(true);
|
||||
expect(rpc.mapping.get('testing_foo')).toEqual({
|
||||
description: 'foo',
|
||||
|
||||
@@ -13,7 +13,7 @@ import { RpcCore } from './index.js';
|
||||
describe('methodSend', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
let rpc: RpcCore;
|
||||
let methods: Record<string, DefinitionRpc>;
|
||||
let methods: { blah: DefinitionRpc; bleh: DefinitionRpc };
|
||||
let provider: ProviderInterface;
|
||||
|
||||
beforeEach((): void => {
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
"version": "10.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/keyring": "^12.2.2",
|
||||
"@polkadot/keyring": "^12.3.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-support": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/x-fetch": "^12.2.2",
|
||||
"@polkadot/x-global": "^12.2.2",
|
||||
"@polkadot/x-ws": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"@polkadot/x-fetch": "^12.3.1",
|
||||
"@polkadot/x-global": "^12.3.1",
|
||||
"@polkadot/x-ws": "^12.3.1",
|
||||
"eventemitter3": "^5.0.1",
|
||||
"mock-socket": "^9.2.1",
|
||||
"nock": "^13.3.1",
|
||||
|
||||
@@ -36,7 +36,7 @@ describe.skip('send', (): void => {
|
||||
return http
|
||||
.send('test_body', ['param'])
|
||||
.then((): void => {
|
||||
expect(mock.body.test_body).toEqual({
|
||||
expect(mock.body['test_body']).toEqual({
|
||||
id: 1,
|
||||
jsonrpc: '2.0',
|
||||
method: 'test_body',
|
||||
|
||||
@@ -202,11 +202,11 @@ export class MockProvider implements ProviderInterface {
|
||||
|
||||
// increment the balances and nonce for each account
|
||||
keyring.getPairs().forEach(({ publicKey }, index): void => {
|
||||
this.setStateBn(query.system.account(publicKey), newHead.number.toBn().addn(index));
|
||||
this.setStateBn(query['system']['account'](publicKey), newHead.number.toBn().addn(index));
|
||||
});
|
||||
|
||||
// set the timestamp for the current block
|
||||
this.setStateBn(query.timestamp.now(), Math.floor(Date.now() / 1000));
|
||||
this.setStateBn(query['timestamp']['now'](), Math.floor(Date.now() / 1000));
|
||||
this.updateSubs('chain_subscribeNewHead', newHead);
|
||||
|
||||
// We emit connected/disconnected at intervals
|
||||
|
||||
@@ -17,10 +17,19 @@ export interface Mock {
|
||||
|
||||
export type MockStateSubscriptionCallback = (error: Error | null, value: any) => void;
|
||||
|
||||
export type MockStateSubscriptions = Record<string, {
|
||||
export interface MockStateSubscription {
|
||||
callbacks: Record<number, MockStateSubscriptionCallback>;
|
||||
lastValue: any;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface MockStateSubscriptions {
|
||||
// known
|
||||
chain_subscribeNewHead: MockStateSubscription;
|
||||
state_subscribeStorage: MockStateSubscription;
|
||||
|
||||
// others
|
||||
[key: string]: MockStateSubscription;
|
||||
}
|
||||
|
||||
export type MockStateDb = Record<string, Uint8Array>;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Constructor } from '@polkadot/util/types';
|
||||
import type { Class } from '@polkadot/util/types';
|
||||
import type { EndpointStats, JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types.js';
|
||||
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
@@ -209,7 +209,7 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#endpointIndex = this.selectEndpointIndex(this.#endpoints);
|
||||
|
||||
// the as here is Deno-specific - not available on the globalThis
|
||||
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as unknown as Constructor<WebSocket>, WebSocket)
|
||||
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as unknown as Class<WebSocket>, WebSocket)
|
||||
? new WebSocket(this.endpoint)
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore - WS may be an instance of ws, which supports options
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/types-create": "10.8.1",
|
||||
"@polkadot/types-support": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/x-ws": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"@polkadot/x-ws": "^12.3.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"tslib": "^2.5.3",
|
||||
"yargs": "^17.7.2"
|
||||
|
||||
@@ -19,6 +19,13 @@ import { isString, stringify } from '@polkadot/util';
|
||||
import { createImports, exportInterface, initMeta, readTemplate, writeFile } from '../util/index.js';
|
||||
import { typeEncoders } from './tsDef.js';
|
||||
|
||||
// Record<string, >
|
||||
interface ParsedDef {
|
||||
_set: Record<string, number>;
|
||||
|
||||
[key: string]: string | Record<string, string> | Record<string, number>;
|
||||
}
|
||||
|
||||
const WITH_TYPEDEF = false;
|
||||
|
||||
const generateLookupDefsTmpl = Handlebars.compile(readTemplate('lookup/defs'));
|
||||
@@ -67,9 +74,9 @@ function expandSet (parsed: Record<string, number>): string[] {
|
||||
);
|
||||
}
|
||||
|
||||
function expandObject (parsed: Record<string, string | Record<string, string>>): string[] {
|
||||
function expandObject (parsed: ParsedDef): string[] {
|
||||
if (parsed._set) {
|
||||
return expandSet(parsed._set as unknown as Record<string, number>);
|
||||
return expandSet(parsed._set);
|
||||
}
|
||||
|
||||
return formatObject(
|
||||
@@ -78,7 +85,7 @@ function expandObject (parsed: Record<string, string | Record<string, string>>):
|
||||
? expandType(v)
|
||||
: Array.isArray(v)
|
||||
? [`[${(v as string[]).map((e) => `'${e}'`).join(', ')}]`]
|
||||
: expandObject(v);
|
||||
: expandObject(v as ParsedDef);
|
||||
|
||||
inner.forEach((l, index): void => {
|
||||
all.push(`${
|
||||
@@ -98,7 +105,7 @@ function expandType (encoded: string): string[] {
|
||||
return [`'${encoded}'`];
|
||||
}
|
||||
|
||||
return expandObject(JSON.parse(encoded) as Record<string, string | Record<string, string>>);
|
||||
return expandObject(JSON.parse(encoded) as ParsedDef);
|
||||
}
|
||||
|
||||
function expandDefToString ({ lookupNameRoot, type }: TypeDef, indent: number): string {
|
||||
|
||||
@@ -114,7 +114,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
|
||||
})
|
||||
.sort(compareName);
|
||||
|
||||
imports.typesTypes.Observable = true;
|
||||
imports.typesTypes['Observable'] = true;
|
||||
|
||||
return generateForMetaTemplate({
|
||||
headerType: 'chain',
|
||||
|
||||
@@ -126,7 +126,7 @@ export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Rec
|
||||
};
|
||||
}).concat(...Object.values(additional)).sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
imports.typesTypes.Observable = true;
|
||||
imports.typesTypes['Observable'] = true;
|
||||
|
||||
return generateRpcTypesTemplate({
|
||||
headerType: 'chain',
|
||||
|
||||
@@ -141,7 +141,7 @@ export function generateCallTypes (registry: Registry, meta: Metadata, dest: str
|
||||
}).filter(({ items }) => items.length).sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
if (modules.length) {
|
||||
imports.typesTypes.Observable = true;
|
||||
imports.typesTypes['Observable'] = true;
|
||||
}
|
||||
|
||||
return generateCallsTypesTemplate({
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export type ExtraTypes = Record<string, Record<string, { runtime?: Record<string, any>, types: Record<string, any> }>>;
|
||||
export type ExtraTypes = Record<string, Record<string, {
|
||||
runtime?: Record<string, any>;
|
||||
types: Record<string, any>;
|
||||
}>>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2023 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Constructor, Registry } from '@polkadot/types/types';
|
||||
import type { CodecClass, Registry } from '@polkadot/types/types';
|
||||
import type { UInt } from '@polkadot/types-codec';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
import type { ModuleTypes, TypeImports } from './imports.js';
|
||||
@@ -69,7 +69,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
}
|
||||
}
|
||||
} else if (isChildClass(Enum, Clazz)) {
|
||||
const { defKeys, isBasic } = new (Clazz as Constructor)(registry) as Enum;
|
||||
const { defKeys, isBasic } = new (Clazz as CodecClass)(registry) as Enum;
|
||||
const keys = defKeys.filter((v) => !v.startsWith('__Unused'));
|
||||
|
||||
if (isBasic) {
|
||||
@@ -80,7 +80,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
}
|
||||
|
||||
possibleTypes.push('Uint8Array');
|
||||
} else if (isChildClass(AbstractInt as unknown as Constructor<UInt>, Clazz) || isChildClass(Compact, Clazz)) {
|
||||
} else if (isChildClass(AbstractInt as unknown as CodecClass<UInt>, Clazz) || isChildClass(Compact, Clazz)) {
|
||||
possibleTypes.push('AnyNumber', 'Uint8Array');
|
||||
} else if (isChildClass(GenericLookupSource, Clazz)) {
|
||||
possibleTypes.push('Address', 'AccountId', 'AccountIndex', 'LookupSource', 'string', 'Uint8Array');
|
||||
@@ -93,7 +93,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
} else if (isChildClass(Null, Clazz)) {
|
||||
possibleTypes.push('null');
|
||||
} else if (isChildClass(Struct, Clazz)) {
|
||||
const s = new (Clazz as Constructor)(registry) as Struct;
|
||||
const s = new (Clazz as CodecClass)(registry) as Struct;
|
||||
const obj = s.defKeys.map((key): string => `${key}?: any`).join('; ');
|
||||
|
||||
possibleTypes.push(`{ ${obj} }`, 'string', 'Uint8Array');
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"dependencies": {
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
"version": "10.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/x-bigint": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/x-bigint": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-augment": "10.8.1",
|
||||
"@polkadot/types-support": "10.8.1",
|
||||
"@polkadot/util-crypto": "^12.2.2"
|
||||
"@polkadot/util-crypto": "^12.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,8 +379,8 @@ describe('Enum', (): void => {
|
||||
const type = new Enum(registry, { A: Text, B: U32, C: U32 }).toRawType();
|
||||
const value = registry.createType(type, { B: 123 });
|
||||
|
||||
expect((value as unknown as Record<string, unknown>).isB).toEqual(true);
|
||||
expect((value as unknown as Record<string, U32>).asB.toNumber()).toEqual(123);
|
||||
expect((value as unknown as { isB: boolean }).isB).toEqual(true);
|
||||
expect((value as unknown as { asB: U32 }).asB.toNumber()).toEqual(123);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ ${formatFixed(micro).padStart(NUM_PAD + PRE_PAD + 1)} μs/op`;
|
||||
}
|
||||
|
||||
export function perf (name: string, count: number, inputs: unknown[][], exec: ExecFn): void {
|
||||
const test = process.env.GITHUB_REPOSITORY
|
||||
const test = process.env['GITHUB_REPOSITORY']
|
||||
? it.skip
|
||||
: it;
|
||||
|
||||
|
||||
@@ -117,15 +117,13 @@ export interface Codec {
|
||||
toU8a (isBare?: BareOpts): Uint8Array;
|
||||
}
|
||||
|
||||
export interface CodecClass<T = Codec> {
|
||||
export interface CodecClass<T = Codec, A extends unknown[] = any[]> {
|
||||
/**
|
||||
* @description An internal fallback type (previous generation) if encoding fails
|
||||
*/
|
||||
readonly __fallbackType?: string;
|
||||
|
||||
// NOTE: We need the any[] here, unknown[] does not work as expected
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
new(registry: Registry, ...args: any[]): T;
|
||||
new(registry: Registry, ...args: A): T;
|
||||
}
|
||||
|
||||
export interface CodecObject<T extends ToString> extends Codec {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -15,6 +15,22 @@ interface TypeDefOptions {
|
||||
displayName?: string;
|
||||
}
|
||||
|
||||
interface SetDetails {
|
||||
_bitLength: number;
|
||||
index: number;
|
||||
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
interface ParsedDef {
|
||||
_alias: string;
|
||||
_enum?: string[];
|
||||
_fallback?: string;
|
||||
_set?: SetDetails;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
const KNOWN_INTERNALS = ['_alias', '_fallback'];
|
||||
|
||||
function getTypeString (typeOrObj: any): string {
|
||||
@@ -71,7 +87,7 @@ function _decodeEnum (value: TypeDef, details: string[] | Record<string, string>
|
||||
|
||||
// decode a set of the form
|
||||
// { _set: { A: 0b0001, B: 0b0010, C: 0b0100 } }
|
||||
function _decodeSet (value: TypeDef, details: Record<string, number>, fallbackType: string | undefined): TypeDef {
|
||||
function _decodeSet (value: TypeDef, details: SetDetails, fallbackType: string | undefined): TypeDef {
|
||||
value.info = TypeDefInfo.Set;
|
||||
value.fallbackType = fallbackType;
|
||||
value.length = details._bitLength;
|
||||
@@ -90,13 +106,13 @@ function _decodeSet (value: TypeDef, details: Record<string, number>, fallbackTy
|
||||
|
||||
// decode a struct, set or enum
|
||||
function _decodeStruct (value: TypeDef, type: string, _: string, count: number): TypeDef {
|
||||
const parsed = JSON.parse(type) as Record<string, unknown> & { _alias: string, _fallback?: string };
|
||||
const parsed = JSON.parse(type) as ParsedDef;
|
||||
const keys = Object.keys(parsed);
|
||||
|
||||
if (keys.includes('_enum')) {
|
||||
return _decodeEnum(value, parsed._enum as string[], count, parsed._fallback);
|
||||
} else if (keys.includes('_set')) {
|
||||
return _decodeSet(value, parsed._set as Record<string, number>, parsed._fallback);
|
||||
if (parsed._enum) {
|
||||
return _decodeEnum(value, parsed._enum, count, parsed._fallback);
|
||||
} else if (parsed._set) {
|
||||
return _decodeSet(value, parsed._set, parsed._fallback);
|
||||
}
|
||||
|
||||
value.alias = parsed._alias
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
"version": "10.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/networks": "^12.2.2",
|
||||
"@polkadot/networks": "^12.3.1",
|
||||
"@polkadot/types": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/types-create": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"version": "10.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,17 +21,17 @@
|
||||
"version": "10.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/keyring": "^12.2.2",
|
||||
"@polkadot/keyring": "^12.3.1",
|
||||
"@polkadot/types-augment": "10.8.1",
|
||||
"@polkadot/types-codec": "10.8.1",
|
||||
"@polkadot/types-create": "10.8.1",
|
||||
"@polkadot/util": "^12.2.2",
|
||||
"@polkadot/util-crypto": "^12.2.2",
|
||||
"@polkadot/util": "^12.3.1",
|
||||
"@polkadot/util-crypto": "^12.3.1",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^12.2.2",
|
||||
"@polkadot/keyring": "^12.3.1",
|
||||
"@polkadot/types-support": "10.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ function injectExtrinsics (registry: TypeRegistry, { lookup, pallets }: Metadata
|
||||
function extractProperties (registry: TypeRegistry, metadata: Metadata): ChainProperties | undefined {
|
||||
const original = registry.getChainProperties();
|
||||
const constants = decorateConstants(registry, metadata.asLatest, metadata.version);
|
||||
const ss58Format = constants.system && (constants.system.sS58Prefix || constants.system.ss58Prefix);
|
||||
const ss58Format = constants['system'] && (constants['system']['sS58Prefix'] || constants['system']['ss58Prefix']);
|
||||
|
||||
if (!ss58Format) {
|
||||
return original;
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('ExtrinsicV4', (): void => {
|
||||
expect(
|
||||
new Extrinsic(
|
||||
registry,
|
||||
tx.balances.transferAllowDeath(keyring.bob.publicKey, 6969n)
|
||||
tx['balances']['transferAllowDeath'](keyring.bob.publicKey, 6969n)
|
||||
).toHex()
|
||||
).toEqual(
|
||||
'0x' +
|
||||
@@ -52,7 +52,7 @@ describe('ExtrinsicV4', (): void => {
|
||||
expect(
|
||||
new Extrinsic(
|
||||
registry,
|
||||
tx.balances.transferAllowDeath(keyring.bob.publicKey, 6969n)
|
||||
tx['balances']['transferAllowDeath'](keyring.bob.publicKey, 6969n)
|
||||
).sign(keyring.alice, {
|
||||
blockHash: '0xec7afaf1cca720ce88c1d1b689d81f0583cc15a97d621cf046dd9abf605ef22f',
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('ExtrinsicPayload', (): void => {
|
||||
it('has a sane inspect', (): void => {
|
||||
// we don't expect this to fail, however it is actually a good
|
||||
// reference for the ordering in base Substrate
|
||||
expect(new ExtrinsicPayload(registry, { method: tx.timestamp.set(0).toHex() } as never).inspect()).toEqual({
|
||||
expect(new ExtrinsicPayload(registry, { method: tx['timestamp']['set'](0).toHex() } as never).inspect()).toEqual({
|
||||
inner: [
|
||||
{ name: 'method', outer: [new Uint8Array([3, 0, 0])] },
|
||||
{ inner: undefined, name: 'era', outer: [new Uint8Array([0]), new Uint8Array([0])] },
|
||||
|
||||
@@ -88,8 +88,8 @@ function decodeCallViaU8a (registry: Registry, value: Uint8Array, _meta?: Functi
|
||||
function decodeCall (registry: Registry, value: unknown | DecodedMethod | Uint8Array | string = new Uint8Array(), _meta?: FunctionMetadataLatest): DecodedMethod {
|
||||
if (isU8a(value) || isHex(value)) {
|
||||
return decodeCallViaU8a(registry, u8aToU8a(value), _meta);
|
||||
} else if (isObject(value) && value.callIndex && value.args) {
|
||||
return decodeCallViaObject(registry, value as DecodedMethod, _meta);
|
||||
} else if (isObject<DecodedMethod>(value) && value.callIndex && value.args) {
|
||||
return decodeCallViaObject(registry, value, _meta);
|
||||
}
|
||||
|
||||
throw new Error(`Call: Cannot decode value '${value as string}' of type ${typeof value}`);
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { AnyJson } from '@polkadot/types-codec/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV15 } from '../interfaces/metadata/index.js';
|
||||
import type { Registry } from '../types/index.js';
|
||||
import type { MetaVersionAll, MetaVersionAsX } from './versions.js';
|
||||
|
||||
import { Struct } from '@polkadot/types-codec';
|
||||
|
||||
@@ -17,23 +18,10 @@ import { toV14 } from './v13/toV14.js';
|
||||
import { toV15 } from './v14/toV15.js';
|
||||
import { toLatest } from './v15/toLatest.js';
|
||||
import { MagicNumber } from './MagicNumber.js';
|
||||
import { LATEST_VERSION, TO_CALLS_VERSION } from './versions.js';
|
||||
|
||||
// Use these to generate all the Meta* types below via template keys
|
||||
// NOTE: Keep from latest -> earliest, see the LATEST_VERSION 0 index
|
||||
const KNOWN_VERSIONS = [15, 14, 13, 12, 11, 10, 9] as const;
|
||||
const LATEST_VERSION = KNOWN_VERSIONS[0];
|
||||
|
||||
// This is part of migration. The toCallsOnly would be usede for esxtensions,
|
||||
// i.e. they need to be updated. To ensure that they are passed a known version
|
||||
// we actually set this to a known-working version
|
||||
//
|
||||
// NOTE: This would only work on compatible types, i.e. v14 & v15 comply
|
||||
const TO_CALLS_VERSION = 14; // LATEST_VERSION;
|
||||
|
||||
type MetaAll = typeof KNOWN_VERSIONS[number];
|
||||
type MetaAsX = `asV${MetaAll}`;
|
||||
type MetaMapped = MetadataAll[MetaAsX];
|
||||
type MetaVersions = Exclude<MetaAll, 9> | 'latest';
|
||||
type MetaMapped = MetadataAll[MetaVersionAsX];
|
||||
type MetaVersions = Exclude<MetaVersionAll, 9> | 'latest';
|
||||
|
||||
/**
|
||||
* @name MetadataVersioned
|
||||
@@ -64,15 +52,15 @@ export class MetadataVersioned extends Struct {
|
||||
|
||||
#getVersion = <T extends MetaMapped, F extends MetaMapped>(version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T => {
|
||||
if (version !== 'latest' && this.#assertVersion(version)) {
|
||||
const asCurr: MetaAsX = `asV${version}`;
|
||||
const asCurr: MetaVersionAsX = `asV${version}`;
|
||||
|
||||
return this.#metadata()[asCurr] as T;
|
||||
}
|
||||
|
||||
if (!this.#converted.has(version)) {
|
||||
const asPrev: MetaAsX = version === 'latest'
|
||||
const asPrev: MetaVersionAsX = version === 'latest'
|
||||
? `asV${LATEST_VERSION}`
|
||||
: `asV${(version - 1) as MetaAll}`;
|
||||
: `asV${(version - 1) as MetaVersionAll}`;
|
||||
|
||||
this.#converted.set(version, fromPrev(this.registry, this[asPrev] as F, this.version));
|
||||
}
|
||||
@@ -165,8 +153,8 @@ export class MetadataVersioned extends Struct {
|
||||
/**
|
||||
* @description the metadata version this structure represents
|
||||
*/
|
||||
public get version (): number {
|
||||
return this.#metadata().index;
|
||||
public get version (): MetaVersionAll {
|
||||
return this.#metadata().index as MetaVersionAll;
|
||||
}
|
||||
|
||||
public getUniqTypes (throwError: boolean): string[] {
|
||||
|
||||
@@ -27,10 +27,19 @@ interface Extract extends ExtractBase {
|
||||
interface TypeInfo {
|
||||
lookups: Record<string, LookupString>;
|
||||
names: Record<number, string>;
|
||||
params: Record<string, SiTypeParameter[]>;
|
||||
params: TypeInfoParams;
|
||||
types: Record<number, PortableType>;
|
||||
}
|
||||
|
||||
interface TypeInfoParams {
|
||||
// known param definitions
|
||||
FrameSystemEventRecord: [event: SiTypeParameter, topic: SiTypeParameter]
|
||||
SpRuntimeUncheckedExtrinsic: [address: SiTypeParameter, call: SiTypeParameter, signature: SiTypeParameter, extra: SiTypeParameter];
|
||||
|
||||
// other type definitions
|
||||
[key: string]: SiTypeParameter[];
|
||||
}
|
||||
|
||||
// Just a placeholder for a type.unrwapOr()
|
||||
const TYPE_UNWRAP = { toNumber: () => -1 };
|
||||
|
||||
@@ -398,7 +407,7 @@ function removeDupeNames (lookup: PortableRegistry, portable: PortableType[], na
|
||||
}
|
||||
|
||||
/** @internal Detect on-chain types (AccountId/Signature) as set as the default */
|
||||
function registerTypes (lookup: PortableRegistry, lookups: Record<string, string>, names: Record<number, string>, params: Record<string, SiTypeParameter[]>): void {
|
||||
function registerTypes (lookup: PortableRegistry, lookups: Record<string, string>, names: Record<number, string>, params: TypeInfoParams): void {
|
||||
// Register the types we extracted
|
||||
lookup.registry.register(lookups);
|
||||
|
||||
@@ -439,7 +448,7 @@ function registerTypes (lookup: PortableRegistry, lookups: Record<string, string
|
||||
* @internal Extracts aliases based on what we know the runtime config looks like in a
|
||||
* Substrate chain. Specifically we want to have access to the Call and Event params
|
||||
**/
|
||||
function extractAliases (params: Record<string, SiTypeParameter[]>, isContract?: boolean): Record<number, string> {
|
||||
function extractAliases (params: TypeInfoParams, isContract?: boolean): Record<number, string> {
|
||||
const hasParams = Object.keys(params).some((k) => !k.startsWith('Pallet'));
|
||||
const alias: Record<number, string> = {};
|
||||
|
||||
@@ -483,7 +492,7 @@ function extractTypeInfo (lookup: PortableRegistry, portable: PortableType[]): T
|
||||
|
||||
const lookups: Record<string, LookupString> = {};
|
||||
const names: Record<number, string> = {};
|
||||
const params: Record<string, SiTypeParameter[]> = {};
|
||||
const params = {} as TypeInfoParams;
|
||||
const dedup = removeDupeNames(lookup, portable, nameInfo);
|
||||
|
||||
for (let i = 0, count = dedup.length; i < count; i++) {
|
||||
@@ -501,7 +510,7 @@ export class PortableRegistry extends Struct implements ILookup {
|
||||
#alias: Record<number, string>;
|
||||
#lookups: Record<string, LookupString>;
|
||||
#names: Record<number, string>;
|
||||
#params: Record<string, SiTypeParameter[]>;
|
||||
#params: TypeInfoParams;
|
||||
#typeDefs: Record<number, TypeDef> = {};
|
||||
#types: Record<number, PortableType>;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { TypeRegistry } from '../../../create/index.js';
|
||||
import { Metadata } from '../../Metadata.js';
|
||||
import { decorateConstants } from '../index.js';
|
||||
|
||||
function init (meta: HexString): [Constants, TypeRegistry] {
|
||||
function init (meta: HexString): [consts: Constants, registry: TypeRegistry] {
|
||||
const registry = new TypeRegistry();
|
||||
const metadata = new Metadata(registry, meta);
|
||||
|
||||
@@ -27,9 +27,9 @@ describe('decorateConstants', (): void => {
|
||||
it('should return constants with the correct type and value', (): void => {
|
||||
const [consts] = init(rpcMetadata);
|
||||
|
||||
expect((consts.democracy.cooloffPeriod as unknown as BlockNumber).bitLength()).toBe(32);
|
||||
expect((consts['democracy']['cooloffPeriod'] as unknown as BlockNumber).bitLength()).toBe(32);
|
||||
// 3 second blocks, 28 days
|
||||
expect((consts.democracy.cooloffPeriod as unknown as BlockNumber).toNumber()).toEqual(28 * 24 * 60 * (60 / 3));
|
||||
expect((consts['democracy']['cooloffPeriod'] as unknown as BlockNumber).toNumber()).toEqual(28 * 24 * 60 * (60 / 3));
|
||||
});
|
||||
|
||||
// removed from session
|
||||
@@ -38,7 +38,7 @@ describe('decorateConstants', (): void => {
|
||||
|
||||
// 0x34 removes as the length prefix removed
|
||||
expect(
|
||||
consts.session.dedupKeyPrefix.toHex()
|
||||
consts['session']['dedupKeyPrefix'].toHex()
|
||||
).toEqual('0x3a73657373696f6e3a6b657973');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,11 +22,12 @@ export function decorateConstants (registry: Registry, { pallets }: MetadataLate
|
||||
{},
|
||||
constants,
|
||||
(constant: PalletConstantMetadataLatest): ConstantCodec => {
|
||||
const codec = registry.createTypeUnsafe(registry.createLookupType(constant.type), [hexToU8a(constant.value.toHex())]);
|
||||
const codec = registry.createTypeUnsafe<ConstantCodec>(registry.createLookupType(constant.type), [hexToU8a(constant.value.toHex())]);
|
||||
|
||||
(codec as unknown as Record<string, unknown>).meta = constant;
|
||||
// We are casting here since we are assigning to a read-only property
|
||||
(codec as { meta: PalletConstantMetadataLatest }).meta = constant;
|
||||
|
||||
return codec as ConstantCodec;
|
||||
return codec;
|
||||
},
|
||||
objectNameToCamel
|
||||
)
|
||||
|
||||
@@ -18,13 +18,13 @@ const errors = decorateErrors(registry, metadata.asLatest, metadata.version);
|
||||
|
||||
describe('decorateErrors', (): void => {
|
||||
it('should return known errors', (): void => {
|
||||
expect(errors.balances.InsufficientBalance).toBeDefined();
|
||||
expect(errors.system.FailedToExtractRuntimeVersion).toBeDefined();
|
||||
expect(errors['balances']['InsufficientBalance']).toBeDefined();
|
||||
expect(errors['system']['FailedToExtractRuntimeVersion']).toBeDefined();
|
||||
});
|
||||
|
||||
it('has the correct metadata for known errors', (): void => {
|
||||
expect(
|
||||
errors.proxy.NotProxy.meta.toJSON()
|
||||
errors['proxy']['NotProxy'].meta.toJSON()
|
||||
).toEqual({
|
||||
args: [],
|
||||
docs: ['Sender is not a proxy of the account to be proxied.'],
|
||||
@@ -36,7 +36,7 @@ describe('decorateErrors', (): void => {
|
||||
|
||||
it('should check against a specific error', (): void => {
|
||||
expect(
|
||||
errors.system.InvalidSpecName.is(
|
||||
errors['system']['InvalidSpecName'].is(
|
||||
registry.createType('DispatchErrorModule', {
|
||||
error: 0,
|
||||
index: 0
|
||||
|
||||
@@ -18,13 +18,13 @@ const events = decorateEvents(registry, metadata.asLatest, metadata.version);
|
||||
|
||||
describe('decorateEvents', (): void => {
|
||||
it('should return known errors', (): void => {
|
||||
expect(events.balances.Transfer).toBeDefined();
|
||||
expect(events.system.CodeUpdated).toBeDefined();
|
||||
expect(events['balances']['Transfer']).toBeDefined();
|
||||
expect(events['system']['CodeUpdated']).toBeDefined();
|
||||
});
|
||||
|
||||
it('has the correct metadata for known errors', (): void => {
|
||||
expect(
|
||||
events.staking.Rewarded.meta.toJSON()
|
||||
events['staking']['Rewarded'].meta.toJSON()
|
||||
).toEqual({
|
||||
args: ['AccountId32', 'u128'],
|
||||
docs: [
|
||||
@@ -41,7 +41,7 @@ describe('decorateEvents', (): void => {
|
||||
|
||||
it('should check against a specific error', (): void => {
|
||||
expect(
|
||||
events.system.ExtrinsicSuccess.is(registry.createType('Event', { index: [0, 0] }))
|
||||
events['system']['ExtrinsicSuccess'].is(registry.createType('Event', { index: [0, 0] }))
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('extrinsics', (): void => {
|
||||
it('encodes an actual transfer (actual data)', (): void => {
|
||||
expect(
|
||||
registry.createType('Extrinsic',
|
||||
extrinsics.balances.transfer(keyring.bob.publicKey, 6969)
|
||||
extrinsics['balances']['transfer'](keyring.bob.publicKey, 6969)
|
||||
).sign(keyring.alice, {
|
||||
blockHash: '0xec7afaf1cca720ce88c1d1b689d81f0583cc15a97d621cf046dd9abf605ef22f',
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
@@ -57,16 +57,16 @@ describe('extrinsics', (): void => {
|
||||
|
||||
describe('decorateExtrinsics', (): void => {
|
||||
it('should throw if an incorrect number of args is supplied', (): void => {
|
||||
expect(() => extrinsics.balances.setBalance()).toThrow(/expects 3 arguments/);
|
||||
expect(() => extrinsics['balances']['setBalance']()).toThrow(/expects 3 arguments/);
|
||||
});
|
||||
|
||||
it('should return a value if the storage function does not expect an argument', (): void => {
|
||||
expect(() => extrinsics.balances.setBalance('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF', 2, 3)).not.toThrow();
|
||||
expect(() => extrinsics['balances']['setBalance']('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF', 2, 3)).not.toThrow();
|
||||
});
|
||||
|
||||
it('should return properly-encoded transactions', (): void => {
|
||||
expect(
|
||||
registry.createType('Extrinsic', extrinsics.timestamp.set(32)).toU8a()
|
||||
registry.createType('Extrinsic', extrinsics['timestamp']['set'](32)).toU8a()
|
||||
).toEqual(
|
||||
new Uint8Array([
|
||||
// length (encoded)
|
||||
@@ -82,9 +82,9 @@ describe('decorateExtrinsics', (): void => {
|
||||
});
|
||||
|
||||
it('has working .is', (): void => {
|
||||
const tx = extrinsics.balances.setBalance('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF', 2, 3);
|
||||
const tx = extrinsics['balances']['setBalance']('5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF', 2, 3);
|
||||
|
||||
expect(extrinsics.balances.setBalance.is(tx)).toBe(true);
|
||||
expect(extrinsics.balances.transfer.is(tx)).toBe(false);
|
||||
expect(extrinsics['balances']['setBalance'].is(tx)).toBe(true);
|
||||
expect(extrinsics['balances']['transfer'].is(tx)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ describe('Decorated', () => {
|
||||
|
||||
expect(
|
||||
u8aToHex(
|
||||
query.system.account('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
|
||||
query['system']['account']('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
|
||||
)
|
||||
).toEqual(
|
||||
'0x410126aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
|
||||
@@ -33,7 +33,7 @@ describe('Decorated', () => {
|
||||
const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version);
|
||||
|
||||
expect(
|
||||
registry.createType('Extrinsic', tx.timestamp.set(63)).toU8a()
|
||||
registry.createType('Extrinsic', tx['timestamp']['set'](63)).toU8a()
|
||||
).toEqual(
|
||||
new Uint8Array([
|
||||
// length (encoded)
|
||||
@@ -51,7 +51,7 @@ describe('Decorated', () => {
|
||||
it('should return constants with the correct type and value', (): void => {
|
||||
const consts = decorateConstants(registry, metadata.asLatest, metadata.version);
|
||||
|
||||
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(u32); // BlockNumber
|
||||
expect(consts.democracy.cooloffPeriod.toHex()).toEqual('0x000c4e00');
|
||||
expect(consts['democracy']['cooloffPeriod']).toBeInstanceOf(u32); // BlockNumber
|
||||
expect(consts['democracy']['cooloffPeriod'].toHex()).toEqual('0x000c4e00');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,13 +19,13 @@ describe('getSorage', (): void => {
|
||||
const storage = getStorage(registry);
|
||||
|
||||
it('should return well known keys', (): void => {
|
||||
expect(typeof storage.substrate).toBe('object');
|
||||
expect(typeof storage['substrate']).toBe('object');
|
||||
|
||||
expect(storage.substrate.code()).toEqual(compactAddLength(u8aToU8a(':code')));
|
||||
expect(storage['substrate']['code']()).toEqual(compactAddLength(u8aToU8a(':code')));
|
||||
|
||||
expect(storage.substrate.changesTrieConfig).toBeTruthy();
|
||||
expect(storage.substrate.childStorageKeyPrefix).toBeTruthy();
|
||||
expect(storage.substrate.extrinsicIndex).toBeTruthy();
|
||||
expect(storage.substrate.heapPages).toBeTruthy();
|
||||
expect(storage['substrate']['changesTrieConfig']).toBeTruthy();
|
||||
expect(storage['substrate']['childStorageKeyPrefix']).toBeTruthy();
|
||||
expect(storage['substrate']['extrinsicIndex']).toBeTruthy();
|
||||
expect(storage['substrate']['heapPages']).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,28 +23,28 @@ describe('decorateStorage', (): void => {
|
||||
const query = decorateStorage(registry, metadata.asLatest, metadata.version);
|
||||
|
||||
it('should throw if the storage function expects an argument', (): void => {
|
||||
expect(() => query.balances.account()).toThrow('Call to balances.account needs 1 arguments, found []');
|
||||
expect(() => query['balances']['account']()).toThrow('Call to balances.account needs 1 arguments, found []');
|
||||
});
|
||||
|
||||
it('should throw if the storage function expects multiple arguments', (): void => {
|
||||
expect(() => query.staking.erasStakers([1])).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
|
||||
expect(() => query['staking']['erasStakers']([1])).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
|
||||
});
|
||||
|
||||
it('should throw if the storage function expects tuple arguments', (): void => {
|
||||
expect(() => query.staking.erasStakers(1)).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
|
||||
expect(() => query['staking']['erasStakers'](1)).toThrow('Call to staking.erasStakers needs 2 arguments, found [1]');
|
||||
});
|
||||
|
||||
it('should return a value if the storage function does not expect an argument', (): void => {
|
||||
expect(() => query.timestamp.now()).not.toThrow();
|
||||
expect(() => query['timestamp']['now']()).not.toThrow();
|
||||
});
|
||||
|
||||
it('should return a value if the storage function has the correct arguments', (): void => {
|
||||
expect(() => query.staking.erasStakers(1, keyring.alice.address)).not.toThrow();
|
||||
expect(() => query['staking']['erasStakers'](1, keyring.alice.address)).not.toThrow();
|
||||
});
|
||||
|
||||
it('should return the correct length-prefixed storage key', (): void => {
|
||||
expect(
|
||||
u8aToHex(query.system.account(keyring.alice.address))
|
||||
u8aToHex(query['system']['account'](keyring.alice.address))
|
||||
).toEqual(
|
||||
'0x' +
|
||||
'4101' + // length
|
||||
@@ -56,7 +56,7 @@ describe('decorateStorage', (): void => {
|
||||
|
||||
it('should decorate the palletVersion entry', (): void => {
|
||||
expect(
|
||||
u8aToHex(query.system.palletVersion())
|
||||
u8aToHex(query['system']['palletVersion']())
|
||||
).toEqual(
|
||||
'0x' +
|
||||
'80' + // length
|
||||
|
||||
@@ -18,7 +18,7 @@ registry.setMetadata(metadata);
|
||||
// console.log(JSON.stringify(registry.lookup.types));
|
||||
|
||||
describe('substrate', (): void => {
|
||||
const code = substrate.code(registry);
|
||||
const code = substrate['code'](registry);
|
||||
|
||||
it('creates a well-known :code key', (): void => {
|
||||
expect(
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
/* global describe, it, expect */
|
||||
|
||||
import type { Registry } from '@polkadot/types-codec/types';
|
||||
import type { MetaVersionAll } from '../versions.js';
|
||||
import type { Check } from './types.js';
|
||||
|
||||
import fs from 'node:fs';
|
||||
@@ -18,6 +19,24 @@ import { unwrapStorageSi, unwrapStorageType } from '../../util/index.js';
|
||||
import { Metadata } from '../Metadata.js';
|
||||
import { getUniqTypes } from './getUniqTypes.js';
|
||||
|
||||
interface MetadataJsonDef {
|
||||
lookup: unknown;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
interface MetadataJson {
|
||||
metadata: {
|
||||
v9: MetadataJsonDef;
|
||||
v10: MetadataJsonDef;
|
||||
v11: MetadataJsonDef;
|
||||
v12: MetadataJsonDef;
|
||||
v13: MetadataJsonDef;
|
||||
v14: MetadataJsonDef;
|
||||
v15: MetadataJsonDef;
|
||||
}
|
||||
}
|
||||
|
||||
function getJsonName (version: number, type: string, sub: 'json' | 'types'): string {
|
||||
return path.join(process.cwd(), `packages/types-support/src/metadata/v${version}/${type}-${sub}.json`);
|
||||
}
|
||||
@@ -33,13 +52,13 @@ function readJson <T = unknown> (version: number, type: string, sub: 'json' | 't
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function decodeLatestMeta (registry: Registry, type: string, version: number, { data }: Check): void {
|
||||
export function decodeLatestMeta (registry: Registry, type: string, version: MetaVersionAll, { data }: Check): void {
|
||||
const metadata = new Metadata(registry, data);
|
||||
|
||||
registry.setMetadata(metadata);
|
||||
|
||||
it('decodes latest substrate properly', (): void => {
|
||||
const json = metadata.toJSON() as Record<string, Record<string, Record<string, string>>>;
|
||||
const json = metadata.toJSON() as unknown as MetadataJson;
|
||||
|
||||
delete json.metadata[`v${metadata.version}`].lookup;
|
||||
|
||||
@@ -48,7 +67,7 @@ export function decodeLatestMeta (registry: Registry, type: string, version: num
|
||||
try {
|
||||
expect(json).toEqual(readJson(version, type, 'json'));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
if (process.env['GITHUB_REPOSITORY']) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -64,7 +83,7 @@ export function decodeLatestMeta (registry: Registry, type: string, version: num
|
||||
try {
|
||||
expect(json).toEqual(readJson(version, type, 'types'));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
if (process.env['GITHUB_REPOSITORY']) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -76,7 +95,7 @@ export function decodeLatestMeta (registry: Registry, type: string, version: num
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function toLatest (registry: Registry, version: number, { data }: Check, withThrow = true): void {
|
||||
export function toLatest (registry: Registry, version: MetaVersionAll, { data }: Check, withThrow = true): void {
|
||||
it(`converts v${version} to latest`, (): void => {
|
||||
const metadata = new Metadata(registry, data);
|
||||
|
||||
@@ -159,7 +178,7 @@ function serialize (registry: Registry, { data }: Check): void {
|
||||
});
|
||||
}
|
||||
|
||||
export function testMeta (version: number, matchers: Record<string, Check>, withFallback = true): void {
|
||||
export function testMeta (version: MetaVersionAll, matchers: Record<string, Check>, withFallback = true): void {
|
||||
describe(`MetadataV${version}`, (): void => {
|
||||
for (const [type, matcher] of Object.entries(matchers)) {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright 2017-2023 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Use these to generate all the Meta* types below via template keys
|
||||
// NOTE: Keep from latest -> earliest, see the LATEST_VERSION 0 index
|
||||
export const KNOWN_VERSIONS = [15, 14, 13, 12, 11, 10, 9] as const;
|
||||
export const LATEST_VERSION = KNOWN_VERSIONS[0];
|
||||
|
||||
// This is part of migration. The toCallsOnly would be usede for esxtensions,
|
||||
// i.e. they need to be updated. To ensure that they are passed a known version
|
||||
// we actually set this to a known-working version
|
||||
//
|
||||
// NOTE: This would only work on compatible types, i.e. v14 & v15 comply
|
||||
export const TO_CALLS_VERSION = 14; // LATEST_VERSION;
|
||||
|
||||
export type MetaVersionAll = typeof KNOWN_VERSIONS[number];
|
||||
export type MetaVersionAsX = `asV${MetaVersionAll}`;
|
||||
@@ -22,7 +22,7 @@ describe('StorageKey', (): void => {
|
||||
it('should allow decoding of a DoubleMap key', (): void => {
|
||||
const key = new StorageKey(registry, '0x5f3e4907f716ac89b6347d15ececedca8bde0a0ea8864605e3b68ed9cb2da01b66ccada06515787c10000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f');
|
||||
|
||||
key.setMeta(query.staking.erasStakers.meta);
|
||||
key.setMeta(query['staking']['erasStakers'].meta);
|
||||
|
||||
expect(key.toHuman()).toEqual([
|
||||
'16',
|
||||
@@ -33,7 +33,7 @@ describe('StorageKey', (): void => {
|
||||
it('should allow decoding of a Map key', (): void => {
|
||||
const key = new StorageKey(registry, '0x426e15054d267946093858132eb537f191ca57b0c4b20b29ae7e99d6201d680cc906f7710aa165d62c709012f807af8fc3f0d2abb0c51ca9a88d4ef24d1a092bf89dacf5ce63ea1d');
|
||||
|
||||
key.setMeta(query.society.defenderVotes.meta);
|
||||
key.setMeta(query['society']['defenderVotes'].meta);
|
||||
|
||||
expect(key.toHuman()).toEqual([
|
||||
'5D4yQHKfqCQYThhHmTfN1JEDi47uyDJc1xg9eZfAG1R7FC7J'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
|
||||
export type { AnyFunction, AnyJson, AnyNumber, AnyString, AnyTuple, AnyU8a, ArgsDef, BareOpts, Codec, CodecClass, CodecTo, CodecClass as Constructor, Inspect } from '@polkadot/types-codec/types';
|
||||
export type { AnyFunction, AnyJson, AnyNumber, AnyString, AnyTuple, AnyU8a, ArgsDef, BareOpts, Codec, CodecClass, CodecTo, Inspect } from '@polkadot/types-codec/types';
|
||||
|
||||
// helper to extract keys from an array
|
||||
export type ArrayElementType<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
"rollup.config.js"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**/*"
|
||||
"**/node_modules/**/*",
|
||||
// We exclude these since it creates some issues with the
|
||||
// @typescript-eslint/dot-notation rules
|
||||
"packages/api-augment/src/kusama/*.ts",
|
||||
"packages/api-augment/src/polkadot/*.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ __metadata:
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-augment": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -400,7 +400,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@polkadot/rpc-core": 10.8.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
@@ -412,12 +412,12 @@ __metadata:
|
||||
dependencies:
|
||||
"@polkadot/api": 10.8.1
|
||||
"@polkadot/api-augment": 10.8.1
|
||||
"@polkadot/keyring": ^12.2.2
|
||||
"@polkadot/keyring": ^12.3.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/types-create": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
@@ -436,8 +436,8 @@ __metadata:
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
@@ -450,7 +450,7 @@ __metadata:
|
||||
"@polkadot/api-augment": 10.8.1
|
||||
"@polkadot/api-base": 10.8.1
|
||||
"@polkadot/api-derive": 10.8.1
|
||||
"@polkadot/keyring": ^12.2.2
|
||||
"@polkadot/keyring": ^12.3.1
|
||||
"@polkadot/rpc-augment": 10.8.1
|
||||
"@polkadot/rpc-core": 10.8.1
|
||||
"@polkadot/rpc-provider": 10.8.1
|
||||
@@ -460,42 +460,42 @@ __metadata:
|
||||
"@polkadot/types-create": 10.8.1
|
||||
"@polkadot/types-known": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
eventemitter3: ^5.0.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/dev-test@npm:^0.75.16":
|
||||
version: 0.75.16
|
||||
resolution: "@polkadot/dev-test@npm:0.75.16"
|
||||
"@polkadot/dev-test@npm:^0.75.19":
|
||||
version: 0.75.19
|
||||
resolution: "@polkadot/dev-test@npm:0.75.19"
|
||||
dependencies:
|
||||
jsdom: ^22.1.0
|
||||
tslib: ^2.5.3
|
||||
checksum: 4b079411cc14029f533deadee7deabfd9f86a29cdd8b173d090e4f8a672d8a850d2c38263e1af2679db512f8f3ccb8fde6fa353d2f17830a246137adba6c5d85
|
||||
checksum: a3c187fde1b9512e11c3917df54912fdb01adb2e9e9eb8893f6916ea2c33bf4883dad253388dcaa606171f5047fedb0a5ed6ff3b9fa256c6ff94dcc1398c6f1c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/dev-ts@npm:^0.75.16":
|
||||
version: 0.75.16
|
||||
resolution: "@polkadot/dev-ts@npm:0.75.16"
|
||||
"@polkadot/dev-ts@npm:^0.75.19":
|
||||
version: 0.75.19
|
||||
resolution: "@polkadot/dev-ts@npm:0.75.19"
|
||||
dependencies:
|
||||
json5: ^2.2.3
|
||||
tslib: ^2.5.3
|
||||
typescript: ^5.1.3
|
||||
checksum: 87df9766ccacb56edd66d3b3073f1920939f13fc883de8759014fb2e788b3c9abd24eecaa9d91f934ed37c0715d48eacb4cc4b5d99e11e7347593ef3e505bb70
|
||||
checksum: efc93f826c5dd1c54b472a61e8cdaeb83f167eaa94194b391d22b8adf2bcf578ed2b9251c863c45907b43ce45c12cde441872f43b1bc69c03983c1a4ee7c2e87
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/dev@npm:^0.75.16":
|
||||
version: 0.75.16
|
||||
resolution: "@polkadot/dev@npm:0.75.16"
|
||||
"@polkadot/dev@npm:^0.75.19":
|
||||
version: 0.75.19
|
||||
resolution: "@polkadot/dev@npm:0.75.19"
|
||||
dependencies:
|
||||
"@eslint/js": ^8.42.0
|
||||
"@polkadot/dev-test": ^0.75.16
|
||||
"@polkadot/dev-ts": ^0.75.16
|
||||
"@polkadot/dev-test": ^0.75.19
|
||||
"@polkadot/dev-ts": ^0.75.19
|
||||
"@rollup/plugin-alias": ^5.0.0
|
||||
"@rollup/plugin-commonjs": ^25.0.0
|
||||
"@rollup/plugin-dynamic-import-vars": ^2.0.3
|
||||
@@ -503,8 +503,8 @@ __metadata:
|
||||
"@rollup/plugin-json": ^6.0.0
|
||||
"@rollup/plugin-node-resolve": ^15.1.0
|
||||
"@tsconfig/strictest": ^2.0.1
|
||||
"@typescript-eslint/eslint-plugin": ^5.59.8
|
||||
"@typescript-eslint/parser": ^5.59.8
|
||||
"@typescript-eslint/eslint-plugin": ^5.59.9
|
||||
"@typescript-eslint/parser": ^5.59.9
|
||||
eslint: ^8.42.0
|
||||
eslint-config-standard: ^17.1.0
|
||||
eslint-import-resolver-node: ^0.3.7
|
||||
@@ -526,12 +526,12 @@ __metadata:
|
||||
globals: ^13.20.0
|
||||
json5: ^2.2.3
|
||||
madge: ^6.1.0
|
||||
rollup: ^3.23.0
|
||||
rollup: ^3.24.0
|
||||
rollup-plugin-cleanup: ^3.2.1
|
||||
tslib: ^2.5.3
|
||||
typescript: ^5.1.3
|
||||
webpack: ^5.85.0
|
||||
webpack-cli: ^5.1.2
|
||||
webpack: ^5.86.0
|
||||
webpack-cli: ^5.1.4
|
||||
webpack-dev-server: ^4.15.0
|
||||
webpack-merge: ^5.9.0
|
||||
webpack-subresource-integrity: ^5.2.0-rc.1
|
||||
@@ -560,32 +560,32 @@ __metadata:
|
||||
polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs
|
||||
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
|
||||
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
|
||||
checksum: 17bd59605879803792189a771ba91ea500a1dcfab528856d14fed0c9a3628306107348be47e0ef1465dbe93f860ae34a9c0f05d58f568fea3b38df4e31ebf5e2
|
||||
checksum: ab5e3c64f125508c068ca2e3f784947b1ddd1196f71cfc820b9bd11fae28548926865f18dadbb8321a646dba4d80f44122890a54efb97bef370b92a2e5f0fc46
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/keyring@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/keyring@npm:12.2.2"
|
||||
"@polkadot/keyring@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/keyring@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/util": 12.2.2
|
||||
"@polkadot/util-crypto": 12.2.2
|
||||
"@polkadot/util": 12.3.1
|
||||
"@polkadot/util-crypto": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
peerDependencies:
|
||||
"@polkadot/util": 12.2.2
|
||||
"@polkadot/util-crypto": 12.2.2
|
||||
checksum: 974d744e76dd6e0b3a8007a2f5fb7fb4c7aa7267ec4ca5ad9ea5ef6e149e23d9b4e8b296cff954a350e0fdaee6f01722083644613890d872eaf668dade6ecac7
|
||||
"@polkadot/util": 12.3.1
|
||||
"@polkadot/util-crypto": 12.3.1
|
||||
checksum: c14ce1f9b237e855ff380630cb9cde53b32735c3e6fe7cc45184dab4030ea84d6d281c99141f556e9e3a993a0556320f4751d7bfc34d24d8ad3e7b3f88006605
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/networks@npm:12.2.2, @polkadot/networks@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/networks@npm:12.2.2"
|
||||
"@polkadot/networks@npm:12.3.1, @polkadot/networks@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/networks@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/util": 12.2.2
|
||||
"@polkadot/util": 12.3.1
|
||||
"@substrate/ss58-registry": ^1.40.0
|
||||
tslib: ^2.5.3
|
||||
checksum: 70250addc52a1eee1a7ecb201b1d11c8aa5aa42edcb49fe4bd5759e50143e970447f688962dab0c32d753b59bfa2918e87353908216920201b3cc8a8e7690a3e
|
||||
checksum: 734ea213dc3fc8f15f9cb7da375f9cdac447b29e1f446cab557f23f8553e188da5f2ca0de61fd48fe629cd6b57c2f6b80462091914539ca46f656ec49f61b678
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -596,7 +596,7 @@ __metadata:
|
||||
"@polkadot/rpc-core": 10.8.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -605,11 +605,11 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||
dependencies:
|
||||
"@polkadot/keyring": ^12.2.2
|
||||
"@polkadot/keyring": ^12.3.1
|
||||
"@polkadot/rpc-augment": 10.8.1
|
||||
"@polkadot/rpc-provider": 10.8.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
@@ -619,14 +619,14 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||
dependencies:
|
||||
"@polkadot/keyring": ^12.2.2
|
||||
"@polkadot/keyring": ^12.3.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/x-fetch": ^12.2.2
|
||||
"@polkadot/x-global": ^12.2.2
|
||||
"@polkadot/x-ws": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
"@polkadot/x-fetch": ^12.3.1
|
||||
"@polkadot/x-global": ^12.3.1
|
||||
"@polkadot/x-ws": ^12.3.1
|
||||
"@substrate/connect": 0.7.26
|
||||
eventemitter3: ^5.0.1
|
||||
mock-socket: ^9.2.1
|
||||
@@ -651,9 +651,9 @@ __metadata:
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/types-create": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/x-ws": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
"@polkadot/x-ws": ^12.3.1
|
||||
"@types/websocket": ^1.0.5
|
||||
"@types/yargs": ^17.0.24
|
||||
handlebars: ^4.7.7
|
||||
@@ -674,7 +674,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -686,9 +686,9 @@ __metadata:
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-augment": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/x-bigint": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
"@polkadot/x-bigint": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -699,7 +699,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -709,11 +709,11 @@ __metadata:
|
||||
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
||||
dependencies:
|
||||
"@polkadot/api": 10.8.1
|
||||
"@polkadot/networks": ^12.2.2
|
||||
"@polkadot/networks": ^12.3.1
|
||||
"@polkadot/types": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/types-create": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -722,7 +722,7 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types-support@workspace:packages/types-support"
|
||||
dependencies:
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -731,50 +731,50 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types@workspace:packages/types"
|
||||
dependencies:
|
||||
"@polkadot/keyring": ^12.2.2
|
||||
"@polkadot/keyring": ^12.3.1
|
||||
"@polkadot/types-augment": 10.8.1
|
||||
"@polkadot/types-codec": 10.8.1
|
||||
"@polkadot/types-create": 10.8.1
|
||||
"@polkadot/types-support": 10.8.1
|
||||
"@polkadot/util": ^12.2.2
|
||||
"@polkadot/util-crypto": ^12.2.2
|
||||
"@polkadot/util": ^12.3.1
|
||||
"@polkadot/util-crypto": ^12.3.1
|
||||
rxjs: ^7.8.1
|
||||
tslib: ^2.5.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/util-crypto@npm:12.2.2, @polkadot/util-crypto@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/util-crypto@npm:12.2.2"
|
||||
"@polkadot/util-crypto@npm:12.3.1, @polkadot/util-crypto@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/util-crypto@npm:12.3.1"
|
||||
dependencies:
|
||||
"@noble/curves": 1.1.0
|
||||
"@noble/hashes": 1.3.1
|
||||
"@polkadot/networks": 12.2.2
|
||||
"@polkadot/util": 12.2.2
|
||||
"@polkadot/networks": 12.3.1
|
||||
"@polkadot/util": 12.3.1
|
||||
"@polkadot/wasm-crypto": ^7.2.1
|
||||
"@polkadot/wasm-util": ^7.2.1
|
||||
"@polkadot/x-bigint": 12.2.2
|
||||
"@polkadot/x-randomvalues": 12.2.2
|
||||
"@polkadot/x-bigint": 12.3.1
|
||||
"@polkadot/x-randomvalues": 12.3.1
|
||||
"@scure/base": 1.1.1
|
||||
tslib: ^2.5.3
|
||||
peerDependencies:
|
||||
"@polkadot/util": 12.2.2
|
||||
checksum: 06c8db2a46bb330ec8b65a92969f1ae795f72ca262f8b5d704d0b948fac4c692a9c62f502f6bb57603a7c802d84badd9a4f5ea5cb1b80f99fc4dad36262578fb
|
||||
"@polkadot/util": 12.3.1
|
||||
checksum: 87a76a4126b28f0c7caa3d52c194dc2a83f86ef9e7c5df5ccf5e1485969043b0a1acead28e8373c5168ba228b61f753dec444042c470ef2f8e5275980ea5a16c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util@npm:12.2.2, @polkadot/util@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/util@npm:12.2.2"
|
||||
"@polkadot/util@npm:12.3.1, @polkadot/util@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/util@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-bigint": 12.2.2
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-textdecoder": 12.2.2
|
||||
"@polkadot/x-textencoder": 12.2.2
|
||||
"@polkadot/x-bigint": 12.3.1
|
||||
"@polkadot/x-global": 12.3.1
|
||||
"@polkadot/x-textdecoder": 12.3.1
|
||||
"@polkadot/x-textencoder": 12.3.1
|
||||
"@types/bn.js": ^5.1.1
|
||||
bn.js: ^5.2.1
|
||||
tslib: ^2.5.3
|
||||
checksum: e15517e51d66cc2a695f56b7296bbc88441d7f98a20540b7ddd67c3f01cf71b058dcf15d44d6a0c6f6be221685bb20757b043a87ddf9721d92d23fe8fafae989
|
||||
checksum: e01c0633c1fd060bd193f5a55f08931b1183d0c3a99f03bb0d45258739870d6a433198042165c9862734666b6c8a2b925350a9f5e8e00942a88af326d50ea74a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -858,77 +858,77 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-bigint@npm:12.2.2, @polkadot/x-bigint@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-bigint@npm:12.2.2"
|
||||
"@polkadot/x-bigint@npm:12.3.1, @polkadot/x-bigint@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-bigint@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
checksum: 7416303c1213d38d2eed67950a9bec7872b742f714f55b71abed188d21f636b221fbe36c48714d42d19d450ba18da7ee104cd807c236cc912079de0553558538
|
||||
checksum: 911d1ff129ac3c48ac3242cb8e1cecacee29a45dc1e2435baad59464dd9d033ab74caaf12fb73e89e794cdb079afa01bd9c77d199bedc6462836b846f3de51b2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-fetch@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-fetch@npm:12.2.2"
|
||||
"@polkadot/x-fetch@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-fetch@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
node-fetch: ^3.3.1
|
||||
tslib: ^2.5.3
|
||||
checksum: 436dad2a518b1176eb8c1104b98e986e66ff462169e0f67df7289606940f78c0116e00cb382f09f4edf1eec3f7c26b68cdf01cabd6826fa1356247de0d8351e2
|
||||
checksum: 465fb748254201a130977e08b77779f8a1742dca4d7214146409eec9fa065cb8c80c0e10fbd3f4f438419b2cfa8f45cfd8b44c45b01a8ada198d4a9d439313d5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-global@npm:12.2.2, @polkadot/x-global@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-global@npm:12.2.2"
|
||||
"@polkadot/x-global@npm:12.3.1, @polkadot/x-global@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-global@npm:12.3.1"
|
||||
dependencies:
|
||||
tslib: ^2.5.3
|
||||
checksum: ddd04b2cc2833d0154928f0a61114ecb21c4cb220c5f72120f41063bceb654541048c38492b39cccb625cd198342017194f20e8d919747d4a23c26907bc97fde
|
||||
checksum: cd5428429595b457ec7149735bd6ca9c74645351388490332e7f6e4711123c46a279968a79e145dc2ab134d6e3b40ab0042caf6c23619b901aa1a9e7db956535
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-randomvalues@npm:12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-randomvalues@npm:12.2.2"
|
||||
"@polkadot/x-randomvalues@npm:12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-randomvalues@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
peerDependencies:
|
||||
"@polkadot/util": 12.2.2
|
||||
"@polkadot/util": 12.3.1
|
||||
"@polkadot/wasm-util": "*"
|
||||
checksum: 123be88954eb20bcd72216ddd5d05f60de16ef767cd488f08a5e02540210b4bc4a499db1ab433b953bda468c53a28132dc08e962a1b0d6fd4b837ae6db3ef90a
|
||||
checksum: 9557aa248b190be84f998547289dbf36ddac0edb7b41bf11095b37ccdd1be3bb7b2d0283ccf476491a9760664578f5f5d690996b08b93e395d7921d6e3f8288a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textdecoder@npm:12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-textdecoder@npm:12.2.2"
|
||||
"@polkadot/x-textdecoder@npm:12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-textdecoder@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
checksum: 5ab4703c1ef7170db8625413fc69e417f5faccabdfc99ffc44f4b0e27c60e8a30818ff2450342d9e9782735209491bb7a43893245f27c0e3ffd64aa4c781ddfc
|
||||
checksum: 81f6b33eb1bd11201a5fe2c750905ec6ec58fe0ca955e3d1785177e9c829f999f1b845a7d4b1b1e1f3bf7cfa7c5bd6cc11876c15ffbd9016ddc94edcb140dcd2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textencoder@npm:12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-textencoder@npm:12.2.2"
|
||||
"@polkadot/x-textencoder@npm:12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-textencoder@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
checksum: 0f13ddf178b945b9a5e7e1b617e3002611a4b94acc30c58d9db002054c0050c96dbf1c5666cd11bde3f4ad6ab79232264b72b77d7a3cb17e45d86a5cabfa57f3
|
||||
checksum: 42cd95519a2433ff1578cfe43db3f7a85373a5739eacba37ce5680df4015c337a103ec699558c99e5efbdd486fca8764b0a080ceec86b1faf712b1fe5c482a0e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-ws@npm:^12.2.2":
|
||||
version: 12.2.2
|
||||
resolution: "@polkadot/x-ws@npm:12.2.2"
|
||||
"@polkadot/x-ws@npm:^12.3.1":
|
||||
version: 12.3.1
|
||||
resolution: "@polkadot/x-ws@npm:12.3.1"
|
||||
dependencies:
|
||||
"@polkadot/x-global": 12.2.2
|
||||
"@polkadot/x-global": 12.3.1
|
||||
tslib: ^2.5.3
|
||||
ws: ^8.13.0
|
||||
checksum: 56b7846ac6df132ad24ee865d5caf667c5e3b5afe306dd3e931662e38b664dc646e53aa3649a1c3fda0516dc33f5aa3db599a47536f58a39119da3e1f664a382
|
||||
checksum: 9c29bb3326c434d36eabd40e7b5b6af776f63972e6c14d77204bad628210deffed693aa90eb9b07c1aad5da26be95997bc281384995e1da8ebf1383426c468fd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1358,14 +1358,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/eslint-plugin@npm:^5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:5.59.8"
|
||||
"@typescript-eslint/eslint-plugin@npm:^5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:5.59.9"
|
||||
dependencies:
|
||||
"@eslint-community/regexpp": ^4.4.0
|
||||
"@typescript-eslint/scope-manager": 5.59.8
|
||||
"@typescript-eslint/type-utils": 5.59.8
|
||||
"@typescript-eslint/utils": 5.59.8
|
||||
"@typescript-eslint/scope-manager": 5.59.9
|
||||
"@typescript-eslint/type-utils": 5.59.9
|
||||
"@typescript-eslint/utils": 5.59.9
|
||||
debug: ^4.3.4
|
||||
grapheme-splitter: ^1.0.4
|
||||
ignore: ^5.2.0
|
||||
@@ -1378,43 +1378,43 @@ __metadata:
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: 3e05cd06149ec3741c3c2fb638e2d19a55687b4614a5c8820433db82997687650297e51c17828d320162ccf4241798cf5712c405561e7605cb17e984a6967f7b
|
||||
checksum: bd2428e307085d7fa6699913b6e61d65eb450bbcd26f884390cbf16722b80e1d80dc289c72774be1cdffd022744894204c3242f40ba3ffdfa05d3f210c4130bb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/parser@npm:^5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/parser@npm:5.59.8"
|
||||
"@typescript-eslint/parser@npm:^5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/parser@npm:5.59.9"
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager": 5.59.8
|
||||
"@typescript-eslint/types": 5.59.8
|
||||
"@typescript-eslint/typescript-estree": 5.59.8
|
||||
"@typescript-eslint/scope-manager": 5.59.9
|
||||
"@typescript-eslint/types": 5.59.9
|
||||
"@typescript-eslint/typescript-estree": 5.59.9
|
||||
debug: ^4.3.4
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: bac9f09d8552086ceb882a7b87ce4d98dfaa41579249216c75d97e3fc07af33cddc4cbbd07a127a5823c826a258882643aaf658bec19cb2a434002b55c5f0d12
|
||||
checksum: 69b07d0a5bc6e1d24d23916c057ea9f2f53a0e7fb6dabadff92987c299640edee2c013fb93269322c7124e87b5c515529001397eae33006dfb40e1dcdf1902d7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/scope-manager@npm:5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/scope-manager@npm:5.59.8"
|
||||
"@typescript-eslint/scope-manager@npm:5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/scope-manager@npm:5.59.9"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.59.8
|
||||
"@typescript-eslint/visitor-keys": 5.59.8
|
||||
checksum: e1e810ee991cfeb433330b04ee949bb6784abe4dbdb7d9480aa7a7536671b4fec914b7803edf662516c8ecb1b31dcff126797f9923270a529c26e2b00b0ea96f
|
||||
"@typescript-eslint/types": 5.59.9
|
||||
"@typescript-eslint/visitor-keys": 5.59.9
|
||||
checksum: 362c22662d844440a7e14223d8cc0722f77ff21ad8f78deb0ee3b3f21de01b8846bf25fbbf527544677e83d8ff48008b3f7d40b39ddec55994ea4a1863e9ec0a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/type-utils@npm:5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/type-utils@npm:5.59.8"
|
||||
"@typescript-eslint/type-utils@npm:5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/type-utils@npm:5.59.9"
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree": 5.59.8
|
||||
"@typescript-eslint/utils": 5.59.8
|
||||
"@typescript-eslint/typescript-estree": 5.59.9
|
||||
"@typescript-eslint/utils": 5.59.9
|
||||
debug: ^4.3.4
|
||||
tsutils: ^3.21.0
|
||||
peerDependencies:
|
||||
@@ -1422,7 +1422,7 @@ __metadata:
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: d9fde31397da0f0e62a5568f64bad99d06bcd324b7e3aac7fd997a3d045a0fe4c084b2e85d440e0a39645acd2269ad6593f196399c2c0f880d293417fec894e3
|
||||
checksum: 6bc2619c5024c152b181eff1f44c9b5e7d0fc75ce9403f03b39d59fc1e13191b2fbaf6730f26a1caae22922ac47489f39c2cebccdd713588f6963169ed2a7958
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1433,19 +1433,19 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/types@npm:5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/types@npm:5.59.8"
|
||||
checksum: 559473d5601c849eb0da1874a2ac67c753480beed484ad6f6cda62fa6023273f2c3005c7f2864d9c2afb7c6356412d0d304b57db10c53597207f18a7f6cd4f18
|
||||
"@typescript-eslint/types@npm:5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/types@npm:5.59.9"
|
||||
checksum: 283f8fee1ee590eeccc2e0fcd3526c856c4b1e2841af2cdcd09eeac842a42cfb32f6bc8b40385380f3dbc3ee29da30f1819115eedf9e16f69ff5a160aeddd8fa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/typescript-estree@npm:5.59.8, @typescript-eslint/typescript-estree@npm:^5.13.0":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:5.59.8"
|
||||
"@typescript-eslint/typescript-estree@npm:5.59.9, @typescript-eslint/typescript-estree@npm:^5.13.0":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:5.59.9"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.59.8
|
||||
"@typescript-eslint/visitor-keys": 5.59.8
|
||||
"@typescript-eslint/types": 5.59.9
|
||||
"@typescript-eslint/visitor-keys": 5.59.9
|
||||
debug: ^4.3.4
|
||||
globby: ^11.1.0
|
||||
is-glob: ^4.0.3
|
||||
@@ -1454,7 +1454,7 @@ __metadata:
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: d93371cc866f573a6a1ddc0eb10d498a8e59f36763a99ce21da0737fff2b4c942eef1587216aad273f8d896ebc0b19003677cba63a27d2646aa2c087638963eb
|
||||
checksum: c0c9b81f20a2a4337f07bc3ccdc9c1dabd765f59096255ed9a149e91e5c9517b25c2b6655f8f073807cfc13500c7451fbd9bb62e5e572c07cc07945ab042db89
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1476,21 +1476,21 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/utils@npm:5.59.8, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.57.0":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/utils@npm:5.59.8"
|
||||
"@typescript-eslint/utils@npm:5.59.9, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.57.0":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/utils@npm:5.59.9"
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils": ^4.2.0
|
||||
"@types/json-schema": ^7.0.9
|
||||
"@types/semver": ^7.3.12
|
||||
"@typescript-eslint/scope-manager": 5.59.8
|
||||
"@typescript-eslint/types": 5.59.8
|
||||
"@typescript-eslint/typescript-estree": 5.59.8
|
||||
"@typescript-eslint/scope-manager": 5.59.9
|
||||
"@typescript-eslint/types": 5.59.9
|
||||
"@typescript-eslint/typescript-estree": 5.59.9
|
||||
eslint-scope: ^5.1.1
|
||||
semver: ^7.3.7
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
checksum: cbaa057485c7f52c45d0dfb4f5a8e9273abccb1c52dcb4426a79f9e71d2c1062cf2525bad6d4aca5ec42db3fe723d749843bcade5a323bde7fbe4b5d5b5d5c3b
|
||||
checksum: 22ec5962886de7dcf65f99c37aad9fb189a3bef6b2b07c81887fb82a0e8bf137246da58e64fb02141352285708440be13acd7f6db1ca19e96f86724813ac4646
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1504,13 +1504,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/visitor-keys@npm:5.59.8":
|
||||
version: 5.59.8
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:5.59.8"
|
||||
"@typescript-eslint/visitor-keys@npm:5.59.9":
|
||||
version: 5.59.9
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:5.59.9"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.59.8
|
||||
"@typescript-eslint/types": 5.59.9
|
||||
eslint-visitor-keys: ^3.3.0
|
||||
checksum: 6bfa7918dbb0e08d8a7404aeeef7bcd1a85736dc8d01614d267c0c5ec10f94d2746b50a945bf5c82c54fda67926e8deaeba8565c919da17f725fc11209ef8987
|
||||
checksum: 2909ce761f7fe546592cd3c43e33263d8a5fa619375fd2fdffbc72ffc33e40d6feacafb28c79f36c638fcc2225048e7cc08c61cbac6ca63723dc68610d80e3e6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7501,9 +7501,9 @@ fsevents@~2.3.2:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rollup@npm:^3.23.0":
|
||||
version: 3.23.0
|
||||
resolution: "rollup@npm:3.23.0"
|
||||
"rollup@npm:^3.24.0":
|
||||
version: 3.24.0
|
||||
resolution: "rollup@npm:3.24.0"
|
||||
dependencies:
|
||||
fsevents: ~2.3.2
|
||||
dependenciesMeta:
|
||||
@@ -7511,7 +7511,7 @@ fsevents@~2.3.2:
|
||||
optional: true
|
||||
bin:
|
||||
rollup: dist/bin/rollup
|
||||
checksum: 0721065cf725c5611815be61d2b01f20b4d0027e17035f6e76384d38396b56cf6ed21a3db78eb004d9db4d24c8a6a19da4563b4ff96b5dd36f0a0f7a3baf85e8
|
||||
checksum: 373d0062a79cfce3583d4f6b7ab8ac9aa3201a9af1fa20b24f61a4ddea95a45974c4a8baed3087cb4e7bfc34a9dcd6774b7a635eb071ba52f97f51a59e860d6e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7519,7 +7519,7 @@ fsevents@~2.3.2:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "root-workspace-0b6124@workspace:."
|
||||
dependencies:
|
||||
"@polkadot/dev": ^0.75.16
|
||||
"@polkadot/dev": ^0.75.19
|
||||
"@polkadot/typegen": "workspace:packages/typegen"
|
||||
"@types/node": ^20.2.5
|
||||
languageName: unknown
|
||||
@@ -8851,9 +8851,9 @@ fsevents@~2.3.2:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"webpack-cli@npm:^5.1.2":
|
||||
version: 5.1.2
|
||||
resolution: "webpack-cli@npm:5.1.2"
|
||||
"webpack-cli@npm:^5.1.4":
|
||||
version: 5.1.4
|
||||
resolution: "webpack-cli@npm:5.1.4"
|
||||
dependencies:
|
||||
"@discoveryjs/json-ext": ^0.5.0
|
||||
"@webpack-cli/configtest": ^2.1.1
|
||||
@@ -8879,7 +8879,7 @@ fsevents@~2.3.2:
|
||||
optional: true
|
||||
bin:
|
||||
webpack-cli: bin/cli.js
|
||||
checksum: 7bf33c82a6737dbf53294f467066395545884f648f44f961fbe16ed06d6c5fb3239ce51ad4b3af5b1ab038352a24861dbde8d92e0985a34c7bbd1893096b750e
|
||||
checksum: 3a4ad0d0342a6815c850ee4633cc2a8a5dae04f918e7847f180bf24ab400803cf8a8943707ffbed03eb20fe6ce647f996f60a2aade87b0b4a9954da3da172ce0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -8975,9 +8975,9 @@ fsevents@~2.3.2:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"webpack@npm:^5.85.0":
|
||||
version: 5.85.0
|
||||
resolution: "webpack@npm:5.85.0"
|
||||
"webpack@npm:^5.86.0":
|
||||
version: 5.86.0
|
||||
resolution: "webpack@npm:5.86.0"
|
||||
dependencies:
|
||||
"@types/eslint-scope": ^3.7.3
|
||||
"@types/estree": ^1.0.0
|
||||
@@ -9008,7 +9008,7 @@ fsevents@~2.3.2:
|
||||
optional: true
|
||||
bin:
|
||||
webpack: bin/webpack.js
|
||||
checksum: b013be9fbc7f6810d1f229f570c70710ddbc7290f817411acffe4214b2b6c783a041ab1f2005d9e1109f4ab21c136f0f8d8c067a5fb64f20a82dcbc1ee0d3f42
|
||||
checksum: 682b1aa8328bb9d52ae66a1d0a1078af88f9e3b3b3a9c9e1ce203e669581a8e61d522420ef253130eacd510d24d7275b840c1311d50bd048d6fd7c1af186ce55
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user