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.1 found (5 same-name repos checked); no cached copy. Use another version.
Block number and block data queries.
-- One-shot block number query:
port web3Cmd : Json.Encode.Value -> Cmd msg
port web3Sub : (Json.Decode.Value -> msg) -> Sub msg
type Msg = GotBlock Block.Msg | ...
subscriptions model =
web3Sub (Json.Decode.decodeValue Block.decoder >> Result.toMaybe >> Maybe.map GotBlock)
fetchBlock : Platform.Cmd msg
fetchBlock =
web3Cmd (Block.encode (Block.getBlockNumber "my-id"))Messages from the JS block port.
A block header with key fields.
Request the current block number. The id is echoed back in the response.
Request a specific block by block number. The id is echoed back.
Start polling the block number every 4 seconds. The id tags each
GotBlockNumber response so you can distinguish multiple watchers.
Request the number of transactions in a block. The second argument is a request ID.
Commands to query block data via port.