@arkade-os/swap 0.1.0-rc.26 → 0.1.0-rc.28

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 (38) hide show
  1. package/dist/advanced.cjs +475 -149
  2. package/dist/advanced.d.cts +9 -8
  3. package/dist/advanced.d.ts +9 -8
  4. package/dist/advanced.js +5 -3
  5. package/dist/{chunk-DHFKCTER.js → chunk-4X56MN56.js} +11 -2
  6. package/dist/{chunk-6O3L4AVI.js → chunk-DGHBRLCF.js} +42 -15
  7. package/dist/{chunk-XBMWEK43.js → chunk-ZF57EAJQ.js} +195 -126
  8. package/dist/index.cjs +473 -149
  9. package/dist/index.d.cts +7 -6
  10. package/dist/index.d.ts +7 -6
  11. package/dist/index.js +3 -3
  12. package/dist/{lockupContract-BTCGwjRH.d.cts → lockupContract-BE_tSx8i.d.cts} +1 -1
  13. package/dist/{lockupContract-BTCE7g83.d.ts → lockupContract-CYSMMrv4.d.ts} +1 -1
  14. package/dist/node/index.d.cts +9 -3
  15. package/dist/node/index.d.ts +9 -3
  16. package/dist/nostr.cjs +238 -86
  17. package/dist/nostr.d.cts +34 -2
  18. package/dist/nostr.d.ts +34 -2
  19. package/dist/nostr.js +227 -80
  20. package/dist/{offer-CsXgroM0.d.cts → offer-C_rgJU7J.d.cts} +1 -1
  21. package/dist/{offer-DYCiKDm6.d.ts → offer-Cr7AaLt-.d.ts} +1 -1
  22. package/dist/{offerFillPlan-CFT8qgTV.d.cts → offerFillPlan-B88PzcLr.d.cts} +13 -17
  23. package/dist/{offerFillPlan-BQnzburi.d.ts → offerFillPlan-DFMl7D3Q.d.ts} +13 -17
  24. package/dist/protocol.cjs +434 -209
  25. package/dist/protocol.d.cts +25 -39
  26. package/dist/protocol.d.ts +25 -39
  27. package/dist/protocol.js +8 -8
  28. package/dist/repositories/realm/index.d.cts +2 -2
  29. package/dist/repositories/realm/index.d.ts +2 -2
  30. package/dist/repositories/sqlite/index.d.cts +2 -2
  31. package/dist/repositories/sqlite/index.d.ts +2 -2
  32. package/dist/{repository-CSJXRd5N.d.ts → repository-CFNZUy2y.d.ts} +55 -103
  33. package/dist/{repository-Bgn0apiL.d.cts → repository-Cs60kDRs.d.cts} +55 -103
  34. package/dist/{rfq-m9tCbQx7.d.cts → rfq-CRiAHBBH.d.cts} +14 -2
  35. package/dist/{rfq-m9tCbQx7.d.ts → rfq-CRiAHBBH.d.ts} +14 -2
  36. package/dist/{watch-CLJXFpMq.d.cts → watch-BEgoHfHu.d.cts} +1 -1
  37. package/dist/{watch-D0R7YhYg.d.ts → watch-C7zGV8zh.d.ts} +1 -1
  38. package/package.json +4 -4
