@arkade-os/swap 0.1.8 → 0.1.10

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.
Files changed (45) hide show
  1. package/dist/advanced.cjs +1125 -554
  2. package/dist/advanced.d.cts +19 -21
  3. package/dist/advanced.d.ts +19 -21
  4. package/dist/advanced.js +40 -34
  5. package/dist/{chunk-ISWLKKSS.js → chunk-2HQZLIVX.js} +106 -39
  6. package/dist/{chunk-5QPJWOCN.js → chunk-6RJVT65W.js} +2 -0
  7. package/dist/chunk-AUJDREZN.js +445 -0
  8. package/dist/{chunk-ZBJGLLYV.js → chunk-FWRDAL73.js} +157 -477
  9. package/dist/{chunk-PDNVKH5L.js → chunk-LCO6AJOS.js} +453 -70
  10. package/dist/index.cjs +1110 -542
  11. package/dist/index.d.cts +5 -6
  12. package/dist/index.d.ts +5 -6
  13. package/dist/index.js +24 -22
  14. package/dist/{lockupContract-DguuT7NK.d.cts → lockupContract-BTTRVwOt.d.cts} +1 -1
  15. package/dist/{lockupContract-BUOsghl1.d.ts → lockupContract-aFarhlxj.d.ts} +1 -1
  16. package/dist/node/index.d.cts +97 -67
  17. package/dist/node/index.d.ts +97 -67
  18. package/dist/nostr.cjs +925 -516
  19. package/dist/nostr.d.cts +1 -1
  20. package/dist/nostr.d.ts +1 -1
  21. package/dist/nostr.js +3 -2
  22. package/dist/{offerFillPlan-_AOLo6kh.d.ts → offerFillPlan-CJC5tnEd.d.ts} +10 -42
  23. package/dist/{offerFillPlan-Bp6-z6dS.d.cts → offerFillPlan-FmyaQoYT.d.cts} +10 -42
  24. package/dist/protocol.cjs +1082 -188
  25. package/dist/protocol.d.cts +42 -23
  26. package/dist/protocol.d.ts +42 -23
  27. package/dist/protocol.js +20 -7
  28. package/dist/repositories/realm/index.d.cts +3 -2
  29. package/dist/repositories/realm/index.d.ts +3 -2
  30. package/dist/repositories/sqlite/index.d.cts +3 -2
  31. package/dist/repositories/sqlite/index.d.ts +3 -2
  32. package/dist/{repository-CkKK0dGO.d.ts → repository-CwwhIAEd.d.cts} +406 -74
  33. package/dist/{repository--pfikw2R.d.cts → repository-DO6QKxBx.d.ts} +406 -74
  34. package/dist/{rfq-IzhOCG02.d.ts → rfq-CYxOyniL.d.ts} +52 -11
  35. package/dist/rfq-contract.cjs +3 -0
  36. package/dist/rfq-contract.d.cts +3 -1
  37. package/dist/rfq-contract.d.ts +3 -1
  38. package/dist/rfq-contract.js +3 -1
  39. package/dist/{rfq-BRpo5uWU.d.cts → rfq-nMGywkqI.d.cts} +52 -11
  40. package/dist/verify-ENO36VPK.js +33 -0
  41. package/dist/{watch-pvTVFp6-.d.cts → watch-DpDSP2tu.d.cts} +4 -3
  42. package/dist/{watch-DDNycuUa.d.ts → watch-_fZSgx_l.d.ts} +4 -3
  43. package/package.json +2 -2
  44. package/dist/offer-BhonWuKR.d.ts +0 -274
  45. package/dist/offer-D_qHpWo2.d.cts +0 -274
package/dist/nostr.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TransportCardFetcher } from '@arkade-os/solver-discovery';
2
- import { e as RfqTransport } from './rfq-BRpo5uWU.cjs';
2
+ import { m as RfqTransport } from './rfq-nMGywkqI.cjs';
3
3
  import { SimplePool } from 'nostr-tools';
4
4
  import '@arkade-os/sdk';
5
5
  import './rfq-contract.cjs';
package/dist/nostr.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TransportCardFetcher } from '@arkade-os/solver-discovery';
2
- import { e as RfqTransport } from './rfq-IzhOCG02.js';
2
+ import { m as RfqTransport } from './rfq-CYxOyniL.js';
3
3
  import { SimplePool } from 'nostr-tools';
4
4
  import '@arkade-os/sdk';
5
5
  import './rfq-contract.js';
package/dist/nostr.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  expectQuote,
3
3
  pairOf
