POSTunsafe_payAllSui

Sui Mainnethttps://sui-mainnet.nodit.io/

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:

  1. accumulate all SUI from input coins and deposit all SUI 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.
Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required
params[0]string

Hex string encoding.

params[1]string[]

The Sui coins to be used in this transaction, including the coin for gas payment.

params[2]string

Hex string encoding.

params[3]string

Hex string encoding.

Responses
jsonrpcstring
idinteger
gasobject[]required

the gas objects to be used

digeststringrequired

Base64 string representing the object digest

objectIdstringrequired

Hex code as string representing the object id

versioninteger (uint64)required

Object version.

inputObjectsoneOf[]required

objects to be used in this transaction

object 1object
MovePackagestringrequired

Hex string encoding.

object 2object
ImmOrOwnedMoveObjectobjectrequired
digeststringrequired

Base64 string representing the object digest

objectIdstringrequired

Hex code as string representing the object id

versioninteger (uint64)required

Object version.

object 3object
SharedMoveObjectobjectrequired
idstringrequired

Hex string encoding.

initial_shared_versionstringrequired
mutableboolean
txBytesstringrequired

BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

X-API-KEY
RequestCU350
cURL
curl -X POST "https://sui-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "unsafe_payAllSui",
  "params": [
    "0x278ae6b78bddb5eea883f3aa128b825ec063fafc5c2efa3e6216a3ea612c3e29",
    [
      "0x2080166125903258dad22a13167c4baacede40abbb95a99b73e845700e9946ba",
      "0x803070324a600994b6e4fc72023feab51299056895bd6d99a579398b57d91e30"
    ],
    "0xccb978e6e5bfc1f026b58dd6af3877d9523526b1ea84b943fb9589506de394a7",
    "10000000"
  ]
}'
Response
Example · 200
{
  "jsonrpc": "string",
  "id": 0,
  "result": {
    "gas": [
      {
        "digest": "string",
        "objectId": "string",
        "version": 0
      }
    ],
    "inputObjects": [
      {}
    ],
    "txBytes": "string"
  }
}