UNPKG

@enclavemoney/enclave-wallet-sdk

Version:

A simple enclave wallet SDK for React applications

72 lines (71 loc) 2.33 kB
import { MultiRelayBuyQuoteParams, OutputDetails, BalanceResponse } from "./services/services"; import { WalletConfig } from "./types/theme"; interface SwapParams { fromToken: { tokenAddress: string; amount?: string; chainId: number; }; toToken: { tokenAddress: string; chainId: number; }; } interface TransferParams { inputToken: { symbol?: string; name?: string; address: string; chainId: number; decimals?: number; balance?: string; logoURI?: string; chainIds?: { chainId: number; address: string; }[]; }; inputAmount?: string; recipient: string; } declare class WalletSDK { private modalContainer; private root; private walletSDKKey; private userSession; private config; constructor(walletSDKKey: string, config?: Partial<WalletConfig>); private saveConfigToLocalStorage; private injectStyles; updateConfig(newConfig: Partial<WalletConfig>): void; setTheme(appearance: "light" | "dark"): void; setCornerRadius(cornerRadius: "S" | "M" | "L"): void; setPrimaryColor(primaryColor: string): void; setFontFamily(fontFamily: string): void; setBrandLogo(brandLogo: string): void; setAuthentication(authentication: { social?: string[]; passkey?: boolean; }): void; setShowEnclave(showEnclave: boolean): void; getConfig(): WalletConfig; getTheme(): "light" | "dark"; getCornerRadius(): "S" | "M" | "L"; clearSavedConfig(): void; getMultiRelayBuyQuote(params: MultiRelayBuyQuoteParams): Promise<OutputDetails | string>; setUserSession(session: any): void; getUserCryptoBalance(): Promise<BalanceResponse | null>; getWalletAddress(): any; getUsername(): any; setUsername(username: string | null): void; getUserSession(): any; logout(): void; openWalletModal(swapParams?: SwapParams, transferParams?: TransferParams): void; swap(params: SwapParams): void; close(): void; } export default WalletSDK; export { WalletProvider } from "./components/WalletProvider"; export { useWallet } from "./components/WalletProvider"; export { WalletModal } from "./components/WalletModal"; export type { WalletConfig } from "./types/theme";