quietgarden/elm-web3/1.0.0

NOTE: the latest version is 2.0.1

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3 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 (5 same-name repos checked); no cached copy. Use another version.

Details

Web3

Top-level Web3 module that composes wallet + transaction state.

Wire this into your Elm app's Model/update/subscriptions.

import Web3


type alias Model =
    { web3 : Web3.Model
    , ...
    }


type Msg
    = Web3Msg Web3.Msg
    | ...


update msg model =
    case msg of
        Web3Msg subMsg ->
            { model | web3 = Web3.update subMsg model.web3 }
type alias Model =
{ wallet : State
, expectedChain : ChainId
, transactions : List ( String, Status )
}

Combined wallet + transaction state.

type Msg
= WalletMsg Msg
| TxMsg String Msg

Messages for wallet and transaction updates.

init : ChainId -> Model

Initialize with the expected chain ID.

update : Msg -> Model -> Model

Update wallet and transaction state from a port message.

subscriptions : Model -> Sub Msg

Placeholder for port subscriptions. Wire your port decoder here.