UNPKG

txtracer-core-test-dev

Version:

Core TxTracer library for collecting transaction information

44 lines (43 loc) 2.29 kB
import { TraceResult } from "./types"; import { BaseTxInfo } from "./methods"; /** * Fully reproduce (re‑trace) a TON transaction inside a local TON Sandbox * and return a structured report with VM logs, money flow, generated * actions and other data. * * Workflow (high level) * 1. Locate the base transaction (`txLink`) on either mainnet or testnet. * 2. Load its shard‑block and the enclosing master‑block; extract * `rand_seed`, config‑cell and the account snapshot *prior* to the block. * 3. Re‑create the exact pre‑tx state by sequentially emulating all earlier * account transactions that happened inside the same master‑block. * 4. Emulate the target transaction itself with full VM verbosity. * 5. Parse the resulting VM log (`c5`, action list, stack trace), compare the * calculated state‑hash with the on‑chain one and assemble a * `TraceResult` object for the caller. * * @param testnet When `true`, work against testnet endpoints; otherwise mainnet. * @param txLink Hex hash that uniquely identifies the transaction to retrace. * * @returns A {@link TraceResult} containing: * 1. an integrity flag `stateUpdateHashOk` * 2. decoded an incoming message (sender / contract / amount) * 3. balance delta, gas and fees * 4. full emulated transaction (`emulatedTx`) with * compute‑phase info, `c5`, action list and raw VM log * 5. version of the sandbox executor used for emulation * * @throws Error If any network lookup fails; if the corresponding shard‑ / * master‑block cannot be found; if deterministic replay * diverges (TVM returns non‑success); or if state‑hash * mismatch is detected after replay. */ export declare const retrace: (testnet: boolean, txLink: string) => Promise<TraceResult>; /** * Fully reproduce (re‑trace) a TON transaction inside a local TON Sandbox * and return a structured report with VM logs, money flow, generated * actions and other data. * * See {@link retrace} for the full description of the workflow. */ export declare const retraceBaseTx: (testnet: boolean, baseTx: BaseTxInfo) => Promise<TraceResult>;