@aa-simulator/btc-connectkit
Version:
First Account Abstraction Protocol on Bitcoin
42 lines (41 loc) • 1.66 kB
TypeScript
import { SmartAccount } from '@aa-simulator/core';
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>;
getSmartAccountInfo: () => Promise<AccountInfo | undefined>;
updateConnector: (id: string, updates: any) => void;
}
interface ConnectOptions {
evmSupportChainIds: number[];
rpcUrls?: Record<number, string>;
walletOptions?: Omit<WalletOption, 'erc4337' | 'customStyle'> & {
customStyle?: Omit<WalletOption['customStyle'], 'supportChains'>;
};
}
export declare const ConnectProvider: ({ children, options, connectors: initialConnectors, autoConnect, }: {
children: React.ReactNode;
options: ConnectOptions;
connectors: BaseConnector[];
autoConnect?: boolean | undefined;
}) => import("react/jsx-runtime").JSX.Element;
export declare const useConnectProvider: () => GlobalState;
export {};