Transaction Builder API
unsafe_batchTransaction
Create an unsigned batched transaction.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
single_transaction_params<[ RPCTransactionRequestParams ]>
Required: yes
Description: List of transaction request parameters
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
txn_builder_mode< IotaTransactionBlockBuilderMode >
Required: no
Description: Whether this is a regular transaction or a Dev Inspect Transaction
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_mergeCoins
Create an unsigned transaction to merge multiple coins into one coin.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
primary_coin< ObjectID >
Required: yes
Description: The coin object to merge into, this coin will remain after the transaction
coin_to_merge< ObjectID >
Required: yes
Description: The coin object to be merged, this coin will be destroyed, the balance will be added to
primary_coin
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_moveCall
Create an unsigned transaction to execute a Move call on the network, by calling the specified function in the module of a given package.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
package_object_id< ObjectID >
Required: yes
Description: The Move package ID, e.g.
0x2
module< string >
Required: yes
Description: The Move module name, e.g.
pay
function< string >
Required: yes
Description: The move function name, e.g.
split
type_arguments<[ TypeTag ]>
Required: yes
Description: The type arguments of the Move function
arguments<[ IotaJsonValue ]>
Required: yes
Description: The arguments to be passed into the Move function, in IotaJson format
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
execution_mode< IotaTransactionBlockBuilderMode >
Required: no
Description: Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be
IotaTransactionBlockBuilderMode::Commit
when it's None.
Result
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_pay
Send Coin<T>
to a list of addresses, where T
can be any coin type, following a list of amounts, The object specified in the gas
field will be used to pay the gas fee for the transaction. The gas object can not appear in input_coins
. If the gas object is not specified, the RPC server will auto-select one.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
input_coins<[ ObjectID ]>
Required: yes
Description: The IOTA coins to be used in this transaction
recipients<[ IotaAddress ]>
Required: yes
Description: The recipients' addresses, the length of this vector must be the same as amounts.
amounts<[ BigInt_for_uint64 ]>
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_payAllIota
Send all IOTA coins to one recipient. This is for IOTA coin only and does not require a separate gas coin object. Specifically, what pay_all_iota does are: 1. accumulate all IOTA from input coins and deposit all IOTA to the first input coin 2. transfer the updated first coin to the recipient and also use this first coin as gas coin object. 3. the balance of the first input coin after tx is sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
input_coins<[ ObjectID ]>
Required: yes
Description: The IOTA coins to be used in this transaction
recipients<[ IotaAddress ]>
Required: yes
Description: The recipients' addresses, the length of this vector must be the same as amounts.
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_payIota
Send IOTA coins to a list of addresses, following a list of amounts. This is for IOTA coin only and does not require a separate gas coin object. Specifically, what pay_iota does are: 1. debit each input_coin to create new coin following the order of amounts and assign it to the corresponding recipient. 2. accumulate all residual IOTA from input coins left and deposit all IOTA to the first input coin, then use the first input coin as the gas coin object. 3. the balance of the first input coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input coints other than the first one are deleted.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
input_coins<[ ObjectID ]>
Required: yes
Description: The IOTA coins to be used in this transaction
recipients<[ IotaAddress ]>
Required: yes
Description: The recipients' addresses, the length of this vector must be the same as amounts.
amounts<[ BigInt_for_uint64 ]>
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_publish
Create an unsigned transaction to publish a Move package.
Parameters
sender< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
compiled_modules<[ Base64 ]>
Required: yes
Description: The compiled bytes of a Move package
dependencies<[ ObjectID ]>
Required: yes
Description: A list of transitive dependency addresses that this set of modules depends on.
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_requestAddStake
Add stake to a validator's staking pool using multiple coins and amount.
Parameters
sender< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
coins<[ ObjectID ]>
Required: yes
Description: Coin object to stake
amount< BigInt_for_uint64 >
Required: no
Description: Stake amount
validator< IotaAddress >
Required: no
Description: The validator's IOTA address
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_requestAddTimelockedStake
Add timelocked stake to a validator's staking pool using multiple balances and amount.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
locked_balance< ObjectID >
Required: yes
Description: TimeLock<Balance> object to stake
validator< IotaAddress >
Required: no
Description: The validator's IOTA address
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_requestWithdrawStake
Withdraw stake from a validator's staking pool.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
staked_iota< ObjectID >
Required: yes
Description: StakedIota object ID
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_requestWithdrawTimelockedStake
Withdraw timelocked stake from a validator's staking pool.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
timelocked_staked_iota< ObjectID >
Required: yes
Description: TimelockedStakedIota object ID
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_splitCoin
Create an unsigned transaction to split a coin object into multiple coins.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
coin_object_id< ObjectID >
Required: yes
Description: The coin object to be spilt
split_amounts<[ BigInt_for_uint64 ]>
Required: yes
Description: The amounts to split out from the coin
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_splitCoinEqual
Create an unsigned transaction to split a coin object into multiple equal-size coins.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
coin_object_id< ObjectID >
Required: yes
Description: The coin object to be spilt
split_count< BigInt_for_uint64 >
Required: yes
Description: The number of coins to split into
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_transferIota
Create an unsigned transaction to send IOTA coin object to an IOTA address. The IOTA object is also used as the gas object.
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
iota_object_id< ObjectID >
Required: yes
Description: The IOTA coin object to be used in this transaction
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
recipient< IotaAddress >
Required: yes
Description: The recipient's IOTA address
amount< BigInt_for_uint64 >
Required: no
Description: The amount to be split out and transferred
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
unsafe_transferObject
Create an unsigned transaction to transfer an object from one address to another. The object's type must allow public transfers
Parameters
signer< IotaAddress >
Required: yes
Description: The transaction signer's IOTA address
object_id< ObjectID >
Required: yes
Description: The ID of the object to be transferred
gas< ObjectID >
Required: no
Description: Gas object to be used in this transaction, node will pick one from the signer's possession if not provided
gas_budget< BigInt_for_uint64 >
Required: yes
Description: The gas budget, the transaction will fail if the gas cost exceed the budget
recipient< IotaAddress >
Required: yes
Description: The recipient's IOTA address
Result
TransactionBlockBytes< TransactionBlockBytes >
Parameters
gas<[ ObjectRef ]>
Required: yes
Description: the gas objects to be used
inputObjects<[ InputObjectKind ]>
Required: yes
Description: objects to be used in this transaction
txBytes< Base64 >
Required: yes
Description: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
Last updated