For building transactions ONLY when you cannot use the SDK to do so.

🚧

Method Deprecation Warning

Transaction builder methods with the unsafe namespace are expected to be deprecated.

Authentication, rate limits, and error handling

See our JSON-RPC API overview doc.

Transaction Builder API

unsafe_batchTransaction

Description
Create an unsigned batched transaction.

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • single_transaction_params : <[RPCTransactionRequestParams]> - list of transaction request parameters (moveCallRequestParams, transferObjectRequestParams, transferSuiRequestParams)
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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 exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
	  "method":"unsafe_batchTransaction", 
	  "params":[
	    "{{signer}}",
        [
          {
            "moveCallRequestParams": {
              "{{arguments}}": [],
              "{{function}},
              "{{module}}",
              "{{package_object_id}}",
              "{{type_arguments}}": []
            }
          },
          {
            "transferObjectRequestParams": {
              "{{object_id}}",
              "{{recipient}}"
            }
          }
        ],
        "{{gas}}",
        {{gas_budget}}],
    "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_mergeCoins

Description
Create an unsigned transaction to merge multiple coins into one coin.

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • primary_coin : <ObjectID> - the coin object to merge into; this coin will remain after the transaction
  • coin_to_merge : <ObjectID> - the coin object to be merged; this coin will be destroyed and the balance will be added to the primary_coin
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_mergeCoins",
      "params":["{{signer}}",
      			"{{primary_coin}}",
      			"{{coin_to_merge}}",            
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_moveCall

Description
Create an unsigned transaction to execute a Move call on the network, by calling the specified function in the module of a given package.

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • package_object_id : <ObjectID> - the Move package ID, e.g. 0x2
  • module : <string> - the Move module name, e.g. nft_minter
  • function : <string> - the Move function name, e.g. mint
  • type_arguments : <[TypeTag]> - the type arguments of the Move function
  • arguments : <[SuiJsonValue]> - the arguments to be passed into the Move function, in SuiJSON format
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
  • execution_mode : <SuiTransactionBuilderMode> - Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be SuiTransactionBuilderMode::Commit when it's None.
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_moveCall",
      "params":["{{signer}}",
      			"{{package_object_id}}",
      			"{{module}}",
      			"{{function}}",  
      			"{{type_arguments}}",
      			"{{arguments}}",            
      			"{{gas}}",      
      			{{gas_budget}},   
                "{{execution_mode}}"],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_pay

Description
Send Coin to a list of addresses, where T can be any coin type, following a list of amounts, The object specified in the gas field will be used to pay the gas fee for the transaction. The gas object can not appear in input_coins. If the gas object is not specified, the RPC server will auto-select one.

Params

  • signer: <SuiAddress> - the transaction signer's Sui address
  • input_coins : <ObjectID> - the Sui coins to be used in this transaction
  • recipients : <SuiAddress> - the recipients' addresses, the length of this vector must be the same as amounts.
  • amounts : <[]> - the amounts to be transferred to recipients, following the same order
  • gas : <ObjectID> - the gas object to be used in this transaction, the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_pay",
      "params":["{{signer}}",
      			"{{input_coins}}", 
      			"{{recipients}}",             
      			{{amounts}},
            	"{{gas}}",
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_payAllSui

Description
Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what the method does is:

  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.

Params

  • 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.
  • recipient : <SuiAddress> - the recipient address
  • gas_budget : <BigInt_for_uint64> - the gas budget; the transaction will fail if the gas cost exceed the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_payAllSui",
      "params":["{{signer}}",
      			"{{input_coins}}", 
      			"{{recipient}}",
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_paySui

Description
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 = sum(input_coins) - sum(amounts) - actual_gas_cost
  4. All other input coins other than the first are deleted

Params

  • 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 : <[]> - 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_paySui",
      "params":["{{signer}}",
      			"{{input_coins}}", 
      			"{{recipients}}",             
      			{{amounts}},
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_publish

Description
Create an unsigned transaction to publish a Move module.

Params

  • sender : <SuiAddress> - the transaction signer's Sui address
  • compiled_modules : <[Base64]> - the compiled bytes of a Move module, the
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_publish",
      "params":["{{sender}}",
      			"{{compiled_modules}}",           
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_requestAddStake

Description
Add delegated stake to a validator's staking pool using multiple coins and amount.

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • coins : <[ObjectID]> - Coin or LockedCoin object to delegate
  • amount : <BigInt_for_uint64> - delegation amount
    -validator : <SuiAddress> - the validator's Sui address
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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 exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_requestAddStake",
      "params":["{{signer}}",
      			"{{coins}}", 
      			{{amount}},             
      			"{{validator}}",
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_requestWithdrawStake

Description
Withdraw stake from a validator's staking pool.

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • staked_sui : <[ObjectID]> - staked Sui object ID
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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 exceeds the budget
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"sui_requestWithdrawDelegation",
      "params":["{{signer}}",
      			"{{staked_sui}}",
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - BCS serialized transaction data bytes without its type tag, as base-64 encoded string

unsafe_splitCoin

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

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • coin_object_id : <ObjectID> - the coin object to be spilt
  • split_amounts : <[]> - the amounts to split out from the coin
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_splitCoin",
      "params":["{{signer}}",
      			"{{coin_object_id}}",
      			{{split_amounts}},       
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_splitCoinEqual

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

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • coin_object_id : <ObjectID> - the coin object to be spilt
  • split_count : <uint164> - the number of coins to split into
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_splitCoinEqual",
      "params":["{{signer}}",
      			"{{coin_object_id}}",
      			{{split_count}},       
      			"{{gas}}",            
                {{gas_budget}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_transferObject

Description
Create an unsigned transaction to transfer an object from one address to another. The object's type must allow public transfers

Params

  • signer : <SuiAddress> - the transaction signer's Sui address
  • object_id : <ObjectID> - the ID of the object to be transferred
  • gas : <ObjectID> - gas object to be used in this transaction; the gateway 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
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_transferObject",
      "params":["{{signer}}",
      			"{{object_id}}",     
      			"{{gas}}",  
      			{{gas_budget}},             
                "{{recipient}}"],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string

unsafe_transferSui

Description
Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used as the gas object.

Params

  • 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> - gas object to be used in this transaction; the gateway will pick one from the signer's possession if not provided
curl https://api.shinami.com/node/v1/<<apiKey>> \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "jsonrpc":"2.0", 
      "method":"unsafe_transferSui",
      "params":["{{signer}}",
      			"{{sui_object_id}}", 
      			{{gas_budget}},             
      			"{{recipient}}",            
                {{amount}}],
      "id":1}'

Result

  • TransactionBytes : <TransactionBytes>
  • gas : <[ObjectRef]> - the gas object to be used
  • inputObjects : <[InputObjectKind]> - objects to be used in this transaction
  • txBytes : <[Base64]> - transaction data bytes, as base-64 encoded string