cmditch / elm-ethereum / Eth.Abi.Decode

Decode RPC Responses

)

Primitives


type AbiDecoder a

uint : AbiDecoder BigInt

int : AbiDecoder BigInt

bool : AbiDecoder Basics.Bool

address : AbiDecoder Eth.Types.Address

string : AbiDecoder String

Bytes

staticBytes : Basics.Int -> AbiDecoder Internal.Types.Hex

dynamicBytes : AbiDecoder Internal.Types.Hex

Arrays

staticArray : Basics.Int -> AbiDecoder a -> AbiDecoder (List a)

Decode Statically Sized Arrays

staticArray 10 uint == uint256 [ 10 ]

dynamicArray : AbiDecoder a -> AbiDecoder (List a)

Decode Dynamically Sized Arrays

Run Decoders

abiDecode : a -> AbiDecoder a

Similar to Json.Decode.succeed, or pure in Haskell

andMap : AbiDecoder a -> AbiDecoder (a -> b) -> AbiDecoder b

toElmDecoder : AbiDecoder a -> Json.Decode.Decoder a

fromString : AbiDecoder a -> String -> Result String a

Events/Logs

topic : Basics.Int -> AbiDecoder a -> Json.Decode.Decoder a

Useful for decoding data withing events/logs.

data : Basics.Int -> AbiDecoder a -> Json.Decode.Decoder a

Useful for decoding data withing events/logs.

TODO - Will this work if dynamic types are in the log data? dropBytes might mess with the length of grabbing dyn vals off the Original Tape