A DataLoader-style multicall batcher. Reads enqueued within the same tick are
coalesced into one Multicall3 call automatically — code paths that don't know
about each other still share a round-trip. Ideal behind an HTTP handler where
many independent reads fire per request.
Example
constbatch = createBatcher(hood) // These three run as ONE multicall even though they're separate awaits: const [a, b, c] = awaitPromise.all([ batch.call({ address:t1, abi:erc20Abi, functionName:'balanceOf', args: [me] }), batch.call({ address:t2, abi:erc20Abi, functionName:'balanceOf', args: [me] }), batch.call({ address:t3, abi:erc20Abi, functionName:'balanceOf', args: [me] }), ])
A DataLoader-style multicall batcher. Reads enqueued within the same tick are coalesced into one Multicall3 call automatically — code paths that don't know about each other still share a round-trip. Ideal behind an HTTP handler where many independent reads fire per request.
Example