Alesya
Alesya

Reputation: 117

Does not get to get the balance amount for the near wallet

I want to get some sums of my wallet balance using 'near-api-py' lib on 'Account' tab of wallet profile(https://wallet.near.org/profile): Wallet balance(NEAR, USD) - near_provider.get_account(account_id) - at the moment, I can only get this amount by all the methods described.

def get_account(self):
    state = near_provider.get_account(account_id)
    print(state)
    return state['amount'], state['block_hash'], state['block_height'], state['locked'], state['storage_paid_at'], \
           state['storage_usage']

state['locked'], state['storage_paid_at'] - outputs 0. Why? I don't understand. I need to get the following amounts:

  1. Reserved for storage(NEAR, USD)
  2. Reserved for transactions(NEAR, USD)
  3. Available balance(NEAR, USD) - at least get this amount!!!!!

Please tell me how to fix it. Thanks

Upvotes: 1

Views: 141

Answers (1)

Peter Volnov
Peter Volnov

Reputation: 1

Use get_balance() method from py-near

Docs: https://py-near.readthedocs.io/en/latest/account.html

Upvotes: 0

Related Questions