import { BTreeMap, Option, Struct, Text, Vec, u32, u8 } from 'https://deno.land/x/polkadot@0.2.45/types/index.ts'; import { HexString } from 'https://deno.land/x/polkadot@0.2.45/util/types.ts'; export interface TypesRepr extends Struct { input: Option; output: Option; toJSON: () => HumanTypesRepr; } export type HumanTypesRepr = { input: number | null; output: number | null; }; export interface ProgramMetadataRepr extends Struct { reg: Vec; } export interface ProgramMetadataReprRustV1 extends ProgramMetadataRepr { init: TypesRepr; handle: TypesRepr; others: TypesRepr; reply: Option; signal: Option; state: Option; toJSON: () => HumanProgramMetadataReprRustV1; } export type HumanProgramMetadataReprRustV1 = { init: HumanTypesRepr; handle: HumanTypesRepr; reply: number | null; others: HumanTypesRepr; signal: number | null; state: number | null; reg: HexString; }; export interface ProgramMetadataReprRustV2 extends ProgramMetadataRepr { init: TypesRepr; handle: TypesRepr; others: TypesRepr; reply: Option; signal: Option; state: TypesRepr; toJSON: () => HumanProgramMetadataReprRustV2; } export type HumanProgramMetadataReprRustV2 = { init: HumanTypesRepr; handle: HumanTypesRepr; reply: number | null; others: HumanTypesRepr; signal: number | null; state: HumanTypesRepr; reg: HexString; }; export interface StateMetadataRepr extends Struct { functions: BTreeMap; reg: Vec; toJSON: () => HumanStateMetadataRepr; } export type HumanStateMetadataRepr = { functions: Record; reg: HexString; }; export type StateFunctions = Record; export type TypeKind = | 'primitive' | 'empty' | 'none' | 'sequence' | 'composite' | 'variant' | 'array' | 'tuple' | 'option' | 'actorid'; export interface TypeStructure { name: string; kind: TypeKind; type: string | object | TypeStructure; len?: number; }