@arkade-os/swap 0.1.7 → 0.1.9
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 +653 -262
- package/dist/advanced.d.cts +9 -8
- package/dist/advanced.d.ts +9 -8
- package/dist/advanced.js +4 -3
- package/dist/{chunk-7BBQ74BG.js → chunk-552GDPBU.js} +484 -128
- package/dist/chunk-5QPJWOCN.js +16 -0
- package/dist/{chunk-QFM55KP2.js → chunk-FQNG4XMF.js} +9 -3
- package/dist/{chunk-SDPNWPGY.js → chunk-I7WEXXZX.js} +27 -16
- package/dist/index.cjs +669 -278
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +4 -3
- package/dist/{lockupContract-CKPFpIt9.d.ts → lockupContract-BUOsghl1.d.ts} +1 -1
- package/dist/{lockupContract-CpJXTjX_.d.cts → lockupContract-DguuT7NK.d.cts} +1 -1
- package/dist/nostr.cjs +290 -17
- package/dist/nostr.d.cts +2 -1
- package/dist/nostr.d.ts +2 -1
- package/dist/nostr.js +2 -1
- package/dist/{offer-Drw1k_jt.d.ts → offer-BhonWuKR.d.ts} +22 -17
- package/dist/{offer-Boxive2u.d.cts → offer-D_qHpWo2.d.cts} +22 -17
- package/dist/{offerFillPlan-BxNkWLtw.d.cts → offerFillPlan-Bp6-z6dS.d.cts} +3 -3
- package/dist/{offerFillPlan-D2N4s7Xe.d.ts → offerFillPlan-_AOLo6kh.d.ts} +3 -3
- package/dist/protocol.cjs +594 -198
- package/dist/protocol.d.cts +9 -8
- package/dist/protocol.d.ts +9 -8
- package/dist/protocol.js +14 -2
- package/dist/repositories/realm/index.d.cts +3 -2
- package/dist/repositories/realm/index.d.ts +3 -2
- package/dist/repositories/sqlite/index.d.cts +3 -2
- package/dist/repositories/sqlite/index.d.ts +3 -2
- package/dist/{repository-DFDNvcZ7.d.cts → repository--pfikw2R.d.cts} +1 -1
- package/dist/{repository-Dn1V17T2.d.ts → repository-CkKK0dGO.d.ts} +1 -1
- package/dist/{rfq-CP-P0PSL.d.ts → rfq-BRpo5uWU.d.cts} +14 -2
- package/dist/{rfq-CP-P0PSL.d.cts → rfq-IzhOCG02.d.ts} +14 -2
- package/dist/rfq-contract.cjs +45 -0
- package/dist/rfq-contract.d.cts +9 -0
- package/dist/rfq-contract.d.ts +9 -0
- package/dist/rfq-contract.js +16 -0
- package/dist/{watch-D-mc_wfD.d.ts → watch-DDNycuUa.d.ts} +1 -1
- package/dist/{watch-DFNMY2K-.d.cts → watch-pvTVFp6-.d.cts} +1 -1
- package/package.json +13 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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-
|
|
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
|
|
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
|
|
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-
|
|
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';
|
|
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-
|
|
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';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-D_qHpWo2.cjs';
|
|
9
|
+
import './rfq-contract.cjs';
|
|
9
10
|
import 'nostr-tools';
|
|
10
11
|
|
|
11
12
|
/** Browser backend over the SDK's shared IndexedDB manager. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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';
|
|
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-
|
|
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';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-BhonWuKR.js';
|
|
9
|
+
import './rfq-contract.js';
|
|
9
10
|
import 'nostr-tools';
|
|
10
11
|
|
|
11
12
|
/** Browser backend over the SDK's shared IndexedDB manager. */
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
unsignedPsbtBytes,
|
|
63
63
|
verifyJointGraph,
|
|
64
64
|
verifyOfferFillPlan
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-I7WEXXZX.js";
|
|
66
66
|
import {
|
|
67
67
|
Amount,
|
|
68
68
|
AmountFormatError,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
isRfqSwapTerminal,
|
|
74
74
|
quoteIdOfSwapId,
|
|
75
75
|
toAtomicDecimal
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-FQNG4XMF.js";
|
|
77
77
|
import {
|
|
78
78
|
CLAIM_PACKET_TYPE,
|
|
79
79
|
LockupRegistrationFailed,
|
|
@@ -83,7 +83,8 @@ import {
|
|
|
83
83
|
appendArkadeScript,
|
|
84
84
|
claimPacketShape,
|
|
85
85
|
isRfqRefusalErrorCode
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-552GDPBU.js";
|
|
87
|
+
import "./chunk-5QPJWOCN.js";
|
|
87
88
|
import {
|
|
88
89
|
InMemoryAssetSwapRepository,
|
|
89
90
|
assertRfqSwapPageFilter,
|
package/dist/nostr.cjs
CHANGED
|
@@ -46,7 +46,7 @@ var import_solver_discovery2 = require("@arkade-os/solver-discovery");
|
|
|
46
46
|
var import_base6 = require("@scure/base");
|
|
47
47
|
var import_solver_discovery = require("@arkade-os/solver-discovery");
|
|
48
48
|
var import_legacy2 = require("@noble/hashes/legacy.js");
|
|
49
|
-
var
|
|
49
|
+
var import_sdk7 = require("@arkade-os/sdk");
|
|
50
50
|
|
|
51
51
|
// src/onchainHtlc.ts
|
|
52
52
|
var import_base = require("@scure/base");
|
|
@@ -65,7 +65,7 @@ var L1_NETWORKS = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// src/rfq.ts
|
|
68
|
-
var
|
|
68
|
+
var import_sdk8 = require("@arkade-os/sdk");
|
|
69
69
|
|
|
70
70
|
// src/claimPacket.ts
|
|
71
71
|
var import_base2 = require("@scure/base");
|
|
@@ -83,10 +83,240 @@ var import_sdk2 = require("@arkade-os/sdk");
|
|
|
83
83
|
// src/offer.ts
|
|
84
84
|
var import_base5 = require("@scure/base");
|
|
85
85
|
var import_utils2 = require("@scure/btc-signer/utils.js");
|
|
86
|
-
var
|
|
86
|
+
var import_sdk6 = require("@arkade-os/sdk");
|
|
87
|
+
|
|
88
|
+
// src/program.ts
|
|
89
|
+
var import_sdk3 = require("@arkade-os/sdk");
|
|
90
|
+
|
|
91
|
+
// src/contracts/asset-swap.json
|
|
92
|
+
var asset_swap_default = {
|
|
93
|
+
formatVersion: 1,
|
|
94
|
+
contractName: "AssetSwap",
|
|
95
|
+
constructorInputs: [
|
|
96
|
+
{
|
|
97
|
+
name: "receiver",
|
|
98
|
+
type: "pubkey"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "amount",
|
|
102
|
+
type: "int"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "assetTxid",
|
|
106
|
+
type: "bytes32"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "assetGroupIndex",
|
|
110
|
+
type: "int"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "user",
|
|
114
|
+
type: "pubkey"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
functions: [
|
|
118
|
+
{
|
|
119
|
+
name: "fulfill",
|
|
120
|
+
arkade: {
|
|
121
|
+
inputs: [],
|
|
122
|
+
asm: [
|
|
123
|
+
"OP_PUSHCURRENTINPUTINDEX",
|
|
124
|
+
"OP_DUP",
|
|
125
|
+
"<assetTxid>",
|
|
126
|
+
"<assetGroupIndex>",
|
|
127
|
+
"OP_INSPECTOUTASSETLOOKUP",
|
|
128
|
+
"OP_VERIFY",
|
|
129
|
+
"<amount>",
|
|
130
|
+
"OP_GREATERTHANOREQUAL",
|
|
131
|
+
"OP_VERIFY",
|
|
132
|
+
"OP_INSPECTOUTPUTSCRIPTPUBKEY",
|
|
133
|
+
"1",
|
|
134
|
+
"OP_NUMEQUALVERIFY",
|
|
135
|
+
"<receiver>",
|
|
136
|
+
"OP_EQUAL"
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
leaves: [
|
|
140
|
+
{
|
|
141
|
+
name: "fulfill",
|
|
142
|
+
witness: [
|
|
143
|
+
{
|
|
144
|
+
name: "serverSig",
|
|
145
|
+
type: "signature",
|
|
146
|
+
encoding: "schnorr-64",
|
|
147
|
+
injected: true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "emulatorSig",
|
|
151
|
+
type: "signature",
|
|
152
|
+
encoding: "schnorr-64",
|
|
153
|
+
injected: true
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
asm: [
|
|
157
|
+
"<SERVER_KEY>",
|
|
158
|
+
"OP_CHECKSIGVERIFY",
|
|
159
|
+
"<EMULATOR_KEY:fulfill>",
|
|
160
|
+
"OP_CHECKSIG"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "cancel",
|
|
167
|
+
leaves: [
|
|
168
|
+
{
|
|
169
|
+
name: "cancel",
|
|
170
|
+
witness: [
|
|
171
|
+
{
|
|
172
|
+
name: "userSig",
|
|
173
|
+
type: "signature",
|
|
174
|
+
encoding: "schnorr-64"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "serverSig",
|
|
178
|
+
type: "signature",
|
|
179
|
+
encoding: "schnorr-64",
|
|
180
|
+
injected: true
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
asm: [
|
|
184
|
+
"<user>",
|
|
185
|
+
"OP_CHECKSIGVERIFY",
|
|
186
|
+
"<SERVER_KEY>",
|
|
187
|
+
"OP_CHECKSIG"
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
source: {
|
|
194
|
+
entry: "asset-swap.ark",
|
|
195
|
+
files: {
|
|
196
|
+
"asset-swap.ark": "pragma arkade ^0.1.0;\n\n// The output at this input's index pays `receiver` at least `amount` of the asset.\n// Coordination of who funds it lives outside the contract.\ncontract AssetSwap(\n pubkey receiver,\n int amount,\n bytes32 assetTxid,\n int assetGroupIndex,\n pubkey user\n) {\n function fulfill() {\n int i = this.activeInputIndex;\n require(tx.outputs[i].assets.lookup(assetTxid, assetGroupIndex) >= amount);\n let paid = tx.outputs[i].script;\n require(paid.version == 1);\n require(paid.program == receiver);\n }\n\n function cancel(signature userSig, signature serverSig) tapscript {\n require(checkMultisig([user, server], [userSig, serverSig], 2));\n }\n}\n"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
compiler: {
|
|
200
|
+
name: "arkadec",
|
|
201
|
+
version: "0.1.0-rc.1",
|
|
202
|
+
options: {
|
|
203
|
+
optimize: true
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
updatedAt: "2026-11-02T17:43:42.615113722+00:00",
|
|
207
|
+
fingerprint: "sha256:e2b80add6237f6c7e2c69a96ae46d55abe6de5f71c3718106f4d5b22ac9e6d0a"
|
|
208
|
+
};
|
|
87
209
|
|
|
88
|
-
// src/swap
|
|
89
|
-
var
|
|
210
|
+
// src/contracts/sats-swap.json
|
|
211
|
+
var sats_swap_default = {
|
|
212
|
+
formatVersion: 1,
|
|
213
|
+
contractName: "SatsSwap",
|
|
214
|
+
constructorInputs: [
|
|
215
|
+
{
|
|
216
|
+
name: "receiver",
|
|
217
|
+
type: "pubkey"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "amount",
|
|
221
|
+
type: "int"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "user",
|
|
225
|
+
type: "pubkey"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
functions: [
|
|
229
|
+
{
|
|
230
|
+
name: "fulfill",
|
|
231
|
+
arkade: {
|
|
232
|
+
inputs: [],
|
|
233
|
+
asm: [
|
|
234
|
+
"OP_PUSHCURRENTINPUTINDEX",
|
|
235
|
+
"OP_DUP",
|
|
236
|
+
"OP_INSPECTOUTPUTVALUE",
|
|
237
|
+
"<amount>",
|
|
238
|
+
"OP_GREATERTHANOREQUAL",
|
|
239
|
+
"OP_VERIFY",
|
|
240
|
+
"OP_INSPECTOUTPUTSCRIPTPUBKEY",
|
|
241
|
+
"1",
|
|
242
|
+
"OP_NUMEQUALVERIFY",
|
|
243
|
+
"<receiver>",
|
|
244
|
+
"OP_EQUAL"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
leaves: [
|
|
248
|
+
{
|
|
249
|
+
name: "fulfill",
|
|
250
|
+
witness: [
|
|
251
|
+
{
|
|
252
|
+
name: "serverSig",
|
|
253
|
+
type: "signature",
|
|
254
|
+
encoding: "schnorr-64",
|
|
255
|
+
injected: true
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "emulatorSig",
|
|
259
|
+
type: "signature",
|
|
260
|
+
encoding: "schnorr-64",
|
|
261
|
+
injected: true
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
asm: [
|
|
265
|
+
"<SERVER_KEY>",
|
|
266
|
+
"OP_CHECKSIGVERIFY",
|
|
267
|
+
"<EMULATOR_KEY:fulfill>",
|
|
268
|
+
"OP_CHECKSIG"
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "cancel",
|
|
275
|
+
leaves: [
|
|
276
|
+
{
|
|
277
|
+
name: "cancel",
|
|
278
|
+
witness: [
|
|
279
|
+
{
|
|
280
|
+
name: "userSig",
|
|
281
|
+
type: "signature",
|
|
282
|
+
encoding: "schnorr-64"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "serverSig",
|
|
286
|
+
type: "signature",
|
|
287
|
+
encoding: "schnorr-64",
|
|
288
|
+
injected: true
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
asm: [
|
|
292
|
+
"<user>",
|
|
293
|
+
"OP_CHECKSIGVERIFY",
|
|
294
|
+
"<SERVER_KEY>",
|
|
295
|
+
"OP_CHECKSIG"
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
source: {
|
|
302
|
+
entry: "sats-swap.ark",
|
|
303
|
+
files: {
|
|
304
|
+
"sats-swap.ark": "pragma arkade ^0.1.0;\n\n// The output at this input's index pays `receiver` at least `amount` sats.\n// Coordination of who funds it lives outside the contract.\ncontract SatsSwap(\n pubkey receiver,\n int amount,\n pubkey user\n) {\n function fulfill() {\n int i = this.activeInputIndex;\n require(tx.outputs[i].value >= amount);\n let paid = tx.outputs[i].script;\n require(paid.version == 1);\n require(paid.program == receiver);\n }\n\n function cancel(signature userSig, signature serverSig) tapscript {\n require(checkMultisig([user, server], [userSig, serverSig], 2));\n }\n}\n"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
compiler: {
|
|
308
|
+
name: "arkadec",
|
|
309
|
+
version: "0.1.0-rc.1",
|
|
310
|
+
options: {
|
|
311
|
+
optimize: true
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
updatedAt: "2026-11-02T17:43:42.616824535+00:00",
|
|
315
|
+
fingerprint: "sha256:d7a60ab2178ede40a2e4867816689ea022641531cc662b562bebd7caa1ef96c4"
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// src/legacy/swap-want-asset.program.v1.json
|
|
319
|
+
var swap_want_asset_program_v1_default = {
|
|
90
320
|
version: 1,
|
|
91
321
|
name: "banco-btc-to-asset",
|
|
92
322
|
params: [
|
|
@@ -125,8 +355,8 @@ var swap_want_asset_program_default = {
|
|
|
125
355
|
}
|
|
126
356
|
};
|
|
127
357
|
|
|
128
|
-
// src/swap-want-btc.program.json
|
|
129
|
-
var
|
|
358
|
+
// src/legacy/swap-want-btc.program.v1.json
|
|
359
|
+
var swap_want_btc_program_v1_default = {
|
|
130
360
|
version: 1,
|
|
131
361
|
name: "banco-asset-to-btc",
|
|
132
362
|
params: [
|
|
@@ -160,6 +390,52 @@ var swap_want_btc_program_default = {
|
|
|
160
390
|
}
|
|
161
391
|
};
|
|
162
392
|
|
|
393
|
+
// src/rfq-contract.ts
|
|
394
|
+
var RFQ_CONTRACT_VERSION_UNSUPPORTED = "contract_version_unsupported";
|
|
395
|
+
var ASSET_SWAP_V2 = "asset-swap-v2";
|
|
396
|
+
var ASSET_SWAP_V3 = "asset-swap-v3";
|
|
397
|
+
|
|
398
|
+
// src/program.ts
|
|
399
|
+
var swapPrograms = {
|
|
400
|
+
wantAsset: import_sdk3.arkade.programFromArtifact(asset_swap_default),
|
|
401
|
+
wantBtc: import_sdk3.arkade.programFromArtifact(sats_swap_default)
|
|
402
|
+
};
|
|
403
|
+
var legacySwapPrograms = {
|
|
404
|
+
wantAsset: import_sdk3.arkade.parseArtifact(swap_want_asset_program_v1_default),
|
|
405
|
+
wantBtc: import_sdk3.arkade.parseArtifact(swap_want_btc_program_v1_default)
|
|
406
|
+
};
|
|
407
|
+
var sharedArgs = ({ user, server, exitDelay }) => ({
|
|
408
|
+
user,
|
|
409
|
+
server,
|
|
410
|
+
...exitDelay && { exitDelay }
|
|
411
|
+
});
|
|
412
|
+
var ASSET_SWAP_CONTRACTS = {
|
|
413
|
+
[ASSET_SWAP_V2]: {
|
|
414
|
+
programs: legacySwapPrograms,
|
|
415
|
+
args: (inputs) => ({
|
|
416
|
+
makerWP: inputs.receiver,
|
|
417
|
+
wantAmount: inputs.amount,
|
|
418
|
+
...inputs.asset && {
|
|
419
|
+
wantAssetTxid: inputs.asset.txid,
|
|
420
|
+
wantAssetGroupIndex: inputs.asset.groupIndex
|
|
421
|
+
},
|
|
422
|
+
...sharedArgs(inputs)
|
|
423
|
+
})
|
|
424
|
+
},
|
|
425
|
+
[ASSET_SWAP_V3]: {
|
|
426
|
+
programs: swapPrograms,
|
|
427
|
+
args: (inputs) => ({
|
|
428
|
+
receiver: inputs.receiver,
|
|
429
|
+
amount: inputs.amount,
|
|
430
|
+
...inputs.asset && {
|
|
431
|
+
assetTxid: inputs.asset.txid,
|
|
432
|
+
assetGroupIndex: inputs.asset.groupIndex
|
|
433
|
+
},
|
|
434
|
+
...sharedArgs(inputs)
|
|
435
|
+
})
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
|
|
163
439
|
// src/rfqCorridor.ts
|
|
164
440
|
var RfqCorridorRegistry = class {
|
|
165
441
|
handlers = /* @__PURE__ */ new Map();
|
|
@@ -199,16 +475,12 @@ var rfqCorridorHandlers = new RfqCorridorRegistry();
|
|
|
199
475
|
// src/store.ts
|
|
200
476
|
var import_base4 = require("@scure/base");
|
|
201
477
|
var import_sha23 = require("@noble/hashes/sha2.js");
|
|
202
|
-
var
|
|
478
|
+
var import_sdk5 = require("@arkade-os/sdk");
|
|
203
479
|
|
|
204
480
|
// src/repository.ts
|
|
205
|
-
var
|
|
481
|
+
var import_sdk4 = require("@arkade-os/sdk");
|
|
206
482
|
|
|
207
483
|
// src/offer.ts
|
|
208
|
-
var swapPrograms = {
|
|
209
|
-
wantAsset: import_sdk5.arkade.parseArtifact(swap_want_asset_program_default),
|
|
210
|
-
wantBtc: import_sdk5.arkade.parseArtifact(swap_want_btc_program_default)
|
|
211
|
-
};
|
|
212
484
|
var FIELDS = {
|
|
213
485
|
swapPkScript: { tag: 1, width: 34 },
|
|
214
486
|
wantAmount: { tag: 2, width: 8 },
|
|
@@ -222,7 +494,7 @@ var FIELDS = {
|
|
|
222
494
|
exitTimelock: { tag: 12, width: 9 }
|
|
223
495
|
};
|
|
224
496
|
var NAMES = Object.fromEntries(Object.entries(FIELDS).map(([k, f]) => [f.tag, k]));
|
|
225
|
-
var ASSET_CARRIER_SATS = BigInt(
|
|
497
|
+
var ASSET_CARRIER_SATS = BigInt(import_sdk6.ASSET_CARRIER_SATS);
|
|
226
498
|
var U64_MAX = (BigInt(1) << BigInt(64)) - BigInt(1);
|
|
227
499
|
var MAX_SAFE_SATS = BigInt(Number.MAX_SAFE_INTEGER);
|
|
228
500
|
|
|
@@ -237,6 +509,7 @@ var ONCHAIN_SEND_PAIR = rfqPair(ARKADE_BTC, ONCHAIN_BTC);
|
|
|
237
509
|
var ONCHAIN_RECEIVE_PAIR = rfqPair(ONCHAIN_BTC, ARKADE_BTC);
|
|
238
510
|
var RFQ_REFUSAL_ERROR_CODES = [
|
|
239
511
|
"amount_side_unsupported",
|
|
512
|
+
RFQ_CONTRACT_VERSION_UNSUPPORTED,
|
|
240
513
|
"exact_out_unsupported",
|
|
241
514
|
"invalid_amount",
|
|
242
515
|
"invalid_payout_address",
|
|
@@ -467,7 +740,7 @@ var closeSharedNostrPool = () => {
|
|
|
467
740
|
};
|
|
468
741
|
|
|
469
742
|
// src/nostr.ts
|
|
470
|
-
var
|
|
743
|
+
var import_sdk9 = require("@arkade-os/sdk");
|
|
471
744
|
var import_nostr_tools2 = require("nostr-tools");
|
|
472
745
|
var RFQ_DIRECTED_KIND = 24859;
|
|
473
746
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
@@ -493,7 +766,7 @@ var closeReasons = (raw) => raw.map((entry) => {
|
|
|
493
766
|
return url ? `${url}: ${reason ?? "closed"}` : reason ?? "closed";
|
|
494
767
|
});
|
|
495
768
|
var nostrRfqTransport = (options) => {
|
|
496
|
-
(0,
|
|
769
|
+
(0, import_sdk9.assertTimerMs)("timeoutMs", options.timeoutMs);
|
|
497
770
|
const relays = options.relays;
|
|
498
771
|
const solverPubkey = options.solverPubkey;
|
|
499
772
|
const secretKey = options.secretKey ?? (0, import_nostr_tools2.generateSecretKey)();
|
|
@@ -605,7 +878,7 @@ var nostrRfqTransport = (options) => {
|
|
|
605
878
|
};
|
|
606
879
|
var isNewer = (event, held) => !held || event.created_at > held.created_at || event.created_at === held.created_at && event.id < held.id;
|
|
607
880
|
var nostrCardFetcher = (options = {}) => {
|
|
608
|
-
(0,
|
|
881
|
+
(0, import_sdk9.assertTimerMs)("timeoutMs", options.timeoutMs);
|
|
609
882
|
if (options.timeoutMs === 0) throw new Error("timeoutMs must be positive");
|
|
610
883
|
const seen = /* @__PURE__ */ new Map();
|
|
611
884
|
const inflight = /* @__PURE__ */ new Map();
|
package/dist/nostr.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TransportCardFetcher } from '@arkade-os/solver-discovery';
|
|
2
|
-
import { e as RfqTransport } from './rfq-
|
|
2
|
+
import { e as RfqTransport } from './rfq-BRpo5uWU.cjs';
|
|
3
3
|
import { SimplePool } from 'nostr-tools';
|
|
4
4
|
import '@arkade-os/sdk';
|
|
5
|
+
import './rfq-contract.cjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* One shared Nostr pool for every swap-package reader and writer.
|
package/dist/nostr.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TransportCardFetcher } from '@arkade-os/solver-discovery';
|
|
2
|
-
import { e as RfqTransport } from './rfq-
|
|
2
|
+
import { e as RfqTransport } from './rfq-IzhOCG02.js';
|
|
3
3
|
import { SimplePool } from 'nostr-tools';
|
|
4
4
|
import '@arkade-os/sdk';
|
|
5
|
+
import './rfq-contract.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* One shared Nostr pool for every swap-package reader and writer.
|
package/dist/nostr.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { asset, RelativeTimelock, OperatorInfo, ArkTxInput, Outpoint, IWallet, EmulatorProvider
|
|
2
|
-
import {
|
|
1
|
+
import { arkade, asset, RelativeTimelock, OperatorInfo, ArkTxInput, Outpoint, IWallet, EmulatorProvider } from '@arkade-os/sdk';
|
|
2
|
+
import { ASSET_SWAP_V2, ASSET_SWAP_V3 } from './rfq-contract.js';
|
|
3
|
+
import { d as AssetSwapRepository } from './repository-CkKK0dGO.js';
|
|
4
|
+
|
|
5
|
+
/** `asset-swap` and `sats-swap`. Exit is appended later; it is not in either artifact.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Internal to `accept()`; no replacement. Moved off the package root to `@arkade-os/swap/protocol`.
|
|
8
|
+
*/
|
|
9
|
+
declare const swapPrograms: Record<"wantAsset" | "wantBtc", ReturnType<typeof arkade.parseArtifact>>;
|
|
10
|
+
type AssetSwapContractVersion = typeof ASSET_SWAP_V2 | typeof ASSET_SWAP_V3;
|
|
11
|
+
/** The versions every asset RFQ advertises by default, most preferred first. */
|
|
12
|
+
declare const ASSET_SWAP_CONTRACT_VERSIONS: readonly ["asset-swap-v3", "asset-swap-v2"];
|
|
13
|
+
/** Absent means {@link ASSET_SWAP_BASELINE}; an id this build cannot derive throws. */
|
|
14
|
+
declare const assetSwapContractVersion: (id: string | undefined) => AssetSwapContractVersion;
|
|
3
15
|
|
|
4
16
|
/**
|
|
5
17
|
* Coverage: whether an offer's script is in the wallet's watched set. `createOffer` promotes; the
|
|
@@ -15,15 +27,6 @@ interface CoverageRegistrationOptions {
|
|
|
15
27
|
readonly scope?: object;
|
|
16
28
|
}
|
|
17
29
|
|
|
18
|
-
/**
|
|
19
|
-
* The contracts, one per WANT side — pure data, shared verbatim with any other implementation.
|
|
20
|
-
*
|
|
21
|
-
* An offer carrying an exit delay compiles a third closure that is in neither file (see
|
|
22
|
-
* {@link withExitClosure}); the golden in `offer.test.ts` pins the artifact it produces.
|
|
23
|
-
*
|
|
24
|
-
* @deprecated Internal to `accept()`; no replacement. Moved off the package root to `@arkade-os/swap/protocol`.
|
|
25
|
-
*/
|
|
26
|
-
declare const swapPrograms: Record<"wantAsset" | "wantBtc", ReturnType<typeof arkade.parseArtifact>>;
|
|
27
30
|
/** A full-fill offer. Exactly one field names an asset: `wantAsset` = the fill must deliver that
|
|
28
31
|
* asset (the deposit is whatever the funding vtxo holds); `offerAsset` = the user deposits that
|
|
29
32
|
* asset and wants sats.
|
|
@@ -58,7 +61,7 @@ interface Offer {
|
|
|
58
61
|
*
|
|
59
62
|
* @deprecated Internal to `accept()`; no replacement. Moved off the package root to `@arkade-os/swap/protocol`.
|
|
60
63
|
*/
|
|
61
|
-
declare function offerContract(offer: Omit<Offer, "swapPkScript">, operatorPubkey: Uint8Array): InstanceType<typeof arkade.ArkadeProgramScript>;
|
|
64
|
+
declare function offerContract(offer: Omit<Offer, "swapPkScript">, operatorPubkey: Uint8Array, contractVersion?: AssetSwapContractVersion): InstanceType<typeof arkade.ArkadeProgramScript>;
|
|
62
65
|
/** Extension packet type tag for Arkade Intents offers.
|
|
63
66
|
*
|
|
64
67
|
* @deprecated Internal to `accept()`; no replacement. Moved off the package root to `@arkade-os/swap/protocol`.
|
|
@@ -145,6 +148,8 @@ interface OfferParams {
|
|
|
145
148
|
pkScript: Uint8Array;
|
|
146
149
|
publicKey: Uint8Array;
|
|
147
150
|
};
|
|
151
|
+
/** Defaults to {@link ASSET_SWAP_BASELINE}. */
|
|
152
|
+
contractVersion?: AssetSwapContractVersion;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
155
|
* Everything an offer commits to, derived and encoded, with nothing written.
|
|
@@ -240,10 +245,10 @@ type FillInputOwner = "solver" | "sponsor";
|
|
|
240
245
|
* Fill an offer — the TAKER's side, and the counterpart to {@link createOffer}. Composes the
|
|
241
246
|
* `fulfill` spend; it does not weaken or reinterpret the covenant.
|
|
242
247
|
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
248
|
+
* `fulfill` reads the output at the spending input's index. This builder puts the deposit at
|
|
249
|
+
* input 0 and the maker payout at output 0. An ASSET want is the first packet group on that
|
|
250
|
+
* output, which carries only a dust carrier ({@link ASSET_CARRIER_SATS}). Every other asset
|
|
251
|
+
* goes to the taker's payout; see {@link FillFunding}.
|
|
247
252
|
*
|
|
248
253
|
* Writes NO local swap record: the maker learns the outcome from the chain (RFQ protocol § 7.2).
|
|
249
254
|
* `fund` is explicit because only the caller knows which coins are reserved (e.g. a corridor's
|
|
@@ -266,4 +271,4 @@ declare function fillOffer(wallet: IWallet, arkServerUrl: string, offerHex: stri
|
|
|
266
271
|
/** @deprecated Use `offerContract` from `@arkade-os/swap/protocol`. */
|
|
267
272
|
declare const offerVtxoScript: typeof offerContract;
|
|
268
273
|
|
|
269
|
-
export { ASSET_CARRIER_SATS as A, type CoverageRegistrationOptions as C, type DerivedOffer as D, type FillFunding as F, NoSpendableDepositError as N, type Offer as O, type FillOutpoint as a, type FillInputOwner as b,
|
|
274
|
+
export { ASSET_CARRIER_SATS as A, type CoverageRegistrationOptions as C, type DerivedOffer as D, type FillFunding as F, NoSpendableDepositError as N, type Offer as O, type FillOutpoint as a, type FillInputOwner as b, ASSET_SWAP_CONTRACT_VERSIONS as c, type AssetSwapContractVersion as d, OFFER_PACKET_TYPE as e, OfferCovenantMismatchError as f, assetSwapContractVersion as g, cancelOffer as h, createOffer as i, decodeOffer as j, encodeOffer as k, fillOffer as l, offerVtxoScript as m, offerContract as o, swapPrograms as s };
|