@@ -1,14 +1,15 @@
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 './offerFillPlan-CFT8qgTV.cjs';
2
- export { e as AcceptConflict, f as AcceptInput, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, k as AssetRfqPreparation, l as AttestingRfqTransport, B as BuildOfferFillPlanOpts, m as CORRIDOR_FACTORIES, n as CancelInput, o as CancelOutcome, p as ClaimedDestination, q as ClientDisposed, r as CorridorBase, s as CorridorClaim, t as CorridorCovenant, u as CorridorDeadline, v as CorridorDeps, w as CorridorDepsByCorridor, x as CorridorDrive, y as CorridorLockup, z as CorridorModule, E as CorridorOverrides, F as CorridorPass, G as CorridorRfqPreparation, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, J as DiscoveryIndexInput, K as DiscoverySnapshotUnavailable, N as DriveMode, P as DriveRefusal, Q as ExchangeOptions, R as FEED_TTL_MS, T as FeeCeiling, U as FeedFetch, V as FeedQuoteInput, W as FillSponsor, X as FillSponsorFare, Y as INDEXED_NETWORKS, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a0 as LockupOwner, a1 as Market, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OperatorUnreachable, ad as ParsedRfqQuote, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, ai as QuotePreparation, aj as QuoteVerificationFailed, ak as REGISTRY_URL, al as ReceiveArtifact, am as ReceiveOptions, an as ReceiveRequest, ao as RecoveryResult, ap as RegisteredAsset, aq as RfqAuctionPolicy, ar as RfqPreparation, as as RfqQuoteInput, at as RfqRendezvous, au as RfqTransportFactory, av as RouteSide, aw as SWAP_ERROR_NAMES, ax as SwapClient, ay as SwapClientConfig, az as SwapDrive, aA as SwapDriveConfig, aB as SwapDriveRefusedError, aC as SwapError, aD as SwapErrorName, aE as SwapFilter, aF as UnsupportedRoute, aG as VerbDeps, aH as acceptQuote, aI as attesting, aJ as buildOfferFillPlan, aK as cancelSwap, aL as canonicalAssetId, aM as cardMarketOf, aN as chooseMarket, aO as conflictingFields, aP as corridorSet, aQ as createSwapClient, aR as createSwapDrive, aS as deepFreeze, aT as digestJointGraph, aU as discoveryIndex, aV as eligibleMarkets, aW as enforceFeeCeiling, aX as exchange, aY as feedFetch, aZ as feedSpread, a_ as isAddressable, a$ as isCardMarket, b0 as isIndexedNetwork, b1 as isSwapError, b2 as isUsableCard, b3 as liveArkadeInfo, b4 as marketBackendOf, b5 as marketKeyOf, b6 as marketRefOf, b7 as nostrTransportFactory, b8 as parseRfqQuote, b9 as pay, ba as quoteFromFeed, bb as quoteViaRfq, bc as readableRecord, bd as receive, be as resolveCorridorBase, bf as resolveCorridorDeps, bg as rfqLeg, bh as rfqPairFor, bi as swapRecordOf, bj as toDiscoveryLeg, bk as unsignedPsbtBytes, bl as usableMarkets, bm as verifyJointGraph, bn as verifyOfferFillPlan, bo as verifyPlanLegs, bp as withCanonicalAmount } from './offerFillPlan-CFT8qgTV.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 './offerFillPlan-B88PzcLr.cjs';
2
+ export { e as AcceptConflict, f as AcceptInput, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, k as AssetRfqPreparation, l as AttestingRfqTransport, B as BuildOfferFillPlanOpts, m as CORRIDOR_FACTORIES, n as CancelInput, o as CancelOutcome, p as ClaimedDestination, q as ClientDisposed, r as CorridorBase, s as CorridorClaim, t as CorridorCovenant, u as CorridorDeadline, v as CorridorDeps, w as CorridorDepsByCorridor, x as CorridorDrive, y as CorridorLockup, z as CorridorModule, E as CorridorOverrides, F as CorridorPass, G as CorridorRfqPreparation, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, J as DiscoveryIndexInput, K as DiscoverySnapshotUnavailable, N as DriveMode, P as DriveRefusal, Q as ExchangeOptions, R as FEED_TTL_MS, T as FeeCeiling, U as FeedFetch, V as FeedQuoteInput, W as FillSponsor, X as FillSponsorFare, Y as INDEXED_NETWORKS, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a0 as LockupOwner, a1 as Market, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OperatorUnreachable, ad as ParsedRfqQuote, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, ai as QuotePreparation, aj as QuoteVerificationFailed, ak as REGISTRY_URL, al as ReceiveArtifact, am as ReceiveOptions, an as ReceiveRequest, ao as RecoveryResult, ap as RegisteredAsset, aq as RfqAuctionPolicy, ar as RfqPreparation, as as RfqQuoteInput, at as RfqRendezvous, au as RfqTransportFactory, av as RouteSide, aw as SWAP_ERROR_NAMES, ax as SwapClient, ay as SwapClientConfig, az as SwapDrive, aA as SwapDriveConfig, aB as SwapDriveRefusedError, aC as SwapError, aD as SwapErrorName, aE as SwapFilter, aF as UnsupportedRoute, aG as VerbDeps, aH as acceptQuote, aI as attesting, aJ as buildOfferFillPlan, aK as cancelSwap, aL as canonicalAssetId, aM as cardMarketOf, aN as chooseMarket, aO as conflictingFields, aP as corridorSet, aQ as createNostrTransportFactory, aR as createSwapClient, aS as createSwapDrive, aT as deepFreeze, aU as digestJointGraph, aV as discoveryIndex, aW as eligibleMarkets, aX as enforceFeeCeiling, aY as exchange, aZ as feedFetch, a_ as feedSpread, a$ as isAddressable, b0 as isCardMarket, b1 as isIndexedNetwork, b2 as isSwapError, b3 as isUsableCard, b4 as liveArkadeInfo, b5 as marketBackendOf, b6 as marketKeyOf, b7 as marketRefOf, b8 as nostrTransportFactory, b9 as parseRfqQuote, ba as pay, bb as quoteFromFeed, bc as quoteViaRfq, bd as readableRecord, be as receive, bf as resolveCorridorBase, bg as resolveCorridorDeps, bh as rfqLeg, bi as rfqPairFor, bj as swapRecordOf, bk as toDiscoveryLeg, bl as unsignedPsbtBytes, bm as usableMarkets, bn as verifyJointGraph, bo as verifyOfferFillPlan, bp as verifyPlanLegs, bq as withCanonicalAmount } from './offerFillPlan-B88PzcLr.cjs';
3
3
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
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-Bgn0apiL.cjs';
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 ArkadeCarrierChoice, u as Artifact, v as AssetIdError, w as AssetIdRefusal, x as AssetNamespace, y as AssetOn, z as AssetPart, B as AssetPaymentInput, D as AssetPaymentTerms, E as AssetRef, F as AssetScale, G as AssetSwapId, H as AtomicDecimal, J as AuctionMarketRef, K as AuctionProvenance, M as BITCOIN_RAILS, T as BTC_ASSET_PART, U as BitcoinRail, V as CORRIDORS, W as CORRIDOR_PASS, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, a2 as Hex, a3 as LOCKUP_OWNER, a4 as MarketBackend, a5 as MarketRef, a6 as OFFER_SWAP_ID_PREFIX, a7 as Outcome, a8 as ParsedAssetId, a9 as Quote, aa as QuoteLeg, ab as RAILS, ac as RFQ_SWAP_ID_PREFIX, ad as RailOf, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, am as RestoredMarketRef, an as RfqAmountSide, ao as SnapshotRef, ap as Swap, aq as SwapFamily, ar as SwapRecordCommon, as as SwapUpdate, at as TaxiIdentity, au as Unsubscribe, av as VerifiedCarrierTerms, aw as arkadeAsset, ax as artifactOf, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aD as corridorOfRail, aE as corridorOutcome, aF as decodeRfqAmount, aG as encodeRfqAmount, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aK as fromRfqAmountSide, aL as fundingWasNotSubmitted, aM as fundsFromWallet, aN as instrumentOf, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, aT as issuanceOf, aU as legOf, aV as offerOutcome, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, aZ as railOfCorridor, a_ as readsChain, a$ as recordArtifact, b0 as recordEndpoint, b1 as recordInstrument, b2 as recordLeg, b3 as recordOutcome, b4 as sameAsset, b5 as swapOf, b6 as toAtomicDecimal, b7 as toRfqAmountSide, b8 as toSafeNumber } from './repository-Bgn0apiL.cjs';
6
- import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-m9tCbQx7.cjs';
7
- export { S as SwapRefusal } from './rfq-m9tCbQx7.cjs';
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-Cs60kDRs.cjs';
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 ArkadeCarrierChoice, u as Artifact, v as AssetIdError, w as AssetIdRefusal, x as AssetNamespace, y as AssetOn, z as AssetPart, B as AssetPaymentInput, D as AssetPaymentTerms, E as AssetRef, F as AssetScale, G as AssetSwapId, H as AtomicDecimal, J as AuctionMarketRef, K as AuctionProvenance, M as BITCOIN_RAILS, T as BTC_ASSET_PART, U as BitcoinRail, V as CORRIDORS, W as CORRIDOR_PASS, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, a2 as Hex, a3 as LOCKUP_OWNER, a4 as MarketBackend, a5 as MarketRef, a6 as OFFER_SWAP_ID_PREFIX, a7 as Outcome, a8 as ParsedAssetId, a9 as Quote, aa as QuoteLeg, ab as RAILS, ac as RFQ_SWAP_ID_PREFIX, ad as RailOf, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, am as RestoredMarketRef, an as RfqAmountSide, ao as SnapshotRef, ap as Swap, aq as SwapFamily, ar as SwapRecordCommon, as as SwapUpdate, at as TaxiIdentity, au as Unsubscribe, av as VerifiedCarrierTerms, aw as arkadeAsset, ax as artifactOf, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aD as corridorOfRail, aE as corridorOutcome, aF as decodeRfqAmount, aG as encodeRfqAmount, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aK as fromRfqAmountSide, aL as fundingWasNotSubmitted, aM as fundsFromWallet, aN as instrumentOf, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, aT as issuanceOf, aU as legOf, aV as offerOutcome, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, aZ as railOfCorridor, a_ as readsChain, a$ as recordArtifact, b0 as recordEndpoint, b1 as recordInstrument, b2 as recordLeg, b3 as recordOutcome, b4 as sameAsset, b5 as swapOf, b6 as toAtomicDecimal, b7 as toRfqAmountSide, b8 as toSafeNumber } from './repository-Cs60kDRs.cjs';
6
+ import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-CRiAHBBH.cjs';
7
+ export { S as SwapRefusal } from './rfq-CRiAHBBH.cjs';
8
8
  import * as btc from '@scure/btc-signer';
