How to Use the Solana Staking API

Typical user journeys when interacting with the Solana Staking API

1. How to Stake

Initiate Solana staking via the Post Stake Intent endpoint.

This returns an unsigned transaction, requiring signing and broadcasting to the network by the account that delegates funds to the specified validator in the request.

2. How to Request Deactivation of Staking Intent

You can request the deactivation of transactions against available addresses.

The POST Deactivation Intent endpoint automatically selects stake addresses to deactivate for request fulfilment. The API returns two sets of transactions – splitting transactions and deactivation transactions. Sign and broadcast splitting transactions before deactivating the transactions.

3. How to Withdrawal a Stake Intent

The Post Withdrawal Intent endpoint requests withdrawal transactions executed against available deactivated accounts.

If more funds are requested than currently unlocked, the API returns an error indicating the maximum possible withdrawal.

Remember that staked tokens must be deactivated before withdrawal.

You will receive at least one unsigned transaction (potentially multiple) requiring signing to complete the withdrawal.

Example Code

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.