UNPKG

@ordao/ethers-decode-error

Version:

Decode ethers.js smart contract errors into human-readable messages

20 lines (19 loc) 783 B
import { ErrorFragment, Result } from 'ethers'; import { DecodedError } from '../types'; type ErrorResultFormatterParam = { data: string; reason?: string; args?: Result; fragment?: ErrorFragment; selector?: string; name?: string; }; type ErrorResultFormatter = (params: ErrorResultFormatterParam) => DecodedError; export declare const emptyErrorResult: ErrorResultFormatter; export declare const userRejectErrorResult: ErrorResultFormatter; export declare const revertErrorResult: ErrorResultFormatter; export declare const unknownErrorResult: ErrorResultFormatter; export declare const panicErrorResult: ErrorResultFormatter; export declare const customErrorResult: ErrorResultFormatter; export declare const rpcErrorResult: ErrorResultFormatter; export {};