withdraw()
Create withdrawal request transaction.
This method calls /solana/{network}/staking/withdraw to create a new unsigned transaction which, if signed and broadcasted, will create a new withdrawal request.
Parameters
await client.solana.withdraw({
network: 'mainnet-beta',
feePayer: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
stakeAccount: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
withdrawAuthority: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
recipient: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
amount: 1002282880,
});network string, required |
feePayer string, required |
stakeAccount string, required |
withdrawAuthority string, required |
recipient string, required |
amount number ≥ 1, required |
nonceAccount string |
computeUnitLimit number ≥ 1 |
computeUnitPrice number ≥ 1 |
Result
The method returns a JSON object that contains a base64-encoded unsigned transaction and some metadata about it.
You can decode the transaction using decodeTransaction() or pass it directly to signWithKeypairs().
{
"feePayer": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"stakeAccount": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"withdrawAuthority": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"recipient": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"amount": 1,
"unsignedTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAcJjkQt4XcX43Vk8FZ7QbUVXSF5oo9jt7x2Dm0E9ut/y+jagnMHpK8BDHt0PpssHwXGD2fBxS6MWBoxptD2u9TvrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1NjSeWM5+GSJdoQd43Al9SVVXC9FfWGwbe7icpomwAUGodgXkTdUKpg0N73+KnqyVX9TXIp4citopJ3AAAAAAAah2BelAgULaAeR5s5tuI4eW3FQ9h/GeQpOtNEAAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAGp9UXGSxcUSGMyUw9SvF/WNruCJuh/UTj29mKAAAAAAan1RcZNYTQ/u2bs0MdEyBr5UQoG1e4VmzFN1/0AAAAijW940iwWddz25ZC37fI0ue5fa+eTbC2ynBM3b0t4pcDAgMAAQBgAwAAAI5ELeF3F+N1ZPBWe0G1FV0heaKPY7e8dg5tBPbrf8voBAAAAAAAAABzZWVkgJaYAAAAAADIAAAAAAAAAAah2BeRN1QqmDQ3vf4qerJVf1NcinhyK2ikncAAAAAABAIBB3QAAAAAjkQt4XcX43Vk8FZ7QbUVXSF5oo9jt7x2Dm0E9ut/y+iORC3hdxfjdWTwVntBtRVdIXmij2O3vHYObQT263/L6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGAQMGCAUABAIAAAA=",
"createdAt": "2023-08-24T08:14:50.455Z"
}feePayer string, required |
stakeAccount string |
withdrawAuthority string |
recipient string |
amount number, required |
unsignedTransaction string, required |
createdAt string, required |
What's next?
- signWithKeypairs()
- verifyTransaction()
- Staking API reference
Updated about 19 hours ago