Skip to main content

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

  1. Create a stake resource with POST /v1/solana/stakes and an Idempotency-Key.
  2. Sign the returned challenge with the withdraw authority.
  3. Create an unsigned stake transaction with POST /v1/solana/stakes/{stakeId}/stake-transactions and a new Idempotency-Key.
  4. Sign the returned transaction with the stake authority and broadcast it.
  5. Report the broadcast transaction signature with PUT /v1/solana/stakes/{stakeId}/transactions/{txId}/submission.
  6. If submission returns a retryable response, follow Retry-After and retry the same submission.
  7. Poll GET /v1/solana/stakes/{stakeId} until protocol.status becomes ACTIVE.

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

  1. Create an unsigned deactivation transaction with POST /v1/solana/stakes/{stakeId}/deactivation-transactions and a new Idempotency-Key.
  2. 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

  1. Check that protocol.status is INACTIVE with GET /v1/solana/stakes/{stakeId}.
  2. Create an unsigned withdrawal transaction with POST /v1/solana/stakes/{stakeId}/withdrawal-transactions and a new Idempotency-Key.
  3. 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.