Skip to main content
The WriteApi provides methods for executing and testing transactions on the Sui network. All methods are in the sui namespace.

Methods

executeTransactionBlock

Executes a signed transaction and waits for results based on the request type.
tx_bytes
Base64
required
BCS serialized transaction data bytes without its type tag, as base64-encoded string
signatures
Base64[]
required
List of signatures (flag || signature || pubkey bytes) as base64-encoded strings. Each signature is committed to the intent message of the transaction data
options
SuiTransactionBlockResponseOptions
Options for specifying the content to be returned
request_type
ExecuteTransactionRequestType
The request type, derived from SuiTransactionBlockResponseOptions if None
result
SuiTransactionBlockResponse
The transaction execution result
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sui_executeTransactionBlock",
    "params": [
      "AAACA...",
      ["AQA..."],
      {
        "showInput": true,
        "showEffects": true,
        "showEvents": true
      },
      "WaitForLocalExecution"
    ]
  }'

devInspectTransactionBlock

Runs the transaction in dev-inspect mode. This allows nearly any transaction (or Move call) with any arguments. Detailed results are provided, including both the transaction effects and any return values.
Dev inspect does not validate ownership, visibility, or other constraints. Use this for debugging and testing only.
sender_address
SuiAddress
required
The sender address
tx_bytes
Base64
required
BCS encoded TransactionKind (as opposed to TransactionData, which includes gasBudget and gasPrice)
gas_price
BigInt<u64>
Gas price to use. Gas is not charged, but gas usage is still calculated. Defaults to reference gas price
epoch
BigInt<u64>
The epoch to perform the call. Will be set from the system state object if not provided
additional_args
DevInspectArgs
Additional arguments including gas_budget, gas_objects, gas_sponsor and skip_checks
result
DevInspectResults
The inspection results, including return values and effects
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sui_devInspectTransactionBlock",
    "params": [
      "0x...",
      "AAACA...",
      null,
      null,
      {
        "gas_budget": "10000000"
      }
    ]
  }'

dryRunTransactionBlock

Returns transaction execution effects including the gas cost summary, without committing the effects to the chain.
Unlike dev-inspect, dry run validates all transaction constraints (ownership, signatures, etc.) as if executing on-chain.
tx_bytes
Base64
required
BCS serialized transaction data bytes as base64-encoded string
result
DryRunTransactionBlockResponse
The dry run results
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sui_dryRunTransactionBlock",
    "params": [
      "AAACA..."
    ]
  }'

Dev Inspect vs Dry Run

FeaturedevInspectTransactionBlockdryRunTransactionBlock
Validates ownershipNoYes
Validates signaturesNoYes
Checks visibilityNoYes
Allows any inputsYesNo
Gas chargedNoNo
Use caseDebugging, testingPre-flight validation

Usage Example with Rust SDK

use sui_sdk::SuiClientBuilder;
use sui_types::transaction::TransactionData;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default()
        .build("https://fullnode.mainnet.sui.io:443")
        .await?;
    
    // Build transaction data
    let tx_data: TransactionData = /* ... */;
    
    // Dry run before executing
    let dry_run = sui.read_api()
        .dry_run_transaction_block(tx_data.clone())
        .await?;
    
    println!("Gas cost: {:?}", dry_run.effects.gas_used());
    
    Ok(())
}

Build docs developers (and LLMs) love