{"id":51219311,"url":"https://github.com/ton-blockchain/retracer-core","last_synced_at":"2026-06-28T06:01:04.393Z","repository":{"id":293345478,"uuid":"981145016","full_name":"ton-blockchain/retracer-core","owner":"ton-blockchain","description":"Core txtracer library for collecting transaction information","archived":false,"fork":false,"pushed_at":"2026-06-25T09:41:35.000Z","size":236,"stargazers_count":17,"open_issues_count":9,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-06-25T22:03:18.860Z","etag":null,"topics":["blockchain","tact","ton","tracing","txtracer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@ton/retracer-core","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ton-blockchain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-10T12:48:51.000Z","updated_at":"2026-06-25T07:52:19.000Z","dependencies_parsed_at":"2025-06-11T08:59:45.944Z","dependency_job_id":"43e68b32-a155-48e5-8fbf-73774051a64e","html_url":"https://github.com/ton-blockchain/retracer-core","commit_stats":null,"previous_names":["tact-lang/txtracer-core","tact-lang/retracer-core","ton-blockchain/txtracer-core","ton-blockchain/retracer-core"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ton-blockchain/retracer-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ton-blockchain%2Fretracer-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ton-blockchain%2Fretracer-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ton-blockchain%2Fretracer-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ton-blockchain%2Fretracer-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ton-blockchain","download_url":"https://codeload.github.com/ton-blockchain/retracer-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ton-blockchain%2Fretracer-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34878963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","tact","ton","tracing","txtracer"],"created_at":"2026-06-28T06:00:40.195Z","updated_at":"2026-06-28T06:01:04.388Z","avatar_url":"https://github.com/ton-blockchain.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# retracer-core\n\n**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.\n\n## Features\n\n- **Detailed transaction tracing**: Emulate transaction execution in an environment identical to TON blockchain's mainnet.\n- **Block and account data collection**: Obtain account state snapshots, block configuration, and transaction history.\n- **Work with libraries and contracts**: Automatic loading and handling of exotic library cells.\n- **Analysis of incoming/outgoing messages, balance calculations, and VM log collection.**\n- **Supports mainnet, testnet, and custom Toncenter-compatible endpoints.**\n\n## Installation\n\n```bash\nyarn add @ton/retracer-core\n# or\nnpm install @ton/retracer-core\n```\n\n## Quick Start\n\n```ts\nimport {RETRACE_MAINNET_NETWORK, retrace} from \"@ton/retracer-core\"\n\n// Example: trace a transaction by its hash\nconst result = await retrace(RETRACE_MAINNET_NETWORK, \"YOUR_TX_HASH\")\nconsole.log(result)\n```\n\n## Main API\n\n### Transaction Tracing\n\n```ts\nimport {\n    RETRACE_MAINNET_NETWORK,\n    RETRACE_TESTNET_NETWORK,\n    findBaseTxByHash,\n    retrace,\n    retraceBaseTx,\n} from \"@ton/retracer-core\"\nimport type {RetraceNetworkConfig} from \"@ton/retracer-core\"\n\n/**\n * @param network - Toncenter-compatible network configuration\n * @param txHash - hex transaction hash\n * @returns Detailed execution report (TraceResult)\n */\nconst result1 = await retrace(RETRACE_MAINNET_NETWORK, txHash)\nconst result2 = await retrace(RETRACE_TESTNET_NETWORK, txHash)\n\nconst customNetwork: RetraceNetworkConfig = {\n    testnet: true,\n    v2BaseUrl: \"https://example.com/api/v2\",\n    v3BaseUrl: \"https://example.com/api/v3\",\n    toncenterApiKey: \"optional-api-key\",\n}\nconst result3 = await retrace(customNetwork, txHash)\n\n/**\n * Retrace a transaction described by base transaction information.\n * Base transaction info should be resolved through the same network first,\n * because it carries the Toncenter v3 shard block reference.\n */\nconst baseTx = await findBaseTxByHash(RETRACE_MAINNET_NETWORK, txHash)\nif (baseTx === undefined) {\n    throw new Error(\"Transaction not found\")\n}\nconst result4 = await retraceBaseTx(RETRACE_MAINNET_NETWORK, baseTx)\n```\n\n### Helper Methods\n\nAll methods are exported from `retracer-core` and can be used independently:\n\n- **findBaseTxByHash(network, txHash)** — Find base transaction info by hash.\n- **findRawTxByHash(network, baseTxInfo)** — Get the raw transaction BoC and shard reference.\n- **findShardBlockForTx(network, rawTx)** — Find the shard block containing the transaction.\n- **findMinLtInShardBlock(network, address, block, targetLt)** — Find the earliest account transaction lt in the same shard block.\n- **findAllTransactionsBetween(network, baseTx, minLt)** — Get all account transactions in a given range.\n- **getBlockConfig(network, mcSeqno)** — Get global config for a masterchain block.\n- **getBlockAccount(network, address, mcSeqno)** — Get account snapshot before a masterchain block.\n- **collectUsedLibraries(network, account, tx)** — Collect used library cells.\n- **prepareEmulator(blockConfig, libs, randSeed)** — Prepare the emulator for transaction execution.\n- **emulatePreviousTransactions(...)** — Emulate a chain of previous transactions to restore the state.\n- **computeFinalData(...)** — Gather final data from emulation result.\n- **findFinalActions(logs)** — Extract final actions from VM logs.\n- **shardAccountToBase64(shardAccount)** — Serialize an account to base64 for the emulator.\n\n## Types\n\nAll main types (transactions, blocks, messages, tracing results) are exported from `retracer-core` and are fully typed (see [src/types.ts](src/types.ts)).\n\n## Projects based on retracer-core\n\n- [TxTracer](https://txtracer.ton.org) — Web application for tracing and debugging any TON blockchain transactions\n\n## License\n\nMIT © TON Studio, TON Core\n\n## Links\n\n- [TON Documentation](https://ton.org/docs/)\n- [Source code \u0026 issue tracker](https://github.com/ton-blockchain/retracer-core)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fton-blockchain%2Fretracer-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fton-blockchain%2Fretracer-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fton-blockchain%2Fretracer-core/lists"}