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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AbiCoder(): AbiCoder;
Returns
Section titled “Returns”AbiCoder
Methods
Section titled “Methods”decode()
Section titled “decode()”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.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
types | readonly (string | ParamType )[] |
data | BytesLike |
loose? | boolean |
Returns
Section titled “Returns”encode()
Section titled “encode()”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.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
types | readonly (string | ParamType )[] |
values | readonly any [] |
Returns
Section titled “Returns”string
DataHexstring
getDefaultValue()
Section titled “getDefaultValue()”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
.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
types | readonly (string | ParamType )[] |
Returns
Section titled “Returns”_setDefaultMaxInflation()
Section titled “_setDefaultMaxInflation()”static _setDefaultMaxInflation(value): void;
Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/abi/abi-coder.d.ts:43
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
value | number |
Returns
Section titled “Returns”void
defaultAbiCoder()
Section titled “defaultAbiCoder()”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.
Returns
Section titled “Returns”AbiCoder
getBuiltinCallException()
Section titled “getBuiltinCallException()”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%%.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
action | CallExceptionAction |
tx | { data? : string ; from? : null | string ; to? : null | string ; } |
tx.data? | string |
tx.from? | null | string |
tx.to? | null | string |
data | null | BytesLike |