更新时间:2023-08-09 GMT+08:00
使用TronWeb发送HTTP请求
Request example:
const TronWeb = require('tronweb');
const tronWeb = new TronWeb({
fullHost: 'your-http-endpoint/your-credential/', // Tron HTTP终端节点
});
let account = "accountAddress"; // 待查询的账户
const main = async () => {
let accountBalance = await tronWeb.trx.getBalance(account);
console.log("accountBalance:\n", accountBalance);
}
main();
Response example:
accountBalance: 1998899400
父主题: 应用程序开发介绍