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
- to get the usdt balance from a specifed address
import { getUsdtBalance } from "ethereum-balance-tracker";
const balance = await getUsdtBalance({
INFURA_PROJECT_ID: "your_infura_project_id",
Address: "0xYourEthAddress",
});
console.log(balance);
- to get the last block number of Ethereum mainnet.
import { getLastBlockNumber } from "ethereum-balance-tracker";
const result = await getLastBlockNumber({
INFURA_PROJECT_ID: "your_infura_project_id",
});
console.log(result);
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.
- Returns a Promise that resolves to the USDT balance of the specified address in wei.
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.
- Returns a Promise that resolves to the latest block number on the Ethereum mainnet as a
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.