0.2.1 • Published 8 months ago
web3-multicall3 v0.2.1
Multicall3
is a library for batching contract calls.
Web3-multicall3
is a type-safe multicall3 contract
wrapper
Installation
yarn add web3-multicall3
Usage
const multicall = new Web3Multicall3({
web3: web3Instance, // Web3 v4.*
address: '0xcA11bde05977b3631167028862bE2a173976CA11', // constant address
});
const [someFunctionResponse] = await multicall.aggregate3([
createContractlCall(
contract, // some contract
'someFunctionName', // function name, types are automatically obtained from contract
[arg1, arg2] // someFunction parameters, types validated by web3
)
]);
createContractCall
A utility that provides type support for proper use of web3 contract
Demo
Parameters
- contract - web3.eth.contract
- fnName - function name (obtained from provided contract)
- args - arguments of selected function (types are validated)
Examples
USDC example
- fetching USDC contract owner and balance of zero addressUSDC example (plugin)
- Web3Multicall3Pluge usage
Tests
- Only very base tests are implemented
0.2.1
8 months ago
0.2.0
8 months ago
0.2.0-beta.3
8 months ago
0.2.0-beta.2
8 months ago
0.2.0-beta.1
8 months ago
0.2.0-beta.0
8 months ago
0.1.0
8 months ago
0.1.0-alpha.7
8 months ago
0.1.0-alpha.6
8 months ago
0.1.0-alpha.5
8 months ago
0.1.0-alpha.4
8 months ago
0.1.0-alpha.3
8 months ago
0.1.0-alpha.2
8 months ago
0.1.0-alpha.0
8 months ago
0.0.1
8 months ago