import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm'; import { Address } from 'viem'; import { RefundPrePeginContext, VaultRefundData } from '../services/refund/buildAndBroadcastRefund'; import { ReconstructPeginParamsResult } from './reconstructPeginParams'; export interface ToRefundInputsOptions { /** * Which sibling of the Pre-PegIn to refund, as an index into the * reconstruction's hashlocks and amounts. Equal to the vault's `htlcVout` * by construction — `PeginManager` asserts `perVault[i].htlcVout === i`. */ htlcVout: number; /** * Depositor BTC pubkey, the same value the reconstruction was run with. * Passed through rather than re-derived so the refund is built against the * key that was actually verified. * * Deliberately NOT narrowed to x-only here. `VaultRefundData.depositorBtcPubkey` * accepts "32 or 33 bytes of hex", and `buildAndBroadcastRefund` narrows it * with `processPublicKeyToXOnly` before it reaches the PSBT builder — so a * wallet's compressed key flows through unchanged, which is what wallets * actually return. Narrowing early would discard the parity byte the * orchestrator's own validation accepts. */ depositorBtcPubkey: string; /** * The vault provider's application entry point. Not recoverable from the * Bitcoin transaction and not part of the verified parameter set — it is a * field of the vault-provider registry row, which is address-keyed and * survives the reorg untouched. */ applicationEntryPoint: Address; /** Funded Pre-PegIn transaction hex, `0x` optional. */ fundedPrePeginTxHex: string; /** Hashlocks indexed by `htlcVout`, as passed to the reconstruction. */ hashlocks: readonly string[]; /** * The Bitcoin network the reconstruction was verified against. An input to * the search rather than an output of it, so it is restated here; passing a * different one would build the refund against a different script tree than * the one that was proven to match. */ network: Network; } export interface RefundInputsFromRecovery { vault: VaultRefundData; context: RefundPrePeginContext; } /** * Project a verified reconstruction into the two shapes * `buildAndBroadcastRefund` injects. * * Every value here comes from a parameter set that has already been * byte-matched against the funded transaction's HTLC outputs, so this is a * projection and not a second validation pass. The orchestrator re-checks the * parts it owns regardless. * * @throws If `htlcVout` does not index the reconstructed batch, or the * hashlock vector disagrees with the reconstructed amounts. */ export declare function toRefundInputs(result: ReconstructPeginParamsResult, options: ToRefundInputsOptions): RefundInputsFromRecovery; //# sourceMappingURL=toRefundInputs.d.ts.map