sui_executeTransactionBlock - Sui
Example code for the sui_executeTransactionBlock JSON-RPC method. Complete guide on how to use sui_executeTransactionBlock JSON-RPC in GetBlock Web3 documentation.
This method executes a signed transaction block on the SUI network and waits for the results. This is the primary method for submitting transactions, including token transfers, smart contract calls, NFT operations, and staking actions.
Parameters
tx_bytes
string
Yes
BCS serialized transaction data (Base64 encoded)
Valid Base64 transaction bytes
signatures
array
Yes
Array of Base64 encoded signatures
Valid signature strings
options
object
No
Response content options
See TransactionBlockResponseOptions
request_type
string
No
Execution wait mode
"WaitForEffectsCert" or "WaitForLocalExecution"
Request Example
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "sui_executeTransactionBlock",
"params": [
"AAACACB...<base64_tx_bytes>",
["AQ7K...<base64_signature>"],
{
"showInput": true,
"showEffects": true,
"showEvents": true,
"showObjectChanges": true,
"showBalanceChanges": true
},
"WaitForLocalExecution"
],
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "sui_executeTransactionBlock",
"params": [
"AAACACB...<base64_tx_bytes>",
["AQ7K...<base64_signature>"],
{
"showInput": true,
"showEffects": true,
"showEvents": true,
"showObjectChanges": true,
"showBalanceChanges": true
},
"WaitForLocalExecution"
],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
Repsonse Parameters
result.digest
string
Unique transaction digest
result.transaction
object
Executed transaction data
result.effects
object
Execution results and gas usage
result.events
array
Events emitted during execution
result.objectChanges
array
Objects created, modified, or deleted
result.balanceChanges
array
Balance changes per address
result.confirmedLocalExecution
boolean
Local execution confirmation
Use Cases
Token Transfers: Submit signed transactions to transfer SUI or custom tokens between addresses on the network.
Smart Contract Execution: Execute Move function calls on deployed packages, enabling interaction with DeFi protocols and dApps.
NFT Operations: Mint, transfer, or burn NFTs by executing the appropriate transaction blocks.
Error handling
InvalidSignature
Signature verification failed
Ensure the transaction is signed correctly
InsufficientGas
Gas budget insufficient
Increase gas budget in transaction
InsufficientCoinBalance
Not enough balance
Verify sender has sufficient funds
ObjectNotFound
Referenced object missing
Check object IDs are valid
SDK Integration
Last updated
Was this helpful?