Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query for Near staked and locked balance. #233

Open
shassal opened this issue Sep 23, 2024 · 1 comment
Open

Query for Near staked and locked balance. #233

shassal opened this issue Sep 23, 2024 · 1 comment

Comments

@shassal
Copy link

shassal commented Sep 23, 2024

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.

@telezhnaya
Copy link
Contributor

Hey @shassal ,
Please have a look at https://github.com/near/core-contracts/tree/master/lockup

If you are the owner of the lockup, and you've never touched it before, consider calling this command
https://github.com/near/core-contracts/tree/master/lockup#check-transfers-vote

@telezhnaya telezhnaya transferred this issue from near/nearcore Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants