import { TransactionError } from "@solana/web3.js"; export declare class GlamError extends Error { message: string; rawError: TransactionError | null | undefined; programLogs?: string[]; constructor(message: string, rawError: TransactionError | null | undefined, programLogs?: string[]); } /** * Extract the program ID that failed from transaction logs. * Looks for "Program failed:" log lines and returns the first match, * which corresponds to the innermost CPI that produced the root cause. */ export declare function extractFailedProgramId(logs?: string[] | null): string | undefined; /** * Resolve a custom program error code to a human-readable message. * When programId is provided, matches against the specific program's IDL * to avoid collisions between programs using the same error code range. * Accepts either a decimal number or a hex string (e.g. "0xBB80"). */ export declare function resolveErrorCode(code: number | string, programId?: string, staging?: boolean): string | undefined; /** * Parse the error message from a transaction error. * Environment-agnostic: handles Anchor errors, program error codes, * simulation failures, and common RPC/network errors. * * Callers (GUI, CLI) can handle environment-specific error types * (e.g. WalletSignTransactionError) before delegating to this function. */ export declare function parseTxError(error: any): string;