platform.getStakingAssetID - AVAX

Example code for the platform.getStakingAssetID JSON-RPC method. Complete guide on how to use platform.getStakingAssetID JSON-RPC in GetBlock Web3 documentation.

Returns the asset ID used for staking on a given subnet. For the Primary Network this is the AVAX asset ID. Subnet L1s may use custom staking assets.

Parameters

Parameter
Type
Required
Description

subnetID

string

No

Subnet ID (default: Primary Network)

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/ext/bc/P' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "platform.getStakingAssetID",
    "params": {},
    "id": "getblock.io"
}'

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
    }
}

Response Parameters

Field
Type
Description

result.assetID

string

Asset ID (Base58 CB58-encoded) used for staking on the requested subnet

Use Cases

  • Subnet integrations that need to know the staking token

  • Wallet support for custom-token-staked L1s

Error Handling

Status Code
Error Message
Cause

404

Not found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?