/** * Redact secrets from a free-form string (error messages, URLs, log lines). * * @example * sanitizeString('Request failed: https://api.example.com/v1?api_key=abc123') * // → 'Request failed: https://api.example.com/v1?api_key=[REDACTED]' */ export declare function sanitizeString(input: string): string; /** * Return a redacted clone of `err`. Preserves prototype (so `instanceof` checks * keep working), `name`, all own properties (`code`, `status`, `correlationId`, * …), and `cause`. Subclass constructors are NOT invoked — they may have * positional signatures (`new AugustAuthError(code, message, opts)`) that would * misalign if we naively passed the sanitized message as the first arg. * * Every write onto the clone goes through `Object.defineProperty` rather than * assignment: the clone inherits `err`'s prototype, and some libraries make * properties read-only there — `@solana/web3.js` defines `name` as non-writable * on its error classes (`TransactionExpiredTimeoutError`, …). Assigning to an * inherited non-writable property throws a `TypeError` in strict mode, which * would escape from inside a caller's `catch` (e.g. `Logger.log.error`) and * replace the error being reported. Defining an own property shadows the * prototype's instead; each one is writable, configurable and enumerable, * exactly as the plain assignment used to create it. * * @param err - Any caught value; non-`Error` values are returned unchanged. * @returns A redacted clone for `Error` instances, otherwise `err` itself. */ export declare function sanitizeError(err: unknown): unknown; /** Sanitize arbitrary log input (strings, errors, objects, arrays, primitives). */ export declare function sanitizeForLogging(input: unknown, depth?: number): unknown; /** * Compute a value-free structural signature for a list of arguments — used * as the `sdk.argShape` Sentry tag so dashboards can count which overload of * a method partners call without ingesting wallet addresses or other PII. * * Tokens: primitives keep their `typeof` name; 0x-prefixed strings narrow to * `'address'` / `'tx-hash'` / `'hex'`; arrays render as `'array()'`; * objects render as `'options{}'`, capped at 12 keys. * * @param args - The `arguments` array of an instrumented method. * @returns Shape tokens, one per arg, in argument order. * * @example * computeArgShape(['0xabc…ef', { vault: '0x…', chainId: 1 }]) * // → ['address', 'options{chainId,vault}'] */ export declare function computeArgShape(args: unknown[]): string[]; /** * Sanitize method arguments for safe logging to Sentry. * Removes sensitive data and truncates large values. */ export declare function sanitizeArgs(args: unknown[]): Record; /** * Recursively sanitize an object, removing sensitive keys. */ export declare function sanitizeObject(obj: Record, depth?: number): Record;