import { OpenfortError } from '../errors/base.js'; import type { useEthereumBridge } from '../ethereum/OpenfortEthereumBridgeContext.js'; import type { useAuthTransitions } from '../openfort/authTransitionContext.js'; import type { OpenfortCoreContextValue } from '../openfort/CoreOpenfortProvider.js'; import type { AuthSession } from '../shared/utils/authTransitionQueue.js'; type SiweBridge = NonNullable>; type SiweOpenfort = Pick & Pick, 'startAuthenticatedMutation'>; /** Maps SIWE failures to the current consumer-facing message. */ export declare function getSiweErrorMessage(error: unknown, chainName: string | undefined): string; /** Adapts zero- and multi-argument SIWE callbacks to the shared hook callback boundary. */ export declare function notifySiweCallback(callback: ((...args: TArgs) => unknown) | undefined, callbackName: 'onSuccess' | 'onError', ...args: TArgs): void; /** Everything the SIWE flow reads, resolved from the bridge and the caller's overrides. */ type SiweInputs = { address: `0x${string}`; connectorType: string; walletClientType: string; chainId: number; accountChainId: number | undefined; chainName: string | undefined; switchChainAsync: SiweBridge['switchChain']['switchChainAsync'] | undefined; signMessage: NonNullable; }; /** * Resolves the values the SIWE flow needs, or returns the message explaining why * it cannot run. Callers report that message before opening an auth transition, * so a missing parameter never invalidates the current principal. */ export declare function resolveSiweInputs(bridge: SiweBridge | null | undefined, overrides: { address?: `0x${string}`; connectorType?: string; walletClientType?: string; }): SiweInputs | string; /** * Runs the SIWE handshake — switch chain, request a nonce, sign, submit — and * reports the outcome through the callbacks. * * Login and link differ only in which pair of `client.auth` calls they make and * in link's need to run them as authenticated mutations, so both share this body. * The flow never rejects: a failure reaches the consumer through `onError`. */ export declare function runSiweFlow(inputs: SiweInputs, openfort: SiweOpenfort, params: { link: boolean; session: AuthSession; onConnect?: () => void; onError?: (error: string, openfortError?: OpenfortError) => void; onStale?: () => void; }): Promise; export {};