For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Avalanche — EVM methods, P-Chain methods (1/2)

API reference for Avalanche. All methods ->

Part 1 of 2: 1 · 2

eth_getAssetBalance​

Retrieves the balance of first class Avalanche Native Tokens on the C-Chain.

In addition to the standard Ethereum APIs, Avalanche offers eth_getAssetBalance to retrieve the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance).

Parameters​

Signature:

eth_getAssetBalance({
address: string,
blk: BlkNrOrHash,
assetID: string,
}) -> {balance: int}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • address: owner of the asset.
    • blk: the block number or hash at which to retrieve the balance.
    • assetID: an ID of the asset for which the balance is requested.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"eth_getAssetBalance",
"params" : [
"0x8723e5773847A4Eb5FeEDabD9320802c5c812F46",
"latest",
"3RvKBAmQnfYionFXMfW5P8TDZgZiogKbHjM8cjpu16LKAgF5T"
]
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1388"
}

eth_baseFee​

Retrieves the base fee for the next block.

Parameters​

Signature:

eth_baseFee() -> {}

Request parameters:

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"eth_baseFee",
"params" : []
}'

Request example​

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x34630b8a00"
}

eth_maxPriorityFeePerGas​

Retrieves the priority fee needed to be included in a block.

Parameters​

Signature:

eth_maxPriorityFeePerGas() -> {}

Request parameters:

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"eth_maxPriorityFeePerGas",
"params" : []
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2540be400"
}

eth_getChainConfig​

Retrieves chain config.

Parameters​

Signature:

eth_getChainConfig({}) -> {chainConfig: json}

Request parameters:

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"eth_getChainConfig",
"params" : []
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"chainId": 43112,
"homesteadBlock": 0,
"daoForkBlock": 0,
"daoForkSupport": true,
"eip150Block": 0,
"eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"apricotPhase1BlockTimestamp": 0,
"apricotPhase2BlockTimestamp": 0,
"apricotPhase3BlockTimestamp": 0,
"apricotPhase4BlockTimestamp": 0,
"apricotPhase5BlockTimestamp": 0
}
}

P-Chain methods​


platform.getBalance​

Retrieves the balance of AVAX for a given address.

Parameters​

Signature:

platform.getBalance({
addresses: []string
}) -> {
balances: string -> int,
unlockeds: string -> int,
lockedStakeables: string -> int,
lockedNotStakeables: string -> int,
utxoIDs: []{
txID: string,
outputIndex: int
}
}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • addresses: the addresses to get the balance for.

Response parameters:

  • balances: a map from assetID to the total balance.
  • unlockeds: a map from assetID to the unlocked balance.
  • lockedStakeables: a map from assetID to the locked stakeable balance.
  • lockedNotStakeables: a map from assetID to the locked and not stakeable balance.
  • utxoIDs: the IDs of the UTXOs that reference address.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getBalance",
"params" :{
"address":"P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"balance": "30000000000000000",
"unlocked": "20000000000000000",
"lockedStakeable": "10000000000000000",
"lockedNotStakeable": "0",
"balances": {
"BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "30000000000000000"
},
"unlockeds": {
"BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "20000000000000000"
},
"lockedStakeables": {
"BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "10000000000000000"
},
"lockedNotStakeables": {},
"utxoIDs": [
{
"txID": "11111111111111111111111111111111LpoYY",
"outputIndex": 1
},
{
"txID": "11111111111111111111111111111111LpoYY",
"outputIndex": 0
}
]
},
"id": 1
}

P-Chain methods​

platform.getBlock​

Retrieves a block by its ID.

Parameters​

Signature:

platform.getBlock({
blockID: string
encoding: string // optional
}) -> {
block: string,
encoding: string
}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • blockID: a block ID in cb58 format.
    • encoding: the encoding format to use; can be either hex or json; defaults to hex.

