UNPKG

@particle-network/btc-connectkit

Version:

First Account Abstraction Protocol on Bitcoin

46 lines (45 loc) 1.79 kB
import { SmartAccount, type AAOptions, type AccountContract } from '@particle-network/aa'; import { type WalletOption } from '@particle-network/wallet'; import { type BaseConnector } from '../connector/base'; import type { AccountInfo } from '../types/accountInfo'; interface GlobalState { connectorId?: string; setConnectorId: (connectorId?: string) => void; connector?: BaseConnector; connectors: BaseConnector[]; openConnectModal: () => void; closeConnectModal: () => void; accounts: string[]; provider: any; disconnect: () => void; getPublicKey: () => Promise<string>; signMessage: (message: string) => Promise<string>; evmAccount?: string; smartAccount?: SmartAccount; switchNetwork: (network: 'livenet' | 'testnet') => Promise<void>; getNetwork: () => Promise<'livenet' | 'testnet'>; sendBitcoin: (toAddress: string, satoshis: number, options?: { feeRate: number; }) => Promise<string>; accountContract: AccountContract; setAccountContract: (accountContract: AccountContract) => void; getSmartAccountInfo: () => Promise<AccountInfo | undefined>; } interface ConnectOptions { projectId: string; clientKey: string; appId: string; aaOptions: AAOptions; rpcUrls?: Record<number, string>; walletOptions?: Omit<WalletOption, 'erc4337' | 'customStyle'> & { customStyle?: Omit<WalletOption['customStyle'], 'supportChains'>; }; } export declare const ConnectProvider: ({ children, options, connectors, autoConnect, }: { children: React.ReactNode; options: ConnectOptions; connectors: BaseConnector[]; autoConnect?: boolean | undefined; }) => import("react/jsx-runtime").JSX.Element; export declare const useConnectProvider: () => GlobalState; export {};