prepare_native_stake_withdraw
Build unsigned native-stake withdraw transaction to move SOL from an inactive stake account back to the wallet. Supports full withdrawal (closes account) or partial withdrawal (leaves account open).
Instructions
Build an unsigned native-stake withdraw tx. Pulls amountSol SOL (or 'max' for the full lamport balance) from an inactive stake account back into the wallet. 'max' closes the account and reclaims the rent-exempt seed; partial-withdraw leaves the account open. Stake MUST be inactive (one full epoch after deactivate) — on-chain reverts otherwise; the simulation gate catches it. DURABLE NONCE REQUIRED + same Ledger blind-sign treatment as prepare_native_stake_delegate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Solana wallet — must be the stake account's withdrawer authority + receives the SOL. (For stakes created via prepare_native_stake_delegate, wallet === staker === withdrawer; no authority handoff is supported in this server.) | |
| stakeAccount | Yes | Base58 stake account address to withdraw from. Stake must be inactive (one full epoch after prepare_native_stake_deactivate). On-chain reverts if the stake is still cooling down — the simulation gate catches it. | |
| amountSol | Yes | Human-readable SOL amount to withdraw (e.g. "1.5"), OR the literal string "max" to withdraw the full lamport balance (closes the stake account and reclaims the rent-exempt seed). Partial withdraws leave the account open with a smaller balance. |