9
9
  import { OnchainProvider, NetworkName, PageRequest, PageResult, IWallet, VHTLC } from '@arkade-os/sdk';
10
- import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-CLJXFpMq.cjs';
11
- import './offer-CsXgroM0.cjs';
10
+ import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-BEgoHfHu.cjs';
11
+ import './offer-C_rgJU7J.cjs';
12
+ import 'nostr-tools';
12
13
 
13
14
  /** The EVM leg's namespace. Which chain is the quote's `evm_chain_id`, not the pair. */
14
15
  declare const EVM_CHAIN = "ethereum";
@@ -1,14 +1,15 @@
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 './offerFillPlan-BQnzburi.js';
2
- export { e as AcceptConflict, f as AcceptInput, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, k as AssetRfqPreparation, l as AttestingRfqTransport, B as BuildOfferFillPlanOpts, m as CORRIDOR_FACTORIES, n as CancelInput, o as CancelOutcome, p as ClaimedDestination, q as ClientDisposed, r as CorridorBase, s as CorridorClaim, t as CorridorCovenant, u as CorridorDeadline, v as CorridorDeps, w as CorridorDepsByCorridor, x as CorridorDrive, y as CorridorLockup, z as CorridorModule, E as CorridorOverrides, F as CorridorPass, G as CorridorRfqPreparation, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, J as DiscoveryIndexInput, K as DiscoverySnapshotUnavailable, N as DriveMode, P as DriveRefusal, Q as ExchangeOptions, R as FEED_TTL_MS, T as FeeCeiling, U as FeedFetch, V as FeedQuoteInput, W as FillSponsor, X as FillSponsorFare, Y as INDEXED_NETWORKS, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a0 as LockupOwner, a1 as Market, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OperatorUnreachable, ad as ParsedRfqQuote, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, ai as QuotePreparation, aj as QuoteVerificationFailed, ak as REGISTRY_URL, al as ReceiveArtifact, am as ReceiveOptions, an as ReceiveRequest, ao as RecoveryResult, ap as RegisteredAsset, aq as RfqAuctionPolicy, ar as RfqPreparation, as as RfqQuoteInput, at as RfqRendezvous, au as RfqTransportFactory, av as RouteSide, aw as SWAP_ERROR_NAMES, ax as SwapClient, ay as SwapClientConfig, az as SwapDrive, aA as SwapDriveConfig, aB as SwapDriveRefusedError, aC as SwapError, aD as SwapErrorName, aE as SwapFilter, aF as UnsupportedRoute, aG as VerbDeps, aH as acceptQuote, aI as attesting, aJ as buildOfferFillPlan, aK as cancelSwap, aL as canonicalAssetId, aM as cardMarketOf, aN as chooseMarket, aO as conflictingFields, aP as corridorSet, aQ as createSwapClient, aR as createSwapDrive, aS as deepFreeze, aT as digestJointGraph, aU as discoveryIndex, aV as eligibleMarkets, aW as enforceFeeCeiling, aX as exchange, aY as feedFetch, aZ as feedSpread, a_ as isAddressable, a$ as isCardMarket, b0 as isIndexedNetwork, b1 as isSwapError, b2 as isUsableCard, b3 as liveArkadeInfo, b4 as marketBackendOf, b5 as marketKeyOf, b6 as marketRefOf, b7 as nostrTransportFactory, b8 as parseRfqQuote, b9 as pay, ba as quoteFromFeed, bb as quoteViaRfq, bc as readableRecord, bd as receive, be as resolveCorridorBase, bf as resolveCorridorDeps, bg as rfqLeg, bh as rfqPairFor, bi as swapRecordOf, bj as toDiscoveryLeg, bk as unsignedPsbtBytes, bl as usableMarkets, bm as verifyJointGraph, bn as verifyOfferFillPlan, bo as verifyPlanLegs, bp as withCanonicalAmount } from './offerFillPlan-BQnzburi.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 './offerFillPlan-DFMl7D3Q.js';
2
+ export { e as AcceptConflict, f as AcceptInput, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, k as AssetRfqPreparation, l as AttestingRfqTransport, B as BuildOfferFillPlanOpts, m as CORRIDOR_FACTORIES, n as CancelInput, o as CancelOutcome, p as ClaimedDestination, q as ClientDisposed, r as CorridorBase, s as CorridorClaim, t as CorridorCovenant, u as CorridorDeadline, v as CorridorDeps, w as CorridorDepsByCorridor, x as CorridorDrive, y as CorridorLockup, z as CorridorModule, E as CorridorOverrides, F as CorridorPass, G as CorridorRfqPreparation, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, J as DiscoveryIndexInput, K as DiscoverySnapshotUnavailable, N as DriveMode, P as DriveRefusal, Q as ExchangeOptions, R as FEED_TTL_MS, T as FeeCeiling, U as FeedFetch, V as FeedQuoteInput, W as FillSponsor, X as FillSponsorFare, Y as INDEXED_NETWORKS, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a0 as LockupOwner, a1 as Market, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, a7 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a8 as ObservationSeam, a9 as OfferPreparation, aa as OnchainClaim, ab as OnchainRefund, ac as OperatorUnreachable, ad as ParsedRfqQuote, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, ai as QuotePreparation, aj as QuoteVerificationFailed, ak as REGISTRY_URL, al as ReceiveArtifact, am as ReceiveOptions, an as ReceiveRequest, ao as RecoveryResult, ap as RegisteredAsset, aq as RfqAuctionPolicy, ar as RfqPreparation, as as RfqQuoteInput, at as RfqRendezvous, au as RfqTransportFactory, av as RouteSide, aw as SWAP_ERROR_NAMES, ax as SwapClient, ay as SwapClientConfig, az as SwapDrive, aA as SwapDriveConfig, aB as SwapDriveRefusedError, aC as SwapError, aD as SwapErrorName, aE as SwapFilter, aF as UnsupportedRoute, aG as VerbDeps, aH as acceptQuote, aI as attesting, aJ as buildOfferFillPlan, aK as cancelSwap, aL as canonicalAssetId, aM as cardMarketOf, aN as chooseMarket, aO as conflictingFields, aP as corridorSet, aQ as createNostrTransportFactory, aR as createSwapClient, aS as createSwapDrive, aT as deepFreeze, aU as digestJointGraph, aV as discoveryIndex, aW as eligibleMarkets, aX as enforceFeeCeiling, aY as exchange, aZ as feedFetch, a_ as feedSpread, a$ as isAddressable, b0 as isCardMarket, b1 as isIndexedNetwork, b2 as isSwapError, b3 as isUsableCard, b4 as liveArkadeInfo, b5 as marketBackendOf, b6 as marketKeyOf, b7 as marketRefOf, b8 as nostrTransportFactory, b9 as parseRfqQuote, ba as pay, bb as quoteFromFeed, bc as quoteViaRfq, bd as readableRecord, be as receive, bf as resolveCorridorBase, bg as resolveCorridorDeps, bh as rfqLeg, bi as rfqPairFor, bj as swapRecordOf, bk as toDiscoveryLeg, bl as unsignedPsbtBytes, bm as usableMarkets, bn as verifyJointGraph, bo as verifyOfferFillPlan, bp as verifyPlanLegs, bq as withCanonicalAmount } from './offerFillPlan-DFMl7D3Q.js';
3
3
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
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-CSJXRd5N.js';
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 ArkadeCarrierChoice, u as Artifact, v as AssetIdError, w as AssetIdRefusal, x as AssetNamespace, y as AssetOn, z as AssetPart, B as AssetPaymentInput, D as AssetPaymentTerms, E as AssetRef, F as AssetScale, G as AssetSwapId, H as AtomicDecimal, J as AuctionMarketRef, K as AuctionProvenance, M as BITCOIN_RAILS, T as BTC_ASSET_PART, U as BitcoinRail, V as CORRIDORS, W as CORRIDOR_PASS, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, a2 as Hex, a3 as LOCKUP_OWNER, a4 as MarketBackend, a5 as MarketRef, a6 as OFFER_SWAP_ID_PREFIX, a7 as Outcome, a8 as ParsedAssetId, a9 as Quote, aa as QuoteLeg, ab as RAILS, ac as RFQ_SWAP_ID_PREFIX, ad as RailOf, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, am as RestoredMarketRef, an as RfqAmountSide, ao as SnapshotRef, ap as Swap, aq as SwapFamily, ar as SwapRecordCommon, as as SwapUpdate, at as TaxiIdentity, au as Unsubscribe, av as VerifiedCarrierTerms, aw as arkadeAsset, ax as artifactOf, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aD as corridorOfRail, aE as corridorOutcome, aF as decodeRfqAmount, aG as encodeRfqAmount, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aK as fromRfqAmountSide, aL as fundingWasNotSubmitted, aM as fundsFromWallet, aN as instrumentOf, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, aT as issuanceOf, aU as legOf, aV as offerOutcome, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, aZ as railOfCorridor, a_ as readsChain, a$ as recordArtifact, b0 as recordEndpoint, b1 as recordInstrument, b2 as recordLeg, b3 as recordOutcome, b4 as sameAsset, b5 as swapOf, b6 as toAtomicDecimal, b7 as toRfqAmountSide, b8 as toSafeNumber } from './repository-CSJXRd5N.js';
6
- import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-m9tCbQx7.js';
7
- export { S as SwapRefusal } from './rfq-m9tCbQx7.js';
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-CFNZUy2y.js';
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 ArkadeCarrierChoice, u as Artifact, v as AssetIdError, w as AssetIdRefusal, x as AssetNamespace, y as AssetOn, z as AssetPart, B as AssetPaymentInput, D as AssetPaymentTerms, E as AssetRef, F as AssetScale, G as AssetSwapId, H as AtomicDecimal, J as AuctionMarketRef, K as AuctionProvenance, M as BITCOIN_RAILS, T as BTC_ASSET_PART, U as BitcoinRail, V as CORRIDORS, W as CORRIDOR_PASS, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, a2 as Hex, a3 as LOCKUP_OWNER, a4 as MarketBackend, a5 as MarketRef, a6 as OFFER_SWAP_ID_PREFIX, a7 as Outcome, a8 as ParsedAssetId, a9 as Quote, aa as QuoteLeg, ab as RAILS, ac as RFQ_SWAP_ID_PREFIX, ad as RailOf, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, am as RestoredMarketRef, an as RfqAmountSide, ao as SnapshotRef, ap as Swap, aq as SwapFamily, ar as SwapRecordCommon, as as SwapUpdate, at as TaxiIdentity, au as Unsubscribe, av as VerifiedCarrierTerms, aw as arkadeAsset, ax as artifactOf, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aD as corridorOfRail, aE as corridorOutcome, aF as decodeRfqAmount, aG as encodeRfqAmount, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aK as fromRfqAmountSide, aL as fundingWasNotSubmitted, aM as fundsFromWallet, aN as instrumentOf, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, aT as issuanceOf, aU as legOf, aV as offerOutcome, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, aZ as railOfCorridor, a_ as readsChain, a$ as recordArtifact, b0 as recordEndpoint, b1 as recordInstrument, b2 as recordLeg, b3 as recordOutcome, b4 as sameAsset, b5 as swapOf, b6 as toAtomicDecimal, b7 as toRfqAmountSide, b8 as toSafeNumber } from './repository-CFNZUy2y.js';
6
+ import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-CRiAHBBH.js';
7
+ export { S as SwapRefusal } from './rfq-CRiAHBBH.js';
8
8
  import * as btc from '@scure/btc-signer';
