如何使用cli接近账户余额?

How to get near balance of an account using cli?

是否可以使用 near cli. 接近账户余额?

运行:

near state <account.near>

应该这样做:

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'
}

甚至:

near state account.near |  sed -n "s/.*formattedAmount: '\([^\]*\).*'//p"

如果您只需要格式化的金额:

XYZ.39429240342