I would like to extract the validator that a given nominator is bonding? Is this possible given the extrinsic or should it be done some other way?

Here is my code:

const { ApiPromise, WsProvider } = require('@polkadot/api');

async function main() {
    // Initialise the provider to connect to the local node
    const provider = new WsProvider('wss://rpc.polkadot.io');

    // Create the API and wait until ready
    const api = await ApiPromise.create({ provider });

    const blockNumber = 11833484; 

    // returns Hash
    const blockHash = await api.rpc.chain.getBlockHash(blockNumber);
    // returns SignedBlock
    const signedBlock = await api.rpc.chain.getBlock(blockHash);

    const apiAt = await api.at(signedBlock.block.header.hash);
    const allRecords = await apiAt.query.system.events();

    const bondingEvents = allRecords.filter(ev => ev.event.method == 'Bonded');
    const bondingExtrinsics = bondingEvents
        .map(ev => 


main().catch((error) => {


  isSigned: true,
  method: {
    args: { max_additional: '13,428,193,000,000' },
    method: 'bondExtra',
    section: 'staking'
  era: { MortalEra: { period: '64', phase: '7' } },
  nonce: '283',
  signature: '0x04aebb51e2b2b1947e3e344537caa45cad9caa170808d8ed2f448ef4e0433b69820e5f60b35065ed7c7adc0ecb88d03b9e1fdf46e6873b8f9263738dbc874080',
  signer: { Id: '15V25oBZGu7wAfV7LPP8YBwaWRgBAyfiVUtVywGHAcDAw9cD' },
  tip: '0'

The amount bonded and the account which is bonding are both clearly visible in the output. How, then, should I go about retrieving the validator which is being bonded to?

1 Answer 1


In this case, the user is not changing their nominations, but simply bonding more funds.

For this, you will need to query the nominations of the user, which can be done with something like:

let result = (await substrate.query.staking.nominators("15V25oBZGu7wAfV7LPP8YBwaWRgBAyfiVUtVywGHAcDAw9cD")).unwrap();

  • When they bond more funds are those funds split evenly between their nominations? How can I derive the total amount they have bonded to their nominations?
    – Teo
    Sep 22, 2022 at 14:34
  • 1
    I think you need to look more into the Phragmen election process used in Polkadot. Basically, we have an algorithm which automatically distributes your funds based on a set of criteria, one of which is make sure validators have as close to even amount of stake across them all. This means, you do not control how much each validator gets, but an algorithm will.
    – Shawn Tabrizi
    Sep 22, 2022 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.