4
- } from "./chunk-PDNVKH5L.js";
5
- import "./chunk-5QPJWOCN.js";
4
+ } from "./chunk-LCO6AJOS.js";
5
+ import "./chunk-6RJVT65W.js";
6
6
  import "./chunk-A3SHHRX4.js";
7
7
 
8
8
  // src/nostr.ts
@@ -186,6 +186,7 @@ var nostrRfqTransport = (options) => {
186
186
  { kinds: [RFQ_DIRECTED_KIND], "#p": [pubkey], authors: [solverPubkey] },
187
187
  {
188
188
  onevent(event) {
189
+ if (event.pubkey !== solverPubkey || !verifyEvent(event)) return;
189
190
  let payload;
190
191
  try {
191
192
  payload = JSON.parse(nip44.v2.decrypt(event.content, conversationKey));
@@ -1,9 +1,7 @@
1
1
  import { IWallet, NetworkName, Network, SignerSet, OnchainProvider, OperatorInfo, VHTLC, ProvisionedKey, ProvisionedClaimSecret, Transaction } from '@arkade-os/sdk';
2
- import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository-CkKK0dGO.js';
3
- import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, e as RfqTransport, L as LightningSendContractParams, f as LightningReceiveContractParams, O as OnchainHtlc, g as OnchainHtlcParams, h as OnchainNetwork, S as SwapRefusal } from './rfq-IzhOCG02.js';
2
+ import { bb as SwapOperator, d as AssetSwapRepository, bd as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, be as RfqSwapActionName, N as NetworkRef, A as AssetId, am as SnapshotRef, a2 as MarketBackend, W as CardMarketRef, a3 as MarketRef, D as AssetRef, q as AmountOn, an as Swap, X as CorridorId, Z as DepositArtifact, l as QuoteInput, a7 as Quote, ac as RankedBid, aq as SwapUpdate, as as Unsubscribe, S as SwapRecord, Q as QuoteId, a5 as Outcome, L as LockupSpendIndexer, ba as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, B as AssetPaymentTerms, bf as DerivedOffer, z as AssetPaymentInput, O as OfferSwapRecord, F as AssetSwapId, ao as SwapFamily, i as RouteResolution, bg as FillFunding, bh as FillOutpoint, bi as FillInputOwner, bj as OfferBinding } from './repository-DO6QKxBx.js';
3
+ import { I as InvoiceFacts, P as Pubkey, C as ChainSource, R as RfqQuote, L as LightningSendContractParams, j as LightningReceiveContractParams, O as OnchainHtlc, k as OnchainHtlcParams, l as OnchainNetwork, A as AttestingRfqTransport, b as RfqTransportFactory, S as SwapRefusal } from './rfq-CYxOyniL.js';
4
4
  import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
5
- import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-BhonWuKR.js';
6
- import * as nostr_tools from 'nostr-tools';
7
5
 
8
6
  /**
9
7
  * What a corridor is given, what a caller may replace, and where "overridden to nothing" is refused.
@@ -1013,41 +1011,6 @@ interface ParsedRfqQuote {
1013
1011
  /** Read a solver's quote, decoding both amounts. */
1014
1012
  declare const parseRfqQuote: (quote: RfqQuote) => ParsedRfqQuote;
1015
1013
 
1016
- /** An {@link RfqTransport} that can prove who answered. Absent means "attests nobody". */
1017
- interface AttestingRfqTransport extends RfqTransport {
1018
- /**
1019
- * The x-only key every reply on this transport is proven to come from. Must be a claim the
1020
- * transport ENFORCES (an author filter plus a conversation key only that author can decrypt
1021
- * to); setting it otherwise turns a check into a decoration.
1022
- */
1023
- readonly attestedResponder?: Pubkey;
1024
- }
1025
- /** What a factory is told about the card it is opening a rendezvous to. */
1026
- interface RfqRendezvous {
1027
- readonly card: DiscoveredMarket;
1028
- /** The card's `discovery_pubkey` — who the request is addressed to. */
1029
- readonly solverPubkey: Pubkey;
1030
- /** The card's relays. */
1031
- readonly relays: readonly string[];
1032
- }
1033
- type RfqTransportFactory = (rendezvous: RfqRendezvous) => AttestingRfqTransport | Promise<AttestingRfqTransport>;
1034
- /** Declare that `transport` proves every reply came from `responder`. */
1035
- declare const attesting: <T extends RfqTransport>(transport: T, responder: Pubkey) => AttestingRfqTransport;
1036
- /**
1037
- * Build the card's Nostr rendezvous bound to one pool, so discovery, quotes, and an
1038
- * app's own readers share one socket per relay. Pass the process-wide
1039
- * `sharedNostrPool()` from `@arkade-os/swap/nostr`, or one the caller owns from
1040
- * `createNostrPool()` (a bare `SimplePool` lets one double close drop the shared socket);
1041
- * omitting it keeps the shared default.
1042
- */
1043
- declare const createNostrTransportFactory: (pool?: nostr_tools.SimplePool) => RfqTransportFactory;
1044
- /**
1045
- * The default: the card's own Nostr rendezvous. It attests the discovery key because
1046
- * `nostrRfqTransport` subscribes with `authors: [solverPubkey]` and decrypts against that key — any
1047
- * other reply is filtered by the relay or fails to decrypt.
1048
- */
1049
- declare const nostrTransportFactory: RfqTransportFactory;
1050
-
1051
1014
  /** What every negotiated quote carries, whatever it settles through. */
1052
1015
  interface NegotiatedPreparation {
1053
1016
  readonly backend: "rfq";
@@ -1199,6 +1162,8 @@ interface AcceptInput {
1199
1162
  /** Unix seconds. */
1200
1163
  readonly now: number;
1201
1164
  readonly validUntil?: number;
1165
+ /** `false` funds an offer without its packet. Written on the record before any funding. */
1166
+ readonly attachOfferPacket?: boolean;
1202
1167
  }
1203
1168
  declare const conflictingFields: (record: SwapRecord, quote: Quote) => string[];
1204
1169
  /**
@@ -1223,7 +1188,7 @@ interface CancelInput {
1223
1188
  * read the call makes, and what the gate is written from. */
1224
1189
  readonly record: OfferSwapRecord;
1225
1190
  /** The delivery channel both edges emit through, armed or not. */
1226
- readonly drive: SwapDrive;
1191
+ readonly drive: Pick<SwapDrive, "ingest">;
1227
1192
  readonly indexer: LockupSpendIndexer;
1228
1193
  /** Unix seconds. Injected for tests. */
1229
1194
  readonly now?: () => number;
@@ -1267,6 +1232,9 @@ interface SwapClientConfig {
1267
1232
  interface AcceptOptions {
1268
1233
  /** Final funding submission deadline, Unix seconds, capped by the quote expiry. */
1269
1234
  readonly validUntil?: number;
1235
+ /** `false` funds an offer with no packet. Default on: a seed-only restore finds an unfilled
1236
+ * deposit by it. Kept on the record, so a resumed funding chooses the same. */
1237
+ readonly attachOfferPacket?: boolean;
1270
1238
  }
1271
1239
  interface SwapClient {
1272
1240
  /**
@@ -1670,7 +1638,7 @@ interface BuildOfferFillPlanOpts {
1670
1638
  sponsor?: FillSponsor;
1671
1639
  }
1672
1640
  /** Builds an unsigned offer fill without signing or submitting the spend. */
1673
- declare function buildOfferFillPlan(wallet: IWallet, arkServerUrl: string, offerHex: string, opts: BuildOfferFillPlanOpts): Promise<JointGraph>;
1641
+ declare function buildOfferFillPlan(wallet: IWallet, arkServerUrl: string, offerHex: string | OfferBinding, opts: BuildOfferFillPlanOpts): Promise<JointGraph>;
1674
1642
  declare function verifyOfferFillPlan(plan: JointGraph): boolean;
1675
1643
 
1676
- export { type JointGraph as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorOverrides as E, type CorridorPass as F, type CorridorRfqPreparation as G, DEFAULT_MAX_REFUND_WINDOW_SECONDS as H, type DiscoveryConfig as I, type DiscoveryIndexInput as J, DiscoverySnapshotUnavailable as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveMode as N, type OnchainCorridorDeps as O, type DriveRefusal as P, type ExchangeOptions as Q, FEED_TTL_MS as R, type SwapPolicy as S, type FeeCeiling as T, type FeedFetch as U, type FeedQuoteInput as V, type FillSponsor as W, type FillSponsorFare as X, INDEXED_NETWORKS as Y, InconsistentRoute as Z, InsufficientFunds as _, type ArkadeCorridorDeps as a, feedSpread as a$, type LockupOwner as a0, type Market as a1, type MarketLeg as a2, MaxFeeExceeded as a3, MissingCorridorDep as a4, NotCancellable as a5, OFFER_FILL_OWNERS as a6, OFFER_FILL_TEMPLATE as a7, ONCHAIN_CLAIM_FEE_RATE_SATVB as a8, type ObservationSeam as a9, type SwapDrive as aA, type SwapDriveConfig as aB, SwapDriveRefusedError as aC, type SwapError as aD, type SwapErrorName as aE, type SwapFilter as aF, UnsupportedRoute as aG, type VerbDeps as aH, acceptQuote as aI, attesting as aJ, buildOfferFillPlan as aK, cancelSwap as aL, canonicalAssetId as aM, cardMarketOf as aN, chooseMarket as aO, conflictingFields as aP, corridorSet as aQ, createNostrTransportFactory as aR, createSwapClient as aS, createSwapDrive as aT, deepFreeze as aU, digestJointGraph as aV, discoveryIndex as aW, eligibleMarkets as aX, enforceFeeCeiling as aY, exchange as aZ, feedFetch as a_, type OfferPreparation as aa, type OnchainClaim as ab, type OnchainRefund as ac, OperatorUnreachable as ad, type ParsedRfqQuote as ae, type PayOptions as af, type PayResult as ag, type QuoteCheck as ah, QuoteExpired as ai, type QuotePreparation as aj, QuoteVerificationFailed as ak, REGISTRY_URL as al, type ReceiveArtifact as am, type ReceiveOptions as an, type ReceiveRequest as ao, type RecoveryResult as ap, type RegisteredAsset as aq, type RfqAuctionPolicy as ar, type RfqPreparation as as, type RfqQuoteInput as at, type RfqRendezvous as au, type RfqTransportFactory as av, type RouteSide as aw, SWAP_ERROR_NAMES as ax, type SwapClient as ay, type SwapClientConfig as az, type CorridorSet as b, isAddressable as b0, isCardMarket as b1, isIndexedNetwork as b2, isSwapError as b3, isUsableCard as b4, liveArkadeInfo as b5, liveOperatorInfo as b6, marketBackendOf as b7, marketKeyOf as b8, marketOf as b9, marketRefOf as ba, nostrTransportFactory as bb, parseRfqQuote as bc, pay as bd, quoteFromFeed as be, quoteViaRfq as bf, readableRecord as bg, receive as bh, resolveCorridorBase as bi, resolveCorridorDeps as bj, rfqLeg as bk, rfqPairFor as bl, swapRecordOf as bm, toDiscoveryLeg as bn, unsignedPsbtBytes as bo, usableMarkets as bp, verifyJointGraph as bq, verifyOfferFillPlan as br, verifyPlanLegs as bs, withCanonicalAmount as bt, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, type AcceptOptions as g, AmbiguousDestination as h, AmountEncodingUnsupported as i, AmountMismatch as j, type AssetRfqPreparation as k, type AttestingRfqTransport as l, CORRIDOR_FACTORIES as m, type CancelInput as n, type CancelOutcome as o, type ClaimedDestination as p, ClientDisposed as q, type CorridorBase as r, type CorridorClaim as s, type CorridorCovenant as t, type CorridorDeadline as u, type CorridorDeps as v, type CorridorDepsByCorridor as w, type CorridorDrive as x, type CorridorLockup as y, type CorridorModule as z };
1644
+ export { type LockupOwner as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorPass as E, type CorridorRfqPreparation as F, DEFAULT_MAX_REFUND_WINDOW_SECONDS as G, type DiscoveryConfig as H, type DiscoveryIndexInput as I, DiscoverySnapshotUnavailable as J, type DriveMode as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveRefusal as N, type OnchainCorridorDeps as O, type ExchangeOptions as P, FEED_TTL_MS as Q, type FeeCeiling as R, type SwapPolicy as S, type FeedFetch as T, type FeedQuoteInput as U, type FillSponsor as V, type FillSponsorFare as W, INDEXED_NETWORKS as X, InconsistentRoute as Y, InsufficientFunds as Z, type JointGraph as _, type ArkadeCorridorDeps as a, isUsableCard as a$, type Market as a0, type MarketLeg as a1, MaxFeeExceeded as a2, MissingCorridorDep as a3, NotCancellable as a4, OFFER_FILL_OWNERS as a5, OFFER_FILL_TEMPLATE as a6, ONCHAIN_CLAIM_FEE_RATE_SATVB as a7, type ObservationSeam as a8, type OfferPreparation as a9, type SwapError as aA, type SwapErrorName as aB, type SwapFilter as aC, UnsupportedRoute as aD, type VerbDeps as aE, acceptQuote as aF, buildOfferFillPlan as aG, cancelSwap as aH, canonicalAssetId as aI, cardMarketOf as aJ, chooseMarket as aK, conflictingFields as aL, corridorSet as aM, createSwapClient as aN, createSwapDrive as aO, deepFreeze as aP, digestJointGraph as aQ, discoveryIndex as aR, eligibleMarkets as aS, enforceFeeCeiling as aT, exchange as aU, feedFetch as aV, feedSpread as aW, isAddressable as aX, isCardMarket as aY, isIndexedNetwork as aZ, isSwapError as a_, type OnchainClaim as aa, type OnchainRefund as ab, OperatorUnreachable as ac, type ParsedRfqQuote as ad, type PayOptions as ae, type PayResult as af, type QuoteCheck as ag, QuoteExpired as ah, type QuotePreparation as ai, QuoteVerificationFailed as aj, REGISTRY_URL as ak, type ReceiveArtifact as al, type ReceiveOptions as am, type ReceiveRequest as an, type RecoveryResult as ao, type RegisteredAsset as ap, type RfqAuctionPolicy as aq, type RfqPreparation as ar, type RfqQuoteInput as as, type RouteSide as at, SWAP_ERROR_NAMES as au, type SwapClient as av, type SwapClientConfig as aw, type SwapDrive as ax, type SwapDriveConfig as ay, SwapDriveRefusedError as az, type CorridorSet as b, liveArkadeInfo as b0, liveOperatorInfo as b1, marketBackendOf as b2, marketKeyOf as b3, marketOf as b4, marketRefOf as b5, parseRfqQuote as b6, pay as b7, quoteFromFeed as b8, quoteViaRfq as b9, readableRecord as ba, receive as bb, resolveCorridorBase as bc, resolveCorridorDeps as bd, rfqLeg as be, rfqPairFor as bf, swapRecordOf as bg, toDiscoveryLeg as bh, unsignedPsbtBytes as bi, usableMarkets as bj, verifyJointGraph as bk, verifyOfferFillPlan as bl, verifyPlanLegs as bm, withCanonicalAmount as bn, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, type AcceptOptions as g, AmbiguousDestination as h, AmountEncodingUnsupported as i, AmountMismatch as j, type AssetRfqPreparation as k, CORRIDOR_FACTORIES as l, type CancelInput as m, type CancelOutcome as n, type ClaimedDestination as o, ClientDisposed as p, type CorridorBase as q, type CorridorClaim as r, type CorridorCovenant as s, type CorridorDeadline as t, type CorridorDeps as u, type CorridorDepsByCorridor as v, type CorridorDrive as w, type CorridorLockup as x, type CorridorModule as y, type CorridorOverrides as z };
@@ -1,9 +1,7 @@
1
1
  import { IWallet, NetworkName, Network, SignerSet, OnchainProvider, OperatorInfo, VHTLC, ProvisionedKey, ProvisionedClaimSecret, Transaction } from '@arkade-os/sdk';
2
- import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository--pfikw2R.cjs';
3
- import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, e as RfqTransport, L as LightningSendContractParams, f as LightningReceiveContractParams, O as OnchainHtlc, g as OnchainHtlcParams, h as OnchainNetwork, S as SwapRefusal } from './rfq-BRpo5uWU.cjs';
2
+ import { bb as SwapOperator, d as AssetSwapRepository, bd as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, be as RfqSwapActionName, N as NetworkRef, A as AssetId, am as SnapshotRef, a2 as MarketBackend, W as CardMarketRef, a3 as MarketRef, D as AssetRef, q as AmountOn, an as Swap, X as CorridorId, Z as DepositArtifact, l as QuoteInput, a7 as Quote, ac as RankedBid, aq as SwapUpdate, as as Unsubscribe, S as SwapRecord, Q as QuoteId, a5 as Outcome, L as LockupSpendIndexer, ba as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, B as AssetPaymentTerms, bf as DerivedOffer, z as AssetPaymentInput, O as OfferSwapRecord, F as AssetSwapId, ao as SwapFamily, i as RouteResolution, bg as FillFunding, bh as FillOutpoint, bi as FillInputOwner, bj as OfferBinding } from './repository-CwwhIAEd.cjs';
3
+ import { I as InvoiceFacts, P as Pubkey, C as ChainSource, R as RfqQuote, L as LightningSendContractParams, j as LightningReceiveContractParams, O as OnchainHtlc, k as OnchainHtlcParams, l as OnchainNetwork, A as AttestingRfqTransport, b as RfqTransportFactory, S as SwapRefusal } from './rfq-nMGywkqI.cjs';
4
4
  import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
5
- import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-D_qHpWo2.cjs';
6
- import * as nostr_tools from 'nostr-tools';
7
5
 
8
6
  /**
9
7
  * What a corridor is given, what a caller may replace, and where "overridden to nothing" is refused.
@@ -1013,41 +1011,6 @@ interface ParsedRfqQuote {
1013
1011
  /** Read a solver's quote, decoding both amounts. */
1014
1012
  declare const parseRfqQuote: (quote: RfqQuote) => ParsedRfqQuote;
1015
1013
 
1016
- /** An {@link RfqTransport} that can prove who answered. Absent means "attests nobody". */
1017
- interface AttestingRfqTransport extends RfqTransport {
1018
- /**
1019
- * The x-only key every reply on this transport is proven to come from. Must be a claim the
1020
- * transport ENFORCES (an author filter plus a conversation key only that author can decrypt
1021
- * to); setting it otherwise turns a check into a decoration.
1022
- */
1023
- readonly attestedResponder?: Pubkey;
1024
- }
1025
- /** What a factory is told about the card it is opening a rendezvous to. */
1026
- interface RfqRendezvous {
1027
- readonly card: DiscoveredMarket;
1028
- /** The card's `discovery_pubkey` — who the request is addressed to. */
1029
- readonly solverPubkey: Pubkey;
1030
- /** The card's relays. */
1031
- readonly relays: readonly string[];
1032
- }
1033
- type RfqTransportFactory = (rendezvous: RfqRendezvous) => AttestingRfqTransport | Promise<AttestingRfqTransport>;
1034
- /** Declare that `transport` proves every reply came from `responder`. */
1035
- declare const attesting: <T extends RfqTransport>(transport: T, responder: Pubkey) => AttestingRfqTransport;
1036
- /**
1037
- * Build the card's Nostr rendezvous bound to one pool, so discovery, quotes, and an
1038
- * app's own readers share one socket per relay. Pass the process-wide
1039
- * `sharedNostrPool()` from `@arkade-os/swap/nostr`, or one the caller owns from
1040
- * `createNostrPool()` (a bare `SimplePool` lets one double close drop the shared socket);
1041
- * omitting it keeps the shared default.
1042
- */
1043
- declare const createNostrTransportFactory: (pool?: nostr_tools.SimplePool) => RfqTransportFactory;
1044
- /**
1045
- * The default: the card's own Nostr rendezvous. It attests the discovery key because
1046
- * `nostrRfqTransport` subscribes with `authors: [solverPubkey]` and decrypts against that key — any
1047
- * other reply is filtered by the relay or fails to decrypt.
1048
- */
1049
- declare const nostrTransportFactory: RfqTransportFactory;
1050
-
1051
1014
  /** What every negotiated quote carries, whatever it settles through. */
1052
1015
  interface NegotiatedPreparation {
1053
1016
  readonly backend: "rfq";
@@ -1199,6 +1162,8 @@ interface AcceptInput {
1199
1162
  /** Unix seconds. */
1200
1163
  readonly now: number;
1201
1164
  readonly validUntil?: number;
1165
+ /** `false` funds an offer without its packet. Written on the record before any funding. */
1166
+ readonly attachOfferPacket?: boolean;
1202
1167
  }
1203
1168
  declare const conflictingFields: (record: SwapRecord, quote: Quote) => string[];
1204
1169
  /**
@@ -1223,7 +1188,7 @@ interface CancelInput {
1223
1188
  * read the call makes, and what the gate is written from. */
1224
1189
  readonly record: OfferSwapRecord;
1225
1190
  /** The delivery channel both edges emit through, armed or not. */
1226
- readonly drive: SwapDrive;
1191
+ readonly drive: Pick<SwapDrive, "ingest">;
1227
1192
  readonly indexer: LockupSpendIndexer;
1228
1193
  /** Unix seconds. Injected for tests. */
1229
1194
  readonly now?: () => number;
@@ -1267,6 +1232,9 @@ interface SwapClientConfig {
1267
1232
  interface AcceptOptions {
1268
1233
  /** Final funding submission deadline, Unix seconds, capped by the quote expiry. */
1269
1234
  readonly validUntil?: number;
1235
+ /** `false` funds an offer with no packet. Default on: a seed-only restore finds an unfilled
1236
+ * deposit by it. Kept on the record, so a resumed funding chooses the same. */
1237
+ readonly attachOfferPacket?: boolean;
1270
1238
  }
1271
1239
  interface SwapClient {
1272
1240
  /**
@@ -1670,7 +1638,7 @@ interface BuildOfferFillPlanOpts {
1670
1638
  sponsor?: FillSponsor;
1671
1639
  }
1672
1640
  /** Builds an unsigned offer fill without signing or submitting the spend. */
1673
- declare function buildOfferFillPlan(wallet: IWallet, arkServerUrl: string, offerHex: string, opts: BuildOfferFillPlanOpts): Promise<JointGraph>;
1641
+ declare function buildOfferFillPlan(wallet: IWallet, arkServerUrl: string, offerHex: string | OfferBinding, opts: BuildOfferFillPlanOpts): Promise<JointGraph>;
1674
1642
  declare function verifyOfferFillPlan(plan: JointGraph): boolean;
1675
1643
 
1676
- export { type JointGraph as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorOverrides as E, type CorridorPass as F, type CorridorRfqPreparation as G, DEFAULT_MAX_REFUND_WINDOW_SECONDS as H, type DiscoveryConfig as I, type DiscoveryIndexInput as J, DiscoverySnapshotUnavailable as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveMode as N, type OnchainCorridorDeps as O, type DriveRefusal as P, type ExchangeOptions as Q, FEED_TTL_MS as R, type SwapPolicy as S, type FeeCeiling as T, type FeedFetch as U, type FeedQuoteInput as V, type FillSponsor as W, type FillSponsorFare as X, INDEXED_NETWORKS as Y, InconsistentRoute as Z, InsufficientFunds as _, type ArkadeCorridorDeps as a, feedSpread as a$, type LockupOwner as a0, type Market as a1, type MarketLeg as a2, MaxFeeExceeded as a3, MissingCorridorDep as a4, NotCancellable as a5, OFFER_FILL_OWNERS as a6, OFFER_FILL_TEMPLATE as a7, ONCHAIN_CLAIM_FEE_RATE_SATVB as a8, type ObservationSeam as a9, type SwapDrive as aA, type SwapDriveConfig as aB, SwapDriveRefusedError as aC, type SwapError as aD, type SwapErrorName as aE, type SwapFilter as aF, UnsupportedRoute as aG, type VerbDeps as aH, acceptQuote as aI, attesting as aJ, buildOfferFillPlan as aK, cancelSwap as aL, canonicalAssetId as aM, cardMarketOf as aN, chooseMarket as aO, conflictingFields as aP, corridorSet as aQ, createNostrTransportFactory as aR, createSwapClient as aS, createSwapDrive as aT, deepFreeze as aU, digestJointGraph as aV, discoveryIndex as aW, eligibleMarkets as aX, enforceFeeCeiling as aY, exchange as aZ, feedFetch as a_, type OfferPreparation as aa, type OnchainClaim as ab, type OnchainRefund as ac, OperatorUnreachable as ad, type ParsedRfqQuote as ae, type PayOptions as af, type PayResult as ag, type QuoteCheck as ah, QuoteExpired as ai, type QuotePreparation as aj, QuoteVerificationFailed as ak, REGISTRY_URL as al, type ReceiveArtifact as am, type ReceiveOptions as an, type ReceiveRequest as ao, type RecoveryResult as ap, type RegisteredAsset as aq, type RfqAuctionPolicy as ar, type RfqPreparation as as, type RfqQuoteInput as at, type RfqRendezvous as au, type RfqTransportFactory as av, type RouteSide as aw, SWAP_ERROR_NAMES as ax, type SwapClient as ay, type SwapClientConfig as az, type CorridorSet as b, isAddressable as b0, isCardMarket as b1, isIndexedNetwork as b2, isSwapError as b3, isUsableCard as b4, liveArkadeInfo as b5, liveOperatorInfo as b6, marketBackendOf as b7, marketKeyOf as b8, marketOf as b9, marketRefOf as ba, nostrTransportFactory as bb, parseRfqQuote as bc, pay as bd, quoteFromFeed as be, quoteViaRfq as bf, readableRecord as bg, receive as bh, resolveCorridorBase as bi, resolveCorridorDeps as bj, rfqLeg as bk, rfqPairFor as bl, swapRecordOf as bm, toDiscoveryLeg as bn, unsignedPsbtBytes as bo, usableMarkets as bp, verifyJointGraph as bq, verifyOfferFillPlan as br, verifyPlanLegs as bs, withCanonicalAmount as bt, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, type AcceptOptions as g, AmbiguousDestination as h, AmountEncodingUnsupported as i, AmountMismatch as j, type AssetRfqPreparation as k, type AttestingRfqTransport as l, CORRIDOR_FACTORIES as m, type CancelInput as n, type CancelOutcome as o, type ClaimedDestination as p, ClientDisposed as q, type CorridorBase as r, type CorridorClaim as s, type CorridorCovenant as t, type CorridorDeadline as u, type CorridorDeps as v, type CorridorDepsByCorridor as w, type CorridorDrive as x, type CorridorLockup as y, type CorridorModule as z };
1644
+ export { type LockupOwner as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorPass as E, type CorridorRfqPreparation as F, DEFAULT_MAX_REFUND_WINDOW_SECONDS as G, type DiscoveryConfig as H, type DiscoveryIndexInput as I, DiscoverySnapshotUnavailable as J, type DriveMode as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveRefusal as N, type OnchainCorridorDeps as O, type ExchangeOptions as P, FEED_TTL_MS as Q, type FeeCeiling as R, type SwapPolicy as S, type FeedFetch as T, type FeedQuoteInput as U, type FillSponsor as V, type FillSponsorFare as W, INDEXED_NETWORKS as X, InconsistentRoute as Y, InsufficientFunds as Z, type JointGraph as _, type ArkadeCorridorDeps as a, isUsableCard as a$, type Market as a0, type MarketLeg as a1, MaxFeeExceeded as a2, MissingCorridorDep as a3, NotCancellable as a4, OFFER_FILL_OWNERS as a5, OFFER_FILL_TEMPLATE as a6, ONCHAIN_CLAIM_FEE_RATE_SATVB as a7, type ObservationSeam as a8, type OfferPreparation as a9, type SwapError as aA, type SwapErrorName as aB, type SwapFilter as aC, UnsupportedRoute as aD, type VerbDeps as aE, acceptQuote as aF, buildOfferFillPlan as aG, cancelSwap as aH, canonicalAssetId as aI, cardMarketOf as aJ, chooseMarket as aK, conflictingFields as aL, corridorSet as aM, createSwapClient as aN, createSwapDrive as aO, deepFreeze as aP, digestJointGraph as aQ, discoveryIndex as aR, eligibleMarkets as aS, enforceFeeCeiling as aT, exchange as aU, feedFetch as aV, feedSpread as aW, isAddressable as aX, isCardMarket as aY, isIndexedNetwork as aZ, isSwapError as a_, type OnchainClaim as aa, type OnchainRefund as ab, OperatorUnreachable as ac, type ParsedRfqQuote as ad, type PayOptions as ae, type PayResult as af, type QuoteCheck as ag, QuoteExpired as ah, type QuotePreparation as ai, QuoteVerificationFailed as aj, REGISTRY_URL as ak, type ReceiveArtifact as al, type ReceiveOptions as am, type ReceiveRequest as an, type RecoveryResult as ao, type RegisteredAsset as ap, type RfqAuctionPolicy as aq, type RfqPreparation as ar, type RfqQuoteInput as as, type RouteSide as at, SWAP_ERROR_NAMES as au, type SwapClient as av, type SwapClientConfig as aw, type SwapDrive as ax, type SwapDriveConfig as ay, SwapDriveRefusedError as az, type CorridorSet as b, liveArkadeInfo as b0, liveOperatorInfo as b1, marketBackendOf as b2, marketKeyOf as b3, marketOf as b4, marketRefOf as b5, parseRfqQuote as b6, pay as b7, quoteFromFeed as b8, quoteViaRfq as b9, readableRecord as ba, receive as bb, resolveCorridorBase as bc, resolveCorridorDeps as bd, rfqLeg as be, rfqPairFor as bf, swapRecordOf as bg, toDiscoveryLeg as bh, unsignedPsbtBytes as bi, usableMarkets as bj, verifyJointGraph as bk, verifyOfferFillPlan as bl, verifyPlanLegs as bm, withCanonicalAmount as bn, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, type AcceptOptions as g, AmbiguousDestination as h, AmountEncodingUnsupported as i, AmountMismatch as j, type AssetRfqPreparation as k, CORRIDOR_FACTORIES as l, type CancelInput as m, type CancelOutcome as n, type ClaimedDestination as o, ClientDisposed as p, type CorridorBase as q, type CorridorClaim as r, type CorridorCovenant as s, type CorridorDeadline as t, type CorridorDeps as u, type CorridorDepsByCorridor as v, type CorridorDrive as w, type CorridorLockup as x, type CorridorModule as y, type CorridorOverrides as z };