@arkade-os/swap 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/advanced.cjs +1097 -541
  2. package/dist/advanced.d.cts +19 -21
  3. package/dist/advanced.d.ts +19 -21
  4. package/dist/advanced.js +40 -34
  5. package/dist/{chunk-FQNG4XMF.js → chunk-2HQZLIVX.js} +98 -37
  6. package/dist/{chunk-5QPJWOCN.js → chunk-6RJVT65W.js} +2 -0
  7. package/dist/chunk-AUJDREZN.js +445 -0
  8. package/dist/{chunk-I7WEXXZX.js → chunk-FWRDAL73.js} +157 -477
  9. package/dist/{chunk-552GDPBU.js → chunk-LCO6AJOS.js} +433 -59
  10. package/dist/index.cjs +1083 -530
  11. package/dist/index.d.cts +5 -6
  12. package/dist/index.d.ts +5 -6
  13. package/dist/index.js +24 -22
  14. package/dist/{lockupContract-DguuT7NK.d.cts → lockupContract-BTTRVwOt.d.cts} +1 -1
  15. package/dist/{lockupContract-BUOsghl1.d.ts → lockupContract-aFarhlxj.d.ts} +1 -1
  16. package/dist/node/index.d.cts +97 -67
  17. package/dist/node/index.d.ts +97 -67
  18. package/dist/nostr.cjs +925 -516
  19. package/dist/nostr.d.cts +1 -1
  20. package/dist/nostr.d.ts +1 -1
  21. package/dist/nostr.js +3 -2
  22. package/dist/{offerFillPlan-_AOLo6kh.d.ts → offerFillPlan-CJC5tnEd.d.ts} +10 -42
  23. package/dist/{offerFillPlan-Bp6-z6dS.d.cts → offerFillPlan-FmyaQoYT.d.cts} +10 -42
  24. package/dist/protocol.cjs +1054 -175
  25. package/dist/protocol.d.cts +42 -23
  26. package/dist/protocol.d.ts +42 -23
  27. package/dist/protocol.js +20 -7
  28. package/dist/repositories/realm/index.d.cts +3 -2
  29. package/dist/repositories/realm/index.d.ts +3 -2
  30. package/dist/repositories/sqlite/index.d.cts +3 -2
  31. package/dist/repositories/sqlite/index.d.ts +3 -2
  32. package/dist/{repository-CkKK0dGO.d.ts → repository-CwwhIAEd.d.cts} +406 -74
  33. package/dist/{repository--pfikw2R.d.cts → repository-DO6QKxBx.d.ts} +406 -74
  34. package/dist/{rfq-IzhOCG02.d.ts → rfq-CYxOyniL.d.ts} +52 -11
  35. package/dist/rfq-contract.cjs +3 -0
  36. package/dist/rfq-contract.d.cts +3 -1
  37. package/dist/rfq-contract.d.ts +3 -1
  38. package/dist/rfq-contract.js +3 -1
  39. package/dist/{rfq-BRpo5uWU.d.cts → rfq-nMGywkqI.d.cts} +52 -11
  40. package/dist/verify-ENO36VPK.js +33 -0
  41. package/dist/{watch-pvTVFp6-.d.cts → watch-DpDSP2tu.d.cts} +4 -3
  42. package/dist/{watch-DDNycuUa.d.ts → watch-_fZSgx_l.d.ts} +4 -3
  43. package/package.json +2 -2
  44. package/dist/offer-BhonWuKR.d.ts +0 -274
  45. package/dist/offer-D_qHpWo2.d.cts +0 -274
