Metadata v14 types (#3765)
* Metadata v14 types * Linting w/ CHANGELOG * Previous-gen SiType as SiType0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainProperties, ContractDisplayName, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces';
|
||||
import type { ChainProperties, ContractDisplayName, SiField, SiLookupTypeId, SiType0, SiTypeDefArray, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces';
|
||||
import type { InterfaceTypes, TypeDef } from '@polkadot/types/types';
|
||||
|
||||
import { TypeDefInfo, TypeRegistry, withTypeString } from '@polkadot/types';
|
||||
@@ -29,7 +29,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
|
||||
public readonly typeOffset;
|
||||
|
||||
#siTypes: SiType[] = [];
|
||||
#siTypes: SiType0[] = [];
|
||||
|
||||
constructor (metadataVersion: string, chainProperties?: ChainProperties) {
|
||||
super();
|
||||
@@ -44,7 +44,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public setMetaTypes (metaTypes: SiType[]): void {
|
||||
public setMetaTypes (metaTypes: SiType0[]): void {
|
||||
this.#siTypes = metaTypes;
|
||||
}
|
||||
|
||||
@@ -83,15 +83,15 @@ export class MetaRegistry extends TypeRegistry {
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
#getMetaType = (id: SiLookupTypeId): SiType => {
|
||||
#getMetaType = (id: SiLookupTypeId): SiType0 => {
|
||||
const type = this.#siTypes[getRegistryOffset(id, this.typeOffset)];
|
||||
|
||||
assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
|
||||
|
||||
return this.createType('SiType', type);
|
||||
return this.createType('SiType0', type);
|
||||
}
|
||||
|
||||
#extract = (type: SiType, id: SiLookupTypeId): TypeDef => {
|
||||
#extract = (type: SiType0, id: SiLookupTypeId): TypeDef => {
|
||||
const path = [...type.path];
|
||||
const isPrimitivePath = !!path.length && (
|
||||
(path.length > 2 && path[0].eq('ink_env') && path[1].eq('types')) ||
|
||||
@@ -174,7 +174,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitive = (type: SiType): TypeDef => {
|
||||
#extractPrimitive = (type: SiType0): TypeDef => {
|
||||
const typeStr = type.def.asPrimitive.type.toString();
|
||||
|
||||
return {
|
||||
@@ -183,7 +183,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitivePath = (type: SiType): TypeDef => {
|
||||
#extractPrimitivePath = (type: SiType0): TypeDef => {
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: type.path[type.path.length - 1].toString()
|
||||
|
||||
@@ -21,7 +21,7 @@ function consts (api: ApiPromise): void {
|
||||
console.log(
|
||||
api.consts.foo.bar,
|
||||
api.consts.balances.existentialDeposit.toNumber(),
|
||||
api.consts.balances.existentialDeposit.meta.documentation.map((s): string => s.toString()).join('')
|
||||
api.consts.balances.existentialDeposit.meta.docs.map((s): string => s.toString()).join('')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes,
|
||||
|
||||
const items = constants
|
||||
.sort(compareName)
|
||||
.map(({ documentation, name, type }) => {
|
||||
.map(({ docs, name, type }) => {
|
||||
const returnType = formatType(allDefs, type.toString(), imports);
|
||||
|
||||
setImports(allDefs, imports, [returnType]);
|
||||
|
||||
return {
|
||||
docs: documentation,
|
||||
docs,
|
||||
name: stringCamelCase(name),
|
||||
type: returnType
|
||||
};
|
||||
|
||||
@@ -24,8 +24,8 @@ function generateForMeta (meta: Metadata, dest: string, isStrict: boolean): void
|
||||
.map(({ errors, name }) => ({
|
||||
items: errors
|
||||
.sort(compareName)
|
||||
.map(({ documentation, name }) => ({
|
||||
docs: documentation,
|
||||
.map(({ docs, name }) => ({
|
||||
docs,
|
||||
name: name.toString()
|
||||
})),
|
||||
name: stringCamelCase(name)
|
||||
|
||||
@@ -30,13 +30,13 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes,
|
||||
items: events
|
||||
.unwrap()
|
||||
.sort(compareName)
|
||||
.map(({ args, documentation, name }) => {
|
||||
.map(({ args, docs, name }) => {
|
||||
const types = args.map((type) => formatType(allDefs, type.toString(), imports));
|
||||
|
||||
setImports(allDefs, imports, types);
|
||||
|
||||
return {
|
||||
docs: documentation,
|
||||
docs,
|
||||
name: name.toString(),
|
||||
type: types.join(', ')
|
||||
};
|
||||
|
||||
@@ -107,7 +107,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
|
||||
|
||||
return {
|
||||
args,
|
||||
docs: storageEntry.documentation,
|
||||
docs: storageEntry.docs,
|
||||
entryType: 'AugmentedQuery',
|
||||
name: stringCamelCase(storageEntry.name),
|
||||
params,
|
||||
|
||||
@@ -44,7 +44,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
|
||||
|
||||
const items = calls.unwrap()
|
||||
.sort(compareName)
|
||||
.map(({ args, documentation, name }) => {
|
||||
.map(({ args, docs, name }) => {
|
||||
const params = args
|
||||
.map(({ name, type }) => {
|
||||
const typeStr = type.toString();
|
||||
@@ -58,7 +58,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
|
||||
|
||||
return {
|
||||
args: args.map(({ type }) => formatType(allDefs, type.toString(), imports)).join(', '),
|
||||
docs: documentation,
|
||||
docs,
|
||||
name: stringCamelCase(name),
|
||||
params
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ const DESC_RPC = 'The following sections contain RPC methods that are Remote Cal
|
||||
const DESC_STORAGE = `The following sections contain Storage methods are part of the default Substrate runtime. On the api, these are exposed via \`api.query.<module>.<method>\`. ${STATIC_TEXT}`;
|
||||
|
||||
/** @internal */
|
||||
function documentationVecToMarkdown (docLines: Vec<Text>, indent = 0): string {
|
||||
function docsVecToMarkdown (docLines: Vec<Text>, indent = 0): string {
|
||||
const md = docLines
|
||||
.map((docLine) => docLine && docLine.substring(1)) // trim the leading space
|
||||
.reduce((md, docLine): string => // generate paragraphs
|
||||
@@ -94,7 +94,7 @@ function renderPage (page: Page): string {
|
||||
md += `\n- **${bullet}**: ${
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
item[bullet] instanceof Vec
|
||||
? documentationVecToMarkdown(item[bullet] as Vec<Text>, 2).toString()
|
||||
? docsVecToMarkdown(item[bullet] as Vec<Text>, 2).toString()
|
||||
: item[bullet]
|
||||
}`;
|
||||
});
|
||||
@@ -180,7 +180,7 @@ function addConstants (metadata: MetadataLatest): string {
|
||||
return {
|
||||
interface: '`' + `api.consts.${sectionName}.${methodName}` + '`',
|
||||
name: `${methodName}: ` + '`' + func.type.toString() + '`',
|
||||
...(func.documentation.length && { summary: func.documentation })
|
||||
...(func.docs.length && { summary: func.docs })
|
||||
};
|
||||
}),
|
||||
name: sectionName
|
||||
@@ -216,7 +216,7 @@ function addStorage (metadata: MetadataLatest): string {
|
||||
return {
|
||||
interface: '`' + `api.query.${sectionName}.${methodName}` + '`',
|
||||
name: `${methodName}(${arg}): ` + '`' + outputType + '`',
|
||||
...(func.documentation.length && { summary: func.documentation })
|
||||
...(func.docs.length && { summary: func.docs })
|
||||
};
|
||||
}),
|
||||
name: sectionName
|
||||
@@ -239,7 +239,7 @@ function addStorage (metadata: MetadataLatest): string {
|
||||
return {
|
||||
interface: '`' + `api.query.substrate.${methodName}` + '`',
|
||||
name: `${methodName}(${arg}): ` + '`' + outputType + '`',
|
||||
summary: meta.documentation
|
||||
summary: meta.docs
|
||||
};
|
||||
}),
|
||||
name: 'substrate'
|
||||
@@ -268,7 +268,7 @@ function addExtrinsics (metadata: MetadataLatest): string {
|
||||
return {
|
||||
interface: '`' + `api.tx.${sectionName}.${methodName}` + '`',
|
||||
name: `${methodName}(${args})`,
|
||||
...(func.documentation.length && { summary: func.documentation })
|
||||
...(func.docs.length && { summary: func.docs })
|
||||
};
|
||||
}),
|
||||
name: sectionName
|
||||
@@ -295,7 +295,7 @@ function addEvents (metadata: MetadataLatest): string {
|
||||
return {
|
||||
interface: '`' + `api.events.${stringCamelCase(meta.name)}.${methodName}.is` + '`',
|
||||
name: `${methodName}(${args})`,
|
||||
...(func.documentation.length && { summary: func.documentation })
|
||||
...(func.docs.length && { summary: func.docs })
|
||||
};
|
||||
}),
|
||||
name: stringCamelCase(meta.name)
|
||||
@@ -317,7 +317,7 @@ function addErrors (metadata: MetadataLatest): string {
|
||||
.map((error) => ({
|
||||
interface: '`' + `api.errors.${stringCamelCase(moduleMetadata.name)}.${error.name.toString()}.is` + '`',
|
||||
name: error.name.toString(),
|
||||
...(error.documentation.length && { summary: error.documentation })
|
||||
...(error.docs.length && { summary: error.docs })
|
||||
})),
|
||||
name: stringLowerFirst(moduleMetadata.name)
|
||||
})),
|
||||
|
||||
@@ -32,7 +32,7 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A
|
||||
import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement } from '@polkadot/types/interfaces/identity';
|
||||
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
|
||||
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
|
||||
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataV14, PalletConstantMetadataV14, PalletErrorMetadataV14, PalletEventMetadataV14, PalletMetadataV14, PalletStorageMetadataV14, PortableRegistry, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
|
||||
@@ -44,7 +44,7 @@ import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/
|
||||
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { SiField, SiLookupTypeId, SiPath, SiType, SiType0, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPhantom, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
@@ -454,6 +454,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<ExtrinsicMetadataV11>': Option<ExtrinsicMetadataV11>;
|
||||
'Option<ExtrinsicMetadataV12>': Option<ExtrinsicMetadataV12>;
|
||||
'Option<ExtrinsicMetadataV13>': Option<ExtrinsicMetadataV13>;
|
||||
'Option<ExtrinsicMetadataV14>': Option<ExtrinsicMetadataV14>;
|
||||
'Option<ExtrinsicOrHash>': Option<ExtrinsicOrHash>;
|
||||
'Option<ExtrinsicPayload>': Option<ExtrinsicPayload>;
|
||||
'Option<ExtrinsicPayloadUnknown>': Option<ExtrinsicPayloadUnknown>;
|
||||
@@ -480,12 +481,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<FunctionArgumentMetadataV11>': Option<FunctionArgumentMetadataV11>;
|
||||
'Option<FunctionArgumentMetadataV12>': Option<FunctionArgumentMetadataV12>;
|
||||
'Option<FunctionArgumentMetadataV13>': Option<FunctionArgumentMetadataV13>;
|
||||
'Option<FunctionArgumentMetadataV14>': Option<FunctionArgumentMetadataV14>;
|
||||
'Option<FunctionArgumentMetadataV9>': Option<FunctionArgumentMetadataV9>;
|
||||
'Option<FunctionMetadataLatest>': Option<FunctionMetadataLatest>;
|
||||
'Option<FunctionMetadataV10>': Option<FunctionMetadataV10>;
|
||||
'Option<FunctionMetadataV11>': Option<FunctionMetadataV11>;
|
||||
'Option<FunctionMetadataV12>': Option<FunctionMetadataV12>;
|
||||
'Option<FunctionMetadataV13>': Option<FunctionMetadataV13>;
|
||||
'Option<FunctionMetadataV14>': Option<FunctionMetadataV14>;
|
||||
'Option<FunctionMetadataV9>': Option<FunctionMetadataV9>;
|
||||
'Option<FundIndex>': Option<FundIndex>;
|
||||
'Option<FundInfo>': Option<FundInfo>;
|
||||
@@ -603,6 +606,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<MetadataV11>': Option<MetadataV11>;
|
||||
'Option<MetadataV12>': Option<MetadataV12>;
|
||||
'Option<MetadataV13>': Option<MetadataV13>;
|
||||
'Option<MetadataV14>': Option<MetadataV14>;
|
||||
'Option<MetadataV9>': Option<MetadataV9>;
|
||||
'Option<MmrLeafProof>': Option<MmrLeafProof>;
|
||||
'Option<MmrRootHash>': Option<MmrRootHash>;
|
||||
@@ -671,8 +675,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<Owner>': Option<Owner>;
|
||||
'Option<PageCounter>': Option<PageCounter>;
|
||||
'Option<PageIndexData>': Option<PageIndexData>;
|
||||
'Option<PalletCallMetadataV14>': Option<PalletCallMetadataV14>;
|
||||
'Option<PalletConstantMetadataV14>': Option<PalletConstantMetadataV14>;
|
||||
'Option<PalletErrorMetadataV14>': Option<PalletErrorMetadataV14>;
|
||||
'Option<PalletEventMetadataV14>': Option<PalletEventMetadataV14>;
|
||||
'Option<PalletId>': Option<PalletId>;
|
||||
'Option<PalletMetadataV14>': Option<PalletMetadataV14>;
|
||||
'Option<PalletsOrigin>': Option<PalletsOrigin>;
|
||||
'Option<PalletStorageMetadataV14>': Option<PalletStorageMetadataV14>;
|
||||
'Option<PalletVersion>': Option<PalletVersion>;
|
||||
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
|
||||
'Option<ParachainInherentData>': Option<ParachainInherentData>;
|
||||
@@ -716,6 +726,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<PhragmenScore>': Option<PhragmenScore>;
|
||||
'Option<PluralityJunction>': Option<PluralityJunction>;
|
||||
'Option<Points>': Option<Points>;
|
||||
'Option<PortableRegistry>': Option<PortableRegistry>;
|
||||
'Option<Precommits>': Option<Precommits>;
|
||||
'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
|
||||
'Option<PrefixedStorageKey>': Option<PrefixedStorageKey>;
|
||||
@@ -833,6 +844,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<SignedBlock>': Option<SignedBlock>;
|
||||
'Option<SignedBlockWithJustification>': Option<SignedBlockWithJustification>;
|
||||
'Option<SignedBlockWithJustifications>': Option<SignedBlockWithJustifications>;
|
||||
'Option<SignedExtensionMetadataV14>': Option<SignedExtensionMetadataV14>;
|
||||
'Option<SignedSubmission>': Option<SignedSubmission>;
|
||||
'Option<SignedSubmissionOf>': Option<SignedSubmissionOf>;
|
||||
'Option<SignerPayload>': Option<SignerPayload>;
|
||||
@@ -840,13 +852,18 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<SiLookupTypeId>': Option<SiLookupTypeId>;
|
||||
'Option<SiPath>': Option<SiPath>;
|
||||
'Option<SiType>': Option<SiType>;
|
||||
'Option<SiType0>': Option<SiType0>;
|
||||
'Option<SiTypeDef>': Option<SiTypeDef>;
|
||||
'Option<SiTypeDefArray>': Option<SiTypeDefArray>;
|
||||
'Option<SiTypeDefBitSequence>': Option<SiTypeDefBitSequence>;
|
||||
'Option<SiTypeDefCompact>': Option<SiTypeDefCompact>;
|
||||
'Option<SiTypeDefComposite>': Option<SiTypeDefComposite>;
|
||||
'Option<SiTypeDefPhantom>': Option<SiTypeDefPhantom>;
|
||||
'Option<SiTypeDefPrimitive>': Option<SiTypeDefPrimitive>;
|
||||
'Option<SiTypeDefSequence>': Option<SiTypeDefSequence>;
|
||||
'Option<SiTypeDefTuple>': Option<SiTypeDefTuple>;
|
||||
'Option<SiTypeDefVariant>': Option<SiTypeDefVariant>;
|
||||
'Option<SiTypeParameter>': Option<SiTypeParameter>;
|
||||
'Option<SiVariant>': Option<SiVariant>;
|
||||
'Option<SlashingSpans>': Option<SlashingSpans>;
|
||||
'Option<SlashingSpansTo204>': Option<SlashingSpansTo204>;
|
||||
@@ -874,24 +891,28 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<StorageEntryMetadataV11>': Option<StorageEntryMetadataV11>;
|
||||
'Option<StorageEntryMetadataV12>': Option<StorageEntryMetadataV12>;
|
||||
'Option<StorageEntryMetadataV13>': Option<StorageEntryMetadataV13>;
|
||||
'Option<StorageEntryMetadataV14>': Option<StorageEntryMetadataV14>;
|
||||
'Option<StorageEntryMetadataV9>': Option<StorageEntryMetadataV9>;
|
||||
'Option<StorageEntryModifierLatest>': Option<StorageEntryModifierLatest>;
|
||||
'Option<StorageEntryModifierV10>': Option<StorageEntryModifierV10>;
|
||||
'Option<StorageEntryModifierV11>': Option<StorageEntryModifierV11>;
|
||||
'Option<StorageEntryModifierV12>': Option<StorageEntryModifierV12>;
|
||||
'Option<StorageEntryModifierV13>': Option<StorageEntryModifierV13>;
|
||||
'Option<StorageEntryModifierV14>': Option<StorageEntryModifierV14>;
|
||||
'Option<StorageEntryModifierV9>': Option<StorageEntryModifierV9>;
|
||||
'Option<StorageEntryTypeLatest>': Option<StorageEntryTypeLatest>;
|
||||
'Option<StorageEntryTypeV10>': Option<StorageEntryTypeV10>;
|
||||
'Option<StorageEntryTypeV11>': Option<StorageEntryTypeV11>;
|
||||
'Option<StorageEntryTypeV12>': Option<StorageEntryTypeV12>;
|
||||
'Option<StorageEntryTypeV13>': Option<StorageEntryTypeV13>;
|
||||
'Option<StorageEntryTypeV14>': Option<StorageEntryTypeV14>;
|
||||
'Option<StorageEntryTypeV9>': Option<StorageEntryTypeV9>;
|
||||
'Option<StorageHasher>': Option<StorageHasher>;
|
||||
'Option<StorageHasherV10>': Option<StorageHasherV10>;
|
||||
'Option<StorageHasherV11>': Option<StorageHasherV11>;
|
||||
'Option<StorageHasherV12>': Option<StorageHasherV12>;
|
||||
'Option<StorageHasherV13>': Option<StorageHasherV13>;
|
||||
'Option<StorageHasherV14>': Option<StorageHasherV14>;
|
||||
'Option<StorageHasherV9>': Option<StorageHasherV9>;
|
||||
'Option<StorageKey>': Option<StorageKey>;
|
||||
'Option<StorageKind>': Option<StorageKind>;
|
||||
@@ -1324,6 +1345,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<ExtrinsicMetadataV11>': Vec<ExtrinsicMetadataV11>;
|
||||
'Vec<ExtrinsicMetadataV12>': Vec<ExtrinsicMetadataV12>;
|
||||
'Vec<ExtrinsicMetadataV13>': Vec<ExtrinsicMetadataV13>;
|
||||
'Vec<ExtrinsicMetadataV14>': Vec<ExtrinsicMetadataV14>;
|
||||
'Vec<ExtrinsicOrHash>': Vec<ExtrinsicOrHash>;
|
||||
'Vec<ExtrinsicPayload>': Vec<ExtrinsicPayload>;
|
||||
'Vec<ExtrinsicPayloadUnknown>': Vec<ExtrinsicPayloadUnknown>;
|
||||
@@ -1350,12 +1372,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<FunctionArgumentMetadataV11>': Vec<FunctionArgumentMetadataV11>;
|
||||
'Vec<FunctionArgumentMetadataV12>': Vec<FunctionArgumentMetadataV12>;
|
||||
'Vec<FunctionArgumentMetadataV13>': Vec<FunctionArgumentMetadataV13>;
|
||||
'Vec<FunctionArgumentMetadataV14>': Vec<FunctionArgumentMetadataV14>;
|
||||
'Vec<FunctionArgumentMetadataV9>': Vec<FunctionArgumentMetadataV9>;
|
||||
'Vec<FunctionMetadataLatest>': Vec<FunctionMetadataLatest>;
|
||||
'Vec<FunctionMetadataV10>': Vec<FunctionMetadataV10>;
|
||||
'Vec<FunctionMetadataV11>': Vec<FunctionMetadataV11>;
|
||||
'Vec<FunctionMetadataV12>': Vec<FunctionMetadataV12>;
|
||||
'Vec<FunctionMetadataV13>': Vec<FunctionMetadataV13>;
|
||||
'Vec<FunctionMetadataV14>': Vec<FunctionMetadataV14>;
|
||||
'Vec<FunctionMetadataV9>': Vec<FunctionMetadataV9>;
|
||||
'Vec<FundIndex>': Vec<FundIndex>;
|
||||
'Vec<FundInfo>': Vec<FundInfo>;
|
||||
@@ -1473,6 +1497,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<MetadataV11>': Vec<MetadataV11>;
|
||||
'Vec<MetadataV12>': Vec<MetadataV12>;
|
||||
'Vec<MetadataV13>': Vec<MetadataV13>;
|
||||
'Vec<MetadataV14>': Vec<MetadataV14>;
|
||||
'Vec<MetadataV9>': Vec<MetadataV9>;
|
||||
'Vec<MmrLeafProof>': Vec<MmrLeafProof>;
|
||||
'Vec<MmrRootHash>': Vec<MmrRootHash>;
|
||||
@@ -1541,8 +1566,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<Owner>': Vec<Owner>;
|
||||
'Vec<PageCounter>': Vec<PageCounter>;
|
||||
'Vec<PageIndexData>': Vec<PageIndexData>;
|
||||
'Vec<PalletCallMetadataV14>': Vec<PalletCallMetadataV14>;
|
||||
'Vec<PalletConstantMetadataV14>': Vec<PalletConstantMetadataV14>;
|
||||
'Vec<PalletErrorMetadataV14>': Vec<PalletErrorMetadataV14>;
|
||||
'Vec<PalletEventMetadataV14>': Vec<PalletEventMetadataV14>;
|
||||
'Vec<PalletId>': Vec<PalletId>;
|
||||
'Vec<PalletMetadataV14>': Vec<PalletMetadataV14>;
|
||||
'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
|
||||
'Vec<PalletStorageMetadataV14>': Vec<PalletStorageMetadataV14>;
|
||||
'Vec<PalletVersion>': Vec<PalletVersion>;
|
||||
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
|
||||
'Vec<ParachainInherentData>': Vec<ParachainInherentData>;
|
||||
@@ -1586,6 +1617,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<PhragmenScore>': Vec<PhragmenScore>;
|
||||
'Vec<PluralityJunction>': Vec<PluralityJunction>;
|
||||
'Vec<Points>': Vec<Points>;
|
||||
'Vec<PortableRegistry>': Vec<PortableRegistry>;
|
||||
'Vec<Precommits>': Vec<Precommits>;
|
||||
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
|
||||
'Vec<PrefixedStorageKey>': Vec<PrefixedStorageKey>;
|
||||
@@ -1703,6 +1735,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<SignedBlock>': Vec<SignedBlock>;
|
||||
'Vec<SignedBlockWithJustification>': Vec<SignedBlockWithJustification>;
|
||||
'Vec<SignedBlockWithJustifications>': Vec<SignedBlockWithJustifications>;
|
||||
'Vec<SignedExtensionMetadataV14>': Vec<SignedExtensionMetadataV14>;
|
||||
'Vec<SignedSubmission>': Vec<SignedSubmission>;
|
||||
'Vec<SignedSubmissionOf>': Vec<SignedSubmissionOf>;
|
||||
'Vec<SignerPayload>': Vec<SignerPayload>;
|
||||
@@ -1710,13 +1743,18 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<SiLookupTypeId>': Vec<SiLookupTypeId>;
|
||||
'Vec<SiPath>': Vec<SiPath>;
|
||||
'Vec<SiType>': Vec<SiType>;
|
||||
'Vec<SiType0>': Vec<SiType0>;
|
||||
'Vec<SiTypeDef>': Vec<SiTypeDef>;
|
||||
'Vec<SiTypeDefArray>': Vec<SiTypeDefArray>;
|
||||
'Vec<SiTypeDefBitSequence>': Vec<SiTypeDefBitSequence>;
|
||||
'Vec<SiTypeDefCompact>': Vec<SiTypeDefCompact>;
|
||||
'Vec<SiTypeDefComposite>': Vec<SiTypeDefComposite>;
|
||||
'Vec<SiTypeDefPhantom>': Vec<SiTypeDefPhantom>;
|
||||
'Vec<SiTypeDefPrimitive>': Vec<SiTypeDefPrimitive>;
|
||||
'Vec<SiTypeDefSequence>': Vec<SiTypeDefSequence>;
|
||||
'Vec<SiTypeDefTuple>': Vec<SiTypeDefTuple>;
|
||||
'Vec<SiTypeDefVariant>': Vec<SiTypeDefVariant>;
|
||||
'Vec<SiTypeParameter>': Vec<SiTypeParameter>;
|
||||
'Vec<SiVariant>': Vec<SiVariant>;
|
||||
'Vec<SlashingSpans>': Vec<SlashingSpans>;
|
||||
'Vec<SlashingSpansTo204>': Vec<SlashingSpansTo204>;
|
||||
@@ -1744,24 +1782,28 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<StorageEntryMetadataV11>': Vec<StorageEntryMetadataV11>;
|
||||
'Vec<StorageEntryMetadataV12>': Vec<StorageEntryMetadataV12>;
|
||||
'Vec<StorageEntryMetadataV13>': Vec<StorageEntryMetadataV13>;
|
||||
'Vec<StorageEntryMetadataV14>': Vec<StorageEntryMetadataV14>;
|
||||
'Vec<StorageEntryMetadataV9>': Vec<StorageEntryMetadataV9>;
|
||||
'Vec<StorageEntryModifierLatest>': Vec<StorageEntryModifierLatest>;
|
||||
'Vec<StorageEntryModifierV10>': Vec<StorageEntryModifierV10>;
|
||||
'Vec<StorageEntryModifierV11>': Vec<StorageEntryModifierV11>;
|
||||
'Vec<StorageEntryModifierV12>': Vec<StorageEntryModifierV12>;
|
||||
'Vec<StorageEntryModifierV13>': Vec<StorageEntryModifierV13>;
|
||||
'Vec<StorageEntryModifierV14>': Vec<StorageEntryModifierV14>;
|
||||
'Vec<StorageEntryModifierV9>': Vec<StorageEntryModifierV9>;
|
||||
'Vec<StorageEntryTypeLatest>': Vec<StorageEntryTypeLatest>;
|
||||
'Vec<StorageEntryTypeV10>': Vec<StorageEntryTypeV10>;
|
||||
'Vec<StorageEntryTypeV11>': Vec<StorageEntryTypeV11>;
|
||||
'Vec<StorageEntryTypeV12>': Vec<StorageEntryTypeV12>;
|
||||
'Vec<StorageEntryTypeV13>': Vec<StorageEntryTypeV13>;
|
||||
'Vec<StorageEntryTypeV14>': Vec<StorageEntryTypeV14>;
|
||||
'Vec<StorageEntryTypeV9>': Vec<StorageEntryTypeV9>;
|
||||
'Vec<StorageHasher>': Vec<StorageHasher>;
|
||||
'Vec<StorageHasherV10>': Vec<StorageHasherV10>;
|
||||
'Vec<StorageHasherV11>': Vec<StorageHasherV11>;
|
||||
'Vec<StorageHasherV12>': Vec<StorageHasherV12>;
|
||||
'Vec<StorageHasherV13>': Vec<StorageHasherV13>;
|
||||
'Vec<StorageHasherV14>': Vec<StorageHasherV14>;
|
||||
'Vec<StorageHasherV9>': Vec<StorageHasherV9>;
|
||||
'Vec<StorageKey>': Vec<StorageKey>;
|
||||
'Vec<StorageKind>': Vec<StorageKind>;
|
||||
@@ -2194,6 +2236,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ExtrinsicMetadataV11: ExtrinsicMetadataV11;
|
||||
ExtrinsicMetadataV12: ExtrinsicMetadataV12;
|
||||
ExtrinsicMetadataV13: ExtrinsicMetadataV13;
|
||||
ExtrinsicMetadataV14: ExtrinsicMetadataV14;
|
||||
ExtrinsicOrHash: ExtrinsicOrHash;
|
||||
ExtrinsicPayload: ExtrinsicPayload;
|
||||
ExtrinsicPayloadUnknown: ExtrinsicPayloadUnknown;
|
||||
@@ -2220,12 +2263,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
FunctionArgumentMetadataV11: FunctionArgumentMetadataV11;
|
||||
FunctionArgumentMetadataV12: FunctionArgumentMetadataV12;
|
||||
FunctionArgumentMetadataV13: FunctionArgumentMetadataV13;
|
||||
FunctionArgumentMetadataV14: FunctionArgumentMetadataV14;
|
||||
FunctionArgumentMetadataV9: FunctionArgumentMetadataV9;
|
||||
FunctionMetadataLatest: FunctionMetadataLatest;
|
||||
FunctionMetadataV10: FunctionMetadataV10;
|
||||
FunctionMetadataV11: FunctionMetadataV11;
|
||||
FunctionMetadataV12: FunctionMetadataV12;
|
||||
FunctionMetadataV13: FunctionMetadataV13;
|
||||
FunctionMetadataV14: FunctionMetadataV14;
|
||||
FunctionMetadataV9: FunctionMetadataV9;
|
||||
FundIndex: FundIndex;
|
||||
FundInfo: FundInfo;
|
||||
@@ -2343,6 +2388,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
MetadataV11: MetadataV11;
|
||||
MetadataV12: MetadataV12;
|
||||
MetadataV13: MetadataV13;
|
||||
MetadataV14: MetadataV14;
|
||||
MetadataV9: MetadataV9;
|
||||
MmrLeafProof: MmrLeafProof;
|
||||
MmrRootHash: MmrRootHash;
|
||||
@@ -2411,8 +2457,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
Owner: Owner;
|
||||
PageCounter: PageCounter;
|
||||
PageIndexData: PageIndexData;
|
||||
PalletCallMetadataV14: PalletCallMetadataV14;
|
||||
PalletConstantMetadataV14: PalletConstantMetadataV14;
|
||||
PalletErrorMetadataV14: PalletErrorMetadataV14;
|
||||
PalletEventMetadataV14: PalletEventMetadataV14;
|
||||
PalletId: PalletId;
|
||||
PalletMetadataV14: PalletMetadataV14;
|
||||
PalletsOrigin: PalletsOrigin;
|
||||
PalletStorageMetadataV14: PalletStorageMetadataV14;
|
||||
PalletVersion: PalletVersion;
|
||||
ParachainDispatchOrigin: ParachainDispatchOrigin;
|
||||
ParachainInherentData: ParachainInherentData;
|
||||
@@ -2456,6 +2508,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
PhragmenScore: PhragmenScore;
|
||||
PluralityJunction: PluralityJunction;
|
||||
Points: Points;
|
||||
PortableRegistry: PortableRegistry;
|
||||
Precommits: Precommits;
|
||||
PrefabWasmModule: PrefabWasmModule;
|
||||
PrefixedStorageKey: PrefixedStorageKey;
|
||||
@@ -2573,6 +2626,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
SignedBlock: SignedBlock;
|
||||
SignedBlockWithJustification: SignedBlockWithJustification;
|
||||
SignedBlockWithJustifications: SignedBlockWithJustifications;
|
||||
SignedExtensionMetadataV14: SignedExtensionMetadataV14;
|
||||
SignedSubmission: SignedSubmission;
|
||||
SignedSubmissionOf: SignedSubmissionOf;
|
||||
SignerPayload: SignerPayload;
|
||||
@@ -2580,13 +2634,18 @@ declare module '@polkadot/types/types/registry' {
|
||||
SiLookupTypeId: SiLookupTypeId;
|
||||
SiPath: SiPath;
|
||||
SiType: SiType;
|
||||
SiType0: SiType0;
|
||||
SiTypeDef: SiTypeDef;
|
||||
SiTypeDefArray: SiTypeDefArray;
|
||||
SiTypeDefBitSequence: SiTypeDefBitSequence;
|
||||
SiTypeDefCompact: SiTypeDefCompact;
|
||||
SiTypeDefComposite: SiTypeDefComposite;
|
||||
SiTypeDefPhantom: SiTypeDefPhantom;
|
||||
SiTypeDefPrimitive: SiTypeDefPrimitive;
|
||||
SiTypeDefSequence: SiTypeDefSequence;
|
||||
SiTypeDefTuple: SiTypeDefTuple;
|
||||
SiTypeDefVariant: SiTypeDefVariant;
|
||||
SiTypeParameter: SiTypeParameter;
|
||||
SiVariant: SiVariant;
|
||||
SlashingSpans: SlashingSpans;
|
||||
SlashingSpansTo204: SlashingSpansTo204;
|
||||
@@ -2614,24 +2673,28 @@ declare module '@polkadot/types/types/registry' {
|
||||
StorageEntryMetadataV11: StorageEntryMetadataV11;
|
||||
StorageEntryMetadataV12: StorageEntryMetadataV12;
|
||||
StorageEntryMetadataV13: StorageEntryMetadataV13;
|
||||
StorageEntryMetadataV14: StorageEntryMetadataV14;
|
||||
StorageEntryMetadataV9: StorageEntryMetadataV9;
|
||||
StorageEntryModifierLatest: StorageEntryModifierLatest;
|
||||
StorageEntryModifierV10: StorageEntryModifierV10;
|
||||
StorageEntryModifierV11: StorageEntryModifierV11;
|
||||
StorageEntryModifierV12: StorageEntryModifierV12;
|
||||
StorageEntryModifierV13: StorageEntryModifierV13;
|
||||
StorageEntryModifierV14: StorageEntryModifierV14;
|
||||
StorageEntryModifierV9: StorageEntryModifierV9;
|
||||
StorageEntryTypeLatest: StorageEntryTypeLatest;
|
||||
StorageEntryTypeV10: StorageEntryTypeV10;
|
||||
StorageEntryTypeV11: StorageEntryTypeV11;
|
||||
StorageEntryTypeV12: StorageEntryTypeV12;
|
||||
StorageEntryTypeV13: StorageEntryTypeV13;
|
||||
StorageEntryTypeV14: StorageEntryTypeV14;
|
||||
StorageEntryTypeV9: StorageEntryTypeV9;
|
||||
StorageHasher: StorageHasher;
|
||||
StorageHasherV10: StorageHasherV10;
|
||||
StorageHasherV11: StorageHasherV11;
|
||||
StorageHasherV12: StorageHasherV12;
|
||||
StorageHasherV13: StorageHasherV13;
|
||||
StorageHasherV14: StorageHasherV14;
|
||||
StorageHasherV9: StorageHasherV9;
|
||||
StorageKey: StorageKey;
|
||||
StorageKind: StorageKind;
|
||||
|
||||
@@ -34,11 +34,11 @@ function injectErrors (_: Registry, metadata: Metadata, metadataErrors: Record<s
|
||||
const sectionIndex = metadata.version >= 12 ? section.index.toNumber() : _sectionIndex;
|
||||
const sectionName = stringCamelCase(section.name);
|
||||
|
||||
section.errors.forEach(({ documentation, name }, index): void => {
|
||||
section.errors.forEach(({ docs, name }, index): void => {
|
||||
const eventIndex = new Uint8Array([sectionIndex, index]);
|
||||
|
||||
metadataErrors[u8aToHex(eventIndex)] = {
|
||||
documentation: documentation.map((d) => d.toString()),
|
||||
docs: docs.map((d) => d.toString()),
|
||||
index,
|
||||
method: name.toString(),
|
||||
name: name.toString(),
|
||||
|
||||
@@ -235,7 +235,7 @@ export class GenericCall<A extends AnyTuple = AnyTuple> extends Struct implement
|
||||
method: call?.method,
|
||||
section: call?.section,
|
||||
...(isExpanded && call
|
||||
? { documentation: call.meta.documentation.map((d) => d.toString()) }
|
||||
? { docs: call.meta.docs.map((d) => d.toString()) }
|
||||
: {}
|
||||
)
|
||||
};
|
||||
|
||||
@@ -156,7 +156,7 @@ export class GenericEvent extends Struct implements IEvent<Codec[]> {
|
||||
method: this.method,
|
||||
section: this.section,
|
||||
...(isExpanded
|
||||
? { documentation: this.meta.documentation.map((d) => d.toString()) }
|
||||
? { docs: this.meta.docs.map((d) => d.toString()) }
|
||||
: {}
|
||||
),
|
||||
...super.toHuman(isExpanded)
|
||||
|
||||
@@ -110,17 +110,21 @@ export default {
|
||||
source: 'ContractProjectSource',
|
||||
contract: 'ContractProjectContract',
|
||||
// expanded scale registry: RegistryReadOnly
|
||||
types: 'Vec<SiType>',
|
||||
// NOTE Previous generation of the SiType definition
|
||||
types: 'Vec<SiType0>',
|
||||
// renamed from layout (ignored for now, incomplete)
|
||||
// storage: 'ContractStorageLayout',
|
||||
spec: 'ContractContractSpec'
|
||||
},
|
||||
ContractProjectContract: {
|
||||
_alias: {
|
||||
docs: 'documentation'
|
||||
},
|
||||
name: 'Text',
|
||||
version: 'Text',
|
||||
authors: 'Vec<Text>',
|
||||
description: 'Option<Text>',
|
||||
documentation: 'Option<Text>',
|
||||
docs: 'Option<Text>',
|
||||
repository: 'Option<Text>',
|
||||
homepage: 'Option<Text>',
|
||||
license: 'Option<Text>'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { BTreeMap, Bytes, Enum, Option, Raw, Struct, Text, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
|
||||
import type { SiLookupTypeId, SiPath, SiType } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { SiLookupTypeId, SiPath, SiType0 } from '@polkadot/types/interfaces/scaleInfo';
|
||||
|
||||
/** @name ContractConstructorSpec */
|
||||
export interface ContractConstructorSpec extends Struct {
|
||||
@@ -118,7 +118,7 @@ export interface ContractProject extends Struct {
|
||||
readonly metadataVersion: Text;
|
||||
readonly source: ContractProjectSource;
|
||||
readonly contract: ContractProjectContract;
|
||||
readonly types: Vec<SiType>;
|
||||
readonly types: Vec<SiType0>;
|
||||
readonly spec: ContractContractSpec;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ export interface ContractProjectContract extends Struct {
|
||||
readonly version: Text;
|
||||
readonly authors: Vec<Text>;
|
||||
readonly description: Option<Text>;
|
||||
readonly documentation: Option<Text>;
|
||||
readonly docs: Option<Text>;
|
||||
readonly repository: Option<Text>;
|
||||
readonly homepage: Option<Text>;
|
||||
readonly license: Option<Text>;
|
||||
|
||||
@@ -6,294 +6,25 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
export const AllHashers = {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Blake2_128Concat: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null,
|
||||
// new in v11
|
||||
Identity: null
|
||||
};
|
||||
import { AllHashers } from './hashers';
|
||||
import { v9 } from './v9';
|
||||
import { v10 } from './v10';
|
||||
import { v11 } from './v11';
|
||||
import { v12 } from './v12';
|
||||
import { v13 } from './v13';
|
||||
import { v14 } from './v14';
|
||||
|
||||
export { AllHashers };
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
types: {
|
||||
// v9
|
||||
ErrorMetadataV9: {
|
||||
name: 'Text',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
EventMetadataV9: {
|
||||
name: 'Text',
|
||||
args: 'Vec<Type>',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
FunctionArgumentMetadataV9: {
|
||||
name: 'Text',
|
||||
type: 'Type'
|
||||
},
|
||||
FunctionMetadataV9: {
|
||||
name: 'Text',
|
||||
args: 'Vec<FunctionArgumentMetadataV9>',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
MetadataV9: {
|
||||
modules: 'Vec<ModuleMetadataV9>'
|
||||
},
|
||||
ModuleConstantMetadataV9: {
|
||||
name: 'Text',
|
||||
type: 'Type',
|
||||
value: 'Bytes',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
ModuleMetadataV9: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV9>',
|
||||
calls: 'Option<Vec<FunctionMetadataV9>>',
|
||||
events: 'Option<Vec<EventMetadataV9>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV9>',
|
||||
errors: 'Vec<ErrorMetadataV9>'
|
||||
},
|
||||
StorageEntryMetadataV9: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV9',
|
||||
type: 'StorageEntryTypeV9',
|
||||
fallback: 'Bytes',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryModifierV9: {
|
||||
_enum: ['Optional', 'Default', 'Required']
|
||||
},
|
||||
StorageEntryTypeV9: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV9',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV9',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV9'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageHasherV9: {
|
||||
_enum: {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null
|
||||
}
|
||||
},
|
||||
StorageMetadataV9: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV9>'
|
||||
},
|
||||
|
||||
// v10
|
||||
ErrorMetadataV10: 'ErrorMetadataV9',
|
||||
EventMetadataV10: 'EventMetadataV9',
|
||||
FunctionArgumentMetadataV10: 'FunctionArgumentMetadataV9',
|
||||
FunctionMetadataV10: 'FunctionMetadataV9',
|
||||
MetadataV10: {
|
||||
modules: 'Vec<ModuleMetadataV10>'
|
||||
},
|
||||
ModuleConstantMetadataV10: 'ModuleConstantMetadataV9',
|
||||
ModuleMetadataV10: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV10>',
|
||||
calls: 'Option<Vec<FunctionMetadataV10>>',
|
||||
events: 'Option<Vec<EventMetadataV10>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV10>',
|
||||
errors: 'Vec<ErrorMetadataV10>'
|
||||
},
|
||||
StorageEntryModifierV10: 'StorageEntryModifierV9',
|
||||
StorageEntryMetadataV10: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV10',
|
||||
type: 'StorageEntryTypeV10',
|
||||
fallback: 'Bytes',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV10: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV10',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV10',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV10'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV10: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV10>'
|
||||
},
|
||||
StorageHasherV10: {
|
||||
_enum: {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Blake2_128Concat: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null
|
||||
}
|
||||
},
|
||||
|
||||
// v11
|
||||
ErrorMetadataV11: 'ErrorMetadataV10',
|
||||
EventMetadataV11: 'EventMetadataV10',
|
||||
ExtrinsicMetadataV11: {
|
||||
version: 'u8',
|
||||
signedExtensions: 'Vec<Text>'
|
||||
},
|
||||
FunctionArgumentMetadataV11: 'FunctionArgumentMetadataV10',
|
||||
FunctionMetadataV11: 'FunctionMetadataV10',
|
||||
MetadataV11: {
|
||||
modules: 'Vec<ModuleMetadataV11>',
|
||||
extrinsic: 'ExtrinsicMetadataV11'
|
||||
},
|
||||
ModuleConstantMetadataV11: 'ModuleConstantMetadataV10',
|
||||
ModuleMetadataV11: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV11>',
|
||||
calls: 'Option<Vec<FunctionMetadataV11>>',
|
||||
events: 'Option<Vec<EventMetadataV11>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV11>',
|
||||
errors: 'Vec<ErrorMetadataV11>'
|
||||
},
|
||||
StorageEntryModifierV11: 'StorageEntryModifierV10',
|
||||
StorageEntryMetadataV11: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV11',
|
||||
type: 'StorageEntryTypeV11',
|
||||
fallback: 'Bytes',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV11: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV11',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV11',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV11'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV11: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV11>'
|
||||
},
|
||||
StorageHasherV11: {
|
||||
_enum: AllHashers
|
||||
},
|
||||
|
||||
// v12
|
||||
ErrorMetadataV12: 'ErrorMetadataV11',
|
||||
EventMetadataV12: 'EventMetadataV11',
|
||||
ExtrinsicMetadataV12: 'ExtrinsicMetadataV11',
|
||||
FunctionArgumentMetadataV12: 'FunctionArgumentMetadataV11',
|
||||
FunctionMetadataV12: 'FunctionMetadataV11',
|
||||
MetadataV12: {
|
||||
modules: 'Vec<ModuleMetadataV12>',
|
||||
extrinsic: 'ExtrinsicMetadataV12'
|
||||
},
|
||||
ModuleConstantMetadataV12: 'ModuleConstantMetadataV11',
|
||||
ModuleMetadataV12: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV12>',
|
||||
calls: 'Option<Vec<FunctionMetadataV12>>',
|
||||
events: 'Option<Vec<EventMetadataV12>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV12>',
|
||||
errors: 'Vec<ErrorMetadataV12>',
|
||||
index: 'u8'
|
||||
},
|
||||
StorageEntryModifierV12: 'StorageEntryModifierV11',
|
||||
StorageEntryMetadataV12: 'StorageEntryMetadataV11',
|
||||
StorageEntryTypeV12: 'StorageEntryTypeV11',
|
||||
StorageMetadataV12: 'StorageMetadataV11',
|
||||
StorageHasherV12: 'StorageHasherV11',
|
||||
|
||||
// v13
|
||||
ErrorMetadataV13: 'ErrorMetadataV12',
|
||||
EventMetadataV13: 'EventMetadataV12',
|
||||
ExtrinsicMetadataV13: 'ExtrinsicMetadataV12',
|
||||
FunctionArgumentMetadataV13: 'FunctionArgumentMetadataV12',
|
||||
FunctionMetadataV13: 'FunctionMetadataV12',
|
||||
MetadataV13: {
|
||||
modules: 'Vec<ModuleMetadataV13>',
|
||||
extrinsic: 'ExtrinsicMetadataV13'
|
||||
},
|
||||
ModuleConstantMetadataV13: 'ModuleConstantMetadataV12',
|
||||
ModuleMetadataV13: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV13>',
|
||||
calls: 'Option<Vec<FunctionMetadataV13>>',
|
||||
events: 'Option<Vec<EventMetadataV13>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV13>',
|
||||
errors: 'Vec<ErrorMetadataV13>',
|
||||
index: 'u8'
|
||||
},
|
||||
StorageEntryModifierV13: 'StorageEntryModifierV12',
|
||||
StorageEntryMetadataV13: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV13',
|
||||
type: 'StorageEntryTypeV13',
|
||||
fallback: 'Bytes',
|
||||
documentation: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV13: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV13',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV13',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV13'
|
||||
},
|
||||
NMap: {
|
||||
keyVec: 'Vec<Type>',
|
||||
hashers: 'Vec<StorageHasherV13>',
|
||||
value: 'Type'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV13: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV13>'
|
||||
},
|
||||
StorageHasherV13: 'StorageHasherV12',
|
||||
...v9,
|
||||
...v10,
|
||||
...v11,
|
||||
...v12,
|
||||
...v13,
|
||||
...v14,
|
||||
|
||||
// This always maps to the latest
|
||||
ErrorMetadataLatest: 'ErrorMetadataV13',
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
export const AllHashers = {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Blake2_128Concat: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null,
|
||||
// new in v11
|
||||
Identity: null
|
||||
};
|
||||
@@ -2,6 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Bytes, Enum, Option, Struct, Text, Type, Vec, bool, u8 } from '@polkadot/types';
|
||||
import type { SiLookupTypeId, SiType } from '@polkadot/types/interfaces/scaleInfo';
|
||||
|
||||
/** @name ErrorMetadataLatest */
|
||||
export interface ErrorMetadataLatest extends ErrorMetadataV13 {}
|
||||
@@ -21,7 +22,7 @@ export interface ErrorMetadataV13 extends ErrorMetadataV12 {}
|
||||
/** @name ErrorMetadataV9 */
|
||||
export interface ErrorMetadataV9 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name EventMetadataLatest */
|
||||
@@ -43,7 +44,7 @@ export interface EventMetadataV13 extends EventMetadataV12 {}
|
||||
export interface EventMetadataV9 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly args: Vec<Type>;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name ExtrinsicMetadataLatest */
|
||||
@@ -61,6 +62,13 @@ export interface ExtrinsicMetadataV12 extends ExtrinsicMetadataV11 {}
|
||||
/** @name ExtrinsicMetadataV13 */
|
||||
export interface ExtrinsicMetadataV13 extends ExtrinsicMetadataV12 {}
|
||||
|
||||
/** @name ExtrinsicMetadataV14 */
|
||||
export interface ExtrinsicMetadataV14 extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly version: u8;
|
||||
readonly signedExtensions: Vec<SignedExtensionMetadataV14>;
|
||||
}
|
||||
|
||||
/** @name FunctionArgumentMetadataLatest */
|
||||
export interface FunctionArgumentMetadataLatest extends FunctionArgumentMetadataV13 {}
|
||||
|
||||
@@ -76,6 +84,12 @@ export interface FunctionArgumentMetadataV12 extends FunctionArgumentMetadataV11
|
||||
/** @name FunctionArgumentMetadataV13 */
|
||||
export interface FunctionArgumentMetadataV13 extends FunctionArgumentMetadataV12 {}
|
||||
|
||||
/** @name FunctionArgumentMetadataV14 */
|
||||
export interface FunctionArgumentMetadataV14 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name FunctionArgumentMetadataV9 */
|
||||
export interface FunctionArgumentMetadataV9 extends Struct {
|
||||
readonly name: Text;
|
||||
@@ -97,11 +111,18 @@ export interface FunctionMetadataV12 extends FunctionMetadataV11 {}
|
||||
/** @name FunctionMetadataV13 */
|
||||
export interface FunctionMetadataV13 extends FunctionMetadataV12 {}
|
||||
|
||||
/** @name FunctionMetadataV14 */
|
||||
export interface FunctionMetadataV14 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly args: Vec<FunctionArgumentMetadataV14>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name FunctionMetadataV9 */
|
||||
export interface FunctionMetadataV9 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly args: Vec<FunctionArgumentMetadataV9>;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name MetadataAll */
|
||||
@@ -144,6 +165,13 @@ export interface MetadataV13 extends Struct {
|
||||
readonly extrinsic: ExtrinsicMetadataV13;
|
||||
}
|
||||
|
||||
/** @name MetadataV14 */
|
||||
export interface MetadataV14 extends Struct {
|
||||
readonly types: PortableRegistry;
|
||||
readonly pallets: Vec<PalletMetadataV14>;
|
||||
readonly extrinsic: ExtrinsicMetadataV14;
|
||||
}
|
||||
|
||||
/** @name MetadataV9 */
|
||||
export interface MetadataV9 extends Struct {
|
||||
readonly modules: Vec<ModuleMetadataV9>;
|
||||
@@ -169,7 +197,7 @@ export interface ModuleConstantMetadataV9 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly type: Type;
|
||||
readonly value: Bytes;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name ModuleMetadataLatest */
|
||||
@@ -227,6 +255,58 @@ export interface ModuleMetadataV9 extends Struct {
|
||||
readonly errors: Vec<ErrorMetadataV9>;
|
||||
}
|
||||
|
||||
/** @name PalletCallMetadataV14 */
|
||||
export interface PalletCallMetadataV14 extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly calls: Vec<FunctionMetadataV14>;
|
||||
}
|
||||
|
||||
/** @name PalletConstantMetadataV14 */
|
||||
export interface PalletConstantMetadataV14 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly value: Bytes;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name PalletErrorMetadataV14 */
|
||||
export interface PalletErrorMetadataV14 extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name PalletEventMetadataV14 */
|
||||
export interface PalletEventMetadataV14 extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name PalletMetadataV14 */
|
||||
export interface PalletMetadataV14 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly storage: Option<PalletStorageMetadataV14>;
|
||||
readonly calls: Option<PalletCallMetadataV14>;
|
||||
readonly events: Option<PalletEventMetadataV14>;
|
||||
readonly constants: Vec<PalletConstantMetadataV14>;
|
||||
readonly errors: Option<PalletErrorMetadataV14>;
|
||||
readonly index: u8;
|
||||
}
|
||||
|
||||
/** @name PalletStorageMetadataV14 */
|
||||
export interface PalletStorageMetadataV14 extends Struct {
|
||||
readonly prefix: Text;
|
||||
readonly items: Vec<StorageEntryMetadataV14>;
|
||||
}
|
||||
|
||||
/** @name PortableRegistry */
|
||||
export interface PortableRegistry extends Struct {
|
||||
readonly types: Vec<SiType>;
|
||||
}
|
||||
|
||||
/** @name SignedExtensionMetadataV14 */
|
||||
export interface SignedExtensionMetadataV14 extends Struct {
|
||||
readonly identifier: Text;
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataLatest */
|
||||
export interface StorageEntryMetadataLatest extends StorageEntryMetadataV13 {}
|
||||
|
||||
@@ -236,7 +316,7 @@ export interface StorageEntryMetadataV10 extends Struct {
|
||||
readonly modifier: StorageEntryModifierV10;
|
||||
readonly type: StorageEntryTypeV10;
|
||||
readonly fallback: Bytes;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataV11 */
|
||||
@@ -245,7 +325,7 @@ export interface StorageEntryMetadataV11 extends Struct {
|
||||
readonly modifier: StorageEntryModifierV11;
|
||||
readonly type: StorageEntryTypeV11;
|
||||
readonly fallback: Bytes;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataV12 */
|
||||
@@ -257,7 +337,16 @@ export interface StorageEntryMetadataV13 extends Struct {
|
||||
readonly modifier: StorageEntryModifierV13;
|
||||
readonly type: StorageEntryTypeV13;
|
||||
readonly fallback: Bytes;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataV14 */
|
||||
export interface StorageEntryMetadataV14 extends Struct {
|
||||
readonly name: Text;
|
||||
readonly modifier: StorageEntryModifierV14;
|
||||
readonly type: StorageEntryTypeV14;
|
||||
readonly fallback: Bytes;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataV9 */
|
||||
@@ -266,7 +355,7 @@ export interface StorageEntryMetadataV9 extends Struct {
|
||||
readonly modifier: StorageEntryModifierV9;
|
||||
readonly type: StorageEntryTypeV9;
|
||||
readonly fallback: Bytes;
|
||||
readonly documentation: Vec<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name StorageEntryModifierLatest */
|
||||
@@ -284,6 +373,9 @@ export interface StorageEntryModifierV12 extends StorageEntryModifierV11 {}
|
||||
/** @name StorageEntryModifierV13 */
|
||||
export interface StorageEntryModifierV13 extends StorageEntryModifierV12 {}
|
||||
|
||||
/** @name StorageEntryModifierV14 */
|
||||
export interface StorageEntryModifierV14 extends StorageEntryModifierV13 {}
|
||||
|
||||
/** @name StorageEntryModifierV9 */
|
||||
export interface StorageEntryModifierV9 extends Enum {
|
||||
readonly isOptional: boolean;
|
||||
@@ -329,6 +421,18 @@ export interface StorageEntryTypeV13 extends Enum {
|
||||
readonly asNMap: { keyVec: Vec<Type>; hashers: Vec<StorageHasherV13>; value: Type; } & Struct;
|
||||
}
|
||||
|
||||
/** @name StorageEntryTypeV14 */
|
||||
export interface StorageEntryTypeV14 extends Enum {
|
||||
readonly isPlain: boolean;
|
||||
readonly asPlain: SiLookupTypeId;
|
||||
readonly isMap: boolean;
|
||||
readonly asMap: { hasher: StorageHasherV14; key: SiLookupTypeId; value: SiLookupTypeId; } & Struct;
|
||||
readonly isDoubleMap: boolean;
|
||||
readonly asDoubleMap: { hasher: StorageHasherV14; key1: SiLookupTypeId; key2: SiLookupTypeId; value: SiLookupTypeId; key2Hasher: StorageHasherV14; } & Struct;
|
||||
readonly isNMap: boolean;
|
||||
readonly asNMap: { key: SiLookupTypeId; hashers: Vec<StorageHasherV14>; value: SiLookupTypeId; } & Struct;
|
||||
}
|
||||
|
||||
/** @name StorageEntryTypeV9 */
|
||||
export interface StorageEntryTypeV9 extends Enum {
|
||||
readonly isPlain: boolean;
|
||||
@@ -369,6 +473,9 @@ export interface StorageHasherV12 extends StorageHasherV11 {}
|
||||
/** @name StorageHasherV13 */
|
||||
export interface StorageHasherV13 extends StorageHasherV12 {}
|
||||
|
||||
/** @name StorageHasherV14 */
|
||||
export interface StorageHasherV14 extends StorageHasherV13 {}
|
||||
|
||||
/** @name StorageHasherV9 */
|
||||
export interface StorageHasherV9 extends Enum {
|
||||
readonly isBlake2128: boolean;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
export const v10: DefinitionsTypes = {
|
||||
// v10
|
||||
ErrorMetadataV10: 'ErrorMetadataV9',
|
||||
EventMetadataV10: 'EventMetadataV9',
|
||||
FunctionArgumentMetadataV10: 'FunctionArgumentMetadataV9',
|
||||
FunctionMetadataV10: 'FunctionMetadataV9',
|
||||
MetadataV10: {
|
||||
modules: 'Vec<ModuleMetadataV10>'
|
||||
},
|
||||
ModuleConstantMetadataV10: 'ModuleConstantMetadataV9',
|
||||
ModuleMetadataV10: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV10>',
|
||||
calls: 'Option<Vec<FunctionMetadataV10>>',
|
||||
events: 'Option<Vec<EventMetadataV10>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV10>',
|
||||
errors: 'Vec<ErrorMetadataV10>'
|
||||
},
|
||||
StorageEntryModifierV10: 'StorageEntryModifierV9',
|
||||
StorageEntryMetadataV10: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV10',
|
||||
type: 'StorageEntryTypeV10',
|
||||
fallback: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV10: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV10',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV10',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV10'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV10: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV10>'
|
||||
},
|
||||
StorageHasherV10: {
|
||||
_enum: {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Blake2_128Concat: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
import { AllHashers } from './hashers';
|
||||
|
||||
export const v11: DefinitionsTypes = {
|
||||
// v11
|
||||
ErrorMetadataV11: 'ErrorMetadataV10',
|
||||
EventMetadataV11: 'EventMetadataV10',
|
||||
ExtrinsicMetadataV11: {
|
||||
version: 'u8',
|
||||
signedExtensions: 'Vec<Text>'
|
||||
},
|
||||
FunctionArgumentMetadataV11: 'FunctionArgumentMetadataV10',
|
||||
FunctionMetadataV11: 'FunctionMetadataV10',
|
||||
MetadataV11: {
|
||||
modules: 'Vec<ModuleMetadataV11>',
|
||||
extrinsic: 'ExtrinsicMetadataV11'
|
||||
},
|
||||
ModuleConstantMetadataV11: 'ModuleConstantMetadataV10',
|
||||
ModuleMetadataV11: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV11>',
|
||||
calls: 'Option<Vec<FunctionMetadataV11>>',
|
||||
events: 'Option<Vec<EventMetadataV11>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV11>',
|
||||
errors: 'Vec<ErrorMetadataV11>'
|
||||
},
|
||||
StorageEntryModifierV11: 'StorageEntryModifierV10',
|
||||
StorageEntryMetadataV11: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV11',
|
||||
type: 'StorageEntryTypeV11',
|
||||
fallback: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV11: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV11',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV11',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV11'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV11: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV11>'
|
||||
},
|
||||
StorageHasherV11: {
|
||||
_enum: AllHashers
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
export const v12: DefinitionsTypes = {
|
||||
// v12
|
||||
ErrorMetadataV12: 'ErrorMetadataV11',
|
||||
EventMetadataV12: 'EventMetadataV11',
|
||||
ExtrinsicMetadataV12: 'ExtrinsicMetadataV11',
|
||||
FunctionArgumentMetadataV12: 'FunctionArgumentMetadataV11',
|
||||
FunctionMetadataV12: 'FunctionMetadataV11',
|
||||
MetadataV12: {
|
||||
modules: 'Vec<ModuleMetadataV12>',
|
||||
extrinsic: 'ExtrinsicMetadataV12'
|
||||
},
|
||||
ModuleConstantMetadataV12: 'ModuleConstantMetadataV11',
|
||||
ModuleMetadataV12: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV12>',
|
||||
calls: 'Option<Vec<FunctionMetadataV12>>',
|
||||
events: 'Option<Vec<EventMetadataV12>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV12>',
|
||||
errors: 'Vec<ErrorMetadataV12>',
|
||||
index: 'u8'
|
||||
},
|
||||
StorageEntryModifierV12: 'StorageEntryModifierV11',
|
||||
StorageEntryMetadataV12: 'StorageEntryMetadataV11',
|
||||
StorageEntryTypeV12: 'StorageEntryTypeV11',
|
||||
StorageMetadataV12: 'StorageMetadataV11',
|
||||
StorageHasherV12: 'StorageHasherV11'
|
||||
};
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
export const v13: DefinitionsTypes = {
|
||||
// v13
|
||||
ErrorMetadataV13: 'ErrorMetadataV12',
|
||||
EventMetadataV13: 'EventMetadataV12',
|
||||
ExtrinsicMetadataV13: 'ExtrinsicMetadataV12',
|
||||
FunctionArgumentMetadataV13: 'FunctionArgumentMetadataV12',
|
||||
FunctionMetadataV13: 'FunctionMetadataV12',
|
||||
MetadataV13: {
|
||||
modules: 'Vec<ModuleMetadataV13>',
|
||||
extrinsic: 'ExtrinsicMetadataV13'
|
||||
},
|
||||
ModuleConstantMetadataV13: 'ModuleConstantMetadataV12',
|
||||
ModuleMetadataV13: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV13>',
|
||||
calls: 'Option<Vec<FunctionMetadataV13>>',
|
||||
events: 'Option<Vec<EventMetadataV13>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV13>',
|
||||
errors: 'Vec<ErrorMetadataV13>',
|
||||
index: 'u8'
|
||||
},
|
||||
StorageEntryModifierV13: 'StorageEntryModifierV12',
|
||||
StorageEntryMetadataV13: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV13',
|
||||
type: 'StorageEntryTypeV13',
|
||||
fallback: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryTypeV13: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV13',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV13',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV13'
|
||||
},
|
||||
NMap: {
|
||||
keyVec: 'Vec<Type>',
|
||||
hashers: 'Vec<StorageHasherV13>',
|
||||
value: 'Type'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageMetadataV13: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV13>'
|
||||
},
|
||||
StorageHasherV13: 'StorageHasherV12'
|
||||
};
|
||||
@@ -0,0 +1,101 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
export const v14: DefinitionsTypes = {
|
||||
// registry
|
||||
PortableRegistry: {
|
||||
types: 'Vec<SiType>'
|
||||
},
|
||||
|
||||
// V14
|
||||
FunctionArgumentMetadataV14: {
|
||||
name: 'Text',
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
FunctionMetadataV14: {
|
||||
name: 'Text',
|
||||
args: 'Vec<FunctionArgumentMetadataV14>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
ExtrinsicMetadataV14: {
|
||||
type: 'SiLookupTypeId',
|
||||
version: 'u8',
|
||||
signedExtensions: 'Vec<SignedExtensionMetadataV14>'
|
||||
},
|
||||
MetadataV14: {
|
||||
types: 'PortableRegistry',
|
||||
pallets: 'Vec<PalletMetadataV14>',
|
||||
extrinsic: 'ExtrinsicMetadataV14'
|
||||
},
|
||||
PalletCallMetadataV14: {
|
||||
type: 'SiLookupTypeId',
|
||||
calls: 'Vec<FunctionMetadataV14>'
|
||||
},
|
||||
PalletConstantMetadataV14: {
|
||||
name: 'Text',
|
||||
type: 'SiLookupTypeId',
|
||||
value: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
PalletErrorMetadataV14: {
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
PalletEventMetadataV14: {
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
PalletMetadataV14: {
|
||||
name: 'Text',
|
||||
storage: 'Option<PalletStorageMetadataV14>',
|
||||
calls: 'Option<PalletCallMetadataV14>',
|
||||
events: 'Option<PalletEventMetadataV14>',
|
||||
constants: 'Vec<PalletConstantMetadataV14>',
|
||||
errors: 'Option<PalletErrorMetadataV14>',
|
||||
index: 'u8'
|
||||
},
|
||||
PalletStorageMetadataV14: {
|
||||
prefix: 'Text',
|
||||
// NOTE: Renamed from entries
|
||||
items: 'Vec<StorageEntryMetadataV14>'
|
||||
},
|
||||
SignedExtensionMetadataV14: {
|
||||
identifier: 'Text',
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
StorageEntryMetadataV14: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV14',
|
||||
type: 'StorageEntryTypeV14',
|
||||
fallback: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryModifierV14: 'StorageEntryModifierV13',
|
||||
StorageEntryTypeV14: {
|
||||
_enum: {
|
||||
Plain: 'SiLookupTypeId',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV14',
|
||||
key: 'SiLookupTypeId',
|
||||
value: 'SiLookupTypeId'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV14',
|
||||
key1: 'SiLookupTypeId',
|
||||
key2: 'SiLookupTypeId',
|
||||
value: 'SiLookupTypeId',
|
||||
key2Hasher: 'StorageHasherV14'
|
||||
},
|
||||
NMap: {
|
||||
// NOTE: Renamed from "keys"
|
||||
key: 'SiLookupTypeId',
|
||||
hashers: 'Vec<StorageHasherV14>',
|
||||
value: 'SiLookupTypeId'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageHasherV14: 'StorageHasherV13'
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { DefinitionsTypes } from '../../types';
|
||||
|
||||
export const v9: DefinitionsTypes = {
|
||||
// v9
|
||||
ErrorMetadataV9: {
|
||||
name: 'Text',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
EventMetadataV9: {
|
||||
name: 'Text',
|
||||
args: 'Vec<Type>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
FunctionArgumentMetadataV9: {
|
||||
name: 'Text',
|
||||
type: 'Type'
|
||||
},
|
||||
FunctionMetadataV9: {
|
||||
name: 'Text',
|
||||
args: 'Vec<FunctionArgumentMetadataV9>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
MetadataV9: {
|
||||
modules: 'Vec<ModuleMetadataV9>'
|
||||
},
|
||||
ModuleConstantMetadataV9: {
|
||||
name: 'Text',
|
||||
type: 'Type',
|
||||
value: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
ModuleMetadataV9: {
|
||||
name: 'Text',
|
||||
storage: 'Option<StorageMetadataV9>',
|
||||
calls: 'Option<Vec<FunctionMetadataV9>>',
|
||||
events: 'Option<Vec<EventMetadataV9>>',
|
||||
constants: 'Vec<ModuleConstantMetadataV9>',
|
||||
errors: 'Vec<ErrorMetadataV9>'
|
||||
},
|
||||
StorageEntryMetadataV9: {
|
||||
name: 'Text',
|
||||
modifier: 'StorageEntryModifierV9',
|
||||
type: 'StorageEntryTypeV9',
|
||||
fallback: 'Bytes',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
StorageEntryModifierV9: {
|
||||
_enum: ['Optional', 'Default', 'Required']
|
||||
},
|
||||
StorageEntryTypeV9: {
|
||||
_enum: {
|
||||
Plain: 'Type',
|
||||
Map: {
|
||||
hasher: 'StorageHasherV9',
|
||||
key: 'Type',
|
||||
value: 'Type',
|
||||
linked: 'bool'
|
||||
},
|
||||
DoubleMap: {
|
||||
hasher: 'StorageHasherV9',
|
||||
key1: 'Type',
|
||||
key2: 'Type',
|
||||
value: 'Type',
|
||||
key2Hasher: 'StorageHasherV9'
|
||||
}
|
||||
}
|
||||
},
|
||||
StorageHasherV9: {
|
||||
_enum: {
|
||||
Blake2_128: null, // eslint-disable-line camelcase
|
||||
Blake2_256: null, // eslint-disable-line camelcase
|
||||
Twox128: null,
|
||||
Twox256: null,
|
||||
Twox64Concat: null
|
||||
}
|
||||
},
|
||||
StorageMetadataV9: {
|
||||
prefix: 'Text',
|
||||
items: 'Vec<StorageEntryMetadataV9>'
|
||||
}
|
||||
};
|
||||
@@ -11,11 +11,19 @@ export default {
|
||||
types: {
|
||||
SiField: {
|
||||
name: 'Option<Text>',
|
||||
type: 'SiLookupTypeId'
|
||||
type: 'SiLookupTypeId',
|
||||
typeName: 'Option<Text>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
SiLookupTypeId: 'u32',
|
||||
SiPath: 'Vec<Text>',
|
||||
SiType: {
|
||||
path: 'SiPath',
|
||||
params: 'Vec<SiTypeParameter>',
|
||||
def: 'SiTypeDef',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
SiType0: {
|
||||
path: 'SiPath',
|
||||
params: 'Vec<SiLookupTypeId>',
|
||||
def: 'SiTypeDef'
|
||||
@@ -27,16 +35,30 @@ export default {
|
||||
Sequence: 'SiTypeDefSequence',
|
||||
Array: 'SiTypeDefArray',
|
||||
Tuple: 'SiTypeDefTuple',
|
||||
Primitive: 'SiTypeDefPrimitive'
|
||||
Primitive: 'SiTypeDefPrimitive',
|
||||
Compact: 'SiTypeDefCompact',
|
||||
Phantom: 'SiTypeDefPhantom',
|
||||
BitSequence: 'SiTypeDefBitSequence',
|
||||
// NOTE: This is specific to the implementation for pre-v14 metadata
|
||||
// compatibility (always keep this as the last entry in the enum)
|
||||
HistoricMetaCompat: 'Type'
|
||||
}
|
||||
},
|
||||
SiTypeDefArray: {
|
||||
len: 'u16',
|
||||
len: 'u32',
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefBitSequence: {
|
||||
bitStoreType: 'SiLookupTypeId',
|
||||
bitOrderType: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefCompact: {
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefComposite: {
|
||||
fields: 'Vec<SiField>'
|
||||
},
|
||||
SiTypeDefPhantom: 'Null',
|
||||
SiTypeDefVariant: {
|
||||
variants: 'Vec<SiVariant>'
|
||||
},
|
||||
@@ -47,10 +69,16 @@ export default {
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefTuple: 'Vec<SiLookupTypeId>',
|
||||
SiTypeParameter: {
|
||||
name: 'Text',
|
||||
type: 'Option<SiLookupTypeId>'
|
||||
},
|
||||
SiVariant: {
|
||||
name: 'Text',
|
||||
fields: 'Vec<SiField>',
|
||||
discriminant: 'Option<u64>'
|
||||
index: 'Option<u8>',
|
||||
discriminant: 'Option<u64>',
|
||||
docs: 'Vec<Text>'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Enum, Option, Struct, Text, Vec, u16, u32, u64 } from '@polkadot/types';
|
||||
import type { Enum, Null, Option, Struct, Text, Type, Vec, u32, u64, u8 } from '@polkadot/types';
|
||||
|
||||
/** @name SiField */
|
||||
export interface SiField extends Struct {
|
||||
readonly name: Option<Text>;
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly typeName: Option<Text>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name SiLookupTypeId */
|
||||
@@ -17,6 +19,14 @@ export interface SiPath extends Vec<Text> {}
|
||||
|
||||
/** @name SiType */
|
||||
export interface SiType extends Struct {
|
||||
readonly path: SiPath;
|
||||
readonly params: Vec<SiTypeParameter>;
|
||||
readonly def: SiTypeDef;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name SiType0 */
|
||||
export interface SiType0 extends Struct {
|
||||
readonly path: SiPath;
|
||||
readonly params: Vec<SiLookupTypeId>;
|
||||
readonly def: SiTypeDef;
|
||||
@@ -36,11 +46,30 @@ export interface SiTypeDef extends Enum {
|
||||
readonly asTuple: SiTypeDefTuple;
|
||||
readonly isPrimitive: boolean;
|
||||
readonly asPrimitive: SiTypeDefPrimitive;
|
||||
readonly isCompact: boolean;
|
||||
readonly asCompact: SiTypeDefCompact;
|
||||
readonly isPhantom: boolean;
|
||||
readonly asPhantom: SiTypeDefPhantom;
|
||||
readonly isBitSequence: boolean;
|
||||
readonly asBitSequence: SiTypeDefBitSequence;
|
||||
readonly isHistoricMetaCompat: boolean;
|
||||
readonly asHistoricMetaCompat: Type;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefArray */
|
||||
export interface SiTypeDefArray extends Struct {
|
||||
readonly len: u16;
|
||||
readonly len: u32;
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefBitSequence */
|
||||
export interface SiTypeDefBitSequence extends Struct {
|
||||
readonly bitStoreType: SiLookupTypeId;
|
||||
readonly bitOrderType: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefCompact */
|
||||
export interface SiTypeDefCompact extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
@@ -49,6 +78,9 @@ export interface SiTypeDefComposite extends Struct {
|
||||
readonly fields: Vec<SiField>;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefPhantom */
|
||||
export interface SiTypeDefPhantom extends Null {}
|
||||
|
||||
/** @name SiTypeDefPrimitive */
|
||||
export interface SiTypeDefPrimitive extends Enum {
|
||||
readonly isBool: boolean;
|
||||
@@ -81,11 +113,19 @@ export interface SiTypeDefVariant extends Struct {
|
||||
readonly variants: Vec<SiVariant>;
|
||||
}
|
||||
|
||||
/** @name SiTypeParameter */
|
||||
export interface SiTypeParameter extends Struct {
|
||||
readonly name: Text;
|
||||
readonly type: Option<SiLookupTypeId>;
|
||||
}
|
||||
|
||||
/** @name SiVariant */
|
||||
export interface SiVariant extends Struct {
|
||||
readonly name: Text;
|
||||
readonly fields: Vec<SiField>;
|
||||
readonly index: Option<u8>;
|
||||
readonly discriminant: Option<u64>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
export type PHANTOM_SCALEINFO = 'scaleInfo';
|
||||
|
||||
@@ -78,7 +78,7 @@ function expandWithMeta ({ meta, method, prefix, section }: CreateItemFn, _stora
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function extendHeadMeta (registry: Registry, { meta: { documentation, name, type }, section }: CreateItemFn, { method }: StorageEntry, iterFn: (...args: unknown[]) => Raw): (...args: unknown[]) => StorageKey {
|
||||
function extendHeadMeta (registry: Registry, { meta: { docs, name, type }, section }: CreateItemFn, { method }: StorageEntry, iterFn: (...args: unknown[]) => Raw): (...args: unknown[]) => StorageKey {
|
||||
const outputType = type.isMap
|
||||
? type.asMap.key
|
||||
: type.isDoubleMap
|
||||
@@ -88,7 +88,7 @@ function extendHeadMeta (registry: Registry, { meta: { documentation, name, type
|
||||
// metadata with a fallback value using the type of the key, the normal
|
||||
// meta fallback only applies to actual entry values, create one for head
|
||||
(iterFn as IterFn).meta = registry.createType('StorageEntryMetadataLatest', {
|
||||
documentation,
|
||||
docs,
|
||||
fallback: registry.createType('Bytes'),
|
||||
modifier: registry.createType('StorageEntryModifierLatest', 1), // required
|
||||
name,
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { Registry } from '../../../types';
|
||||
import { createFunction } from './createFunction';
|
||||
|
||||
interface SubstrateMetadata {
|
||||
documentation: string;
|
||||
docs: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ type Creator = (registry: Registry) => StorageEntry;
|
||||
|
||||
// Small helper function to factorize code on this page.
|
||||
/** @internal */
|
||||
function createRuntimeFunction (method: string, key: string, { documentation, type }: SubstrateMetadata): (registry: Registry) => StorageEntry {
|
||||
function createRuntimeFunction (method: string, key: string, { docs, type }: SubstrateMetadata): (registry: Registry) => StorageEntry {
|
||||
return (registry: Registry): StorageEntry =>
|
||||
createFunction(registry, {
|
||||
meta: {
|
||||
documentation: registry.createType('Vec<Text>', [documentation]),
|
||||
docs: registry.createType('Vec<Text>', [docs]),
|
||||
modifier: registry.createType('StorageEntryModifierLatest', 1), // required
|
||||
name: registry.createType('Text', method),
|
||||
toJSON: (): any => key,
|
||||
@@ -34,23 +34,23 @@ function createRuntimeFunction (method: string, key: string, { documentation, ty
|
||||
|
||||
export const substrate: Record<string, Creator> = {
|
||||
changesTrieConfig: createRuntimeFunction('changesTrieConfig', ':changes_trie', {
|
||||
documentation: ' Changes trie configuration is stored under this key.',
|
||||
docs: ' Changes trie configuration is stored under this key.',
|
||||
type: 'u32'
|
||||
}),
|
||||
childStorageKeyPrefix: createRuntimeFunction('childStorageKeyPrefix', ':child_storage:', {
|
||||
documentation: ' Prefix of child storage keys.',
|
||||
docs: ' Prefix of child storage keys.',
|
||||
type: 'u32'
|
||||
}),
|
||||
code: createRuntimeFunction('code', ':code', {
|
||||
documentation: ' Wasm code of the runtime.',
|
||||
docs: ' Wasm code of the runtime.',
|
||||
type: 'Bytes'
|
||||
}),
|
||||
extrinsicIndex: createRuntimeFunction('extrinsicIndex', ':extrinsic_index', {
|
||||
documentation: ' Current extrinsic index (u32) is stored under this key.',
|
||||
docs: ' Current extrinsic index (u32) is stored under this key.',
|
||||
type: 'u32'
|
||||
}),
|
||||
heapPages: createRuntimeFunction('heapPages', ':heappages', {
|
||||
documentation: ' Number of wasm linear memory pages required for execution of the runtime.',
|
||||
docs: ' Number of wasm linear memory pages required for execution of the runtime.',
|
||||
type: 'u64'
|
||||
})
|
||||
};
|
||||
|
||||
@@ -13,8 +13,8 @@ interface ModuleMetadataTrimmed {
|
||||
name: Text;
|
||||
}
|
||||
|
||||
function trimDocs (documentation: Vec<Text>): string[] {
|
||||
const strings = documentation.map((doc) => doc.toString().trim());
|
||||
function trimDocs (docs: Vec<Text>): string[] {
|
||||
const strings = docs.map((doc) => doc.toString().trim());
|
||||
const firstEmpty = strings.findIndex((doc) => !doc.length);
|
||||
|
||||
return firstEmpty === -1
|
||||
@@ -28,10 +28,10 @@ function mapCalls (registry: Registry, _calls: Option<Vec<FunctionMetadataLatest
|
||||
return registry.createType(
|
||||
'Option<Vec<FunctionMetadataLatest>>' as any,
|
||||
calls
|
||||
? calls.map(({ args, documentation, name }) =>
|
||||
? calls.map(({ args, docs, name }) =>
|
||||
registry.createType('FunctionMetadataLatest', {
|
||||
args,
|
||||
documentation: trimDocs(documentation),
|
||||
docs: trimDocs(docs),
|
||||
name
|
||||
})
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@ export type RegistryTypes =
|
||||
{ _set: Record<string, number> }>;
|
||||
|
||||
export interface RegistryError {
|
||||
documentation: string[];
|
||||
docs: string[];
|
||||
index: number;
|
||||
// compat
|
||||
method: string;
|
||||
|
||||
Reference in New Issue
Block a user