Marketplace has launched, further enabling blockchain developers! Learn more

Contents

platform.getPendingValidators 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.

    connected - bool - (optional) if the node is connected.

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

  1. delegators - object
  2. 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.

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 = {
    "subnetID": null,
    "nodeIDs": [],
  };
  const result = await provider.send("platform.getPendingValidators", params);
  console.log(result);
})();
Ready to get started? Create a free account