Skip to main content
注意: 此页面尚未翻译成中文。以下内容为英文原版。
The AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.

Methods

decode()

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.

Parameters

Returns

Result The decoded values.

Source

abi/abi-coder.ts:223

encode()

Encode the values as the specified types into ABI data.

Parameters

Returns

string The encoded data in hexadecimal format.

Source

abi/abi-coder.ts:201

getDefaultValue()

Get the default values for the given types. For example, a uint is by default 0 and bool is by default false.

Parameters

Returns

Result The default values corresponding to the given types.

Source

abi/abi-coder.ts:188

defaultAbiCoder()

Returns the shared singleton instance of a default AbiCoder. On the first call, the instance is created internally.

Returns

AbiCoder The default ABI coder instance.

Source

abi/abi-coder.ts:252

getBuiltinCallException()

Returns a quais-compatible CallExceptionError for the given result data.

Parameters

Returns

CallExceptionError The corresponding call exception error.

Source

abi/abi-coder.ts:267