@arkade-os/swap 0.1.0 → 0.1.1
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 +134 -24
- package/dist/advanced.d.cts +10 -8
- package/dist/advanced.d.ts +10 -8
- package/dist/advanced.js +6 -2
- package/dist/{chunk-WKJFXXSR.js → chunk-T4FHBWZI.js} +90 -13
- package/dist/{chunk-HRMWBULL.js → chunk-YHESEL4I.js} +53 -15
- package/dist/index.cjs +130 -24
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/{lockupContract-D7BNjksX.d.ts → lockupContract-CIXkJPxV.d.ts} +1 -1
- package/dist/{lockupContract-G-9CNRMq.d.cts → lockupContract-CkhWMKCo.d.cts} +1 -1
- package/dist/{offer-DdB1M6FZ.d.ts → offer-BPD2ortO.d.ts} +1 -1
- package/dist/{offer-CcJfx5Fj.d.cts → offer-Diff5Flc.d.cts} +1 -1
- package/dist/{offerFillPlan-BII0PW92.d.cts → offerFillPlan-B-5ae_gQ.d.cts} +40 -11
- package/dist/{offerFillPlan-CNTLVD7j.d.ts → offerFillPlan-CJzneX6F.d.ts} +40 -11
- package/dist/protocol.cjs +83 -11
- package/dist/protocol.d.cts +6 -6
- package/dist/protocol.d.ts +6 -6
- package/dist/protocol.js +1 -1
- 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-DmPzpbd7.d.ts → repository-BBVRh9ez.d.ts} +17 -2
- package/dist/{repository-DqdLVrVv.d.cts → repository-C4pvymhs.d.cts} +17 -2
- package/dist/{watch-CmJQDtsy.d.ts → watch-7BiRa4oB.d.ts} +1 -1
- package/dist/{watch-BonYT9af.d.cts → watch-Bxq-lx_6.d.cts} +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2998,7 +2998,8 @@ async function findLockupVtxos(contracts, swapPkScript) {
|
|
|
2998
2998
|
txid: vtxo.txid,
|
|
2999
2999
|
vout: vtxo.vout,
|
|
3000
3000
|
value: Number(vtxo.value),
|
|
3001
|
-
recoverable: vtxo.isSwept
|
|
3001
|
+
recoverable: vtxo.isSwept,
|
|
3002
|
+
...vtxo.assets?.length ? { assets: vtxo.assets } : {}
|
|
3002
3003
|
});
|
|
3003
3004
|
}
|
|
3004
3005
|
return out;
|
|
@@ -3008,17 +3009,17 @@ var candidateWitnessItems = (tx, inputIndex) => [
|
|
|
3008
3009
|
...(0, import_sdk8.getArkPsbtFields)(tx, inputIndex, import_sdk8.ConditionWitness).flat(),
|
|
3009
3010
|
...tx.getInput(inputIndex).finalScriptWitness ?? []
|
|
3010
3011
|
];
|
|
3011
|
-
var
|
|
3012
|
+
var refundLeafScript = (tx, inputIndex) => {
|
|
3012
3013
|
const input = tx.getInput(inputIndex);
|
|
3013
3014
|
const witness = input.finalScriptWitness;
|
|
3014
3015
|
const leaves = input.tapLeafScript ?? [];
|
|
3015
3016
|
const script = witness && witness.length >= 2 ? witness[witness.length - 2] : leaves.length === 1 ? (0, import_sdk8.scriptFromTapLeafScript)(leaves[0]) : void 0;
|
|
3016
|
-
if (!script) return
|
|
3017
|
+
if (!script) return void 0;
|
|
3017
3018
|
try {
|
|
3018
3019
|
const { type } = (0, import_sdk8.decodeTapscript)(script);
|
|
3019
|
-
return type === "multisig" || type === "csv-multisig" || type === "cltv-multisig";
|
|
3020
|
+
return type === "multisig" || type === "csv-multisig" || type === "cltv-multisig" ? script : void 0;
|
|
3020
3021
|
} catch {
|
|
3021
|
-
return
|
|
3022
|
+
return void 0;
|
|
3022
3023
|
}
|
|
3023
3024
|
};
|
|
3024
3025
|
async function readLockupFate(indexer, input) {
|
|
@@ -3051,6 +3052,7 @@ async function readLockupFate(indexer, input) {
|
|
|
3051
3052
|
const spends = [...spentBy.values()];
|
|
3052
3053
|
const { txs } = await indexer.getVirtualTxs([...spentBy.keys()]);
|
|
3053
3054
|
const refunded = /* @__PURE__ */ new Set();
|
|
3055
|
+
const leafScripts = /* @__PURE__ */ new Set();
|
|
3054
3056
|
for (const raw of txs) {
|
|
3055
3057
|
let tx;
|
|
3056
3058
|
try {
|
|
@@ -3072,11 +3074,15 @@ async function readLockupFate(indexer, input) {
|
|
|
3072
3074
|
return { fate: "claimed", preimage: candidate, spends };
|
|
3073
3075
|
}
|
|
3074
3076
|
}
|
|
3075
|
-
|
|
3077
|
+
const leafScript = refundLeafScript(tx, i);
|
|
3078
|
+
if (leafScript) {
|
|
3079
|
+
refunded.add(`${vtxo.txid}:${vtxo.vout}`);
|
|
3080
|
+
leafScripts.add(import_base7.hex.encode(leafScript));
|
|
3081
|
+
}
|
|
3076
3082
|
}
|
|
3077
3083
|
}
|
|
3078
3084
|
if (sweptLeft) return { fate: "open" };
|
|
3079
|
-
return everySpendNamed && all.every((vtxo) => refunded.has(`${vtxo.txid}:${vtxo.vout}`)) ? { fate: "returned", spends } : { fate: "unknown" };
|
|
3085
|
+
return everySpendNamed && all.every((vtxo) => refunded.has(`${vtxo.txid}:${vtxo.vout}`)) ? { fate: "returned", spends, leafScripts: [...leafScripts] } : { fate: "unknown" };
|
|
3080
3086
|
}
|
|
3081
3087
|
var assertNoneSwept = (vtxos, contract) => {
|
|
3082
3088
|
const swept = vtxos.filter((vtxo) => vtxo.recoverable);
|
|
@@ -3097,6 +3103,23 @@ var operatorUnrollScript = async (operator, network) => {
|
|
|
3097
3103
|
};
|
|
3098
3104
|
var MAX_LOCKUP_SPEND_INPUTS = 16;
|
|
3099
3105
|
var boundedLockupSpend = (vtxos) => [...vtxos].sort((a, b) => b.value - a.value).slice(0, MAX_LOCKUP_SPEND_INPUTS);
|
|
3106
|
+
var lockupAssetOutputs = (vtxos) => {
|
|
3107
|
+
const inputs = /* @__PURE__ */ new Map();
|
|
3108
|
+
const totals = /* @__PURE__ */ new Map();
|
|
3109
|
+
vtxos.forEach((vtxo, vin) => {
|
|
3110
|
+
if (!vtxo.assets?.length) return;
|
|
3111
|
+
inputs.set(vin, [...vtxo.assets]);
|
|
3112
|
+
for (const { assetId, amount } of vtxo.assets) {
|
|
3113
|
+
totals.set(assetId, (totals.get(assetId) ?? 0n) + amount);
|
|
3114
|
+
}
|
|
3115
|
+
});
|
|
3116
|
+
if (inputs.size === 0) return [];
|
|
3117
|
+
const receiver = {
|
|
3118
|
+
address: "",
|
|
3119
|
+
assets: [...totals].map(([assetId, amount]) => ({ assetId, amount }))
|
|
3120
|
+
};
|
|
3121
|
+
return [import_sdk8.Extension.create([(0, import_sdk8.createAssetPacket)(inputs, [receiver])]).txOut()];
|
|
3122
|
+
};
|
|
3100
3123
|
var lockupInputs = (vtxos, contract, leaf) => {
|
|
3101
3124
|
const tapTree = contract.encode();
|
|
3102
3125
|
return vtxos.map((vtxo) => ({
|
|
@@ -3122,7 +3145,7 @@ async function pushRefundWithoutReceiver(operator, input) {
|
|
|
3122
3145
|
const amount = vtxos.reduce((sum, vtxo) => sum + vtxo.value, 0);
|
|
3123
3146
|
const { arkTx: tx, checkpoints } = (0, import_sdk8.buildOffchainTx)(
|
|
3124
3147
|
lockupInputs(vtxos, input.contract, leaf),
|
|
3125
|
-
[{ script: refundPkScript, amount: BigInt(amount) }],
|
|
3148
|
+
[{ script: refundPkScript, amount: BigInt(amount) }, ...lockupAssetOutputs(vtxos)],
|
|
3126
3149
|
serverUnrollScript
|
|
3127
3150
|
);
|
|
3128
3151
|
const signedTx = await input.sender.sign(tx);
|
|
@@ -3405,8 +3428,7 @@ var chainSourceFrom = (provider, network) => {
|
|
|
3405
3428
|
}));
|
|
3406
3429
|
},
|
|
3407
3430
|
async getSpendingTx(txid, vout, pkScript) {
|
|
3408
|
-
const
|
|
3409
|
-
const outspend = outspends[vout];
|
|
3431
|
+
const outspend = provider.getTxOutspend ? await provider.getTxOutspend(txid, vout) : (await provider.getTxOutspends(txid))[vout];
|
|
3410
3432
|
if (!outspend?.spent) return null;
|
|
3411
3433
|
const spender = outspend.txid || await spenderFromHistory(txid, vout, pkScript);
|
|
3412
3434
|
if (!spender) return null;
|
|
@@ -3576,8 +3598,7 @@ var chainSourceOver = (backend, network) => {
|
|
|
3576
3598
|
}));
|
|
3577
3599
|
},
|
|
3578
3600
|
async getSpendingTx(txid, vout, pkScript) {
|
|
3579
|
-
const
|
|
3580
|
-
const outspend = outspends[vout];
|
|
3601
|
+
const outspend = backend.provider.getTxOutspend ? await backend.provider.getTxOutspend(txid, vout) : (await backend.provider.getTxOutspends(txid))[vout];
|
|
3581
3602
|
if (!outspend?.spent) return null;
|
|
3582
3603
|
const spender = outspend.txid || await spenderFromVins(txid, vout, pkScript);
|
|
3583
3604
|
if (!spender) return null;
|
|
@@ -5804,6 +5825,8 @@ var RFQ_SWAP_ACTIVE_STATES = [
|
|
|
5804
5825
|
"needs_counterparty"
|
|
5805
5826
|
];
|
|
5806
5827
|
var isRfqSwapTerminal = (state) => RFQ_SWAP_TERMINAL_STATES.includes(state);
|
|
5828
|
+
var isRecheckableRefundedSend = (record) => record.kind === "lightning_send" && record.state === "refunded" && !record.refundTxid;
|
|
5829
|
+
var isRfqSwapRestorable = (record) => !isRfqSwapTerminal(record.state) || isRecheckableRefundedSend(record);
|
|
5807
5830
|
|
|
5808
5831
|
// src/rfqRecord.ts
|
|
5809
5832
|
init_rfqCorridor();
|
|
@@ -6343,7 +6366,10 @@ async function pushClaim(operator, input) {
|
|
|
6343
6366
|
provider: operator,
|
|
6344
6367
|
inputs: lockupInputs(vtxos, input.contract, leaf),
|
|
6345
6368
|
// One aggregate output: this leaf inspects nothing about the output set.
|
|
6346
|
-
outputs: [
|
|
6369
|
+
outputs: [
|
|
6370
|
+
{ script: input.destinationPkScript, amount: BigInt(locked) },
|
|
6371
|
+
...lockupAssetOutputs(vtxos)
|
|
6372
|
+
],
|
|
6347
6373
|
serverUnrollScript,
|
|
6348
6374
|
verifyServerSignatures: { serverPubkey: input.contract.options.server }
|
|
6349
6375
|
});
|
|
@@ -6792,6 +6818,46 @@ var RfqSwapManager = class _RfqSwapManager {
|
|
|
6792
6818
|
}
|
|
6793
6819
|
return { restored, failed, pruned: [] };
|
|
6794
6820
|
}
|
|
6821
|
+
/**
|
|
6822
|
+
* Re-read stored `refunded` Lightning sends with no refund txid, one at a time. A misread
|
|
6823
|
+
* could have ended a settled send this way: a `claimed` read settles the record, any other
|
|
6824
|
+
* answer, or a failure, leaves it untouched. Returns the swaps it settled in every sink; one
|
|
6825
|
+
* a sink refused stays monitored for the poll to retry. `stopped` is checked before each
|
|
6826
|
+
* record and before each write, so a caller can walk away mid-run.
|
|
6827
|
+
*/
|
|
6828
|
+
async recheckRefundedSends(options = {}) {
|
|
6829
|
+
const repository = this.requireRepository("recheckRefundedSends");
|
|
6830
|
+
const params = options.params ?? this.paramsFromContracts();
|
|
6831
|
+
const settled = [];
|
|
6832
|
+
for (const record of await collectRfqSwaps(repository, { state: "refunded" })) {
|
|
6833
|
+
if (options.stopped?.()) break;
|
|
6834
|
+
if (!isRecheckableRefundedSend(record) || this.monitored.has(record.rfqId)) continue;
|
|
6835
|
+
const removedAt = this.removed.get(record.rfqId);
|
|
6836
|
+
try {
|
|
6837
|
+
const swap = rebuildRfqSwap(record, await params(record));
|
|
6838
|
+
const fate = await readLockupFate(this.deps.indexer, {
|
|
6839
|
+
swapPkScript: swap.lockupPkScript,
|
|
6840
|
+
paymentHash: swap.paymentHash
|
|
6841
|
+
});
|
|
6842
|
+
if (options.stopped?.()) break;
|
|
6843
|
+
if (fate.fate !== "claimed") continue;
|
|
6844
|
+
if (this.monitored.has(record.rfqId)) continue;
|
|
6845
|
+
if (this.removed.get(record.rfqId) !== removedAt) continue;
|
|
6846
|
+
delete swap.lockupSpendTxids;
|
|
6847
|
+
this.stampLockupSpends(swap, fate.spends);
|
|
6848
|
+
this.stampSettlementPreimage(swap, fate.preimage);
|
|
6849
|
+
this.setState(swap, "settled");
|
|
6850
|
+
if (await this.save(swap)) {
|
|
6851
|
+
this.dirty.delete(swap.rfqId);
|
|
6852
|
+
settled.push(swap);
|
|
6853
|
+
} else {
|
|
6854
|
+
this.track(swap);
|
|
6855
|
+
}
|
|
6856
|
+
} catch {
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
return settled;
|
|
6860
|
+
}
|
|
6795
6861
|
/**
|
|
6796
6862
|
* Drop stored records that are terminal and past `RFQ_SWAP_RETENTION_SECONDS` (per
|
|
6797
6863
|
* `shouldRetainRfqSwap`), and return their ids. Explicit only: restore keeps history.
|
|
@@ -7158,6 +7224,7 @@ var RfqSwapManager = class _RfqSwapManager {
|
|
|
7158
7224
|
* finalization and the per-swap lock belong to `pollSwap`.
|
|
7159
7225
|
*/
|
|
7160
7226
|
async runPass(swap) {
|
|
7227
|
+
if (isRfqSwapTerminal(swap.state)) return;
|
|
7161
7228
|
await this.ensureRegistered(swap);
|
|
7162
7229
|
let fate;
|
|
7163
7230
|
try {
|
|
@@ -7169,6 +7236,11 @@ var RfqSwapManager = class _RfqSwapManager {
|
|
|
7169
7236
|
} catch {
|
|
7170
7237
|
fate = { fate: "unknown" };
|
|
7171
7238
|
}
|
|
7239
|
+
if ((swap.kind === "lightning_send" || swap.kind === "onchain_send") && fate.fate === "returned" && this.config.now() < swap.refundLocktime && !fate.leafScripts.every(
|
|
7240
|
+
(script) => script === swap.lockup?.script.nonInteractiveRefundScript
|
|
7241
|
+
)) {
|
|
7242
|
+
fate = { fate: "unknown" };
|
|
7243
|
+
}
|
|
7172
7244
|
if (swap.kind === "onchain_receive") return this.driveOnchainReceive(swap, fate);
|
|
7173
7245
|
if (fate.fate === "claimed" || fate.fate === "returned") {
|
|
7174
7246
|
this.stampLockupSpends(swap, fate.spends);
|
|
@@ -7982,6 +8054,7 @@ var createSwapDrive = (config) => {
|
|
|
7982
8054
|
let readyPromise;
|
|
7983
8055
|
const inFlight2 = /* @__PURE__ */ new Set();
|
|
7984
8056
|
let queue = Promise.resolve();
|
|
8057
|
+
let recheck;
|
|
7985
8058
|
const track = (work) => {
|
|
7986
8059
|
inFlight2.add(work);
|
|
7987
8060
|
void work.then(
|
|
@@ -7999,6 +8072,7 @@ var createSwapDrive = (config) => {
|
|
|
7999
8072
|
do {
|
|
8000
8073
|
await queue;
|
|
8001
8074
|
await Promise.allSettled([...inFlight2]);
|
|
8075
|
+
if (!disposed) await recheck;
|
|
8002
8076
|
await watcher?.idle();
|
|
8003
8077
|
} while (inFlight2.size > 0);
|
|
8004
8078
|
};
|
|
@@ -8021,12 +8095,12 @@ var createSwapDrive = (config) => {
|
|
|
8021
8095
|
storage(),
|
|
8022
8096
|
remember,
|
|
8023
8097
|
// Terminal records stay readable but are excluded from the manager's read, sparing
|
|
8024
|
-
// a rebuild per record just to file it `finished
|
|
8025
|
-
// `rfqId` (see `getRfqSwapsPage`).
|
|
8026
|
-
(r) => !undrivable.has(r.id) &&
|
|
8098
|
+
// a rebuild per record just to file it `finished`, except a refunded send restore
|
|
8099
|
+
// re-reads. The index still learns their `rfqId` (see `getRfqSwapsPage`).
|
|
8100
|
+
(r) => !undrivable.has(r.id) && isRfqSwapRestorable(r)
|
|
8027
8101
|
),
|
|
8028
8102
|
storage(),
|
|
8029
|
-
(r) => !undrivableLegacy.has(r.rfqId) &&
|
|
8103
|
+
(r) => !undrivableLegacy.has(r.rfqId) && isRfqSwapRestorable(r)
|
|
8030
8104
|
)
|
|
8031
8105
|
);
|
|
8032
8106
|
const effectiveState = (swap) => {
|
|
@@ -8475,8 +8549,9 @@ var createSwapDrive = (config) => {
|
|
|
8475
8549
|
}
|
|
8476
8550
|
}
|
|
8477
8551
|
const liveCorridor = corridor.filter((record) => !isRfqSwapTerminal(record.state));
|
|
8552
|
+
const recheckable = corridor.filter(isRecheckableRefundedSend);
|
|
8478
8553
|
const store = corridorStore();
|
|
8479
|
-
for (const record of liveCorridor) store.index(record);
|
|
8554
|
+
for (const record of [...liveCorridor, ...recheckable]) store.index(record);
|
|
8480
8555
|
const liveLegacy = await legacyLiveRfqSwaps(repository);
|
|
8481
8556
|
if (liveCorridor.length > 0 || liveLegacy.length > 0) {
|
|
8482
8557
|
try {
|
|
@@ -8523,6 +8598,17 @@ var createSwapDrive = (config) => {
|
|
|
8523
8598
|
}
|
|
8524
8599
|
}
|
|
8525
8600
|
emitAll();
|
|
8601
|
+
if (mode !== "readonly" && recheckable.length > 0) {
|
|
8602
|
+
recheck = (async () => {
|
|
8603
|
+
try {
|
|
8604
|
+
await contractsOf();
|
|
8605
|
+
managerDeps.repository = store;
|
|
8606
|
+
await manager.recheckRefundedSends({ stopped: () => disposed });
|
|
8607
|
+
} catch (error) {
|
|
8608
|
+
console.warn("[swap] the refunded send re-read did not complete", error);
|
|
8609
|
+
}
|
|
8610
|
+
})();
|
|
8611
|
+
}
|
|
8526
8612
|
};
|
|
8527
8613
|
const ready = () => readyPromise ??= restore();
|
|
8528
8614
|
const stop = async () => {
|
|
@@ -8706,14 +8792,22 @@ var publicAssetId = (corridor, assetId, network) => {
|
|
|
8706
8792
|
if (!ARKADE_ASSET_IDENTITY.test(assetId)) return void 0;
|
|
8707
8793
|
return `arkade:${network}/${ARKADE_ASSET_NAMESPACE}:${assetId}`;
|
|
8708
8794
|
};
|
|
8795
|
+
var cardLegAssetId = (card, side, network) => {
|
|
8796
|
+
const corridor = corridorOfRail(marketCorridor(card, side));
|
|
8797
|
+
if (corridor === void 0) return void 0;
|
|
8798
|
+
const canonical = marketAssetId(card, side);
|
|
8799
|
+
if (canonical !== void 0 && isAssetId(canonical)) return canonical;
|
|
8800
|
+
return publicAssetId(
|
|
8801
|
+
corridor,
|
|
8802
|
+
(side === "base" ? card.base_asset : card.quote_asset).id,
|
|
8803
|
+
network
|
|
8804
|
+
);
|
|
8805
|
+
};
|
|
8709
8806
|
var aliasTableFrom = (markets, network) => {
|
|
8710
8807
|
const rows = /* @__PURE__ */ new Map();
|
|
8711
8808
|
const add = (card, side) => {
|
|
8712
8809
|
const info = side === "base" ? card.base_asset : card.quote_asset;
|
|
8713
|
-
const
|
|
8714
|
-
if (corridor === void 0) return;
|
|
8715
|
-
const canonical = marketAssetId(card, side);
|
|
8716
|
-
const id = canonical !== void 0 && isAssetId(canonical) ? canonical : publicAssetId(corridor, info.id, network);
|
|
8810
|
+
const id = cardLegAssetId(card, side, network);
|
|
8717
8811
|
if (id === void 0 || typeof info.ticker !== "string" || info.ticker === "") return;
|
|
8718
8812
|
rows.set(`${id} ${info.ticker.toLowerCase()}`, { id, ticker: info.ticker });
|
|
8719
8813
|
};
|
|
@@ -8801,6 +8895,18 @@ var cardMarketOf = (card, snapshot, key, backend) => ({
|
|
|
8801
8895
|
pair: card.pair ?? marketPairLabel(card),
|
|
8802
8896
|
snapshot
|
|
8803
8897
|
});
|
|
8898
|
+
var marketLegOf = (card, side, network) => {
|
|
8899
|
+
const asset8 = cardLegAssetId(card, side, network);
|
|
8900
|
+
return {
|
|
8901
|
+
...asset8 === void 0 ? {} : { asset: asset8 },
|
|
8902
|
+
decimals: (side === "base" ? card.base_asset : card.quote_asset).decimals,
|
|
8903
|
+
limits: (0, import_solver_discovery10.sideLimits)(card, side)
|
|
8904
|
+
};
|
|
8905
|
+
};
|
|
8906
|
+
var marketOf = (card, snapshot, network) => ({
|
|
8907
|
+
...cardMarketOf(card, snapshot, marketKeyOf(card), marketBackendOf(card)),
|
|
8908
|
+
legs: [marketLegOf(card, "base", network), marketLegOf(card, "quote", network)]
|
|
8909
|
+
});
|
|
8804
8910
|
|
|
8805
8911
|
// src/client/resolve.ts
|
|
8806
8912
|
var SUPPORTED_PAIRS = [
|
|
@@ -10500,10 +10606,10 @@ var createSwapClient = (config) => {
|
|
|
10500
10606
|
},
|
|
10501
10607
|
markets: async () => {
|
|
10502
10608
|
ensureLive("markets");
|
|
10503
|
-
const { discovery } = await resolved();
|
|
10609
|
+
const { base, discovery } = await resolved();
|
|
10504
10610
|
const snapshot = await discovery.load();
|
|
10505
10611
|
return usableMarkets(snapshot, config.policy).map(
|
|
10506
|
-
(card) =>
|
|
10612
|
+
(card) => marketOf(card, snapshot.ref, base.networkName)
|
|
10507
10613
|
);
|
|
10508
10614
|
},
|
|
10509
10615
|
pay: async (destination, options) => {
|
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
|
|
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-B-5ae_gQ.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-C4pvymhs.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-C4pvymhs.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-CkhWMKCo.cjs';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-Diff5Flc.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
|
|
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-CJzneX6F.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-BBVRh9ez.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-BBVRh9ez.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-CIXkJPxV.js';
|
|
7
7
|
import '@arkade-os/solver-discovery';
|
|
8
|
-
import './offer-
|
|
8
|
+
import './offer-BPD2ortO.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-YHESEL4I.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-T4FHBWZI.js";
|
|
77
77
|
import {
|
|
78
78
|
CLAIM_PACKET_TYPE,
|
|
79
79
|
LockupRegistrationFailed,
|
|
@@ -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-BBVRh9ez.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-C4pvymhs.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-C4pvymhs.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-Diff5Flc.cjs';
|
|
6
6
|
import * as nostr_tools from 'nostr-tools';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -498,7 +498,8 @@ declare const isAddressable: (card: DiscoveredMarket) => boolean;
|
|
|
498
498
|
declare const marketBackendOf: (card: DiscoveredMarket) => MarketBackend;
|
|
499
499
|
/**
|
|
500
500
|
* The cards on a snapshot this client may act on at all: the policy's registry allowlist, then
|
|
501
|
-
* addressability. Shared with `markets()
|
|
501
|
+
* addressability. Shared with `markets()`; eligibility is not, so `markets()` can list a card
|
|
502
|
+
* `quote()` refuses.
|
|
502
503
|
*/
|
|
503
504
|
declare const usableMarkets: (snapshot: DiscoverySnapshot, policy?: SwapPolicy) => DiscoveredMarket[];
|
|
504
505
|
/**
|
|
@@ -529,12 +530,34 @@ declare const marketRefOf: (candidate: MarketCandidate, snapshot: SnapshotRef) =
|
|
|
529
530
|
declare const cardMarketOf: (card: DiscoveredMarket, snapshot: SnapshotRef, key: string, backend: MarketBackend) => CardMarketRef;
|
|
530
531
|
/** Narrow a `MarketRef` to the card arm — the only one `quote()` mints. */
|
|
531
532
|
declare const isCardMarket: (market: MarketRef) => market is CardMarketRef;
|
|
533
|
+
/** One side of a {@link Market}. */
|
|
534
|
+
interface MarketLeg {
|
|
535
|
+
/** Absent when the leg has no public id, e.g. an `eip155:` leg. */
|
|
536
|
+
readonly asset?: AssetId;
|
|
537
|
+
/** For `Amount.format`. */
|
|
538
|
+
readonly decimals: number;
|
|
539
|
+
/**
|
|
540
|
+
* The card's announced bounds, in atomic units. Indicative: the solver can still refuse.
|
|
541
|
+
* `null`: the solver will not pay this leg out; a one-way card still routes it as the give leg.
|
|
542
|
+
* Only an amount pinned with `amountOn: "take"` is checked: a give-pinned amount still resolves,
|
|
543
|
+
* and a feed card still quotes it, even if the resulting take is out of range.
|
|
544
|
+
*/
|
|
545
|
+
readonly limits: {
|
|
546
|
+
readonly min: bigint;
|
|
547
|
+
readonly max: bigint;
|
|
548
|
+
} | null;
|
|
549
|
+
}
|
|
532
550
|
/**
|
|
533
|
-
* A market as the v2 client publishes it
|
|
534
|
-
*
|
|
535
|
-
*
|
|
551
|
+
* A market as the v2 client publishes it: the {@link CardMarketRef} a quote would cite, plus its
|
|
552
|
+
* legs. Find a leg by `asset`, not position: they are in card order. The legs stay off
|
|
553
|
+
* `CardMarketRef` because that is written into durable records, which forbid `bigint`.
|
|
536
554
|
*/
|
|
537
|
-
|
|
555
|
+
interface Market extends CardMarketRef {
|
|
556
|
+
readonly legs: readonly [MarketLeg, MarketLeg];
|
|
557
|
+
}
|
|
558
|
+
/** A card as {@link Market}. `network` is the wallet's, as routing uses, so a legacy leg's id
|
|
559
|
+
* matches `resolve()` under a `DiscoveryConfig.network` override. */
|
|
560
|
+
declare const marketOf: (card: DiscoveredMarket, snapshot: SnapshotRef, network: NetworkRef) => Market;
|
|
538
561
|
|
|
539
562
|
/**
|
|
540
563
|
* The three product-facing verbs: `pay`, `receive` and `exchange` each compile a
|
|
@@ -1304,9 +1327,15 @@ interface SwapClient {
|
|
|
1304
1327
|
*/
|
|
1305
1328
|
swaps(filter?: SwapFilter): Promise<Swap[]>;
|
|
1306
1329
|
/**
|
|
1307
|
-
* The markets
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1330
|
+
* The markets on the active snapshot, in the `Quote.market` shape plus each leg's announced
|
|
1331
|
+
* limits, with no RFQ and no disclosure. Shares `quote()`'s registry allowlist and addressability
|
|
1332
|
+
* filter but not its eligibility, so it can list a card `quote()` refuses. Fetches when no
|
|
1333
|
+
* snapshot is in hand, as `quote()` does, since callers reach for it BEFORE quoting.
|
|
1334
|
+
*
|
|
1335
|
+
* `key` is not unique: correlate with `resolve().market` on `key` + `source` + `discoveryPubkey`,
|
|
1336
|
+
* or `solver` on spot cards, which have no `discoveryPubkey`. These fields identify a solver's
|
|
1337
|
+
* market, not one card. A solver may publish several with different limits: `pair` separates a
|
|
1338
|
+
* flipped card, but nothing public separates fee tiers.
|
|
1310
1339
|
*
|
|
1311
1340
|
* @throws {DiscoverySnapshotUnavailable} when the fetch leaves it with
|
|
1312
1341
|
* nothing either.
|
|
@@ -1639,4 +1668,4 @@ interface BuildOfferFillPlanOpts {
|
|
|
1639
1668
|
declare function buildOfferFillPlan(wallet: IWallet, arkServerUrl: string, offerHex: string, opts: BuildOfferFillPlanOpts): Promise<JointGraph>;
|
|
1640
1669
|
declare function verifyOfferFillPlan(plan: JointGraph): boolean;
|
|
1641
1670
|
|
|
1642
|
-
export { type JointGraph as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorOverrides as E, type CorridorPass as F, type CorridorRfqPreparation as G, DEFAULT_MAX_REFUND_WINDOW_SECONDS as H, type DiscoveryConfig as I, type DiscoveryIndexInput as J, DiscoverySnapshotUnavailable as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveMode as N, type OnchainCorridorDeps as O, type DriveRefusal as P, type ExchangeOptions as Q, FEED_TTL_MS as R, type SwapPolicy as S, type FeeCeiling as T, type FeedFetch as U, type FeedQuoteInput as V, type FillSponsor as W, type FillSponsorFare as X, INDEXED_NETWORKS as Y, InconsistentRoute as Z, InsufficientFunds as _, type ArkadeCorridorDeps as a,
|
|
1671
|
+
export { type JointGraph as $, type AssetAliasTable as A, type BuildOfferFillPlanOpts as B, type CorridorFactory as C, type DiscoveryIndex as D, type CorridorOverrides as E, type CorridorPass as F, type CorridorRfqPreparation as G, DEFAULT_MAX_REFUND_WINDOW_SECONDS as H, type DiscoveryConfig as I, type DiscoveryIndexInput as J, DiscoverySnapshotUnavailable as K, type LightningCorridorDeps as L, type MarketCandidate as M, type DriveMode as N, type OnchainCorridorDeps as O, type DriveRefusal as P, type ExchangeOptions as Q, FEED_TTL_MS as R, type SwapPolicy as S, type FeeCeiling as T, type FeedFetch as U, type FeedQuoteInput as V, type FillSponsor as W, type FillSponsorFare as X, INDEXED_NETWORKS as Y, InconsistentRoute as Z, InsufficientFunds as _, type ArkadeCorridorDeps as a, feedSpread as a$, type LockupOwner as a0, type Market as a1, type MarketLeg as a2, MaxFeeExceeded as a3, MissingCorridorDep as a4, NotCancellable as a5, OFFER_FILL_OWNERS as a6, OFFER_FILL_TEMPLATE as a7, ONCHAIN_CLAIM_FEE_RATE_SATVB as a8, type ObservationSeam as a9, type SwapDrive as aA, type SwapDriveConfig as aB, SwapDriveRefusedError as aC, type SwapError as aD, type SwapErrorName as aE, type SwapFilter as aF, UnsupportedRoute as aG, type VerbDeps as aH, acceptQuote as aI, attesting as aJ, buildOfferFillPlan as aK, cancelSwap as aL, canonicalAssetId as aM, cardMarketOf as aN, chooseMarket as aO, conflictingFields as aP, corridorSet as aQ, createNostrTransportFactory as aR, createSwapClient as aS, createSwapDrive as aT, deepFreeze as aU, digestJointGraph as aV, discoveryIndex as aW, eligibleMarkets as aX, enforceFeeCeiling as aY, exchange as aZ, feedFetch as a_, type OfferPreparation as aa, type OnchainClaim as ab, type OnchainRefund as ac, OperatorUnreachable as ad, type ParsedRfqQuote as ae, type PayOptions as af, type PayResult as ag, type QuoteCheck as ah, QuoteExpired as ai, type QuotePreparation as aj, QuoteVerificationFailed as ak, REGISTRY_URL as al, type ReceiveArtifact as am, type ReceiveOptions as an, type ReceiveRequest as ao, type RecoveryResult as ap, type RegisteredAsset as aq, type RfqAuctionPolicy as ar, type RfqPreparation as as, type RfqQuoteInput as at, type RfqRendezvous as au, type RfqTransportFactory as av, type RouteSide as aw, SWAP_ERROR_NAMES as ax, type SwapClient as ay, type SwapClientConfig as az, type CorridorSet as b, isAddressable as b0, isCardMarket as b1, isIndexedNetwork as b2, isSwapError as b3, isUsableCard as b4, liveArkadeInfo as b5, marketBackendOf as b6, marketKeyOf as b7, marketOf as b8, marketRefOf as b9, nostrTransportFactory as ba, parseRfqQuote as bb, pay as bc, quoteFromFeed as bd, quoteViaRfq as be, readableRecord as bf, receive as bg, resolveCorridorBase as bh, resolveCorridorDeps as bi, rfqLeg as bj, rfqPairFor as bk, swapRecordOf as bl, toDiscoveryLeg as bm, unsignedPsbtBytes as bn, usableMarkets as bo, verifyJointGraph as bp, verifyOfferFillPlan as bq, verifyPlanLegs as br, withCanonicalAmount as bs, type DiscoveryLeg as c, type DiscoverySnapshot as d, AcceptConflict as e, type AcceptInput as f, type AcceptOptions as g, AmbiguousDestination as h, AmountEncodingUnsupported as i, AmountMismatch as j, type AssetRfqPreparation as k, type AttestingRfqTransport as l, CORRIDOR_FACTORIES as m, type CancelInput as n, type CancelOutcome as o, type ClaimedDestination as p, ClientDisposed as q, type CorridorBase as r, type CorridorClaim as s, type CorridorCovenant as t, type CorridorDeadline as u, type CorridorDeps as v, type CorridorDepsByCorridor as w, type CorridorDrive as x, type CorridorLockup as y, type CorridorModule as z };
|