UNPKG

bigblocks

Version:

Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React

96 lines 2.67 kB
/** * Yours Wallet Provider Integration * * This module provides lazy-loaded integration with Yours Wallet * using the window.yours provider API when available. */ export interface YoursProviderType { connect(): Promise<string>; disconnect(): Promise<void>; sendBsv(outputs: { to: string; amount: number; }[]): Promise<SendBsvResponse>; getBalance(): Promise<Balance>; getPaymentUtxos(): Promise<Utxo[]>; getExchangeRate(): Promise<number>; on(event: "switchAccount" | "signedOut", handler: () => void): void; off(event: "switchAccount" | "signedOut", handler: () => void): void; } export interface Balance { bsv: number; usd: number; } export interface Utxo { txid: string; vout: number; amount: number; script: string; } export interface SendBsvResponse { txid: string; rawtx: string; } declare global { interface Window { yours?: YoursProviderType; } } export declare class YoursWalletProvider { private provider; private isInstalled; private isConnected; private publicKey; private listeners; constructor(); private checkInstallation; private setupEventListeners; isWalletInstalled(): boolean; connect(): Promise<{ success: boolean; publicKey?: string; error?: string; }>; disconnect(): Promise<void>; getPublicKey(): string | null; isWalletConnected(): boolean; getBalance(): Promise<Balance | null>; on(event: "connected" | "disconnected", handler: () => void): void; off(event: "connected" | "disconnected", handler: () => void): void; private emit; } export declare function useYoursWallet(): { isInstalled: boolean; isConnected: boolean; publicKey: string | null; balance: Balance | null; connect: () => Promise<{ success: boolean; publicKey?: string; error?: string; }>; disconnect: () => Promise<void>; refreshBalance: () => Promise<void>; provider: YoursWalletProvider; }; export declare function createYoursAuthHandler(): Promise<{ success: boolean; encryptedBackup?: string; idKey?: string; error?: string; oauthToken?: string; profile?: { address: string; publicKey: string; balance?: { bsv: number; usd: number; }; }; }>; export interface YoursInstallPromptProps { onInstalled?: () => void; className?: string; } export declare function YoursInstallPrompt({ onInstalled, className, }: YoursInstallPromptProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=yours-wallet-provider.d.ts.map