intrepidshape/elm-web3/1.0.0

NOTE: the latest version is 3.0.0

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/IntrepidShape/elm-web3.

What we checked: The repo moved to github.com/IntrepidShape/elm-web3 and tag 1.0.0 is there; its commit 9d919244f65e is from 2026-05-09 11:48 UTC, before the version was published (2026-05-09 11:58 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/intrepidshape/elm-web3/zipball/1.0.0/

Web3.Block

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"))
type Cmd
= RequestBlockNumber String
| RequestBlock BlockNumber String
| WatchBlockNumber String
| RequestBlockTxCount BlockNumber String

Commands to query block data via port.

type Msg
= GotBlockNumber String Int
| GotBlock String Block
| GotBlockTxCount String Int

Messages from the JS block port.

type alias Block =
{ number : Int
, hash : String
, timestamp : Int
, gasLimit : BigInt
, gasUsed : BigInt
, baseFeePerGas : Maybe BigInt
, parentHash : String
}

A block header with key fields.

getBlockNumber : String -> Cmd

Request the current block number. The id is echoed back in the response.

getBlock : BlockNumber -> String -> Cmd

Request a specific block by block number. The id is echoed back.

watchBlockNumber : String -> Cmd

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.

encode : Cmd -> Value

Encode a Cmd for the JS port.

decoder : Decoder Msg

Decode Msg responses from the JS port.