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

Address display and input components.

-- Display with optional explorer link:
Web3.Ui.Address.view []
    { explorerUrl = Just "https://etherscan.io/address/" }
    addr


-- Truncated address string (pure, no Html):
Web3.Ui.Address.short addr  --> "0x1234…abcd"


-- Address text input:
Web3.Ui.Address.input []
    { value = model.addressInput
    , onInput = AddressInputChanged
    , valid = True
    }
List (Attribute msg)
-> { explorerUrl : Maybe String }
-> Address
-> Html msg

Display an address as "0x1234…abcd". Optionally wraps in an <a> tag when explorerUrl is Just url.

CSS class: web3-address

short : Address -> String

Truncate an address to "0x" + first 4 hex chars + "…" + last 4 hex chars.

short addr  --> "0x1234…abcd"
List (Attribute msg)
-> { value : String
, onInput : String -> msg
, valid : Bool
}
-> Html msg

A text input for address entry. Adds web3-input-address--invalid class when valid is False.

The host app is responsible for validating with T.address.

CSS class: web3-input-address (plus web3-input-address--invalid when invalid)