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

48 lines (47 loc) 1.68 kB
import { BitcoinRpcClient } from "./rpc"; import { FinalizedPSBT } from "../types/bitcoin"; import { CaravanWalletConfig } from "../types/caravan"; /** * Service for handling PSBTs (Partially Signed Bitcoin Transactions) */ export declare class TransactionService { private readonly rpc; private readonly network; constructor(rpc: BitcoinRpcClient, isRegtest?: boolean); /** * Create a new PSBT from a wallet */ createPSBT(wallet: string, outputs: Record<string, number>[], options?: { rbf?: boolean; feeRate?: number; includeWatching?: boolean; }): Promise<string>; /** * Decode a PSBT to get detailed information */ decodePSBT(psbtBase64: string): Promise<any>; /** * Process a PSBT with a wallet (sign inputs that the wallet can sign) */ processPSBT(wallet: string, psbtBase64: string): Promise<string>; /** * Finalize a PSBT that has all required signatures */ finalizePSBT(psbtBase64: string): Promise<FinalizedPSBT>; /** * Broadcast a finalized transaction to the network */ broadcastTransaction(txHex: string): Promise<string>; /** * Sign a PSBT with a private key in WIF format */ signPSBTWithPrivateKey(psbtBase64: string, privateKeyWIF: string): Promise<string>; /** * Extract signatures from a PSBT for Caravan */ extractSignaturesForCaravan(psbtBase64: string, privateKeyWIF: string): Promise<any>; /** * Try to detect which Caravan wallet a PSBT is for */ detectCaravanWalletForPSBT(psbtBase64: string, caravanWallets: CaravanWalletConfig[]): Promise<CaravanWalletConfig | null>; }