Ethereum Balance Tracker is an npm package that allows you to retrieve the USDT balance of a specific Ethereum address using Web3 and the USDT contract ABI.
To install the package, you can use npm:
npm install ethereum-balance-tracker
import { getUsdtBalance } from "ethereum-balance-tracker";
const balance = await getUsdtBalance({
INFURA_PROJECT_ID: "your_infura_project_id",
Address: "0xYourEthAddress",
});
console.log(balance);
import { getLastBlockNumber } from "ethereum-balance-tracker";
const result = await getLastBlockNumber({
INFURA_PROJECT_ID: "your_infura_project_id",
});
console.log(result);
getUsdtBalance({ INFURA_PROJECT_ID, Address })
This function retrieves the USDT balance of a specified Ethereum address in wei using the provided Infura Project ID and the address.
INFURA_PROJECT_ID
(string): Your Infura Project ID for connecting to the Ethereum network.Address
(string): The Ethereum address for which you want to retrieve the USDT balance.getLastBlockNumber({ INFURA_PROJECT_ID })
This function retrieves the last block number on the Ethereum mainnet using the provided Infura Project ID.
INFURA_PROJECT_ID
(string): Your Infura Project ID for connecting to the Ethereum network.bigint
.This package utilizes the web3
library to interact with the Ethereum network
This project is licensed under the MIT License - see the LICENSE file for details.