9
9
  import { OnchainProvider, NetworkName, PageRequest, PageResult, IWallet, VHTLC } from '@arkade-os/sdk';
10
- import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-D0R7YhYg.js';
11
- import './offer-DYCiKDm6.js';
10
+ import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-C7zGV8zh.js';
11
+ import './offer-Cr7AaLt-.js';
12
+ import 'nostr-tools';
12
13
 
13
14
  /** The EVM leg's namespace. Which chain is the quote's `evm_chain_id`, not the pair. */
14
15
  declare const EVM_CHAIN = "ethereum";
package/dist/advanced.js CHANGED
@@ -52,6 +52,7 @@ import {
52
52
  corridorOfRail,
53
53
  corridorRecordStore,
54
54
  corridorSet,
55
+ createNostrTransportFactory,
55
56
  createSwapClient,
56
57
  createSwapDrive,
57
58
  decodeBolt11,
@@ -135,7 +136,7 @@ import {
135
136
  withCanonicalAmount,
136
137
  withDepositFate,
137
138
  withRfqState
138
- } from "./chunk-6O3L4AVI.js";
139
+ } from "./chunk-DGHBRLCF.js";
139
140
  import {
140
141
  ACTIVITY_TOKEN,
141
142
  Amount,
@@ -170,7 +171,7 @@ import {
170
171
  recordOutcome,
171
172
  swapOf,
172
173
  toAtomicDecimal
173
- } from "./chunk-XBMWEK43.js";
174
+ } from "./chunk-ZF57EAJQ.js";
174
175
  import {
175
176
  ARKADE_BTC,
176
177
  SwapRefusal,
@@ -178,7 +179,7 @@ import {
178
179
  assertPreimageMatches,
179
180
  rfqPair,
180
181
  sealClaimPacket
181
- } from "./chunk-DHFKCTER.js";
182
+ } from "./chunk-4X56MN56.js";
182
183
  import "./chunk-A3SHHRX4.js";
