import type { AuthState, ChallengeResponse, SessionRefreshResponse } from "@0xmonaco/types"; import type { AuthenticationStatus } from "../../provider"; export interface UseAuthState { /** Current authentication status */ authenticationStatus: AuthenticationStatus; } export interface UseAuthReturn extends UseAuthState { /** * Complete authentication flow. Generates a session keypair, has the wallet * authorize it, and returns the AuthState (including the session keypair). * @param options - Optional configuration * @param options.connectWebSocket - Auto-connect all authenticated WebSocket channels after login (currently Orders) (default: false) */ login: (options?: { connectWebSocket?: boolean; }) => Promise; /** Logout user and clear state. Revokes the session on the server. */ logout: () => Promise; /** Refresh the current session, extending its expiry. */ refreshAuth: () => Promise; /** Sign a challenge message with the connected wallet. */ signChallenge: (message: string) => Promise; /** * Create an authentication challenge for the given address, binding the * provided session public key. Advanced/manual flow — most callers should * use `login`/`authenticate`, which manage the keypair for you. */ createChallenge: (address: string, sessionPublicKey: string) => Promise; /** Complete authentication with signature. Returns the AuthState. */ authenticate: () => Promise; /** Extend the current session's expiry (signed with the active session key). */ refreshSession: () => Promise; /** Revoke the current session on the server. */ revokeSession: () => Promise; }