For building transactions ONLY when you cannot use the SDK to do so.
Method Deprecation Warning
Transaction builder methods with the unsafe namespace are expected to be deprecated.
Authentication, rate limits, and error handling
See our JSON-RPC API overview doc.
Transaction Builder API
unsafe_batchTransaction
Description
Create an unsigned batched transaction.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresssingle_transaction_params
:<[RPCTransactionRequestParams]>
- list of transaction request parameters (moveCallRequestParams, transferObjectRequestParams, transferSuiRequestParams)gas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_batchTransaction",
"params":[
"{{signer}}",
[
{
"moveCallRequestParams": {
"{{arguments}}": [],
"{{function}},
"{{module}}",
"{{package_object_id}}",
"{{type_arguments}}": []
}
},
{
"transferObjectRequestParams": {
"{{object_id}}",
"{{recipient}}"
}
}
],
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_mergeCoins
Description
Create an unsigned transaction to merge multiple coins into one coin.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressprimary_coin
:<ObjectID>
- the coin object to merge into; this coin will remain after the transactioncoin_to_merge
:<ObjectID>
- the coin object to be merged; this coin will be destroyed and the balance will be added to theprimary_coin
gas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_mergeCoins",
"params":["{{signer}}",
"{{primary_coin}}",
"{{coin_to_merge}}",
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_moveCall
Description
Create an unsigned transaction to execute a Move call on the network, by calling the specified function in the module of a given package.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresspackage_object_id
:<ObjectID>
- the Move package ID, e.g.0x2
module
:<string>
- the Move module name, e.g.nft_minter
function
:<string>
- the Move function name, e.g.mint
type_arguments
:<[TypeTag]>
- the type arguments of the Move functionarguments
:<[SuiJsonValue]>
- the arguments to be passed into the Move function, in SuiJSON formatgas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budgetexecution_mode
:<SuiTransactionBuilderMode>
- Whether this is a Normal transaction or a Dev Inspect Transaction. Default to beSuiTransactionBuilderMode::Commit
when it's None.
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_moveCall",
"params":["{{signer}}",
"{{package_object_id}}",
"{{module}}",
"{{function}}",
"{{type_arguments}}",
"{{arguments}}",
"{{gas}}",
{{gas_budget}},
"{{execution_mode}}"],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_pay
Description
Send Coin 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.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressinput_coins
:<ObjectID>
- the Sui coins to be used in this transactionrecipients
:<SuiAddress>
- the recipients' addresses, the length of this vector must be the same as amounts.amounts
:<[]>
- the amounts to be transferred to recipients, following the same ordergas
:<ObjectID>
- the gas object to be used in this transaction, the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_pay",
"params":["{{signer}}",
"{{input_coins}}",
"{{recipients}}",
{{amounts}},
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_payAllSui
Description
Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what the method does is:
- accumulate all SUI from input coins and deposit all SUI to the first input coin
- transfer the updated first coin to the recipient and also use this first coin as gas coin object.
- the balance of the first input coin after tx is sum(input_coins) - actual_gas_cost.
- all other input coins other than the first are deleted.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressinput_coins
:<ObjectID>
- the Sui coins to be used in this transaction, including the coin for gas payment.recipient
:<SuiAddress>
- the recipient addressgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_payAllSui",
"params":["{{signer}}",
"{{input_coins}}",
"{{recipient}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_paySui
Description
Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_all_sui does are:
- Accumulate all SUI from input coins and deposit all SUI to the first input coin
- Transfer the updated first coin to the recipient and also use this first coin as gas coin object
- The balance of the first input coin after tx = sum(input_coins) - sum(amounts) - actual_gas_cost
- All other input coins other than the first are deleted
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressinput_coins
:<ObjectID>
- the Sui coins to be used in this transaction, including the coin for gas payment.recipients
:<SuiAddress>
- the recipients' addresses, the length of this vector must be the same as amounts.amounts
:<[]>
- the amounts to be transferred to recipients, following the same ordergas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_paySui",
"params":["{{signer}}",
"{{input_coins}}",
"{{recipients}}",
{{amounts}},
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_publish
Description
Create an unsigned transaction to publish a Move module.
Params
sender
:<SuiAddress>
- the transaction signer's Sui addresscompiled_modules
:<[Base64]>
- the compiled bytes of a Move module, thegas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_publish",
"params":["{{sender}}",
"{{compiled_modules}}",
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_requestAddStake
Description
Add delegated stake to a validator's staking pool using multiple coins and amount.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresscoins
:<[ObjectID]>
- Coin or LockedCoin object to delegateamount
:<BigInt_for_uint64>
- delegation amount
-validator
:<SuiAddress>
- the validator's Sui addressgas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_requestAddStake",
"params":["{{signer}}",
"{{coins}}",
{{amount}},
"{{validator}}",
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_requestWithdrawStake
Description
Withdraw stake from a validator's staking pool.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressstaked_sui
:<[ObjectID]>
- staked Sui object IDgas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"sui_requestWithdrawDelegation",
"params":["{{signer}}",
"{{staked_sui}}",
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- BCS serialized transaction data bytes without its type tag, as base-64 encoded string
unsafe_splitCoin
Description
Create an unsigned transaction to split a coin object into multiple coins.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresscoin_object_id
:<ObjectID>
- the coin object to be spiltsplit_amounts
:<[]>
- the amounts to split out from the coingas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_splitCoin",
"params":["{{signer}}",
"{{coin_object_id}}",
{{split_amounts}},
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_splitCoinEqual
Description
Create an unsigned transaction to split a coin object into multiple equal-size coins.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresscoin_object_id
:<ObjectID>
- the coin object to be spiltsplit_count
:<uint164>
- the number of coins to split intogas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_splitCoinEqual",
"params":["{{signer}}",
"{{coin_object_id}}",
{{split_count}},
"{{gas}}",
{{gas_budget}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_transferObject
Description
Create an unsigned transaction to transfer an object from one address to another. The object's type must allow public transfers
Params
signer
:<SuiAddress>
- the transaction signer's Sui addressobject_id
:<ObjectID>
- the ID of the object to be transferredgas
:<ObjectID>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not providedgas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budgetrecipient
:<SuiAddress>
- the recipient's Sui address
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_transferObject",
"params":["{{signer}}",
"{{object_id}}",
"{{gas}}",
{{gas_budget}},
"{{recipient}}"],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string
unsafe_transferSui
Description
Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used as the gas object.
Params
signer
:<SuiAddress>
- the transaction signer's Sui addresssui_object_id
:<ObjectID>
- the Sui coin object to be used in this transactiongas_budget
:<BigInt_for_uint64>
- the gas budget; the transaction will fail if the gas cost exceed the budgetrecipient
:<SuiAddress>
- the recipient's Sui addressamount
:<BigInt_for_uint64>
- gas object to be used in this transaction; the gateway will pick one from the signer's possession if not provided
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0",
"method":"unsafe_transferSui",
"params":["{{signer}}",
"{{sui_object_id}}",
{{gas_budget}},
"{{recipient}}",
{{amount}}],
"id":1}'
Result
TransactionBytes
:<TransactionBytes>
- gas :
<[ObjectRef]>
- the gas object to be used - inputObjects :
<[InputObjectKind]>
- objects to be used in this transaction - txBytes :
<[Base64]>
- transaction data bytes, as base-64 encoded string