getStakeActivation
Returns epoch activation information for a stake account. This includes the current state (active, inactive, activating, or deactivating) and the active/inactive stake amounts. This method is essential for staking dashboards, delegation tools, and applications that need to show users the status of their staked SOL, including how much is currently earning rewards and how much is in transition.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | string | Yes | Base-58 encoded public key of the stake account |
| 2 | object | No | Configuration object |
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
epoch | u64 | Epoch for which to query activation. Defaults to current epoch |
minContextSlot | number | Minimum slot at which the request can be evaluated |
Response
Returns an object:
| Field | Type | Description |
|---|---|---|
state | string | Activation state: active, inactive, activating, or deactivating |
active | u64 | Stake active during the epoch in lamports |
inactive | u64 | Stake inactive during the epoch in lamports |
Code Examples
cURL
1curl http://[IP_ADDRESS]:[PORT] -X POST -H "Content-Type: application/json" -d '{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "method": "getStakeActivation",
5 "params": [
6 "CYRJWqiSjLitBAcRxPvWpgX3s5TvmN1SuMB9vkp692Kx",
7 { "commitment": "confirmed" }
8 ]
9}'TypeScript
1const response = await fetch("http://[IP_ADDRESS]:[PORT]", {
2 method: "POST",
3 headers: { "Content-Type": "application/json" },
4 body: JSON.stringify({
5 jsonrpc: "2.0",
6 id: 1,
7 method: "getStakeActivation",
8 params: [
9 "CYRJWqiSjLitBAcRxPvWpgX3s5TvmN1SuMB9vkp692Kx",
10 { commitment: "confirmed" }
11 ]
12 }),
13});
14const { result } = await response.json();
15console.log("State:", result.state, "Active:", result.active / 1e9, "SOL");Python
1import requests
2
3response = requests.post("http://[IP_ADDRESS]:[PORT]", json={
4 "jsonrpc": "2.0",
5 "id": 1,
6 "method": "getStakeActivation",
7 "params": [
8 "CYRJWqiSjLitBAcRxPvWpgX3s5TvmN1SuMB9vkp692Kx",
9 {"commitment": "confirmed"}
10 ]
11})
12result = response.json()["result"]
13print(f"State: {result['state']}, Active: {result['active']/1e9} SOL")Rust
1use reqwest::Client;
2use serde_json::json;
3
4#[tokio::main]
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let client = Client::new();
7 let res = client.post("http://[IP_ADDRESS]:[PORT]")
8 .json(&json!({
9 "jsonrpc": "2.0",
10 "id": 1,
11 "method": "getStakeActivation",
12 "params": [
13 "CYRJWqiSjLitBAcRxPvWpgX3s5TvmN1SuMB9vkp692Kx",
14 {"commitment": "confirmed"}
15 ]
16 }))
17 .send().await?
18 .text().await?;
19 println!("{}", res);
20 Ok(())
21}Example Response
1{
2 "jsonrpc": "2.0",
3 "result": {
4 "state": "active",
5 "active": 1000000000,
6 "inactive": 0
7 },
8 "id": 1
9}