The AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.
Decode the ABI data as the types into values.
If loose decoding is enabled, then strict padding is not enforced. Some older versions of Solidity incorrectly
padded event data emitted from external
functions.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types. |
data | BytesLike | The ABI data to decode. |
loose ? | boolean | Enable loose decoding. Default is false |
The decoded values.
Encode the values as the specified types into ABI data.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types. |
values | readonly any [] | Array of values to encode. |
string
The encoded data in hexadecimal format.
Get the default values for the given types. For example, a uint
is by default 0
and bool
is by default
false
.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types to get default values for. |
The default values corresponding to the given types.
Returns the shared singleton instance of a default AbiCoder.
On the first call, the instance is created internally.
The default ABI coder instance.
Returns a quais-compatible CallExceptionError for the given result data.
Parameter | Type | Description |
---|---|---|
action | CallExceptionAction | The action that triggered the exception. |
tx | object | The transaction information. |
tx.data ? | string | - |
tx.from ? | null | string | - |
tx.to ? | null | string | - |
data | null | BytesLike | The data associated with the call exception. |
The corresponding call exception error.
The AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.
Decode the ABI data as the types into values.
If loose decoding is enabled, then strict padding is not enforced. Some older versions of Solidity incorrectly
padded event data emitted from external
functions.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types. |
data | BytesLike | The ABI data to decode. |
loose ? | boolean | Enable loose decoding. Default is false |
The decoded values.
Encode the values as the specified types into ABI data.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types. |
values | readonly any [] | Array of values to encode. |
string
The encoded data in hexadecimal format.
Get the default values for the given types. For example, a uint
is by default 0
and bool
is by default
false
.
Parameter | Type | Description |
---|---|---|
types | readonly (string | ParamType )[] | Array of parameter types to get default values for. |
The default values corresponding to the given types.
Returns the shared singleton instance of a default AbiCoder.
On the first call, the instance is created internally.
The default ABI coder instance.
Returns a quais-compatible CallExceptionError for the given result data.
Parameter | Type | Description |
---|---|---|
action | CallExceptionAction | The action that triggered the exception. |
tx | object | The transaction information. |
tx.data ? | string | - |
tx.from ? | null | string | - |
tx.to ? | null | string | - |
data | null | BytesLike | The data associated with the call exception. |
The corresponding call exception error.