@arkade-os/swap 0.1.2 → 0.1.4
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/README.md +1 -1
- package/dist/advanced.cjs +31 -38
- package/dist/advanced.d.cts +8 -8
- package/dist/advanced.d.ts +8 -8
- package/dist/advanced.js +5 -3
- package/dist/{chunk-ICSREL7N.js → chunk-7BBQ74BG.js} +15 -14
- package/dist/{chunk-BLECLU5Q.js → chunk-GJKGPE3S.js} +19 -33
- package/dist/{chunk-J2PMAQP2.js → chunk-HDCC3JZR.js} +14 -11
- package/dist/index.cjs +28 -38
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/{lockupContract-CIXkJPxV.d.ts → lockupContract-CdXh9yIr.d.ts} +1 -1
- package/dist/{lockupContract-CkhWMKCo.d.cts → lockupContract-QfbsjyXG.d.cts} +1 -1
- package/dist/node/index.cjs +37 -37
- package/dist/node/index.js +37 -37
- package/dist/nostr.d.cts +1 -1
- package/dist/nostr.d.ts +1 -1
- package/dist/nostr.js +1 -1
- package/dist/{offer-Diff5Flc.d.cts → offer-BxzPQ6zh.d.cts} +11 -11
- package/dist/{offer-BPD2ortO.d.ts → offer-Q1lVhrVX.d.ts} +11 -11
- package/dist/{offerFillPlan-B-5ae_gQ.d.cts → offerFillPlan-CvKlB246.d.cts} +16 -11
- package/dist/{offerFillPlan-CJzneX6F.d.ts → offerFillPlan-_PhFt4B1.d.ts} +16 -11
- package/dist/protocol.cjs +27 -38
- package/dist/protocol.d.cts +9 -8
- package/dist/protocol.d.ts +9 -8
- package/dist/protocol.js +2 -2
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.cjs +37 -37
- package/dist/repositories/sqlite/index.d.cts +3 -3
- package/dist/repositories/sqlite/index.d.ts +3 -3
- package/dist/repositories/sqlite/index.js +37 -37
- package/dist/{repository-BBVRh9ez.d.ts → repository-BOQ1qYoj.d.ts} +8 -7
- package/dist/{repository-C4pvymhs.d.cts → repository-Cut4eEkm.d.cts} +8 -7
- package/dist/{rfq-C0tHOvn6.d.cts → rfq-CP-P0PSL.d.cts} +7 -7
- package/dist/{rfq-C0tHOvn6.d.ts → rfq-CP-P0PSL.d.ts} +7 -7
- package/dist/{watch-7BiRa4oB.d.ts → watch-D15U0QpD.d.ts} +1 -1
- package/dist/{watch-Bxq-lx_6.d.cts → watch-D4PeBZ3H.d.cts} +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -216,7 +216,7 @@ Native does not, so install `react-native-get-random-values` (or `expo-crypto`)
|
|
|
216
216
|
before this package. `crypto.subtle` is unused. `EventSource` and `WebSocket` are needed only by
|
|
217
217
|
the watch and relay transports, each of which takes an injected implementation.
|
|
218
218
|
|
|
219
|
-
The client takes no
|
|
219
|
+
The client takes no operator URL. Operator info, Arkade chain reads and broadcast are all derived
|
|
220
220
|
from the wallet, which is the single place that knows which operator it speaks to. The onchain
|
|
221
221
|
corridor is the exception: `IWallet` carries no L1 provider, so it reads bitcoin from Esplora at
|
|
222
222
|
`ESPLORA_URL[network]`. Point it elsewhere with
|
package/dist/advanced.cjs
CHANGED
|
@@ -781,7 +781,7 @@ async function deriveOffer(wallet, params) {
|
|
|
781
781
|
})()
|
|
782
782
|
]);
|
|
783
783
|
const operatorPubKey = import_base2.hex.decode((0, import_sdk3.toXOnlySignerHex)(info.signerPubkey));
|
|
784
|
-
const network = (0, import_sdk3.
|
|
784
|
+
const network = (0, import_sdk3.networkFromOperatorInfo)(info);
|
|
785
785
|
const emuKey = import_base2.hex.decode(
|
|
786
786
|
(0, import_sdk3.toXOnlySignerHex)((0, import_sdk3.resolveEmulatorPubkey)(network, params.emulatorPubkey))
|
|
787
787
|
);
|
|
@@ -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);
|
|
@@ -876,7 +877,7 @@ async function connectFillContract(wallet, arkServerUrl, offer, opts = {}) {
|
|
|
876
877
|
const { swapAddress, emulator, emulatorPubkey } = opts;
|
|
877
878
|
const contractManager = await wallet.getContractManager();
|
|
878
879
|
const client = await import_sdk3.arkade.Arkade.connect({
|
|
879
|
-
arkade: new import_sdk3.
|
|
880
|
+
arkade: new import_sdk3.RestOperatorProvider(arkServerUrl),
|
|
880
881
|
indexer: new import_sdk3.RestIndexerProvider(arkServerUrl),
|
|
881
882
|
identity: wallet.identity,
|
|
882
883
|
contractManager,
|
|
@@ -1246,7 +1247,7 @@ var init_offer = __esm({
|
|
|
1246
1247
|
derivingClient = (wallet, info, contractManager) => import_sdk3.arkade.Arkade.connect({
|
|
1247
1248
|
arkade: { getInfo: async () => info },
|
|
1248
1249
|
identity: wallet.identity,
|
|
1249
|
-
network: (0, import_sdk3.
|
|
1250
|
+
network: (0, import_sdk3.networkFromOperatorInfo)(info),
|
|
1250
1251
|
contractManager
|
|
1251
1252
|
});
|
|
1252
1253
|
NoSpendableDepositError = class extends Error {
|
|
@@ -2846,6 +2847,7 @@ __export(advanced_exports, {
|
|
|
2846
2847
|
legOf: () => legOf,
|
|
2847
2848
|
lightningCorridor: () => lightningCorridor,
|
|
2848
2849
|
liveArkadeInfo: () => liveArkadeInfo,
|
|
2850
|
+
liveOperatorInfo: () => liveOperatorInfo,
|
|
2849
2851
|
marketBackendOf: () => marketBackendOf,
|
|
2850
2852
|
marketKeyOf: () => marketKeyOf,
|
|
2851
2853
|
marketOf: () => marketOf,
|
|
@@ -4920,7 +4922,7 @@ var operatorUnrollScript = async (operator, network) => {
|
|
|
4920
4922
|
const info = await operator.getInfo();
|
|
4921
4923
|
return (0, import_sdk14.assertValidServerUnrollScript)(
|
|
4922
4924
|
info.checkpointTapscript,
|
|
4923
|
-
network ?? (0, import_sdk14.
|
|
4925
|
+
network ?? (0, import_sdk14.networkFromOperatorInfo)(info),
|
|
4924
4926
|
(0, import_sdk14.toXOnly)(import_base10.hex.decode(info.forfeitPubkey), "forfeit key")
|
|
4925
4927
|
);
|
|
4926
4928
|
};
|
|
@@ -4966,30 +4968,16 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
4966
4968
|
const leaf = input.contract.refundWithoutReceiver();
|
|
4967
4969
|
const vtxos = boundedLockupSpend(input.vtxos);
|
|
4968
4970
|
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);
|
|
4971
|
+
const txid = await (0, import_sdk14.signAndSubmitOffchainTx)({
|
|
4972
|
+
identity: input.sender,
|
|
4973
|
+
provider: operator,
|
|
4974
|
+
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
4975
|
+
outputs: [{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
4976
|
+
serverUnrollScript,
|
|
4977
|
+
oneShot: input.oneShot
|
|
4978
|
+
});
|
|
4991
4979
|
return {
|
|
4992
|
-
txid
|
|
4980
|
+
txid,
|
|
4993
4981
|
amount,
|
|
4994
4982
|
left: input.vtxos.length - vtxos.length,
|
|
4995
4983
|
spent: vtxos
|
|
@@ -5212,7 +5200,7 @@ var emulatorPubkeyFor = (base) => {
|
|
|
5212
5200
|
} catch {
|
|
5213
5201
|
throw new MissingCorridorDep(
|
|
5214
5202
|
"arkade",
|
|
5215
|
-
`
|
|
5203
|
+
`key for the operator's cosigner that emulates Arkade Script (none is pinned for ${base.networkName}; pass emulatorPubkey)`
|
|
5216
5204
|
);
|
|
5217
5205
|
}
|
|
5218
5206
|
};
|
|
@@ -5271,7 +5259,7 @@ function resolveCorridorDeps(corridor, overrides, base) {
|
|
|
5271
5259
|
}
|
|
5272
5260
|
}
|
|
5273
5261
|
}
|
|
5274
|
-
var
|
|
5262
|
+
var liveOperatorInfo = async (wallet, opts = {}) => {
|
|
5275
5263
|
const requireLive = opts.requireLive ?? true;
|
|
5276
5264
|
try {
|
|
5277
5265
|
return await wallet.getArkadeInfo({ requireLive });
|
|
@@ -5282,8 +5270,9 @@ var liveArkadeInfo = async (wallet, opts = {}) => {
|
|
|
5282
5270
|
);
|
|
5283
5271
|
}
|
|
5284
5272
|
};
|
|
5273
|
+
var liveArkadeInfo = liveOperatorInfo;
|
|
5285
5274
|
var resolveCorridorBase = async (input) => {
|
|
5286
|
-
const info = await
|
|
5275
|
+
const info = await liveOperatorInfo(input.wallet, { requireLive: input.requireLive });
|
|
5287
5276
|
const networkName = info.network;
|
|
5288
5277
|
return {
|
|
5289
5278
|
wallet: input.wallet,
|
|
@@ -6406,7 +6395,8 @@ async function pushClaim(operator, input) {
|
|
|
6406
6395
|
...lockupAssetOutputs(vtxos)
|
|
6407
6396
|
],
|
|
6408
6397
|
serverUnrollScript,
|
|
6409
|
-
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
6398
|
+
verifyServerSignatures: { serverPubkey: input.contract.options.server },
|
|
6399
|
+
oneShot: input.oneShot
|
|
6410
6400
|
});
|
|
6411
6401
|
return { txid, amount: locked, left: live.length - vtxos.length, spent: vtxos };
|
|
6412
6402
|
}
|
|
@@ -6620,7 +6610,8 @@ function arkadeRefunder(deps) {
|
|
|
6620
6610
|
contract,
|
|
6621
6611
|
sender,
|
|
6622
6612
|
vtxos,
|
|
6623
|
-
network: await deps.network?.()
|
|
6613
|
+
network: await deps.network?.(),
|
|
6614
|
+
oneShot: deps.wallet.oneShotSubmit
|
|
6624
6615
|
});
|
|
6625
6616
|
if (result.left > 0 || done) {
|
|
6626
6617
|
spentBy.set(swap.rfqId, /* @__PURE__ */ new Set([...done ?? [], ...result.spent.map(keyOf)]));
|
|
@@ -8347,7 +8338,8 @@ var createSwapDrive = (config) => {
|
|
|
8347
8338
|
// Passed through: `pushClaim`'s own value check decides whether `P` is published.
|
|
8348
8339
|
expectedAmount: swap.expectedAmount,
|
|
8349
8340
|
partiallyClaimed,
|
|
8350
|
-
network: await pinnedNetwork()
|
|
8341
|
+
network: await pinnedNetwork(),
|
|
8342
|
+
oneShot: wallet.oneShotSubmit
|
|
8351
8343
|
})
|
|
8352
8344
|
);
|
|
8353
8345
|
};
|
|
@@ -9500,7 +9492,7 @@ var lockupOf = (derived) => ({
|
|
|
9500
9492
|
pkScript: derived.swapPkScript
|
|
9501
9493
|
});
|
|
9502
9494
|
var covenantInputs = (input) => {
|
|
9503
|
-
const network = (0, import_sdk35.
|
|
9495
|
+
const network = (0, import_sdk35.networkFromOperatorInfo)(input.info);
|
|
9504
9496
|
const arkade3 = input.corridors.get("arkade").deps;
|
|
9505
9497
|
return {
|
|
9506
9498
|
operatorPubkey: (0, import_sdk35.toXOnly)(import_base21.hex.decode(input.info.signerPubkey), "ark signer key"),
|
|
@@ -9570,7 +9562,7 @@ var quoteArkadeAsset = async (input) => {
|
|
|
9570
9562
|
const receivePkScript = resolveReceivePkScript(
|
|
9571
9563
|
receiveAddress,
|
|
9572
9564
|
maker.pkScript,
|
|
9573
|
-
(0, import_sdk35.
|
|
9565
|
+
(0, import_sdk35.networkFromOperatorInfo)(input.info).hrp,
|
|
9574
9566
|
(0, import_sdk35.toXOnly)(import_base21.hex.decode(input.info.signerPubkey), "ark signer key")
|
|
9575
9567
|
);
|
|
9576
9568
|
const choice = payment?.carrier;
|
|
@@ -9638,7 +9630,7 @@ var quoteArkadeAsset = async (input) => {
|
|
|
9638
9630
|
receiveAddress: receiveAddress ?? new import_sdk35.ArkAddress(
|
|
9639
9631
|
(0, import_sdk35.toXOnly)(import_base21.hex.decode(input.info.signerPubkey), "ark signer key"),
|
|
9640
9632
|
maker.pkScript.slice(2),
|
|
9641
|
-
(0, import_sdk35.
|
|
9633
|
+
(0, import_sdk35.networkFromOperatorInfo)(input.info).hrp
|
|
9642
9634
|
).encode(),
|
|
9643
9635
|
validUntil,
|
|
9644
9636
|
...carrier === void 0 ? {} : { carrier },
|
|
@@ -10352,7 +10344,7 @@ var createSwapClient = (config) => {
|
|
|
10352
10344
|
remember(quoteId, preparation);
|
|
10353
10345
|
return quote;
|
|
10354
10346
|
}
|
|
10355
|
-
const info = await
|
|
10347
|
+
const info = await liveOperatorInfo(wallet, { requireLive: true });
|
|
10356
10348
|
const rendezvous = market.card.discovery_pubkey;
|
|
10357
10349
|
if (rendezvous === void 0) {
|
|
10358
10350
|
throw new Error(`card ${market.card.solver} names no discovery key to address`);
|
|
@@ -11132,6 +11124,7 @@ var readCommonProfile = (profile, paymentHash, chainId) => {
|
|
|
11132
11124
|
legOf,
|
|
11133
11125
|
lightningCorridor,
|
|
11134
11126
|
liveArkadeInfo,
|
|
11127
|
+
liveOperatorInfo,
|
|
11135
11128
|
marketBackendOf,
|
|
11136
11129
|
marketKeyOf,
|
|
11137
11130
|
marketOf,
|
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
|
|
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-CvKlB246.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 liveOperatorInfo, b7 as marketBackendOf, b8 as marketKeyOf, b9 as marketOf, ba as marketRefOf, bb as nostrTransportFactory, bc as parseRfqQuote, bd as pay, be as quoteFromFeed, bf as quoteViaRfq, bg as readableRecord, bh as receive, bi as resolveCorridorBase, bj as resolveCorridorDeps, bk as rfqLeg, bl as rfqPairFor, bm as swapRecordOf, bn as toDiscoveryLeg, bo as unsignedPsbtBytes, bp as usableMarkets, bq as verifyJointGraph, br as verifyOfferFillPlan, bs as verifyPlanLegs, bt as withCanonicalAmount } from './offerFillPlan-CvKlB246.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-
|
|
6
|
-
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-
|
|
7
|
-
export { S as SwapRefusal } from './rfq-
|
|
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-Cut4eEkm.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-Cut4eEkm.cjs';
|
|
6
|
+
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-CP-P0PSL.cjs';
|
|
7
|
+
export { S as SwapRefusal } from './rfq-CP-P0PSL.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-D4PeBZ3H.cjs';
|
|
11
|
+
import './offer-BxzPQ6zh.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
|
|
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-_PhFt4B1.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 liveOperatorInfo, b7 as marketBackendOf, b8 as marketKeyOf, b9 as marketOf, ba as marketRefOf, bb as nostrTransportFactory, bc as parseRfqQuote, bd as pay, be as quoteFromFeed, bf as quoteViaRfq, bg as readableRecord, bh as receive, bi as resolveCorridorBase, bj as resolveCorridorDeps, bk as rfqLeg, bl as rfqPairFor, bm as swapRecordOf, bn as toDiscoveryLeg, bo as unsignedPsbtBytes, bp as usableMarkets, bq as verifyJointGraph, br as verifyOfferFillPlan, bs as verifyPlanLegs, bt as withCanonicalAmount } from './offerFillPlan-_PhFt4B1.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-
|
|
6
|
-
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-
|
|
7
|
-
export { S as SwapRefusal } from './rfq-
|
|
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-BOQ1qYoj.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-BOQ1qYoj.js';
|
|
6
|
+
import { I as InvoiceFacts, C as ChainSource, R as RfqQuote } from './rfq-CP-P0PSL.js';
|
|
7
|
+
export { S as SwapRefusal } from './rfq-CP-P0PSL.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-D15U0QpD.js';
|
|
11
|
+
import './offer-Q1lVhrVX.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
|
@@ -83,6 +83,7 @@ import {
|
|
|
83
83
|
isUsableCard,
|
|
84
84
|
issuanceOf,
|
|
85
85
|
liveArkadeInfo,
|
|
86
|
+
liveOperatorInfo,
|
|
86
87
|
marketBackendOf,
|
|
87
88
|
marketKeyOf,
|
|
88
89
|
marketOf,
|
|
@@ -138,7 +139,7 @@ import {
|
|
|
138
139
|
withCanonicalAmount,
|
|
139
140
|
withDepositFate,
|
|
140
141
|
withRfqState
|
|
141
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-HDCC3JZR.js";
|
|
142
143
|
import {
|
|
143
144
|
ACTIVITY_TOKEN,
|
|
144
145
|
Amount,
|
|
@@ -173,7 +174,7 @@ import {
|
|
|
173
174
|
recordOutcome,
|
|
174
175
|
swapOf,
|
|
175
176
|
toAtomicDecimal
|
|
176
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-GJKGPE3S.js";
|
|
177
178
|
import {
|
|
178
179
|
ARKADE_BTC,
|
|
179
180
|
SwapRefusal,
|
|
@@ -182,7 +183,7 @@ import {
|
|
|
182
183
|
bindsClaimAmount,
|
|
183
184
|
rfqPair,
|
|
184
185
|
sealClaimPacket
|
|
185
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-7BBQ74BG.js";
|
|
186
187
|
import "./chunk-A3SHHRX4.js";
|
|
187
188
|
|
|
188
189
|
// src/reveal.ts
|
|
@@ -670,6 +671,7 @@ export {
|
|
|
670
671
|
legOf,
|
|
671
672
|
lightningCorridor,
|
|
672
673
|
liveArkadeInfo,
|
|
674
|
+
liveOperatorInfo,
|
|
673
675
|
marketBackendOf,
|
|
674
676
|
marketKeyOf,
|
|
675
677
|
marketOf,
|
|
@@ -240,12 +240,12 @@ import { concatBytes } from "@scure/btc-signer/utils.js";
|
|
|
240
240
|
import {
|
|
241
241
|
ASSET_CARRIER_SATS as SDK_ASSET_CARRIER_SATS,
|
|
242
242
|
ArkAddress,
|
|
243
|
-
|
|
243
|
+
RestOperatorProvider,
|
|
244
244
|
RestEmulatorProvider,
|
|
245
245
|
RestIndexerProvider,
|
|
246
246
|
arkade,
|
|
247
247
|
asset,
|
|
248
|
-
|
|
248
|
+
networkFromOperatorInfo,
|
|
249
249
|
resolveEmulatorPubkey,
|
|
250
250
|
toXOnlySignerHex
|
|
251
251
|
} from "@arkade-os/sdk";
|
|
@@ -622,7 +622,7 @@ async function registerOfferContract(wallet, info, binding, operatorPubkey, expe
|
|
|
622
622
|
var derivingClient = (wallet, info, contractManager) => arkade.Arkade.connect({
|
|
623
623
|
arkade: { getInfo: async () => info },
|
|
624
624
|
identity: wallet.identity,
|
|
625
|
-
network:
|
|
625
|
+
network: networkFromOperatorInfo(info),
|
|
626
626
|
contractManager
|
|
627
627
|
});
|
|
628
628
|
function offerContractParams(client, binding, operatorPubkey, expectedPkScript) {
|
|
@@ -750,7 +750,7 @@ async function deriveOffer(wallet, params) {
|
|
|
750
750
|
})()
|
|
751
751
|
]);
|
|
752
752
|
const operatorPubKey = hex2.decode(toXOnlySignerHex(info.signerPubkey));
|
|
753
|
-
const network =
|
|
753
|
+
const network = networkFromOperatorInfo(info);
|
|
754
754
|
const emuKey = hex2.decode(
|
|
755
755
|
toXOnlySignerHex(resolveEmulatorPubkey(network, params.emulatorPubkey))
|
|
756
756
|
);
|
|
@@ -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);
|
|
@@ -921,7 +922,7 @@ async function connectFillContract(wallet, arkServerUrl, offer, opts = {}) {
|
|
|
921
922
|
const { swapAddress, emulator, emulatorPubkey } = opts;
|
|
922
923
|
const contractManager = await wallet.getContractManager();
|
|
923
924
|
const client = await arkade.Arkade.connect({
|
|
924
|
-
arkade: new
|
|
925
|
+
arkade: new RestOperatorProvider(arkServerUrl),
|
|
925
926
|
indexer: new RestIndexerProvider(arkServerUrl),
|
|
926
927
|
identity: wallet.identity,
|
|
927
928
|
contractManager,
|
|
@@ -1680,7 +1681,7 @@ import {
|
|
|
1680
1681
|
ArkAddress as ArkAddress3,
|
|
1681
1682
|
assertTimerMs as assertTimerMs2,
|
|
1682
1683
|
VHTLC,
|
|
1683
|
-
|
|
1684
|
+
networkFromOperatorInfo as networkFromOperatorInfo2,
|
|
1684
1685
|
resolveEmulatorPubkey as resolveEmulatorPubkey2,
|
|
1685
1686
|
toXOnly
|
|
1686
1687
|
} from "@arkade-os/sdk";
|
|
@@ -2282,7 +2283,7 @@ async function requestLightningSend(wallet, transport, params) {
|
|
|
2282
2283
|
);
|
|
2283
2284
|
}
|
|
2284
2285
|
const operatorPubkey = toXOnly(hex5.decode(info.signerPubkey), "ark signer key");
|
|
2285
|
-
const network =
|
|
2286
|
+
const network = networkFromOperatorInfo2(info);
|
|
2286
2287
|
const derived = deriveLightningSend({
|
|
2287
2288
|
quote,
|
|
2288
2289
|
paymentHash: params.invoice.paymentHash,
|
|
@@ -2377,7 +2378,7 @@ async function requestArkadeSwap(wallet, transport, params) {
|
|
|
2377
2378
|
const makerPkScript = info === void 0 ? ownPkScript : resolveReceivePkScript(
|
|
2378
2379
|
receiveAddress,
|
|
2379
2380
|
ownPkScript,
|
|
2380
|
-
|
|
2381
|
+
networkFromOperatorInfo2(info).hrp,
|
|
2381
2382
|
toXOnly(hex5.decode(info.signerPubkey), "ark signer key")
|
|
2382
2383
|
);
|
|
2383
2384
|
const pair = rfqPair(
|
|
@@ -2451,8 +2452,8 @@ async function requestArkadeSwap(wallet, transport, params) {
|
|
|
2451
2452
|
};
|
|
2452
2453
|
}
|
|
2453
2454
|
var l1NetworkFromArk = (network) => network === "bitcoin" ? "bitcoin" : network === "regtest" ? "regtest" : "testnet";
|
|
2454
|
-
var
|
|
2455
|
-
const network =
|
|
2455
|
+
var operatorTerms = (info, emulatorPubkey) => {
|
|
2456
|
+
const network = networkFromOperatorInfo2(info);
|
|
2456
2457
|
return {
|
|
2457
2458
|
operatorPubkey: toXOnly(hex5.decode(info.signerPubkey), "ark signer key"),
|
|
2458
2459
|
emulatorPubkey: toXOnly(
|
|
@@ -2593,7 +2594,7 @@ async function requestOnchainSend(wallet, transport, params) {
|
|
|
2593
2594
|
quote,
|
|
2594
2595
|
paymentHash,
|
|
2595
2596
|
payoutPubkey: params.payoutPubkey,
|
|
2596
|
-
...
|
|
2597
|
+
...operatorTerms(info, params.emulatorPubkey),
|
|
2597
2598
|
l1Network: l1NetworkFromArk(info.network),
|
|
2598
2599
|
refundAddress,
|
|
2599
2600
|
senderPubkey
|
|
@@ -2808,7 +2809,7 @@ async function requestLightningReceive(wallet, transport, params) {
|
|
|
2808
2809
|
paymentHash,
|
|
2809
2810
|
payoutPubkey,
|
|
2810
2811
|
payoutAddress,
|
|
2811
|
-
...
|
|
2812
|
+
...operatorTerms(info, params.emulatorPubkey)
|
|
2812
2813
|
});
|
|
2813
2814
|
const now = Math.floor(Date.now() / 1e3);
|
|
2814
2815
|
const { payDeadline } = verifyReceiveInvoice({
|
|
@@ -2901,7 +2902,7 @@ async function requestOnchainReceive(wallet, transport, params) {
|
|
|
2901
2902
|
payoutPubkey,
|
|
2902
2903
|
payoutAddress,
|
|
2903
2904
|
refundPubkey: params.refundPubkey,
|
|
2904
|
-
...
|
|
2905
|
+
...operatorTerms(info, params.emulatorPubkey),
|
|
2905
2906
|
l1Network: l1NetworkFromArk(info.network)
|
|
2906
2907
|
});
|
|
2907
2908
|
assertFundable({
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
rfqCorridorHandlers,
|
|
25
25
|
rfqSignerOf,
|
|
26
26
|
updateAssetSwapBestEffort
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7BBQ74BG.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
|
-
|
|
937
|
-
|
|
934
|
+
networkFromOperatorInfo,
|
|
935
|
+
signAndSubmitOffchainTx,
|
|
938
936
|
scriptFromTapLeafScript,
|
|
939
937
|
toXOnly
|
|
940
938
|
} from "@arkade-os/sdk";
|
|
@@ -1092,7 +1090,7 @@ var operatorUnrollScript = async (operator, network) => {
|
|
|
1092
1090
|
const info = await operator.getInfo();
|
|
1093
1091
|
return assertValidServerUnrollScript(
|
|
1094
1092
|
info.checkpointTapscript,
|
|
1095
|
-
network ??
|
|
1093
|
+
network ?? networkFromOperatorInfo(info),
|
|
1096
1094
|
toXOnly(hex2.decode(info.forfeitPubkey), "forfeit key")
|
|
1097
1095
|
);
|
|
1098
1096
|
};
|
|
@@ -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)]));
|