Search code examples
nearprotocol

Get a number of delegators of a staking pool in NEAR protocol


How can I get the number of delegators per validator?

I see that the block explorer here is pulling a delegators amount: https://explorer.near.org/nodes/validators


Solution

  • You need to make a view function call to the staking pool contract

    NEAR Explorer code that does it is here: https://github.com/near/near-explorer/blob/6fb41596299fd8ac073efc413b2d95074ea5d7da/backend/src/index.js#L387-L394