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

Method parseError

js/src/static_dependencies/ethers/interface.js:943–951  ·  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)

Source from the content-addressed store, hash-verified

941 * If the matching error cannot be found, returns null.
942 */
943 parseError(data) {
944 const hexData = hexlify(data);
945 const fragment = this.getError(dataSlice(hexData, 0, 4));
946 if (!fragment) {
947 return null;
948 }
949 const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));
950 return new ErrorDescription(fragment, fragment.selector, args);
951 }
952 /**
953 * Creates a new [[Interface]] from the ABI %%value%%.
954 *

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