Skip to main content
The TransactionBuilder API is in the unsafe namespace because it’s intended for development and testing. For production applications, use the Rust SDK or TypeScript SDK instead.
The TransactionBuilder API provides methods for building unsigned transaction blocks. All methods are in the unsafe namespace.

Transfer Methods

transferObject

Creates an unsigned transaction to transfer an object from one address to another. The object’s type must allow public transfers.
signer
SuiAddress
required
The transaction signer’s Sui address
object_id
ObjectID
required
The ID of the object to be transferred
gas
ObjectID
Gas object to be used in this transaction. Node will pick one from the signer’s possession if not provided
gas_budget
BigInt<u64>
required
The gas budget. The transaction will fail if the gas cost exceeds the budget
recipient
SuiAddress
required
The recipient’s Sui address
result
TransactionBlockBytes
The unsigned transaction bytes

transferSui

Creates an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used as the gas object.
signer
SuiAddress
required
The transaction signer’s Sui address
sui_object_id
ObjectID
required
The Sui coin object to be used in this transaction
gas_budget
BigInt<u64>
required
The gas budget. The transaction will fail if the gas cost exceeds the budget
recipient
SuiAddress
required
The recipient’s Sui address
amount
BigInt<u64>
The amount to be split out and transferred
result
TransactionBlockBytes
The unsigned transaction bytes

Payment Methods

pay

Sends Coin<T> to a list of addresses, where T can be any coin type, following a list of amounts.
signer
SuiAddress
required
The transaction signer’s Sui address
input_coins
ObjectID[]
required
The Sui coins to be used in this transaction
recipients
SuiAddress[]
required
The recipients’ addresses (length must match amounts)
amounts
BigInt<u64>[]
required
The amounts to be transferred to recipients, following the same order
gas
ObjectID
Gas object to be used. Cannot appear in input_coins. Node will pick one if not provided
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

paySui

Sends SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and does not require a separate gas coin object.
The first input coin is used as the gas coin. Its balance after the transaction is: sum(input_coins) - sum(amounts) - actual_gas_cost
signer
SuiAddress
required
The transaction signer’s Sui address
input_coins
ObjectID[]
required
The Sui coins to be used, including the coin for gas payment
recipients
SuiAddress[]
required
The recipients’ addresses (length must match amounts)
amounts
BigInt<u64>[]
required
The amounts to be transferred to recipients
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

payAllSui

Sends all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin.
signer
SuiAddress
required
The transaction signer’s Sui address
input_coins
ObjectID[]
required
The Sui coins to be used, including the coin for gas payment
recipient
SuiAddress
required
The recipient address
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

Move Call Methods

moveCall

Creates an unsigned transaction to execute a Move call on the network.
signer
SuiAddress
required
The transaction signer’s Sui address
package_object_id
ObjectID
required
The Move package ID (e.g., 0x2)
module
string
required
The Move module name (e.g., pay)
function
string
required
The Move function name (e.g., split)
type_arguments
SuiTypeTag[]
required
The type arguments of the Move function
arguments
SuiJsonValue[]
required
The arguments to be passed into the Move function, in SuiJson format
gas
ObjectID
Gas object to be used. Node will pick one if not provided
gas_budget
BigInt<u64>
required
The gas budget
execution_mode
SuiTransactionBlockBuilderMode
Whether this is a Normal transaction or Dev Inspect. Defaults to Commit
result
TransactionBlockBytes
The unsigned transaction bytes

publish

Creates an unsigned transaction to publish a Move package.
sender
SuiAddress
required
The transaction signer’s Sui address
compiled_modules
Base64[]
required
The compiled bytes of a Move package
dependencies
ObjectID[]
required
A list of transitive dependency addresses that this set of modules depends on
gas
ObjectID
Gas object to be used. Node will pick one if not provided
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

Coin Operations

splitCoin

Creates an unsigned transaction to split a coin object into multiple coins.
signer
SuiAddress
required
The transaction signer’s Sui address
coin_object_id
ObjectID
required
The coin object to be split
split_amounts
BigInt<u64>[]
required
The amounts to split out from the coin
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

splitCoinEqual

Creates an unsigned transaction to split a coin object into multiple equal-size coins.
signer
SuiAddress
required
The transaction signer’s Sui address
coin_object_id
ObjectID
required
The coin object to be split
split_count
BigInt<u64>
required
The number of coins to split into
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

mergeCoins

Creates an unsigned transaction to merge multiple coins into one coin.
signer
SuiAddress
required
The transaction signer’s Sui address
primary_coin
ObjectID
required
The coin object to merge into (remains after transaction)
coin_to_merge
ObjectID
required
The coin object to be merged (destroyed, balance added to primary_coin)
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

Staking Operations

requestAddStake

Adds stake to a validator’s staking pool using multiple coins and amount.
signer
SuiAddress
required
The transaction signer’s Sui address
coins
ObjectID[]
required
Coin objects (SUI) to stake
amount
BigInt<u64>
Stake amount
validator
SuiAddress
required
The validator’s Sui address
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

requestWithdrawStake

Withdraws stake from a validator’s staking pool.
signer
SuiAddress
required
The transaction signer’s Sui address
staked_sui
ObjectID
required
StakedSui object ID
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
result
TransactionBlockBytes
The unsigned transaction bytes

Batch Transactions

batchTransaction

Creates an unsigned batched transaction.
signer
SuiAddress
required
The transaction signer’s Sui address
single_transaction_params
RPCTransactionRequestParams[]
required
List of transaction request parameters
gas
ObjectID
Gas object to be used
gas_budget
BigInt<u64>
required
The gas budget
txn_builder_mode
SuiTransactionBlockBuilderMode
Whether this is a regular transaction or Dev Inspect
result
TransactionBlockBytes
The unsigned transaction bytes

Migration Note

Instead of using these RPC methods directly, consider using:These provide better developer experience, type safety, and error handling.

Build docs developers (and LLMs) love