Request example (hex)​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getBlock",
"params" :{
"blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
"encoding": "hex"
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"block": "0x00000000000309473dc99a0851a29174d84e522da8ccb1a56ac23f7b0ba79f80acce34cf576900000000000f4241000000010000001200000001000000000000000000000000000000000000000000000000000000000000000000000000000000011c4c57e1bcb3c567f9f03caa75563502d1a21393173c06d9d79ea247b20e24800000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000000338e0465f0000000100000000000000000427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd6520000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000338d1041f0000000000000000000000010000000195a4467dd8f939554ea4e6501c08294386938cbf000000010000000900000001c79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed738580119286dde",
"encoding": "hex"
},
"id": 1
}

Request example (JSON)​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getBlock",
"params" :{
"blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
"encoding": "json"
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"block": {
"parentID": "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S",
"height": 1000001,
"txs": [
{
"unsignedTx": {
"inputs": {
"networkID": 1,
"blockchainID": "11111111111111111111111111111111LpoYY",
"outputs": [],
"inputs": [
{
"txID": "DTqiagiMFdqbNQ62V2Gt1GddTVLkKUk2caGr4pyza9hTtsfta",
"outputIndex": 0,
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
"input": {
"amount": 13839124063,
"signatureIndices": [0]
}
}
],
"memo": "0x"
},
"destinationChain": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5",
"exportedOutputs": [
{
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
"output": {
"addresses": [
"P-avax1jkjyvlwclyu42n4yuegpczpfgwrf8r9lyj0d3c"
],
"amount": 13838124063,
"locktime": 0,
"threshold": 1
}
}
]
},
"credentials": [
{
"signatures": [
"0xc79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed7385801"
]
}
]
}
]
},
"encoding": "json"
},
"id": 1
}

platform.getBlockchains​

Retrieves all the blockchains that exist (excluding the P-Chain).

Parameters​

Signature:

platform.getBlockchains() ->
{
blockchains: []{
id: string,
name:string,
subnetID: string,
vmID: string
}
}

Request parameters:

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (object; required): None.

Response parameters:

  • blockchains: all of the blockchains that exists on the Avalanche network.
  • name: the human-readable name of this blockchain.
  • id: the blockchain ID.
  • subnetID: the ID of the Subnet that validates this blockchain.
  • vmID: the ID of the Virtual Machine the blockchain runs.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getBlockchains",
"params" :{}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"blockchains": [
{
"id": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"name": "X-Chain",
"subnetID": "11111111111111111111111111111111LpoYY",
"vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq"
},
{
"id": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5",
"name": "C-Chain",
"subnetID": "11111111111111111111111111111111LpoYY",
"vmID": "mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6"
},
{
"id": "CqhF97NNugqYLiGaQJ2xckfmkEr8uNeGG5TQbyGcgnZ5ahQwa",
"name": "Simple DAG Payments",
"subnetID": "11111111111111111111111111111111LpoYY",
"vmID": "sqjdyTKUSrQs1YmKDTUbdUhdstSdtRTGRbUn8sqK8B6pkZkz1"
},
{
"id": "VcqKNBJsYanhVFxGyQE5CyNVYxL3ZFD7cnKptKWeVikJKQkjv",
"name": "Simple Chain Payments",
"subnetID": "11111111111111111111111111111111LpoYY",
"vmID": "sqjchUjzDqDfBPGjfQq2tXW1UCwZTyvzAWHsNzF2cb1eVHt6w"
},
{
"id": "2SMYrx4Dj6QqCEA3WjnUTYEFSnpqVTwyV3GPNgQqQZbBbFgoJX",
"name": "Simple Timestamp Server",
"subnetID": "11111111111111111111111111111111LpoYY",
"vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH"
},
{
"id": "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN",
"name": "My new timestamp",
"subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r",
"vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH"
},
{
"id": "2TtHFqEAAJ6b33dromYMqfgavGPF3iCpdG3hwNMiart2aB5QHi",
"name": "My new AVM",
"subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r",
"vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq"
}
]
},
"id": 1
}

