For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Sui JSON-RPC (deprecated) (5/5)

API reference for Sui. All methods ->

Part 5 of 5: 1 · 2 · 3 · 4 · 5

Methods supported

unsafe_paySui

Sends 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.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <input_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> (BigInt_for_uint64): the amounts to be transferred to recipients, following the same order.
    • <gas_budget> (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_publish

Creates an unsigned transaction to publish a Move package.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <sender> (SuiAddress): the transaction signer's Sui address.
    • <compiled_modules> (Base64): the compiled bytes of a Move package.
    • <dependencies> (ObjectID): a list of transitive dependency addresses that this set of modules depends on.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_requestAddStake

Adds the stake to a validator's staking pool using multiple coins and amount.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <coins> (ObjectID): the coin object to stake.
    • <amount> (BigInt_for_uint64): the stake amount.
    • <validator> (SuiAddress): the validator's Sui address.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_requestWithdrawStake

Withdraws the stake from a validator's staking pool.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <staked_sui> (ObjectID): the StakedSui object ID.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_splitCoin

Creates an unsigned transaction to split a coin object into multiple coins.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <coin_object_id> (ObjectID): the coin object to be spilt.
    • <split_amounts> (BigInt_for_uint64): the amounts to split out from the coin.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_splitCoinEqual

Creates an unsigned transaction to split a coin object into multiple equal-size coins.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <coin_object_id> (ObjectID): the coin object to be spilt.
    • <split_count> (BigInt_for_uint64): the number of coins to split into.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_transferObject

Creates an unsigned transaction to transfer an object from one address to another.

The object's type must allow public transfers

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <object_id> (ObjectID): the ID of the object to be transferred.
    • <gas> (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.
    • <recipient> (SuiAddress): the recipient's Sui address.

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.

unsafe_transferSui

Creates an unsigned transaction to send a SUI coin object to a Sui address.

The SUI object is also used as the gas object.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <signer> (SuiAddress): the transaction signer's Sui address.
    • <sui_object_id> (ObjectID): the Sui coin object to be used in this transaction.
    • <gas_budget> (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget.
    • <recipient> (SuiAddress): the recipient's Sui address.
    • <amount> (BigInt_for_uint64): the amount to be split out and transferred

Returns

  • gas: the gas objects to be used.
  • inputObjects: objects to be used in this transaction.
  • txBytes: BCS serialized transaction data bytes without its type tag, as base-64 encoded string.