PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@polkadot-api/metadata-builders/dist

Просмотр файла: index.d.ts

import * as scale from '@polkadot-api/substrate-bindings';
import { StringRecord, V14Lookup, V14, V15, Codec } from '@polkadot-api/substrate-bindings';

type MetadataPrimitives = "bool" | "char" | "str" | "u8" | "u16" | "u32" | "u64" | "u128" | "u256" | "i8" | "i16" | "i32" | "i64" | "i128" | "i256";
type PrimitiveVar = {
    type: "primitive";
    value: MetadataPrimitives;
};
type VoidVar = {
    type: "void";
};
type CompactVar = {
    type: "compact";
    isBig: boolean | null;
};
type BitSequenceVar = {
    type: "bitSequence";
};
type AccountId32 = {
    type: "AccountId32";
};
type AccountId20 = {
    type: "AccountId20";
};
type TerminalVar = PrimitiveVar | VoidVar | CompactVar | BitSequenceVar | AccountId32 | AccountId20;
type TupleVar = {
    type: "tuple";
    value: LookupEntry[];
    innerDocs: Array<string[]>;
};
type StructVar = {
    type: "struct";
    value: StringRecord<LookupEntry>;
    innerDocs: StringRecord<string[]>;
};
type EnumVar = {
    type: "enum";
    value: StringRecord<({
        type: "lookupEntry";
        value: LookupEntry;
    } | VoidVar | TupleVar | StructVar | ArrayVar) & {
        idx: number;
    }>;
    innerDocs: StringRecord<string[]>;
};
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;
declare const getLookupFn: (lookupData: V14Lookup) => (id: number) => LookupEntry;

declare const getDynamicBuilder: (metadata: V14 | V15) => {
    buildDefinition: (id: number) => Codec<any>;
    buildStorage: (pallet: string, entry: string) => {
        len: number;
        fallback: unknown;
        enc: (...args: any[]) => string;
        dec: scale.Decoder<unknown>;
        keyDecoder: (value: string) => { [K in keyof scale.EncoderWithHash<any>[]]: scale.EncoderWithHash<any>[][K] extends scale.EncoderWithHash<infer V> ? V : unknown; };
    };
    buildEvent: (pallet: string, name: string) => {
        codec: Codec<any>;
        location: [number, number];
    };
    buildError: (pallet: string, name: string) => {
        codec: Codec<any>;
        location: [number, number];
    };
    buildRuntimeCall: (api: string, method: string) => {
        args: Codec<any[]>;
        value: Codec<any>;
    };
    buildCall: (pallet: string, name: string) => {
        codec: Codec<any>;
        location: [number, number];
    };
    buildConstant: (pallet: string, constantName: string) => Codec<any>;
    ss58Prefix: number | undefined;
};

declare const getChecksumBuilder: (metadata: V14 | V15) => {
    buildDefinition: (id: number) => string | null;
    buildRuntimeCall: (api: string, method: string) => string | null;
    buildStorage: (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[];
};

export { type AccountId20, type AccountId32, type ArrayVar, type BitSequenceVar, type CompactVar, type ComposedVar, type EnumVar, type LookupEntry, type MetadataPrimitives, type OptionVar, type PrimitiveVar, type ResultVar, type SequenceVar, type StructVar, type TerminalVar, type TupleVar, type Var, type VoidVar, getChecksumBuilder, getDynamicBuilder, getLookupFn };

Выполнить команду


Для локальной разработки. Не используйте в интернете!