Marketplace has launched, further enabling blockchain developers! Learn more

Contents

platform.getCurrentValidators RPC method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. subnetID (optional) The subnet whose current validators are returned. If omitted, returns the current validators of the Primary Network.
  2. 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.

Returns:

  1. validators - object
  2. txID - string - the validator transaction.

    startTime - string - the Unix time when the validator starts validating the Subnet.

    endTime - string - the Unix time when the validator stops validating the Subnet.

    stakeAmount - string - (optional) the amount of nAVAX this validator staked. Omitted if subnetID is not the Primary Network.

    nodeID - string - (optional) the validator’s node ID.

    weight - string - (optional) the validator’s weight when sampling validators. Omitted if subnetID is the Primary Network.

  3. rewardOwner - object - an OutputOwners output which includes locktime, threshold and array of addresses.
  4. locktime - string

    threshold - string

    addresses - []string

  5. potentialReward - string - the potential reward earned from staking.
  6. delegationFee - string - the percent fee this validator charges when others delegate stake to them.
  7. uptime - string - the % of time the queried node has reported the peer as online.
  8. connected - bool - (optional) if the node is connected.
  9. delegators - object - the list of delegators to this validator.

txID - string - the delegator transaction.

startTime - string - the Unix time when the validator starts.

endTime - string - the Unix time when the validator stops.

stakeAmount - string - the amount of nAVAX this validator staked. Omitted if subnetID is not the Primary. Network.

nodeID - string - the validating node’s node ID.

rewardOwner - object - a OutputOwners output which includes locktime, threshold and array of addresses.

locktime - string

threshold - string

addresses - []string

potentialReward - string - the potential reward earned from staking.

Code Examples:

const ethers = require("ethers");

(async () => {
  const provider = new ethers.providers.JsonRpcProvider(
    "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/P"
  );
  const params = {};
  const result = await provider.send("platform.getCurrentValidators", params);
  console.log(result);
})();
Ready to get started? Create a free account