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
58 lines (57 loc) • 2.06 kB
TypeScript
import { BitcoinRpcClient } from "./rpc";
import { CaravanWalletConfig, ExtendedPublicKey, AddressType, Network } from "../types/caravan";
/**
* Service for managing Caravan wallets
*/
export declare class CaravanService {
private readonly rpc;
private readonly caravanDir;
private readonly keysDir;
constructor(rpc: BitcoinRpcClient, caravanDir: string, keysDir: string);
/**
* Get the path to the Caravan configuration directory
*/
getCaravanDir(): string;
/**
* Convert BIP32 path from 'h' notation to apostrophe notation
* Example: "m/84h/1h/0h" becomes "m/84'/1'/0'"
*/
convertBip32PathFormat(path: string): string;
/**
* Format a Caravan wallet config for export
* This handles any needed conversions (like BIP32 path format)
*/
formatCaravanConfigForExport(config: CaravanWalletConfig): CaravanWalletConfig;
/**
* List all Caravan wallet configurations
*/
listCaravanWallets(): Promise<CaravanWalletConfig[]>;
/**
* Get a specific Caravan wallet by name
*/
getCaravanWallet(name: string): Promise<CaravanWalletConfig | null>;
/**
* Save a Caravan wallet configuration
*/
saveCaravanWalletConfig(config: CaravanWalletConfig): Promise<string>;
/**
* Create a new Caravan wallet configuration
*/
createCaravanWalletConfig({ name, addressType, network, requiredSigners, totalSigners, extendedPublicKeys, startingAddressIndex, }: {
name: string;
addressType: AddressType;
network: Network;
requiredSigners: number;
totalSigners: number;
extendedPublicKeys: ExtendedPublicKey[];
startingAddressIndex?: number;
}): Promise<CaravanWalletConfig>;
/**
* Create a watch-only wallet for a Caravan wallet configuration
*/
createWatchWalletForCaravan(caravanConfig: CaravanWalletConfig): Promise<string>;
/**
* Build wallet descriptors from a Caravan configuration
*/
private buildDescriptorsFromCaravanConfig;
}