Skip to main content

unsafe_requestWithdrawStake

'Transaction Builder API: Withdraw a stake from a validator''s staking pool.'

'Transaction Builder API: Withdraw a stake from a validator''s staking pool.'

Parameters

  • signer : <SuiAddress> - the transaction signer's Sui address
  • staked_sui: <ObjectID> - StakedSui object ID
  • 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_requestWithdrawStake

Request

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

Result

{
"jsonrpc": "2.0",
"result": {
"txBytes": "AAACAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQEAAAAAAAAAAQEABoUME55/iSPt0wYibv4I1+1pnq+o+Ljlmn+mqjH0gf+FQ9cAAAAAACAlOpVdGBlgqhK95qpVTddBWUUZkfnelKa4Md8l6JM2xwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMKc3VpX3N5c3RlbRZyZXF1ZXN0X3dpdGhkcmF3X3N0YWtlAAIBAAABAQDusw9NxnWn1JuKvt9Y6y43OPrPxVTID0snq2KqAoePVgEGhQwTnn+JI+3TBiJu/gjX7Wmer6j4uOWaf6aqMfSB/4VD1wAAAAAAICU6lV0YGWCqEr3mqlVN10FZRRmR+d6Uprgx3yXokzbH7rMPTcZ1p9Sbir7fWOsuNzj6z8VUyA9LJ6tiqgKHj1boAwAAAAAAAIgTAAAAAAAAAA==",
"gas": [
{
"objectId": "0x06850c139e7f8923edd306226efe08d7ed699eafa8f8b8e59a7fa6aa31f481ff",
"version": 14107525,
"digest": "3WKtzDa1Xmj8c97hhFgLr4MtUUGqt9Nu7JnqfDstBh1g"
}
],
"inputObjects": [
{
"SharedMoveObject": {
"id": "0x0000000000000000000000000000000000000000000000000000000000000005",
"initial_shared_version": "1",
"mutable": true
}
},
{
"ImmOrOwnedMoveObject": {
"objectId": "0x06850c139e7f8923edd306226efe08d7ed699eafa8f8b8e59a7fa6aa31f481ff",
"version": 14107525,
"digest": "3WKtzDa1Xmj8c97hhFgLr4MtUUGqt9Nu7JnqfDstBh1g"
}
},
{
"MovePackage": "0x0000000000000000000000000000000000000000000000000000000000000003"
},
{
"ImmOrOwnedMoveObject": {
"objectId": "0x06850c139e7f8923edd306226efe08d7ed699eafa8f8b8e59a7fa6aa31f481ff",
"version": 14107525,
"digest": "3WKtzDa1Xmj8c97hhFgLr4MtUUGqt9Nu7JnqfDstBh1g"
}
}
]
},
"id": 1
}