Skip to content

Query for Near staked and locked balance. #233

Description

@shassal

Hi @nearprotocol-ci ,

I am using one API to get the balance and staked balance at a blockheight. But seems like on some other explorer it's different.

Query that i used:

curl --location 'https://archival-rpc.mainnet.near.org'
--header 'Content-Type: application/json'
--data '{
"jsonrpc": "2.0",
"id": "dontcare",
"method": "query",
"params": {
"request_type": "view_account",
"block_id": 109422153,
"account_id": "35b2e85e2e7add13abcd8ae62998cbfad9bad5bf.lockup.near"
}
}'

Here, i am passing the block_id as a param.

In the response, i can see the locked balance as 0.

{
"jsonrpc": "2.0",
"result": {
"amount": "3500361012273079800000000",
"locked": "0",
"code_hash": "4Pfw2RU6e35dUsHQQoFYfwX8KFFvSRNwMSNLXuSFHXrC",
"storage_usage": 344792,
"storage_paid_at": 0,
"block_height": 109422153,
"block_hash": "716ws7djkZtvseBLDUdvjPFND1y1NTbTr8EWEFP4bcbf"
},
"id": "dontcare"
}

Query 1:
What is the difference between locked balance and staked balance.

Query 2:
On the explorer, it shows https://near-staking.com/user/35b2e85e2e7add13abcd8ae62998cbfad9bad5bf.lockup.near, some staked balance.

Thanks,
Saloni.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions