cmditch/elm-ethereum/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Abi.Decode

Decode RPC Responses

)

Primitives

type AbiDecoder a
uint : AbiDecoder BigInt
int : AbiDecoder BigInt
bool : AbiDecoder Bool
address : AbiDecoder Address
string : AbiDecoder String

Bytes

staticBytes : Int -> AbiDecoder String
dynamicBytes : AbiDecoder String

Arrays

staticArray : 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

dynamicArray address == address[]

Special

ipfsHash : AbiDecoder IPFSHash

Decodes bytes32 into IPFS Hash (assuming use of 32 byte sha256) Not IPFS future proof. See https://ethereum.stackexchange.com/questions/17094/how-to-store-ipfs-hash-using-bytes

Run Decoders

abiDecode : a -> AbiDecoder a

Similar to Json.Decode.Pipeline.decode also a synonym for Json.Decode.succeed

andMap : AbiDecoder a -> AbiDecoder (a -> b) -> AbiDecoder b
toElmDecoder : AbiDecoder a -> Decoder a
toElmDecoderWithDebug : String -> AbiDecoder a -> Decoder a
fromString : AbiDecoder a -> String -> Result String a

Events/Logs

topic : Int -> AbiDecoder a -> Decoder a

Useful for decoding data withing events/logs.

data : Int -> AbiDecoder a -> Decoder a

Useful for decoding data withing events/logs.