Is it possible to get near balance of an account using near cli.?
Asked
Active
Viewed 643 times
1 Answers
8
Running:
near state <account.near>
should do the trick:
Account account.near
{
amount: 'XXXXXX',
locked: '0',
code_hash: 'XXXX',
storage_usage: XX,
storage_paid_at: 0,
block_height: XXX,
block_hash: 'XXXX',
formattedAmount: 'XXXX'
}
or even:
near state account.near | sed -n "s/.*formattedAmount: '\([^\\]*\).*'/\1/p"
if you just need the formattedAmount:
XYZ.39429240342

chefsale
- 326
- 1
- 7
-
Super helpful. Thank you! – Ryan Dec 02 '21 at 19:29