@arkade-os/swap 0.0.3 → 0.0.4

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,150 +1,4 @@
1
- import { ReadonlyIdentity, IWallet, Identity, asset, VHTLC } from '@arkade-os/sdk';
2
- import { DiscoveredMarket } from '@arkade-os/solver-discovery';
3
-
4
- type AssetSwapStatus = "pending" | "cancelling" | "fulfilled" | "cancelled" | "recoverable" | "awaiting_fill" | "claimable" | "claimed" | "refunded_l1";
5
- /** The sentinel asset id for BTC itself, as opposed to a 68-hex asset id.
6
- * Lives here with the {@link AssetSwap} fields it describes so the market and
7
- * restore layers share one spelling instead of re-typing the literal. */
8
- declare const BTC_ASSET_ID = "btc";
9
- interface AssetSwapFallbackSecretsV1 {
10
- version: 1;
11
- type: "stored";
12
- senderPrivateKeyHex: string;
13
- /** Onchain-send only. A lightning send's preimage belongs to the payee. */
14
- preimageHex?: string;
15
- }
16
- type AssetSwapFallbackSecrets = AssetSwapFallbackSecretsV1;
17
- interface AssetSwap {
18
- /** Funding txid — the swap's identity. */
19
- id: string;
20
- /** 'btc' or a 68-hex asset id. */
21
- fromAsset: string;
22
- toAsset: string;
23
- /** Atomic amounts as strings (bigint is not JSON-safe). */
24
- fromAmount: string;
25
- /** The covenant wantAmount — a floor, the fill pays >= this. */
26
- toAmount: string;
27
- swapAddress: string;
28
- /** Hex pkScript of the swap contract — the indexer monitoring key. */
29
- swapPkScript: string;
30
- /** TLV offer — needed to rebuild the contract for cancel. */
31
- offerHex: string;
32
- fundingTxid: string;
33
- spentTxid?: string;
34
- status: AssetSwapStatus;
35
- createdAt: number;
36
- completedAt?: number;
37
- /** RFQ pair string, e.g. `arkade:BTC->onchain:BTC`. */
38
- pair?: string;
39
- /** `sha256(P)`, hex. Public, and how a restore confirms a candidate
40
- * derivation is the right one. */
41
- paymentHash?: string;
42
- /**
43
- * The HD descriptor this swap's secrets derive from. Public — it is what
44
- * lets the record carry no secrets at all. Present iff the swap was
45
- * created on a wallet that can allocate.
46
- */
47
- signingDescriptor?: string;
48
- /** P, hex, when the user supplied a preimage that is not seed-derived. */
49
- preimageHex?: string;
50
- /**
51
- * Complete stored-arm secrets for wallets that cannot derive. Versioned
52
- * and discriminated so restore can rebuild both the sender identity and,
53
- * for onchain sends, P.
54
- */
55
- fallbackSecrets?: AssetSwapFallbackSecrets;
56
- /** The L1 HTLC's pkScript, hex — the chain-watch key. */
57
- htlcPkScriptHex?: string;
58
- htlcLocktime?: number;
59
- /** The L1 funding txid, once observed. */
60
- l1Txid?: string;
61
- }
62
- /** All swaps, newest-first. Insertion order is not chronological — the restore
63
- * scan rebuilds records in tx-scan order — so sort at read to keep
64
- * newest-first canonical for every consumer. */
65
- declare const getAssetSwapsOrThrow: (repository: AssetSwapRepository) => Promise<AssetSwap[]>;
66
- /** The consumer read: a broken backend reads as no swaps rather than crashing
67
- * a history view. Mutations must use {@link getAssetSwapsOrThrow} instead —
68
- * swallowing the read there would let "the backend is gone" masquerade as "no
69
- * such swap" and skip the write silently. */
70
- declare const getAssetSwaps: (repository: AssetSwapRepository) => Promise<AssetSwap[]>;
71
- /** Add a swap; no-op if the id is already stored. Returns the updated list.
72
- * THROWS on a failed write — nothing irreversible may happen until this record
73
- * is durable, so the caller must not fund on a failure. */
74
- declare const addAssetSwap: (repository: AssetSwapRepository, swap: AssetSwap) => Promise<AssetSwap[]>;
75
- /** Merge changes into a swap by id. Returns the updated list.
76
- * THROWS on a failed read or write, like {@link addAssetSwap} — use this for a
77
- * write that gates something irreversible. Transitions written *after* the
78
- * irreversible act belong on {@link updateAssetSwapBestEffort}. */
79
- declare const updateAssetSwap: (repository: AssetSwapRepository, id: string, changes: Partial<Omit<AssetSwap, "id">>) => Promise<AssetSwap[]>;
80
- /**
81
- * {@link updateAssetSwap} for transitions that follow an irreversible action (a
82
- * broadcast claim, a spent lockup): failing the caller there would report as
83
- * failed a swap whose funds already moved, and a stale status is recoverable —
84
- * crash recovery re-derives the true state from the chain
85
- * (`classifyOnchainHtlc`).
86
- *
87
- * `persisted` is the part that must not be hidden: a caller that notifies on a
88
- * change, or treats one as terminal, has to know the store did not agree.
89
- */
90
- declare const updateAssetSwapBestEffort: (repository: AssetSwapRepository, id: string, changes: Partial<Omit<AssetSwap, "id">>) => Promise<{
91
- swaps: AssetSwap[];
92
- persisted: boolean;
93
- }>;
94
-
95
- /** A registry discovery result held for reuse. Refetchable — unlike a swap
96
- * record, losing it costs one network round trip — but it must survive a cold
97
- * boot: serving it stale is what keeps quoting alive while a registry is down. */
98
- interface MarketsCacheEntry {
99
- markets: DiscoveredMarket[];
100
- fetchedAt: number;
101
- }
102
- /**
103
- * Everything the package persists, following the monorepo repository
104
- * convention (versioned interface, AsyncDisposable, one backend per
105
- * platform — see the Boltz plugin's SwapRepository). Consumers construct
106
- * exactly one of these; there is no second storage seam.
107
- *
108
- * Durable records (swaps) and rebuildable state (the restore scan's txid
109
- * cursor, the markets cache) live side by side because they share a
110
- * lifetime: all three belong to one wallet on one device, and a consumer
111
- * that wipes one wants all three gone.
112
- *
113
- * ponytail: no query filters — every consumer reads all swaps and filters
114
- * in memory; mirror the Boltz plugin's GetSwapsFilter when a consumer needs
115
- * subset queries.
116
- */
117
- interface AssetSwapRepository extends AsyncDisposable {
118
- readonly version: 1;
119
- /** Insert or replace a swap by id. Store the record whole: `fallbackSecrets`
120
- * is secret-bearing, and a field-mapped backend that drops it loses the
121
- * stored arm's claim and refund keys. */
122
- saveSwap(swap: AssetSwap): Promise<void>;
123
- /** All stored swaps, in no particular order — `getAssetSwaps` is the
124
- * canonical newest-first read. */
125
- getAllSwaps(): Promise<AssetSwap[]>;
126
- /** Sent txids already checked for offer packets (see restore.ts). */
127
- getScannedTxids(): Promise<Set<string>>;
128
- markTxidsScanned(txids: Iterable<string>): Promise<void>;
129
- /** Cached registry markets, or undefined on a miss. */
130
- getCachedMarkets(network: string, registry: string): Promise<MarketsCacheEntry | undefined>;
131
- saveCachedMarkets(network: string, registry: string, entry: MarketsCacheEntry): Promise<void>;
132
- clear(): Promise<void>;
133
- }
134
- declare class InMemoryAssetSwapRepository implements AssetSwapRepository {
135
- readonly version: 1;
136
- private readonly swaps;
137
- private readonly scanned;
138
- private readonly markets;
139
- saveSwap(swap: AssetSwap): Promise<void>;
140
- getAllSwaps(): Promise<AssetSwap[]>;
141
- getScannedTxids(): Promise<Set<string>>;
142
- markTxidsScanned(txids: Iterable<string>): Promise<void>;
143
- getCachedMarkets(network: string, registry: string): Promise<MarketsCacheEntry | undefined>;
144
- saveCachedMarkets(network: string, registry: string, entry: MarketsCacheEntry): Promise<void>;
145
- clear(): Promise<void>;
146
- [Symbol.asyncDispose](): Promise<void>;
147
- }
1
+ import { asset, VHTLC, IWallet, ProvisionedClaimSecret, ProvisionedKey } from '@arkade-os/sdk';
148
2
 
