UNPKG

caravan-x

Version:

A terminal-based utility for managing Caravan multisig wallets in regtest mode. This tool simplifies development and testing with Caravan by providing an easy-to-use interface

108 lines (107 loc) 3.57 kB
import { CaravanService } from "../core/caravan"; import { BitcoinService } from "../core/bitcoin"; import { BitcoinRpcClient } from "../core/rpc"; import { TransactionService } from "../core/transaction"; import { CaravanWalletConfig, AddressType } from "../types/caravan"; /** * Commands for managing Caravan multisig wallets */ export declare class MultisigCommands { private readonly caravanService; private readonly bitcoinService; private readonly bitcoinRpcClient; private readonly transactionService; constructor(caravanService: CaravanService, bitcoinService: BitcoinService, bitcoinRpcClient: BitcoinRpcClient, transactionService: TransactionService); /** * List all Caravan wallet configurations */ listCaravanWallets(): Promise<CaravanWalletConfig[]>; /** * Create a new Caravan wallet configuration */ createCaravanWallet(): Promise<CaravanWalletConfig | null>; /** * Spend funds from a Caravan multisig wallet */ spendFromCaravanWallet(): Promise<any | null>; /** * Helper method to check if a wallet was created by this terminal tool */ private isTerminalCreatedWallet; /** * Format a decoded PSBT for display */ private formatPSBTSummary; /** * Get descriptors from a wallet */ private getWalletDescriptors; /** * Import multisig descriptors to watch wallet */ private importMultisigToWatchWallet; /** * Create a test transaction for the multisig wallet */ private createTestTransaction; /** * Create a watch-only wallet for a Caravan configuration */ createWatchWallet(caravanConfig?: CaravanWalletConfig): Promise<string | null>; /** * Show details of a Caravan wallet */ showCaravanWalletDetails(): Promise<CaravanWalletConfig | null>; /** * Fund a Caravan wallet */ fundCaravanWallet(): Promise<any | null>; /** * Sign a Caravan PSBT and generate JSON signature format for reimporting into Caravan */ signCaravanPSBT(): Promise<any | false>; /** * Fixed amount precision for Bitcoin transactions */ private formatBitcoinAmount; /** * Create test transactions with proper amount precision and multisig funding */ private createPrivacyTestTransactions; /** * Create transactions with good privacy (updated with proper amounts) */ private createGoodPrivacyTransactions; /** * Create transactions with moderate privacy (updated with proper amounts) */ private createModeratePrivacyTransactions; /** * Create transactions with bad privacy (updated with proper amounts and address reuse) */ private createBadPrivacyTransactions; /** * Create test multisig wallets with CLI options */ createTestMultisigWalletsWithOptions(options: { baseName: string; privacyLevel: string; addressType: AddressType; requiredSigners: number; totalSigners: number; transactionCount: number; }): Promise<void>; /** * Create a single test wallet using Caravan-compatible descriptors */ private createSingleTestWallet; /** * Create Caravan-compatible descriptors with proper fingerprints and paths */ private createCaravanCompatibleDescriptors; /** * Alternative method: Use the watch wallet's own address generation * This leverages the imported descriptors automatically */ private generateAddressesFromWatchWallet; }