POSTunsafe_paySui

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

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_cost
  4. all other input coints other than the first one 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[]

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

params[3]string[]

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

params[4]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_paySui",
  "params": [
    "0x278ae6b78bddb5eea883f3aa128b825ec063fafc5c2efa3e6216a3ea612c3e29",
    [
      "0x2080166125903258dad22a13167c4baacede40abbb95a99b73e845700e9946ba",
      "0x803070324a600994b6e4fc72023feab51299056895bd6d99a579398b57d91e30"
    ],
    [
      "0xccb978e6e5bfc1f026b58dd6af3877d9523526b1ea84b943fb9589506de394a7",
      "0xe23ae882a87078749ba09f2346b51ea3f2fc46eaa789351672c5bba5954a7f61"
    ],
    [
      "1000000000",
      "2000000000"
    ],
    "10000000"
  ]
}'
Response
Example · 200
{
  "jsonrpc": "string",
  "id": 0,
  "result": {
    "gas": [
      {
        "digest": "string",
        "objectId": "string",
        "version": 0
      }
    ],
    "inputObjects": [
      {}
    ],
    "txBytes": "string"
  }
}