Endpoints
API Usage
Once you have access to the Staking API with a validated user and existing API keys, you can start using this service.
Try it live
Every endpoint on this page can be executed from the interactive Swagger console, using your own X-API-KEY.
The machine-readable OpenAPI schema is available at:
Authentication
In order to use the Staking API endpoints you need to include your API KEY.
Heads up! To obtain a valid API key required for authentication, please refer to the Authentication > Create API keys section of the documentation.
Header:
| Name | Description | Example value | Required |
|---|---|---|---|
X-API-KEY | Your api key value | <API_KEY_VALUE> | ✅ |
X-NETWORK | Blockchain network/cluster identifier | mainnet-beta | ⚪ |
X-NETWORK header
Use the X-NETWORK header to select the Solana cluster to operate on (e.g., mainnet-beta, devnet).
Supported values match the RPC cluster identifier that Solana exposes (the cluster argument in web3). If you omit the header the API falls back to the default Solana network configured for your account.
Currently supported values: mainnet-beta and devnet. Contact [email protected] if you need another cluster enabled.
List available networks
Need to know which Solana clusters are enabled for your API key? Ask the API directly.
- Endpoint:
/api/v1/solana/native/networks
Each item in the response includes:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Internal descriptor for the Solana blockchain entry |
type | string | ✅ | Blockchain type string (always SOLANA) |
chain_id | string | ✅ | Cluster identifier such as mainnet-beta or devnet |
is_default | boolean | ✅ | true when the cluster is used as fallback |
Example
curl "https://staking-api.stakely.io/api/v1/solana/native/networks" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta"
Response:
[
{
"name": "solana",
"type": "SOLANA",
"chain_id": "mainnet-beta",
"is_default": true
}
]
Create nonce account action
Craft a create nonce account transaction:
- Endpoint:
/api/v1/solana/native/action/create-nonce-account
Description
This endpoint will craft a create nonce account transaction ready to be signed. Creating a nonce account is an important step for durable transactions in Solana, especially useful for complex operations like staking.
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | ✅ | Wallet address of the user that will perform the staking action |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
unsigned_tx_hex | string | ✅ | Unsigned craft transaction hex string |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/create-nonce-account" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv"
}'
Response:
{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}
Stake action
Craft a stake transaction:
- Endpoint:
/api/v1/solana/native/action/stake
Description
This endpoint will craft a stake transaction ready to be signed.
The stake action combines these steps into a single transaction, simplifying the process for users. When you initiate a stake action through the Staking API, it will craft a transaction that creates the stake account, funds it, and delegates to our validator in one go.
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | ✅ | Wallet address of the user that will perform the staking action |
nonce_account_address | string | ⚪ | Nonce account address, if not provided, the nonce will not be durable in time |
amount | number | ✅ | Amount of stake to perform in solana units, Minimum 0.01 |
sign | boolean | ⚪ | Whether to partial-sign the transaction with the stake account key. Defaults to true when omitted. Set to false to return an unsigned transaction for external signing. |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
unsigned_tx_hex | string | ✅ | Unsigned craft transaction hex string |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/stake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny",
"amount": 0.01,
"sign": true
}'
Response:
{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}
Unstake action (deactivate)
Craft an unstake transaction:
- Endpoint:
/api/v1/solana/native/action/unstake
Description
This endpoint will craft an unstake transaction ready to be signed.
The unstake action through the Staking API initiates this process by creating a transaction that deactivates your stake account. It's important to note that this doesn't immediately return your tokens - you'll need to wait for the cooldown period and then perform a separate withdrawal action.
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | ✅ | Wallet address of the user that will perform the staking action |
stake_account_address | string | ✅ | Stake account address to be unstaked will all its balance |
nonce_account_address | string | ⚪ | Nonce account address, if not provided, the nonce will not be durable in time |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
unsigned_tx_hex | string | ✅ | Unsigned craft transaction hex string |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/unstake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"stake_account_address": "3ztZzUBzfeJ17VoZyNngBW9Uezs9pDkPyJPcBYQMZDWu",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny"
}'
Response:
{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}
Withdraw deactivated stake action
Craft a withdraw deactivated stake transaction:
- Endpoint:
/api/v1/solana/native/action/withdraw
Description
This endpoint will craft a withdraw deactivated stake transaction ready to be signed.
After your stake has been fully deactivated, you can withdraw the tokens back to your main wallet. This process is called withdrawing deactivated stake. Here's an overview of the withdraw action.
The withdraw action through the Staking API creates a transaction that performs this withdrawal. While it's possible to partially withdraw funds in multiple transactions, the most common approach is to fully withdraw the entire balance in a single transaction.
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | ✅ | Wallet address of the user that will perform the staking action to withdraw the funds and also be the recipient of the withdrawn funds |
stake_account_address | string | ✅ | Stake account address from which the withdraw will be performed |
nonce_account_address | string | ⚪ | Nonce account address, if not provided, the nonce will not be durable in time |
amount | number | ⚪ | Amount of stake to perform in solana units, Minimum 0.01. If Not provided, the entire stake will be withdrawn |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
unsigned_tx_hex | string | ✅ | Unsigned craft transaction hex string |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/withdraw" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"stake_account_address": "3ztZzUBzfeJ17VoZyNngBW9Uezs9pDkPyJPcBYQMZDWu",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny",
"amount": 0.01
}'
Response:
{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}
Prepare action
Gathers signature and unsigned tx:
- Endpoint:
/api/v1/solana/native/action/prepare
Description
Prepare a signed transaction by gathering the provided signatures with the unsigned transaction hex string:
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
unsigned_tx_hex | string | ✅ | Unsigned transaction body hex string |
signatures | string[] | ✅ | Array of transaction signature hex strings |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
signed_tx_hex | string | ✅ | Signed transaction string (hex encoded) ready to be broadcasted |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/prepare" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000",
"signatures": [
"b6c291475834980a1db41bad1bcc23e2930295c4...5151deabf80a"
]
}'
Response:
{
"signed_tx_hex": "01392e8e2d590173daa411c2b5c2cceb943458c3...000405000000"
}
Broadcast action
Broadcast a signed transaction
- Endpoint:
/api/v1/solana/native/action/broadcast
Description
Broadcast a signed transaction. Usually you will brodcast the signed transaction returned in prepare previous step:
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
signed_tx_hex | string | ✅ | Signed transaction string (hex encoded) to be broadcasted |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
tx_hash | string | ✅ | Transaction hash of the broadcasted transaction |
Example
curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/broadcast" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"signed_tx_hex": "01392e8e2d590173daa411c2b5c2cceb943458c3...000405000000"
}'
Response:
{
"tx_hash": "29JtVkmnVR2EHZN9h79UU1wYs1xhfM7EB9hAL7Zf...VxrBQk3SLnCk"
}
Stake balance
Get the native staking balance for the given address:
- Endpoint:
/api/v1/solana/native/stake-balance/{address}
Description
Returns the stake accounts associated with the wallet and the total balance across them, for native Solana staking.
Request parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
address | path | string | ✅ | Solana wallet address |
Returned
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | ✅ | Wallet address that was queried |
current_epoch | number | ✅ | Current epoch on the Solana network |
stake_accounts | StakeAccountDto[] | ✅ | Array of stake accounts associated with the wallet address |
total_balance_sol | number | ✅ | Total balance across all stake accounts, in SOL |
Each item in stake_accounts is a StakeAccountDto: |
| Field | Type | Required | Description |
|---|---|---|---|
pubkey | string | ✅ | Public key of the stake account |
balance_sol | number | ✅ | Balance in SOL (converted from lamports) |
balance_lamports | number | ✅ | Balance in lamports (raw value from account) |
account_data | object | ✅ | Full parsed account data from Solana |
unstakeable | UnstakeableStatusDto | ✅ | Unstakeable status information |
withdrawable | WithdrawableStatusDto | ✅ | Withdrawable status information |
The unstakeable status object:
| Field | Type | Required | Description |
|---|---|---|---|
status | boolean | ✅ | Whether the stake account can be unstaked. FALSE means the account is currently staked and cannot be deactivated yet (deactivationEpoch > currentEpoch + 10). TRUE means it can be deactivated. |
epoch | object | ✅ | The epoch at which the stake account can be unstaked (deactivationEpoch + 10). Null if not applicable (e.g., account not delegated or already deactivated). |
The withdrawable status object:
| Field | Type | Required | Description |
|---|---|---|---|
status | boolean | ✅ | Whether the stake account can be withdrawn. TRUE means the account is delegated and deactivationEpoch + 1 >= currentEpoch. FALSE otherwise. |
epoch | object | ✅ | The epoch at which the stake account can be withdrawn (deactivationEpoch + 1). Null if deactivationEpoch is undefined or account is not delegated. |
Example
curl "https://staking-api.stakely.io/api/v1/solana/native/stake-balance/CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta"
Response:
{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"current_epoch": 440,
"stake_accounts": [
{
"pubkey": "5vJfJUHyq7kM5Lz7K8Z9Y1X2W3V4U5T6S7R8Q9P0O1N2M3L4K5J6",
"balance_sol": 1.5,
"balance_lamports": 1500000000,
"account_data": {
"parsed": {
"type": "delegated",
"info": {
"meta": {
"authorized": {
"staker": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"withdrawer": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv"
}
},
"stake": {
"delegation": {
"voter": "Vote111111111111111111111111111111111111111",
"stake": "1500000000",
"activationEpoch": "400",
"deactivationEpoch": "18446744073709551615"
}
}
}
}
},
"unstakeable": {
"status": false,
"epoch": 450
},
"withdrawable": {
"status": true,
"epoch": 441
}
}
],
"total_balance_sol": 3.5
}