Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3 is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 2.0.0 found (5 same-name repos checked); no cached copy. Use another version.
Batch multiple contract reads into a single eth_call via Multicall3.
The Multicall3 contract (0xcA11bde05977b3631167028862bE2a173976CA11) is deployed on Ethereum, PulseChain, and most EVM networks. It lets you pack N read calls into one RPC round-trip.
import Web3.Multicall as Multicall
import Web3.Abi.Encode as Encode
let
req =
Multicall.batch "balance-check"
[ Multicall.callSpec tokenAddress "balanceOf(address)" [ Encode.address myAddr ]
, Multicall.callSpec tokenAddress "totalSupply()" []
]
in
-- Outgoing port: web3Cmd (Multicall.encode req)
-- Incoming port: match on { tag = "multicallResult" } and apply responseDecoderBuild a CallSpec for a contract read.
Multicall.callSpec
pairAddress
"getReserves()"
[]A batched multicall request with a correlation id.
The result of a single call within a multicall batch.
data is the raw ABI-encoded return value as a hex string (0x-prefixed).
Apply your specific decoder (e.g. from Web3.Abi.Decode) to parse it.
Batch a list of call specs into a multicall request.
The id is echoed back in the multicallResult response so you can match
responses to requests when multiple batches are in flight.
Encode a multicall request for the JS port.
Produces:
{ "tag": "multicall"
, "id": "..."
, "calls": [ { "contract": "0x...", "method": "...", "args": [...] }, ... ]
}Decoder for the multicallResult port response.
Expects:
{ "tag": "multicallResult"
, "id": "..."
, "results": [ { "success": true, "data": "0x..." }, ... ]
}Results are in the same order as the original call specs.
A single call specification for inclusion in a multicall batch.