* 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)
| 1232 | * If the matching error cannot be found, returns null. |
| 1233 | */ |
| 1234 | parseError(data: BytesLike): null | ErrorDescription { |
| 1235 | const hexData = hexlify(data); |
| 1236 | |
| 1237 | const fragment = this.getError(dataSlice(hexData, 0, 4)); |
| 1238 | |
| 1239 | if (!fragment) { return null; } |
| 1240 | |
| 1241 | const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); |
| 1242 | return new ErrorDescription(fragment, fragment.selector, args); |
| 1243 | } |
| 1244 | |
| 1245 | /** |
| 1246 | * Creates a new [[Interface]] from the ABI %%value%%. |