UNPKG

eros-sdk-react

Version:

eros sdk

429 lines (425 loc) 11.7 kB
import { PropsWithChildren, CSSProperties, ReactNode } from 'react'; import { UseQueryOptions } from '@tanstack/react-query/src/types'; interface AuthParams { AppId: string; AppClientId: string; UserId: string; AccessToken: string; Address?: string; } interface EmbeddedWalletsParams { Url: string; } declare enum ChainType { Ethereum = "ethereum", Solana = "solana" } declare enum RecoveryType { Base = "base_generated_recovery_key", UserPasscode = "user_passcode_recovery_key" } type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegram' | 'linkedin' | 'facebook' | 'youtube' | 'kakao'; type WalletType = 'evm' | 'sol' | 'tron' | 'btc' | 'ton'; type LoginMethodType = WalletType | 'email' | ISocialLoginMethod; type CEXType = "Gate" | "Coinbase" | "Kucoin" | 'Bitget' | 'OKX' | 'Bybit' | 'Binance'; type OtherLoginMethodType = 'email' | ISocialLoginMethod; type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod; type IEnvName = 'main' | 'dev' | 'test'; type IEnvConfigType = { endpoints: { back: string; auth: string; }; }; type ILoginWalletReq = { domain: string; statement: string; address: string; chainId: number; version: string; uri: string; nonce: string; issuedAt?: string; }; type IMatchEvents = { onLogin?: (data: { token: string; did: string; }) => void; onLogout?: () => void; onBind?: (data: { type: string; }) => void; }; type BindWalletParam = { type: string; address: string; signature: any; message: string; connector_type: string; wallet_client_type: string; }; type OverviewInfo = { score: number; total_assets: number; wallets: number; followers: number; sbt: number; is_kyc: boolean; is_poh: boolean; mid: string; user_identity: string; identities: { [key: string]: string; }; did: string; address: string; username?: string; max_level: number; user_level: number; recover_type: `${RecoveryType}`; user_fried_total: number; }; type AnyObject = { [key: string]: any; }; type ThemeType = { modal: { header: CSSProperties; input: CSSProperties; back: CSSProperties; close: CSSProperties; content: CSSProperties; overlay: CSSProperties; error: CSSProperties; }; email: { addressInput: CSSProperties; address: CSSProperties; codeBox: CSSProperties; codeInput: CSSProperties; codeButton: CSSProperties; codeButtonDisabled: CSSProperties; }; login: { box: CSSProperties; item: CSSProperties; itemIcon: CSSProperties; itemName: CSSProperties; content: CSSProperties; arrow: CSSProperties; }; button: { default: CSSProperties; disabled: CSSProperties; line: CSSProperties; }; user: { item: CSSProperties; value: CSSProperties; }; }; type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; }; type WalletReceiveMessageType = { source: 'match-wallet'; method: string; data: any; status: 'success' | 'failed'; messageId: string; version: number; }; type MessageType = { method: string; data: any; }; type IconProps = { color?: string; size?: number | string; width?: number | string; height?: number | string; style?: CSSProperties; className?: string; onClick?: (e?: any) => void; }; type ModalProps = PropsWithChildren & { isOpen: boolean; width?: number; className?: string; zIndex?: number; }; type ModalWithHeaderProps = ModalProps & { onBack?: () => void; onClose?: () => void; title?: ReactNode; showClose?: boolean; showBorder?: boolean; }; type InputProps = { placeholder?: string; value?: string; onChange?: (e?: any) => void; disabled?: boolean; readonly?: boolean; type?: string; maxLength?: number; className?: string; after?: React.ReactNode; showLength?: boolean; showClear?: boolean; rows?: number; maxRows?: number; }; type LoginBoxProps = { methods?: OtherLoginMethodType[]; inModal?: boolean; recommendMethods?: RecommendLoginMethodType[]; walletMethods?: WalletType[]; }; type LoginPanelProps = { header?: React.ReactNode; onClose?: () => void; } & LoginBoxProps; type LoginModalProps = LoginPanelProps & ModalProps; type EmailModalProps = ModalProps & { onClose?: () => void; onBack?: () => void; onLogin?: () => void; }; type ButtonProps = { size?: 'sm' | 'df' | 'lg'; type?: "button" | "submit" | "reset"; rounded?: boolean; block?: boolean; disabled?: boolean; loading?: boolean; children?: React.ReactNode; onClick?: () => void; highlight?: boolean; style?: CSSProperties; className?: string; }; type BindItemType = { type: string; type_sort: string; platform_name: string; platform_id: number; platform_uid: string; platform_nickname: string; platform_status: number; }; type PohItemType = { user_id: number; poh_market_id: number; image_type: string; category: string; name: string; app_id: string; schema_id: string; active: boolean; }; type BindInfoType = { progress_count: number; progress_current: number; total_assets: number; wallet_count: number; wallet_current: number; cex_count: number; cex_current: number; social_count: number; social_current: number; others_count: number; others_current: number; }; type PohZkpassParams = { taskId: string; schemaId: string; publicFields: any; allocatorAddress: string; publicFieldsHash: string; allocatorSignature: string; uHash: string; validatorAddress: string; validatorSignature: string; }; type PopoverPositionType = "center" | "left" | "right"; type PopoverTypeType = "hover" | "click"; type PopoverProps = PropsWithChildren & { position?: PopoverPositionType; type?: PopoverTypeType; content: ReactNode; className?: string; gap?: number | string; }; type UserPopoverProps = Omit<PopoverProps, 'content'>; type LocaleType = "en" | "zh" | "tw" | "fr" | "ja" | "ko" | "vi" | "es" | "pt"; type WalletConfigType = { type: "Base" | "UserPasscode"; }; type DrawerProps = PropsWithChildren & { showClose?: boolean; onClose?: () => void; isOpen: boolean; title?: React.ReactNode; zIndex?: number; onBack?: () => void; }; type WalletPanelProps = DrawerProps & { title?: React.ReactNode; drawerTitleVisible?: boolean; }; type AppConfigType = { appid: string; app_name: string; app_icon?: string; platform: LoginMethodType[]; }; type UIProps = { style?: CSSProperties; className?: string; onClick?: (e?: any) => void; }; type UserChainType = { id: number; name: string; nativeCurrency: { name: string; symbol: string; decimals: number; icon: string; }; rpcUrls: { default: { http: string[]; }; }; blockExplorers: { default: { name: string; url: string; apiUrl: string; }; }; iconUrl: string; contracts: { multicall3: { address: `0x${string}`; }; }; }; interface UserTransactionNextPageParams { block_number: number; fee: string; hash: string; index: number; inserted_at: string; items_count: number; limit: number; offset: number; value: string; } type Hash = `0x${string}`; type Address = `0x${string}`; type UserTransactionType = { amount: string; block_number: string; from: Address; hash: Hash; input: Hash; receive: string; source: "auto" | "matchain"; timestamp: string; to: Address; value: string; extra: { asset: string; decodedInput: any; has_error_in_internal_transactions: boolean; name: string; receipt_status: number; result: string; status: string; }; }; type UserTransactionRecordType = UserTransactionType & { symbol: string; decimals: number; }; type UserAssetToken = { symbol: string; name: string; balance: number; price: number; chain_id: string; address: string; decimals: string; icon: string; price_change_24h: number; }; type UserImportTokenType = { chain_id: string; symbol: string; address: string; decimals: number; }; type WalletAssetType = { chain_id: string; chain_name: string; symbol: string; name: string; balance: number; price: number; price_change_24h: number; address: string; decimals: string; icon: string; }; type MetaPageType<T> = { meta: { page_num: number; page_size: number; total: number; }; items: T; }; type WalletChainType = { chain_id: number; chain_name: string; chain_icon: string; chain_full_name: string; chain_type: string; }; type WalletNFTType = { token_address: string; token_id: string; token_uri: string; amount: string; owner_of: string; name: string; symbol: string; blockchain: string; chain_id: string; }; type WalletAssetMergeType = { chain_id: string; chain_name?: string; name?: string; symbol: string; balance?: number; price?: number; address: string; decimals: string; icon?: string; price_change_24h?: number; isAuto?: boolean; isCustom?: boolean; value?: number; balanceValue?: string; }; type useMatchWalletAssetsProps = { importTokenOptions?: Partial<Omit<UseQueryOptions<UserImportTokenType[]>, 'queryKey' | 'queryFn'>>; assetListOptions?: Partial<Omit<UseQueryOptions<UserAssetToken[]>, 'queryKey' | 'queryFn'>>; }; type WalletStatusType = 'error' | 'success' | 'nonce' | 'signer' | 'connecting' | 'start'; export { RecoveryType as $, type Address as A, type ButtonProps as B, type CEXType as C, type DrawerProps as D, type EmailModalProps as E, type BindItemType as F, type BindInfoType as G, type Hash as H, type IMatchEvents as I, type PohItemType as J, type WalletChainType as K, type LocaleType as L, type ModalWithHeaderProps as M, type WalletNFTType as N, type OtherLoginMethodType as O, type PopoverPositionType as P, type AppConfigType as Q, type RecommendLoginMethodType as R, type AuthParams as S, type BindWalletParam as T, type UIProps as U, type DeepPartial as V, type WalletConfigType as W, type EmbeddedWalletsParams as X, type IEnvName as Y, type ILoginWalletReq as Z, type MessageType as _, type IEnvConfigType as a, type ThemeType as a0, type UserPopoverProps as a1, type UserTransactionRecordType as a2, type WalletReceiveMessageType as a3, type WalletStatusType as a4, type LoginBoxProps as b, type WalletType as c, type PopoverTypeType as d, type LoginPanelProps as e, type LoginModalProps as f, type WalletAssetMergeType as g, type WalletPanelProps as h, type InputProps as i, type ModalProps as j, type PopoverProps as k, type ISocialLoginMethod as l, type OverviewInfo as m, type LoginMethodType as n, ChainType as o, type UserChainType as p, type AnyObject as q, type UserTransactionType as r, type UserImportTokenType as s, type UserAssetToken as t, type useMatchWalletAssetsProps as u, type IconProps as v, type PohZkpassParams as w, type UserTransactionNextPageParams as x, type WalletAssetType as y, type MetaPageType as z };