Skip to content
Discussion options

You must be logged in to vote

I checked the current docs and source, and there are really 2 different batching paths in viem here.

  1. http(..., { batch: true }) is transport level JSON-RPC batching.
    That exists on the HTTP transport.

  2. createPublicClient({ batch: { multicall: ... } }) is eth_call aggregation through Multicall3 or deployless multicall.
    That is client level batching, not WebSocket JSON-RPC batching.

So for the transport part, there is no native WebSocket version of http({ batch: true }) today.
The current webSocket() transport sends one request at a time.

There is also one detail in your example that explains why your reads are not being merged.
When you pass account, viem turns that into from on the e…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by NicolasKritter
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants