import type { ChainNamespace } from '@reown/appkit-common'; /** * True when `connectorId` is a Coinbase connector. * * The connector id (not the provider "type") is the reliable signal: it is a * stable `'coinbaseWallet'` / `'coinbaseWalletSDK'` across every adapter and * registration path, whereas the provider type is remapped to `'EXTERNAL'` by * `PresetsUtil.ConnectorTypesMap` on most paths. Matched case-insensitively by * substring to also tolerate the wagmi restore path's uppercased * `connector.type` (`'COINBASEWALLET'`). */ export declare function isCoinbaseConnectorId(connectorId: string | undefined): boolean; /** * EIP-1193 `4100` unauthorized error, matched by code or by the SDK's * `eth_requestAccounts` wording, walking the `cause` chain (viem/provider * wrappers nest the original error) with bounded depth. */ export declare function isUnauthorizedProviderError(err: unknown, depth?: number): boolean; /** * Wrap a Coinbase provider so any signing RPC that fails with `4100` triggers a * one-shot recovery: a single `eth_requestAccounts` re-authorization, an active- * chain re-assert for state-changing calls, then exactly one retry. * * - Non-`4100` failures pass through untouched (no re-auth attempt). * - A rejected re-auth prompt propagates and classifies as a user rejection. * - A still-unauthorized retry fails once (no loop) — the recovery calls the raw * provider, never the wrapper, so it cannot recurse. * * Non-`request` members are delegated to the raw provider bound to the raw * instance, so private class fields and EIP-1193 event emitters keep working. * The wrapper is cached per raw instance so repeated `setProvider` calls with * the same provider return a stable reference (no consumer identity churn). */ export declare function withCoinbaseReauth(provider: T): T; /** * Apply {@link withCoinbaseReauth} to an eip155 Coinbase provider, returning * every other provider untouched. This is the single decision the provider * registration seam (`syncProvider`) needs — keeping the guard here (keyed on * the reliable connector id) rather than in the state setter. */ export declare function maybeWrapCoinbaseProvider(params: { connectorId: string | undefined; chainNamespace: ChainNamespace | undefined; provider: T; }): T;