我是 TronGrid.js 和 node.js 的新手。当我使用节点 index.js通过 cmd 执行此文件时,它工作正常......但是,当我在aspx 文件中加载相同的文件作为脚本时,它会给出以下错误:
未捕获的 ReferenceError:未定义要求
这是我的 index.js
const TRONGRID = require("trongrid");
const TRONWEB = require("tronweb");
const tronWeb = new TRONWEB({
fullHost: "https://api.shasta.trongrid.io/"
});
const tronGrid = new TRONGRID(tronWeb);
async function getTransactions() {
let options = {
onlyTo: true
};
var transactions = await tronGrid.account.getTransactions("TJqfBdPgRHbFpWz7epwq3LGzrxtNyzWTTQ", options);
console.log(transactions);
}
getTransactions();