Polygon
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Polygon
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
trace_replayTransaction re-executes one historical Polygon PoS transaction and returns whichever trace types you request for it. Its standout output is the stateDiff, which marks each touched account with = (unchanged), + (created), - (deleted), or *{from,to} (modified) — a precise record of how a MATIC-fee transaction reshaped chain state. Send the request to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89), passing the transaction hash and your traceTypes. It replays the transaction and returns a selectable combination of call-tree trace, opcode-level VM trace, and state diff.
stateDiff to see which storage slot changed (or failed to) right before the failure.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | transactionHash | string | Sí | Hash of the transaction to replay. |
| 2 | traceTypes | array | Sí | One or more of `"trace"`, `"vmTrace"`, `"stateDiff"`. At least one value is required. |
| Tipo | Descripción |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is the call tree, `stateDiff` maps each affected address to balance/nonce/code/storage diffs using `=` (unchanged), `+` (created), `-` (deleted), `*{from,to}` (modified), `vmTrace` is the Parity-format opcode trace. |
Try it live in the Polygon playground.
| Código | Mensaje | Causa |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or not supported by this client (primarily OpenEthereum/Nethermind/Erigon). |
-32602 | Invalid params | Transaction hash is missing/malformed or traceTypes is empty or contains unknown values. |
-32000 | transaction not found | Transaction does not exist or archive trace data is unavailable for that block. |
vmTrace on a complex Polygon DeFi transaction produces enormous output — stick to trace or stateDiff when you do not need opcode detail.vmTrace format is Parity-specific — do not confuse it with Bor's Geth-style debug_traceTransaction struct-log; the two parse differently.Parámetros
0x-prefixed 32-byte hash
["trace"] | ["trace","vmTrace","stateDiff"]