package/dist/index.d.cts CHANGED
@@ -1,11 +1,10 @@
1
- export { e as AcceptConflict, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, A as AssetAliasTable, B as BuildOfferFillPlanOpts, o as CancelOutcome, q as ClientDisposed, E as CorridorOverrides, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, d as DiscoverySnapshot, K as DiscoverySnapshotUnavailable, N as DriveMode, Q as ExchangeOptions, T as FeeCeiling, W as FillSponsor, X as FillSponsorFare, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a1 as Market, a2 as MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, ad as OperatorUnreachable, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, ak as QuoteVerificationFailed, al as REGISTRY_URL, am as ReceiveArtifact, an as ReceiveOptions, ao as ReceiveRequest, ap as RecoveryResult, aq as RegisteredAsset, ar as RfqAuctionPolicy, av as RfqTransportFactory, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, S as SwapPolicy, aG as UnsupportedRoute, aH as VerbDeps, aK as buildOfferFillPlan, aM as canonicalAssetId, aS as createSwapClient, aU as deepFreeze, aV as digestJointGraph, aZ as exchange, b3 as isSwapError, bd as pay, bh as receive, bo as unsignedPsbtBytes, bq as verifyJointGraph, br as verifyOfferFillPlan } from './offerFillPlan-Bp6-z6dS.cjs';
2
- import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry, a7 as Outcome, ap as Swap, l as QuoteInput, i as RouteResolution, a9 as Quote, as as SwapUpdate, au as Unsubscribe } from './repository--pfikw2R.cjs';
3
- export { o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, s as AmountRefusal, t as ArkadeCarrierChoice, u as Artifact, A as AssetId, 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, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, b as CorridorSwapRecord, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, ba as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a4 as MarketBackend, a5 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a8 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, aa as QuoteLeg, ab as RAILS, R as Rail, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, j as ResolvedEndpoint, am as RestoredMarketRef, bb as RfqSwapState, k as Route, ao as SnapshotRef, bc as SwapContractRegistry, aq as SwapFamily, bd as SwapOperator, ar as SwapRecordCommon, at as TaxiIdentity, av as VerifiedCarrierTerms, aw as arkadeAsset, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, be as isRfqSwapTerminal, aT as issuanceOf, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, b4 as sameAsset, b6 as toAtomicDecimal } from './repository--pfikw2R.cjs';
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, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-BRpo5uWU.cjs';
1
+ export { e as AcceptConflict, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, A as AssetAliasTable, B as BuildOfferFillPlanOpts, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, G as DEFAULT_MAX_REFUND_WINDOW_SECONDS, H as DiscoveryConfig, d as DiscoverySnapshot, J as DiscoverySnapshotUnavailable, K as DriveMode, P as ExchangeOptions, R as FeeCeiling, V as FillSponsor, W as FillSponsorFare, Y as InconsistentRoute, Z as InsufficientFunds, _ as JointGraph, a0 as Market, a1 as MarketLeg, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, ac as OperatorUnreachable, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, 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, au as SWAP_ERROR_NAMES, av as SwapClient, aw as SwapClientConfig, az as SwapDriveRefusedError, aA as SwapError, aB as SwapErrorName, aC as SwapFilter, S as SwapPolicy, aD as UnsupportedRoute, aE as VerbDeps, aG as buildOfferFillPlan, aI as canonicalAssetId, aN as createSwapClient, aP as deepFreeze, aQ as digestJointGraph, aU as exchange, a_ as isSwapError, b7 as pay, bb as receive, bi as unsignedPsbtBytes, bk as verifyJointGraph, bl as verifyOfferFillPlan } from './offerFillPlan-FmyaQoYT.cjs';
2
+ export { C as ChainSource, I as InvoiceFacts, e as RFQ_REFUSAL_ERROR_CODES, f as RfqRefusalDetail, g as RfqRefusalErrorCode, h as RfqRefusalUnit, b as RfqTransportFactory, S as SwapRefusal, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-nMGywkqI.cjs';
3
+ import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b7 as MarketsCacheEntry, a5 as Outcome, an as Swap, l as QuoteInput, i as RouteResolution, a7 as Quote, aq as SwapUpdate, as as Unsubscribe } from './repository-CwwhIAEd.cjs';
4
+ export { n as ARKADE_ASSET_NAMESPACE, o as Amount, p as AmountFormatError, r as AmountRefusal, s as ArkadeCarrierChoice, t as Artifact, A as AssetId, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetPaymentInput, B as AssetPaymentTerms, D as AssetRef, E as AssetScale, F as AssetSwapId, G as AtomicDecimal, H as AuctionMarketRef, J as AuctionProvenance, K as BITCOIN_RAILS, M as BTC_ASSET_PART, T as BitcoinRail, W as CardMarketRef, X as CorridorId, Y as CorridorKind, b as CorridorSwapRecord, Z as DepositArtifact, _ as DisplayDecimal, $ as Endpoint, a0 as Ep, b8 as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a2 as MarketBackend, a3 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a6 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, a8 as QuoteLeg, a9 as RAILS, R as Rail, ac as RankedBid, ad as RawState, ae as ReceiverPaidCarrierQuote, af as RecordedArtifact, ag as RecordedAssetPayment, ah as RecordedEndpoint, ai as RecordedInstrument, aj as RecordedLeg, j as ResolvedEndpoint, ak as RestoredMarketRef, b9 as RfqSwapState, k as Route, am as SnapshotRef, ba as SwapContractRegistry, ao as SwapFamily, bb as SwapOperator, ap as SwapRecordCommon, ar as TaxiIdentity, at as VerifiedCarrierTerms, au as arkadeAsset, aw as assetPartOf, ax as assetSwapIdOf, ay as bitcoinNetworkOf, az as btcAssetPart, aA as btcOn, aF as familyOfSwapId, aG as formatAssetId, aH as fromAtomicDecimal, aM as isAssetId, aN as isAtomicDecimal, aO as isBtcAsset, aP as isBtcAssetLenient, aQ as isNetworkRef, bc as isRfqSwapTerminal, aR as issuanceOf, aU as parseAssetId, aV as quoteIdOfSwapId, aW as railOf, b2 as sameAsset, b4 as toAtomicDecimal } from './repository-CwwhIAEd.cjs';
5
5
  import { PageRequest, PageResult, PaymentHandle, PaymentRail, RouterPreferences, Wallet, PaymentRouter, PaymentStatus } from '@arkade-os/sdk';
6
- export { C as CLAIM_PACKET_TYPE, a as ClaimPacketShape, L as LockupRegistrationFailed, S as SEALED_CIPHERTEXT_LENGTH, b as appendArkadeScript, c as claimPacketShape } from './lockupContract-DguuT7NK.cjs';
6
+ export { C as CLAIM_PACKET_TYPE, a as ClaimPacketShape, L as LockupRegistrationFailed, S as SEALED_CIPHERTEXT_LENGTH, b as appendArkadeScript, c as claimPacketShape } from './lockupContract-BTTRVwOt.cjs';
7
7
  import '@arkade-os/solver-discovery';
8
- import './offer-D_qHpWo2.cjs';
9
8
  import './rfq-contract.cjs';
10
9
  import 'nostr-tools';
