getBalance

查询函数,查询账户trx余额,返回的trx以sun为单位。

用法

tronWeb.trx.getBalance(address);

参数类型
String(HexString或Base58)

返回值类型
Number

示例

//参数 Base58
> tronWeb.trx.getBalance('TTSFjEG3Lu9WkHdp4JrWYhbGP6K1REqnGQ').then(result => console.log(result))
Promise { <pending> }
> 29887074430
         
//参数 HexString
>tronWeb.trx.getBalance('41BF97A54F4B829C4E9253B26024B1829E1A3B1120').then(result => console.log(result))
Promise { <pending> }
> 29340074430