Documentation Index
Fetch the complete documentation index at: https://docs.hubra.app/llms.txt
Use this file to discover all available pages before exploring further.
inactive state. The companion to /api/v1/unstake for sol-native-stake deactivate flows: deactivate begins the cooldown, this completes the unstake once the deactivation epoch has passed.
By default, withdraws all lamports back to the wallet (closing the account). Pass lamports for a partial drain.
Lifecycle
StakeProgram.withdraw rejects with insufficient funds for instruction if you call it before currentEpoch > deactivationEpoch. Do not poll faster than once per epoch.
Request
| Field | Type | Required | Description |
|---|---|---|---|
wallet | string | yes | Solana wallet pubkey (the withdraw authority). |
stakeAccount | string | yes | Pubkey of the stake account to close. Returned by your earlier /stake call. |
lamports | number | optional | Partial drain. If omitted, withdraws the account’s full balance and closes the account. Must be a positive integer when provided. |
Response
route: "rpc" — there is no Sanctum or Voltr involvement.
Errors
| Status | Slug | When |
|---|---|---|
400 | invalid_request | Missing wallet or stakeAccount, or non-positive lamports. |
502 | upstream_error | Stake account does not exist on-chain, or RPC rejected the simulation. |
Common upstream error: “insufficient funds for instruction”
Returned at broadcast time when the stake account has not yet reachedinactive. Wait until the on-chain epoch is strictly greater than the account’s deactivationEpoch and try again.
The Solana CLI’s solana stakes “Inactive Stake: X SOL” line is misleading — it shows the unlocked portion, not the account state. The on-chain rule is what matters: an account is inactive when currentEpoch > deactivationEpoch.
See also
POST /unstake
Begin deactivation (kind=deactivate).
POST /broadcast
Submit the signed withdraw.