quietgarden/elm-web3-ui/1.0.0

NOTE: the latest version is 2.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3-ui is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.0.0 found (1 same-name repos checked); no cached copy. Use another version.

Details

Web3.Ui.Wallet

Wallet connection UI components.

All functions accept List (Html.Attribute msg) as the first argument — merged onto the root element. Pass [] for no extra attributes.

No default styles — every element has a semantic class name. Supply your own CSS.

-- Basic connect/disconnect button:
Web3.Ui.Wallet.connectButton []
    { onConnect = ConnectWallet, onDisconnect = DisconnectWallet }
    model.wallet


-- Full wallet UI handling all states:
Web3.Ui.Wallet.viewState []
    { onConnect = ConnectWallet
    , onSwitchChain = SwitchChain
    , onDisconnect = DisconnectWallet
    , knownChains = [ Chain.pulsechain, Chain.ethereum ]
    }
    model.wallet
List (Attribute msg)
-> { onConnect : msg
, onDisconnect : msg
}
-> State
-> Html msg

A connect/disconnect button. Shows "Connect" in disconnected/error states and "Disconnect" in connected states.

CSS classes: web3-connect-btn, web3-disconnect-btn

List (Attribute msg)
-> (String -> msg)
-> List WalletProvider
-> Html msg

A list of EIP-6963 discovered wallets for the user to pick from.

Each wallet renders as a button with the wallet icon and name.

CSS classes: web3-wallet-picker (container), web3-wallet-option (each item)

List (Attribute msg)
-> { onConnect : msg
, onSwitchChain : msg
, onDisconnect : msg
, knownChains : List Chain
}
-> State
-> Html msg

Full wallet UI — handles all Wallet.State variants with appropriate labels and actions.

Pass knownChains so the WrongChain branch can display the target network name.

CSS class: web3-wallet-state

chainBadge : List (Attribute msg) -> List Chain -> State -> Html msg

Displays the connected chain name, looked up from the supplied chain list. Falls back to "Unknown Chain" if not found.

Shows "Wrong Chain" when in WrongChain state. Shows "Read-only" when in ReadOnly state. Shows "—" when connecting, disconnected, or in error state.

CSS class: web3-chain-badge