ExW3.Abi (exw3 v0.6.1) View Source

Link to this section Summary

Functions

Decodes data based on given type signature

Decodes event based on given data and provided signature

Decodes output based on specified functions return signature

Encodes data into Ethereum hex string based on types signature

Encodes input from a method call based on function signature

Encodes data and appends it to the encoded method id

Encodes options into Ethereum JSON RPC hex string

Encodes list of options and returns them as a map

Loads the abi at the file path and reformats it to a map

Loads the bin ar the file path

Returns the 4 character method id based on the hash of the method signature

Returns the type signature of a given function

Link to this section Functions

Link to this function

decode_data(types_signature, data)

View Source

Specs

decode_data(binary(), binary()) :: any()

Decodes data based on given type signature

Link to this function

decode_event(data, signature)

View Source

Specs

decode_event(binary(), binary()) :: any()

Decodes event based on given data and provided signature

Link to this function

decode_output(abi, name, output)

View Source

Specs

decode_output(map(), binary(), binary()) :: list()

Decodes output based on specified functions return signature

Link to this function

encode_data(types_signature, data)

View Source

Specs

encode_data(binary(), list()) :: binary()

Encodes data into Ethereum hex string based on types signature

Link to this function

encode_input(abi, name, input)

View Source

Specs

encode_input(map(), binary(), list()) :: binary()

Encodes input from a method call based on function signature

Link to this function

encode_method_call(abi, name, input)

View Source

Specs

encode_method_call(map(), binary(), list()) :: binary()

Encodes data and appends it to the encoded method id

Specs

encode_option(integer()) :: binary()

Encodes options into Ethereum JSON RPC hex string

Link to this function

encode_options(options, keys)

View Source

Specs

encode_options(map(), list()) :: map()

Encodes list of options and returns them as a map

Specs

load_abi(binary()) :: list() | {:error, atom()}

Loads the abi at the file path and reformats it to a map

Specs

load_bin(binary()) :: binary()

Loads the bin ar the file path

Link to this function

method_signature(abi, name)

View Source

Specs

method_signature(map(), binary()) :: binary()

Returns the 4 character method id based on the hash of the method signature

Link to this function

types_signature(abi, name)

View Source

Specs

types_signature(map(), binary()) :: binary()

Returns the type signature of a given function