@arkade-os/swap 0.0.10 → 0.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { VHTLC, asset, IWallet, ProvisionedClaimSecret, ProvisionedKey } from '@arkade-os/sdk';
1
+ import { VHTLC, IWallet, ProvisionedClaimSecret, ProvisionedKey, asset } from '@arkade-os/sdk';
2
2
 
3
3
  /** L1 confirmation-depth and reorg margin between dependent timelocks. */
4
4
  declare const ONCHAIN_ORDER_MARGIN_SECONDS: number;
@@ -251,15 +251,23 @@ type RfqRefusalReason = "unsupported_pair" | "unsupported_payload" | "amount_out
251
251
  declare const RFQ_TERMINAL_STATES: readonly ["settled", "refused", "expired", "refunded", "stuck"];
252
252
  /** A refusal from the solver, carrying its closed-set reason. */
253
253
  declare class SwapRefusal extends Error {
254
+ /** Literal-typed so the v2 error taxonomy's union discriminates on `name`
255
+ * — a `string` here collapses the discriminant for every member. Same value
256
+ * the constructor has always set, moved to a field initializer. */
257
+ readonly name = "SwapRefusal";
254
258
  readonly reason: string;
255
259
  readonly rfqId: string | undefined;
256
260
  constructor(reason: string, rfqId?: string);
257
261
  }
258
- /** The solver's address does not match the local derivation. NEVER fund past this. */
262
+ /**
263
+ * The solver's address does not match the local derivation. NEVER fund past
264
+ * this. `derived` is every candidate address tried — more than one when the
265
+ * derivation itself is ambiguous, see {@link verifyLockupAddress}.
266
+ */
259
267
  declare class AddressMismatch extends Error {
260
- readonly derived: string;
268
+ readonly derived: string | string[];
261
269
  readonly quoted: string | undefined;
262
- constructor(derived: string, quoted?: string);
270
+ constructor(derived: string | string[], quoted?: string);
263
271
  }
264
272
  /** A fresh client-chosen negotiation id: 32 random bytes, lowercase hex. */
265
273
  declare const newRfqId: () => string;
