quietgarden/elm-web3/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 2.0.1 found (5 same-name repos checked); no cached copy. Use another version.

Details

Web3.Fee

Gas price and fee history queries.

fetchGasPrice : Platform.Cmd msg
fetchGasPrice =
    web3Cmd (Fee.encode (Fee.getGasPrice "gas-query"))
type Cmd
= RequestGasPrice String
| RequestFeeHistory String Int

Commands to query fee data via port.

type Msg
= GotGasPrice String BigInt
| GotFeeHistory String FeeHistory

Messages from the JS fee port.

type alias FeeHistory =
{ baseFeePerGas : List BigInt
, gasUsedRatio : List Float
, oldestBlock : Int
}

Historical fee data from eth_feeHistory.

getGasPrice : String -> Cmd

Request the current gas price (eth_gasPrice). The id is echoed back.

getFeeHistory : String -> Int -> Cmd

Request fee history for the last blockCount blocks.

encode : Cmd -> Value

Encode a Cmd for the JS port.

decoder : Decoder Msg

Decode Msg responses from the JS port.