View on GitHub

web3js-cn

web3.eth.getBalance

返回链上指定地址的账户余额。

调用:

web3.eth.getBalance(addressHexString [, defaultBlock] [, callback])

参数:

示例:

var balance = web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1");
console.log(balance); // instanceof BigNumber
console.log(balance.toString(10)); // '1000000000000'
console.log(balance.toNumber()); // 1000000000000

教程推荐: