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

78 lines (77 loc) 2.16 kB
/** * Test Scenario Service for Caravan-X * Handles loading and applying pre-configured test scenarios */ import { TestScenario } from "../types/config"; import { BitcoinService } from "./bitcoin"; import { CaravanService } from "./caravan"; import { TransactionService } from "./transaction"; import { BitcoinRpcClient } from "./rpc"; export declare class ScenarioService { private readonly bitcoinService; private readonly caravanService; private readonly transactionService; private readonly rpc; private readonly scenariosDir; constructor(bitcoinService: BitcoinService, caravanService: CaravanService, transactionService: TransactionService, rpc: BitcoinRpcClient, scenariosDir: string); /** * Get all available scenarios (built-in + custom) */ listScenarios(): Promise<TestScenario[]>; /** * Get a specific scenario by ID */ getScenario(scenarioId: string): Promise<TestScenario | null>; /** * Apply a test scenario */ applyScenario(scenarioId: string): Promise<void>; /** * Setup blockchain to target height */ private setupBlockchain; /** * Create wallets for the scenario */ private createScenarioWallets; /** * Create a singlesig wallet for the scenario */ private createSinglesigWallet; /** * Create a multisig wallet for the scenario */ private createMultisigWallet; /** * Get xpub from a wallet */ private getXpubFromWallet; /** * Convert address type string to enum */ private getAddressTypeEnum; /** * Fund a wallet */ private fundWallet; /** * Execute transactions for the scenario */ private executeScenarioTransactions; /** * Load custom scenarios from the scenarios directory */ private loadCustomScenarios; /** * Validate scenario structure */ private isValidScenario; /** * Save a custom scenario */ saveScenario(scenario: TestScenario): Promise<void>; /** * Delete a custom scenario */ deleteScenario(scenarioId: string): Promise<void>; }