Interface class

The Interface Class abstracts the encoding and decoding required to interact with contracts on the Ethereum network.

Many of the standards organically evolved along side the Solidity language, which other languages have adopted to remain compatible with existing deployed contracts.

The EVM itself does not understand what the ABI is. It is simply an agreed upon set of formats to encode various types of data which each contract can expect so they can interoperate with each other.

Constructors

Interface(dynamic abi)
Create a new Interface from a JSON string or object representing abi.
factory

Properties

deploy ConstructorFragment<_ConstructorFragmentImpl>
The ConstructorFragment for the interface.
no setter
events Map<String, EventFragment>
All the EventFragment in the interface.
no setter
fragments List<Fragment<_FragmentImpl>>
All the Fragment in the interface.
no setter
functions Map<String, FunctionFragment>
All the FunctionFragment in the interface.
no setter
hashCode int
The hash code for this object.
no setterinherited
impl → _InterfaceImpl
Internal JS Object, should not be used directly.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decodeFunctionResult(String function, String data) List
Returns the decoded values from the result of a call for function (see Specifying Fragments) for the given data.
decodeFunctionResultFromFragment(Fragment<_FragmentImpl> function, String data) List
Returns the decoded values from the result of a call for function (see Specifying Fragments) for the given data.
encodeFilterTopics(String topic, [List values = const []]) List
Returns the encoded topic filter, which can be passed to getLogs for fragment (see Specifying Fragments) for the given values.
encodeFilterTopicsFromFragment(Fragment<_FragmentImpl> topic, [List values = const []]) List
Returns the encoded topic filter, which can be passed to getLogs for fragment (see Specifying Fragments) for the given values.
encodeFunctionData(String function, [List? values]) String
Returns the encoded data, which can be used as the data for a transaction for function (see Specifying Fragments) for the given values.
encodeFunctionDataFromFragment(Fragment<_FragmentImpl> function, [List? values]) String
Returns the encoded data, which can be used as the data for a transaction for function (see Specifying Fragments) for the given values.
format([FormatTypes? type]) → dynamic
Return the formatted Interface.
formatFull() List<String>
Format into FormatTypes.full.
formatJson() String
Format into FormatTypes.json.
formatMinimal() List<String>
Format into FormatTypes.minimal.
getEvent(String event) EventFragment
Returns the FunctionFragment for event.
getEventFromFragment(Fragment<_FragmentImpl> event) EventFragment
Returns the FunctionFragment for event fragment.
getEventTopic(String event) String
Return the topic hash for event.
getFunction(String function) FunctionFragment
Returns the FunctionFragment for function.
getFunctionFromFragment(Fragment<_FragmentImpl> function) FunctionFragment
Returns the FunctionFragment for function fragment.
getSighash(String function) String
Return the sighash (or Function Selector) for function.
getSighashByFragment(Fragment<_FragmentImpl> fragment) String
Return the sighash (or Function Selector) for fragment.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited