Updated on 2023-12-06 GMT+08:00

Using TronWeb to Send HTTP Requests

Request example

const TronWeb = require('tronweb');
const tronWeb = new TronWeb({
fullHost: ' your-http-endpoint / your-credential / ', // TRON HTTP endpoint
  });

let account = " accountAddress "; // The account to be queried

const main = async () => {
    let accountBalance = await tronWeb.trx.getBalance(account);
    console.log("accountBalance:\n", accountBalance);
}

main();

Response example

accountBalance:
 1998899400