@arkade-os/swap 0.1.0-rc.21 → 0.1.0-rc.22

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.
package/dist/advanced.cjs CHANGED
@@ -1845,6 +1845,7 @@ __export(advanced_exports, {
1845
1845
  ClientDisposed: () => ClientDisposed,
1846
1846
  CovclaimdRevealError: () => CovclaimdRevealError,
1847
1847
  DEFAULT_INVOICE_EXPIRY_SECONDS: () => DEFAULT_INVOICE_EXPIRY_SECONDS,
1848
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS: () => DEFAULT_MAX_REFUND_WINDOW_SECONDS,
1848
1849
  DiscoverySnapshotUnavailable: () => DiscoverySnapshotUnavailable,
1849
1850
  FEED_TTL_MS: () => FEED_TTL_MS,
1850
1851
  INDEXED_NETWORKS: () => INDEXED_NETWORKS,
@@ -1983,6 +1984,7 @@ __export(advanced_exports, {
1983
1984
  verifyQuotedAmount: () => verifyQuotedAmount,
1984
1985
  verifyReceiveInvoiceFacts: () => verifyReceiveInvoiceFacts,
1985
1986
  verifyReceiveWindow: () => verifyReceiveWindow,
1987
+ verifyRefundWindow: () => verifyRefundWindow,
1986
1988
  verifyResponder: () => verifyResponder,
1987
1989
  verifySendInvoice: () => verifySendInvoice,
1988
1990
  verifySendWindow: () => verifySendWindow,
@@ -6959,6 +6961,11 @@ var pinAmount = (input, takeInstrument) => {
6959
6961
 
6960
6962
  // src/client/verify.ts
6961
6963
  init_rfq();
6964
+
6965
+ // src/client/policy.ts
6966
+ var DEFAULT_MAX_REFUND_WINDOW_SECONDS = 30 * 24 * 3600;
6967
+
6968
+ // src/client/verify.ts
6962
6969
  var reasonOf = (error) => error instanceof Error && typeof error.reason === "string" ? error.reason : void 0;
6963
6970
  var CHECK_BY_REASON = {
6964
6971
  invoice_expired: "invoice",
@@ -7109,6 +7116,22 @@ var verifyQuoteTtl = (input) => {
7109
7116
  throw new QuoteExpired(input.quoteId, input.expiresAt, input.now);
7110
7117
  }
7111
7118
  };
7119
+ var CSV_GRANULARITY_SECONDS = 512;
7120
+ var verifyRefundWindow = (input) => {
7121
+ const max = input.maxSeconds ?? DEFAULT_MAX_REFUND_WINDOW_SECONDS;
7122
+ const window = input.refundLocktime - input.now;
7123
+ if (!(window <= max)) {
7124
+ throw new QuoteVerificationFailed("refund_window", `at most ${max}s`, `${window}s`);
7125
+ }
7126
+ const delay = input.refundWithoutReceiverDelay;
7127
+ if (delay !== void 0 && !(delay < max + CSV_GRANULARITY_SECONDS)) {
7128
+ throw new QuoteVerificationFailed(
7129
+ "refund_window",
7130
+ `a solo-refund delay of at most ${max}s`,
7131
+ `${delay}s`
7132
+ );
7133
+ }
7134
+ };
7112
7135
  var verifyQuotedAmount = (input) => {
7113
7136
  verifyPinnedAmount(input);
7114
7137
  if (input.take > input.give) {
@@ -7501,6 +7524,12 @@ var quoteLightningSend = async (input) => {
7501
7524
  now: input.now,
7502
7525
  invoiceExpiresAt: invoice.expiresAt
7503
7526
  });
7527
+ verifyRefundWindow({
7528
+ refundLocktime: derived.refundLocktime,
7529
+ refundWithoutReceiverDelay: derived.contractParams.refundWithoutReceiverDelay,
7530
+ now: input.now,
7531
+ maxSeconds: input.policy?.maxRefundWindowSeconds
7532
+ });
7504
7533
  verifyQuoteTtl({
7505
7534
  quoteId: input.quoteId,
7506
7535
  expiresAt: parsed.validUntil,
@@ -7703,6 +7732,11 @@ var quoteOnchainSend = async (input) => {
7703
7732
  direction: "send"
7704
7733
  }
7705
7734
  });
7735
+ verifyRefundWindow({
7736
+ refundLocktime: derived.refundLocktime,
7737
+ now: input.now,
7738
+ maxSeconds: input.policy?.maxRefundWindowSeconds
7739
+ });
7706
7740
  verifyQuoteTtl({
7707
7741
  quoteId: input.quoteId,
7708
7742
  expiresAt: parsed.validUntil,
@@ -8227,6 +8261,7 @@ async function revealClaimPacket(client, input) {
8227
8261
  ClientDisposed,
8228
8262
  CovclaimdRevealError,
8229
8263
  DEFAULT_INVOICE_EXPIRY_SECONDS,
8264
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
8230
8265
  DiscoverySnapshotUnavailable,
8231
8266
  FEED_TTL_MS,
8232
8267
  INDEXED_NETWORKS,
@@ -8365,6 +8400,7 @@ async function revealClaimPacket(client, input) {
8365
8400
  verifyQuotedAmount,
8366
8401
  verifyReceiveInvoiceFacts,
8367
8402
  verifyReceiveWindow,
8403
+ verifyRefundWindow,
8368
8404
  verifyResponder,
8369
8405
  verifySendInvoice,
8370
8406
  verifySendWindow,
@@ -1,5 +1,5 @@
1
- import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps, b as CorridorSet, D as DiscoveryIndex, S as SwapPolicy, c as DiscoveryLeg, M as MarketCandidate, d as DiscoverySnapshot } from './errors-hm7aqnRM.cjs';
2
- export { e as AcceptConflict, f as AcceptInput, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, j as AssetRfqPreparation, k as AttestingRfqTransport, l as CORRIDOR_FACTORIES, m as CancelInput, n as CancelOutcome, o as ClaimedDestination, p as ClientDisposed, q as CorridorBase, r as CorridorClaim, s as CorridorCovenant, t as CorridorDeadline, u as CorridorDeps, v as CorridorDepsByCorridor, w as CorridorDrive, x as CorridorLockup, y as CorridorModule, z as CorridorOverrides, B as CorridorPass, E as CorridorRfqPreparation, F as DiscoveryConfig, G as DiscoveryIndexInput, H as DiscoverySnapshotUnavailable, I as DriveMode, J as DriveRefusal, K as ExchangeOptions, N as FEED_TTL_MS, P as FeeCeiling, Q as FeedFetch, R as FeedQuoteInput, T as INDEXED_NETWORKS, U as InconsistentRoute, V as InsufficientFunds, W as LockupOwner, X as Market, Y as MaxFeeExceeded, Z as MissingCorridorDep, _ as NotCancellable, $ as ONCHAIN_CLAIM_FEE_RATE_SATVB, a0 as ObservationSeam, a1 as OfferPreparation, a2 as OnchainClaim, a3 as OperatorUnreachable, a4 as ParsedRfqQuote, a5 as PayOptions, a6 as PayResult, a7 as QuoteCheck, a8 as QuoteExpired, a9 as QuotePreparation, aa as QuoteVerificationFailed, ab as REGISTRY_URL, ac as ReceiveArtifact, ad as ReceiveOptions, ae as ReceiveRequest, af as RecoveryResult, ag as RegisteredAsset, ah as RfqAuctionPolicy, ai as RfqPreparation, aj as RfqQuoteInput, ak as RfqRendezvous, al as RfqTransportFactory, am as RouteSide, an as SWAP_ERROR_NAMES, ao as SwapClient, ap as SwapClientConfig, aq as SwapDrive, ar as SwapDriveConfig, as as SwapDriveRefusedError, at as SwapError, au as SwapErrorName, av as SwapFilter, aw as UnsupportedRoute, ax as VerbDeps, ay as acceptQuote, az as attesting, aA as cancelSwap, aB as canonicalAssetId, aC as cardMarketOf, aD as chooseMarket, aE as conflictingFields, aF as corridorSet, aG as createSwapClient, aH as createSwapDrive, aI as discoveryIndex, aJ as eligibleMarkets, aK as enforceFeeCeiling, aL as exchange, aM as feedFetch, aN as feedSpread, aO as isAddressable, aP as isCardMarket, aQ as isIndexedNetwork, aR as isSwapError, aS as isUsableCard, aT as liveArkadeInfo, aU as marketBackendOf, aV as marketKeyOf, aW as marketRefOf, aX as nostrTransportFactory, aY as parseRfqQuote, aZ as pay, a_ as quoteFromFeed, a$ as quoteViaRfq, b0 as readableRecord, b1 as receive, b2 as resolveCorridorBase, b3 as resolveCorridorDeps, b4 as rfqLeg, b5 as rfqPairFor, b6 as swapRecordOf, b7 as toDiscoveryLeg, b8 as usableMarkets, b9 as verifyPlanLegs, ba as withCanonicalAmount } from './errors-hm7aqnRM.cjs';
1
+ import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps, b as CorridorSet, D as DiscoveryIndex, S as SwapPolicy, c as DiscoveryLeg, M as MarketCandidate, d as DiscoverySnapshot } from './errors-BylRy7TR.cjs';
2
+ export { e as AcceptConflict, f as AcceptInput, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, j as AssetRfqPreparation, k as AttestingRfqTransport, l as CORRIDOR_FACTORIES, m as CancelInput, n as CancelOutcome, o as ClaimedDestination, p as ClientDisposed, q as CorridorBase, r as CorridorClaim, s as CorridorCovenant, t as CorridorDeadline, u as CorridorDeps, v as CorridorDepsByCorridor, w as CorridorDrive, x as CorridorLockup, y as CorridorModule, z as CorridorOverrides, B as CorridorPass, E as CorridorRfqPreparation, F as DEFAULT_MAX_REFUND_WINDOW_SECONDS, G as DiscoveryConfig, H as DiscoveryIndexInput, I as DiscoverySnapshotUnavailable, J as DriveMode, K as DriveRefusal, N as ExchangeOptions, P as FEED_TTL_MS, Q as FeeCeiling, R as FeedFetch, T as FeedQuoteInput, U as INDEXED_NETWORKS, V as InconsistentRoute, W as InsufficientFunds, X as LockupOwner, Y as Market, Z as MaxFeeExceeded, _ as MissingCorridorDep, $ as NotCancellable, a0 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a1 as ObservationSeam, a2 as OfferPreparation, a3 as OnchainClaim, a4 as OperatorUnreachable, a5 as ParsedRfqQuote, a6 as PayOptions, a7 as PayResult, a8 as QuoteCheck, a9 as QuoteExpired, aa as QuotePreparation, ab as QuoteVerificationFailed, ac as REGISTRY_URL, ad as ReceiveArtifact, ae as ReceiveOptions, af as ReceiveRequest, ag as RecoveryResult, ah as RegisteredAsset, ai as RfqAuctionPolicy, aj as RfqPreparation, ak as RfqQuoteInput, al as RfqRendezvous, am as RfqTransportFactory, an as RouteSide, ao as SWAP_ERROR_NAMES, ap as SwapClient, aq as SwapClientConfig, ar as SwapDrive, as as SwapDriveConfig, at as SwapDriveRefusedError, au as SwapError, av as SwapErrorName, aw as SwapFilter, ax as UnsupportedRoute, ay as VerbDeps, az as acceptQuote, aA as attesting, aB as cancelSwap, aC as canonicalAssetId, aD as cardMarketOf, aE as chooseMarket, aF as conflictingFields, aG as corridorSet, aH as createSwapClient, aI as createSwapDrive, aJ as discoveryIndex, aK as eligibleMarkets, aL as enforceFeeCeiling, aM as exchange, aN as feedFetch, aO as feedSpread, aP as isAddressable, aQ as isCardMarket, aR as isIndexedNetwork, aS as isSwapError, aT as isUsableCard, aU as liveArkadeInfo, aV as marketBackendOf, aW as marketKeyOf, aX as marketRefOf, aY as nostrTransportFactory, aZ as parseRfqQuote, a_ as pay, a$ as quoteFromFeed, b0 as quoteViaRfq, b1 as readableRecord, b2 as receive, b3 as resolveCorridorBase, b4 as resolveCorridorDeps, b5 as rfqLeg, b6 as rfqPairFor, b7 as swapRecordOf, b8 as toDiscoveryLeg, b9 as usableMarkets, ba as verifyPlanLegs, bb as withCanonicalAmount } from './errors-BylRy7TR.cjs';
3
3
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
4
4
  import { N as NetworkRef, C as Corridor, A as AssetId, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer, i as RouteResolution, j as ResolvedEndpoint, P as PinnedAmount, I as Instrument, k as Route, l as QuoteInput, m as Pubkey } from './repository-BuYWGAKz.cjs';
5
5
  export { n as ACTIVITY_TOKEN, o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, r as AmountOn, s as AmountRefusal, t as Artifact, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetRef, B as AssetScale, D as AssetSwapId, E as AtomicDecimal, F as AuctionMarketRef, G as AuctionProvenance, H as BITCOIN_RAILS, J as BTC_ASSET_PART, K as BitcoinRail, M as CORRIDORS, T as CORRIDOR_PASS, U as CardMarketRef, V as CorridorId, W as CorridorKind, X as DepositArtifact, Y as DisplayDecimal, Z as Endpoint, _ as Ep, $ as Hex, a0 as LOCKUP_OWNER, a1 as MarketBackend, a2 as MarketRef, a3 as OFFER_SWAP_ID_PREFIX, a4 as Outcome, a5 as ParsedAssetId, a6 as Quote, a7 as QuoteLeg, a8 as RAILS, a9 as RFQ_SWAP_ID_PREFIX, aa as RailOf, ab as RankedBid, ac as RawState, ad as RecordedArtifact, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, ah as RestoredMarketRef, ai as RfqAmountSide, aj as SnapshotRef, ak as Swap, al as SwapFamily, am as SwapRecordCommon, an as SwapUpdate, ao as Unsubscribe, ap as arkadeAsset, aq as artifactOf, ar as assetPartOf, as as assetSwapIdOf, at as bitcoinNetworkOf, au as btcAssetPart, av as btcOn, aw as corridorOfRail, ax as corridorOutcome, ay as decodeRfqAmount, az as encodeRfqAmount, aA as familyOfSwapId, aB as formatAssetId, aC as fromAtomicDecimal, aD as fromRfqAmountSide, aE as fundsFromWallet, aF as instrumentOf, aG as isAssetId, aH as isAtomicDecimal, aI as isBtcAsset, aJ as isBtcAssetLenient, aK as isNetworkRef, aL as issuanceOf, aM as legOf, aN as offerOutcome, aO as parseAssetId, aP as quoteIdOfSwapId, aQ as railOf, aR as railOfCorridor, aS as readsChain, aT as recordArtifact, aU as recordEndpoint, aV as recordInstrument, aW as recordLeg, aX as recordOutcome, aY as sameAsset, aZ as swapOf, a_ as toAtomicDecimal, a$ as toRfqAmountSide, b0 as toSafeNumber } from './repository-BuYWGAKz.cjs';
@@ -431,6 +431,17 @@ declare const verifyQuoteTtl: (input: {
431
431
  readonly now: number;
432
432
  readonly floorSeconds?: number;
433
433
  }) => void;
434
+ /**
435
+ * The policy ceiling on how long a send's funds stay locked: a solver that never pays could
436
+ * otherwise hold them for as long as it quotes.
437
+ */
438
+ declare const verifyRefundWindow: (input: {
439
+ readonly refundLocktime: number;
440
+ /** Lightning send's solo-refund CSV delay. */
441
+ readonly refundWithoutReceiverDelay?: number;
442
+ readonly now: number;
443
+ readonly maxSeconds?: number;
444
+ }) => void;
434
445
  /**
435
446
  * The quote answers the request that was made: the pinned side must not be repriced.
436
447
  *
@@ -547,4 +558,4 @@ declare function revealClaimPacket(client: CovclaimdClient, input: {
547
558
  ciphertext: string;
548
559
  }>;
549
560
 
550
- export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSet, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, DiscoveryIndex, DiscoveryLeg, DiscoverySnapshot, INVOICE_HRPS, Instrument, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, MarketCandidate, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, PinnedAmount, Pubkey, QuoteId, QuoteInput, Rail, type RecordSink, type ResolveDeps, ResolvedEndpoint, type ResolvedRoute, type RevealParams, Route, RouteResolution, SwapPolicy, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, assembleRoute, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, resolveRoute, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
561
+ export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSet, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, DiscoveryIndex, DiscoveryLeg, DiscoverySnapshot, INVOICE_HRPS, Instrument, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, MarketCandidate, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, PinnedAmount, Pubkey, QuoteId, QuoteInput, Rail, type RecordSink, type ResolveDeps, ResolvedEndpoint, type ResolvedRoute, type RevealParams, Route, RouteResolution, SwapPolicy, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, assembleRoute, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, resolveRoute, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyRefundWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
@@ -1,5 +1,5 @@
1
- import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps, b as CorridorSet, D as DiscoveryIndex, S as SwapPolicy, c as DiscoveryLeg, M as MarketCandidate, d as DiscoverySnapshot } from './errors-C3h8ANmE.js';
2
- export { e as AcceptConflict, f as AcceptInput, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, j as AssetRfqPreparation, k as AttestingRfqTransport, l as CORRIDOR_FACTORIES, m as CancelInput, n as CancelOutcome, o as ClaimedDestination, p as ClientDisposed, q as CorridorBase, r as CorridorClaim, s as CorridorCovenant, t as CorridorDeadline, u as CorridorDeps, v as CorridorDepsByCorridor, w as CorridorDrive, x as CorridorLockup, y as CorridorModule, z as CorridorOverrides, B as CorridorPass, E as CorridorRfqPreparation, F as DiscoveryConfig, G as DiscoveryIndexInput, H as DiscoverySnapshotUnavailable, I as DriveMode, J as DriveRefusal, K as ExchangeOptions, N as FEED_TTL_MS, P as FeeCeiling, Q as FeedFetch, R as FeedQuoteInput, T as INDEXED_NETWORKS, U as InconsistentRoute, V as InsufficientFunds, W as LockupOwner, X as Market, Y as MaxFeeExceeded, Z as MissingCorridorDep, _ as NotCancellable, $ as ONCHAIN_CLAIM_FEE_RATE_SATVB, a0 as ObservationSeam, a1 as OfferPreparation, a2 as OnchainClaim, a3 as OperatorUnreachable, a4 as ParsedRfqQuote, a5 as PayOptions, a6 as PayResult, a7 as QuoteCheck, a8 as QuoteExpired, a9 as QuotePreparation, aa as QuoteVerificationFailed, ab as REGISTRY_URL, ac as ReceiveArtifact, ad as ReceiveOptions, ae as ReceiveRequest, af as RecoveryResult, ag as RegisteredAsset, ah as RfqAuctionPolicy, ai as RfqPreparation, aj as RfqQuoteInput, ak as RfqRendezvous, al as RfqTransportFactory, am as RouteSide, an as SWAP_ERROR_NAMES, ao as SwapClient, ap as SwapClientConfig, aq as SwapDrive, ar as SwapDriveConfig, as as SwapDriveRefusedError, at as SwapError, au as SwapErrorName, av as SwapFilter, aw as UnsupportedRoute, ax as VerbDeps, ay as acceptQuote, az as attesting, aA as cancelSwap, aB as canonicalAssetId, aC as cardMarketOf, aD as chooseMarket, aE as conflictingFields, aF as corridorSet, aG as createSwapClient, aH as createSwapDrive, aI as discoveryIndex, aJ as eligibleMarkets, aK as enforceFeeCeiling, aL as exchange, aM as feedFetch, aN as feedSpread, aO as isAddressable, aP as isCardMarket, aQ as isIndexedNetwork, aR as isSwapError, aS as isUsableCard, aT as liveArkadeInfo, aU as marketBackendOf, aV as marketKeyOf, aW as marketRefOf, aX as nostrTransportFactory, aY as parseRfqQuote, aZ as pay, a_ as quoteFromFeed, a$ as quoteViaRfq, b0 as readableRecord, b1 as receive, b2 as resolveCorridorBase, b3 as resolveCorridorDeps, b4 as rfqLeg, b5 as rfqPairFor, b6 as swapRecordOf, b7 as toDiscoveryLeg, b8 as usableMarkets, b9 as verifyPlanLegs, ba as withCanonicalAmount } from './errors-C3h8ANmE.js';
1
+ import { A as AssetAliasTable, C as CorridorFactory, a as ArkadeCorridorDeps, L as LightningCorridorDeps, O as OnchainCorridorDeps, b as CorridorSet, D as DiscoveryIndex, S as SwapPolicy, c as DiscoveryLeg, M as MarketCandidate, d as DiscoverySnapshot } from './errors-ZmzO8ukL.js';
2
+ export { e as AcceptConflict, f as AcceptInput, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, j as AssetRfqPreparation, k as AttestingRfqTransport, l as CORRIDOR_FACTORIES, m as CancelInput, n as CancelOutcome, o as ClaimedDestination, p as ClientDisposed, q as CorridorBase, r as CorridorClaim, s as CorridorCovenant, t as CorridorDeadline, u as CorridorDeps, v as CorridorDepsByCorridor, w as CorridorDrive, x as CorridorLockup, y as CorridorModule, z as CorridorOverrides, B as CorridorPass, E as CorridorRfqPreparation, F as DEFAULT_MAX_REFUND_WINDOW_SECONDS, G as DiscoveryConfig, H as DiscoveryIndexInput, I as DiscoverySnapshotUnavailable, J as DriveMode, K as DriveRefusal, N as ExchangeOptions, P as FEED_TTL_MS, Q as FeeCeiling, R as FeedFetch, T as FeedQuoteInput, U as INDEXED_NETWORKS, V as InconsistentRoute, W as InsufficientFunds, X as LockupOwner, Y as Market, Z as MaxFeeExceeded, _ as MissingCorridorDep, $ as NotCancellable, a0 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a1 as ObservationSeam, a2 as OfferPreparation, a3 as OnchainClaim, a4 as OperatorUnreachable, a5 as ParsedRfqQuote, a6 as PayOptions, a7 as PayResult, a8 as QuoteCheck, a9 as QuoteExpired, aa as QuotePreparation, ab as QuoteVerificationFailed, ac as REGISTRY_URL, ad as ReceiveArtifact, ae as ReceiveOptions, af as ReceiveRequest, ag as RecoveryResult, ah as RegisteredAsset, ai as RfqAuctionPolicy, aj as RfqPreparation, ak as RfqQuoteInput, al as RfqRendezvous, am as RfqTransportFactory, an as RouteSide, ao as SWAP_ERROR_NAMES, ap as SwapClient, aq as SwapClientConfig, ar as SwapDrive, as as SwapDriveConfig, at as SwapDriveRefusedError, au as SwapError, av as SwapErrorName, aw as SwapFilter, ax as UnsupportedRoute, ay as VerbDeps, az as acceptQuote, aA as attesting, aB as cancelSwap, aC as canonicalAssetId, aD as cardMarketOf, aE as chooseMarket, aF as conflictingFields, aG as corridorSet, aH as createSwapClient, aI as createSwapDrive, aJ as discoveryIndex, aK as eligibleMarkets, aL as enforceFeeCeiling, aM as exchange, aN as feedFetch, aO as feedSpread, aP as isAddressable, aQ as isCardMarket, aR as isIndexedNetwork, aS as isSwapError, aT as isUsableCard, aU as liveArkadeInfo, aV as marketBackendOf, aW as marketKeyOf, aX as marketRefOf, aY as nostrTransportFactory, aZ as parseRfqQuote, a_ as pay, a$ as quoteFromFeed, b0 as quoteViaRfq, b1 as readableRecord, b2 as receive, b3 as resolveCorridorBase, b4 as resolveCorridorDeps, b5 as rfqLeg, b6 as rfqPairFor, b7 as swapRecordOf, b8 as toDiscoveryLeg, b9 as usableMarkets, ba as verifyPlanLegs, bb as withCanonicalAmount } from './errors-ZmzO8ukL.js';
3
3
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
4
4
  import { N as NetworkRef, C as Corridor, A as AssetId, R as Rail, a as RfqSwapRecordStore, b as CorridorSwapRecord, Q as QuoteId, c as AssetSwapStatus, S as SwapRecord, O as OfferSwapRecord, d as AssetSwapRepository, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, h as AssetSwap, L as LockupSpendIndexer, i as RouteResolution, j as ResolvedEndpoint, P as PinnedAmount, I as Instrument, k as Route, l as QuoteInput, m as Pubkey } from './repository-DYnRLPt-.js';
5
5
  export { n as ACTIVITY_TOKEN, o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, r as AmountOn, s as AmountRefusal, t as Artifact, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetRef, B as AssetScale, D as AssetSwapId, E as AtomicDecimal, F as AuctionMarketRef, G as AuctionProvenance, H as BITCOIN_RAILS, J as BTC_ASSET_PART, K as BitcoinRail, M as CORRIDORS, T as CORRIDOR_PASS, U as CardMarketRef, V as CorridorId, W as CorridorKind, X as DepositArtifact, Y as DisplayDecimal, Z as Endpoint, _ as Ep, $ as Hex, a0 as LOCKUP_OWNER, a1 as MarketBackend, a2 as MarketRef, a3 as OFFER_SWAP_ID_PREFIX, a4 as Outcome, a5 as ParsedAssetId, a6 as Quote, a7 as QuoteLeg, a8 as RAILS, a9 as RFQ_SWAP_ID_PREFIX, aa as RailOf, ab as RankedBid, ac as RawState, ad as RecordedArtifact, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, ah as RestoredMarketRef, ai as RfqAmountSide, aj as SnapshotRef, ak as Swap, al as SwapFamily, am as SwapRecordCommon, an as SwapUpdate, ao as Unsubscribe, ap as arkadeAsset, aq as artifactOf, ar as assetPartOf, as as assetSwapIdOf, at as bitcoinNetworkOf, au as btcAssetPart, av as btcOn, aw as corridorOfRail, ax as corridorOutcome, ay as decodeRfqAmount, az as encodeRfqAmount, aA as familyOfSwapId, aB as formatAssetId, aC as fromAtomicDecimal, aD as fromRfqAmountSide, aE as fundsFromWallet, aF as instrumentOf, aG as isAssetId, aH as isAtomicDecimal, aI as isBtcAsset, aJ as isBtcAssetLenient, aK as isNetworkRef, aL as issuanceOf, aM as legOf, aN as offerOutcome, aO as parseAssetId, aP as quoteIdOfSwapId, aQ as railOf, aR as railOfCorridor, aS as readsChain, aT as recordArtifact, aU as recordEndpoint, aV as recordInstrument, aW as recordLeg, aX as recordOutcome, aY as sameAsset, aZ as swapOf, a_ as toAtomicDecimal, a$ as toRfqAmountSide, b0 as toSafeNumber } from './repository-DYnRLPt-.js';
@@ -431,6 +431,17 @@ declare const verifyQuoteTtl: (input: {
431
431
  readonly now: number;
432
432
  readonly floorSeconds?: number;
433
433
  }) => void;
434
+ /**
435
+ * The policy ceiling on how long a send's funds stay locked: a solver that never pays could
436
+ * otherwise hold them for as long as it quotes.
437
+ */
438
+ declare const verifyRefundWindow: (input: {
439
+ readonly refundLocktime: number;
440
+ /** Lightning send's solo-refund CSV delay. */
441
+ readonly refundWithoutReceiverDelay?: number;
442
+ readonly now: number;
443
+ readonly maxSeconds?: number;
444
+ }) => void;
434
445
  /**
435
446
  * The quote answers the request that was made: the pinned side must not be repriced.
436
447
  *
@@ -547,4 +558,4 @@ declare function revealClaimPacket(client: CovclaimdClient, input: {
547
558
  ciphertext: string;
548
559
  }>;
549
560
 
550
- export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSet, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, DiscoveryIndex, DiscoveryLeg, DiscoverySnapshot, INVOICE_HRPS, Instrument, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, MarketCandidate, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, PinnedAmount, Pubkey, QuoteId, QuoteInput, Rail, type RecordSink, type ResolveDeps, ResolvedEndpoint, type ResolvedRoute, type RevealParams, Route, RouteResolution, SwapPolicy, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, assembleRoute, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, resolveRoute, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
561
+ export { type AddressParams, ArkadeCorridorDeps, AssetAliasTable, AssetId, type ChainSourceBackend, Corridor, CorridorFactory, type CorridorRecordStore, CorridorSet, CorridorSwapRecord, type CovclaimdClient, type CovclaimdInfo, CovclaimdRevealError, DEFAULT_INVOICE_EXPIRY_SECONDS, type DepositFate, DiscoveryIndex, DiscoveryLeg, DiscoverySnapshot, INVOICE_HRPS, Instrument, type L1Tip, LIGHTNING_DRIVE, LightningCorridorDeps, MarketCandidate, NetworkRef, ONCHAIN_DRIVE, OfferSwapRecord, OnchainCorridorDeps, PinnedAmount, Pubkey, QuoteId, QuoteInput, Rail, type RecordSink, type ResolveDeps, ResolvedEndpoint, type ResolvedRoute, type RevealParams, Route, RouteResolution, SwapPolicy, SwapRecord, aliasTableFrom, applyOfferSpend, arkadeCorridor, assembleRoute, chainSourceOver, corridorRecordStore, covclaimdClient, decodeBolt11, esploraChainSource, esploraTip, fateMoved, lightningCorridor, networksOfInvoiceHrp, offerFactsOf, offerRecordSource, onchainCorridor, pageRfqRecords, publicAssetId, resolveRoute, restoredCorridorRecord, restoredOfferRecord, revealClaimPacket, revealFieldsFromScript, rfqRecordOf, satsOf, scopedToRail, splitRecords, verifiedCarrierSats, verifyCrossAssetAmount, verifyPair, verifyQuoteTtl, verifyQuotedAmount, verifyReceiveInvoiceFacts, verifyReceiveWindow, verifyRefundWindow, verifyResponder, verifySendInvoice, verifySendWindow, verifyingDerivation, walletLockupIndexer, withDepositFate, withRfqState };
package/dist/advanced.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  CORRIDOR_FACTORIES,
14
14
  ClientDisposed,
15
15
  DEFAULT_INVOICE_EXPIRY_SECONDS,
16
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
16
17
  DiscoverySnapshotUnavailable,
17
18
  FEED_TTL_MS,
18
19
  INDEXED_NETWORKS,
@@ -136,6 +137,7 @@ import {
136
137
  verifyQuotedAmount,
137
138
  verifyReceiveInvoiceFacts,
138
139
  verifyReceiveWindow,
140
+ verifyRefundWindow,
139
141
  verifyResponder,
140
142
  verifySendInvoice,
141
143
  verifySendWindow,
@@ -144,7 +146,7 @@ import {
144
146
  withCanonicalAmount,
145
147
  withDepositFate,
146
148
  withRfqState
147
- } from "./chunk-HUQQVBC4.js";
149
+ } from "./chunk-OT53STVX.js";
148
150
  import {
149
151
  ACTIVITY_TOKEN,
150
152
  CORRIDOR_PASS,
@@ -302,6 +304,7 @@ export {
302
304
  ClientDisposed,
303
305
  CovclaimdRevealError,
304
306
  DEFAULT_INVOICE_EXPIRY_SECONDS,
307
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
305
308
  DiscoverySnapshotUnavailable,
306
309
  FEED_TTL_MS,
307
310
  INDEXED_NETWORKS,
@@ -440,6 +443,7 @@ export {
440
443
  verifyQuotedAmount,
441
444
  verifyReceiveInvoiceFacts,
442
445
  verifyReceiveWindow,
446
+ verifyRefundWindow,
443
447
  verifyResponder,
444
448
  verifySendInvoice,
445
449
  verifySendWindow,
@@ -2800,6 +2800,9 @@ var pinAmount = (input, takeInstrument) => {
2800
2800
  return void 0;
2801
2801
  };
2802
2802
 
2803
+ // src/client/policy.ts
2804
+ var DEFAULT_MAX_REFUND_WINDOW_SECONDS = 30 * 24 * 3600;
2805
+
2803
2806
  // src/client/verify.ts
2804
2807
  var reasonOf = (error) => error instanceof Error && typeof error.reason === "string" ? error.reason : void 0;
2805
2808
  var CHECK_BY_REASON = {
@@ -2951,6 +2954,22 @@ var verifyQuoteTtl = (input) => {
2951
2954
  throw new QuoteExpired(input.quoteId, input.expiresAt, input.now);
2952
2955
  }
2953
2956
  };
2957
+ var CSV_GRANULARITY_SECONDS = 512;
2958
+ var verifyRefundWindow = (input) => {
2959
+ const max = input.maxSeconds ?? DEFAULT_MAX_REFUND_WINDOW_SECONDS;
2960
+ const window = input.refundLocktime - input.now;
2961
+ if (!(window <= max)) {
2962
+ throw new QuoteVerificationFailed("refund_window", `at most ${max}s`, `${window}s`);
2963
+ }
2964
+ const delay = input.refundWithoutReceiverDelay;
2965
+ if (delay !== void 0 && !(delay < max + CSV_GRANULARITY_SECONDS)) {
2966
+ throw new QuoteVerificationFailed(
2967
+ "refund_window",
2968
+ `a solo-refund delay of at most ${max}s`,
2969
+ `${delay}s`
2970
+ );
2971
+ }
2972
+ };
2954
2973
  var verifyQuotedAmount = (input) => {
2955
2974
  verifyPinnedAmount(input);
2956
2975
  if (input.take > input.give) {
@@ -3513,6 +3532,12 @@ var quoteLightningSend = async (input) => {
3513
3532
  now: input.now,
3514
3533
  invoiceExpiresAt: invoice.expiresAt
3515
3534
  });
3535
+ verifyRefundWindow({
3536
+ refundLocktime: derived.refundLocktime,
3537
+ refundWithoutReceiverDelay: derived.contractParams.refundWithoutReceiverDelay,
3538
+ now: input.now,
3539
+ maxSeconds: input.policy?.maxRefundWindowSeconds
3540
+ });
3516
3541
  verifyQuoteTtl({
3517
3542
  quoteId: input.quoteId,
3518
3543
  expiresAt: parsed.validUntil,
@@ -3715,6 +3740,11 @@ var quoteOnchainSend = async (input) => {
3715
3740
  direction: "send"
3716
3741
  }
3717
3742
  });
3743
+ verifyRefundWindow({
3744
+ refundLocktime: derived.refundLocktime,
3745
+ now: input.now,
3746
+ maxSeconds: input.policy?.maxRefundWindowSeconds
3747
+ });
3718
3748
  verifyQuoteTtl({
3719
3749
  quoteId: input.quoteId,
3720
3750
  expiresAt: parsed.validUntil,
@@ -4219,6 +4249,7 @@ export {
4219
4249
  isCardMarket,
4220
4250
  assembleRoute,
4221
4251
  resolveRoute,
4252
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
4222
4253
  verifyResponder,
4223
4254
  verifyPair,
4224
4255
  verifyingDerivation,
@@ -4227,6 +4258,7 @@ export {
4227
4258
  verifySendInvoice,
4228
4259
  verifyReceiveInvoiceFacts,
4229
4260
  verifyQuoteTtl,
4261
+ verifyRefundWindow,
4230
4262
  verifyQuotedAmount,
4231
4263
  verifyCrossAssetAmount,
4232
4264
  verifiedCarrierSats,
@@ -666,6 +666,8 @@ type DriveMode =
666
666
  * round, and nothing new is discovered.
667
667
  */
668
668
  | "readonly";
669
+ /** Default {@link SwapPolicy.maxRefundWindowSeconds}: 30 days. */
670
+ declare const DEFAULT_MAX_REFUND_WINDOW_SECONDS: number;
669
671
  interface SwapPolicy {
670
672
  /** How much the client drives on its own. Default `"auto"`. */
671
673
  readonly drive?: DriveMode;
@@ -700,6 +702,12 @@ interface SwapPolicy {
700
702
  * `QuoteExpired`, rather than handing back terms that would fail at `accept()`.
701
703
  */
702
704
  readonly quoteTtlFloorSeconds?: number;
705
+ /**
706
+ * The longest a send's funds may stay locked before the trader can refund, in seconds.
707
+ * Caps `refund_locktime` and the solo-refund delay; above it `quote()` throws
708
+ * `QuoteVerificationFailed("refund_window")`. Default {@link DEFAULT_MAX_REFUND_WINDOW_SECONDS}.
709
+ */
710
+ readonly maxRefundWindowSeconds?: number;
703
711
  /**
704
712
  * §10, reserved and inert: the published-RFQ auction's parameters.
705
713
  */
@@ -1557,4 +1565,4 @@ declare function isSwapError<N extends SwapErrorName>(e: unknown, name: N): e is
1557
1565
  name: N;
1558
1566
  }>;
1559
1567
 
1560
- export { ONCHAIN_CLAIM_FEE_RATE_SATVB as $, type AssetAliasTable as A, type CorridorPass as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorRfqPreparation as E, type DiscoveryConfig as F, type DiscoveryIndexInput as G, DiscoverySnapshotUnavailable as H, type DriveMode as I, type DriveRefusal as J, type ExchangeOptions as K, type LightningCorridorDeps as L, type MarketCandidate as M, FEED_TTL_MS as N, type OnchainCorridorDeps as O, type FeeCeiling as P, type FeedFetch as Q, type FeedQuoteInput as R, type SwapPolicy as S, INDEXED_NETWORKS as T, InconsistentRoute as U, InsufficientFunds as V, type LockupOwner as W, type Market as X, MaxFeeExceeded as Y, MissingCorridorDep as Z, NotCancellable as _, type ArkadeCorridorDeps as a, quoteViaRfq as a$, type ObservationSeam as a0, type OfferPreparation as a1, type OnchainClaim as a2, OperatorUnreachable as a3, type ParsedRfqQuote as a4, type PayOptions as a5, type PayResult as a6, type QuoteCheck as a7, QuoteExpired as a8, type QuotePreparation as a9, cancelSwap as aA, canonicalAssetId as aB, cardMarketOf as aC, chooseMarket as aD, conflictingFields as aE, corridorSet as aF, createSwapClient as aG, createSwapDrive as aH, discoveryIndex as aI, eligibleMarkets as aJ, enforceFeeCeiling as aK, exchange as aL, feedFetch as aM, feedSpread as aN, isAddressable as aO, isCardMarket as aP, isIndexedNetwork as aQ, isSwapError as aR, isUsableCard as aS, liveArkadeInfo as aT, marketBackendOf as aU, marketKeyOf as aV, marketRefOf as aW, nostrTransportFactory as aX, parseRfqQuote as aY, pay as aZ, quoteFromFeed as a_, QuoteVerificationFailed as aa, REGISTRY_URL as ab, type ReceiveArtifact as ac, type ReceiveOptions as ad, type ReceiveRequest as ae, type RecoveryResult as af, type RegisteredAsset as ag, type RfqAuctionPolicy as ah, type RfqPreparation as ai, type RfqQuoteInput as aj, type RfqRendezvous as ak, type RfqTransportFactory as al, type RouteSide as am, SWAP_ERROR_NAMES as an, type SwapClient as ao, type SwapClientConfig as ap, type SwapDrive as aq, type SwapDriveConfig as ar, SwapDriveRefusedError as as, type SwapError as at, type SwapErrorName as au, type SwapFilter as av, UnsupportedRoute as aw, type VerbDeps as ax, acceptQuote as ay, attesting as az, type CorridorSet as b, readableRecord as b0, receive as b1, resolveCorridorBase as b2, resolveCorridorDeps as b3, rfqLeg as b4, rfqPairFor as b5, swapRecordOf as b6, toDiscoveryLeg as b7, usableMarkets as b8, verifyPlanLegs as b9, withCanonicalAmount as ba, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, AmbiguousDestination as g, AmountEncodingUnsupported as h, AmountMismatch as i, type AssetRfqPreparation as j, type AttestingRfqTransport 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 };
1568
+ export { NotCancellable as $, type AssetAliasTable as A, type CorridorPass as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorRfqPreparation as E, DEFAULT_MAX_REFUND_WINDOW_SECONDS as F, type DiscoveryConfig as G, type DiscoveryIndexInput as H, DiscoverySnapshotUnavailable as I, type DriveMode as J, type DriveRefusal as K, type LightningCorridorDeps as L, type MarketCandidate as M, type ExchangeOptions as N, type OnchainCorridorDeps as O, FEED_TTL_MS as P, type FeeCeiling as Q, type FeedFetch as R, type SwapPolicy as S, type FeedQuoteInput as T, INDEXED_NETWORKS as U, InconsistentRoute as V, InsufficientFunds as W, type LockupOwner as X, type Market as Y, MaxFeeExceeded as Z, MissingCorridorDep as _, type ArkadeCorridorDeps as a, quoteFromFeed as a$, ONCHAIN_CLAIM_FEE_RATE_SATVB as a0, type ObservationSeam as a1, type OfferPreparation as a2, type OnchainClaim as a3, OperatorUnreachable as a4, type ParsedRfqQuote as a5, type PayOptions as a6, type PayResult as a7, type QuoteCheck as a8, QuoteExpired as a9, attesting as aA, cancelSwap as aB, canonicalAssetId as aC, cardMarketOf as aD, chooseMarket as aE, conflictingFields as aF, corridorSet as aG, createSwapClient as aH, createSwapDrive as aI, discoveryIndex as aJ, eligibleMarkets as aK, enforceFeeCeiling as aL, exchange as aM, feedFetch as aN, feedSpread as aO, isAddressable as aP, isCardMarket as aQ, isIndexedNetwork as aR, isSwapError as aS, isUsableCard as aT, liveArkadeInfo as aU, marketBackendOf as aV, marketKeyOf as aW, marketRefOf as aX, nostrTransportFactory as aY, parseRfqQuote as aZ, pay as a_, type QuotePreparation as aa, QuoteVerificationFailed as ab, REGISTRY_URL as ac, type ReceiveArtifact as ad, type ReceiveOptions as ae, type ReceiveRequest as af, type RecoveryResult as ag, type RegisteredAsset as ah, type RfqAuctionPolicy as ai, type RfqPreparation as aj, type RfqQuoteInput as ak, type RfqRendezvous as al, type RfqTransportFactory as am, type RouteSide as an, SWAP_ERROR_NAMES as ao, type SwapClient as ap, type SwapClientConfig as aq, type SwapDrive as ar, type SwapDriveConfig as as, SwapDriveRefusedError as at, type SwapError as au, type SwapErrorName as av, type SwapFilter as aw, UnsupportedRoute as ax, type VerbDeps as ay, acceptQuote as az, type CorridorSet as b, quoteViaRfq as b0, readableRecord as b1, receive as b2, resolveCorridorBase as b3, resolveCorridorDeps as b4, rfqLeg as b5, rfqPairFor as b6, swapRecordOf as b7, toDiscoveryLeg as b8, usableMarkets as b9, verifyPlanLegs as ba, withCanonicalAmount as bb, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, AmbiguousDestination as g, AmountEncodingUnsupported as h, AmountMismatch as i, type AssetRfqPreparation as j, type AttestingRfqTransport 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 };
@@ -666,6 +666,8 @@ type DriveMode =
666
666
  * round, and nothing new is discovered.
667
667
  */
668
668
  | "readonly";
669
+ /** Default {@link SwapPolicy.maxRefundWindowSeconds}: 30 days. */
670
+ declare const DEFAULT_MAX_REFUND_WINDOW_SECONDS: number;
669
671
  interface SwapPolicy {
670
672
  /** How much the client drives on its own. Default `"auto"`. */
671
673
  readonly drive?: DriveMode;
@@ -700,6 +702,12 @@ interface SwapPolicy {
700
702
  * `QuoteExpired`, rather than handing back terms that would fail at `accept()`.
701
703
  */
702
704
  readonly quoteTtlFloorSeconds?: number;
705
+ /**
706
+ * The longest a send's funds may stay locked before the trader can refund, in seconds.
707
+ * Caps `refund_locktime` and the solo-refund delay; above it `quote()` throws
708
+ * `QuoteVerificationFailed("refund_window")`. Default {@link DEFAULT_MAX_REFUND_WINDOW_SECONDS}.
709
+ */
710
+ readonly maxRefundWindowSeconds?: number;
703
711
  /**
704
712
  * §10, reserved and inert: the published-RFQ auction's parameters.
705
713
  */
@@ -1557,4 +1565,4 @@ declare function isSwapError<N extends SwapErrorName>(e: unknown, name: N): e is
1557
1565
  name: N;
1558
1566
  }>;
1559
1567
 
1560
- export { ONCHAIN_CLAIM_FEE_RATE_SATVB as $, type AssetAliasTable as A, type CorridorPass as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorRfqPreparation as E, type DiscoveryConfig as F, type DiscoveryIndexInput as G, DiscoverySnapshotUnavailable as H, type DriveMode as I, type DriveRefusal as J, type ExchangeOptions as K, type LightningCorridorDeps as L, type MarketCandidate as M, FEED_TTL_MS as N, type OnchainCorridorDeps as O, type FeeCeiling as P, type FeedFetch as Q, type FeedQuoteInput as R, type SwapPolicy as S, INDEXED_NETWORKS as T, InconsistentRoute as U, InsufficientFunds as V, type LockupOwner as W, type Market as X, MaxFeeExceeded as Y, MissingCorridorDep as Z, NotCancellable as _, type ArkadeCorridorDeps as a, quoteViaRfq as a$, type ObservationSeam as a0, type OfferPreparation as a1, type OnchainClaim as a2, OperatorUnreachable as a3, type ParsedRfqQuote as a4, type PayOptions as a5, type PayResult as a6, type QuoteCheck as a7, QuoteExpired as a8, type QuotePreparation as a9, cancelSwap as aA, canonicalAssetId as aB, cardMarketOf as aC, chooseMarket as aD, conflictingFields as aE, corridorSet as aF, createSwapClient as aG, createSwapDrive as aH, discoveryIndex as aI, eligibleMarkets as aJ, enforceFeeCeiling as aK, exchange as aL, feedFetch as aM, feedSpread as aN, isAddressable as aO, isCardMarket as aP, isIndexedNetwork as aQ, isSwapError as aR, isUsableCard as aS, liveArkadeInfo as aT, marketBackendOf as aU, marketKeyOf as aV, marketRefOf as aW, nostrTransportFactory as aX, parseRfqQuote as aY, pay as aZ, quoteFromFeed as a_, QuoteVerificationFailed as aa, REGISTRY_URL as ab, type ReceiveArtifact as ac, type ReceiveOptions as ad, type ReceiveRequest as ae, type RecoveryResult as af, type RegisteredAsset as ag, type RfqAuctionPolicy as ah, type RfqPreparation as ai, type RfqQuoteInput as aj, type RfqRendezvous as ak, type RfqTransportFactory as al, type RouteSide as am, SWAP_ERROR_NAMES as an, type SwapClient as ao, type SwapClientConfig as ap, type SwapDrive as aq, type SwapDriveConfig as ar, SwapDriveRefusedError as as, type SwapError as at, type SwapErrorName as au, type SwapFilter as av, UnsupportedRoute as aw, type VerbDeps as ax, acceptQuote as ay, attesting as az, type CorridorSet as b, readableRecord as b0, receive as b1, resolveCorridorBase as b2, resolveCorridorDeps as b3, rfqLeg as b4, rfqPairFor as b5, swapRecordOf as b6, toDiscoveryLeg as b7, usableMarkets as b8, verifyPlanLegs as b9, withCanonicalAmount as ba, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, AmbiguousDestination as g, AmountEncodingUnsupported as h, AmountMismatch as i, type AssetRfqPreparation as j, type AttestingRfqTransport 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 };
1568
+ export { NotCancellable as $, type AssetAliasTable as A, type CorridorPass as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorRfqPreparation as E, DEFAULT_MAX_REFUND_WINDOW_SECONDS as F, type DiscoveryConfig as G, type DiscoveryIndexInput as H, DiscoverySnapshotUnavailable as I, type DriveMode as J, type DriveRefusal as K, type LightningCorridorDeps as L, type MarketCandidate as M, type ExchangeOptions as N, type OnchainCorridorDeps as O, FEED_TTL_MS as P, type FeeCeiling as Q, type FeedFetch as R, type SwapPolicy as S, type FeedQuoteInput as T, INDEXED_NETWORKS as U, InconsistentRoute as V, InsufficientFunds as W, type LockupOwner as X, type Market as Y, MaxFeeExceeded as Z, MissingCorridorDep as _, type ArkadeCorridorDeps as a, quoteFromFeed as a$, ONCHAIN_CLAIM_FEE_RATE_SATVB as a0, type ObservationSeam as a1, type OfferPreparation as a2, type OnchainClaim as a3, OperatorUnreachable as a4, type ParsedRfqQuote as a5, type PayOptions as a6, type PayResult as a7, type QuoteCheck as a8, QuoteExpired as a9, attesting as aA, cancelSwap as aB, canonicalAssetId as aC, cardMarketOf as aD, chooseMarket as aE, conflictingFields as aF, corridorSet as aG, createSwapClient as aH, createSwapDrive as aI, discoveryIndex as aJ, eligibleMarkets as aK, enforceFeeCeiling as aL, exchange as aM, feedFetch as aN, feedSpread as aO, isAddressable as aP, isCardMarket as aQ, isIndexedNetwork as aR, isSwapError as aS, isUsableCard as aT, liveArkadeInfo as aU, marketBackendOf as aV, marketKeyOf as aW, marketRefOf as aX, nostrTransportFactory as aY, parseRfqQuote as aZ, pay as a_, type QuotePreparation as aa, QuoteVerificationFailed as ab, REGISTRY_URL as ac, type ReceiveArtifact as ad, type ReceiveOptions as ae, type ReceiveRequest as af, type RecoveryResult as ag, type RegisteredAsset as ah, type RfqAuctionPolicy as ai, type RfqPreparation as aj, type RfqQuoteInput as ak, type RfqRendezvous as al, type RfqTransportFactory as am, type RouteSide as an, SWAP_ERROR_NAMES as ao, type SwapClient as ap, type SwapClientConfig as aq, type SwapDrive as ar, type SwapDriveConfig as as, SwapDriveRefusedError as at, type SwapError as au, type SwapErrorName as av, type SwapFilter as aw, UnsupportedRoute as ax, type VerbDeps as ay, acceptQuote as az, type CorridorSet as b, quoteViaRfq as b0, readableRecord as b1, receive as b2, resolveCorridorBase as b3, resolveCorridorDeps as b4, rfqLeg as b5, rfqPairFor as b6, swapRecordOf as b7, toDiscoveryLeg as b8, usableMarkets as b9, verifyPlanLegs as ba, withCanonicalAmount as bb, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, AmbiguousDestination as g, AmountEncodingUnsupported as h, AmountMismatch as i, type AssetRfqPreparation as j, type AttestingRfqTransport 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 };
package/dist/index.cjs CHANGED
@@ -1970,6 +1970,7 @@ __export(index_exports, {
1970
1970
  BTC_ASSET_PART: () => BTC_ASSET_PART,
1971
1971
  CLAIM_PACKET_TYPE: () => CLAIM_PACKET_TYPE,
1972
1972
  ClientDisposed: () => ClientDisposed,
1973
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS: () => DEFAULT_MAX_REFUND_WINDOW_SECONDS,
1973
1974
  DiscoverySnapshotUnavailable: () => DiscoverySnapshotUnavailable,
1974
1975
  InMemoryAssetSwapRepository: () => InMemoryAssetSwapRepository,
1975
1976
  InconsistentRoute: () => InconsistentRoute,
@@ -6982,6 +6983,11 @@ var pinAmount = (input, takeInstrument) => {
6982
6983
 
6983
6984
  // src/client/verify.ts
6984
6985
  init_rfq();
6986
+
6987
+ // src/client/policy.ts
6988
+ var DEFAULT_MAX_REFUND_WINDOW_SECONDS = 30 * 24 * 3600;
6989
+
6990
+ // src/client/verify.ts
6985
6991
  var reasonOf = (error) => error instanceof Error && typeof error.reason === "string" ? error.reason : void 0;
6986
6992
  var CHECK_BY_REASON = {
6987
6993
  invoice_expired: "invoice",
@@ -7132,6 +7138,22 @@ var verifyQuoteTtl = (input) => {
7132
7138
  throw new QuoteExpired(input.quoteId, input.expiresAt, input.now);
7133
7139
  }
7134
7140
  };
7141
+ var CSV_GRANULARITY_SECONDS = 512;
7142
+ var verifyRefundWindow = (input) => {
7143
+ const max = input.maxSeconds ?? DEFAULT_MAX_REFUND_WINDOW_SECONDS;
7144
+ const window = input.refundLocktime - input.now;
7145
+ if (!(window <= max)) {
7146
+ throw new QuoteVerificationFailed("refund_window", `at most ${max}s`, `${window}s`);
7147
+ }
7148
+ const delay = input.refundWithoutReceiverDelay;
7149
+ if (delay !== void 0 && !(delay < max + CSV_GRANULARITY_SECONDS)) {
7150
+ throw new QuoteVerificationFailed(
7151
+ "refund_window",
7152
+ `a solo-refund delay of at most ${max}s`,
7153
+ `${delay}s`
7154
+ );
7155
+ }
7156
+ };
7135
7157
  var verifyQuotedAmount = (input) => {
7136
7158
  verifyPinnedAmount(input);
7137
7159
  if (input.take > input.give) {
@@ -7693,6 +7715,12 @@ var quoteLightningSend = async (input) => {
7693
7715
  now: input.now,
7694
7716
  invoiceExpiresAt: invoice.expiresAt
7695
7717
  });
7718
+ verifyRefundWindow({
7719
+ refundLocktime: derived.refundLocktime,
7720
+ refundWithoutReceiverDelay: derived.contractParams.refundWithoutReceiverDelay,
7721
+ now: input.now,
7722
+ maxSeconds: input.policy?.maxRefundWindowSeconds
7723
+ });
7696
7724
  verifyQuoteTtl({
7697
7725
  quoteId: input.quoteId,
7698
7726
  expiresAt: parsed.validUntil,
@@ -7895,6 +7923,11 @@ var quoteOnchainSend = async (input) => {
7895
7923
  direction: "send"
7896
7924
  }
7897
7925
  });
7926
+ verifyRefundWindow({
7927
+ refundLocktime: derived.refundLocktime,
7928
+ now: input.now,
7929
+ maxSeconds: input.policy?.maxRefundWindowSeconds
7930
+ });
7898
7931
  verifyQuoteTtl({
7899
7932
  quoteId: input.quoteId,
7900
7933
  expiresAt: parsed.validUntil,
@@ -8557,6 +8590,7 @@ function createSwapPaymentRouter(wallet, client, config) {
8557
8590
  BTC_ASSET_PART,
8558
8591
  CLAIM_PACKET_TYPE,
8559
8592
  ClientDisposed,
8593
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
8560
8594
  DiscoverySnapshotUnavailable,
8561
8595
  InMemoryAssetSwapRepository,
8562
8596
  InconsistentRoute,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AcceptConflict, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, A as AssetAliasTable, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, F as DiscoveryConfig, d as DiscoverySnapshot, H as DiscoverySnapshotUnavailable, I as DriveMode, K as ExchangeOptions, P as FeeCeiling, U as InconsistentRoute, V as InsufficientFunds, X as Market, Y as MaxFeeExceeded, Z as MissingCorridorDep, _ as NotCancellable, a3 as OperatorUnreachable, a5 as PayOptions, a6 as PayResult, a7 as QuoteCheck, a8 as QuoteExpired, aa as QuoteVerificationFailed, ab as REGISTRY_URL, ac as ReceiveArtifact, ad as ReceiveOptions, ae as ReceiveRequest, af as RecoveryResult, ag as RegisteredAsset, ah as RfqAuctionPolicy, al as RfqTransportFactory, an as SWAP_ERROR_NAMES, ao as SwapClient, ap as SwapClientConfig, as as SwapDriveRefusedError, at as SwapError, au as SwapErrorName, av as SwapFilter, S as SwapPolicy, aw as UnsupportedRoute, ax as VerbDeps, aB as canonicalAssetId, aG as createSwapClient, aL as exchange, aR as isSwapError, aZ as pay, b1 as receive } from './errors-hm7aqnRM.cjs';
1
+ export { e as AcceptConflict, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, A as AssetAliasTable, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, F as DEFAULT_MAX_REFUND_WINDOW_SECONDS, G as DiscoveryConfig, d as DiscoverySnapshot, I as DiscoverySnapshotUnavailable, J as DriveMode, N as ExchangeOptions, Q as FeeCeiling, V as InconsistentRoute, W as InsufficientFunds, Y as Market, Z as MaxFeeExceeded, _ as MissingCorridorDep, $ as NotCancellable, a4 as OperatorUnreachable, a6 as PayOptions, a7 as PayResult, a8 as QuoteCheck, a9 as QuoteExpired, ab as QuoteVerificationFailed, ac as REGISTRY_URL, ad as ReceiveArtifact, ae as ReceiveOptions, af as ReceiveRequest, ag as RecoveryResult, ah as RegisteredAsset, ai as RfqAuctionPolicy, am as RfqTransportFactory, ao as SWAP_ERROR_NAMES, ap as SwapClient, aq as SwapClientConfig, at as SwapDriveRefusedError, au as SwapError, av as SwapErrorName, aw as SwapFilter, S as SwapPolicy, ax as UnsupportedRoute, ay as VerbDeps, aC as canonicalAssetId, aH as createSwapClient, aM as exchange, aS as isSwapError, a_ as pay, b2 as receive } from './errors-BylRy7TR.cjs';
2
2
  import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b1 as MarketsCacheEntry, a4 as Outcome, ak as Swap, l as QuoteInput, i as RouteResolution, a6 as Quote, an as SwapUpdate, ao as Unsubscribe } from './repository-BuYWGAKz.cjs';
3
3
  export { o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, s as AmountRefusal, t as Artifact, A as AssetId, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetRef, B as AssetScale, D as AssetSwapId, E as AtomicDecimal, F as AuctionMarketRef, G as AuctionProvenance, H as BITCOIN_RAILS, J as BTC_ASSET_PART, K as BitcoinRail, U as CardMarketRef, V as CorridorId, W as CorridorKind, b as CorridorSwapRecord, X as DepositArtifact, Y as DisplayDecimal, Z as Endpoint, _ as Ep, b2 as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a1 as MarketBackend, a2 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a5 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, a7 as QuoteLeg, a8 as RAILS, R as Rail, ab as RankedBid, ac as RawState, ad as RecordedArtifact, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, j as ResolvedEndpoint, ah as RestoredMarketRef, b3 as RfqSwapState, k as Route, aj as SnapshotRef, b4 as SwapContractRegistry, al as SwapFamily, b5 as SwapOperator, am as SwapRecordCommon, ap as arkadeAsset, ar as assetPartOf, as as assetSwapIdOf, at as bitcoinNetworkOf, au as btcAssetPart, av as btcOn, aA as familyOfSwapId, aB as formatAssetId, aC as fromAtomicDecimal, aG as isAssetId, aH as isAtomicDecimal, aI as isBtcAsset, aJ as isBtcAssetLenient, aK as isNetworkRef, b6 as isRfqSwapTerminal, aL as issuanceOf, aO as parseAssetId, aP as quoteIdOfSwapId, aQ as railOf, aY as sameAsset, a_ as toAtomicDecimal } from './repository-BuYWGAKz.cjs';
4
4
  export { C as ChainSource, I as InvoiceFacts, a as RFQ_REFUSAL_ERROR_CODES, b as RfqRefusalDetail, c as RfqRefusalErrorCode, d as RfqRefusalUnit, S as SwapRefusal, i as isRfqRefusalErrorCode } from './rfq-60PGpQ_x.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AcceptConflict, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, A as AssetAliasTable, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, F as DiscoveryConfig, d as DiscoverySnapshot, H as DiscoverySnapshotUnavailable, I as DriveMode, K as ExchangeOptions, P as FeeCeiling, U as InconsistentRoute, V as InsufficientFunds, X as Market, Y as MaxFeeExceeded, Z as MissingCorridorDep, _ as NotCancellable, a3 as OperatorUnreachable, a5 as PayOptions, a6 as PayResult, a7 as QuoteCheck, a8 as QuoteExpired, aa as QuoteVerificationFailed, ab as REGISTRY_URL, ac as ReceiveArtifact, ad as ReceiveOptions, ae as ReceiveRequest, af as RecoveryResult, ag as RegisteredAsset, ah as RfqAuctionPolicy, al as RfqTransportFactory, an as SWAP_ERROR_NAMES, ao as SwapClient, ap as SwapClientConfig, as as SwapDriveRefusedError, at as SwapError, au as SwapErrorName, av as SwapFilter, S as SwapPolicy, aw as UnsupportedRoute, ax as VerbDeps, aB as canonicalAssetId, aG as createSwapClient, aL as exchange, aR as isSwapError, aZ as pay, b1 as receive } from './errors-C3h8ANmE.js';
1
+ export { e as AcceptConflict, g as AmbiguousDestination, h as AmountEncodingUnsupported, i as AmountMismatch, A as AssetAliasTable, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, F as DEFAULT_MAX_REFUND_WINDOW_SECONDS, G as DiscoveryConfig, d as DiscoverySnapshot, I as DiscoverySnapshotUnavailable, J as DriveMode, N as ExchangeOptions, Q as FeeCeiling, V as InconsistentRoute, W as InsufficientFunds, Y as Market, Z as MaxFeeExceeded, _ as MissingCorridorDep, $ as NotCancellable, a4 as OperatorUnreachable, a6 as PayOptions, a7 as PayResult, a8 as QuoteCheck, a9 as QuoteExpired, ab as QuoteVerificationFailed, ac as REGISTRY_URL, ad as ReceiveArtifact, ae as ReceiveOptions, af as ReceiveRequest, ag as RecoveryResult, ah as RegisteredAsset, ai as RfqAuctionPolicy, am as RfqTransportFactory, ao as SWAP_ERROR_NAMES, ap as SwapClient, aq as SwapClientConfig, at as SwapDriveRefusedError, au as SwapError, av as SwapErrorName, aw as SwapFilter, S as SwapPolicy, ax as UnsupportedRoute, ay as VerbDeps, aC as canonicalAssetId, aH as createSwapClient, aM as exchange, aS as isSwapError, a_ as pay, b2 as receive } from './errors-ZmzO8ukL.js';
2
2
  import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b1 as MarketsCacheEntry, a4 as Outcome, ak as Swap, l as QuoteInput, i as RouteResolution, a6 as Quote, an as SwapUpdate, ao as Unsubscribe } from './repository-DYnRLPt-.js';
3
3
  export { o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, s as AmountRefusal, t as Artifact, A as AssetId, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetRef, B as AssetScale, D as AssetSwapId, E as AtomicDecimal, F as AuctionMarketRef, G as AuctionProvenance, H as BITCOIN_RAILS, J as BTC_ASSET_PART, K as BitcoinRail, U as CardMarketRef, V as CorridorId, W as CorridorKind, b as CorridorSwapRecord, X as DepositArtifact, Y as DisplayDecimal, Z as Endpoint, _ as Ep, b2 as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a1 as MarketBackend, a2 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a5 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, a7 as QuoteLeg, a8 as RAILS, R as Rail, ab as RankedBid, ac as RawState, ad as RecordedArtifact, ae as RecordedEndpoint, af as RecordedInstrument, ag as RecordedLeg, j as ResolvedEndpoint, ah as RestoredMarketRef, b3 as RfqSwapState, k as Route, aj as SnapshotRef, b4 as SwapContractRegistry, al as SwapFamily, b5 as SwapOperator, am as SwapRecordCommon, ap as arkadeAsset, ar as assetPartOf, as as assetSwapIdOf, at as bitcoinNetworkOf, au as btcAssetPart, av as btcOn, aA as familyOfSwapId, aB as formatAssetId, aC as fromAtomicDecimal, aG as isAssetId, aH as isAtomicDecimal, aI as isBtcAsset, aJ as isBtcAssetLenient, aK as isNetworkRef, b6 as isRfqSwapTerminal, aL as issuanceOf, aO as parseAssetId, aP as quoteIdOfSwapId, aQ as railOf, aY as sameAsset, a_ as toAtomicDecimal } from './repository-DYnRLPt-.js';
4
4
  export { C as ChainSource, I as InvoiceFacts, a as RFQ_REFUSAL_ERROR_CODES, b as RfqRefusalDetail, c as RfqRefusalErrorCode, d as RfqRefusalUnit, S as SwapRefusal, i as isRfqRefusalErrorCode } from './rfq-60PGpQ_x.js';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  BITCOIN_RAILS,
11
11
  BTC_ASSET_PART,
12
12
  ClientDisposed,
13
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
13
14
  DiscoverySnapshotUnavailable,
14
15
  InconsistentRoute,
15
16
  InsufficientFunds,
@@ -61,7 +62,7 @@ import {
61
62
  sameAsset,
62
63
  swapHandle,
63
64
  toAtomicDecimal
64
- } from "./chunk-HUQQVBC4.js";
65
+ } from "./chunk-OT53STVX.js";
65
66
  import {
66
67
  isRfqSwapTerminal
67
68
  } from "./chunk-ITFCQWPG.js";
@@ -353,6 +354,7 @@ export {
353
354
  BTC_ASSET_PART,
354
355
  CLAIM_PACKET_TYPE,
355
356
  ClientDisposed,
357
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
356
358
  DiscoverySnapshotUnavailable,
357
359
  InMemoryAssetSwapRepository,
358
360
  InconsistentRoute,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/swap",
3
- "version": "0.1.0-rc.21",
3
+ "version": "0.1.0-rc.22",
4
4
  "type": "module",
5
5
  "description": "Client-side Arkade Intents asset swaps: state a route, get an outcome. Pay a bolt11 invoice, receive over Lightning, exchange assets, or withdraw onchain.",
6
6
  "repository": {
@@ -86,7 +86,7 @@
86
86
  "dist"
87
87
  ],
88
88
  "engines": {
89
- "node": ">=22.12.0"
89
+ "node": ">=22.13.0"
90
90
  },
91
91
  "keywords": [
92
92
  "arkade",
@@ -104,7 +104,7 @@
104
104
  "@scure/base": "2.4.0",
105
105
  "@scure/btc-signer": "2.4.1",
106
106
  "light-bolt11-decoder": "3.2.0",
107
- "@arkade-os/sdk": "0.5.0-rc.18"
107
+ "@arkade-os/sdk": "0.5.0-rc.19"
108
108
  },
109
109
  "peerDependencies": {
110
110
  "nostr-tools": "^2.12.0"