Skip to main content

TransactionRevertWithCustomError <ReceiptType>

This error is used when a transaction to a smart contract fails and a custom user error (https://blog.soliditylang.org/2021/04/21/custom-errors/) is able to be parsed from the revert reason

Hierarchy

Index

Constructors

publicconstructor

  • new TransactionRevertWithCustomError<ReceiptType>(reason: string, customErrorName: string, customErrorDecodedSignature: string, customErrorArguments: Record<string, unknown>, signature?: string, receipt?: ReceiptType, data?: string): TransactionRevertWithCustomError<ReceiptType>
  • Type parameters

    Parameters

    • reason: string
    • customErrorName: string
    • customErrorDecodedSignature: string
    • customErrorArguments: Record<string, unknown>
    • optionalsignature: string
    • optionalreceipt: ReceiptType
    • optionaldata: string

    Returns TransactionRevertWithCustomError<ReceiptType>

Properties

publiccause

cause: undefined | Error

publiccode

code: number = ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR

publiccustomErrorArguments

customErrorArguments: Record<string, unknown>

publiccustomErrorDecodedSignature

customErrorDecodedSignature: string

publiccustomErrorName

customErrorName: string

publicoptionaldata

data?: string

publicreadonlyname

name: string

publicreason

reason: string

publicoptionalreceipt

receipt?: ReceiptType

publicoptionalsignature

signature?: string

publicstack

stack: undefined | string

Accessors

publicinnerError

  • get innerError(): undefined | Error | Error[]
  • set innerError(cause: undefined | Error | Error[]): void
  • @deprecated

    Use the cause property instead.


    Returns undefined | Error | Error[]

  • @deprecated

    Use the cause property instead.


    Parameters

    • cause: undefined | Error | Error[]

    Returns void

Methods

publictoJSON

  • toJSON(): { cause: undefined | Error; code: number; customErrorArguments: Record<string, unknown>; customErrorDecodedSignature: string; customErrorName: string; data: undefined | string; innerError: undefined | Error; message: string; name: string; reason: string; receipt: undefined | ReceiptType; signature: undefined | string }
  • Returns { cause: undefined | Error; code: number; customErrorArguments: Record<string, unknown>; customErrorDecodedSignature: string; customErrorName: string; data: undefined | string; innerError: undefined | Error; message: string; name: string; reason: string; receipt: undefined | ReceiptType; signature: undefined | string }

    • cause: undefined | Error
    • code: number
    • customErrorArguments: Record<string, unknown>
    • customErrorDecodedSignature: string
    • customErrorName: string
    • data: undefined | string
    • innerError: undefined | Error
    • message: string
    • name: string
    • reason: string
    • receipt: undefined | ReceiptType
    • signature: undefined | string

publicstaticconvertToString

  • convertToString(value: unknown, unquotValue?: boolean): string
  • Parameters

    • value: unknown
    • unquotValue: boolean = false

    Returns string