Estoy tratando de construir un solo módulo para obtener los detalles del token, sin embargo, obtengo todos los datos requeridos pero no obtengo liquidez en el grupo.
const ADDRESS = "0x26193c7fa4354ae49ec53ea2cebc513dc39a10aa"; async function run() { const contract = new web3.eth.Contract(ABI, ADDRESS); const name = await contract.methods.name().call(); console.log("name:", name); const symbol = await contract.methods.symbol().call(); console.log("symbol:", symbol); const decimals = await contract.methods.decimals().call(); console.log("decimals:", decimals); const totalSupply = await contract.methods.totalSupply().call(); console.log("totalSupply:", totalSupply); (async () => { const tokenAddres = ADDRESS; // change this with the token addres that you want to know the let bnbPrice = await calcBNBPrice() // query pancakeswap to get the price of BNB in USDT console.log(`CURRENT BNB PRICE: ${bnbPrice}`); // Them amount of tokens to sell. adjust this value based on you need, you can encounter errors with high supply tokens when this value is 1. let tokens_to_sell = 1; let priceInBnb = await calcSell(tokens_to_sell, tokenAddres) / tokens_to_sell; // calculate TOKEN price in BNB console.log('IN BNB : ' + priceInBnb + ' | Just convert it to USD '); console.log(`IN USD: ${priceInBnb * bnbPrice}`); [![enter image description here][1]][1]// convert the token price from BNB to USD based on the retrieved BNB value })(); run();