149
3
  /** L1 confirmation-depth and reorg margin between dependent timelocks. */
150
4
  declare const ONCHAIN_ORDER_MARGIN_SECONDS: number;
@@ -356,168 +210,6 @@ declare function classifyOnchainHtlc(chain: ChainSource, input: {
356
210
  };
357
211
  }): Promise<OnchainHtlcPhase>;
358
212
 
359
- /**
360
- * Domain separator for the preimage derivation.
361
- *
362
- * NArk scopes its tag by protocol+provider (`Arkade-Boltz-Preimage-v1`,
363
- * `SwapsManagementService.cs:128`) so any Arkade SDK reproduces the same
364
- * preimage. NArk has no RFQ corridor yet, so this tag defines the scheme
365
- * rather than mirroring one; it is deliberately distinct from the Boltz tag,
366
- * or the same wallet key would derive one preimage for both corridors.
367
- */
368
- declare const RFQ_PREIMAGE_TAG = "Arkade-RFQ-Preimage-v1";
369
- /**
370
- * `TAG ‖ xonly(32) ‖ u32le(index)` — the message that gets BIP-340 signed.
371
- *
372
- * Anchored on the canonical x-only key rather than the descriptor string:
373
- * restore reconstructs a bare descriptor that serialises differently from the
374
- * signing descriptor used at create time, and only the key agrees across both.
375
- */
376
- declare function buildPreimageMessage(xonly: Uint8Array, index: number): Uint8Array;
377
- /** No secrets at rest: everything re-derives from the seed plus this. */
378
- interface DerivedSwapSecrets {
379
- derivable: true;
380
- /** Public. Persist it on the swap record; it is what restore keys off. */
381
- signingDescriptor: string;
382
- /** Onchain-send only, when the caller supplied P instead of deriving it. */
383
- preimage?: Uint8Array;
384
- }
385
- /** The wallet could not allocate. These are real secrets — persist them. */
386
- interface StoredSwapSecrets {
387
- derivable: false;
388
- senderPrivateKey: Uint8Array;
389
- /** Onchain-send only. A lightning send's preimage belongs to the payee. */
390
- preimage?: Uint8Array;
391
- }
392
- /**
393
- * Which arm a swap got. The discriminant makes the persistence obligation a
394
- * type-level fact: a consumer written against {@link DerivedSwapSecrets} alone
395
- * fails to compile when handed the stored arm.
396
- */
397
- type SwapSecrets = DerivedSwapSecrets | StoredSwapSecrets;
398
- /**
399
- * Allocate a descriptor for one swap, or `undefined` when the wallet cannot.
400
- *
401
- * Allocates — never peeks. `getCurrentSigningDescriptor` returns the same
402
- * descriptor until the wallet rotates, and two swaps sharing a descriptor
403
- * derive the *identical* preimage, so one solver learning its own preimage
404
- * would learn the other swap's.
405
- *
406
- * Cost of allocating: the index is consumed even when the quote is later
407
- * refused, and a swap index never turns into a funded receive contract, so a
408
- * long run of swaps widens the "unused" gap a seed-only `restore()` scan sees
409
- * (see the README's gap-limit note). Restores that keep the swap repository
410
- * are unaffected — `adoptSwapDescriptor` re-claims each record's index.
411
- */
412
- declare function deriveSwapSecrets(wallet: IWallet): Promise<DerivedSwapSecrets | undefined>;
413
- /**
414
- * The fallback arm. Separate from {@link deriveSwapSecrets} so nothing can
415
- * fabricate a preimage while probing for a derived one.
416
- */
417
- declare function randomSwapSecrets(opts?: {
418
- preimage?: boolean | Uint8Array;
419
- }): StoredSwapSecrets;
420
- /**
421
- * Serialize or restore the secrets arm a persisted record describes. Normal
422
- * HD swaps store only `signingDescriptor`; caller-supplied preimages add
423
- * `preimageHex`; fallback swaps use `fallbackSecrets` so both P and the
424
- * sender identity survive a restart.
425
- */
426
- declare function rfqSecretsToRecord(secrets: SwapSecrets): {
427
- signingDescriptor?: string;
428
- preimageHex?: string;
429
- fallbackSecrets?: AssetSwapFallbackSecrets;
430
- };
431
- declare function rfqSecretsOfRecord(record: {
432
- signingDescriptor?: string;
433
- preimageHex?: string;
434
- fallbackSecrets?: AssetSwapFallbackSecrets;
435
- }): SwapSecrets | undefined;
436
- /**
437
- * Claim a restored swap's index so a later allocation cannot reissue it —
438
- * which would derive that swap's preimage a second time, for a different swap.
439
- * Monotonic; a no-op on a wallet that cannot allocate.
440
- */
441
- declare function adoptSwapDescriptor(wallet: IWallet, signingDescriptor: string): Promise<void>;
442
- /** Why a wallet cannot produce a swap's sender key. Different instructions to
443
- * a user: restore the other wallet, or accept that this record never carried
444
- * the secrets at all. */
445
- type RefundBlockedReason =
446
- /** The record names no arm: neither `signingDescriptor` nor `fallbackSecrets`. */
447
- "no-secrets"
448
- /** It names an arm this version cannot read. */
449
- | "unreadable-secrets"
450
- /** The descriptor belongs to another seed, or this wallet is static. */
451
- | "foreign-descriptor";
452
- /**
453
- * The wallet cannot produce this swap's sender key, so no local refund is
454
- * possible: not a failure to retry, a capability this wallet does not have.
455
- *
456
- * Thrown where the cause is discovered rather than translated at the edge, so
457
- * a `refundArkade` wired through {@link senderIdentityForSwapRecord} reports it
458
- * to `RfqSwapManager` unwrapped — which is what stops the manager grinding
459
- * against a push that can never work for the whole refund window.
460
- */
461
- declare class RefundNotLocallyPossibleError extends Error {
462
- readonly reason: RefundBlockedReason;
463
- readonly name = "RefundNotLocallyPossibleError";
464
- constructor(reason: RefundBlockedReason, message: string, options?: {
465
- cause?: unknown;
466
- });
467
- }
468
- /**
469
- * The VHTLC `sender` identity — the signer for every interactive refund.
470
- *
471
- * The capability probe is not the check that matters: `signerForDescriptor`
472
- * falls back to the plain wallet identity for a descriptor it cannot derive —
473
- * a different seed, a static wallet — and that identity signs happily with the
474
- * wrong key, which surfaces only as a solver rejection or a dead claim script.
475
- * So the check is on what comes back: only a descriptor-bound signer carries
476
- * `signSchnorrDeterministic`.
477
- */
478
- declare function senderIdentityForRfqSecrets(wallet: IWallet, secrets: SwapSecrets): Promise<Identity>;
479
- /**
480
- * The VHTLC `sender` identity for a stored swap record, or a typed refusal.
481
- *
482
- * The record→identity composition {@link rfqSecretsOfRecord} deliberately does
483
- * not do: it stays total so history iteration can call it, so *this* is where
484
- * "no secrets on the record" becomes a refusal rather than an `undefined` the
485
- * caller has to remember to check.
486
- *
487
- * **Wire `refundArkade` here, not to {@link senderIdentityForRfqSecrets}.**
488
- * Only two of the three causes are throws; a caller one level down would skip
489
- * the third silently and turn it into a `TypeError` at the push site, which
490
- * `RfqSwapManager` then treats as retryable and grinds against for the whole
491
- * refund window.
492
- *
493
- * Takes the record shape structurally, matching {@link rfqSecretsOfRecord}, so
494
- * either record type can be passed.
495
- */
496
- declare function senderIdentityForSwapRecord(wallet: IWallet, record: {
497
- signingDescriptor?: string;
498
- preimageHex?: string;
499
- fallbackSecrets?: AssetSwapFallbackSecrets;
500
- }): Promise<Identity>;
501
- /** The `sender` x-only pubkey, the only half the request flow needs. */
502
- declare function senderPubkeyForRfqSecrets(wallet: IWallet, secrets: SwapSecrets): Promise<Uint8Array>;
503
- /**
504
- * An identity that signs with `aux_rand = 0`, which is what makes the
505
- * derivation reproducible. `DescriptorIdentity` satisfies it and throws rather
506
- * than degrading to a random-aux signer.
507
- */
508
- interface DeterministicSigner extends ReadonlyIdentity {
509
- signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
510
- }
511
- declare function isDeterministicSigner(value: unknown): value is DeterministicSigner;
512
- /**
513
- * `sha256(sign(sha256(msg)))`, with the signing key and the message key being
514
- * the same identity — passing a key in separately is how this silently derives
515
- * an unrecoverable preimage.
516
- */
517
- declare function derivePreimage(signer: DeterministicSigner): Promise<Uint8Array>;
518
- /** The onchain-send preimage, re-derived or read back off the stored arm. */
519
- declare function preimageForRfqSecrets(wallet: IWallet, secrets: SwapSecrets): Promise<Uint8Array>;
520
-
521
213
  /** Legs are `<corridor>:<asset>`; a pair is directional, `from->to`. Arkade
522
214
  * asset legs stay coarse (`arkade:ASSET`) — the exact asset ids ride the
523
215
  * request profile, mirroring how the offer TLV identifies assets. */
