import type { SolanaAddress } from '@funkit/api-base'; import type { Address } from 'viem'; import { type FunkitUserInfo } from '../consts/funkit'; export declare enum LoginType { Web3 = "web3", Guest = "guest" } /** * Whether externalUserId should be treated as a trusted wallet address. * Currently only Lighter mobile QR flow passes externalUserId as an L1 address. */ export declare function getIsExternalUserIdAddress(apiKey: string, externalUserId: string | undefined): boolean; /** * The session's EVM address: wagmi's connected address, or externalUserId when * that holds a trusted L1 address (Lighter mobile QR). * * See {@link resolveIdentityAddress} for which address represents the user. */ export declare function resolveEvmAddress(address: Address | undefined, externalUserId: string | undefined, isExternalUserIdAddress: boolean): Address | undefined; /** * EVM keeps precedence, so adding a Solana wallet never re-keys a session that * already has an EVM address. */ export declare function resolveIdentityAddress(evmAddress: Address | undefined, solanaAddress: SolanaAddress | undefined): Address | SolanaAddress | undefined; /** * Whether the session counts as logged in. * Web3 only qualifies once wagmi has resolved an address — `connector` is set * as soon as a connection attempt starts (status 'connecting'/'reconnecting'), * before `address` exists, so gating on `loginType` alone would flip this true * while `identityAddress` is still undefined. */ export declare function resolveIsUserLoggedIn(loginType: LoginType, identityAddress: Address | SolanaAddress | undefined, externalUserId: string | undefined): boolean; /** * Resolve the userId for the current session. */ export declare function resolveUserId(identityAddress: Address | SolanaAddress | undefined, externalUserId: string | undefined, apiKey: string, isExternalUserIdAddress: boolean): string; interface BuildUserInfoArgs { address: Address | undefined; solanaAddress: SolanaAddress | undefined; externalUserId: string | undefined; apiKey: string; isExternalUserIdAddress: boolean; loginType: LoginType; connectorName: string | undefined; ensName: string | null | undefined; ensAvatar: string | null | undefined; } /** * Build the FunkitUserInfo for the current session. */ export declare function buildUserInfo({ address, solanaAddress, externalUserId, apiKey, isExternalUserIdAddress, loginType, connectorName, ensName, ensAvatar, }: BuildUserInfoArgs): FunkitUserInfo; export {};