Don't miss Build Games$1M Builder Competition
Staking

platform.getStake

GetStake returns the amount of nAVAX that [args.Addresses] have cumulatively staked on the Primary Network. This method assumes that each stake output has only owner This method assumes only AVAX can be staked This method only concerns itself with the Primary Network, not subnets TODO: Improve the performance of this method by maintaining this data in a data structure rather than re-calculating it by iterating over stakers

POST
/ext/bc/P#platform.getStake

Request Body

application/json

JSON-RPC request

jsonrpc*string
method*string
params*

Method parameters

id*integer

Response Body

application/json

application/json

curl -X POST "https://api.avax.network/ext/bc/P#platform.getStake" \  -H "Content-Type: application/json" \  -d '{    "jsonrpc": "2.0",    "method": "platform.getStake",    "params": {},    "id": 1  }'
{
  "jsonrpc": "2.0",
  "result": {
    "staked": "1000000000",
    "stakeds": {},
    "stakedOutputs": [
      "string"
    ],
    "encoding": "hex"
  },
  "id": 1
}
{
  "jsonrpc": "2.0",
  "error": {
    "code": 0,
    "message": "string",
    "data": {}
  },
  "id": 1
}

Is this guide helpful?