Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Supported JSON-RPC methods for Avalanche mainnet and fuji testnet.
Platform Chain (P-Chain):
The final chain that Avalanche offers is the p-chain (for the platform). The P-chain's function allows you to stake AVAX and serve as a validator. If you are a validator or delegating to a validator, then your AVAX rewards will be received on this chain. Note that these also differ from Ethereum-style 0x addresses and begin with a "P-avax". The trailing endpoint for P-Chain calls is:
The trailing endpoint for P-Chain calls is:
Get the balance of an asset controlled by a given address. Get information about an asset.
blockchainID
- string
status - string - status is one of:
Validating - string - The blockchain is being validated by this node.
Created - string - The blockchain exists but isn't being validated by this node.
Preferred - string - The blockchain was proposed to be created and is likely to be created but the transaction isn't yet accepted.
Syncing - string - This node is participating in this blockchain as a non-validating node.
Unknown - string - The blockchain either wasn't proposed or the proposal to create it isn't preferred. The proposal may be resubmitted.
Get all the blockchains that exist (excluding the P-Chain).
none
blockchains
- [object] - All of the blockchains that exists on the Avalanche network.
name - string - The human-readable name of this blockchain.
id - string - The blockchain ID.
subnetID - string - The ID of the Subnet that validates this blockchain.
vmID - string - The ID of the Virtual Machine the blockchain runs.
Get the balance of AVAX controlled by a given address.
address
- string - Address you want to fetch balances for.
balance - string - The total balance, in nAVAX.
unlocked - string - The unlocked balance, in nAVAX.
lockedStakeable - string - The locked stakeable balance, in nAVAX.
lockedNotStakeable - string - The locked and not stakeable balance, in nAVAX.
utxoIDs - [object] - The IDs of the UTXOs that reference address.
txID - string
outputIndex - int
Retrieve an assetID for a subnet’s staking asset. Currently this always returns the Primary Network’s staking assetID.
List the validators in the pending validator set of the specified Subnet. Each validator is not currently validating the Subnet but will in the future.
nodeIDs
- []string - (optional) a list of the nodeIDs of pending validators to request. If omitted, all pending validators are returned. If a specified nodeID is not in the set of pending validators, it will not be included in the response.
subnetID
(optional) The subnet whose current validators are returned. If omitted, returns the current validators of the Primary Network.
delegators
- object
txID
- string - the validator transaction.
startTime
- string - the Unix time when the validator starts.
endTime
- string - the Unix time when the validator stops.
stakeAmount
- string - (optional) the amount of nAVAX this validator staked. Omitted if subnetID is not the Primary Network.
nodeID
- string - (optional) the validating node’s node ID.
validators - object
weight - string - (optional) the validator’s weight when sampling validators. Omitted if subnetID is the Primary Network.
connected - bool - (optional) if the node is connected.
nodeID - string - (optional) the validator’s node ID.
stakeAmount - string - (optional) the amount of nAVAX this validator staked. Omitted if subnetID is not the Primary Network.
endTime - string - the Unix time when the validator stops validating the Subnet.
startTime - string - the Unix time when the validator starts validating the Subnet.
txID - string - the validator transaction.
Returns the UTXOs that were rewarded after the provided transaction's staking or delegation period ended.
txID - string - The ID of the staking or delegating transaction.
encoding - string - Specifies the format for the returned UTXOs. Can only be "hex" when a value is provided.
numFetched - uint64 - The number of returned UTXOs
utxos - []string - The array of encoded reward UTXOs
encoding - string - Encoding is "hex" only.
Get the amount of nAVAX staked by a set of addresses. The amount returned does not include staking rewards.
Gets a transaction’s status by its ID. If the transaction was dropped, response will include a reason field with more information why the transaction was dropped.
txID
- string - The transaction id.
status - string - status is one of:
Unknown
- string - The transaction hasn’t been seen by this node
Dropped
- string - The transaction will never be accepted by any node in the network, check reason field for more information
Processing
- string - The transaction is being voted on by this node
Committed
- string - The transaction is (or will be) accepted by every node
Gets the UTXOs that reference a given set of addresses.
addresses
- []string - the addresses from which we want to retrieve the UTXOs.
limit
- int - (optional) At most limit UTXOs are returned. If limit is omitted or greater than 1024, it is set to 1024.
startIndex
- object - (optional) an object of an address and a utxo.
address
- string
utxo
- string
sourceChain
- string - (optional) the chain from which we want to fetch the UTXOs, (X or C).
encoding
- string - (optional) Specifies the format for the returned UTXOs. Can only be hex when a value is provided.
numFetched
- string - the number of UTXOs fetched.
utxos
- []string - the UTXOs fetched.
endIndex
- object - the last address and utxo that was fetched.
address
- string
utxo
- string
Returns an upper bound on amount of tokens that exist that can stake the requested Subnet. This is an upper bound because it does not account for burnt tokens, including transaction fees.
List the current validators of the given Subnet.
A transaction is said to change an address's balance if either is true:
A UTXO that the transaction consumes was at least partially owned by the address.
A UTXO that the transaction produces is at least partially owned by the address.
subnetID - string - (optional) The subnet whose current validators are returned. If omitted, returns the current validators of the Primary Network
nodeIDs - string - (optional) A list of the nodeIDs of pending validators to request. If omitted, all pending validators are returned. If a specified nodeID is not in the set of pending validators, it will not be included in the response
subnetID
is the Subnet whose current validators are returned. If omitted, returns the current validators of the Primary Network.
nodeIDs
is 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.
validators
:
txID
is the validator transaction.
startTime
is the Unix time when the validator starts validating the Subnet.
endTime
is the Unix time when the validator stops validating the Subnet.
stakeAmount
is the amount of tokens this validator staked. Omitted if subnetID
is not a PoS Subnet.
nodeID
is the validator’s node ID.
weight
is the validator’s weight when sampling validators. Omitted if subnetID
is a PoS Subnet.
validationRewardOwner
is 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
is 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
is the potential reward earned from staking. Omitted if subnetID
is not a PoS Subnet.
delegationFeeRate
is the percent fee this validator charges when others delegate stake to them. Omitted if subnetID
is not a PoS Subnet.
uptime
is the % of time the queried node has reported the peer as online and validating the Subnet.
connected
is if the node is connected and tracks the Subnet.
signer
is the node's BLS public key and proof of possession. Omitted if the validator doesn't have a BLS public key.
delegatorCount
is the number of delegators on this validator. Omitted if subnetID
is not a PoS Subnet.
delegatorWeight
is total weight of delegators on this validator. Omitted if subnetID
is not a PoS Subnet.
delegators
is the list of delegators to this validator. Omitted if subnetID
is not a PoS Subnet. Omitted unless nodeIDs
specifies a single NodeID.
txID
is the delegator transaction.
startTime
is the Unix time when the delegator started.
endTime
is the Unix time when the delegator stops.
stakeAmount
is the amount of nAVAX this delegator staked.
nodeID
is the validating node’s node ID.
rewardOwner
is an OutputOwners
output which includes locktime
, threshold
and array of addresses
.
potentialReward
is the potential reward earned from staking
Get info about the Subnets.
Gets a transaction by its ID.
encoding
- string - Optional encoding parameter to specify the format for the returned transaction. Can be either "hex" or "json". Defaults to "hex".
txID
- string - The transaction id.
txID
- string - The id of the subnet.
encoding
- string - Specifies the encoding format used in the request.
Returns the maximum amount of nAVAX staking to the named node during a particular time period.
subnetID
- string - A Buffer or cb58 string representing a subnet.
nodeID
- string - A string representing ID of the node whose stake amount is required during the given duration
startTime
- int - A big number denoting start time of the duration during which stake amount of the node is required.
endTime
- int - A big number denoting end time of the duration during which stake amount of the node is required.
amount
- uint64
Issue a transaction to the Platform Chain.
Sample validators from the specified Subnet.
height
- int - the numerical value representing the P-Chain height to get the validator set at.
subnetID
- string - (optional) the subnet ID to get the validator set of. If not given, gets validator set of the Primary Network.
validators
- object - the validators and their weights of a subnet or the Primary Network.