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.Abi.Decode

Helpers to decode contract return values from JSON received through ports from the JS Web3 layer.

address : Decoder Address

Decode an Address return value.

uint256 : Decoder BigInt

Decode a uint256 return value as a BigInt.

int256 : Decoder BigInt

Decode an int256 return value as a BigInt.

bool : Decoder Bool

Decode a bool return value.

string : Decoder String

Decode a string return value.

bytes32 : Decoder String

Decode a bytes32 hex string (e.g. an event topic). Expects a 0x-prefixed 66-character hex string and returns it as-is.

decodeRevertReason : String -> Maybe String

Attempt to decode an EVM revert reason from raw revert data.

Checks for the Error(string) selector 0x08c379a2 and decodes the ABI-encoded string that follows. Returns Nothing if the data is not a standard Error(string) revert.

decodeRevertReason "0x08c379a200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e73756666696369656e742066756e647300000000000000000000000000"
--> Just "Insufficient funds"