import { DepositTerms } from './depositTerms'; /** * Minimal structural wallet for the Pre-PegIn ceremony. Mirrors * `DeriveContextHashCapableWallet` so an app-side wrapper object qualifies * without implementing all of `BitcoinWallet`. All methods are optional so * the capability probe below can run on any wallet. */ export interface PrePeginApprovalWallet { deriveContextHash?(appName: string, context: string): Promise; approveDepositTerms?(terms: DepositTerms): Promise; holdsApprovedDepositTerms?(terms: DepositTerms): Promise; validateDepositTerms?(terms: DepositTerms): Promise; } export interface EnsurePrePeginTermsApprovalParams { wallet: PrePeginApprovalWallet; /** The approved terms — required for approval-capable wallets, ignored (but still txid-checked) otherwise. */ depositTerms: DepositTerms | undefined; /** Funded Pre-PegIn tx hex (0x optional): the funding outpoints AND the txid the terms must match. */ fundedPrePeginTxHex: string; /** x-only depositor pubkey (64 hex, 0x optional) — the identity the PSBT is signed with. */ depositorBtcPubkey: string; } /** * Run the derive → approve ceremony (or a no-op) before a Pre-PegIn signature. * * - Non-approval wallets: no-op, after asserting the terms (if any) match the tx. * - Approval-capable wallets: require terms, assert they match this tx's txid, * derive the vault root over the tx's funding outpoints, then approve. * * Skip fast-path: when `holdsApprovedDepositTerms` reports the byte-equal * intent still live, the ceremony is skipped — it survives everything the * flow does in between (PoP/PegIn signing spend separate device state; * app-babylon-vault `sign_psbt_validate.c` @ 73a57c50). A stale true fails * closed at the signature; the retry then re-runs the full ceremony. * * Otherwise always derives first — the host cannot read device state, so * this path never approves-only. * * @throws If approval-capable but no terms are provided, or the provided terms * are for a different transaction. */ export declare function ensurePrePeginTermsApproval(params: EnsurePrePeginTermsApprovalParams): Promise; //# sourceMappingURL=prePeginApproval.d.ts.map