Skip to main content

unsafe_transferSui

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

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

Parameters

  • 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

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

Example Request and Result for unsafe_transferSui

Request

curl --location 'https://sui-testnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "unsafe_transferSui",
"params": [
"0x563ee81d153032ef327b349420cf91e28a8d5528cbdcae5c108093a8a3879abb",
"0x003f9c0f533b4f72b38e4dfd90f26c29f052eb855ab8fb1912d20ac2e39ac3bc",
"2000",
"0xeeb30f4dc675a7d49b8abedf58eb2e3738facfc554c80f4b27ab62aa02878f56",
"2"
]
}'

Result

{
"jsonrpc": "2.0",
"result": {
"txBytes": "AAACACDusw9NxnWn1JuKvt9Y6y43OPrPxVTID0snq2KqAoePVgAIAgAAAAAAAAACAgABAQEAAQECAAABAABWPugdFTAy7zJ7NJQgz5Hiio1VKMvcrlwQgJOoo4eauwEAP5wPUztPcrOOTf2Q8mwp8FLrhVq4+xkS0grC45rDvCKgEAAAAAAAIPTdUyUhkhrkLz3h/2BpV7H2ZXm6WUv66fIHIPSPLJavVj7oHRUwMu8yezSUIM+R4oqNVSjL3K5cEICTqKOHmrvoAwAAAAAAANAHAAAAAAAAAA==",
"gas": [
{
"objectId": "0x003f9c0f533b4f72b38e4dfd90f26c29f052eb855ab8fb1912d20ac2e39ac3bc",
"version": 1089570,
"digest": "HUrDhmdBEtQW8LBAd2fdQrqznLedy16rPjME6WdZqCsG"
}
],
"inputObjects": [
{
"ImmOrOwnedMoveObject": {
"objectId": "0x003f9c0f533b4f72b38e4dfd90f26c29f052eb855ab8fb1912d20ac2e39ac3bc",
"version": 1089570,
"digest": "HUrDhmdBEtQW8LBAd2fdQrqznLedy16rPjME6WdZqCsG"
}
}
]
},
"id": 1
}