import * as scale from '@polkadot-api/substrate-bindings'; import { StringRecord, UnifiedMetadata, V14Lookup, Codec } from '@polkadot-api/substrate-bindings'; type SignedPrimitive = "i8" | "i16" | "i32" | "i64" | "i128" | "i256"; type UnsignedPrimitive = "u8" | "u16" | "u32" | "u64" | "u128" | "u256"; type MetadataPrimitives = "bool" | "char" | "str" | SignedPrimitive | UnsignedPrimitive; type PrimitiveVar = { type: "primitive"; value: MetadataPrimitives; }; type VoidVar = { type: "void"; }; type CompactVar = { type: "compact"; isBig: boolean; size: UnsignedPrimitive; }; type BitSequenceVar = { type: "bitSequence"; isLSB: boolean; }; type AccountId32 = { type: "AccountId32"; }; type AccountId20 = { type: "AccountId20"; }; type TerminalVar = PrimitiveVar | VoidVar | CompactVar | BitSequenceVar | AccountId32 | AccountId20; type TupleVar = { type: "tuple"; value: LookupEntry[]; innerDocs: Array; }; type StructVar = { type: "struct"; value: StringRecord; innerDocs: StringRecord; }; type EnumVar = { type: "enum"; value: StringRecord<({ type: "lookupEntry"; value: LookupEntry; } | VoidVar | TupleVar | StructVar | ArrayVar) & { idx: number; }>; innerDocs: StringRecord; byteLength?: number; }; type OptionVar = { type: "option"; value: LookupEntry; }; type ResultVar = { type: "result"; value: { ok: LookupEntry; ko: LookupEntry; }; }; type SequenceVar = { type: "sequence"; value: LookupEntry; }; type ArrayVar = { type: "array"; value: LookupEntry; len: number; }; type ComposedVar = TupleVar | StructVar | SequenceVar | ArrayVar | OptionVar | ResultVar | EnumVar; type Var = TerminalVar | ComposedVar; type LookupEntry = { id: number; } & Var; interface MetadataLookup { (id: number): LookupEntry; metadata: UnifiedMetadata; call: number | null; } declare const denormalizeLookup: (lookupData: V14Lookup) => (id: number) => LookupEntry; declare const getLookupFn: (metadata: UnifiedMetadata) => MetadataLookup; declare const getDynamicBuilder: (getLookupEntryDef: MetadataLookup) => { buildDefinition: (id: number) => Codec; buildStorage: (pallet: string, entry: string) => { args: [scale.Encoder, scale.Decoder] & { enc: scale.Encoder; dec: scale.Decoder; } & { inner: Codec[]; }; keys: { enc: (...args: any[]) => string; dec: (value: string) => any[]; }; value: Codec; len: number; fallback: any; }; buildEvent: (pallet: string, name: string) => { codec: Codec; location: [number, number]; }; buildError: (pallet: string, name: string) => { codec: Codec; location: [number, number]; }; buildViewFn: (pallet: string, entry: string) => { args: [scale.Encoder, scale.Decoder] & { enc: scale.Encoder; dec: scale.Decoder; } & { inner: Codec[]; }; value: Codec; }; buildRuntimeCall: (api: string, method: string) => { args: [scale.Encoder, scale.Decoder] & { enc: scale.Encoder; dec: scale.Decoder; } & { inner: Codec[]; }; value: Codec; }; buildCall: (pallet: string, name: string) => { codec: Codec; location: [number, number]; }; buildConstant: (pallet: string, constantName: string) => Codec; ss58Prefix: number | undefined; }; declare const getChecksumBuilder: (getLookupEntryDef: MetadataLookup) => { buildDefinition: (id: number) => string | null; buildRuntimeCall: (api: string, method: string) => string | null; buildStorage: (pallet: string, entry: string) => string | null; buildViewFns: (pallet: string, entry: string) => string | null; buildCall: (pallet: string, name: string) => string | null; buildEvent: (pallet: string, name: string) => string | null; buildError: (pallet: string, name: string) => string | null; buildConstant: (pallet: string, constantName: string) => string | null; buildComposite: (input: VoidVar | TupleVar | StructVar | ArrayVar) => string | null; buildNamedTuple: (input: StructVar) => string | null; getAllGeneratedChecksums: () => string[]; }; declare const getLookupCodecBuilder: (lookup: (id: number) => LookupEntry, accountId?: Codec) => (id: number) => Codec; export { denormalizeLookup, getChecksumBuilder, getDynamicBuilder, getLookupCodecBuilder, getLookupFn }; export type { AccountId20, AccountId32, ArrayVar, BitSequenceVar, CompactVar, ComposedVar, EnumVar, LookupEntry, MetadataLookup, MetadataPrimitives, OptionVar, PrimitiveVar, ResultVar, SequenceVar, SignedPrimitive, StructVar, TerminalVar, TupleVar, UnsignedPrimitive, Var, VoidVar };