참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.The AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.
Methods
decode()
external functions.
Parameters
| 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 |
Returns
Result
The decoded values.
Source
abi/abi-coder.ts:223encode()
Parameters
| Parameter | Type | Description |
|---|---|---|
types | readonly (string | ParamType)[] | Array of parameter types. |
values | readonly any[] | Array of values to encode. |
Returns
string
The encoded data in hexadecimal format.
Source
abi/abi-coder.ts:201getDefaultValue()
uint is by default 0 and bool is by default
false.
Parameters
| Parameter | Type | Description |
|---|---|---|
types | readonly (string | ParamType)[] | Array of parameter types to get default values for. |
Returns
Result
The default values corresponding to the given types.
Source
abi/abi-coder.ts:188defaultAbiCoder()
Returns
AbiCoder
The default ABI coder instance.
Source
abi/abi-coder.ts:252getBuiltinCallException()
Parameters
| 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. |
Returns
CallExceptionError
The corresponding call exception error.