@@ -754,13 +446,13 @@ interface InvoiceFacts {
754
446
  * throws while nothing is funded. `RfqSwapManager` re-registers as a backstop
755
447
  * for older records; a repeat write is a no-op.
756
448
  *
757
- * Allocates a fresh `sender` key per call and returns it as `senderPubkey`
758
- * plus `secrets`. On an HD wallet `secrets` holds only a public descriptor and
759
- * nothing needs protecting; otherwise it holds the raw key and the caller MUST
760
- * persist it, or every interactive refund path is gone. `nonInteractiveRefund`
761
- * still recovers the funds without it but it needs the SOLVER's active
762
- * cooperation, not just infrastructure uptime, so losing the key with an
763
- * unwilling solver is a total loss.
449
+ * The `sender` key comes from the wallet a fresh HD descriptor per call, or
450
+ * the wallet's static key and is returned as `senderPubkey` plus `secrets`.
451
+ * `secrets` holds only a public descriptor; the signer re-derives from the
452
+ * wallet, so nothing secret is at rest. Persist `secrets` with the record
453
+ * anyway: it is how the refund signer is found again. `nonInteractiveRefund`
454
+ * recovers the funds even without it but it needs the SOLVER's active
455
+ * cooperation, not just infrastructure uptime.
764
456
  */
765
457
  declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, transport: RfqTransport, params: {
766
458
  invoice: InvoiceFacts;
@@ -786,9 +478,9 @@ declare function requestLightningSend(wallet: IWallet, arkServerUrl: string, tra
786
478
  refundAddress: string;
787
479
  /** The VHTLC `sender` x-only key, bound into the covenant. Public. */
788
480
  senderPubkey: Uint8Array;
789
- /** How the `sender` key is recovered later. Persist it with the record
790
- * on the derivable arm it holds nothing secret. */
791
- secrets: SwapSecrets;
481
+ /** How the `sender` key is recovered later. Persist it with the record;
482
+ * it holds nothing secret. */
483
+ secrets: ProvisionedKey;
792
484
  }>;
793
485
  /**
794
486
  * Map an arkade↔arkade quote onto `createOffer` terms. The trader takes the
@@ -941,7 +633,7 @@ declare function requestOnchainSend(wallet: IWallet, arkServerUrl: string, trans
941
633
  senderPubkey: Uint8Array;
942
634
  /** How the preimage and the `sender` key are recovered later. Persist it
943
635
  * with the record BEFORE funding. */
944
- secrets: SwapSecrets;
636
+ secrets: ProvisionedClaimSecret;
945
637
  }>;
946
638
  /** Default floor for the window between the last moment the hold invoice can
947
639
  * be paid and the solver's refund leaf opening. */
@@ -1130,7 +822,7 @@ declare function requestLightningReceive(wallet: IWallet, arkServerUrl: string,
1130
822
  payoutPubkey: Uint8Array;
1131
823
  /** How the preimage and the payout key are recovered later. Persist it
1132
824
  * with the record BEFORE paying the invoice. */
1133
- secrets: SwapSecrets;
825
+ secrets: ProvisionedClaimSecret;
1134
826
  }>;
1135
827
  /**
1136
828
  * The pure core of {@link requestOnchainReceive}: derive BOTH contracts
@@ -1201,7 +893,7 @@ declare function requestOnchainReceive(wallet: IWallet, arkServerUrl: string, tr
1201
893
  htlc: OnchainHtlc;
1202
894
  payoutAddress: string;
1203
895
  payoutPubkey: Uint8Array;
1204
- secrets: SwapSecrets;
896
+ secrets: ProvisionedClaimSecret;
1205
897
  }>;
1206
898
 
1207
- export { buildPreimageMessage as $, type AssetSwapRepository as A, BTC_ASSET_ID as B, type ChainSource as C, type DerivedSwapSecrets as D, RFQ_TERMINAL_STATES as E, type RefundBlockedReason as F, RefundNotLocallyPossibleError as G, type HtlcUtxo as H, InMemoryAssetSwapRepository as I, type RelaySocket as J, type RfqQuote as K, LIGHTNING_BTC as L, type MarketsCacheEntry as M, type RfqRefusalReason as N, type OnchainHtlc as O, SwapRefusal as P, type SwapSecrets as Q, type RfqStatus as R, type StoredSwapSecrets as S, addAssetSwap as T, adoptSwapDescriptor as U, arkadeSwapRequest as V, assertFundable as W, assertReceivable as X, awaitOnchainFill as Y, buildHtlcClaim as Z, buildHtlcRefund as _, type AssetSwap as a, claimOnchainFill as a0, classifyOnchainHtlc as a1, deriveLightningReceive as a2, deriveOnchainReceive as a3, deriveOnchainSend as a4, derivePreimage as a5, deriveSwapSecrets as a6, extractPreimage as a7, getAssetSwaps as a8, getAssetSwapsOrThrow as a9, unilateralClaimDelay as aA, unilateralRefundDelay as aB, unilateralRefundWithoutReceiverDelay as aC, updateAssetSwap as aD, updateAssetSwapBestEffort as aE, verifyLockupAddress as aF, verifyReceiveInvoice as aG, httpTransport as aa, isDeterministicSigner as ab, lightningReceiveRequest as ac, lightningSendRequest as ad, lightningSendVtxoScript as ae, newPreimage as af, newRfqId as ag, offerTermsFromQuote as ah, onchainHtlcScript as ai, onchainReceiveRequest as aj, onchainSendRequest as ak, paymentHashOf as al, preimageForRfqSecrets as am, randomSwapSecrets as an, receiveVtxoScript as ao, relayTransport as ap, requestLightningReceive as aq, requestLightningSend as ar, requestOnchainReceive as as, requestOnchainSend as at, rfqPair as au, rfqSecretsOfRecord as av, rfqSecretsToRecord as aw, senderIdentityForRfqSecrets as ax, senderIdentityForSwapRecord as ay, senderPubkeyForRfqSecrets as az, type RfqTransport as b, type ChainUtxo as c, type OnchainHtlcPhase as d, ARKADE_ASSET as e, ARKADE_BTC as f, AddressMismatch as g, type AssetSwapFallbackSecrets as h, type AssetSwapStatus as i, type DeterministicSigner as j, type InvoiceFacts as k, LIGHTNING_RECEIVE_PAIR as l, LIGHTNING_SEND_PAIR as m, MAX_MIN_CONFIRMATIONS as n, MIN_CLAIM_WINDOW_SECONDS as o, MIN_HEADROOM_SECONDS as p, ONCHAIN_BTC as q, ONCHAIN_CLAIM_MARGIN_SECONDS as r, ONCHAIN_DUST_SATS as s, ONCHAIN_ORDER_MARGIN_SECONDS as t, ONCHAIN_RECEIVE_PAIR as u, ONCHAIN_SECONDS_PER_BLOCK as v, ONCHAIN_SEND_PAIR as w, type OnchainHtlcParams as x, type OnchainNetwork as y, RFQ_PREIMAGE_TAG as z };
899
+ export { paymentHashOf as $, ARKADE_ASSET as A, buildHtlcClaim as B, type ChainSource as C, buildHtlcRefund as D, claimOnchainFill as E, classifyOnchainHtlc as F, deriveLightningReceive as G, type HtlcUtxo as H, type InvoiceFacts as I, deriveOnchainReceive as J, deriveOnchainSend as K, LIGHTNING_BTC as L, MAX_MIN_CONFIRMATIONS as M, extractPreimage as N, type OnchainHtlc as O, httpTransport as P, lightningReceiveRequest as Q, type RfqStatus as R, SwapRefusal as S, lightningSendRequest as T, lightningSendVtxoScript as U, newPreimage as V, newRfqId as W, offerTermsFromQuote as X, onchainHtlcScript as Y, onchainReceiveRequest as Z, onchainSendRequest as _, type RfqTransport as a, receiveVtxoScript as a0, relayTransport as a1, requestLightningReceive as a2, requestLightningSend as a3, requestOnchainReceive as a4, requestOnchainSend as a5, rfqPair as a6, unilateralClaimDelay as a7, unilateralRefundDelay as a8, unilateralRefundWithoutReceiverDelay as a9, verifyLockupAddress as aa, verifyReceiveInvoice as ab, type ChainUtxo as b, type OnchainHtlcPhase as c, ARKADE_BTC as d, AddressMismatch as e, LIGHTNING_RECEIVE_PAIR as f, LIGHTNING_SEND_PAIR as g, MIN_CLAIM_WINDOW_SECONDS as h, MIN_HEADROOM_SECONDS as i, ONCHAIN_BTC as j, ONCHAIN_CLAIM_MARGIN_SECONDS as k, ONCHAIN_DUST_SATS as l, ONCHAIN_ORDER_MARGIN_SECONDS as m, ONCHAIN_RECEIVE_PAIR as n, ONCHAIN_SECONDS_PER_BLOCK as o, ONCHAIN_SEND_PAIR as p, type OnchainHtlcParams as q, type OnchainNetwork as r, RFQ_TERMINAL_STATES as s, type RelaySocket as t, type RfqQuote as u, type RfqRefusalReason as v, arkadeSwapRequest as w, assertFundable as x, assertReceivable as y, awaitOnchainFill as z };