Skip to main content

unsafe_splitCoinEqual

Transaction Builder API: Create an unsigned transaction to split a coin object into multiple equal-size coins.

Transaction Builder API: Create an unsigned transaction to split a coin object into multiple equal-size coins.

Parameters

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

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

Request

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

Result

{
"jsonrpc": "2.0",
"result": {
"txBytes": "AAACAQAAP5wPUztPcrOOTf2Q8mwp8FLrhVq4+xkS0grC45rDvCKgEAAAAAAAIPTdUyUhkhrkLz3h/2BpV7H2ZXm6WUv66fIHIPSPLJavAAgCAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIDcGF5D2RpdmlkZV9hbmRfa2VlcAEHhcW2SYh7F3eFYaOgm8GkdCufmcmnl2PomswKXdwj7LUDZXRoA0VUSAACAQAAAQEAVj7oHRUwMu8yezSUIM+R4oqNVSjL3K5cEICTqKOHmrsBC78rbAPLD14T1jSUU168V4VsaKHY/2c0zCGk5G36vA8p4XAAAAAAACAlGdyE6dJy1R1HDv2UJPmpwIxeq/b4rO9kZbkPBIZy11Y+6B0VMDLvMns0lCDPkeKKjVUoy9yuXBCAk6ijh5q76AMAAAAAAADQBwAAAAAAAAA=",
"gas": [
{
"objectId": "0x0bbf2b6c03cb0f5e13d63494535ebc57856c68a1d8ff6734cc21a4e46dfabc0f",
"version": 7397673,
"digest": "3VpxVaviG7RykDVLx1A21yT5YD1QFJpo1AWv5hJxQjKt"
}
],
"inputObjects": [
{
"ImmOrOwnedMoveObject": {
"objectId": "0x003f9c0f533b4f72b38e4dfd90f26c29f052eb855ab8fb1912d20ac2e39ac3bc",
"version": 1089570,
"digest": "HUrDhmdBEtQW8LBAd2fdQrqznLedy16rPjME6WdZqCsG"
}
},
{
"MovePackage": "0x0000000000000000000000000000000000000000000000000000000000000002"
},
{
"MovePackage": "0x85c5b649887b17778561a3a09bc1a4742b9f99c9a79763e89acc0a5ddc23ecb5"
},
{
"ImmOrOwnedMoveObject": {
"objectId": "0x0bbf2b6c03cb0f5e13d63494535ebc57856c68a1d8ff6734cc21a4e46dfabc0f",
"version": 7397673,
"digest": "3VpxVaviG7RykDVLx1A21yT5YD1QFJpo1AWv5hJxQjKt"
}
}
]
},
"id": 1
}