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

Typed balance query with correlation IDs.

This module provides a dedicated, typed interface for querying native ETH/PLS balances. Multiple queries can be in flight simultaneously — each carries a correlation id that is echoed back so responses can be matched.

-- Send via your port:
web3Cmd (Web3.Balance.encode (Web3.Balance.getBalance address "my-id"))


-- Receive via your port:
case D.decodeValue Web3.Balance.decoder incoming of
    Ok (Web3.Balance.GotBalance id wei) ->
        -- id matches the one you sent; wei is the amount
    Err _ ->
        -- not a balance response
type Cmd

A pending balance request. Carry the address and a correlation id.

type Msg
= GotBalance String Wei

A resolved balance response. Contains the correlation id and the amount in wei.

getBalance : Address -> String -> Cmd

Build a balance query for address, tagged with id.

encode : Cmd -> Value

Encode a Cmd for the JS port.

Produces {tag:'getBalance', address, id}.

decoder : Decoder Msg

Decode a {tag:'balance', id, wei} response from the JS port.