intrepidshape/elm-web3/1.0.0

NOTE: the latest version is 3.0.0

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/IntrepidShape/elm-web3.

What we checked: The repo moved to github.com/IntrepidShape/elm-web3 and tag 1.0.0 is there; its commit 9d919244f65e is from 2026-05-09 11:48 UTC, before the version was published (2026-05-09 11:58 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/intrepidshape/elm-web3/zipball/1.0.0/

Web3.Contract.Send

Type-safe contract write calls (eth_sendTransaction).

Build a write call, encode it for the JS port, optionally estimate gas first.

-- Non-payable: approve
approve : Address -> BigInt -> WriteCall
approve spender amount =
    writeCall
        { contract = tokenAddress
        , method = "approve"
        , args = [ Encode.address spender, Encode.uint256 amount ]
        }


-- Payable: buy
buy : BigInt -> Wei -> WriteCall
buy minTokens value =
    payableCall
        { contract = routerAddress
        , method = "buy"
        , args = [ Encode.uint256 minTokens ]
        , value = value
        }

A write call to a contract.

{ contract : Address
, method : String
, args : List Value
}

Create a non-payable write call.

{ contract : Address
, method : String
, args : List Value
, value : BigInt
}

Create a payable write call with a value.

Set a gas limit.

encode : WriteCall -> Value

Encode a write call for the JS port.

Encode a write call as an estimateGas command for the JS port.

estimateGas myWriteCall
-- sends { tag: "estimateGas", contract: ..., method: ..., args: ..., value: ... }
-- JS responds with { tag: "gasEstimate", gas: "21000" }
{ bytecode : String
, args : List Value
, gasLimit : Maybe Int
}
-> Value

Encode a contract deployment for submission via the port.

encodeRawSend : String -> Value

Encode a raw signed transaction for broadcast via the port.