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

Details

Web3.Abi.Encode

Helpers to encode contract call parameters to JSON values for passing through ports to the JS Web3 layer.

address : Address -> Value

Encode an Address argument.

uint256 : BigInt -> Value

Encode a uint256 argument from a BigInt.

int256 : BigInt -> Value

Encode an int256 argument from a BigInt.

bool : Bool -> Value

Encode a bool argument.

string : String -> Value

Encode a string argument.

bytes : String -> Value

Encode raw bytes as a hex string.

bytes32 : String -> Value

Encode a bytes32 value.

bytesN : String -> Value

Encode a bytesN value (bytes1 through bytes31).

list : (a -> Value) -> List a -> Value

Encode a dynamic array argument.

-- Transfer(address[],uint256[])
Encode.list Encode.address recipients
Encode.list Encode.uint256 amounts
tuple2 : (a -> Value) -> (b -> Value) -> ( a, b ) -> Value

Encode a 2-tuple (struct with two fields).

-- swap(address token, uint256 amount)
Encode.tuple2 Encode.address Encode.uint256 ( tokenAddr, amount )
tuple3 : (a -> Value) -> (b -> Value) -> (c -> Value) -> ( a, b, c ) -> Value

Encode a 3-tuple (struct with three fields).