intrepidshape/elm-web3-ui/2.3.0

NOTE: the latest version is 4.0.0

Web3.Ui.Transaction

Transaction lifecycle UI components.

Pattern-match on Tx.Status to render appropriate UI without missing any state.

-- Status badge with modifier class:
Web3.Ui.Transaction.statusBadge [] tx.status


-- Action button disabled while in-flight:
Web3.Ui.Transaction.actionButton []
    { label = "Buy", pendingLabel = "Buying…", onPress = SubmitBuy }
    tx.status


-- Clickable tx hash link:
Web3.Ui.Transaction.txHashLink []
    { explorerUrl = "https://etherscan.io/tx/" }
    hash


-- Hash link extracted from status (Nothing when no hash available):
-- Pass Nothing for explorerUrl in local dev — renders a plain span instead of a dead link.
Web3.Ui.Transaction.statusHashLink []
    { explorerUrl = Just "https://etherscan.io/tx/" }
    tx.status


-- Confirmed receipt display:
Web3.Ui.Transaction.receiptView []
    { explorerUrl = "https://etherscan.io/tx/" }
    receipt
statusBadge : List (Attribute msg) -> Status -> Html msg

A status badge for the current transaction state.

Labels: "Idle" / "Awaiting Signature" / "Pending" / "Confirming" / "Confirmed" / "Failed" / "Rejected"

CSS classes: web3-tx-badge plus one of: web3-tx-badge--idle, web3-tx-badge--pending, web3-tx-badge--confirmed, web3-tx-badge--failed, web3-tx-badge--rejected

List (Attribute msg)
-> { label : String
, pendingLabel : String
, onPress : msg
}
-> Status
-> Html msg

An action button that is active in Idle and terminal states, and disabled while in-flight (AwaitingSignature, Submitted, Confirming).

Shows pendingLabel while the transaction is in-flight.

CSS classes: web3-action-btn, web3-action-btn--pending (added when disabled)

List (Attribute msg)
-> { explorerUrl : Maybe String }
-> Receipt
-> Html msg

Display a confirmed transaction receipt.

Root element: <div class="web3-receipt web3-receipt--success|failed">

Each field is wrapped in <div class="web3-receipt-field">.

CSS classes: web3-receipt, web3-receipt--success, web3-receipt--failed, web3-receipt-field

confirmationProgress : List (Attribute msg) -> { required : Int } -> Status -> Html msg

Confirmation progress as a row of dots — one per required confirmation, filled as they land. Renders only in Confirming; every other status is Html.text "" so it composes inline without layout cost.

The count comes straight from the Confirming _ n state, which the Web3.Transaction machine guarantees is strictly increasing (see MonotonicConfirmations in elm-web3's proofs/tla/TransactionSpec.tla) — these dots can never un-fill.

CSS classes: web3-confirmations, web3-confirmations__dot, web3-confirmations__dot--filled, web3-confirmations__count.