Solana RPC API手册

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

getStakeActivation

getStakeActivation方法返回指定抵押账号的周期激活信息。

请求参数

  • <string> - Pubkey of stake account to query, as base-58 encoded string
  • <object> - (optional) Configuration object containing the following optional fields:
    • (optional) Commitment
    • (optional) epoch: - epoch for which to calculate activation details. If parameter not provided, defaults to current epoch.

响应结果

The result will be a JSON object with the following fields:

  • state: <string> - the stake account's activation state, one of: active, inactive, activating, deactivating
  • active: <u64> - stake active during the epoch
  • inactive: <u64> - stake inactive during the epoch

示例代码

请求:

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
  {"jsonrpc":"2.0","id":1, "method":"getStakeActivation", "params": ["CYRJWqiSjLitBAcRxPvWpgX3s5TvmN2SuRY3eEYypFvT"]}

响应:

{"jsonrpc":"2.0","result":{"active":197717120,"inactive":0,"state":"active"},"id":1}

请求:

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getStakeActivation",
    "params": [
      "CYRJWqiSjLitBAcRxPvWpgX3s5TvmN2SuRY3eEYypFvT",
      {
        "epoch": 4
      }
    ]
  }

响应:

{
  "jsonrpc": "2.0",
  "result": {
    "active": 124429280,
    "inactive": 73287840,
    "state": "activating"
  },
  "id": 1
}