* 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)
| 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%%. |