sui_executeTransactionBlock{deprecated} - Sui
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.
This method is deprecated
Parameters
| Parameter | Type | Required | Description | Default/Supported Values |
|---|---|---|---|---|
| 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
bashcurl --location --request POST 'https://shared.eu-central-1.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"
],
}'javascriptimport 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://shared.eu-central-1.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));pythonimport requests
import json
url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
payload = json.dumps({
"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"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)rustuse reqwest::header;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.header(header::CONTENT_TYPE, "application/json")
.body(r#"{
"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"
}"#)
.send()
.await?;
println!("{}", response.text().await?);
Ok(())
}Response
json{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"digest": "7dp5WtTmtGp83EXYYFMzjBJRFeSgR67AzqMETLrfgeFx",
"effects": {
"messageVersion": "v1",
"status": {"status": "success"},
"executedEpoch": "100",
"gasUsed": {
"computationCost": "1000000",
"storageCost": "2000000",
"storageRebate": "500000"
}
},
"events": [],
"objectChanges": [],
"balanceChanges": [],
"confirmedLocalExecution": true
}
}Repsonse Parameters
| Parameter | Type | Description |
|---|---|---|
| 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
| Error | Description | Solution |
|---|---|---|
| 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
example.ts
typescriptimport { SuiClient } from '@mysten/sui/client';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
import { Transaction } from '@mysten/sui/transactions';
const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const keypair = new Ed25519Keypair();
const tx = new Transaction();
tx.transferObjects([tx.object('0x...')], tx.pure.address('0x...'));
const result = await client.signAndExecuteTransaction({
signer: keypair,
transaction: tx,
options: { showEffects: true, showEvents: true },
});
console.log(result);example_sui_rust.rs
rustuse sui_sdk::SuiClientBuilder;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let sui = SuiClientBuilder::default()
.build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.await?;
// Build and sign transaction, then execute
let result = sui.quorum_driver_api()
.execute_transaction_block(tx_bytes, vec![signature], None, None)
.await?;
println!("{:?}", result);
Ok(())
}