Closed elliottssu closed 6 years ago
I get different results:
> eos.getCurrencyBalance('eosio.token', 'geydcmrxg4gf', 'EOS')
api > post https://mainnet.eoscanada.com/v1/chain/get_currency_balance {"code":"eosio.token","account":"geydcmrxg4gf","symbol":"EOS"}
api < response https://mainnet.eoscanada.com/v1/chain/get_currency_balance ["3.0000 EOS"]
> eos.getCurrencyBalance('eosio.token', 'geydcmrxg4gg', 'EOS')
api > post https://mainnet.eoscanada.com/v1/chain/get_currency_balance {"code":"eosio.token","account":"geydcmrxg4gg","symbol":"EOS"}
api < response https://mainnet.eoscanada.com/v1/chain/get_currency_balance []
As the document write, how to get current account balance
eosjs:
const balance = await eos.getCurrencyBalance('eosio.token', 'myaccount', 'TOK')
cleos:
$ cleos get currency balance eosio.token myaccount TOK
well, cleos can be get the account is 'myaccount' like: 200.0000 TOK
however, getCurrencyBalance() params accept token account, no matter what account i write, it still return a array like :
[ "200.0000 TOK"]