///
///
///
import { OpCode, SysCallName, UInt160, VMState } from '@neo-one/client-common-esnext-esm';
import { Monitor } from '@neo-one/monitor-esnext-esm';
import { Block, ExecutionAction, ScriptContainer, TriggerType, VMFeatureSwitches, VMListeners, WriteBlockchain } from '@neo-one/node-core-esnext-esm';
import BN from 'bn.js';
import { StackItem } from './stackItem';
export declare const MAX_SHL_SHR = 65535;
export declare const MIN_SHL_SHR: number;
export declare const MAX_SIZE_BIG_INTEGER = 32;
export declare const MAX_STACK_SIZE: number;
export declare const MAX_ITEM_SIZE: number;
export declare const MAX_INVOCATION_STACK_SIZE = 1024;
export declare const MAX_ARRAY_SIZE = 1024;
export declare const MAX_ARRAY_SIZE_BN: BN;
export declare const BLOCK_HEIGHT_YEAR = 2000000;
export declare const FEES: {
ONE: BN;
TEN: BN;
TWENTY: BN;
ONE_HUNDRED: BN;
TWO_HUNDRED: BN;
FOUR_HUNDRED: BN;
FIVE_HUNDRED: BN;
ONE_THOUSAND: BN;
};
export declare const FREE_GAS: BN;
export declare type ExecutionStack = ReadonlyArray;
export interface ExecutionInit {
readonly scriptContainer: ScriptContainer;
readonly triggerType: TriggerType;
readonly action: ExecutionAction;
readonly listeners: VMListeners;
readonly skipWitnessVerify: boolean;
readonly persistingBlock?: Block;
readonly vmFeatures: VMFeatureSwitches;
}
export interface CreatedContracts {
readonly [hash: string]: UInt160;
}
export interface Options {
readonly depth: number;
readonly stack: ExecutionStack;
readonly stackAlt: ExecutionStack;
readonly createdContracts: CreatedContracts;
readonly scriptHash: UInt160 | undefined;
readonly entryScriptHash: UInt160;
readonly returnValueCount: number;
readonly stackCount: number;
readonly pc?: number;
}
export interface ExecutionContext {
readonly state: VMState;
readonly errorMessage?: string;
readonly blockchain: WriteBlockchain;
readonly init: ExecutionInit;
readonly engine: {
readonly run: (input: {
readonly monitor: Monitor;
readonly context: ExecutionContext;
}) => Promise;
readonly executeScript: (input: {
readonly monitor: Monitor;
readonly code: Buffer;
readonly blockchain: WriteBlockchain;
readonly init: ExecutionInit;
readonly gasLeft: BN;
readonly options?: Options;
}) => Promise;
};
readonly code: Buffer;
readonly scriptHash: UInt160;
readonly callingScriptHash: UInt160 | undefined;
readonly entryScriptHash: UInt160;
readonly pc: number;
readonly depth: number;
readonly stack: ExecutionStack;
readonly stackAlt: ExecutionStack;
readonly gasLeft: BN;
readonly createdContracts: CreatedContracts;
readonly returnValueCount: number;
readonly stackCount: number;
}
export interface OpResult {
readonly context: ExecutionContext;
readonly results?: ReadonlyArray;
readonly resultsAlt?: ReadonlyArray;
}
export interface OpInvokeArgs {
readonly monitor: Monitor;
readonly context: ExecutionContext;
readonly args: ReadonlyArray;
readonly argsAlt: ReadonlyArray;
}
export declare type OpInvoke = (input: OpInvokeArgs) => Promise | OpResult;
export interface Op {
readonly name: OpCode;
readonly in: number;
readonly inAlt: number;
readonly out: number;
readonly outAlt: number;
readonly invocation: number;
readonly fee: BN;
readonly invoke: OpInvoke;
}
export interface SysCall {
readonly name: SysCallName;
readonly in: number;
readonly inAlt: number;
readonly out: number;
readonly outAlt: number;
readonly invocation: number;
readonly fee: BN;
readonly invoke: OpInvoke;
readonly context: ExecutionContext;
}