import { SparkWalletConnector, SparkWalletConnectorOpts } from '../SparkWalletConnector'; import type { ISparkProvider } from '../../types'; /** * Spark wallet connector implementation using sats-connect library. * * This connector enables integration with any wallet that supports the * sats-connect Spark methods, providing a standardized interface for * Spark Bitcoin operations including address management, balance queries, * message signing, and token transfers. * * @example * ```typescript * const connector = new SparkSatsConnectConnector({ * walletBook, * sparkNetworks * }); * * await connector.connect(); * const address = await connector.getAddress(); * const balance = await connector.getBalance(); * ``` */ export declare class SparkSatsConnectConnector extends SparkWalletConnector { /** Human-readable connector name */ name: string; /** * Creates a new Spark Sats Connect connector * @param opts - Configuration options */ constructor(opts: SparkWalletConnectorOpts); /** * Returns undefined since sats-connect uses a request-based API * rather than a window provider pattern. * * The connector methods directly call sats-connect's request function * instead of delegating to a provider object. * * @returns undefined as no provider object is needed */ getProvider(): ISparkProvider | undefined; /** * Retrieves the current wallet address using sats-connect. * * Requests the Spark address from the connected wallet using the * spark_getAddresses method. * * @returns The wallet address as a string, or undefined if unavailable * @throws Error if the user cancels the request */ getAddress(): Promise; /** * Retrieves the public key for the Spark address. * * @returns The public key as a hex string * @throws Error if the request fails */ private getPublicKey; /** * Retrieves the wallet balance using sats-connect. * * Gets the Spark Bitcoin balance in BTC (converted from satoshis). * * TODO: Add support for returning token balances in addition to BTC balance. * The spark_getBalance method returns tokenBalances which we currently ignore. * * @returns The balance as a string in BTC, or undefined if unavailable * @throws Error if the request fails */ getBalance(): Promise; /** * Signs a message using sats-connect spark_signMessage method. * * @param message - The message to sign or signing request object * @returns The signature as a string, or undefined if signing fails * @throws Error if the request fails or user cancels */ signMessage(message: string | { message: string; isTaproot?: boolean; }): Promise; /** * Transfers Bitcoin to another Spark address using sats-connect. * * @param params - Transfer parameters * @param params.receiverSparkAddress - The recipient's Spark address * @param params.amountSats - Amount to transfer in satoshis * @param params.isTaproot - Whether to use Taproot (currently ignored for sats-connect) * @returns The transaction ID/hash * @throws Error if the transfer fails or user cancels */ transferBitcoin(params: { receiverSparkAddress: string; amountSats: string | number; isTaproot?: boolean; }): Promise; /** * Transfers tokens to another Spark address using sats-connect. * * @param params - Transfer parameters * @param params.tokenPublicKey - The token's identifier (bech32m format) * @param params.receiverSparkAddress - The recipient's Spark address * @param params.tokenAmount - Amount of tokens to transfer * @param params.isTaproot - Whether to use Taproot (currently ignored for sats-connect) * @returns The transaction ID/hash * @throws Error if the transfer fails or user cancels */ transferTokens(params: { tokenPublicKey: string; receiverSparkAddress: string; tokenAmount: number; isTaproot?: boolean; }): Promise; /** * Checks if the Spark wallet is installed in the browser. * * For sats-connect, we check if the library is available since it * doesn't rely on a window provider pattern. * * @returns True if sats-connect is available */ isInstalledOnBrowser(): boolean; }