Skip to main content

unsafe_paySui

POST

Send 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. Specifically, what pay_sui 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 SUI from input coins left and deposit all SUI 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_cost4. all other input coints other than the first one are deleted.
param[0]
signerstringrequired
The transaction signer's Sui address
param[1]
inputCoinsarrayrequired
The Sui coins to be used in this transaction, including the coin for gas payment.
param[2]
recipientsarrayrequired
The recipients' addresses, the length of this vector must be the same as amounts.
param[3]
amountsarrayrequired
The amounts to be transferred to recipients, following the same order
param[4]
gasBudgetstringrequired
The gas budget, the transaction will fail if the gas cost exceed the budget
Responses
jsonrpcstring
idinteger
the gas objects to be used
digestobjectrequired
objectIdobjectrequired
versionobjectrequired
inputObjectsarrayrequired
objects to be used in this transaction
txBytesstringrequired
BCS serialized transaction data bytes without its type tag, as base-64 encoded string.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Bad Request"
}
cURL
curl -X POST 'https://sui-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "unsafe_paySui",
"params": [
null,
[],
[],
[],
null
]
}'