Skip to content

unsafe_paySui ​

Transaction Builder API

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 coins other than the first one are deleted.

Parameters ​

  • signer · SuiAddress · requiredthe transaction signer's Sui address
  • input_coins · ObjectID[] · requiredthe Sui coins to be used in this transaction, including the coin for gas payment.
  • recipients · SuiAddress[] · requiredthe recipients' addresses, the length of this vector must be the same as amounts.
  • amounts · BigInt<u64>[] · requiredthe amounts to be transferred to recipients, following the same order
  • gas_budget · BigInt<u64> · requiredthe gas budget, the transaction will fail if the gas cost exceed the budget

Result ​

  • TransactionBlockBytes · TransactionBlockBytes

    • gas · ObjectRef[] · requiredthe gas objects to be used
    • inputObjects · InputObjectKind[] · requiredobjects to be used in this transaction
    • txBytes · Base64 · requiredBCS serialized transaction data bytes without its type tag, as base-64 encoded string.

Example ​

Replace each <param> with a value of the type listed under Parameters.

Request ​

bash
curl https://mainnet-api.inodra.com/v1/jsonrpc \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "unsafe_paySui",
  "params": [
    "<signer>",
    "<input_coins>",
    "<recipients>",
    "<amounts>",
    "<gas_budget>"
  ]
}'

The full-stack Sui data layer.