Skip to content

AbiCoder

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:20

The AbiCoder is a low-level class responsible for encoding JavaScript values into binary data and decoding binary data into JavaScript values.

new AbiCoder(): AbiCoder;

AbiCoder

decode(
types,
data,
loose?): Result;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:42

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.

ParameterType
typesreadonly (string | ParamType)[]
dataBytesLike
loose?boolean

Result


encode(types, values): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:34

Encode the %%values%% as the %%types%% into ABI data.

ParameterType
typesreadonly (string | ParamType)[]
valuesreadonly any[]

string

DataHexstring


getDefaultValue(types): Result;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:28

Get the default values for the given %%types%%.

For example, a uint is by default 0 and bool is by default false.

ParameterType
typesreadonly (string | ParamType)[]

Result


static _setDefaultMaxInflation(value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:43

ParameterType
valuenumber

void


static defaultAbiCoder(): AbiCoder;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:49

Returns the shared singleton instance of a default [[AbiCoder]].

On the first call, the instance is created internally.

AbiCoder


static getBuiltinCallException(
action,
tx,
data): CallExceptionError;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:55

Returns an ethers-compatible [[CallExceptionError]] Error for the given result %%data%% for the [[CallExceptionAction]] %%action%% against the Transaction %%tx%%.

ParameterType
actionCallExceptionAction
tx{ data?: string; from?: null | string; to?: null | string; }
tx.data?string
tx.from?null | string
tx.to?null | string
datanull | BytesLike

CallExceptionError