import React, { FC, PropsWithChildren } from 'react'; import { Web3Client } from '@cxptek/web3client'; import { UseQueryResult } from '@tanstack/react-query'; export declare enum StatusState { READY = "ready", LOADING = "loading", SUCCESS = "success", REJECTED = "rejected", ERROR = "error" } export type Web3AuthSession = { address: string; [propName: string]: string; }; export type Web3AuthConfig = { getSignData: (account: string) => Promise; verifyMessage: (account: string, signature: string, nonce: string) => Promise; signOut: () => Promise; getMe: () => Promise; enabled?: boolean; }; export type Web3AuthContextValue = Required & { nonce: string | null; session: UseQueryResult; status: StatusState; signIn: (client: Web3Client) => Promise; resetStatus: () => void; }; export type SignData = { nonce: string; message?: string; }; export declare const Web3AuthContext: React.Context; export type Web3AuthProviderProps = Web3AuthConfig & { onSignIn?: (data?: Web3AuthSession) => void; onSignOut?: () => void; }; declare const Web3AuthProvider: FC>; export type UseWeb3AuthConfig = { onSignIn?: (data?: Web3AuthSession) => void; onSignOut?: () => void; }; export type UseWeb3AuthProps = { isSignedIn: boolean; session?: UseQueryResult; status: StatusState | string; error?: Error | string; isRejected: boolean; isError: boolean; isLoading: boolean; isSuccess: boolean; isReady: boolean; reset: () => void; signIn: (client: Web3Client) => Promise; signOut: () => Promise; }; export declare const useWeb3AuthContext: ({ onSignIn, onSignOut }?: UseWeb3AuthConfig) => UseWeb3AuthProps; export default Web3AuthProvider;