183
184
 
184
185
  // src/reveal.ts
@@ -599,6 +600,7 @@ export {
599
600
  corridorRecordStore,
600
601
  corridorSet,
601
602
  covclaimdClient,
603
+ createNostrTransportFactory,
602
604
  createSwapClient,
603
605
  createSwapDrive,
604
606
  decodeBolt11,
@@ -1323,6 +1323,7 @@ import * as btc from "@scure/btc-signer";
1323
1323
  import { assertTimerMs } from "@arkade-os/sdk";
1324
1324
  var ONCHAIN_ORDER_MARGIN_SECONDS = 2 * 60 * 60;
1325
1325
  var ONCHAIN_CLAIM_MARGIN_SECONDS = 90 * 60;
1326
+ var ONCHAIN_CLAIM_BUMP_SECONDS = 20 * 60;
1326
1327
  var MAX_MIN_CONFIRMATIONS = 6;
1327
1328
  var LOCKTIME_THRESHOLD = 5e8;
1328
1329
  var ONCHAIN_SECONDS_PER_BLOCK = 600;
@@ -1495,6 +1496,13 @@ var buildHtlcRefund = (input) => buildLeafSpend({
1495
1496
  // any value below 0xffffffff enables nLockTime enforcement
1496
1497
  sequence: 4294967294
1497
1498
  });
1499
+ function nextClaimFeeRate(input) {
1500
+ const last = input.lastSatVb;
1501
+ const estimate = Number.isFinite(input.estimateSatVb) ? input.estimateSatVb : 0;
1502
+ const wanted = last === void 0 ? Math.max(input.configuredSatVb, estimate) : input.bump ? Math.max(Math.ceil(last * 1.5), last + 1, estimate) : Math.max(last, estimate);
1503
+ const affordable = Number((input.utxoAmount - ONCHAIN_DUST_SATS) / BigInt(ONCHAIN_CLAIM_VSIZE));
1504
+ return Math.max(last ?? input.configuredSatVb, Math.min(wanted, affordable));
1505
+ }
1498
1506
  function extractPreimage(txHex, paymentHash) {
1499
1507
  let raw;
1500
1508
  try {
@@ -1522,7 +1530,7 @@ async function awaitOnchainFill(chain, htlc, minConfirmations, options = {}) {
1522
1530
  }
1523
1531
  async function claimOnchainFill(chain, input) {
1524
1532
  const now = input.now ?? Math.floor(Date.now() / 1e3);
1525
- if (input.htlc.refundLocktime - now < ONCHAIN_CLAIM_MARGIN_SECONDS) {
1533
+ if (!input.republish && input.htlc.refundLocktime - now < ONCHAIN_CLAIM_MARGIN_SECONDS) {
1526
1534
  throw gateError(
1527
1535
  "claim_window_closed",
1528
1536
  "refund leaf opens too soon to claim safely \u2014 take the covenant refund instead"
@@ -2932,6 +2940,7 @@ export {
2932
2940
  lockupContractParams,
2933
2941
  ONCHAIN_ORDER_MARGIN_SECONDS,
2934
2942
  ONCHAIN_CLAIM_MARGIN_SECONDS,
2943
+ ONCHAIN_CLAIM_BUMP_SECONDS,
2935
2944
  MAX_MIN_CONFIRMATIONS,
2936
2945
  LOCKTIME_THRESHOLD,
2937
2946
  ONCHAIN_SECONDS_PER_BLOCK,
@@ -2941,13 +2950,13 @@ export {
2941
2950
  paymentHashOf,
2942
2951
  assertPreimageMatches,
2943
2952
  gateError,
2944
- sleep,
2945
2953
  pollUntil,
2946
2954
  L1_NETWORKS,
2947
2955
  l1ScriptForAddress,
2948
2956
  onchainHtlcScript,
2949
2957
  buildHtlcClaim,
2950
2958
  buildHtlcRefund,
2959
+ nextClaimFeeRate,
2951
2960
  extractPreimage,
2952
2961
  awaitOnchainFill,
2953
2962
  claimOnchainFill,
@@ -57,7 +57,7 @@ import {
57
57
  undeliveredCarry,
58
58
  walletOperator,
59
59
  watchOfferSwaps
60
- } from "./chunk-XBMWEK43.js";
60
+ } from "./chunk-ZF57EAJQ.js";
61
61
  import {
62
62
  ARKADE_BTC,
63
63
  ASSET_CARRIER_SATS,
@@ -95,6 +95,7 @@ import {
95
95
  lightningSendRequest,
96
96
  lockupContractParams,
97
97
  newRfqId,
98
+ nextClaimFeeRate,
98
99
  offerTermsFromQuote,
99
100
  onchainReceiveRequest,
100
101
  onchainSendRequest,
@@ -117,7 +118,7 @@ import {
117
118
  sealClaimPacket,
118
119
  unilateralClaimDelay,
119
120
  verifyOfferAddress
120
- } from "./chunk-DHFKCTER.js";
121
+ } from "./chunk-4X56MN56.js";
121
122
  import {
122
123
  assertRfqSwapPageFilter,
123
124
  collectAssetSwaps,
@@ -1126,6 +1127,12 @@ var chainSourceOver = (backend, network) => {
1126
1127
  },
1127
1128
  async getMtp() {
1128
1129
  return (await backend.tip()).mtp;
1130
+ },
1131
+ async getTxStatus(txid) {
1132
+ return (await backend.provider.getTxStatus(txid)).confirmed ? "confirmed" : "unconfirmed";
1133
+ },
1134
+ getFeeRate() {
1135
+ return backend.provider.getFeeRate();
1129
1136
  }
1130
1137
  };
1131
1138
  };
@@ -2108,8 +2115,15 @@ var createSwapDrive = (config) => {
2108
2115
  touch(swap.rfqId, swap);
2109
2116
  });
2110
2117
  let onchainSeams;
2118
+ const liveFeeRate = async (chain) => {
2119
+ try {
2120
+ return await chain.getFeeRate?.();
2121
+ } catch {
2122
+ return void 0;
2123
+ }
2124
+ };
2111
2125
  const defaultOnchainClaim = (chain, feeRateSatVb) => {
2112
- return async (swap, utxo) => {
2126
+ return async (swap, utxo, options) => {
2113
2127
  const record = await corridorStore().getRfqSwap(swap.rfqId);
2114
2128
  if (!record) {
2115
2129
  throw new Error(`rfq swap ${swap.rfqId} has no stored record to claim from`);
@@ -2130,17 +2144,25 @@ var createSwapDrive = (config) => {
2130
2144
  if (!swap.payoutPkScript) {
2131
2145
  throw new Error(`rfq swap ${swap.rfqId} carries no claim payout script`);
2132
2146
  }
2147
+ const rate = nextClaimFeeRate({
2148
+ configuredSatVb: feeRateSatVb,
2149
+ utxoAmount: utxo.amount,
2150
+ estimateSatVb: await liveFeeRate(chain),
2151
+ ...swap.claimFeeRateSatVb === void 0 ? {} : { lastSatVb: swap.claimFeeRateSatVb },
2152
+ ...options?.bump ? { bump: true } : {}
2153
+ });
2133
2154
  const { txid } = await track(
2134
2155
  claimOnchainFill(chain, {
2135
2156
  htlc: swap.htlc,
2136
2157
  utxo,
2137
2158
  preimage,
2138
2159
  payoutPkScript: swap.payoutPkScript,
2139
- feeRateSatVb,
2140
- sign: (sighash) => signer.signMessage(sighash, "schnorr")
2160
+ feeRateSatVb: rate,
2161
+ sign: (sighash) => signer.signMessage(sighash, "schnorr"),
2162
+ ...swap.claimTxid ? { republish: true } : {}
2141
2163
  })
2142
2164
  );
2143
- return { txid };
2165
+ return { txid, feeRateSatVb: rate };
2144
2166
  };
2145
2167
  };
2146
2168
  const defaultOnchainRefund = (chain, feeRateSatVb) => {
@@ -4212,16 +4234,20 @@ var exchange = async (deps, options) => settle(
4212
4234
 
4213
4235
  // src/client/transport.ts
4214
4236
  var attesting = (transport, responder) => Object.assign(transport, { attestedResponder: responder });
4215
- var nostrTransportFactory = async (rendezvous) => {
4216
- const { nostrRfqTransport } = await import("./nostr.js");
4217
- return attesting(
4218
- nostrRfqTransport({
4219
- relays: [...rendezvous.relays],
4220
- solverPubkey: rendezvous.solverPubkey
4221
- }),
4222
- rendezvous.solverPubkey
4223
- );
4237
+ var createNostrTransportFactory = (pool) => {
4238
+ return async (rendezvous) => {
4239
+ const { nostrRfqTransport } = await import("./nostr.js");
4240
+ return attesting(
4241
+ nostrRfqTransport({
4242
+ relays: [...rendezvous.relays],
4243
+ solverPubkey: rendezvous.solverPubkey,
4244
+ ...pool === void 0 ? {} : { pool }
4245
+ }),
4246
+ rendezvous.solverPubkey
4247
+ );
4248
+ };
4224
4249
  };
4250
+ var nostrTransportFactory = createNostrTransportFactory();
4225
4251
 
4226
4252
  // src/client/client.ts
4227
4253
  import { hex as hex9 } from "@scure/base";
@@ -4766,6 +4792,7 @@ export {
4766
4792
  receive,
4767
4793
  exchange,
4768
4794
  attesting,
4795
+ createNostrTransportFactory,
4769
4796
  nostrTransportFactory,
4770
4797
  createSwapClient,
4771
4798
  OFFER_FILL_TEMPLATE,