@pelith/ethers-multicall
Install
yarn add @pelith/ethers-multicall
Example
import { Contract as MulticallContract, Provider as MulticallProvider } from '@pelith/ethers-multicall';
const ethcallProvider = new MulticallProvider(web3Provider, chainId);
const tokenContract = new MulticallContract(address, ERC20_ABI);
const balances = await ethcallProvider.all([
tokenContract.balanceOf(account1),
tokenContract.balanceOf(account2),
]);
const balancesAtBlock = await ethcallProvider.all([
tokenContract.balanceOf(account1),
tokenContract.balanceOf(account2),
], blockTag);