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.Query

Typed decoders for on-chain read queries: transaction count (nonce), storage slot reads, contract bytecode, and transaction lookup by hash.

Each query carries a correlation id that is echoed back so responses can be matched when multiple queries are in flight.

-- Send via your port:
web3Cmd (Web3.Query.encode (Web3.Query.getTxCount address "nonce-1"))


-- Receive via your port:
case D.decodeValue Web3.Query.decoder incoming of
    Ok (Web3.Query.GotTxCount id nonce) -> ...
    Ok (Web3.Query.GotStorageAt id val) -> ...
    Ok (Web3.Query.GotCode id bytecode) -> ...
    Ok (Web3.Query.GotTransaction id info) -> ...
    Ok (Web3.Query.TransactionNotFound id) -> ...
    Err _ -> -- not a query response
type Cmd
= RequestTxCount Address String
| RequestStorageAt Address Int String
| RequestCode Address String
| RequestTransaction TxHash String

Commands to send to the JS query port.

type Msg
= GotTxCount String Int
| GotStorageAt String String
| GotCode String String
| GotTransaction String TransactionInfo
| TransactionNotFound String

Messages from the JS query port.

type alias TransactionInfo =
{ hash : TxHash
, from : Address
, to : Maybe Address
, value : Wei
, nonce : Int
, data : String
, gas : Int
, blockNumber : Maybe Int
, blockHash : Maybe String
}

Information about a transaction fetched by hash.

getTxCount : Address -> String -> Cmd

Build a transaction count (nonce) query for address, tagged with id.

getStorageAt : Address -> Int -> String -> Cmd

Build a storage slot query. slot is the integer slot index (converted to hex).

getCode : Address -> String -> Cmd

Build a contract bytecode query for contract, tagged with id.

getTransaction : TxHash -> String -> Cmd

Request a transaction by hash. The second argument is a request ID.

encode : Cmd -> Value

Encode a Cmd for the JS port.

decoder : Decoder Msg

Decode query responses from the JS port.

Handles txCount, storageAt, code, transaction, and transactionNotFound tags. Returns Err for unknown tags.