ethers.js/docs/v5/api/utils/abi/coder
2020-06-12 19:21:37 -04:00
..
index.html Updated docs. 2020-06-12 19:21:37 -04:00
README.md Updated docs and added redirects. 2020-06-12 03:38:55 -04:00

Documentation: html

AbiCoder

Creating Instance

**new **ethers . utils . AbiCoder( [ coerceFunc ] )

Create a new AbiCoder instance, which will call the coerceFunc on every decode, where the result of the call will be used in the Result.

The function signature is (type, value), where the type is the string describing the type and the value is the processed value from the underlying Coder.

If the callback throws, the Result will contain a property that when accessed will throw, allowing for higher level libraries to recover from data errors.

ethers . utils . defaultAbiCoder => AbiCoder

An AbiCoder created when the library is imported which is used by the Interface.

Coding Methods

abiCoder . encode( types , values ) => string< DataHexString >

Encode the array values according the array of types, each of which may be a string or a ParamType.

abiCoder . decode( types , data ) => Result

Decode the data according to the array of types, each of which may be a string or ParamType.