Solana
Solana
Solana
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
simulateTransaction executes a Solana transaction against the bank without broadcasting it, so you can see what would happen before spending a single lamport on fees. The response wraps any execution err, the program logs, unitsConsumed (compute units), returnData, optional post-simulation accounts, and optional innerInstructions. It is the standard safety check before sendTransaction for SOL transfers, SPL token operations, and program calls like Raydium or Jupiter routes. Call it on TheRPC at https://solana.therpc.io/YOUR_API_KEY.
unitsConsumed to size an accurate compute-unit limit on the real transaction, so you neither over-reserve nor run out of budget mid-execution.err and logs before paying the SOL fee to broadcast it.accounts config field with the addresses you care about, to preview balances or program data after the transaction would run.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | transaction | string | Ja | Encoded transaction (signed or unsigned depending on flags). |
| 2 | config | object | Nein | Options: commitment, sigVerify, replaceRecentBlockhash, encoding (base58|base64), minContextSlot, accounts {addresses, encoding}, innerInstructions. |
| Typ | Beschreibung |
|---|---|
| object | RpcResponse wrapping { err, logs, accounts, unitsConsumed, returnData, innerInstructions? }. |
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
sigVerify and replaceRecentBlockhash are mutually exclusive — setting both returns an error. Use sigVerify to check signatures on a fully-signed payload, or replaceRecentBlockhash to simulate an unsigned draft with a fresh blockhash.null err with populated logs means the transaction succeeded in simulation only. It is not a guarantee of on-chain confirmation, since state can change before you actually send.base64 encoding and set the encoding field to match your payload; a mismatch makes the node fail to decode the transaction.