export interface FileAbi { header: 'PBCABI'; version: number; abi: ContractAbi; } export interface ContractAbi { shortnameLength: number; types: StructTypeAbi[]; init: FnAbi; actions: FnAbi[]; state: TypeSpec; } export interface StructTypeAbi { name: string; fields: FieldAbi[]; } export interface FieldAbi { name: string; type: TypeSpec; } export interface FnAbi { name: string; shortname: string; arguments: ArgumentAbi[]; len?: number; } export interface ArgumentAbi { name: string; type: TypeSpec; } export type AbiValue = string | { [key: string]: AbiValue; } | AbiValue[]; export type TypeSpec = SimpleTypeSpec | CompositeTypeSpec | StructTypeSpec; export type CompositeTypeSpec = VecTypeSpec | BTreeMapTypeSpec | BTreeSetTypeSpec | ByteArrayTypeSpec; export interface StructTypeSpec { typeIndex: TypeIndex.Struct; customTypeIndex: number; } export declare enum TypeIndex { Struct = 0, u8 = 1, u16 = 2, u32 = 3, u64 = 4, u128 = 5, i8 = 6, i16 = 7, i32 = 8, i64 = 9, i128 = 10, String = 11, bool = 12, Address = 13, Vec = 14, BTreeMap = 15, BTreeSet = 16, ByteArray = 17 } export type NumericTypeIndex = NumericTypeSpec['typeIndex']; export interface NumericTypeSpec { typeIndex: TypeIndex.u8 | TypeIndex.u16 | TypeIndex.u32 | TypeIndex.u64 | TypeIndex.u128 | TypeIndex.i8 | TypeIndex.i16 | TypeIndex.i32 | TypeIndex.i64 | TypeIndex.i128; } export type SimpleTypeIndex = SimpleTypeSpec['typeIndex']; export interface SimpleTypeSpec { typeIndex: NumericTypeIndex | TypeIndex.String | TypeIndex.bool | TypeIndex.Address; } export interface VecTypeSpec { typeIndex: TypeIndex.Vec; valueType: TypeSpec; } export interface BTreeMapTypeSpec { typeIndex: TypeIndex.BTreeMap; keyType: TypeSpec; valueType: TypeSpec; } export interface BTreeSetTypeSpec { typeIndex: TypeIndex.BTreeSet; valueType: TypeSpec; } export interface ByteArrayTypeSpec { typeIndex: TypeIndex.ByteArray; length: number; } export declare const TYPE_NAMES: { [key in TypeIndex]: string; };