import { Address, Cell, TupleItem } from '@ton/core'; import { ExtraCurrency } from '../utils/ec'; export type BlockId = { workchain: number; shard: bigint; seqno: number; rootHash: Buffer; fileHash: Buffer; }; export type PrevBlocksInfo = { lastMcBlocks: BlockId[]; prevKeyBlock: BlockId; lastMcBlocks100?: BlockId[]; }; export type GetMethodArgs = { code: Cell; data: Cell; methodId: number; stack: TupleItem[]; config: string; verbosity: ExecutorVerbosity; libs?: Cell; address: Address; unixTime: number; balance: bigint; randomSeed: Buffer; gasLimit: bigint; debugEnabled: boolean; extraCurrency?: ExtraCurrency; prevBlocksInfo?: PrevBlocksInfo; }; export type GetMethodResultSuccess = { success: true; stack: string; gas_used: string; vm_exit_code: number; vm_log: string; missing_library: string | null; }; export type GetMethodResultError = { success: false; error: string; }; export type GetMethodResult = { output: GetMethodResultSuccess | GetMethodResultError; logs: string; debugLogs: string; }; export type RunCommonArgs = { config: string; libs: Cell | null; verbosity: ExecutorVerbosity; shardAccount: string; now: number; lt: bigint; randomSeed: Buffer | null; ignoreChksig: boolean; debugEnabled: boolean; prevBlocksInfo?: PrevBlocksInfo; }; export type RunTransactionArgs = { message: Cell; } & RunCommonArgs; export type TickOrTock = 'tick' | 'tock'; export type RunTickTockArgs = { which: TickOrTock; } & RunCommonArgs; export type ExecutorVerbosity = 'short' | 'full' | 'full_location' | 'full_location_gas' | 'full_location_stack' | 'full_location_stack_verbose'; export type EmulationResultSuccess = { success: true; transaction: string; shardAccount: string; vmLog: string; actions: string | null; }; export type VMResults = { vmLog: string; vmExitCode: number; }; export type EmulationResultError = { success: false; error: string; vmResults?: VMResults; }; export type EmulationResult = { result: EmulationResultSuccess | EmulationResultError; logs: string; debugLogs: string; }; export interface IExecutor { runGetMethod(args: GetMethodArgs): Promise; runTickTock(args: RunTickTockArgs): Promise; runTransaction(args: RunTransactionArgs): Promise; } export declare class Executor implements IExecutor { private module; private heap; private emulator?; debugLogFunc: (s: string) => void; private constructor(); static create(opts?: { debug?: boolean; }): Promise; runGetMethod(args: GetMethodArgs): Promise; private runCommon; runTickTock(args: RunTickTockArgs): Promise; runTransaction(args: RunTransactionArgs): Promise; private createEmulator; private getEmulatorPointer; invoke(method: string, args: (number | string)[]): number; sbsGetMethodSetup(args: GetMethodArgs): number; destroyTvmEmulator(ptr: number): void; sbsGetMethodStep(ptr: number): boolean; sbsGetMethodStack(ptr: number): TupleItem[]; sbsGetMethodC7(ptr: number): TupleItem; sbsGetMethodGetContDistinguisher(ptr: number): number; sbsGetMethodSetContDistinguishers(ptr: number, distinguisher: number, trueDistinguisher: number, falseDistinguisher: number): void; sbsGetMethodGetContDistinguisherTriggered(ptr: number): boolean; sbsGetMethodSetTryParams(ptr: number, primed: number, triggered: number): void; sbsGetMethodGetTriggeredTryParam(ptr: number): number; sbsGetMethodCodePos(ptr: number): { hash: string; offset: number; }; sbsGetMethodResult(ptr: number): GetMethodResult; sbsTransactionSetup(args: RunTransactionArgs): { res: number; emptr: number; }; destroyEmulator(ptr: number): void; sbsTransactionStep(ptr: number): boolean; sbsTransactionCodePos(ptr: number): { hash: string; offset: number; }; sbsTransactionStack(ptr: number): TupleItem[]; sbsTransactionC7(ptr: number): TupleItem; sbsTransactionGetContDistinguisher(ptr: number): number; sbsTransactionSetContDistinguishers(ptr: number, distinguisher: number, trueDistinguisher: number, falseDistinguisher: number): void; sbsTransactionGetContDistinguisherTriggered(ptr: number): boolean; sbsTransactionSetTryParams(ptr: number, primed: number, triggered: number): void; sbsTransactionGetTriggeredTryParam(ptr: number): number; sbsTransactionResult(ptr: number): EmulationResult; private extractString; getVersion(): { commitHash: string; commitDate: string; }; }