
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
@ton/retracer-core
Advanced tools
retracer-core is a core library for deep analysis, emulation, and tracing transactions on the TON blockchain. The library allows you to reproduce transaction execution in a local sandbox, obtain detailed reports on computation, actions, and money flow, and collect low-level information about blocks, accounts, and messages.
yarn add @ton/retracer-core
# or
npm install @ton/retracer-core
import {RETRACE_MAINNET_NETWORK, retrace} from "@ton/retracer-core"
// Example: trace a transaction by its hash
const result = await retrace(RETRACE_MAINNET_NETWORK, "YOUR_TX_HASH")
console.log(result)
import {
RETRACE_MAINNET_NETWORK,
RETRACE_TESTNET_NETWORK,
findBaseTxByHash,
retrace,
retraceBaseTx,
} from "@ton/retracer-core"
import type {RetraceNetworkConfig} from "@ton/retracer-core"
/**
* @param network - Toncenter-compatible network configuration
* @param txHash - hex transaction hash
* @returns Detailed execution report (TraceResult)
*/
const result1 = await retrace(RETRACE_MAINNET_NETWORK, txHash)
const result2 = await retrace(RETRACE_TESTNET_NETWORK, txHash)
const customNetwork: RetraceNetworkConfig = {
testnet: true,
v2BaseUrl: "https://example.com/api/v2",
v3BaseUrl: "https://example.com/api/v3",
toncenterApiKey: "optional-api-key",
}
const result3 = await retrace(customNetwork, txHash)
/**
* Retrace a transaction described by base transaction information.
* Base transaction info should be resolved through the same network first,
* because it carries the Toncenter v3 shard block reference.
*/
const baseTx = await findBaseTxByHash(RETRACE_MAINNET_NETWORK, txHash)
if (baseTx === undefined) {
throw new Error("Transaction not found")
}
const result4 = await retraceBaseTx(RETRACE_MAINNET_NETWORK, baseTx)
All methods are exported from retracer-core and can be used independently:
All main types (transactions, blocks, messages, tracing results) are exported from retracer-core and are fully typed (see src/types.ts).
MIT © TON Studio, TON Core
FAQs
Core TxTracer library for collecting transaction information
We found that @ton/retracer-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.