Solana integration
The API creates resources for staking and related operations, while your client signs and broadcasts Solana transactions.
Flow overview
Create and activate a stake
- Create a stake resource with
POST /v1/solana/stakesand anIdempotency-Key. - Sign the returned challenge with the withdraw authority.
- Create an unsigned stake transaction with
POST /v1/solana/stakes/{stakeId}/stake-transactionsand a newIdempotency-Key. - Sign the returned transaction with the stake authority and broadcast it.
- Report the broadcast transaction signature with
PUT /v1/solana/stakes/{stakeId}/transactions/{txId}/submission. - If submission returns a retryable response, follow
Retry-Afterand retry the same submission. - Poll
GET /v1/solana/stakes/{stakeId}untilprotocol.statusbecomesACTIVE.
If the challenge expires before the stake transaction is created, request a new challenge with PUT /v1/solana/stakes/{stakeId}/stake-transaction-challenge.
Refresh an unsigned transaction
If an unsigned transaction expires before it is broadcast, refresh it with POST /v1/solana/stakes/{stakeId}/transactions/{txId}/refresh, then sign and broadcast the returned transaction.
Deactivate a stake
- Create an unsigned deactivation transaction with
POST /v1/solana/stakes/{stakeId}/deactivation-transactionsand a newIdempotency-Key. - Sign and broadcast the transaction with the stake authority, then report its signature with
PUT /v1/solana/stakes/{stakeId}/transactions/{txId}/submission.
Stake deactivation follows Solana's cooldown process and may take multiple epochs to complete.
Withdraw an inactive stake
- Check that
protocol.statusisINACTIVEwithGET /v1/solana/stakes/{stakeId}. - Create an unsigned withdrawal transaction with
POST /v1/solana/stakes/{stakeId}/withdrawal-transactionsand a newIdempotency-Key. - Sign and broadcast the transaction with the withdraw authority, then report its signature with
PUT /v1/solana/stakes/{stakeId}/transactions/{txId}/submission.
Use a distinct Idempotency-Key for each logical resource or transaction creation operation. Reuse the same key only when retrying that same operation.