@arkade-os/swap 0.1.2 → 0.1.3
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 +17 -27
- package/dist/advanced.d.cts +6 -6
- package/dist/advanced.d.ts +6 -6
- package/dist/advanced.js +3 -3
- package/dist/{chunk-ICSREL7N.js → chunk-2AQYBSF5.js} +2 -1
- package/dist/{chunk-J2PMAQP2.js → chunk-6HKTAZLJ.js} +4 -3
- package/dist/{chunk-BLECLU5Q.js → chunk-G5QURHVP.js} +17 -31
- package/dist/index.cjs +17 -27
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/{lockupContract-CkhWMKCo.d.cts → lockupContract-AwSwif9u.d.cts} +1 -1
- package/dist/{lockupContract-CIXkJPxV.d.ts → lockupContract-D-OpxRSX.d.ts} +1 -1
- package/dist/nostr.js +1 -1
- package/dist/{offer-BPD2ortO.d.ts → offer-4Ir1bRQV.d.ts} +1 -1
- package/dist/{offer-Diff5Flc.d.cts → offer-BEcW5o7V.d.cts} +1 -1
- package/dist/{offerFillPlan-B-5ae_gQ.d.cts → offerFillPlan-DvrHfYoH.d.cts} +2 -2
- package/dist/{offerFillPlan-CJzneX6F.d.ts → offerFillPlan-bsyVMum3.d.ts} +2 -2
- package/dist/protocol.cjs +15 -26
- package/dist/protocol.d.cts +7 -6
- package/dist/protocol.d.ts +7 -6
- package/dist/protocol.js +2 -2
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/{repository-C4pvymhs.d.cts → repository-BW42Dtct.d.cts} +1 -0
- package/dist/{repository-BBVRh9ez.d.ts → repository-ChRNknNn.d.ts} +1 -0
- package/dist/{watch-7BiRa4oB.d.ts → watch-B_Q0ddHg.d.ts} +1 -1
- package/dist/{watch-Bxq-lx_6.d.cts → watch-CpnfqYCE.d.cts} +1 -1
- package/package.json +2 -2
package/dist/advanced.cjs
CHANGED
|
@@ -840,8 +840,9 @@ async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
|
840
840
|
identity: wallet.identity,
|
|
841
841
|
// registered offers resolve VTXOs from the contract repository; the indexer is the fallback
|
|
842
842
|
// for offers created before registration existed
|
|
843
|
-
contractManager
|
|
843
|
+
contractManager,
|
|
844
844
|
// no `network`: the row lookup is by script and the payout comes from wallet.getAddress()
|
|
845
|
+
oneShotSubmit: wallet.oneShotSubmit
|
|
845
846
|
});
|
|
846
847
|
const operatorPubkey = swapAddress ? import_sdk3.ArkAddress.decode(swapAddress).serverPubKey : client.serverKey;
|
|
847
848
|
const { program, args, keys } = swapProgramBinding(offer, operatorPubkey);
|
|
@@ -4966,30 +4967,16 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
4966
4967
|
const leaf = input.contract.refundWithoutReceiver();
|
|
4967
4968
|
const vtxos = boundedLockupSpend(input.vtxos);
|
|
4968
4969
|
const amount = vtxos.reduce((sum, vtxo) => sum + vtxo.value, 0);
|
|
4969
|
-
const
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
checkpoints.map((c) => import_base10.base64.encode(c.toPSBT()))
|
|
4978
|
-
);
|
|
4979
|
-
(0, import_sdk14.assertSubmittedArkTxid)(submitted, signedTx, "refundWithoutReceiver");
|
|
4980
|
-
const matched = (0, import_sdk14.matchServerCheckpoints)(
|
|
4981
|
-
submitted.signedCheckpointTxs,
|
|
4982
|
-
checkpoints,
|
|
4983
|
-
"refundWithoutReceiver"
|
|
4984
|
-
);
|
|
4985
|
-
const finalCheckpoints = await Promise.all(
|
|
4986
|
-
matched.map(
|
|
4987
|
-
async ({ server }) => import_base10.base64.encode((await input.sender.sign(server, [0])).toPSBT())
|
|
4988
|
-
)
|
|
4989
|
-
);
|
|
4990
|
-
await operator.finalizeTx(submitted.arkTxid, finalCheckpoints);
|
|
4970
|
+
const txid = await (0, import_sdk14.signAndSubmitOffchainTx)({
|
|
4971
|
+
identity: input.sender,
|
|
4972
|
+
provider: operator,
|
|
4973
|
+
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
4974
|
+
outputs: [{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
4975
|
+
serverUnrollScript,
|
|
4976
|
+
oneShot: input.oneShot
|
|
4977
|
+
});
|
|
4991
4978
|
return {
|
|
4992
|
-
txid
|
|
4979
|
+
txid,
|
|
4993
4980
|
amount,
|
|
4994
4981
|
left: input.vtxos.length - vtxos.length,
|
|
4995
4982
|
spent: vtxos
|
|
@@ -6406,7 +6393,8 @@ async function pushClaim(operator, input) {
|
|
|
6406
6393
|
...lockupAssetOutputs(vtxos)
|
|
6407
6394
|
],
|
|
6408
6395
|
serverUnrollScript,
|
|
6409
|
-
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
6396
|
+
verifyServerSignatures: { serverPubkey: input.contract.options.server },
|
|
6397
|
+
oneShot: input.oneShot
|
|
6410
6398
|
});
|
|
6411
6399
|
return { txid, amount: locked, left: live.length - vtxos.length, spent: vtxos };
|
|
6412
6400
|
}
|
|
@@ -6620,7 +6608,8 @@ function arkadeRefunder(deps) {
|
|
|
6620
6608
|
contract,
|
|
6621
6609
|
sender,
|
|
6622
6610
|
vtxos,
|
|
6623
|
-
network: await deps.network?.()
|
|
6611
|
+
network: await deps.network?.(),
|
|
6612
|
+
oneShot: deps.wallet.oneShotSubmit
|
|
6624
6613
|
});
|
|
6625
6614
|
if (result.left > 0 || done) {
|
|
6626
6615
|
spentBy.set(swap.rfqId, /* @__PURE__ */ new Set([...done ?? [], ...result.spent.map(keyOf)]));
|
|
@@ -8347,7 +8336,8 @@ var createSwapDrive = (config) => {
|
|
|
8347
8336
|
// Passed through: `pushClaim`'s own value check decides whether `P` is published.
|
|
8348
8337
|
expectedAmount: swap.expectedAmount,
|
|
8349
8338
|
partiallyClaimed,
|
|
8350
|
-
network: await pinnedNetwork()
|
|
8339
|
+
network: await pinnedNetwork(),
|
|
8340
|
+
oneShot: wallet.oneShotSubmit
|
|
8351
8341
|
})
|
|
8352
8342
|
);
|
|
8353
8343
|
};
|
package/dist/advanced.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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-
|
|
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 MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, a8 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a9 as ObservationSeam, aa as OfferPreparation, ab as OnchainClaim, ac as OnchainRefund, ad as OperatorUnreachable, ae as ParsedRfqQuote, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, aj as QuotePreparation, 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, as as RfqPreparation, at as RfqQuoteInput, au as RfqRendezvous, av as RfqTransportFactory, aw as RouteSide, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aA as SwapDrive, aB as SwapDriveConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, aG as UnsupportedRoute, aH as VerbDeps, aI as acceptQuote, aJ as attesting, aK as buildOfferFillPlan, aL as cancelSwap, aM as canonicalAssetId, aN as cardMarketOf, aO as chooseMarket, aP as conflictingFields, aQ as corridorSet, aR as createNostrTransportFactory, aS as createSwapClient, aT as createSwapDrive, aU as deepFreeze, aV as digestJointGraph, aW as discoveryIndex, aX as eligibleMarkets, aY as enforceFeeCeiling, aZ as exchange, a_ as feedFetch, a$ as feedSpread, b0 as isAddressable, b1 as isCardMarket, b2 as isIndexedNetwork, b3 as isSwapError, b4 as isUsableCard, b5 as liveArkadeInfo, b6 as marketBackendOf, b7 as marketKeyOf, b8 as marketOf, b9 as marketRefOf, ba as nostrTransportFactory, bb as parseRfqQuote, bc as pay, bd as quoteFromFeed, be as quoteViaRfq, bf as readableRecord, bg as receive, bh as resolveCorridorBase, bi as resolveCorridorDeps, bj as rfqLeg, bk as rfqPairFor, bl as swapRecordOf, bm as toDiscoveryLeg, bn as unsignedPsbtBytes, bo as usableMarkets, bp as verifyJointGraph, bq as verifyOfferFillPlan, br as verifyPlanLegs, bs as withCanonicalAmount } from './offerFillPlan-
|
|
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-DvrHfYoH.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 MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, a8 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a9 as ObservationSeam, aa as OfferPreparation, ab as OnchainClaim, ac as OnchainRefund, ad as OperatorUnreachable, ae as ParsedRfqQuote, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, aj as QuotePreparation, 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, as as RfqPreparation, at as RfqQuoteInput, au as RfqRendezvous, av as RfqTransportFactory, aw as RouteSide, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aA as SwapDrive, aB as SwapDriveConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, aG as UnsupportedRoute, aH as VerbDeps, aI as acceptQuote, aJ as attesting, aK as buildOfferFillPlan, aL as cancelSwap, aM as canonicalAssetId, aN as cardMarketOf, aO as chooseMarket, aP as conflictingFields, aQ as corridorSet, aR as createNostrTransportFactory, aS as createSwapClient, aT as createSwapDrive, aU as deepFreeze, aV as digestJointGraph, aW as discoveryIndex, aX as eligibleMarkets, aY as enforceFeeCeiling, aZ as exchange, a_ as feedFetch, a$ as feedSpread, b0 as isAddressable, b1 as isCardMarket, b2 as isIndexedNetwork, b3 as isSwapError, b4 as isUsableCard, b5 as liveArkadeInfo, b6 as marketBackendOf, b7 as marketKeyOf, b8 as marketOf, b9 as marketRefOf, ba as nostrTransportFactory, bb as parseRfqQuote, bc as pay, bd as quoteFromFeed, be as quoteViaRfq, bf as readableRecord, bg as receive, bh as resolveCorridorBase, bi as resolveCorridorDeps, bj as rfqLeg, bk as rfqPairFor, bl as swapRecordOf, bm as toDiscoveryLeg, bn as unsignedPsbtBytes, bo as usableMarkets, bp as verifyJointGraph, bq as verifyOfferFillPlan, br as verifyPlanLegs, bs as withCanonicalAmount } from './offerFillPlan-DvrHfYoH.cjs';
|
|
3
3
|
import { DiscoveredMarket, Side } from '@arkade-os/solver-discovery';
|
|
4
|
-
import { N as NetworkRef, A as AssetId, C as Corridor, 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-
|
|
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-
|
|
4
|
+
import { N as NetworkRef, A as AssetId, C as Corridor, 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-BW42Dtct.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-BW42Dtct.cjs';
|
|
6
6
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-C0tHOvn6.cjs';
|
|
7
7
|
export { S as SwapRefusal } from './rfq-C0tHOvn6.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-
|
|
11
|
-
import './offer-
|
|
10
|
+
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-CpnfqYCE.cjs';
|
|
11
|
+
import './offer-BEcW5o7V.cjs';
|
|
12
12
|
import 'nostr-tools';
|
|
13
13
|
|
|
14
14
|
/** The EVM leg's namespace. Which chain is the quote's `evm_chain_id`, not the pair. */
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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-
|
|
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 MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, a8 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a9 as ObservationSeam, aa as OfferPreparation, ab as OnchainClaim, ac as OnchainRefund, ad as OperatorUnreachable, ae as ParsedRfqQuote, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, aj as QuotePreparation, 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, as as RfqPreparation, at as RfqQuoteInput, au as RfqRendezvous, av as RfqTransportFactory, aw as RouteSide, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aA as SwapDrive, aB as SwapDriveConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, aG as UnsupportedRoute, aH as VerbDeps, aI as acceptQuote, aJ as attesting, aK as buildOfferFillPlan, aL as cancelSwap, aM as canonicalAssetId, aN as cardMarketOf, aO as chooseMarket, aP as conflictingFields, aQ as corridorSet, aR as createNostrTransportFactory, aS as createSwapClient, aT as createSwapDrive, aU as deepFreeze, aV as digestJointGraph, aW as discoveryIndex, aX as eligibleMarkets, aY as enforceFeeCeiling, aZ as exchange, a_ as feedFetch, a$ as feedSpread, b0 as isAddressable, b1 as isCardMarket, b2 as isIndexedNetwork, b3 as isSwapError, b4 as isUsableCard, b5 as liveArkadeInfo, b6 as marketBackendOf, b7 as marketKeyOf, b8 as marketOf, b9 as marketRefOf, ba as nostrTransportFactory, bb as parseRfqQuote, bc as pay, bd as quoteFromFeed, be as quoteViaRfq, bf as readableRecord, bg as receive, bh as resolveCorridorBase, bi as resolveCorridorDeps, bj as rfqLeg, bk as rfqPairFor, bl as swapRecordOf, bm as toDiscoveryLeg, bn as unsignedPsbtBytes, bo as usableMarkets, bp as verifyJointGraph, bq as verifyOfferFillPlan, br as verifyPlanLegs, bs as withCanonicalAmount } from './offerFillPlan-
|
|
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-bsyVMum3.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 MarketLeg, a3 as MaxFeeExceeded, a4 as MissingCorridorDep, a5 as NotCancellable, a6 as OFFER_FILL_OWNERS, a7 as OFFER_FILL_TEMPLATE, a8 as ONCHAIN_CLAIM_FEE_RATE_SATVB, a9 as ObservationSeam, aa as OfferPreparation, ab as OnchainClaim, ac as OnchainRefund, ad as OperatorUnreachable, ae as ParsedRfqQuote, af as PayOptions, ag as PayResult, ah as QuoteCheck, ai as QuoteExpired, aj as QuotePreparation, 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, as as RfqPreparation, at as RfqQuoteInput, au as RfqRendezvous, av as RfqTransportFactory, aw as RouteSide, ax as SWAP_ERROR_NAMES, ay as SwapClient, az as SwapClientConfig, aA as SwapDrive, aB as SwapDriveConfig, aC as SwapDriveRefusedError, aD as SwapError, aE as SwapErrorName, aF as SwapFilter, aG as UnsupportedRoute, aH as VerbDeps, aI as acceptQuote, aJ as attesting, aK as buildOfferFillPlan, aL as cancelSwap, aM as canonicalAssetId, aN as cardMarketOf, aO as chooseMarket, aP as conflictingFields, aQ as corridorSet, aR as createNostrTransportFactory, aS as createSwapClient, aT as createSwapDrive, aU as deepFreeze, aV as digestJointGraph, aW as discoveryIndex, aX as eligibleMarkets, aY as enforceFeeCeiling, aZ as exchange, a_ as feedFetch, a$ as feedSpread, b0 as isAddressable, b1 as isCardMarket, b2 as isIndexedNetwork, b3 as isSwapError, b4 as isUsableCard, b5 as liveArkadeInfo, b6 as marketBackendOf, b7 as marketKeyOf, b8 as marketOf, b9 as marketRefOf, ba as nostrTransportFactory, bb as parseRfqQuote, bc as pay, bd as quoteFromFeed, be as quoteViaRfq, bf as readableRecord, bg as receive, bh as resolveCorridorBase, bi as resolveCorridorDeps, bj as rfqLeg, bk as rfqPairFor, bl as swapRecordOf, bm as toDiscoveryLeg, bn as unsignedPsbtBytes, bo as usableMarkets, bp as verifyJointGraph, bq as verifyOfferFillPlan, br as verifyPlanLegs, bs as withCanonicalAmount } from './offerFillPlan-bsyVMum3.js';
|
|
3
3
|
import { DiscoveredMarket, Side } from '@arkade-os/solver-discovery';
|
|
4
|
-
import { N as NetworkRef, A as AssetId, C as Corridor, 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-
|
|
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-
|
|
4
|
+
import { N as NetworkRef, A as AssetId, C as Corridor, 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-ChRNknNn.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-ChRNknNn.js';
|
|
6
6
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-C0tHOvn6.js';
|
|
7
7
|
export { S as SwapRefusal } from './rfq-C0tHOvn6.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-
|
|
11
|
-
import './offer-
|
|
10
|
+
import { O as OfferSpendChanges, a as OfferSwapFacts, b as OfferSwapSource } from './watch-B_Q0ddHg.js';
|
|
11
|
+
import './offer-4Ir1bRQV.js';
|
|
12
12
|
import 'nostr-tools';
|
|
13
13
|
|
|
14
14
|
/** The EVM leg's namespace. Which chain is the quote's `evm_chain_id`, not the pair. */
|
package/dist/advanced.js
CHANGED
|
@@ -138,7 +138,7 @@ import {
|
|
|
138
138
|
withCanonicalAmount,
|
|
139
139
|
withDepositFate,
|
|
140
140
|
withRfqState
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-6HKTAZLJ.js";
|
|
142
142
|
import {
|
|
143
143
|
ACTIVITY_TOKEN,
|
|
144
144
|
Amount,
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
recordOutcome,
|
|
174
174
|
swapOf,
|
|
175
175
|
toAtomicDecimal
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-G5QURHVP.js";
|
|
177
177
|
import {
|
|
178
178
|
ARKADE_BTC,
|
|
179
179
|
SwapRefusal,
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
bindsClaimAmount,
|
|
183
183
|
rfqPair,
|
|
184
184
|
sealClaimPacket
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-2AQYBSF5.js";
|
|
186
186
|
import "./chunk-A3SHHRX4.js";
|
|
187
187
|
|
|
188
188
|
// src/reveal.ts
|
|
@@ -854,8 +854,9 @@ async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
|
854
854
|
identity: wallet.identity,
|
|
855
855
|
// registered offers resolve VTXOs from the contract repository; the indexer is the fallback
|
|
856
856
|
// for offers created before registration existed
|
|
857
|
-
contractManager
|
|
857
|
+
contractManager,
|
|
858
858
|
// no `network`: the row lookup is by script and the payout comes from wallet.getAddress()
|
|
859
|
+
oneShotSubmit: wallet.oneShotSubmit
|
|
859
860
|
});
|
|
860
861
|
const operatorPubkey = swapAddress ? ArkAddress.decode(swapAddress).serverPubKey : client.serverKey;
|
|
861
862
|
const { program, args, keys } = swapProgramBinding(offer, operatorPubkey);
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
undeliveredCarry,
|
|
61
61
|
walletOperator,
|
|
62
62
|
watchOfferSwaps
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-G5QURHVP.js";
|
|
64
64
|
import {
|
|
65
65
|
ARKADE_BTC,
|
|
66
66
|
ASSET_CARRIER_SATS,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
unilateralClaimDelay,
|
|
126
126
|
verifyOfferAddress,
|
|
127
127
|
withExitClosure
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-2AQYBSF5.js";
|
|
129
129
|
import {
|
|
130
130
|
assertRfqSwapPageFilter,
|
|
131
131
|
collectAssetSwaps,
|
|
@@ -2393,7 +2393,8 @@ var createSwapDrive = (config) => {
|
|
|
2393
2393
|
// Passed through: `pushClaim`'s own value check decides whether `P` is published.
|
|
2394
2394
|
expectedAmount: swap.expectedAmount,
|
|
2395
2395
|
partiallyClaimed,
|
|
2396
|
-
network: await pinnedNetwork()
|
|
2396
|
+
network: await pinnedNetwork(),
|
|
2397
|
+
oneShot: wallet.oneShotSubmit
|
|
2397
2398
|
})
|
|
2398
2399
|
);
|
|
2399
2400
|
};
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
rfqCorridorHandlers,
|
|
25
25
|
rfqSignerOf,
|
|
26
26
|
updateAssetSwapBestEffort
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2AQYBSF5.js";
|
|
28
28
|
import {
|
|
29
29
|
collectRfqSwaps
|
|
30
30
|
} from "./chunk-A3SHHRX4.js";
|
|
@@ -925,16 +925,14 @@ import { sha256 } from "@noble/hashes/sha2.js";
|
|
|
925
925
|
import {
|
|
926
926
|
ConditionWitness,
|
|
927
927
|
Transaction,
|
|
928
|
-
assertSubmittedArkTxid,
|
|
929
928
|
assertValidServerUnrollScript,
|
|
930
|
-
buildOffchainTx,
|
|
931
929
|
createAssetPacket,
|
|
932
930
|
decodeTapscript,
|
|
933
931
|
Extension,
|
|
934
932
|
getArkPsbtFields,
|
|
935
933
|
isVtxoSpent,
|
|
936
|
-
matchServerCheckpoints,
|
|
937
934
|
networkFromArkadeInfo,
|
|
935
|
+
signAndSubmitOffchainTx,
|
|
938
936
|
scriptFromTapLeafScript,
|
|
939
937
|
toXOnly
|
|
940
938
|
} from "@arkade-os/sdk";
|
|
@@ -1138,30 +1136,16 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
1138
1136
|
const leaf = input.contract.refundWithoutReceiver();
|
|
1139
1137
|
const vtxos = boundedLockupSpend(input.vtxos);
|
|
1140
1138
|
const amount = vtxos.reduce((sum, vtxo) => sum + vtxo.value, 0);
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
checkpoints.map((c) => base64.encode(c.toPSBT()))
|
|
1150
|
-
);
|
|
1151
|
-
assertSubmittedArkTxid(submitted, signedTx, "refundWithoutReceiver");
|
|
1152
|
-
const matched = matchServerCheckpoints(
|
|
1153
|
-
submitted.signedCheckpointTxs,
|
|
1154
|
-
checkpoints,
|
|
1155
|
-
"refundWithoutReceiver"
|
|
1156
|
-
);
|
|
1157
|
-
const finalCheckpoints = await Promise.all(
|
|
1158
|
-
matched.map(
|
|
1159
|
-
async ({ server }) => base64.encode((await input.sender.sign(server, [0])).toPSBT())
|
|
1160
|
-
)
|
|
1161
|
-
);
|
|
1162
|
-
await operator.finalizeTx(submitted.arkTxid, finalCheckpoints);
|
|
1139
|
+
const txid = await signAndSubmitOffchainTx({
|
|
1140
|
+
identity: input.sender,
|
|
1141
|
+
provider: operator,
|
|
1142
|
+
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
1143
|
+
outputs: [{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
1144
|
+
serverUnrollScript,
|
|
1145
|
+
oneShot: input.oneShot
|
|
1146
|
+
});
|
|
1163
1147
|
return {
|
|
1164
|
-
txid
|
|
1148
|
+
txid,
|
|
1165
1149
|
amount,
|
|
1166
1150
|
left: input.vtxos.length - vtxos.length,
|
|
1167
1151
|
spent: vtxos
|
|
@@ -1895,7 +1879,7 @@ function shouldRetainRfqSwap(record, now) {
|
|
|
1895
1879
|
// src/claim.ts
|
|
1896
1880
|
import {
|
|
1897
1881
|
claimWithPreimageIdentity,
|
|
1898
|
-
signAndSubmitOffchainTx
|
|
1882
|
+
signAndSubmitOffchainTx as signAndSubmitOffchainTx2
|
|
1899
1883
|
} from "@arkade-os/sdk";
|
|
1900
1884
|
var LockupAmountMismatchError = class extends Error {
|
|
1901
1885
|
name = "LockupAmountMismatchError";
|
|
@@ -1931,7 +1915,7 @@ async function pushClaim(operator, input) {
|
|
|
1931
1915
|
assertPreimageMatches(input.preimage, input.contract.options.preimageHash);
|
|
1932
1916
|
const serverUnrollScript = await operatorUnrollScript(operator, input.network);
|
|
1933
1917
|
const leaf = input.contract.claim();
|
|
1934
|
-
const txid = await
|
|
1918
|
+
const txid = await signAndSubmitOffchainTx2({
|
|
1935
1919
|
identity: claimWithPreimageIdentity(input.receiver, input.preimage),
|
|
1936
1920
|
provider: operator,
|
|
1937
1921
|
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
@@ -1941,7 +1925,8 @@ async function pushClaim(operator, input) {
|
|
|
1941
1925
|
...lockupAssetOutputs(vtxos)
|
|
1942
1926
|
],
|
|
1943
1927
|
serverUnrollScript,
|
|
1944
|
-
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
1928
|
+
verifyServerSignatures: { serverPubkey: input.contract.options.server },
|
|
1929
|
+
oneShot: input.oneShot
|
|
1945
1930
|
});
|
|
1946
1931
|
return { txid, amount: locked, left: live.length - vtxos.length, spent: vtxos };
|
|
1947
1932
|
}
|
|
@@ -2016,7 +2001,8 @@ function arkadeRefunder(deps) {
|
|
|
2016
2001
|
contract,
|
|
2017
2002
|
sender,
|
|
2018
2003
|
vtxos,
|
|
2019
|
-
network: await deps.network?.()
|
|
2004
|
+
network: await deps.network?.(),
|
|
2005
|
+
oneShot: deps.wallet.oneShotSubmit
|
|
2020
2006
|
});
|
|
2021
2007
|
if (result.left > 0 || done) {
|
|
2022
2008
|
spentBy.set(swap.rfqId, /* @__PURE__ */ new Set([...done ?? [], ...result.spent.map(keyOf)]));
|
package/dist/index.cjs
CHANGED
|
@@ -1331,8 +1331,9 @@ async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
|
1331
1331
|
identity: wallet.identity,
|
|
1332
1332
|
// registered offers resolve VTXOs from the contract repository; the indexer is the fallback
|
|
1333
1333
|
// for offers created before registration existed
|
|
1334
|
-
contractManager
|
|
1334
|
+
contractManager,
|
|
1335
1335
|
// no `network`: the row lookup is by script and the payout comes from wallet.getAddress()
|
|
1336
|
+
oneShotSubmit: wallet.oneShotSubmit
|
|
1336
1337
|
});
|
|
1337
1338
|
const operatorPubkey = swapAddress ? import_sdk5.ArkAddress.decode(swapAddress).serverPubKey : client.serverKey;
|
|
1338
1339
|
const { program, args, keys } = swapProgramBinding(offer, operatorPubkey);
|
|
@@ -3143,30 +3144,16 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
3143
3144
|
const leaf = input.contract.refundWithoutReceiver();
|
|
3144
3145
|
const vtxos = boundedLockupSpend(input.vtxos);
|
|
3145
3146
|
const amount = vtxos.reduce((sum, vtxo) => sum + vtxo.value, 0);
|
|
3146
|
-
const
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
checkpoints.map((c) => import_base7.base64.encode(c.toPSBT()))
|
|
3155
|
-
);
|
|
3156
|
-
(0, import_sdk8.assertSubmittedArkTxid)(submitted, signedTx, "refundWithoutReceiver");
|
|
3157
|
-
const matched = (0, import_sdk8.matchServerCheckpoints)(
|
|
3158
|
-
submitted.signedCheckpointTxs,
|
|
3159
|
-
checkpoints,
|
|
3160
|
-
"refundWithoutReceiver"
|
|
3161
|
-
);
|
|
3162
|
-
const finalCheckpoints = await Promise.all(
|
|
3163
|
-
matched.map(
|
|
3164
|
-
async ({ server }) => import_base7.base64.encode((await input.sender.sign(server, [0])).toPSBT())
|
|
3165
|
-
)
|
|
3166
|
-
);
|
|
3167
|
-
await operator.finalizeTx(submitted.arkTxid, finalCheckpoints);
|
|
3147
|
+
const txid = await (0, import_sdk8.signAndSubmitOffchainTx)({
|
|
3148
|
+
identity: input.sender,
|
|
3149
|
+
provider: operator,
|
|
3150
|
+
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
3151
|
+
outputs: [{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
3152
|
+
serverUnrollScript,
|
|
3153
|
+
oneShot: input.oneShot
|
|
3154
|
+
});
|
|
3168
3155
|
return {
|
|
3169
|
-
txid
|
|
3156
|
+
txid,
|
|
3170
3157
|
amount,
|
|
3171
3158
|
left: input.vtxos.length - vtxos.length,
|
|
3172
3159
|
spent: vtxos
|
|
@@ -6371,7 +6358,8 @@ async function pushClaim(operator, input) {
|
|
|
6371
6358
|
...lockupAssetOutputs(vtxos)
|
|
6372
6359
|
],
|
|
6373
6360
|
serverUnrollScript,
|
|
6374
|
-
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
6361
|
+
verifyServerSignatures: { serverPubkey: input.contract.options.server },
|
|
6362
|
+
oneShot: input.oneShot
|
|
6375
6363
|
});
|
|
6376
6364
|
return { txid, amount: locked, left: live.length - vtxos.length, spent: vtxos };
|
|
6377
6365
|
}
|
|
@@ -6585,7 +6573,8 @@ function arkadeRefunder(deps) {
|
|
|
6585
6573
|
contract,
|
|
6586
6574
|
sender,
|
|
6587
6575
|
vtxos,
|
|
6588
|
-
network: await deps.network?.()
|
|
6576
|
+
network: await deps.network?.(),
|
|
6577
|
+
oneShot: deps.wallet.oneShotSubmit
|
|
6589
6578
|
});
|
|
6590
6579
|
if (result.left > 0 || done) {
|
|
6591
6580
|
spentBy.set(swap.rfqId, /* @__PURE__ */ new Set([...done ?? [], ...result.spent.map(keyOf)]));
|
|
@@ -8312,7 +8301,8 @@ var createSwapDrive = (config) => {
|
|
|
8312
8301
|
// Passed through: `pushClaim`'s own value check decides whether `P` is published.
|
|
8313
8302
|
expectedAmount: swap.expectedAmount,
|
|
8314
8303
|
partiallyClaimed,
|
|
8315
|
-
network: await pinnedNetwork()
|
|
8304
|
+
network: await pinnedNetwork(),
|
|
8305
|
+
oneShot: wallet.oneShotSubmit
|
|
8316
8306
|
})
|
|
8317
8307
|
);
|
|
8318
8308
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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, bc as pay, bg as receive, bn as unsignedPsbtBytes, bp as verifyJointGraph, bq 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-
|
|
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, bc as pay, bg as receive, bn as unsignedPsbtBytes, bp as verifyJointGraph, bq as verifyOfferFillPlan } from './offerFillPlan-DvrHfYoH.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-BW42Dtct.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-BW42Dtct.cjs';
|
|
4
4
|
export { C as ChainSource, I as InvoiceFacts, a as RFQ_REFUSAL_ERROR_CODES, b as RfqRefusalDetail, c as RfqRefusalErrorCode, d as RfqRefusalUnit, S as SwapRefusal, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-C0tHOvn6.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-AwSwif9u.cjs';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-BEcW5o7V.cjs';
|
|
9
9
|
import 'nostr-tools';
|
|
10
10
|
|
|
11
11
|
/** Browser backend over the SDK's shared IndexedDB manager. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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, bc as pay, bg as receive, bn as unsignedPsbtBytes, bp as verifyJointGraph, bq 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-
|
|
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, bc as pay, bg as receive, bn as unsignedPsbtBytes, bp as verifyJointGraph, bq as verifyOfferFillPlan } from './offerFillPlan-bsyVMum3.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-ChRNknNn.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-ChRNknNn.js';
|
|
4
4
|
export { C as ChainSource, I as InvoiceFacts, a as RFQ_REFUSAL_ERROR_CODES, b as RfqRefusalDetail, c as RfqRefusalErrorCode, d as RfqRefusalUnit, S as SwapRefusal, T as TxStatus, i as isRfqRefusalErrorCode } from './rfq-C0tHOvn6.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-D-OpxRSX.js';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-4Ir1bRQV.js';
|
|
9
9
|
import 'nostr-tools';
|
|
10
10
|
|
|
11
11
|
/** 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-6HKTAZLJ.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-G5QURHVP.js";
|
|
77
77
|
import {
|
|
78
78
|
CLAIM_PACKET_TYPE,
|
|
79
79
|
LockupRegistrationFailed,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
appendArkadeScript,
|
|
84
84
|
claimPacketShape,
|
|
85
85
|
isRfqRefusalErrorCode
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-2AQYBSF5.js";
|
|
87
87
|
import {
|
|
88
88
|
InMemoryAssetSwapRepository,
|
|
89
89
|
assertRfqSwapPageFilter,
|
package/dist/nostr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asset, RelativeTimelock, ArkadeInfo, ArkTxInput, Outpoint, IWallet, EmulatorProvider, arkade } from '@arkade-os/sdk';
|
|
2
|
-
import { d as AssetSwapRepository } from './repository-
|
|
2
|
+
import { d as AssetSwapRepository } from './repository-ChRNknNn.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Coverage: whether an offer's script is in the wallet's watched set. `createOffer` promotes; the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asset, RelativeTimelock, ArkadeInfo, ArkTxInput, Outpoint, IWallet, EmulatorProvider, arkade } from '@arkade-os/sdk';
|
|
2
|
-
import { d as AssetSwapRepository } from './repository-
|
|
2
|
+
import { d as AssetSwapRepository } from './repository-BW42Dtct.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Coverage: whether an offer's script is in the wallet's watched set. `createOffer` promotes; the
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IWallet, NetworkName, Network, SignerSet, OnchainProvider, ArkadeInfo, VHTLC, ProvisionedKey, ProvisionedClaimSecret, Transaction } from '@arkade-os/sdk';
|
|
2
|
-
import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository-
|
|
2
|
+
import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository-BW42Dtct.cjs';
|
|
3
3
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, e as RfqTransport, L as LightningSendContractParams, f as LightningReceiveContractParams, O as OnchainHtlc, g as OnchainHtlcParams, h as OnchainNetwork, S as SwapRefusal } from './rfq-C0tHOvn6.cjs';
|
|
4
4
|
import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
|
|
5
|
-
import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-
|
|
5
|
+
import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-BEcW5o7V.cjs';
|
|
6
6
|
import * as nostr_tools from 'nostr-tools';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IWallet, NetworkName, Network, SignerSet, OnchainProvider, ArkadeInfo, VHTLC, ProvisionedKey, ProvisionedClaimSecret, Transaction } from '@arkade-os/sdk';
|
|
2
|
-
import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository-
|
|
2
|
+
import { bd as SwapOperator, d as AssetSwapRepository, m as Pubkey, bf as RfqSwapManagerCallbacks, C as Corridor, I as Instrument, bg as RfqSwapActionName, N as NetworkRef, A as AssetId, ao as SnapshotRef, a4 as MarketBackend, X as CardMarketRef, a5 as MarketRef, E as AssetRef, r as AmountOn, ap as Swap, Y as CorridorId, _ as DepositArtifact, l as QuoteInput, a9 as Quote, ae as RankedBid, as as SwapUpdate, au as Unsubscribe, S as SwapRecord, Q as QuoteId, a7 as Outcome, L as LockupSpendIndexer, bc as SwapContractRegistry, j as ResolvedEndpoint, P as PinnedAmount, D as AssetPaymentTerms, B as AssetPaymentInput, O as OfferSwapRecord, G as AssetSwapId, aq as SwapFamily, i as RouteResolution } from './repository-ChRNknNn.js';
|
|
3
3
|
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote, e as RfqTransport, L as LightningSendContractParams, f as LightningReceiveContractParams, O as OnchainHtlc, g as OnchainHtlcParams, h as OnchainNetwork, S as SwapRefusal } from './rfq-C0tHOvn6.js';
|
|
4
4
|
import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
|
|
5
|
-
import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-
|
|
5
|
+
import { D as DerivedOffer, F as FillFunding, a as FillOutpoint, b as FillInputOwner } from './offer-4Ir1bRQV.js';
|
|
6
6
|
import * as nostr_tools from 'nostr-tools';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/protocol.cjs
CHANGED
|
@@ -1178,8 +1178,9 @@ async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
|
1178
1178
|
identity: wallet.identity,
|
|
1179
1179
|
// registered offers resolve VTXOs from the contract repository; the indexer is the fallback
|
|
1180
1180
|
// for offers created before registration existed
|
|
1181
|
-
contractManager
|
|
1181
|
+
contractManager,
|
|
1182
1182
|
// no `network`: the row lookup is by script and the payout comes from wallet.getAddress()
|
|
1183
|
+
oneShotSubmit: wallet.oneShotSubmit
|
|
1183
1184
|
});
|
|
1184
1185
|
const operatorPubkey = swapAddress ? import_sdk5.ArkAddress.decode(swapAddress).serverPubKey : client.serverKey;
|
|
1185
1186
|
const { program, args, keys } = swapProgramBinding(offer, operatorPubkey);
|
|
@@ -3622,30 +3623,16 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
3622
3623
|
const leaf = input.contract.refundWithoutReceiver();
|
|
3623
3624
|
const vtxos = boundedLockupSpend(input.vtxos);
|
|
3624
3625
|
const amount = vtxos.reduce((sum, vtxo) => sum + vtxo.value, 0);
|
|
3625
|
-
const
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
checkpoints.map((c) => import_base7.base64.encode(c.toPSBT()))
|
|
3634
|
-
);
|
|
3635
|
-
(0, import_sdk8.assertSubmittedArkTxid)(submitted, signedTx, "refundWithoutReceiver");
|
|
3636
|
-
const matched = (0, import_sdk8.matchServerCheckpoints)(
|
|
3637
|
-
submitted.signedCheckpointTxs,
|
|
3638
|
-
checkpoints,
|
|
3639
|
-
"refundWithoutReceiver"
|
|
3640
|
-
);
|
|
3641
|
-
const finalCheckpoints = await Promise.all(
|
|
3642
|
-
matched.map(
|
|
3643
|
-
async ({ server }) => import_base7.base64.encode((await input.sender.sign(server, [0])).toPSBT())
|
|
3644
|
-
)
|
|
3645
|
-
);
|
|
3646
|
-
await operator.finalizeTx(submitted.arkTxid, finalCheckpoints);
|
|
3626
|
+
const txid = await (0, import_sdk8.signAndSubmitOffchainTx)({
|
|
3627
|
+
identity: input.sender,
|
|
3628
|
+
provider: operator,
|
|
3629
|
+
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
3630
|
+
outputs: [{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
3631
|
+
serverUnrollScript,
|
|
3632
|
+
oneShot: input.oneShot
|
|
3633
|
+
});
|
|
3647
3634
|
return {
|
|
3648
|
-
txid
|
|
3635
|
+
txid,
|
|
3649
3636
|
amount,
|
|
3650
3637
|
left: input.vtxos.length - vtxos.length,
|
|
3651
3638
|
spent: vtxos
|
|
@@ -5582,7 +5569,8 @@ function arkadeRefunder(deps) {
|
|
|
5582
5569
|
contract,
|
|
5583
5570
|
sender,
|
|
5584
5571
|
vtxos,
|
|
5585
|
-
network: await deps.network?.()
|
|
5572
|
+
network: await deps.network?.(),
|
|
5573
|
+
oneShot: deps.wallet.oneShotSubmit
|
|
5586
5574
|
});
|
|
5587
5575
|
if (result.left > 0 || done) {
|
|
5588
5576
|
spentBy.set(swap.rfqId, /* @__PURE__ */ new Set([...done ?? [], ...result.spent.map(keyOf)]));
|
|
@@ -5687,7 +5675,8 @@ async function pushClaim(operator, input) {
|
|
|
5687
5675
|
...lockupAssetOutputs(vtxos)
|
|
5688
5676
|
],
|
|
5689
5677
|
serverUnrollScript,
|
|
5690
|
-
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
5678
|
+
verifyServerSignatures: { serverPubkey: input.contract.options.server },
|
|
5679
|
+
oneShot: input.oneShot
|
|
5691
5680
|
});
|
|
5692
5681
|
return { txid, amount: locked, left: live.length - vtxos.length, spent: vtxos };
|
|
5693
5682
|
}
|
package/dist/protocol.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ProvisionedKey, ProvisionedClaimSecret, RestIndexerProvider, Transaction, ActivityResolver, IWallet, Network, OnchainProvider, VHTLC, Identity, Asset, PaymentRail } from '@arkade-os/sdk';
|
|
2
|
-
import { bh as SwapSecretsProjection, e as RfqSwapRecord, h as AssetSwap, d as AssetSwapRepository, L as LockupSpendIndexer, bb as RfqSwapState, bd as SwapOperator, bi as LockupContractSource, bj as RfqSwap, bk as ArkadeRefundResult, bl as LockupVtxo } from './repository-
|
|
3
|
-
export { c as AssetSwapStatus, bm as AvailableRfqSwapManagerCallbacks, bn as BTC_ASSET_ID, bo as LightningReceiveSwap, bp as LightningSendSwap, bq as LockupFate, br as LockupNeedsRecoveryError, bs as LockupParams, bt as LockupSpend, bu as OnchainReceiveAction, bv as OnchainReceiveNeedsChainSource, bw as OnchainReceiveSwap, bx as OnchainSendAction, by as OnchainSendSwap, bz as PersistableRfqSwap, bA as PreimageBlockedReason, bB as PreimageNotRecoverableError, bC as REFUND_MTP_LAG_SECONDS, bD as RFQ_SWAP_RETENTION_SECONDS, bE as ReceiveLockupSwap, bF as RfqRestoreFailure, bG as RfqRestoreOptions, bH as RfqRestoreResult, bg as RfqSwapActionName, bI as RfqSwapLockup, bJ as RfqSwapManager, bf as RfqSwapManagerCallbacks, bK as RfqSwapManagerConfig, bL as RfqSwapManagerDeps, bM as RfqSwapManagerEvents, bN as RfqSwapOrigin, bO as RfqSwapOriginRequired, bP as RfqSwapOutcome, a as RfqSwapRecordStore, bQ as addAssetSwap, bR as awaitRfqResolution, bS as createRfqSwapRecord, bT as findLockupVtxos, bU as getAssetSwaps, bV as isRfqTerminal, bW as nextOnchainAction, bX as nextOnchainReceiveAction, bY as normalizeRfqSwapRecord, bZ as preimageForSwapRecord, b_ as pushRefundWithoutReceiver, b$ as readLockupFate, c0 as rebuildRfqSwap, c1 as rfqSwapOriginOf, c2 as shouldRetainRfqSwap, c3 as swapSecretsToRecord, c4 as updateAssetSwap, c5 as updateRfqSwapRecord } from './repository-
|
|
2
|
+
import { bh as SwapSecretsProjection, e as RfqSwapRecord, h as AssetSwap, d as AssetSwapRepository, L as LockupSpendIndexer, bb as RfqSwapState, bd as SwapOperator, bi as LockupContractSource, bj as RfqSwap, bk as ArkadeRefundResult, bl as LockupVtxo } from './repository-BW42Dtct.cjs';
|
|
3
|
+
export { c as AssetSwapStatus, bm as AvailableRfqSwapManagerCallbacks, bn as BTC_ASSET_ID, bo as LightningReceiveSwap, bp as LightningSendSwap, bq as LockupFate, br as LockupNeedsRecoveryError, bs as LockupParams, bt as LockupSpend, bu as OnchainReceiveAction, bv as OnchainReceiveNeedsChainSource, bw as OnchainReceiveSwap, bx as OnchainSendAction, by as OnchainSendSwap, bz as PersistableRfqSwap, bA as PreimageBlockedReason, bB as PreimageNotRecoverableError, bC as REFUND_MTP_LAG_SECONDS, bD as RFQ_SWAP_RETENTION_SECONDS, bE as ReceiveLockupSwap, bF as RfqRestoreFailure, bG as RfqRestoreOptions, bH as RfqRestoreResult, bg as RfqSwapActionName, bI as RfqSwapLockup, bJ as RfqSwapManager, bf as RfqSwapManagerCallbacks, bK as RfqSwapManagerConfig, bL as RfqSwapManagerDeps, bM as RfqSwapManagerEvents, bN as RfqSwapOrigin, bO as RfqSwapOriginRequired, bP as RfqSwapOutcome, a as RfqSwapRecordStore, bQ as addAssetSwap, bR as awaitRfqResolution, bS as createRfqSwapRecord, bT as findLockupVtxos, bU as getAssetSwaps, bV as isRfqTerminal, bW as nextOnchainAction, bX as nextOnchainReceiveAction, bY as normalizeRfqSwapRecord, bZ as preimageForSwapRecord, b_ as pushRefundWithoutReceiver, b$ as readLockupFate, c0 as rebuildRfqSwap, c1 as rfqSwapOriginOf, c2 as shouldRetainRfqSwap, c3 as swapSecretsToRecord, c4 as updateAssetSwap, c5 as updateRfqSwapRecord } from './repository-BW42Dtct.cjs';
|
|
4
4
|
import { h as OnchainNetwork, O as OnchainHtlc, g as OnchainHtlcParams, C as ChainSource, I as InvoiceFacts, e as RfqTransport, r as requestLightningSend, j as requestOnchainSend } from './rfq-C0tHOvn6.cjs';
|
|
5
5
|
export { A as ARKADE_BTC, k as AddressMismatch, l as ChainUtxo, H as HtlcUtxo, m as LIGHTNING_BTC, n as LIGHTNING_RECEIVE_PAIR, o as LIGHTNING_SEND_PAIR, p as LOCKTIME_THRESHOLD, f as LightningReceiveContractParams, L as LightningSendContractParams, M as MAX_MIN_CONFIRMATIONS, q as MIN_CLAIM_WINDOW_SECONDS, s as ONCHAIN_BTC, t as ONCHAIN_CLAIM_MARGIN_SECONDS, u as ONCHAIN_DUST_SATS, v as ONCHAIN_ORDER_MARGIN_SECONDS, w as ONCHAIN_RECEIVE_PAIR, x as ONCHAIN_SECONDS_PER_BLOCK, y as ONCHAIN_SEND_PAIR, z as OnchainHtlcPhase, B as RelaySocket, R as RfqQuote, D as RfqRefusalReason, E as RfqStatus, F as arkadeAssetLeg, G as arkadeSwapRequest, J as assertArkadeFundable, K as awaitOnchainFill, N as buildHtlcClaim, P as buildHtlcRefund, Q as canonicalAssetAmount, U as claimOnchainFill, V as classifyOnchainHtlc, W as deriveLightningReceive, X as deriveOnchainReceive, Y as deriveOnchainSend, Z as extractPreimage, _ as httpTransport, $ as l1ScriptForAddress, a0 as lightningReceiveContract, a1 as lightningReceiveRequest, a2 as lightningSendContract, a3 as lightningSendRequest, a4 as newPreimage, a5 as normalizeMakerPkScript, a6 as normalizeMakerPublicKey, a7 as onchainHtlcScript, a8 as onchainReceiveRequest, a9 as onchainSendRequest, aa as paymentHashOf, ab as relayTransport, ac as requestArkadeSwap, ad as requestLightningReceive, ae as requestOnchainReceive, af as unilateralClaimDelay, ag as unilateralRefundDelay, ah as unilateralRefundWithoutReceiverDelay, ai as verifyLockupAddress, aj as verifyOfferAddress, ak as verifyReceiveInvoice } from './rfq-C0tHOvn6.cjs';
|
|
6
|
-
export { d as ClaimPacketInput, e as LockupContractMissing, f as LockupContractReader, g as LockupContractWriter, h as SWAP_LOCKUP_CONTRACT_KIND, i as SWAP_LOCKUP_CONTRACT_LABEL, j as SWAP_LOCKUP_CONTRACT_TYPE, k as SealedClaimPacket, l as lockupContractParams, r as registerLockupContract, s as sealClaimPacket } from './lockupContract-
|
|
6
|
+
export { d as ClaimPacketInput, e as LockupContractMissing, f as LockupContractReader, g as LockupContractWriter, h as SWAP_LOCKUP_CONTRACT_KIND, i as SWAP_LOCKUP_CONTRACT_LABEL, j as SWAP_LOCKUP_CONTRACT_TYPE, k as SealedClaimPacket, l as lockupContractParams, r as registerLockupContract, s as sealClaimPacket } from './lockupContract-AwSwif9u.cjs';
|
|
7
7
|
import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
|
|
8
|
-
import { O as Offer } from './offer-
|
|
9
|
-
export { A as ASSET_CARRIER_SATS, F as FillFunding, a as FillOutpoint, N as NoSpendableDepositError, c as OFFER_PACKET_TYPE, d as OfferCovenantMismatchError, e as cancelOffer, f as createOffer, g as decodeOffer, h as encodeOffer, i as fillOffer, o as offerContract, j as offerVtxoScript, s as swapPrograms } from './offer-
|
|
10
|
-
export { c as OfferSwapWatcher, W as WatchOfferSwapsParams, w as watchOfferSwaps } from './watch-
|
|
8
|
+
import { O as Offer } from './offer-BEcW5o7V.cjs';
|
|
9
|
+
export { A as ASSET_CARRIER_SATS, F as FillFunding, a as FillOutpoint, N as NoSpendableDepositError, c as OFFER_PACKET_TYPE, d as OfferCovenantMismatchError, e as cancelOffer, f as createOffer, g as decodeOffer, h as encodeOffer, i as fillOffer, o as offerContract, j as offerVtxoScript, s as swapPrograms } from './offer-BEcW5o7V.cjs';
|
|
10
|
+
export { c as OfferSwapWatcher, W as WatchOfferSwapsParams, w as watchOfferSwaps } from './watch-CpnfqYCE.cjs';
|
|
11
11
|
|
|
12
12
|
/** Which wallet key signs this leg, at `profile.signer`. Omitted entirely (not blank) by a corridor
|
|
13
13
|
* whose leg this wallet never signs. */
|
|
@@ -403,6 +403,7 @@ declare function pushClaim(operator: SwapOperator, input: {
|
|
|
403
403
|
partiallyClaimed?: boolean;
|
|
404
404
|
/** @see operatorUnrollScript */
|
|
405
405
|
network?: Network;
|
|
406
|
+
oneShot?: boolean;
|
|
406
407
|
}): Promise<{
|
|
407
408
|
txid: string;
|
|
408
409
|
amount: number;
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ProvisionedKey, ProvisionedClaimSecret, RestIndexerProvider, Transaction, ActivityResolver, IWallet, Network, OnchainProvider, VHTLC, Identity, Asset, PaymentRail } from '@arkade-os/sdk';
|
|
2
|
-
import { bh as SwapSecretsProjection, e as RfqSwapRecord, h as AssetSwap, d as AssetSwapRepository, L as LockupSpendIndexer, bb as RfqSwapState, bd as SwapOperator, bi as LockupContractSource, bj as RfqSwap, bk as ArkadeRefundResult, bl as LockupVtxo } from './repository-
|
|
3
|
-
export { c as AssetSwapStatus, bm as AvailableRfqSwapManagerCallbacks, bn as BTC_ASSET_ID, bo as LightningReceiveSwap, bp as LightningSendSwap, bq as LockupFate, br as LockupNeedsRecoveryError, bs as LockupParams, bt as LockupSpend, bu as OnchainReceiveAction, bv as OnchainReceiveNeedsChainSource, bw as OnchainReceiveSwap, bx as OnchainSendAction, by as OnchainSendSwap, bz as PersistableRfqSwap, bA as PreimageBlockedReason, bB as PreimageNotRecoverableError, bC as REFUND_MTP_LAG_SECONDS, bD as RFQ_SWAP_RETENTION_SECONDS, bE as ReceiveLockupSwap, bF as RfqRestoreFailure, bG as RfqRestoreOptions, bH as RfqRestoreResult, bg as RfqSwapActionName, bI as RfqSwapLockup, bJ as RfqSwapManager, bf as RfqSwapManagerCallbacks, bK as RfqSwapManagerConfig, bL as RfqSwapManagerDeps, bM as RfqSwapManagerEvents, bN as RfqSwapOrigin, bO as RfqSwapOriginRequired, bP as RfqSwapOutcome, a as RfqSwapRecordStore, bQ as addAssetSwap, bR as awaitRfqResolution, bS as createRfqSwapRecord, bT as findLockupVtxos, bU as getAssetSwaps, bV as isRfqTerminal, bW as nextOnchainAction, bX as nextOnchainReceiveAction, bY as normalizeRfqSwapRecord, bZ as preimageForSwapRecord, b_ as pushRefundWithoutReceiver, b$ as readLockupFate, c0 as rebuildRfqSwap, c1 as rfqSwapOriginOf, c2 as shouldRetainRfqSwap, c3 as swapSecretsToRecord, c4 as updateAssetSwap, c5 as updateRfqSwapRecord } from './repository-
|
|
2
|
+
import { bh as SwapSecretsProjection, e as RfqSwapRecord, h as AssetSwap, d as AssetSwapRepository, L as LockupSpendIndexer, bb as RfqSwapState, bd as SwapOperator, bi as LockupContractSource, bj as RfqSwap, bk as ArkadeRefundResult, bl as LockupVtxo } from './repository-ChRNknNn.js';
|
|
3
|
+
export { c as AssetSwapStatus, bm as AvailableRfqSwapManagerCallbacks, bn as BTC_ASSET_ID, bo as LightningReceiveSwap, bp as LightningSendSwap, bq as LockupFate, br as LockupNeedsRecoveryError, bs as LockupParams, bt as LockupSpend, bu as OnchainReceiveAction, bv as OnchainReceiveNeedsChainSource, bw as OnchainReceiveSwap, bx as OnchainSendAction, by as OnchainSendSwap, bz as PersistableRfqSwap, bA as PreimageBlockedReason, bB as PreimageNotRecoverableError, bC as REFUND_MTP_LAG_SECONDS, bD as RFQ_SWAP_RETENTION_SECONDS, bE as ReceiveLockupSwap, bF as RfqRestoreFailure, bG as RfqRestoreOptions, bH as RfqRestoreResult, bg as RfqSwapActionName, bI as RfqSwapLockup, bJ as RfqSwapManager, bf as RfqSwapManagerCallbacks, bK as RfqSwapManagerConfig, bL as RfqSwapManagerDeps, bM as RfqSwapManagerEvents, bN as RfqSwapOrigin, bO as RfqSwapOriginRequired, bP as RfqSwapOutcome, a as RfqSwapRecordStore, bQ as addAssetSwap, bR as awaitRfqResolution, bS as createRfqSwapRecord, bT as findLockupVtxos, bU as getAssetSwaps, bV as isRfqTerminal, bW as nextOnchainAction, bX as nextOnchainReceiveAction, bY as normalizeRfqSwapRecord, bZ as preimageForSwapRecord, b_ as pushRefundWithoutReceiver, b$ as readLockupFate, c0 as rebuildRfqSwap, c1 as rfqSwapOriginOf, c2 as shouldRetainRfqSwap, c3 as swapSecretsToRecord, c4 as updateAssetSwap, c5 as updateRfqSwapRecord } from './repository-ChRNknNn.js';
|
|
4
4
|
import { h as OnchainNetwork, O as OnchainHtlc, g as OnchainHtlcParams, C as ChainSource, I as InvoiceFacts, e as RfqTransport, r as requestLightningSend, j as requestOnchainSend } from './rfq-C0tHOvn6.js';
|
|
5
5
|
export { A as ARKADE_BTC, k as AddressMismatch, l as ChainUtxo, H as HtlcUtxo, m as LIGHTNING_BTC, n as LIGHTNING_RECEIVE_PAIR, o as LIGHTNING_SEND_PAIR, p as LOCKTIME_THRESHOLD, f as LightningReceiveContractParams, L as LightningSendContractParams, M as MAX_MIN_CONFIRMATIONS, q as MIN_CLAIM_WINDOW_SECONDS, s as ONCHAIN_BTC, t as ONCHAIN_CLAIM_MARGIN_SECONDS, u as ONCHAIN_DUST_SATS, v as ONCHAIN_ORDER_MARGIN_SECONDS, w as ONCHAIN_RECEIVE_PAIR, x as ONCHAIN_SECONDS_PER_BLOCK, y as ONCHAIN_SEND_PAIR, z as OnchainHtlcPhase, B as RelaySocket, R as RfqQuote, D as RfqRefusalReason, E as RfqStatus, F as arkadeAssetLeg, G as arkadeSwapRequest, J as assertArkadeFundable, K as awaitOnchainFill, N as buildHtlcClaim, P as buildHtlcRefund, Q as canonicalAssetAmount, U as claimOnchainFill, V as classifyOnchainHtlc, W as deriveLightningReceive, X as deriveOnchainReceive, Y as deriveOnchainSend, Z as extractPreimage, _ as httpTransport, $ as l1ScriptForAddress, a0 as lightningReceiveContract, a1 as lightningReceiveRequest, a2 as lightningSendContract, a3 as lightningSendRequest, a4 as newPreimage, a5 as normalizeMakerPkScript, a6 as normalizeMakerPublicKey, a7 as onchainHtlcScript, a8 as onchainReceiveRequest, a9 as onchainSendRequest, aa as paymentHashOf, ab as relayTransport, ac as requestArkadeSwap, ad as requestLightningReceive, ae as requestOnchainReceive, af as unilateralClaimDelay, ag as unilateralRefundDelay, ah as unilateralRefundWithoutReceiverDelay, ai as verifyLockupAddress, aj as verifyOfferAddress, ak as verifyReceiveInvoice } from './rfq-C0tHOvn6.js';
|
|
6
|
-
export { d as ClaimPacketInput, e as LockupContractMissing, f as LockupContractReader, g as LockupContractWriter, h as SWAP_LOCKUP_CONTRACT_KIND, i as SWAP_LOCKUP_CONTRACT_LABEL, j as SWAP_LOCKUP_CONTRACT_TYPE, k as SealedClaimPacket, l as lockupContractParams, r as registerLockupContract, s as sealClaimPacket } from './lockupContract-
|
|
6
|
+
export { d as ClaimPacketInput, e as LockupContractMissing, f as LockupContractReader, g as LockupContractWriter, h as SWAP_LOCKUP_CONTRACT_KIND, i as SWAP_LOCKUP_CONTRACT_LABEL, j as SWAP_LOCKUP_CONTRACT_TYPE, k as SealedClaimPacket, l as lockupContractParams, r as registerLockupContract, s as sealClaimPacket } from './lockupContract-D-OpxRSX.js';
|
|
7
7
|
import { Network as Network$1, LocalCardInput, TransportCardFetcher, DiscoveredMarket, Side, OfferPlan } from '@arkade-os/solver-discovery';
|
|
8
|
-
import { O as Offer } from './offer-
|
|
9
|
-
export { A as ASSET_CARRIER_SATS, F as FillFunding, a as FillOutpoint, N as NoSpendableDepositError, c as OFFER_PACKET_TYPE, d as OfferCovenantMismatchError, e as cancelOffer, f as createOffer, g as decodeOffer, h as encodeOffer, i as fillOffer, o as offerContract, j as offerVtxoScript, s as swapPrograms } from './offer-
|
|
10
|
-
export { c as OfferSwapWatcher, W as WatchOfferSwapsParams, w as watchOfferSwaps } from './watch-
|
|
8
|
+
import { O as Offer } from './offer-4Ir1bRQV.js';
|
|
9
|
+
export { A as ASSET_CARRIER_SATS, F as FillFunding, a as FillOutpoint, N as NoSpendableDepositError, c as OFFER_PACKET_TYPE, d as OfferCovenantMismatchError, e as cancelOffer, f as createOffer, g as decodeOffer, h as encodeOffer, i as fillOffer, o as offerContract, j as offerVtxoScript, s as swapPrograms } from './offer-4Ir1bRQV.js';
|
|
10
|
+
export { c as OfferSwapWatcher, W as WatchOfferSwapsParams, w as watchOfferSwaps } from './watch-B_Q0ddHg.js';
|
|
11
11
|
|
|
12
12
|
/** Which wallet key signs this leg, at `profile.signer`. Omitted entirely (not blank) by a corridor
|
|
13
13
|
* whose leg this wallet never signs. */
|
|
@@ -403,6 +403,7 @@ declare function pushClaim(operator: SwapOperator, input: {
|
|
|
403
403
|
partiallyClaimed?: boolean;
|
|
404
404
|
/** @see operatorUnrollScript */
|
|
405
405
|
network?: Network;
|
|
406
|
+
oneShot?: boolean;
|
|
406
407
|
}): Promise<{
|
|
407
408
|
txid: string;
|
|
408
409
|
amount: number;
|
package/dist/protocol.js
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
validatePlan,
|
|
43
43
|
watchMarkets,
|
|
44
44
|
watchOfferSwaps
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-G5QURHVP.js";
|
|
46
46
|
import {
|
|
47
47
|
ARKADE_BTC,
|
|
48
48
|
ASSET_CARRIER_SATS,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
verifyLockupAddress,
|
|
129
129
|
verifyOfferAddress,
|
|
130
130
|
verifyReceiveInvoice
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-2AQYBSF5.js";
|
|
132
132
|
import {
|
|
133
133
|
collectRfqSwaps
|
|
134
134
|
} from "./chunk-A3SHHRX4.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RealmLike } from '@arkade-os/sdk/repositories/realm';
|
|
2
2
|
import { PageRequest, PageResult } from '@arkade-os/sdk';
|
|
3
|
-
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-
|
|
3
|
+
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-BW42Dtct.cjs';
|
|
4
4
|
import '@arkade-os/solver-discovery';
|
|
5
5
|
import '../../rfq-C0tHOvn6.cjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RealmLike } from '@arkade-os/sdk/repositories/realm';
|
|
2
2
|
import { PageRequest, PageResult } from '@arkade-os/sdk';
|
|
3
|
-
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-
|
|
3
|
+
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-ChRNknNn.js';
|
|
4
4
|
import '@arkade-os/solver-discovery';
|
|
5
5
|
import '../../rfq-C0tHOvn6.js';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
|
|
2
2
|
import { PageRequest, PageResult } from '@arkade-os/sdk';
|
|
3
|
-
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-
|
|
3
|
+
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-BW42Dtct.cjs';
|
|
4
4
|
import '@arkade-os/solver-discovery';
|
|
5
5
|
import '../../rfq-C0tHOvn6.cjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
|
|
2
2
|
import { PageRequest, PageResult } from '@arkade-os/sdk';
|
|
3
|
-
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-
|
|
3
|
+
import { d as AssetSwapRepository, h as AssetSwap, e as RfqSwapRecord, f as RfqSwapPageFilter, g as RfqSwapPageCursor, S as SwapRecord, b9 as MarketsCacheEntry } from '../../repository-ChRNknNn.js';
|
|
4
4
|
import '@arkade-os/solver-discovery';
|
|
5
5
|
import '../../rfq-C0tHOvn6.js';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWallet } from '@arkade-os/sdk';
|
|
2
|
-
import { c as AssetSwapStatus, d as AssetSwapRepository, h as AssetSwap } from './repository-
|
|
2
|
+
import { c as AssetSwapStatus, d as AssetSwapRepository, h as AssetSwap } from './repository-ChRNknNn.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* What this watcher needs to know about an offer swap, narrower than {@link AssetSwap}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWallet } from '@arkade-os/sdk';
|
|
2
|
-
import { c as AssetSwapStatus, d as AssetSwapRepository, h as AssetSwap } from './repository-
|
|
2
|
+
import { c as AssetSwapStatus, d as AssetSwapRepository, h as AssetSwap } from './repository-BW42Dtct.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* What this watcher needs to know about an offer swap, narrower than {@link AssetSwap}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkade-os/swap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Client-side Arkade Intents asset swaps: state a route, get an outcome. Pay a bolt11 invoice, receive over Lightning, exchange assets, or withdraw onchain.",
|
|
6
6
|
"repository": {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@scure/base": "2.4.0",
|
|
105
105
|
"@scure/btc-signer": "2.4.1",
|
|
106
106
|
"light-bolt11-decoder": "3.2.0",
|
|
107
|
-
"@arkade-os/sdk": "0.5.
|
|
107
|
+
"@arkade-os/sdk": "0.5.3"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
110
|
"nostr-tools": "2.24.1"
|