Split into types-augment (#4350)
* Aplit into types-augment * Adjust * Adjust, fix typegen run * Adjust * Rebuild * Adjust * Adjust * CC
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './lookup';
|
||||
import './registry';
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
import kusama from './kusama';
|
||||
import polkadot from './polkadot';
|
||||
import substrate from './substrate';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
// Not 100% sure it is relevant, however the order here is the same
|
||||
// as exposed in the typegen lookup order
|
||||
types: objectSpread({}, substrate, polkadot, kusama)
|
||||
} as Definitions;
|
||||
@@ -1,4 +0,0 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -1,208 +0,0 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Lookup73: kusama_runtime::ProxyType
|
||||
**/
|
||||
KusamaRuntimeProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction']
|
||||
},
|
||||
/**
|
||||
* Lookup102: polkadot_runtime_parachains::disputes::pallet::Event<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletEvent: {
|
||||
_enum: {
|
||||
DisputeInitiated: '(H256,PolkadotRuntimeParachainsDisputesDisputeLocation)',
|
||||
DisputeConcluded: '(H256,PolkadotRuntimeParachainsDisputesDisputeResult)',
|
||||
DisputeTimedOut: 'H256',
|
||||
Revert: 'u32'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup104: polkadot_runtime_parachains::disputes::DisputeLocation
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesDisputeLocation: {
|
||||
_enum: ['Local', 'Remote']
|
||||
},
|
||||
/**
|
||||
* Lookup105: polkadot_runtime_parachains::disputes::DisputeResult
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesDisputeResult: {
|
||||
_enum: ['Valid', 'Invalid']
|
||||
},
|
||||
/**
|
||||
* Lookup244: kusama_runtime::SessionKeys
|
||||
**/
|
||||
KusamaRuntimeSessionKeys: {
|
||||
grandpa: 'SpFinalityGrandpaAppPublic',
|
||||
babe: 'SpConsensusBabeAppPublic',
|
||||
imOnline: 'PalletImOnlineSr25519AppSr25519Public',
|
||||
paraValidator: 'PolkadotPrimitivesV0ValidatorAppPublic',
|
||||
paraAssignment: 'PolkadotPrimitivesV1AssignmentAppPublic',
|
||||
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
|
||||
},
|
||||
/**
|
||||
* Lookup317: kusama_runtime::OriginCaller
|
||||
**/
|
||||
KusamaRuntimeOriginCaller: {
|
||||
_enum: {
|
||||
system: 'FrameSystemRawOrigin',
|
||||
__Unused1: 'Null',
|
||||
__Unused2: 'Null',
|
||||
__Unused3: 'Null',
|
||||
__Unused4: 'Null',
|
||||
Void: 'SpCoreVoid',
|
||||
__Unused6: 'Null',
|
||||
__Unused7: 'Null',
|
||||
__Unused8: 'Null',
|
||||
__Unused9: 'Null',
|
||||
__Unused10: 'Null',
|
||||
__Unused11: 'Null',
|
||||
__Unused12: 'Null',
|
||||
__Unused13: 'Null',
|
||||
Council: 'PalletCollectiveRawOrigin',
|
||||
TechnicalCommittee: 'PalletCollectiveRawOrigin',
|
||||
__Unused16: 'Null',
|
||||
__Unused17: 'Null',
|
||||
__Unused18: 'Null',
|
||||
__Unused19: 'Null',
|
||||
__Unused20: 'Null',
|
||||
__Unused21: 'Null',
|
||||
__Unused22: 'Null',
|
||||
__Unused23: 'Null',
|
||||
__Unused24: 'Null',
|
||||
__Unused25: 'Null',
|
||||
__Unused26: 'Null',
|
||||
__Unused27: 'Null',
|
||||
__Unused28: 'Null',
|
||||
__Unused29: 'Null',
|
||||
__Unused30: 'Null',
|
||||
__Unused31: 'Null',
|
||||
__Unused32: 'Null',
|
||||
__Unused33: 'Null',
|
||||
__Unused34: 'Null',
|
||||
__Unused35: 'Null',
|
||||
__Unused36: 'Null',
|
||||
__Unused37: 'Null',
|
||||
__Unused38: 'Null',
|
||||
__Unused39: 'Null',
|
||||
__Unused40: 'Null',
|
||||
__Unused41: 'Null',
|
||||
__Unused42: 'Null',
|
||||
__Unused43: 'Null',
|
||||
__Unused44: 'Null',
|
||||
__Unused45: 'Null',
|
||||
__Unused46: 'Null',
|
||||
__Unused47: 'Null',
|
||||
__Unused48: 'Null',
|
||||
__Unused49: 'Null',
|
||||
ParachainsOrigin: 'PolkadotRuntimeParachainsOriginPalletOrigin',
|
||||
__Unused51: 'Null',
|
||||
__Unused52: 'Null',
|
||||
__Unused53: 'Null',
|
||||
__Unused54: 'Null',
|
||||
__Unused55: 'Null',
|
||||
__Unused56: 'Null',
|
||||
__Unused57: 'Null',
|
||||
__Unused58: 'Null',
|
||||
__Unused59: 'Null',
|
||||
__Unused60: 'Null',
|
||||
__Unused61: 'Null',
|
||||
__Unused62: 'Null',
|
||||
__Unused63: 'Null',
|
||||
__Unused64: 'Null',
|
||||
__Unused65: 'Null',
|
||||
__Unused66: 'Null',
|
||||
__Unused67: 'Null',
|
||||
__Unused68: 'Null',
|
||||
__Unused69: 'Null',
|
||||
__Unused70: 'Null',
|
||||
__Unused71: 'Null',
|
||||
__Unused72: 'Null',
|
||||
__Unused73: 'Null',
|
||||
__Unused74: 'Null',
|
||||
__Unused75: 'Null',
|
||||
__Unused76: 'Null',
|
||||
__Unused77: 'Null',
|
||||
__Unused78: 'Null',
|
||||
__Unused79: 'Null',
|
||||
__Unused80: 'Null',
|
||||
__Unused81: 'Null',
|
||||
__Unused82: 'Null',
|
||||
__Unused83: 'Null',
|
||||
__Unused84: 'Null',
|
||||
__Unused85: 'Null',
|
||||
__Unused86: 'Null',
|
||||
__Unused87: 'Null',
|
||||
__Unused88: 'Null',
|
||||
__Unused89: 'Null',
|
||||
__Unused90: 'Null',
|
||||
__Unused91: 'Null',
|
||||
__Unused92: 'Null',
|
||||
__Unused93: 'Null',
|
||||
__Unused94: 'Null',
|
||||
__Unused95: 'Null',
|
||||
__Unused96: 'Null',
|
||||
__Unused97: 'Null',
|
||||
__Unused98: 'Null',
|
||||
XcmPallet: 'PalletXcmOrigin'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup380: kusama_runtime::NposCompactSolution24
|
||||
**/
|
||||
KusamaRuntimeNposCompactSolution24: {
|
||||
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
|
||||
votes2: 'Vec<(Compact<u32>,(Compact<u16>,Compact<PerU16>),Compact<u16>)>',
|
||||
votes3: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);2],Compact<u16>)>',
|
||||
votes4: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);3],Compact<u16>)>',
|
||||
votes5: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);4],Compact<u16>)>',
|
||||
votes6: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);5],Compact<u16>)>',
|
||||
votes7: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);6],Compact<u16>)>',
|
||||
votes8: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);7],Compact<u16>)>',
|
||||
votes9: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);8],Compact<u16>)>',
|
||||
votes10: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);9],Compact<u16>)>',
|
||||
votes11: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);10],Compact<u16>)>',
|
||||
votes12: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);11],Compact<u16>)>',
|
||||
votes13: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);12],Compact<u16>)>',
|
||||
votes14: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);13],Compact<u16>)>',
|
||||
votes15: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);14],Compact<u16>)>',
|
||||
votes16: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);15],Compact<u16>)>',
|
||||
votes17: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);16],Compact<u16>)>',
|
||||
votes18: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);17],Compact<u16>)>',
|
||||
votes19: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);18],Compact<u16>)>',
|
||||
votes20: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);19],Compact<u16>)>',
|
||||
votes21: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);20],Compact<u16>)>',
|
||||
votes22: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);21],Compact<u16>)>',
|
||||
votes23: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);22],Compact<u16>)>',
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup499: polkadot_runtime_parachains::disputes::pallet::Call<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletCall: {
|
||||
_enum: ['force_unfreeze']
|
||||
},
|
||||
/**
|
||||
* Lookup679: polkadot_primitives::v1::DisputeState<N>
|
||||
**/
|
||||
PolkadotPrimitivesV1DisputeState: {
|
||||
validatorsFor: 'BitVec',
|
||||
validatorsAgainst: 'BitVec',
|
||||
start: 'u32',
|
||||
concludedAt: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup680: polkadot_runtime_parachains::disputes::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletError: {
|
||||
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
|
||||
},
|
||||
/**
|
||||
* Lookup715: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,131 +0,0 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
declare module '@polkadot/types/lookup' {
|
||||
import type { BitVec, Compact, Enum, Null, Option, Struct, Vec, u16, u32 } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { H256, PerU16 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name KusamaRuntimeProxyType (73) */
|
||||
export interface KusamaRuntimeProxyType extends Enum {
|
||||
readonly isAny: boolean;
|
||||
readonly isNonTransfer: boolean;
|
||||
readonly isGovernance: boolean;
|
||||
readonly isStaking: boolean;
|
||||
readonly isIdentityJudgement: boolean;
|
||||
readonly isCancelProxy: boolean;
|
||||
readonly isAuction: boolean;
|
||||
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (102) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletEvent extends Enum {
|
||||
readonly isDisputeInitiated: boolean;
|
||||
readonly asDisputeInitiated: ITuple<[H256, PolkadotRuntimeParachainsDisputesDisputeLocation]>;
|
||||
readonly isDisputeConcluded: boolean;
|
||||
readonly asDisputeConcluded: ITuple<[H256, PolkadotRuntimeParachainsDisputesDisputeResult]>;
|
||||
readonly isDisputeTimedOut: boolean;
|
||||
readonly asDisputeTimedOut: H256;
|
||||
readonly isRevert: boolean;
|
||||
readonly asRevert: u32;
|
||||
readonly type: 'DisputeInitiated' | 'DisputeConcluded' | 'DisputeTimedOut' | 'Revert';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (104) */
|
||||
export interface PolkadotRuntimeParachainsDisputesDisputeLocation extends Enum {
|
||||
readonly isLocal: boolean;
|
||||
readonly isRemote: boolean;
|
||||
readonly type: 'Local' | 'Remote';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (105) */
|
||||
export interface PolkadotRuntimeParachainsDisputesDisputeResult extends Enum {
|
||||
readonly isValid: boolean;
|
||||
readonly isInvalid: boolean;
|
||||
readonly type: 'Valid' | 'Invalid';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeSessionKeys (244) */
|
||||
export interface KusamaRuntimeSessionKeys extends Struct {
|
||||
readonly grandpa: SpFinalityGrandpaAppPublic;
|
||||
readonly babe: SpConsensusBabeAppPublic;
|
||||
readonly imOnline: PalletImOnlineSr25519AppSr25519Public;
|
||||
readonly paraValidator: PolkadotPrimitivesV0ValidatorAppPublic;
|
||||
readonly paraAssignment: PolkadotPrimitivesV1AssignmentAppPublic;
|
||||
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeOriginCaller (317) */
|
||||
export interface KusamaRuntimeOriginCaller extends Enum {
|
||||
readonly isSystem: boolean;
|
||||
readonly asSystem: FrameSystemRawOrigin;
|
||||
readonly isVoid: boolean;
|
||||
readonly isCouncil: boolean;
|
||||
readonly asCouncil: PalletCollectiveRawOrigin;
|
||||
readonly isTechnicalCommittee: boolean;
|
||||
readonly asTechnicalCommittee: PalletCollectiveRawOrigin;
|
||||
readonly isParachainsOrigin: boolean;
|
||||
readonly asParachainsOrigin: PolkadotRuntimeParachainsOriginPalletOrigin;
|
||||
readonly isXcmPallet: boolean;
|
||||
readonly asXcmPallet: PalletXcmOrigin;
|
||||
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (380) */
|
||||
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
|
||||
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
|
||||
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
|
||||
readonly votes3: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes4: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes5: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes6: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes7: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes8: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes9: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes10: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes11: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes12: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes13: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes14: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes15: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes16: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes17: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes18: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes19: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes20: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes21: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes22: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes23: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletCall (499) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletCall extends Enum {
|
||||
readonly isForceUnfreeze: boolean;
|
||||
readonly type: 'ForceUnfreeze';
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV1DisputeState (679) */
|
||||
export interface PolkadotPrimitivesV1DisputeState extends Struct {
|
||||
readonly validatorsFor: BitVec;
|
||||
readonly validatorsAgainst: BitVec;
|
||||
readonly start: u32;
|
||||
readonly concludedAt: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletError (680) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
|
||||
readonly isDuplicateDisputeStatementSets: boolean;
|
||||
readonly isAncientDisputeStatement: boolean;
|
||||
readonly isValidatorIndexOutOfBounds: boolean;
|
||||
readonly isInvalidSignature: boolean;
|
||||
readonly isDuplicateStatement: boolean;
|
||||
readonly isPotentialSpam: boolean;
|
||||
readonly isSingleSidedDispute: boolean;
|
||||
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'PotentialSpam' | 'SingleSidedDispute';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (715) */
|
||||
export type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './types-substrate';
|
||||
import './types-polkadot';
|
||||
import './types-kusama';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/types-augment';
|
||||
|
||||
import type { Compact, Option } from './codec';
|
||||
import type { AccountId, BlockAttestations, SessionKeys7 } from './interfaces';
|
||||
import type { Bytes, u32 } from './primitive';
|
||||
|
||||
@@ -51,7 +51,7 @@ function getVariantStringIdx ({ index }: SiVariant): string {
|
||||
}
|
||||
|
||||
// create error mapping from metadata
|
||||
function injectErrors (_: Registry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, RegistryError>>): void {
|
||||
function injectErrors (_: TypeRegistry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, RegistryError>>): void {
|
||||
clearRecord(result);
|
||||
|
||||
for (let i = 0; i < pallets.length; i++) {
|
||||
@@ -76,7 +76,7 @@ function injectErrors (_: Registry, { lookup, pallets }: MetadataLatest, version
|
||||
}
|
||||
|
||||
// create event classes from metadata
|
||||
function injectEvents (registry: CodecRegistry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, CodecClass<GenericEventData>>>): void {
|
||||
function injectEvents (registry: TypeRegistry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, CodecClass<GenericEventData>>>): void {
|
||||
const filtered = pallets.filter(filterEventsSome);
|
||||
|
||||
clearRecord(result);
|
||||
@@ -99,7 +99,7 @@ function injectEvents (registry: CodecRegistry, { lookup, pallets }: MetadataLat
|
||||
}
|
||||
|
||||
// create extrinsic mapping from metadata
|
||||
function injectExtrinsics (registry: CodecRegistry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, CallFunction>>): void {
|
||||
function injectExtrinsics (registry: TypeRegistry, { lookup, pallets }: MetadataLatest, version: number, result: Record<string, Record<string, CallFunction>>): void {
|
||||
const filtered = pallets.filter(filterCallsSome);
|
||||
|
||||
clearRecord(result);
|
||||
@@ -117,7 +117,7 @@ function injectExtrinsics (registry: CodecRegistry, { lookup, pallets }: Metadat
|
||||
}
|
||||
|
||||
// extract additional properties from the metadata
|
||||
function extractProperties (registry: CodecRegistry, metadata: Metadata): ChainProperties | undefined {
|
||||
function extractProperties (registry: TypeRegistry, metadata: Metadata): ChainProperties | undefined {
|
||||
const original = (registry as Registry).getChainProperties();
|
||||
const constants = decorateConstants(registry, metadata.asLatest, metadata.version);
|
||||
const ss58Format = constants.system && (constants.system.sS58Prefix || constants.system.ss58Prefix);
|
||||
@@ -128,7 +128,7 @@ function extractProperties (registry: CodecRegistry, metadata: Metadata): ChainP
|
||||
|
||||
const { tokenDecimals, tokenSymbol } = original || {};
|
||||
|
||||
return (registry as Registry).createType('ChainProperties', { ss58Format, tokenDecimals, tokenSymbol });
|
||||
return registry.createTypeUnsafe<ChainProperties>('ChainProperties', [{ ss58Format, tokenDecimals, tokenSymbol }]);
|
||||
}
|
||||
|
||||
export class TypeRegistry implements Registry {
|
||||
@@ -286,8 +286,8 @@ export class TypeRegistry implements Registry {
|
||||
/**
|
||||
* @description Creates an instance of a type as registered
|
||||
*/
|
||||
public createTypeUnsafe <T extends Codec = Codec, K extends string = string, R = DetectCodec<T, K>> (type: K, params: unknown[], options?: CreateOptions): R {
|
||||
return createTypeUnsafe(this, type, params, options) as unknown as R;
|
||||
public createTypeUnsafe <T extends Codec = Codec, K extends string = string> (type: K, params: unknown[], options?: CreateOptions): T {
|
||||
return createTypeUnsafe(this, type, params, options);
|
||||
}
|
||||
|
||||
// find a specific call
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// augment the registry
|
||||
import '@polkadot/types/augment';
|
||||
|
||||
// used inside augmented definitions
|
||||
export type { Observable } from 'rxjs';
|
||||
export * from '@polkadot/types/types/registry';
|
||||
|
||||
@@ -17,6 +17,11 @@ import type { DetectCodec } from './detect';
|
||||
|
||||
export type { RegistryTypes } from '@polkadot/types-codec/types';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface InterfaceTypes {
|
||||
// augmented inside @polkadot/types-augment
|
||||
}
|
||||
|
||||
export type CodecHasher = (data: Uint8Array) => Uint8Array;
|
||||
|
||||
export interface ChainUpgradeVersion {
|
||||
|
||||
Reference in New Issue
Block a user