/// import { AssetDef } from "algosdk"; import { Runtime } from "../index"; import type { ExecutionMode, Operator, SSCAttributesM, StackElem, StoreAccountI, TEALStack } from "../types"; export declare class Interpreter { /** * Note: Interpreter operates on `ctx`, it doesn't operate on `store`. * All the functions query or update only a state copy from the interpreter, not the `runtime.store`. */ readonly stack: TEALStack; tealVersion: number; gas: number; length: number; bytecblock: Uint8Array[]; intcblock: BigInt[]; scratch: StackElem[]; instructions: Operator[]; instructionIndex: number; runtime: Runtime; constructor(); /** * Queries ASA Definitions data by assetID. Returns undefined if ASA is not deployed. * @param assetId Asset Index */ getAssetDef(assetId: number): AssetDef | undefined; /** * Queries app (SSCAttributesM) from state. Throws TEAL.APP_NOT_FOUND if app is not found. * @param appId Application Index */ getApp(appId: number, line: number): SSCAttributesM; /** * Queries account by accountIndex or `ctx.tx.snd` (if `accountIndex==0`). * Throws exception if account is not found. * @param accountIndex index of account to fetch from account list * @param line line number * NOTE: index 0 represents txn sender account */ getAccount(accountIndex: bigint, line: number): StoreAccountI; /** * Queries application by application index. Returns undefined if app is not found. * @param appId: current application id * @param key: key to fetch value of from local state */ getGlobalState(appId: number, key: Uint8Array | string, line: number): StackElem | undefined; /** * Updates app global state. * Throws error if app is not found. * @param appId: application id * @param key: app global state key * @param value: value associated with a key */ setGlobalState(appId: number, key: Uint8Array | string, value: StackElem, line: number): void; /** * Description: moves instruction index to "label", throws error if label not found * @param label: branch label */ jumpForward(label: string, line: number): void; /** * This function executes TEAL code after parsing * @param program: teal code * @param mode : execution mode of TEAL code (Stateless or Stateful) * @param runtime : runtime object */ execute(program: string, mode: ExecutionMode, runtime: Runtime): void; }