MCPcopy Create free account
hub / github.com/ccxt/ccxt / parseError

Method parseError

ts/src/static_dependencies/ethers/interface.ts:1195–1204  ·  view source on GitHub ↗

* Parses a revert data, finding the matching error and extracts * the parameter values along with other useful error details. * * If the matching error cannot be found, returns null.

(data: BytesLike)

Source from the content-addressed store, hash-verified

1193 * If the matching error cannot be found, returns null.
1194 */
1195 parseError(data: BytesLike): null | ErrorDescription {
1196 const hexData = hexlify(data);
1197
1198 const fragment = this.getError(dataSlice(hexData, 0, 4));
1199
1200 if (!fragment) { return null; }
1201
1202 const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));
1203 return new ErrorDescription(fragment, fragment.selector, args);
1204 }
1205
1206 /**
1207 * Creates a new [[Interface]] from the ABI %%value%%.

Callers

nothing calls this directly

Calls 4

getErrorMethod · 0.95
hexlifyFunction · 0.90
dataSliceFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected