sui_devInspectTransactionBlock - Sui
Example code for the sui_devInspectTransactionBlock JSON-RPC method. Complete guide on how to use sui_devInspectTransactionBlock JSON-RPC in GetBlock Web3 documentation.
This method runs a transaction in dev-inspect mode for testing and development purposes. Unlike dryRunTransactionBlock, this method, it doesn't require gas payment and can simulate transactions from any sender address. It's primarily used for debugging and testing Move function calls.
Parameters
sender_address
SuiAddress
Yes
The simulated sender's address
tx_bytes
Base64
Yes
BCS encoded TransactionKind
gas_price
BigInt_for_uint64
No
Gas price for cost calculation
epoch
BigInt_for_uint64
No
Epoch to simulate execution in
Returns
effects
object
Simulated execution effects
results
array
Return values from Move calls
events
array
Events that would be emitted
Request Example
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "sui_devInspectTransactionBlock",
"params": [
"0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961",
"AAACACB...<base64_tx_bytes>",
null,
null
]
}'const axios = require('axios');
const url = 'https://go.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'sui_devInspectTransactionBlock',
params: [
'0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961',
'AAACACB...<base64_tx_bytes>',
null,
null
]
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
Response Parameters
effects
object
Simulated execution effects and gas costs
results
array
Return values from Move function calls
events
array
Events that would be emitted
Use Cases
Test Move function calls without gas
Debug smart contract logic
Simulate transactions from any address
Inspect return values from functions
Development and testing workflows
Error Handling
-32602
Invalid params - malformed input
-32603
Internal error - simulation failed
MoveAbort
Move execution aborted
SDK Integration
Last updated
Was this helpful?