@@ -293,7 +301,7 @@ interface RfqStatus {
293
301
  /** The rfq_request for the lightning send profile. A BOLT11 profile is always
294
302
  * exact-out: the invoice fixes the amount, so none is restated here.
295
303
  * `senderPubkey` is the trader's own key for the VHTLC's sender-side leaves
296
- * (see {@link lightningSendVtxoScript}) — required, never sent anywhere else,
304
+ * (see {@link lightningSendContract}) — required, never sent anywhere else,
297
305
  * never trusted by the solver as anything but a pubkey to bind into the
298
306
  * script. On the wire it's `client_refund_pubkey` (the payload schemas are
299
307
  * public at https://docs.arkadeos.com/intents/reference/rfq — the solver's schema
@@ -323,9 +331,24 @@ declare const arkadeSwapRequest: (input: {
323
331
  * 90 because the refund CLTV matures against median-time-past (BIP-113),
324
332
  * which lags wall clock by ~1h — a smaller wall-clock margin is no margin. */
325
333
  declare const MIN_HEADROOM_SECONDS: number;
326
- /** Compare-only check of the solver's address against YOUR derivation.
327
- * Throws {@link AddressMismatch}; returns the address so calls chain. */
328
- declare const verifyLockupAddress: (quote: RfqQuote, derivedAddress: string) => string;
334
+ /**
335
+ * Compare-only check of the solver's address against YOUR OWN derivation(s)
336
+ * — never extends trust, only narrows it.
337
+ *
338
+ * `derivedAddress` may be a single address or an array of candidates. Pass an
339
+ * array when your own derivation is ambiguous — as it is for the covenant
340
+ * lockups while solvers roll out the timelocked non-interactive refund leaf:
341
+ * nothing on the wire says whether a given quote's covenant carries it (the
342
+ * shape is fixed by the solver's own build, not negotiated per quote), so the
343
+ * only safe move is to derive BOTH shapes and accept whichever one the quote's
344
+ * own `lockup_address` matches. This loses no security: every candidate shape
345
+ * pins the refund to the trader's own refund destination, so a solver gains
346
+ * nothing by choosing which one to quote.
347
+ *
348
+ * Throws {@link AddressMismatch} only when NONE of the candidates match.
349
+ * Returns the address that matched, so calls chain exactly as before.
350
+ */
351
+ declare const verifyLockupAddress: (quote: RfqQuote, derivedAddress: string | string[]) => string;
329
352
  /** The user's gates, checked immediately before funding — never at quote
330
353
  * time. Throws with a stable `reason` property. `invoiceExpiresAt` applies to
331
354
  * BOLT11 profiles only; `onchain` adds the L1-HTLC gates (§ guardrails of the
@@ -397,7 +420,7 @@ declare const SOLO_REFUND_HEADROOM_SECONDS: number;
397
420
  * exit delay exactly as the reference solver derives it — both sides read the
398
421
  * SAME server, so the derivation (not a quote field) is what keeps the two
399
422
  * scripts identical. */
400
- declare const unilateralClaimDelay: (serverExitDelaySeconds: number) => number;
423
+ declare const unilateralClaimDelay: (operatorExitDelaySeconds: number) => number;
401
424
  /** VHTLC's `unilateralRefund` tier: sender + receiver, no server — LEVEL with
402
425
  * `claimDelay`, not above it. Neither party can spend a two-signature leaf
403
426
  * alone, so separating it buys no safety, and every second spent separating it
@@ -413,23 +436,25 @@ declare const unilateralRefundWithoutReceiverDelay: (claimDelay: number) => numb
413
436
  * hex); the script's HASH160 commitment is derived from it here, which is why
414
437
  * the trader never needs to see `P`.
415
438
  *
416
- * Every quote gets the full eight-leaf contract: VHTLC's own six
439
+ * Every quote gets the full emulator-covenant suite on top of VHTLC's own six
417
440
  * (`claim`/`refund`/`refundWithoutReceiver`/`unilateralClaim`/
418
- * `unilateralRefund`/`unilateralRefundWithoutReceiver`), plus two more the
419
- * emulator co-signs under a covenant pinning the payout to a pre-committed
420
- * destination — `nonInteractiveClaim` (server + emulator, pays the solver's
421
- * own `receiverPkScript`, no solver signature needed) and
422
- * `nonInteractiveRefund` (server + solver + emulator, pays the trader's own
423
- * `refundPkScript`, no timelock and no trader signature needed — see {@link
424
- * VHTLC.Options.nonInteractiveRefund}'s doc comment for why that matters).
441
+ * `unilateralRefund`/`unilateralRefundWithoutReceiver`): `nonInteractiveClaim`
442
+ * (server + emulator, pays the solver's own `receiverPkScript`, no solver
443
+ * signature needed), `nonInteractiveRefund` (server + solver + emulator, pays
444
+ * the trader's own `refundPkScript`, no timelock and no trader signature
445
+ * needed — see {@link VHTLC.Options.nonInteractiveParameters}'s doc comment for why
446
+ * that matters), and its timelocked twin `nonInteractiveRefundWithoutReceiver`
447
+ * (server + emulator alone, after `refundLocktime` — the only refund tier
448
+ * needing no participant at all). Nine leaves in all, unless `legacy` says
449
+ * otherwise.
425
450
  */
426
- declare function lightningSendVtxoScript(params: {
451
+ declare function lightningSendContract(params: {
427
452
  /** Binding field #1: the solver's x-only key, from the quote. */
428
453
  solverPubkey: Uint8Array;
429
454
  /** Binding field #2: when the trader's refund path opens, from the quote. */
430
455
  refundLocktime: number;
431
456
  /** The Ark server's x-only key — the trader's OWN connection. */
432
- serverPubkey: Uint8Array;
457
+ operatorPubkey: Uint8Array;
433
458
  /** BOLT11 payment hash, hex — from the trader's OWN invoice decode. */
434
459
  paymentHash: string;
435
460
  /** From {@link unilateralClaimDelay} over the trader's OWN server info.
@@ -439,7 +464,7 @@ declare function lightningSendVtxoScript(params: {
439
464
  /** Emulator x-only key (32 bytes). */
440
465
  emulatorPubkey: Uint8Array;
441
466
  /** Where a refund must pay: the trader's P2TR pkScript (34 bytes). Also
442
- * `nonInteractiveRefund`'s covenant destination. */
467
+ * the refund covenants' destination. */
443
468
  refundPkScript: Uint8Array;
444
469
  /** The trader's own key — VHTLC's `sender` role. Required on every
445
470
  * interactive refund-side leaf; the trader generates and persists it
@@ -450,10 +475,15 @@ declare function lightningSendVtxoScript(params: {
450
475
  * covenant key can be derived; the trader does not otherwise use or trust
451
476
  * this value. P2TR pkScript, 34 bytes. */
452
477
  receiverPkScript: Uint8Array;
478
+ /** LEGACY REBUILD ONLY — see {@link VHTLC.Options.nonInteractiveParameters}'s
479
+ * `legacy` field. Set only to re-derive a lockup funded before the
480
+ * timelocked refund leaf shipped; {@link matchQuotedLockup} passes it when
481
+ * the quote's own address says the solver quoted that shape. */
482
+ legacy?: "preTimelockedRefund";
453
483
  }): InstanceType<typeof VHTLC.ScriptV2>;
454
- /** Every input {@link lightningSendVtxoScript} builds from. Derived from the
484
+ /** Every input {@link lightningSendContract} builds from. Derived from the
455
485
  * builder rather than restated, so the two cannot drift. */
456
- type LightningSendTreeParams = Parameters<typeof lightningSendVtxoScript>[0];
486
+ type LightningSendContractParams = Parameters<typeof lightningSendContract>[0];
457
487
  /** The BOLT11 facts the trader read from its OWN decode — this module takes
458
488
  * the facts, not the decoder, so any wallet's existing decoder serves. */
459
489
  interface InvoiceFacts {
@@ -487,14 +517,15 @@ interface InvoiceFacts {
487
517
  * throws while nothing is funded. `RfqSwapManager` re-registers as a backstop
488
518
  * for older records; a repeat write is a no-op.
489
519
  *
490
- * The `sender` key is the wallet's identity key, reused by {@link
491
- * provisionRefundKey} — returned as `senderPubkey` plus `secrets`. `secrets`
492
- * holds only a public descriptor; the signer re-derives from the wallet, so
493
- * nothing secret is at rest. Persist `secrets` with the record anyway: it is
494
- * how the refund signer is found again. `nonInteractiveRefund` recovers the funds even without it — but it needs the SOLVER's active
495
- * cooperation, not just infrastructure uptime.
520
+ * The `sender` key is the wallet's identity key, as {@link provisionRefundKey}
521
+ * pins it — returned as `senderPubkey` plus `secrets`. `secrets` holds only a
522
+ * public descriptor; the signer re-derives from the wallet, so nothing secret
523
+ * is at rest. Persist `secrets` with the record anyway: it is how the refund
524
+ * signer is found again. `nonInteractiveRefund` recovers the funds even
525
+ * without it — but it needs the SOLVER's active cooperation, not just
526
+ * infrastructure uptime.
496
527
  */
497
- declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
528
+ declare function requestLightningSend(wallet: IWallet, transport: RfqTransport, params: {
498
529
  invoice: InvoiceFacts;
499
530
  rfqId?: string;
500
531
  /** Co-signer key override (33-byte compressed hex); see
@@ -527,7 +558,7 @@ declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, tra
527
558
  *
528
559
  * Returned so a consumer can persist the swap without re-deriving any of
529
560
  * it. Half of these are not on the quote: `serverPubkey` and `claimDelay`
530
- * come from this wallet's own `getInfo()`, `emulatorPubkey` from a
561
+ * come from this wallet's own `getArkadeInfo()`, `emulatorPubkey` from a
531
562
  * per-network pin, `refundPkScript` from `secrets` — decoded from the
532
563
  * refund address at provisioning time, the same address this call returns
533
564
  * as `refundAddress`.
@@ -539,7 +570,7 @@ declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, tra
539
570
  * `VHTLCV2ContractHandler.serializeParams(script.options)`, the shape the
540
571
  * rebuild accepts.
541
572
  */
542
- treeParams: LightningSendTreeParams;
573
+ contractParams: LightningSendContractParams;
543
574
  }>;
544
575
  /**
545
576
  * Map an arkade↔arkade quote onto `createOffer` terms. The trader takes the
@@ -622,7 +653,7 @@ declare function deriveOnchainSend(input: {
622
653
  quote: RfqQuote;
623
654
  paymentHash: string;
624
655
  payoutPubkey: Uint8Array;
625
- serverPubkey: Uint8Array;
656
+ operatorPubkey: Uint8Array;
626
657
  emulatorPubkey: Uint8Array;
627
658
  claimDelay: number;
628
659
  hrp: string;
@@ -673,7 +704,7 @@ declare function deriveOnchainSend(input: {
673
704
  * `claimOnchainFill`) before `htlc.refundLocktime`. Missing that window
674
705
  * forfeits the fill and falls back to the Arkade covenant refund.
675
706
  */
676
- declare function requestOnchainSend(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
707
+ declare function requestOnchainSend(wallet: IWallet, transport: RfqTransport, params: {
677
708
  amount: number;
678
709
  amountSide: "from" | "to";
679
710
  /** User's x-only L1 key that will claim the HTLC. */
@@ -721,6 +752,11 @@ declare function requestOnchainSend(wallet: IWallet, arkServerUrl: string, trans
721
752
  /** `profile.min_confirmations`; gates when the L1 fill becomes claimable,
722
753
  * and part of what a restored swap needs to drive its own claim. */
723
754
  minConfirmations: number;
755
+ /** The arkade lockup's refund deadline, as the covenant was built with it.
756
+ * Read this rather than `quote.refund_locktime`: that field is optional on
757
+ * the wire, a solver may carry the value in `profile` instead, and
758
+ * `deriveOnchainSend` is what settles which one this contract used. */
759
+ refundLocktime: number;
724
760
  /** The VHTLC `sender` x-only key, bound into the covenant. Public. */
725
761
  senderPubkey: Uint8Array;
726
762
  /** How the preimage and the `sender` key are recovered later — map it
@@ -786,13 +822,13 @@ declare const assertReceivable: (input: {
786
822
  /** Absolute sats ceiling on `from_amount`. */
787
823
  maxPayAmount?: number;
788
824
  }) => void;
789
- /** Compile the RECEIVE-direction VHTLC: the same eight-leaf tree as {@link
790
- * lightningSendVtxoScript} with the roles inverted — the trader is the
825
+ /** Compile the RECEIVE-direction VHTLC: the same suite-carrying tree as {@link
826
+ * lightningSendContract} with the roles inverted — the trader is the
791
827
  * `receiver` (it generated `P` and claims the lockup with it), the solver is
792
828
  * the `sender` (it funds the lockup and holds the refund recourse). One
793
829
  * function shared by both receive corridors, mirroring the send legs' sharing
794
- * of `lightningSendVtxoScript`. */
795
- declare function receiveVtxoScript(params: {
830
+ * of `lightningSendContract`. */
831
+ declare function lightningReceiveContract(params: {
796
832
  /** Binding field #1: the solver's x-only key, from the quote — VHTLC's
797
833
  * `sender` role on the receive corridors. */
798
834
  solverPubkey: Uint8Array;
@@ -800,7 +836,7 @@ declare function receiveVtxoScript(params: {
800
836
  * the quote — after it the solver may reclaim an unclaimed lockup. */
801
837
  refundLocktime: number;
802
838
  /** The Ark server's x-only key — the trader's OWN connection. */
803
- serverPubkey: Uint8Array;
839
+ operatorPubkey: Uint8Array;
804
840
  /** `sha256(P)`, hex — the trader's OWN preimage hash. */
805
841
  paymentHash: string;
806
842
  /** From {@link unilateralClaimDelay} over the trader's OWN server info. */
@@ -817,10 +853,12 @@ declare function receiveVtxoScript(params: {
817
853
  /** The trader's own Arkade payout pkScript (decoded from its payout
818
854
  * address) — `nonInteractiveClaim`'s pinned destination. */
819
855
  payoutPkScript: Uint8Array;
856
+ /** LEGACY REBUILD ONLY — see {@link lightningSendVtxoScript}'s `legacy`. */
857
+ legacy?: "preTimelockedRefund";
820
858
  }): InstanceType<typeof VHTLC.ScriptV2>;
821
- /** Every input {@link receiveVtxoScript} builds from; see
822
- * {@link LightningSendTreeParams}. */
823
- type LightningReceiveTreeParams = Parameters<typeof receiveVtxoScript>[0];
859
+ /** Every input {@link lightningReceiveContract} builds from; see
860
+ * {@link LightningSendContractParams}. */
861
+ type LightningReceiveContractParams = Parameters<typeof lightningReceiveContract>[0];
824
862
  /**
825
863
  * The pure core of {@link requestLightningReceive}: derive the solver-funded
826
864
  * covenant locally from the quote's binding fields plus the trader's own data
@@ -834,7 +872,7 @@ declare function deriveLightningReceive(input: {
834
872
  paymentHash: string;
835
873
  payoutPubkey: Uint8Array;
836
874
  payoutAddress: string;
837
- serverPubkey: Uint8Array;
875
+ operatorPubkey: Uint8Array;
838
876
  emulatorPubkey: Uint8Array;
839
877
  claimDelay: number;
840
878
  hrp: string;
@@ -847,7 +885,7 @@ declare function deriveLightningReceive(input: {
847
885
  refundLocktime: number;
848
886
  /** Every input the covenant was built from — see the same field on
849
887
  * `requestLightningSend`'s result for why a consumer needs them. */
850
- treeParams: LightningReceiveTreeParams;
888
+ contractParams: LightningReceiveContractParams;
851
889
  };
852
890
  /**
853
891
  * The `lightning:BTC->arkade:BTC` user flow: quote → derive the covenant
@@ -880,7 +918,7 @@ declare function deriveLightningReceive(input: {
880
918
  * Pay before `invoiceExpiresAt`: the hold-invoice window is minutes, not the
881
919
  * quote's `valid_until`.
882
920
  */
883
- declare function requestLightningReceive(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
921
+ declare function requestLightningReceive(wallet: IWallet, transport: RfqTransport, params: {
884
922
  amount: number;
885
923
  amountSide: "from" | "to";
886
924
  /** Co-signer key override (33-byte compressed hex); see
@@ -925,7 +963,7 @@ declare function requestLightningReceive(wallet: IWallet, arkServerUrl: string,
925
963
  secrets: ProvisionedClaimSecret;
926
964
  /** Every input the covenant was built from; see the same field on
927
965
  * `requestLightningSend`'s result. */
928
- treeParams: LightningReceiveTreeParams;
966
+ contractParams: LightningReceiveContractParams;
929
967
  }>;
930
968
  /**
931
969
  * The pure core of {@link requestOnchainReceive}: derive BOTH contracts
@@ -941,7 +979,7 @@ declare function deriveOnchainReceive(input: {
941
979
  payoutAddress: string;
942
980
  /** The trader's own x-only L1 key — the HTLC's refund role. */
943
981
  refundPubkey: Uint8Array;
944
- serverPubkey: Uint8Array;
982
+ operatorPubkey: Uint8Array;
945
983
  emulatorPubkey: Uint8Array;
946
984
  claimDelay: number;
947
985
  hrp: string;
@@ -969,7 +1007,7 @@ declare function deriveOnchainReceive(input: {
969
1007
  * `refundPubkey`) opens at `htlc.refundLocktime` — `buildHtlcRefund` takes it
970
1008
  * back from there.
971
1009
  */
972
- declare function requestOnchainReceive(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
1010
+ declare function requestOnchainReceive(wallet: IWallet, transport: RfqTransport, params: {
973
1011
  amount: number;
974
1012
  amountSide: "from" | "to";
975
1013
  /** Co-signer key override (33-byte compressed hex); see
@@ -1002,4 +1040,4 @@ declare function requestOnchainReceive(wallet: IWallet, arkServerUrl: string, tr
1002
1040
  secrets: ProvisionedClaimSecret;
1003
1041
  }>;
1004
1042
 
1005
- export { newRfqId as $, ARKADE_ASSET as A, arkadeAssetLeg as B, type ChainSource as C, arkadeSwapRequest as D, assertFundable as E, assertReceivable as F, awaitOnchainFill as G, type HtlcUtxo as H, type InvoiceFacts as I, buildHtlcClaim as J, buildHtlcRefund as K, LIGHTNING_BTC as L, MAX_MIN_CONFIRMATIONS as M, claimOnchainFill as N, type OnchainNetwork as O, classifyOnchainHtlc as P, deriveLightningReceive as Q, RFQ_TERMINAL_STATES as R, SOLO_REFUND_HEADROOM_SECONDS as S, deriveOnchainReceive as T, deriveOnchainSend as U, extractPreimage as V, httpTransport as W, lightningReceiveRequest as X, lightningSendRequest as Y, lightningSendVtxoScript as Z, newPreimage as _, type OnchainHtlc as a, offerTermsFromQuote as a0, onchainHtlcScript as a1, onchainReceiveRequest as a2, onchainSendRequest as a3, paymentHashOf as a4, receiveVtxoScript as a5, relayTransport as a6, requestLightningReceive as a7, requestLightningSend as a8, requestOnchainReceive as a9, requestOnchainSend as aa, rfqPair as ab, unilateralClaimDelay as ac, unilateralRefundDelay as ad, unilateralRefundWithoutReceiverDelay as ae, verifyLockupAddress as af, verifyReceiveInvoice as ag, type OnchainHtlcParams as b, ARKADE_BTC as c, AddressMismatch as d, type ChainUtxo as e, LIGHTNING_RECEIVE_PAIR as f, LIGHTNING_SEND_PAIR as g, LOCKTIME_THRESHOLD as h, type LightningReceiveTreeParams as i, type LightningSendTreeParams as j, MIN_CLAIM_WINDOW_SECONDS as k, MIN_HEADROOM_SECONDS as l, ONCHAIN_BTC as m, ONCHAIN_CLAIM_MARGIN_SECONDS as n, ONCHAIN_DUST_SATS as o, ONCHAIN_ORDER_MARGIN_SECONDS as p, ONCHAIN_RECEIVE_PAIR as q, ONCHAIN_SECONDS_PER_BLOCK as r, ONCHAIN_SEND_PAIR as s, type OnchainHtlcPhase as t, type RelaySocket as u, type RfqQuote as v, type RfqRefusalReason as w, type RfqStatus as x, type RfqTransport as y, SwapRefusal as z };
1043
+ export { lightningReceiveRequest as $, ARKADE_ASSET as A, type RfqRefusalReason as B, type ChainSource as C, type RfqStatus as D, SwapRefusal as E, arkadeAssetLeg as F, arkadeSwapRequest as G, type HtlcUtxo as H, type InvoiceFacts as I, assertFundable as J, assertReceivable as K, LIGHTNING_BTC as L, MAX_MIN_CONFIRMATIONS as M, awaitOnchainFill as N, type OnchainNetwork as O, buildHtlcClaim as P, buildHtlcRefund as Q, type RfqTransport as R, SOLO_REFUND_HEADROOM_SECONDS as S, claimOnchainFill as T, classifyOnchainHtlc as U, deriveLightningReceive as V, deriveOnchainReceive as W, deriveOnchainSend as X, extractPreimage as Y, httpTransport as Z, lightningReceiveContract as _, type OnchainHtlc as a, lightningSendContract as a0, lightningSendRequest as a1, newPreimage as a2, newRfqId as a3, offerTermsFromQuote as a4, onchainHtlcScript as a5, onchainReceiveRequest as a6, onchainSendRequest as a7, paymentHashOf as a8, relayTransport as a9, requestOnchainReceive as aa, rfqPair as ab, unilateralClaimDelay as ac, unilateralRefundDelay as ad, unilateralRefundWithoutReceiverDelay as ae, verifyLockupAddress as af, verifyReceiveInvoice as ag, type OnchainHtlcParams as b, requestLightningSend as c, requestOnchainSend as d, ARKADE_BTC as e, AddressMismatch as f, type ChainUtxo as g, LIGHTNING_RECEIVE_PAIR as h, LIGHTNING_SEND_PAIR as i, LOCKTIME_THRESHOLD as j, type LightningReceiveContractParams as k, type LightningSendContractParams as l, MIN_CLAIM_WINDOW_SECONDS as m, MIN_HEADROOM_SECONDS as n, ONCHAIN_BTC as o, ONCHAIN_CLAIM_MARGIN_SECONDS as p, ONCHAIN_DUST_SATS as q, requestLightningReceive as r, ONCHAIN_ORDER_MARGIN_SECONDS as s, ONCHAIN_RECEIVE_PAIR as t, ONCHAIN_SECONDS_PER_BLOCK as u, ONCHAIN_SEND_PAIR as v, type OnchainHtlcPhase as w, RFQ_TERMINAL_STATES as x, type RelaySocket as y, type RfqQuote as z };
@@ -1,4 +1,4 @@
1
- import { VHTLC, asset, IWallet, ProvisionedClaimSecret, ProvisionedKey } from '@arkade-os/sdk';
1
+ import { VHTLC, IWallet, ProvisionedClaimSecret, ProvisionedKey, asset } from '@arkade-os/sdk';
2
2
 
3
3
  /** L1 confirmation-depth and reorg margin between dependent timelocks. */
4
4
  declare const ONCHAIN_ORDER_MARGIN_SECONDS: number;
@@ -251,15 +251,23 @@ type RfqRefusalReason = "unsupported_pair" | "unsupported_payload" | "amount_out
251
251
  declare const RFQ_TERMINAL_STATES: readonly ["settled", "refused", "expired", "refunded", "stuck"];
252
252
  /** A refusal from the solver, carrying its closed-set reason. */
253
253
  declare class SwapRefusal extends Error {
254
+ /** Literal-typed so the v2 error taxonomy's union discriminates on `name`
255
+ * — a `string` here collapses the discriminant for every member. Same value
256
+ * the constructor has always set, moved to a field initializer. */
257
+ readonly name = "SwapRefusal";
254
258
  readonly reason: string;
255
259
  readonly rfqId: string | undefined;
256
260
  constructor(reason: string, rfqId?: string);
257
261
  }
258
- /** The solver's address does not match the local derivation. NEVER fund past this. */
262
+ /**
263
+ * The solver's address does not match the local derivation. NEVER fund past
264
+ * this. `derived` is every candidate address tried — more than one when the
265
+ * derivation itself is ambiguous, see {@link verifyLockupAddress}.
266
+ */
259
267
  declare class AddressMismatch extends Error {
260
- readonly derived: string;
268
+ readonly derived: string | string[];
261
269
  readonly quoted: string | undefined;
262
- constructor(derived: string, quoted?: string);
270
+ constructor(derived: string | string[], quoted?: string);
263
271
  }
264
272
  /** A fresh client-chosen negotiation id: 32 random bytes, lowercase hex. */
265
273
  declare const newRfqId: () => string;
@@ -293,7 +301,7 @@ interface RfqStatus {
293
301
  /** The rfq_request for the lightning send profile. A BOLT11 profile is always
294
302
  * exact-out: the invoice fixes the amount, so none is restated here.
295
303
  * `senderPubkey` is the trader's own key for the VHTLC's sender-side leaves
296
- * (see {@link lightningSendVtxoScript}) — required, never sent anywhere else,
304
+ * (see {@link lightningSendContract}) — required, never sent anywhere else,
297
305
  * never trusted by the solver as anything but a pubkey to bind into the
298
306
  * script. On the wire it's `client_refund_pubkey` (the payload schemas are
299
307
  * public at https://docs.arkadeos.com/intents/reference/rfq — the solver's schema
@@ -323,9 +331,24 @@ declare const arkadeSwapRequest: (input: {
323
331
  * 90 because the refund CLTV matures against median-time-past (BIP-113),
324
332
  * which lags wall clock by ~1h — a smaller wall-clock margin is no margin. */
325
333
  declare const MIN_HEADROOM_SECONDS: number;
326
- /** Compare-only check of the solver's address against YOUR derivation.
327
- * Throws {@link AddressMismatch}; returns the address so calls chain. */
328
- declare const verifyLockupAddress: (quote: RfqQuote, derivedAddress: string) => string;
334
+ /**
335
+ * Compare-only check of the solver's address against YOUR OWN derivation(s)
336
+ * — never extends trust, only narrows it.
337
+ *
338
+ * `derivedAddress` may be a single address or an array of candidates. Pass an
339
+ * array when your own derivation is ambiguous — as it is for the covenant
340
+ * lockups while solvers roll out the timelocked non-interactive refund leaf:
341
+ * nothing on the wire says whether a given quote's covenant carries it (the
342
+ * shape is fixed by the solver's own build, not negotiated per quote), so the
343
+ * only safe move is to derive BOTH shapes and accept whichever one the quote's
344
+ * own `lockup_address` matches. This loses no security: every candidate shape
345
+ * pins the refund to the trader's own refund destination, so a solver gains
346
+ * nothing by choosing which one to quote.
347
+ *
348
+ * Throws {@link AddressMismatch} only when NONE of the candidates match.
349
+ * Returns the address that matched, so calls chain exactly as before.
350
+ */
351
+ declare const verifyLockupAddress: (quote: RfqQuote, derivedAddress: string | string[]) => string;
329
352
  /** The user's gates, checked immediately before funding — never at quote
330
353
  * time. Throws with a stable `reason` property. `invoiceExpiresAt` applies to
331
354
  * BOLT11 profiles only; `onchain` adds the L1-HTLC gates (§ guardrails of the
@@ -397,7 +420,7 @@ declare const SOLO_REFUND_HEADROOM_SECONDS: number;
397
420
  * exit delay exactly as the reference solver derives it — both sides read the
398
421
  * SAME server, so the derivation (not a quote field) is what keeps the two
399
422
  * scripts identical. */
400
- declare const unilateralClaimDelay: (serverExitDelaySeconds: number) => number;
423
+ declare const unilateralClaimDelay: (operatorExitDelaySeconds: number) => number;
401
424
  /** VHTLC's `unilateralRefund` tier: sender + receiver, no server — LEVEL with
402
425
  * `claimDelay`, not above it. Neither party can spend a two-signature leaf
403
426
  * alone, so separating it buys no safety, and every second spent separating it
@@ -413,23 +436,25 @@ declare const unilateralRefundWithoutReceiverDelay: (claimDelay: number) => numb
413
436
  * hex); the script's HASH160 commitment is derived from it here, which is why
414
437
  * the trader never needs to see `P`.
415
438
  *
416
- * Every quote gets the full eight-leaf contract: VHTLC's own six
439
+ * Every quote gets the full emulator-covenant suite on top of VHTLC's own six
417
440
  * (`claim`/`refund`/`refundWithoutReceiver`/`unilateralClaim`/
418
- * `unilateralRefund`/`unilateralRefundWithoutReceiver`), plus two more the
419
- * emulator co-signs under a covenant pinning the payout to a pre-committed
420
- * destination — `nonInteractiveClaim` (server + emulator, pays the solver's
421
- * own `receiverPkScript`, no solver signature needed) and
422
- * `nonInteractiveRefund` (server + solver + emulator, pays the trader's own
423
- * `refundPkScript`, no timelock and no trader signature needed — see {@link
424
- * VHTLC.Options.nonInteractiveRefund}'s doc comment for why that matters).
441
+ * `unilateralRefund`/`unilateralRefundWithoutReceiver`): `nonInteractiveClaim`
442
+ * (server + emulator, pays the solver's own `receiverPkScript`, no solver
443
+ * signature needed), `nonInteractiveRefund` (server + solver + emulator, pays
444
+ * the trader's own `refundPkScript`, no timelock and no trader signature
445
+ * needed — see {@link VHTLC.Options.nonInteractiveParameters}'s doc comment for why
446
+ * that matters), and its timelocked twin `nonInteractiveRefundWithoutReceiver`
447
+ * (server + emulator alone, after `refundLocktime` — the only refund tier
448
+ * needing no participant at all). Nine leaves in all, unless `legacy` says
449
+ * otherwise.
425
450
  */
426
- declare function lightningSendVtxoScript(params: {
451
+ declare function lightningSendContract(params: {
427
452
  /** Binding field #1: the solver's x-only key, from the quote. */
428
453
  solverPubkey: Uint8Array;
429
454
  /** Binding field #2: when the trader's refund path opens, from the quote. */
430
455
  refundLocktime: number;
431
456
  /** The Ark server's x-only key — the trader's OWN connection. */
432
- serverPubkey: Uint8Array;
457
+ operatorPubkey: Uint8Array;
433
458
  /** BOLT11 payment hash, hex — from the trader's OWN invoice decode. */
434
459
  paymentHash: string;
435
460
  /** From {@link unilateralClaimDelay} over the trader's OWN server info.
@@ -439,7 +464,7 @@ declare function lightningSendVtxoScript(params: {
439
464
  /** Emulator x-only key (32 bytes). */
440
465
  emulatorPubkey: Uint8Array;
441
466
  /** Where a refund must pay: the trader's P2TR pkScript (34 bytes). Also
442
- * `nonInteractiveRefund`'s covenant destination. */
467
+ * the refund covenants' destination. */
443
468
  refundPkScript: Uint8Array;
444
469
  /** The trader's own key — VHTLC's `sender` role. Required on every
445
470
  * interactive refund-side leaf; the trader generates and persists it
@@ -450,10 +475,15 @@ declare function lightningSendVtxoScript(params: {
450
475
  * covenant key can be derived; the trader does not otherwise use or trust
451
476
  * this value. P2TR pkScript, 34 bytes. */
452
477
  receiverPkScript: Uint8Array;
478
+ /** LEGACY REBUILD ONLY — see {@link VHTLC.Options.nonInteractiveParameters}'s
479
+ * `legacy` field. Set only to re-derive a lockup funded before the
480
+ * timelocked refund leaf shipped; {@link matchQuotedLockup} passes it when
481
+ * the quote's own address says the solver quoted that shape. */
482
+ legacy?: "preTimelockedRefund";
453
483
  }): InstanceType<typeof VHTLC.ScriptV2>;
454
- /** Every input {@link lightningSendVtxoScript} builds from. Derived from the
484
+ /** Every input {@link lightningSendContract} builds from. Derived from the
455
485
  * builder rather than restated, so the two cannot drift. */
456
- type LightningSendTreeParams = Parameters<typeof lightningSendVtxoScript>[0];
486
+ type LightningSendContractParams = Parameters<typeof lightningSendContract>[0];
457
487
  /** The BOLT11 facts the trader read from its OWN decode — this module takes
458
488
  * the facts, not the decoder, so any wallet's existing decoder serves. */
459
489
  interface InvoiceFacts {
@@ -487,14 +517,15 @@ interface InvoiceFacts {
487
517
  * throws while nothing is funded. `RfqSwapManager` re-registers as a backstop
488
518
  * for older records; a repeat write is a no-op.
489
519
  *
490
- * The `sender` key is the wallet's identity key, reused by {@link
491
- * provisionRefundKey} — returned as `senderPubkey` plus `secrets`. `secrets`
492
- * holds only a public descriptor; the signer re-derives from the wallet, so
493
- * nothing secret is at rest. Persist `secrets` with the record anyway: it is
494
- * how the refund signer is found again. `nonInteractiveRefund` recovers the funds even without it — but it needs the SOLVER's active
495
- * cooperation, not just infrastructure uptime.
520
+ * The `sender` key is the wallet's identity key, as {@link provisionRefundKey}
521
+ * pins it — returned as `senderPubkey` plus `secrets`. `secrets` holds only a
522
+ * public descriptor; the signer re-derives from the wallet, so nothing secret
523
+ * is at rest. Persist `secrets` with the record anyway: it is how the refund
524
+ * signer is found again. `nonInteractiveRefund` recovers the funds even
525
+ * without it — but it needs the SOLVER's active cooperation, not just
526
+ * infrastructure uptime.
496
527
  */
497
- declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
528
+ declare function requestLightningSend(wallet: IWallet, transport: RfqTransport, params: {
498
529
  invoice: InvoiceFacts;
499
530
  rfqId?: string;
500
531
  /** Co-signer key override (33-byte compressed hex); see
@@ -527,7 +558,7 @@ declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, tra
527
558
  *
528
559
  * Returned so a consumer can persist the swap without re-deriving any of
529
560
  * it. Half of these are not on the quote: `serverPubkey` and `claimDelay`
530
- * come from this wallet's own `getInfo()`, `emulatorPubkey` from a
561
+ * come from this wallet's own `getArkadeInfo()`, `emulatorPubkey` from a
531
562
  * per-network pin, `refundPkScript` from `secrets` — decoded from the
532
563
  * refund address at provisioning time, the same address this call returns
533
564
  * as `refundAddress`.
@@ -539,7 +570,7 @@ declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, tra
539
570
  * `VHTLCV2ContractHandler.serializeParams(script.options)`, the shape the
540
571
  * rebuild accepts.
541
572
  */
542
- treeParams: LightningSendTreeParams;
573
+ contractParams: LightningSendContractParams;
543
574
  }>;
544
575
  /**
545
576
  * Map an arkade↔arkade quote onto `createOffer` terms. The trader takes the
@@ -622,7 +653,7 @@ declare function deriveOnchainSend(input: {
622
653
  quote: RfqQuote;
623
654
  paymentHash: string;
624
655
  payoutPubkey: Uint8Array;
625
- serverPubkey: Uint8Array;
656
+ operatorPubkey: Uint8Array;
626
657
  emulatorPubkey: Uint8Array;
627
658
  claimDelay: number;
628
659
  hrp: string;
@@ -673,7 +704,7 @@ declare function deriveOnchainSend(input: {
673
704
  * `claimOnchainFill`) before `htlc.refundLocktime`. Missing that window
674
705
  * forfeits the fill and falls back to the Arkade covenant refund.
675
706
  */
676
- declare function requestOnchainSend(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
707
+ declare function requestOnchainSend(wallet: IWallet, transport: RfqTransport, params: {
677
708
  amount: number;
678
709
  amountSide: "from" | "to";
679
710
  /** User's x-only L1 key that will claim the HTLC. */
@@ -721,6 +752,11 @@ declare function requestOnchainSend(wallet: IWallet, arkServerUrl: string, trans
721
752
  /** `profile.min_confirmations`; gates when the L1 fill becomes claimable,
722
753
  * and part of what a restored swap needs to drive its own claim. */
723
754
  minConfirmations: number;
755
+ /** The arkade lockup's refund deadline, as the covenant was built with it.
756
+ * Read this rather than `quote.refund_locktime`: that field is optional on
757
+ * the wire, a solver may carry the value in `profile` instead, and
758
+ * `deriveOnchainSend` is what settles which one this contract used. */
759
+ refundLocktime: number;
724
760
  /** The VHTLC `sender` x-only key, bound into the covenant. Public. */
725
761
  senderPubkey: Uint8Array;
726
762
  /** How the preimage and the `sender` key are recovered later — map it
@@ -786,13 +822,13 @@ declare const assertReceivable: (input: {
786
822
  /** Absolute sats ceiling on `from_amount`. */
787
823
  maxPayAmount?: number;
788
824
  }) => void;
789
- /** Compile the RECEIVE-direction VHTLC: the same eight-leaf tree as {@link
790
- * lightningSendVtxoScript} with the roles inverted — the trader is the
825
+ /** Compile the RECEIVE-direction VHTLC: the same suite-carrying tree as {@link
826
+ * lightningSendContract} with the roles inverted — the trader is the
791
827
  * `receiver` (it generated `P` and claims the lockup with it), the solver is
792
828
  * the `sender` (it funds the lockup and holds the refund recourse). One
793
829
  * function shared by both receive corridors, mirroring the send legs' sharing
794
- * of `lightningSendVtxoScript`. */
795
- declare function receiveVtxoScript(params: {
830
+ * of `lightningSendContract`. */
831
+ declare function lightningReceiveContract(params: {
796
832
  /** Binding field #1: the solver's x-only key, from the quote — VHTLC's
797
833
  * `sender` role on the receive corridors. */
798
834
  solverPubkey: Uint8Array;
@@ -800,7 +836,7 @@ declare function receiveVtxoScript(params: {
800
836
  * the quote — after it the solver may reclaim an unclaimed lockup. */
801
837
  refundLocktime: number;
802
838
  /** The Ark server's x-only key — the trader's OWN connection. */
803
- serverPubkey: Uint8Array;
839
+ operatorPubkey: Uint8Array;
804
840
  /** `sha256(P)`, hex — the trader's OWN preimage hash. */
805
841
  paymentHash: string;
806
842
  /** From {@link unilateralClaimDelay} over the trader's OWN server info. */
@@ -817,10 +853,12 @@ declare function receiveVtxoScript(params: {
817
853
  /** The trader's own Arkade payout pkScript (decoded from its payout
818
854
  * address) — `nonInteractiveClaim`'s pinned destination. */
819
855
  payoutPkScript: Uint8Array;
856
+ /** LEGACY REBUILD ONLY — see {@link lightningSendVtxoScript}'s `legacy`. */
857
+ legacy?: "preTimelockedRefund";
820
858
  }): InstanceType<typeof VHTLC.ScriptV2>;
821
- /** Every input {@link receiveVtxoScript} builds from; see
822
- * {@link LightningSendTreeParams}. */
823
- type LightningReceiveTreeParams = Parameters<typeof receiveVtxoScript>[0];
859
+ /** Every input {@link lightningReceiveContract} builds from; see
860
+ * {@link LightningSendContractParams}. */
861
+ type LightningReceiveContractParams = Parameters<typeof lightningReceiveContract>[0];
824
862
  /**
825
863
  * The pure core of {@link requestLightningReceive}: derive the solver-funded
826
864
  * covenant locally from the quote's binding fields plus the trader's own data
@@ -834,7 +872,7 @@ declare function deriveLightningReceive(input: {
834
872
  paymentHash: string;
835
873
  payoutPubkey: Uint8Array;
836
874
  payoutAddress: string;
837
- serverPubkey: Uint8Array;
875
+ operatorPubkey: Uint8Array;
838
876
  emulatorPubkey: Uint8Array;
839
877
  claimDelay: number;
840
878
  hrp: string;
@@ -847,7 +885,7 @@ declare function deriveLightningReceive(input: {
847
885
  refundLocktime: number;
848
886
  /** Every input the covenant was built from — see the same field on
849
887
  * `requestLightningSend`'s result for why a consumer needs them. */
850
- treeParams: LightningReceiveTreeParams;
888
+ contractParams: LightningReceiveContractParams;
851
889
  };
852
890
  /**
853
891
  * The `lightning:BTC->arkade:BTC` user flow: quote → derive the covenant
@@ -880,7 +918,7 @@ declare function deriveLightningReceive(input: {
880
918
  * Pay before `invoiceExpiresAt`: the hold-invoice window is minutes, not the
881
919
  * quote's `valid_until`.
882
920
  */
883
- declare function requestLightningReceive(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
921
+ declare function requestLightningReceive(wallet: IWallet, transport: RfqTransport, params: {
884
922
  amount: number;
885
923
  amountSide: "from" | "to";
886
924
  /** Co-signer key override (33-byte compressed hex); see
@@ -925,7 +963,7 @@ declare function requestLightningReceive(wallet: IWallet, arkServerUrl: string,
925
963
  secrets: ProvisionedClaimSecret;
926
964
  /** Every input the covenant was built from; see the same field on
927
965
  * `requestLightningSend`'s result. */
928
- treeParams: LightningReceiveTreeParams;
966
+ contractParams: LightningReceiveContractParams;
929
967
  }>;
930
968
  /**
931
969
  * The pure core of {@link requestOnchainReceive}: derive BOTH contracts
@@ -941,7 +979,7 @@ declare function deriveOnchainReceive(input: {
941
979
  payoutAddress: string;
942
980
  /** The trader's own x-only L1 key — the HTLC's refund role. */
943
981
  refundPubkey: Uint8Array;
944
- serverPubkey: Uint8Array;
982
+ operatorPubkey: Uint8Array;
945
983
  emulatorPubkey: Uint8Array;
946
984
  claimDelay: number;
947
985
  hrp: string;
@@ -969,7 +1007,7 @@ declare function deriveOnchainReceive(input: {
969
1007
  * `refundPubkey`) opens at `htlc.refundLocktime` — `buildHtlcRefund` takes it
970
1008
  * back from there.
971
1009
  */
972
- declare function requestOnchainReceive(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
1010
+ declare function requestOnchainReceive(wallet: IWallet, transport: RfqTransport, params: {
973
1011
  amount: number;
974
1012
  amountSide: "from" | "to";
975
1013
  /** Co-signer key override (33-byte compressed hex); see
@@ -1002,4 +1040,4 @@ declare function requestOnchainReceive(wallet: IWallet, arkServerUrl: string, tr
1002
1040
  secrets: ProvisionedClaimSecret;
1003
1041
  }>;
1004
1042
 
1005
- export { newRfqId as $, ARKADE_ASSET as A, arkadeAssetLeg as B, type ChainSource as C, arkadeSwapRequest as D, assertFundable as E, assertReceivable as F, awaitOnchainFill as G, type HtlcUtxo as H, type InvoiceFacts as I, buildHtlcClaim as J, buildHtlcRefund as K, LIGHTNING_BTC as L, MAX_MIN_CONFIRMATIONS as M, claimOnchainFill as N, type OnchainNetwork as O, classifyOnchainHtlc as P, deriveLightningReceive as Q, RFQ_TERMINAL_STATES as R, SOLO_REFUND_HEADROOM_SECONDS as S, deriveOnchainReceive as T, deriveOnchainSend as U, extractPreimage as V, httpTransport as W, lightningReceiveRequest as X, lightningSendRequest as Y, lightningSendVtxoScript as Z, newPreimage as _, type OnchainHtlc as a, offerTermsFromQuote as a0, onchainHtlcScript as a1, onchainReceiveRequest as a2, onchainSendRequest as a3, paymentHashOf as a4, receiveVtxoScript as a5, relayTransport as a6, requestLightningReceive as a7, requestLightningSend as a8, requestOnchainReceive as a9, requestOnchainSend as aa, rfqPair as ab, unilateralClaimDelay as ac, unilateralRefundDelay as ad, unilateralRefundWithoutReceiverDelay as ae, verifyLockupAddress as af, verifyReceiveInvoice as ag, type OnchainHtlcParams as b, ARKADE_BTC as c, AddressMismatch as d, type ChainUtxo as e, LIGHTNING_RECEIVE_PAIR as f, LIGHTNING_SEND_PAIR as g, LOCKTIME_THRESHOLD as h, type LightningReceiveTreeParams as i, type LightningSendTreeParams as j, MIN_CLAIM_WINDOW_SECONDS as k, MIN_HEADROOM_SECONDS as l, ONCHAIN_BTC as m, ONCHAIN_CLAIM_MARGIN_SECONDS as n, ONCHAIN_DUST_SATS as o, ONCHAIN_ORDER_MARGIN_SECONDS as p, ONCHAIN_RECEIVE_PAIR as q, ONCHAIN_SECONDS_PER_BLOCK as r, ONCHAIN_SEND_PAIR as s, type OnchainHtlcPhase as t, type RelaySocket as u, type RfqQuote as v, type RfqRefusalReason as w, type RfqStatus as x, type RfqTransport as y, SwapRefusal as z };
1043
+ export { lightningReceiveRequest as $, ARKADE_ASSET as A, type RfqRefusalReason as B, type ChainSource as C, type RfqStatus as D, SwapRefusal as E, arkadeAssetLeg as F, arkadeSwapRequest as G, type HtlcUtxo as H, type InvoiceFacts as I, assertFundable as J, assertReceivable as K, LIGHTNING_BTC as L, MAX_MIN_CONFIRMATIONS as M, awaitOnchainFill as N, type OnchainNetwork as O, buildHtlcClaim as P, buildHtlcRefund as Q, type RfqTransport as R, SOLO_REFUND_HEADROOM_SECONDS as S, claimOnchainFill as T, classifyOnchainHtlc as U, deriveLightningReceive as V, deriveOnchainReceive as W, deriveOnchainSend as X, extractPreimage as Y, httpTransport as Z, lightningReceiveContract as _, type OnchainHtlc as a, lightningSendContract as a0, lightningSendRequest as a1, newPreimage as a2, newRfqId as a3, offerTermsFromQuote as a4, onchainHtlcScript as a5, onchainReceiveRequest as a6, onchainSendRequest as a7, paymentHashOf as a8, relayTransport as a9, requestOnchainReceive as aa, rfqPair as ab, unilateralClaimDelay as ac, unilateralRefundDelay as ad, unilateralRefundWithoutReceiverDelay as ae, verifyLockupAddress as af, verifyReceiveInvoice as ag, type OnchainHtlcParams as b, requestLightningSend as c, requestOnchainSend as d, ARKADE_BTC as e, AddressMismatch as f, type ChainUtxo as g, LIGHTNING_RECEIVE_PAIR as h, LIGHTNING_SEND_PAIR as i, LOCKTIME_THRESHOLD as j, type LightningReceiveContractParams as k, type LightningSendContractParams as l, MIN_CLAIM_WINDOW_SECONDS as m, MIN_HEADROOM_SECONDS as n, ONCHAIN_BTC as o, ONCHAIN_CLAIM_MARGIN_SECONDS as p, ONCHAIN_DUST_SATS as q, requestLightningReceive as r, ONCHAIN_ORDER_MARGIN_SECONDS as s, ONCHAIN_RECEIVE_PAIR as t, ONCHAIN_SECONDS_PER_BLOCK as u, ONCHAIN_SEND_PAIR as v, type OnchainHtlcPhase as w, RFQ_TERMINAL_STATES as x, type RelaySocket as y, type RfqQuote as z };