import { Transaction } from 'mate/transaction'; import { SliceKeyType } from 'utils/contractHelper'; export interface ContractResultItem { key: string; value: { [key: string]: any; }; type: 'object' | 'sk_slice_db'; keyType?: SliceKeyType; } export declare type ContractResult = ContractResultItem[]; export declare class Contract { constructor(); ready: boolean; init: () => Promise; /** * @description 把 js function 处理成code string后交给runtime去执行 * @param code [Function] js function * @returns */ runFunction: (code: Uint8Array, trans: Transaction, storage: string) => ContractResult; /** * @description 直接把code string交给runtime去执行 * @param code [Uint8Array] js 代码的字符创 * @returns */ execCode: (code: Uint8Array) => string | undefined; }