platform.getBlockchainStatus​

Retrieves the status of a blockchain.

Parameters​

Signature:

platform.getBlockchainStatus(
{
blockchainID: string
}
) -> {status: string}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • blockchainID: a blockchain ID to return the status for.

Response parameters:

  • status: either of the following:
    • Validating: the blockchain is being validated by this node.
    • Created: the blockchain exists but isn’t being validated by this node.
    • Preferred: the blockchain was proposed to be created and is likely to be created but the transaction isn’t yet accepted.
    • Syncing: the node is participating in this blockchain as a non-validating node.
    • Unknown: the blockchain either wasn’t proposed or the proposal to create it isn’t preferred. The proposal may be resubmitted.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getBlockchainStatus",
"params" :{
"blockchainID":"2NbS4dwGaf2p1MaXb65PrkZdXRwmSX4ZzGnUu7jm3aykgThuZE"}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"status": "Created"
},
"id": 1
}

platform.getCurrentSupply​

Retrieves an upper bound on the amount of existing tokens that can stake the requested Subnet.

This is an upper bound because it does not account for burnt tokens, including transaction fees.

Parameters​

Signature:

platform.getCurrentSupply({
subnetID: string // optional
}) -> {supply: int}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • subnetID: a Subnet ID.

Response parameters:

  • supply: an upper bound on the number of tokens that exist.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getCurrentSupply",
"params" :{
"subnetID":"11111111111111111111111111111111LpoYY"}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"supply": "365865167637779183"
},
"id": 1
}

platform.getCurrentValidators​

Retrieves the list of current validators of the given Subnet.

Parameters​

Signature:

platform.getCurrentValidators({
subnetID: string, // optional
nodeIDs: string[], // optional
}) -> {
validators: []{
txID: string,
startTime: string,
endTime: string,
stakeAmount: string,
nodeID: string,
weight: string,
validationRewardOwner: {
locktime: string,
threshold: string,
addresses: string[]
},
delegationRewardOwner: {
locktime: string,
threshold: string,
addresses: string[]
},
potentialReward: string,
delegationFee: string,
uptime: string,
connected: bool,
signer: {
publicKey: string,
proofOfPosession: string
},
delegatorCount: string,
delegatorWeight: string,
delegators: []{
txID: string,
startTime: string,
endTime: string,
stakeAmount: string,
nodeID: string,
rewardOwner: {
locktime: string,
threshold: string,
addresses: string[]
},
potentialReward: string,
}
}
}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • subnetID: the Subnet whose current validators are returned; if omitted, returns the current validators of the Primary Network.
    • nodeIDs: a list of the NodeIDs of current validators to request; if omitted, all current validators are returned; if a specified NodeID is not in the set of current validators, it will not be included in the response.

Response parameters:

  • validators:
    • txID: the validator transaction.
    • startTime: the Unix time when the validator starts validating the Subnet.
    • endTime: the Unix time when the validator stops validating the Subnet.
    • stakeAmount: the amount of tokens this validator staked. Omitted if subnetID is not a PoS Subnet.
    • nodeID: the validator’s node ID.
    • weight: the validator’s weight when sampling validators. Omitted if subnetID is a PoS Subnet.
    • validationRewardOwner: an OutputOwners output which includes locktime, threshold, and array of addresses. Specifies the owner of the potential reward earned from staking. Omitted if subnetID is not a PoS Subnet.
    • delegationRewardOwner: an OutputOwners output which includes locktime, threshold, and array of addresses. Specifies the owner of the potential reward earned from delegations. Omitted if subnetID is not a PoS Subnet.
    • potentialReward: the potential reward earned from staking. Omitted if subnetID is not a PoS Subnet.
    • delegationFeeRate: the percentage fee this validator charges when others delegate stake to them. Omitted if subnetID is not a PoS Subnet.
    • uptime: the % of time the queried node has reported the peer as online and validating the Subnet.
    • connected: if the node is connected and tracks the Subnet.
    • signer: the node's BLS public key and proof of possession. Omitted if the validator doesn't have a BLS public key.
    • delegatorCount: the number of delegators on this validator. Omitted if subnetID is not a PoS Subnet.
    • delegatorWeight: total weight of delegators on this validator. Omitted if subnetID is not a PoS Subnet.
    • delegators: the list of delegators to this validator. Omitted if subnetID is not a PoS Subnet. Omitted unless nodeIDs specifies a single NodeID.
      • txID: the delegator transaction.
      • startTime: the Unix time when the delegator started.
      • endTime: the Unix time when the delegator stops.
      • stakeAmount: the amount of nAVAX this delegator staked.
      • nodeID: the validating node’s node ID.
      • rewardOwner: an OutputOwners output which includes locktime, threshold, and array of addresses.
      • potentialReward: the potential reward earned from staking.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getCurrentValidators",
