/* tslint:disable */
/* eslint-disable */

/* auto-generated by NAPI-RS */

/** Decoded error result returned to JavaScript. */
export interface JsDecodedError {
  /** Error kind: "revert_string" | "custom_error" | "panic" | "raw_revert" | "empty" */
  kind: string
  /** For revert_string: the revert message */
  message?: string
  /** For custom_error: the error name (e.g. "InsufficientBalance") */
  errorName?: string
  /** For custom_error: decoded inputs as JSON string { param: value, ... } */
  inputs?: string
  /** For panic: the panic code as a number */
  panicCode?: number
  /** For panic: human-readable explanation of the panic code */
  panicMeaning?: string
  /** Raw revert data as hex string (always present) */
  rawData: string
  /** 4-byte selector as hex (null if empty or unknown) */
  selector?: string
  /** Human-readable suggestion on how to fix (if known) */
  suggestion?: string
  /** Confidence score 0.0-1.0 (1.0 = certain, <1.0 = ambiguous) */
  confidence: number
}
export declare class EvmErrorDecoder {
  /**
   * Create a new EVM error decoder with the bundled signature registry.
   *
   * The bundled registry includes 500+ known error signatures from:
   * ERC-20, ERC-721, OpenZeppelin, Uniswap V3, Aave, and more.
   */
  constructor()
  /**
   * Decode raw revert data into a structured error.
   *
   * `data` should be a hex string (with or without 0x prefix).
   *
   * Returns a `DecodedError` object with a `kind` field indicating the type:
   * - `"revert_string"` — a `require("message")` revert
   * - `"custom_error"` — a Solidity custom error (0.8.4+)
   * - `"panic"` — a Solidity panic (assert failure, overflow, etc.)
   * - `"raw_revert"` — unrecognized 4-byte selector
   * - `"empty"` — no revert data (out of gas or plain revert())
   */
  decode(data: string): JsDecodedError
  /**
   * Decode with optional transaction context for better error messages.
   *
   * `context` can include the contract address, function name, etc.
   */
  decodeWithContext(data: string, contextJson: string): JsDecodedError
  /** Get the human-readable panic description for a panic code. */
  static panicMeaning(code: number): string
}
