/// import React, { FC, PropsWithChildren } from 'react'; import { Web3Client, ConnectResponse, Chain } from '@cxptek/web3client'; import { UseQueryResult } from '@tanstack/react-query'; export { i18n } from '@lingui/core'; declare const AVAILABLE_LANGUAGES: readonly ["en-US", "vi-VN"]; type Languages = (typeof AVAILABLE_LANGUAGES)[number]; type Web3ContextValue = { language: Languages; open: boolean; setOpen: React.Dispatch>; route: string; setRoute: React.Dispatch>; errorMessage: Error$1; connectorId: string; setConnectorId: React.Dispatch>; connectors: Web3Client[]; connect: (id: string) => Promise; account: string | undefined; chainId: number | undefined; chain: Chain | undefined; isConnected: boolean; isDisconnected: boolean; disconnect: () => void; client: Web3Client | undefined; switchChain: (chain: Chain) => Promise; isUnsupported: boolean; web3Auth: boolean; options: Web3ConnectOption; }; type Error$1 = string | React.ReactNode | null; type Web3ConnectOption = { language?: Languages; theme?: 'dark' | 'light' | 'auto'; connectors?: Web3Client[]; enforceSupportedChains?: boolean; }; type Web3ConnectProviderProps = { options: Web3ConnectOption; }; declare const Web3Provider: FC>; declare const useWeb3Context: () => Web3ContextValue; declare enum StatusState { READY = "ready", LOADING = "loading", SUCCESS = "success", REJECTED = "rejected", ERROR = "error" } type Web3AuthSession = { address: string; [propName: string]: string; }; type Web3AuthConfig = { getSignData: (account: string) => Promise; verifyMessage: (account: string, signature: string, nonce: string) => Promise; signOut: () => Promise; getMe: () => Promise; enabled?: boolean; }; type SignData = { nonce: string; message?: string; }; type Web3AuthProviderProps = Web3AuthConfig & { onSignIn?: (data?: Web3AuthSession) => void; onSignOut?: () => void; }; declare const Web3AuthProvider: FC>; type UseWeb3AuthConfig = { onSignIn?: (data?: Web3AuthSession) => void; onSignOut?: () => void; }; 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; }; declare const useWeb3AuthContext: ({ onSignIn, onSignOut }?: UseWeb3AuthConfig) => UseWeb3AuthProps; type ConnectButtonProps = { label?: string; onClick?: (open: () => void) => void; }; declare const ButtonConnect: FC; /** * useConnectors hook. Hekp to get supported connector by chainId and get connector by id. * * @author Tieu Phong * @since 1.2.0 * * @returns {Object} getSupportedConnector, getConnector */ declare const useConnectors: () => { getSupportedConnector: (chainId: number) => Web3Client[]; getConnector: (connectorId: string) => Web3Client; switchConnector: (newConnector: Web3Client) => Promise; }; export { ButtonConnect, type Languages, type SignData, Web3AuthProvider, type Web3AuthSession, Web3Provider, useConnectors, useWeb3AuthContext, useWeb3Context };