11
10
 
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- export { e as AcceptConflict, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, A as AssetAliasTable, B as BuildOfferFillPlanOpts, o as CancelOutcome, q as ClientDisposed, E as CorridorOverrides, H as DEFAULT_MAX_REFUND_WINDOW_SECONDS, I as DiscoveryConfig, d as DiscoverySnapshot, K as DiscoverySnapshotUnavailable, N as DriveMode, Q as ExchangeOptions, T as FeeCeiling, W as FillSponsor, X as FillSponsorFare, Z as InconsistentRoute, _ as InsufficientFunds, $ as JointGraph, a1 as Market, a2 as MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, ad as OperatorUnreachable, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, ak as QuoteVerificationFailed, al as REGISTRY_URL, am as ReceiveArtifact, an as ReceiveOptions, ao as ReceiveRequest, ap as RecoveryResult, aq as RegisteredAsset, ar as RfqAuctionPolicy, av as RfqTransportFactory, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, S as SwapPolicy, aG as UnsupportedRoute, aH as VerbDeps, aK as buildOfferFillPlan, aM as canonicalAssetId, aS as createSwapClient, aU as deepFreeze, aV as digestJointGraph, aZ as exchange, b3 as isSwapError, bd as pay, bh as receive, bo as unsignedPsbtBytes, bq as verifyJointGraph, br as verifyOfferFillPlan } from './offerFillPlan-_AOLo6kh.js';
2
- import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry, a7 as Outcome, ap as Swap, l as QuoteInput, i as RouteResolution, a9 as Quote, as as SwapUpdate, au as Unsubscribe } from './repository-CkKK0dGO.js';
3
- export { o as ARKADE_ASSET_NAMESPACE, p as Amount, q as AmountFormatError, s as AmountRefusal, t as ArkadeCarrierChoice, u as Artifact, A as AssetId, 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, X as CardMarketRef, Y as CorridorId, Z as CorridorKind, b as CorridorSwapRecord, _ as DepositArtifact, $ as DisplayDecimal, a0 as Endpoint, a1 as Ep, ba as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a4 as MarketBackend, a5 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a8 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, aa as QuoteLeg, ab as RAILS, R as Rail, ae as RankedBid, af as RawState, ag as ReceiverPaidCarrierQuote, ah as RecordedArtifact, ai as RecordedAssetPayment, aj as RecordedEndpoint, ak as RecordedInstrument, al as RecordedLeg, j as ResolvedEndpoint, am as RestoredMarketRef, bb as RfqSwapState, k as Route, ao as SnapshotRef, bc as SwapContractRegistry, aq as SwapFamily, bd as SwapOperator, ar as SwapRecordCommon, at as TaxiIdentity, av as VerifiedCarrierTerms, aw as arkadeAsset, ay as assetPartOf, az as assetSwapIdOf, aA as bitcoinNetworkOf, aB as btcAssetPart, aC as btcOn, aH as familyOfSwapId, aI as formatAssetId, aJ as fromAtomicDecimal, aO as isAssetId, aP as isAtomicDecimal, aQ as isBtcAsset, aR as isBtcAssetLenient, aS as isNetworkRef, be as isRfqSwapTerminal, aT as issuanceOf, aW as parseAssetId, aX as quoteIdOfSwapId, aY as railOf, b4 as sameAsset, b6 as toAtomicDecimal } from './repository-CkKK0dGO.js';
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, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-IzhOCG02.js';
1
+ export { e as AcceptConflict, g as AcceptOptions, h as AmbiguousDestination, i as AmountEncodingUnsupported, j as AmountMismatch, A as AssetAliasTable, B as BuildOfferFillPlanOpts, n as CancelOutcome, p as ClientDisposed, z as CorridorOverrides, G as DEFAULT_MAX_REFUND_WINDOW_SECONDS, H as DiscoveryConfig, d as DiscoverySnapshot, J as DiscoverySnapshotUnavailable, K as DriveMode, P as ExchangeOptions, R as FeeCeiling, V as FillSponsor, W as FillSponsorFare, Y as InconsistentRoute, Z as InsufficientFunds, _ as JointGraph, a0 as Market, a1 as MarketLeg, a2 as MaxFeeExceeded, a3 as MissingCorridorDep, a4 as NotCancellable, a5 as OFFER_FILL_OWNERS, a6 as OFFER_FILL_TEMPLATE, ac as OperatorUnreachable, ae as PayOptions, af as PayResult, ag as QuoteCheck, ah as QuoteExpired, 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, au as SWAP_ERROR_NAMES, av as SwapClient, aw as SwapClientConfig, az as SwapDriveRefusedError, aA as SwapError, aB as SwapErrorName, aC as SwapFilter, S as SwapPolicy, aD as UnsupportedRoute, aE as VerbDeps, aG as buildOfferFillPlan, aI as canonicalAssetId, aN as createSwapClient, aP as deepFreeze, aQ as digestJointGraph, aU as exchange, a_ as isSwapError, b7 as pay, bb as receive, bi as unsignedPsbtBytes, bk as verifyJointGraph, bl as verifyOfferFillPlan } from './offerFillPlan-CJC5tnEd.js';
2
+ export { C as ChainSource, I as InvoiceFacts, e as RFQ_REFUSAL_ERROR_CODES, f as RfqRefusalDetail, g as RfqRefusalErrorCode, h as RfqRefusalUnit, b as RfqTransportFactory, S as SwapRefusal, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-CYxOyniL.js';
3
+ import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b7 as MarketsCacheEntry, a5 as Outcome, an as Swap, l as QuoteInput, i as RouteResolution, a7 as Quote, aq as SwapUpdate, as as Unsubscribe } from './repository-DO6QKxBx.js';
4
+ export { n as ARKADE_ASSET_NAMESPACE, o as Amount, p as AmountFormatError, r as AmountRefusal, s as ArkadeCarrierChoice, t as Artifact, A as AssetId, u as AssetIdError, v as AssetIdRefusal, w as AssetNamespace, x as AssetOn, y as AssetPart, z as AssetPaymentInput, B as AssetPaymentTerms, D as AssetRef, E as AssetScale, F as AssetSwapId, G as AtomicDecimal, H as AuctionMarketRef, J as AuctionProvenance, K as BITCOIN_RAILS, M as BTC_ASSET_PART, T as BitcoinRail, W as CardMarketRef, X as CorridorId, Y as CorridorKind, b as CorridorSwapRecord, Z as DepositArtifact, _ as DisplayDecimal, $ as Endpoint, a0 as Ep, b8 as InMemoryAssetSwapRepository, I as Instrument, L as LockupSpendIndexer, a2 as MarketBackend, a3 as MarketRef, N as NetworkRef, O as OfferSwapRecord, a6 as ParsedAssetId, P as PinnedAmount, Q as QuoteId, a8 as QuoteLeg, a9 as RAILS, R as Rail, ac as RankedBid, ad as RawState, ae as ReceiverPaidCarrierQuote, af as RecordedArtifact, ag as RecordedAssetPayment, ah as RecordedEndpoint, ai as RecordedInstrument, aj as RecordedLeg, j as ResolvedEndpoint, ak as RestoredMarketRef, b9 as RfqSwapState, k as Route, am as SnapshotRef, ba as SwapContractRegistry, ao as SwapFamily, bb as SwapOperator, ap as SwapRecordCommon, ar as TaxiIdentity, at as VerifiedCarrierTerms, au as arkadeAsset, aw as assetPartOf, ax as assetSwapIdOf, ay as bitcoinNetworkOf, az as btcAssetPart, aA as btcOn, aF as familyOfSwapId, aG as formatAssetId, aH as fromAtomicDecimal, aM as isAssetId, aN as isAtomicDecimal, aO as isBtcAsset, aP as isBtcAssetLenient, aQ as isNetworkRef, bc as isRfqSwapTerminal, aR as issuanceOf, aU as parseAssetId, aV as quoteIdOfSwapId, aW as railOf, b2 as sameAsset, b4 as toAtomicDecimal } from './repository-DO6QKxBx.js';
5
5
  import { PageRequest, PageResult, PaymentHandle, PaymentRail, RouterPreferences, Wallet, PaymentRouter, PaymentStatus } from '@arkade-os/sdk';
