Skip to main content

unsafe_requestAddStake

Transaction Builder API: Add stake to a validator's staking pool using multiple coins and amount.

Transaction Builder API: Add stake to a validator's staking pool using multiple coins and amount.

Parameters

  • signer : <SuiAddress> - the transaction signer's Sui address
  • coins : <[ObjectID]> - Coin<SUI> object to stake
  • amount : <uint64> - stake amount
  • validator : <SuiAddress> - the validator's Sui address
  • 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_requestAddStake

Request

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

Result

{
"jsonrpc": "2.0",
"result": {
"txBytes": "AAAEAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQEAAAAAAAAAAQEAdCdOPcwbz3NgspHg/X1aZsRo1Wx2ZmQCjTTN12DAAJCkIFQAAAAAACC/HMsNq7PPzkJSKt1qkBzkDWjrvOSrW8fnMi8SJMWFIwAJAQIAAAAAAAAAACCIEnAC1DqsSpJCK0s11B4X1yti0DNnUexS40HIuNELpwIFAAEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMKc3VpX3N5c3RlbRpyZXF1ZXN0X2FkZF9zdGFrZV9tdWxfY29pbgAEAQAAAgAAAQIAAQMAH0Rsxsqm3/Eh0VQFaOkeibfg029uAJUixZJlxiftA2EBC78rbAPLD14T1jSUU168V4VsaKHY/2c0zCGk5G36vA8p4XAAAAAAACAlGdyE6dJy1R1HDv2UJPmpwIxeq/b4rO9kZbkPBIZy1x9EbMbKpt/xIdFUBWjpHom34NNvbgCVIsWSZcYn7QNh6AMAAAAAAADQBwAAAAAAAAA=",
"gas": [
{
"objectId": "0x0bbf2b6c03cb0f5e13d63494535ebc57856c68a1d8ff6734cc21a4e46dfabc0f",
"version": 7397673,
"digest": "3VpxVaviG7RykDVLx1A21yT5YD1QFJpo1AWv5hJxQjKt"
}
],
"inputObjects": [
{
"SharedMoveObject": {
"id": "0x0000000000000000000000000000000000000000000000000000000000000005",
"initial_shared_version": "1",
"mutable": true
}
},
{
"ImmOrOwnedMoveObject": {
"objectId": "0x74274e3dcc1bcf7360b291e0fd7d5a66c468d56c766664028d34cdd760c00090",
"version": 5513380,
"digest": "Ds2LSHthqBzpEFDix7iLprGaTFgeDgyZtcDhTmZvDntJ"
}
},
{
"MovePackage": "0x0000000000000000000000000000000000000000000000000000000000000003"
},
{
"ImmOrOwnedMoveObject": {
"objectId": "0x0bbf2b6c03cb0f5e13d63494535ebc57856c68a1d8ff6734cc21a4e46dfabc0f",
"version": 7397673,
"digest": "3VpxVaviG7RykDVLx1A21yT5YD1QFJpo1AWv5hJxQjKt"
}
}
]
},
"id": 1
}