intrepidshape/elm-web3-ui/1.0.0

NOTE: the latest version is 4.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-ui.

What we checked: The repo moved to github.com/IntrepidShape/elm-web3-ui and tag 1.0.0 is there; its commit 4a2f1b2ed9a9 is from 2026-05-09 11:59 UTC, before the version was published (2026-05-09 12:02 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-ui/zipball/1.0.0/

Web3.Ui.Balance

Balance display components.

Uses Web3.Units.formatUnits / Web3.Units.formatEther internally.

-- ERC-20 token with 6 decimals:
Web3.Ui.Balance.view []
    { decimals = 6, symbol = "USDC" }
    amount


-- Native ETH/PLS balance:
Web3.Ui.Balance.viewEther []
    { symbol = "ETH" }
    weiAmount


-- Balance that may not have loaded yet:
Web3.Ui.Balance.viewMaybe []
    { decimals = 6, symbol = "USDC", loading = "…" }
    model.balance


-- Ether balance that may not have loaded yet:
Web3.Ui.Balance.viewEtherMaybe []
    { symbol = "ETH", loading = "…" }
    model.ethBalance
List (Attribute msg)
-> { decimals : Int
, symbol : String
}
-> BigInt
-> Html msg

Display a token balance formatted with the given decimal count and symbol.

view [] { decimals = 6, symbol = "USDC" } amount
--> <span class="web3-balance">1.5 USDC</span>

CSS class: web3-balance

viewEther : List (Attribute msg) -> { symbol : String } -> BigInt -> Html msg

Display a Wei amount as ether (18 decimals) with the given symbol.

viewEther [] { symbol = "ETH" } weiAmount
--> <span class="web3-balance">1.5 ETH</span>

CSS class: web3-balance

List (Attribute msg)
-> { decimals : Int
, symbol : String
, loading : String
}
-> Maybe BigInt
-> Html msg

Display a token balance that may not have loaded yet.

Shows opts.loading with class web3-balance--loading while Nothing. Renders the same as view once the balance arrives.

CSS classes: web3-balance, web3-balance--loading (loading state only)

List (Attribute msg)
-> { symbol : String
, loading : String
}
-> Maybe BigInt
-> Html msg

Display a Wei balance that may not have loaded yet (18 decimals).

Delegates to viewMaybe with decimals = 18.

CSS classes: web3-balance, web3-balance--loading (loading state only)