6
- export { C as CLAIM_PACKET_TYPE, a as ClaimPacketShape, L as LockupRegistrationFailed, S as SEALED_CIPHERTEXT_LENGTH, b as appendArkadeScript, c as claimPacketShape } from './lockupContract-BUOsghl1.js';
6
+ export { C as CLAIM_PACKET_TYPE, a as ClaimPacketShape, L as LockupRegistrationFailed, S as SEALED_CIPHERTEXT_LENGTH, b as appendArkadeScript, c as claimPacketShape } from './lockupContract-aFarhlxj.js';
7
7
  import '@arkade-os/solver-discovery';
8
- import './offer-BhonWuKR.js';
9
8
  import './rfq-contract.js';
10
9
  import 'nostr-tools';
11
10
 
package/dist/index.js CHANGED
@@ -1,33 +1,16 @@
1
1
  import {
2
2
  ARKADE_ASSET_NAMESPACE,
3
- AcceptConflict,
4
- AmbiguousDestination,
5
- AmountEncodingUnsupported,
6
- AmountMismatch,
7
3
  AssetIdError,
8
4
  BITCOIN_RAILS,
9
5
  BTC_ASSET_PART,
10
- ClientDisposed,
11
- DEFAULT_MAX_REFUND_WINDOW_SECONDS,
12
- DiscoverySnapshotUnavailable,
13
- InconsistentRoute,
14
- InsufficientFunds,
15
- MaxFeeExceeded,
16
- MissingCorridorDep,
17
- NotCancellable,
18
6
  OFFER_FILL_OWNERS,
19
7
  OFFER_FILL_TEMPLATE,
20
8
  ONCHAIN_SWAP_RAIL,
21
- OperatorUnreachable,
22
9
  PAYMENT_STATUS,
23
- QuoteExpired,
24
- QuoteVerificationFailed,
25
10
  RAILS,
26
11
  REGISTRY_URL,
27
- SWAP_ERROR_NAMES,
28
12
  SwapDriveRefusedError,
29
13
  SwapPaymentFailedError,
30
- UnsupportedRoute,
31
14
  arkadeAsset,
32
15
  assetPartOf,
33
16
  bitcoinNetworkOf,
@@ -45,7 +28,6 @@ import {
45
28
  isBtcAsset,
46
29
  isBtcAssetLenient,
47
30
  isNetworkRef,
48
- isSwapError,
49
31
  isTerminalStatus,
50
32
  issuanceOf,
51
33
  onchainSwapRail,
@@ -62,7 +44,7 @@ import {
62
44
  unsignedPsbtBytes,
63
45
  verifyJointGraph,
64
46
  verifyOfferFillPlan
65
- } from "./chunk-I7WEXXZX.js";
47
+ } from "./chunk-FWRDAL73.js";
66
48
  import {
67
49
  Amount,
68
50
  AmountFormatError,
@@ -73,7 +55,27 @@ import {
73
55
  isRfqSwapTerminal,
74
56
  quoteIdOfSwapId,
75
57
  toAtomicDecimal
76
- } from "./chunk-FQNG4XMF.js";
58
+ } from "./chunk-2HQZLIVX.js";
59
+ import {
60
+ AcceptConflict,
61
+ AmbiguousDestination,
62
+ AmountEncodingUnsupported,
63
+ AmountMismatch,
64
+ ClientDisposed,
65
+ DEFAULT_MAX_REFUND_WINDOW_SECONDS,
66
+ DiscoverySnapshotUnavailable,
67
+ InconsistentRoute,
68
+ InsufficientFunds,
69
+ MaxFeeExceeded,
70
+ MissingCorridorDep,
71
+ NotCancellable,
72
+ OperatorUnreachable,
73
+ QuoteExpired,
74
+ QuoteVerificationFailed,
75
+ SWAP_ERROR_NAMES,
76
+ UnsupportedRoute,
77
+ isSwapError
78
+ } from "./chunk-AUJDREZN.js";
77
79
  import {
78
80
  CLAIM_PACKET_TYPE,
79
81
  LockupRegistrationFailed,
@@ -83,8 +85,8 @@ import {
83
85
  appendArkadeScript,
84
86
  claimPacketShape,
85
87
  isRfqRefusalErrorCode
86
- } from "./chunk-552GDPBU.js";
87
- import "./chunk-5QPJWOCN.js";
88
+ } from "./chunk-LCO6AJOS.js";
89
+ import "./chunk-6RJVT65W.js";
88
90
  import {
89
91
  InMemoryAssetSwapRepository,
90
92
  assertRfqSwapPageFilter,
@@ -1,4 +1,4 @@
1
- import { C as CoverageRegistrationOptions } from './offer-D_qHpWo2.cjs';
1
+ import { cu as CoverageRegistrationOptions } from './repository-CwwhIAEd.cjs';
2
2
  import { VHTLC, IContractManager } from '@arkade-os/sdk';
3
3
 
4
4
  interface SealedClaimPacket {
@@ -1,4 +1,4 @@
1
- import { C as CoverageRegistrationOptions } from './offer-BhonWuKR.js';
1
+ import { cu as CoverageRegistrationOptions } from './repository-DO6QKxBx.js';
2
2
  import { VHTLC, IContractManager } from '@arkade-os/sdk';
3
3
 
4
4
  interface SealedClaimPacket {
@@ -1,6 +1,6 @@
1
1
  import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
2
2
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
3
- import { VHTLC, InputExpiryFloor, NetworkName, PageRequest, PageResult } from '@arkade-os/sdk';
3
+ import { RelativeTimelock, VHTLC, InputExpiryFloor, NetworkName, PageRequest, PageResult } from '@arkade-os/sdk';
4
4
 
5
5
  /**
6
6
  * The platform's per-user configuration directory: `%APPDATA%` on Windows (falling back to the
@@ -14,6 +14,85 @@ declare const configDir: (env?: NodeJS.ProcessEnv) => string;
14
14
  */
15
15
  declare const swapDatabasePath: (network: string, env?: NodeJS.ProcessEnv) => string;
16
16
 
17
+ declare const ASSET_SWAP_V2 = "asset-swap-v2";
18
+ declare const ASSET_SWAP_V3 = "asset-swap-v3";
19
+ /** v3 whose `fulfill` also needs the quoting solver's `taker` signature. */
20
+ declare const ASSET_SWAP_V4 = "asset-swap-v4";
21
+
22
+ type AssetSwapContractVersion = typeof ASSET_SWAP_V2 | typeof ASSET_SWAP_V3 | typeof ASSET_SWAP_V4;
23
+
24
+ /**
25
+ * Where a monitored RFQ swap stands, and which of those states end it. Its own module so the
26
+ * record layer (retention via {@link isRfqSwapTerminal}) and the manager need not import each
27
+ * other at runtime; `swapManager.ts` re-exports all three names.
28
+ */
29
+ /**
30
+ * Where a monitored swap stands; the vocabulary of `CorridorSwapRecord.state`. `Outcome`, from
31
+ * `client.onUpdate()`, is the client-level projection over it.
32
+ *
33
+ * `claimable`/`claimed` apply when the TRADER has something to claim: the L1 fill on an onchain
34
+ * send, the solver-funded lockup on a receive. `lightning_send` has neither; the trader's only
35
+ * move there is the refund.
36
+ */
37
+ type RfqSwapState =
38
+ /** Live; nothing actionable yet. On a receive leg this covers the whole
39
+ * stretch before the solver funds anything. */
40
+ "pending"
41
+ /** There is something for the trader to take, and the window to take it is
42
+ * open: the confirmed L1 fill on an onchain send, or a lockup funded for at
43
+ * least `expectedAmount` on a receive. */
44
+ | "claimable"
45
+ /**
46
+ * The trader's claim has been made (L1 broadcast on an onchain send, Arkade submission on a
47
+ * receive). **On a receive this is a local belief, not a chain fact**, hence not terminal:
48
+ * `refunded` is still reachable if the claim never lands.
49
+ */
50
+ | "claimed"
51
+ /**
52
+ * This wallet will not act, and only the counterparty can change that
53
+ * (`RfqSwapCommon.blockedReason` says why).
54
+ *
55
+ * Send leg: the Arkade refund cannot be pushed from here (no secrets, foreign descriptor, or
56
+ * nothing wired). Receive leg: the lockup cannot be claimed — underfunded (publishing `P`
57
+ * for it is the attack `LockupAmountMismatchError` refuses) or its claim window shut.
58
+ *
59
+ * **Not terminal.** The money is still at the lockup and the refusal is re-checked every
60
+ * pass, so fixing the cause returns the swap to `pending`. On an onchain send the L1 half
61
+ * keeps being driven regardless.
62
+ */
63
+ | "needs_counterparty"
64
+ /**
65
+ * Terminal: the lockup was spent by a hash-verified claim, read off chain, never reported.
66
+ * On a send leg it is the counterparty's claim; on a receive leg the TRADER's own, matched by
67
+ * hash rather than our txid so a claim that lands without us still counts.
68
+ */
69
+ | "settled"
70
+ /**
71
+ * Terminal: the lockup was spent by something other than a claim. On a send leg that is the
72
+ * money coming back. **On a receive leg it is a LOSS**: every non-claim leaf is the
73
+ * solver's. Also where a receive swap ends when its window closes with nothing to observe.
74
+ */
75
+ | "refunded"
76
+ /** Terminal: an action failed and its window closed. */
77
+ | "failed";
78
+
79
+ /** {@link OfferBinding} as a record stores it: hex and decimal strings, so the record stays JSON. */
80
+ interface RecordedOfferBinding {
81
+ readonly version: AssetSwapContractVersion;
82
+ readonly receiverPkScript: string;
83
+ readonly amount: string;
84
+ readonly wantAsset?: string;
85
+ readonly offerAsset?: string;
86
+ readonly userPublicKey: string;
87
+ readonly serverPublicKey: string;
88
+ readonly emulatorPublicKey: string;
89
+ readonly exitDelay?: {
90
+ readonly type: RelativeTimelock["type"];
91
+ readonly value: string;
92
+ };
93
+ readonly taker?: string;
94
+ }
95
+
17
96
  /** @deprecated Use `Outcome`. Moved off the package root to `@arkade-os/swap/protocol`. */
18
97
  type AssetSwapStatus = "pending" | "cancelling" | "fulfilled" | "cancelled" | "recoverable" | "awaiting_fill" | "claimable" | "claimed" | "refunded_l1";
19
98
  /**
@@ -48,8 +127,10 @@ interface AssetSwap extends SwapSecretsProjection {
48
127
  swapAddress: string;
49
128
  /** Hex pkScript of the swap contract — the indexer monitoring key. */
50
129
  swapPkScript: string;
51
- /** TLV offer — needed to rebuild the contract for cancel. */
52
- offerHex: string;
130
+ /** TLV offer — rebuilds the contract for cancel when there is no `binding`. */
131
+ offerHex?: string;
132
+ /** The covenant, structured. A directed offer carries this and no `offerHex`. */
133
+ binding?: RecordedOfferBinding;
53
134
  fundingTxid: string;
54
135
  spentTxid?: string;
55
136
  status: AssetSwapStatus;
@@ -85,59 +166,13 @@ interface OnchainHtlc {
85
166
  }
86
167
 
87
168
  /**
88
- * Where a monitored RFQ swap stands, and which of those states end it. Its own module so the
89
- * record layer (retention via {@link isRfqSwapTerminal}) and the manager need not import each
90
- * other at runtime; `swapManager.ts` re-exports all three names.
91
- */
92
- /**
93
- * Where a monitored swap stands; the vocabulary of `CorridorSwapRecord.state`. `Outcome`, from
94
- * `client.onUpdate()`, is the client-level projection over it.
95
- *
96
- * `claimable`/`claimed` apply when the TRADER has something to claim: the L1 fill on an onchain
97
- * send, the solver-funded lockup on a receive. `lightning_send` has neither; the trader's only
98
- * move there is the refund.
99
- */
100
- type RfqSwapState =
101
- /** Live; nothing actionable yet. On a receive leg this covers the whole
102
- * stretch before the solver funds anything. */
103
- "pending"
104
- /** There is something for the trader to take, and the window to take it is
105
- * open: the confirmed L1 fill on an onchain send, or a lockup funded for at
106
- * least `expectedAmount` on a receive. */
107
- | "claimable"
108
- /**
109
- * The trader's claim has been made (L1 broadcast on an onchain send, Arkade submission on a
110
- * receive). **On a receive this is a local belief, not a chain fact**, hence not terminal:
111
- * `refunded` is still reachable if the claim never lands.
112
- */
113
- | "claimed"
114
- /**
115
- * This wallet will not act, and only the counterparty can change that
116
- * (`RfqSwapCommon.blockedReason` says why).
117
- *
118
- * Send leg: the Arkade refund cannot be pushed from here (no secrets, foreign descriptor, or
119
- * nothing wired). Receive leg: the lockup cannot be claimed — underfunded (publishing `P`
120
- * for it is the attack `LockupAmountMismatchError` refuses) or its claim window shut.
121
- *
122
- * **Not terminal.** The money is still at the lockup and the refusal is re-checked every
123
- * pass, so fixing the cause returns the swap to `pending`. On an onchain send the L1 half
124
- * keeps being driven regardless.
125
- */
126
- | "needs_counterparty"
127
- /**
128
- * Terminal: the lockup was spent by a hash-verified claim, read off chain, never reported.
129
- * On a send leg it is the counterparty's claim; on a receive leg the TRADER's own, matched by
130
- * hash rather than our txid so a claim that lands without us still counts.
131
- */
132
- | "settled"
133
- /**
134
- * Terminal: the lockup was spent by something other than a claim. On a send leg that is the
135
- * money coming back. **On a receive leg it is a LOSS**: every non-claim leaf is the
136
- * solver's. Also where a receive swap ends when its window closes with nothing to observe.
169
+ * The two string aliases the v2 surface is written in. Aliases rather than branded types, so
170
+ * literals need no constructor.
137
171
  */
138
- | "refunded"
139
- /** Terminal: an action failed and its window closed. */
140
- | "failed";
172
+ /** Lowercase hex, no `0x` prefix — the encoding `@scure/base`'s `hex` emits. */
173
+ type Hex = string;
174
+ /** A secp256k1 public key as {@link Hex}: x-only (32 bytes) or compressed (33). */
175
+ type Pubkey = Hex;
141
176
 
142
177
  /**
143
178
  * What the manager needs to register a swap's lockup with the wallet, so the indexer
@@ -442,15 +477,6 @@ type Corridor = (typeof CORRIDORS)[number];
442
477
  * purpose — which chains a registry lists is a listing decision, not an id-grammar one. */
443
478
  type CorridorId = Corridor | `eip155:${number}`;
444
479
 
445
- /**
446
- * The two string aliases the v2 surface is written in. Aliases rather than branded types, so
447
- * literals need no constructor.
448
- */
449
- /** Lowercase hex, no `0x` prefix — the encoding `@scure/base`'s `hex` emits. */
450
- type Hex = string;
451
- /** A secp256k1 public key as {@link Hex}: x-only (32 bytes) or compressed (33). */
452
- type Pubkey = Hex;
453
-
454
480
  /**
455
481
  * A quote's identity, minted by the client at quote time on every backend: feed-priced quotes
456
482
  * have no solver id, and `accept()` is idempotent by quote id *only* (§3.2).
@@ -605,19 +631,23 @@ interface SwapRecordCommon {
605
631
  readonly createdAt: number;
606
632
  readonly updatedAt: number;
607
633
  }
608
- /** `arkade <-> arkade`: the offer covenant. `offerHex` is the whole covenant, so no tree params. */
634
+ /** `arkade <-> arkade`: the offer covenant, whole in `binding` or `offerHex`, so no tree params. */
609
635
  interface OfferSwapRecord extends SwapRecordCommon {
610
636
  readonly family: "offer";
611
637
  /** v1's raw status vocabulary, read verbatim by the drive's `RawState`. */
612
638
  readonly status: AssetSwapStatus;
613
- /** The TLV offer, hex. The only input `cancelOffer` needs. */
614
- readonly offerHex: string;
639
+ /** The TLV offer, hex: what rebuilds the covenant when there is no `binding`. */
640
+ readonly offerHex?: string;
641
+ /** The covenant, structured. A directed swap carries this and no `offerHex`. */
642
+ readonly binding?: RecordedOfferBinding;
615
643
  readonly swapAddress: string;
616
644
  /** The covenant's scriptPubKey, hex — the indexer's monitoring key and the reconcile's match key. */
617
645
  readonly swapPkScript: string;
618
646
  /** Sats riding an asset deposit, decimal: the solver's published carrier, which the fill is
619
647
  * priced against. Absent for a BTC deposit and for feed-priced swaps (the SDK default). */
620
648
  readonly carrierSats?: string;
649
+ /** `false`: the funding carries no offer packet. Absent attaches it. */
650
+ readonly attachOfferPacket?: false;
621
651
  readonly spentTxid?: string;
622
652
  readonly completedAt?: number;
623
653
  }
@@ -1,6 +1,6 @@
1
1
  import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
2
2
  import { DiscoveredMarket } from '@arkade-os/solver-discovery';
3
- import { VHTLC, InputExpiryFloor, NetworkName, PageRequest, PageResult } from '@arkade-os/sdk';
3
+ import { RelativeTimelock, VHTLC, InputExpiryFloor, NetworkName, PageRequest, PageResult } from '@arkade-os/sdk';
4
4
 
5
5
  /**
6
6
  * The platform's per-user configuration directory: `%APPDATA%` on Windows (falling back to the
@@ -14,6 +14,85 @@ declare const configDir: (env?: NodeJS.ProcessEnv) => string;
14
14
  */
15
15
  declare const swapDatabasePath: (network: string, env?: NodeJS.ProcessEnv) => string;
16
16
 
17
+ declare const ASSET_SWAP_V2 = "asset-swap-v2";
18
+ declare const ASSET_SWAP_V3 = "asset-swap-v3";
19
+ /** v3 whose `fulfill` also needs the quoting solver's `taker` signature. */
20
+ declare const ASSET_SWAP_V4 = "asset-swap-v4";
21
+
22
+ type AssetSwapContractVersion = typeof ASSET_SWAP_V2 | typeof ASSET_SWAP_V3 | typeof ASSET_SWAP_V4;
23
+
24
+ /**
25
+ * Where a monitored RFQ swap stands, and which of those states end it. Its own module so the
26
+ * record layer (retention via {@link isRfqSwapTerminal}) and the manager need not import each
27
+ * other at runtime; `swapManager.ts` re-exports all three names.
28
+ */
29
+ /**
30
+ * Where a monitored swap stands; the vocabulary of `CorridorSwapRecord.state`. `Outcome`, from
31
+ * `client.onUpdate()`, is the client-level projection over it.
32
+ *
33
+ * `claimable`/`claimed` apply when the TRADER has something to claim: the L1 fill on an onchain
34
+ * send, the solver-funded lockup on a receive. `lightning_send` has neither; the trader's only
35
+ * move there is the refund.
36
+ */
37
+ type RfqSwapState =
38
+ /** Live; nothing actionable yet. On a receive leg this covers the whole
39
+ * stretch before the solver funds anything. */
40
+ "pending"
41
+ /** There is something for the trader to take, and the window to take it is
42
+ * open: the confirmed L1 fill on an onchain send, or a lockup funded for at
43
+ * least `expectedAmount` on a receive. */
44
+ | "claimable"
45
+ /**
46
+ * The trader's claim has been made (L1 broadcast on an onchain send, Arkade submission on a
47
+ * receive). **On a receive this is a local belief, not a chain fact**, hence not terminal:
48
+ * `refunded` is still reachable if the claim never lands.
49
+ */
50
+ | "claimed"
51
+ /**
52
+ * This wallet will not act, and only the counterparty can change that
53
+ * (`RfqSwapCommon.blockedReason` says why).
54
+ *
55
+ * Send leg: the Arkade refund cannot be pushed from here (no secrets, foreign descriptor, or
56
+ * nothing wired). Receive leg: the lockup cannot be claimed — underfunded (publishing `P`
57
+ * for it is the attack `LockupAmountMismatchError` refuses) or its claim window shut.
58
+ *
59
+ * **Not terminal.** The money is still at the lockup and the refusal is re-checked every
60
+ * pass, so fixing the cause returns the swap to `pending`. On an onchain send the L1 half
61
+ * keeps being driven regardless.
62
+ */
63
+ | "needs_counterparty"
64
+ /**
65
+ * Terminal: the lockup was spent by a hash-verified claim, read off chain, never reported.
66
+ * On a send leg it is the counterparty's claim; on a receive leg the TRADER's own, matched by
67
+ * hash rather than our txid so a claim that lands without us still counts.
68
+ */
69
+ | "settled"
70
+ /**
71
+ * Terminal: the lockup was spent by something other than a claim. On a send leg that is the
72
+ * money coming back. **On a receive leg it is a LOSS**: every non-claim leaf is the
73
+ * solver's. Also where a receive swap ends when its window closes with nothing to observe.
74
+ */
75
+ | "refunded"
76
+ /** Terminal: an action failed and its window closed. */
77
+ | "failed";
78
+
79
+ /** {@link OfferBinding} as a record stores it: hex and decimal strings, so the record stays JSON. */
80
+ interface RecordedOfferBinding {
81
+ readonly version: AssetSwapContractVersion;
82
+ readonly receiverPkScript: string;
83
+ readonly amount: string;
84
+ readonly wantAsset?: string;
85
+ readonly offerAsset?: string;
86
+ readonly userPublicKey: string;
87
+ readonly serverPublicKey: string;
88
+ readonly emulatorPublicKey: string;
89
+ readonly exitDelay?: {
90
+ readonly type: RelativeTimelock["type"];
91
+ readonly value: string;
92
+ };
93
+ readonly taker?: string;
94
+ }
95
+
17
96
  /** @deprecated Use `Outcome`. Moved off the package root to `@arkade-os/swap/protocol`. */
18
97
  type AssetSwapStatus = "pending" | "cancelling" | "fulfilled" | "cancelled" | "recoverable" | "awaiting_fill" | "claimable" | "claimed" | "refunded_l1";
19
98
  /**
@@ -48,8 +127,10 @@ interface AssetSwap extends SwapSecretsProjection {
48
127
  swapAddress: string;
49
128
  /** Hex pkScript of the swap contract — the indexer monitoring key. */
50
129
  swapPkScript: string;
51
- /** TLV offer — needed to rebuild the contract for cancel. */
52
- offerHex: string;
130
+ /** TLV offer — rebuilds the contract for cancel when there is no `binding`. */
131
+ offerHex?: string;
132
+ /** The covenant, structured. A directed offer carries this and no `offerHex`. */
133
+ binding?: RecordedOfferBinding;
53
134
  fundingTxid: string;
54
135
  spentTxid?: string;
55
136
  status: AssetSwapStatus;
@@ -85,59 +166,13 @@ interface OnchainHtlc {
85
166
  }
86
167
 
87
168
  /**
88
- * Where a monitored RFQ swap stands, and which of those states end it. Its own module so the
89
- * record layer (retention via {@link isRfqSwapTerminal}) and the manager need not import each
90
- * other at runtime; `swapManager.ts` re-exports all three names.
91
- */
92
- /**
93
- * Where a monitored swap stands; the vocabulary of `CorridorSwapRecord.state`. `Outcome`, from
94
- * `client.onUpdate()`, is the client-level projection over it.
95
- *
96
- * `claimable`/`claimed` apply when the TRADER has something to claim: the L1 fill on an onchain
97
- * send, the solver-funded lockup on a receive. `lightning_send` has neither; the trader's only
98
- * move there is the refund.
99
- */
100
- type RfqSwapState =
101
- /** Live; nothing actionable yet. On a receive leg this covers the whole
102
- * stretch before the solver funds anything. */
103
- "pending"
104
- /** There is something for the trader to take, and the window to take it is
105
- * open: the confirmed L1 fill on an onchain send, or a lockup funded for at
106
- * least `expectedAmount` on a receive. */
107
- | "claimable"
108
- /**
109
- * The trader's claim has been made (L1 broadcast on an onchain send, Arkade submission on a
110
- * receive). **On a receive this is a local belief, not a chain fact**, hence not terminal:
111
- * `refunded` is still reachable if the claim never lands.
112
- */
113
- | "claimed"
114
- /**
115
- * This wallet will not act, and only the counterparty can change that
116
- * (`RfqSwapCommon.blockedReason` says why).
117
- *
118
- * Send leg: the Arkade refund cannot be pushed from here (no secrets, foreign descriptor, or
119
- * nothing wired). Receive leg: the lockup cannot be claimed — underfunded (publishing `P`
120
- * for it is the attack `LockupAmountMismatchError` refuses) or its claim window shut.
121
- *
122
- * **Not terminal.** The money is still at the lockup and the refusal is re-checked every
123
- * pass, so fixing the cause returns the swap to `pending`. On an onchain send the L1 half
124
- * keeps being driven regardless.
125
- */
126
- | "needs_counterparty"
127
- /**
128
- * Terminal: the lockup was spent by a hash-verified claim, read off chain, never reported.
129
- * On a send leg it is the counterparty's claim; on a receive leg the TRADER's own, matched by
130
- * hash rather than our txid so a claim that lands without us still counts.
131
- */
132
- | "settled"
133
- /**
134
- * Terminal: the lockup was spent by something other than a claim. On a send leg that is the
135
- * money coming back. **On a receive leg it is a LOSS**: every non-claim leaf is the
136
- * solver's. Also where a receive swap ends when its window closes with nothing to observe.
169
+ * The two string aliases the v2 surface is written in. Aliases rather than branded types, so
170
+ * literals need no constructor.
137
171
  */
138
- | "refunded"
139
- /** Terminal: an action failed and its window closed. */
140
- | "failed";
172
+ /** Lowercase hex, no `0x` prefix — the encoding `@scure/base`'s `hex` emits. */
173
+ type Hex = string;
174
+ /** A secp256k1 public key as {@link Hex}: x-only (32 bytes) or compressed (33). */
175
+ type Pubkey = Hex;
141
176
 
142
177
  /**
143
178
  * What the manager needs to register a swap's lockup with the wallet, so the indexer
@@ -442,15 +477,6 @@ type Corridor = (typeof CORRIDORS)[number];
442
477
  * purpose — which chains a registry lists is a listing decision, not an id-grammar one. */
443
478
  type CorridorId = Corridor | `eip155:${number}`;
444
479
 
445
- /**
446
- * The two string aliases the v2 surface is written in. Aliases rather than branded types, so
447
- * literals need no constructor.
448
- */
449
- /** Lowercase hex, no `0x` prefix — the encoding `@scure/base`'s `hex` emits. */
450
- type Hex = string;
451
- /** A secp256k1 public key as {@link Hex}: x-only (32 bytes) or compressed (33). */
452
- type Pubkey = Hex;
453
-
454
480
  /**
455
481
  * A quote's identity, minted by the client at quote time on every backend: feed-priced quotes
456
482
  * have no solver id, and `accept()` is idempotent by quote id *only* (§3.2).
@@ -605,19 +631,23 @@ interface SwapRecordCommon {
605
631
  readonly createdAt: number;
606
632
  readonly updatedAt: number;
607
633
  }
608
- /** `arkade <-> arkade`: the offer covenant. `offerHex` is the whole covenant, so no tree params. */
634
+ /** `arkade <-> arkade`: the offer covenant, whole in `binding` or `offerHex`, so no tree params. */
609
635
  interface OfferSwapRecord extends SwapRecordCommon {
610
636
  readonly family: "offer";
611
637
  /** v1's raw status vocabulary, read verbatim by the drive's `RawState`. */
612
638
  readonly status: AssetSwapStatus;
613
- /** The TLV offer, hex. The only input `cancelOffer` needs. */
614
- readonly offerHex: string;
639
+ /** The TLV offer, hex: what rebuilds the covenant when there is no `binding`. */
640
+ readonly offerHex?: string;
641
+ /** The covenant, structured. A directed swap carries this and no `offerHex`. */
642
+ readonly binding?: RecordedOfferBinding;
615
643
  readonly swapAddress: string;
616
644
  /** The covenant's scriptPubKey, hex — the indexer's monitoring key and the reconcile's match key. */
617
645
  readonly swapPkScript: string;
618
646
  /** Sats riding an asset deposit, decimal: the solver's published carrier, which the fill is
619
647
  * priced against. Absent for a BTC deposit and for feed-priced swaps (the SDK default). */
620
648
  readonly carrierSats?: string;
649
+ /** `false`: the funding carries no offer packet. Absent attaches it. */
650
+ readonly attachOfferPacket?: false;
621
651
  readonly spentTxid?: string;
622
652
  readonly completedAt?: number;
623
653
  }