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.Contract.Call

Type-safe contract read calls (eth_call).

Build a read call, encode it for the JS port, decode the response. The code generator creates typed wrappers around these primitives.

-- Generated code uses this under the hood:
balanceOf : Address -> ReadCall String
balanceOf addr =
    readCall
        { contract = tokenAddress
        , method = "balanceOf"
        , args = [ Encode.address addr ]
        , decoder = Decode.string
        }
type ReadCall a

A read-only contract call with a typed return value.

{ contract : Address
, method : String
, args : List Value
, decoder : Decoder a
, id : String
}
-> ReadCall a

Create a read call. The id is echoed back in the response so you can match responses to requests when multiple calls are in flight.

Set the block number for the call.

encode : ReadCall a -> Value

Encode a read call for the JS port.

responseDecoder : ReadCall a -> Decoder a

Get the response decoder for a read call.