"params" :{
"nodeIDs": ["NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD"]
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"validators": [
{
"txID": "2NNkpYTGfTFLSGXJcHtVv6drwVU2cczhmjK2uhvwDyxwsjzZMm",
"startTime": "1600368632",
"endTime": "1602960455",
"stakeAmount": "2000000000000",
"nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD",
"validationRewardOwner": {
"locktime": "0",
"threshold": "1",
"addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
},
"delegationRewardOwner": {
"locktime": "0",
"threshold": "1",
"addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
},
"potentialReward": "117431493426",
"delegationFee": "10.0000",
"uptime": "0.0000",
"connected": false,
"delegatorCount": "1",
"delegatorWeight": "25000000000",
"delegators": [
{
"txID": "Bbai8nzGVcyn2VmeYcbS74zfjJLjDacGNVuzuvAQkHn1uWfoV",
"startTime": "1600368523",
"endTime": "1602960342",
"stakeAmount": "25000000000",
"nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD",
"rewardOwner": {
"locktime": "0",
"threshold": "1",
"addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
},
"potentialReward": "11743144774"
}
]
}
]
},
"id": 1
}

platform.getHeight​

Retrieves the height of the latest accepted block.

Parameters​

Signature:

platform.getHeight() ->
{
height: int,
}

Request parameters:

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (object; required): None.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getHeight",
"params" :{}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"height": "56"
},
"id": 1
}

platform.getMaxStakeAmount​

Retrieves the maximum amount of nAVAX staking to the named node during a particular time period.

Parameters​

Signature:

platform.getMaxStakeAmount(
{
subnetID: string,
nodeID: string,
startTime: int,
endTime: int
}
) ->
{
amount: uint64
}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • subnetID: a Buffer or cb58 string representing Subnet.
    • nodeID: a string representing ID of the node whose stake amount is required during the given duration.
    • startTime: a big number denoting start time of the duration during which stake amount of the node is required.
    • endTime: a big number denoting end time of the duration during which stake amount of the node is required.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getMaxStakeAmount",
"params" :{
"subnetID":"11111111111111111111111111111111LpoYY",
"nodeID":"NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
"startTime": 1644240334,
"endTime": 1644240634
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"amount": "2000000000000000"
},
"id": 1
}

platform.getMinStake​

Retrieves the minimum amount of tokens required to validate the requested Subnet and the minimum amount of tokens that can be delegated.

Parameters​

Signature:

platform.getMinStake({
subnetID: string // optional
}) ->
{
minValidatorStake : uint64,
minDelegatorStake : uint64
}

Request parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (object; required):

    • subnetID: a string representing Subnet.

Request example​

curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"id" :1,
"method" :"platform.getMinStake",
"params" :{
"subnetID":"11111111111111111111111111111111LpoYY"
}
}'

Response example​

{
"jsonrpc": "2.0",
"result": {
"minValidatorStake": "2000000000000",
"minDelegatorStake": "25000000000"
},
"id": 1
}