@arkade-os/swap 0.0.13 → 0.0.14
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/index.cjs +5 -3
- package/dist/index.js +6 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1835,7 +1835,7 @@ async function watchOfferSwaps({
|
|
|
1835
1835
|
}
|
|
1836
1836
|
};
|
|
1837
1837
|
const unsubscribe = manager.onContractEvent((event) => {
|
|
1838
|
-
if (event.type !== "vtxo_spent") return;
|
|
1838
|
+
if (!(0, import_sdk7.isContractVtxoEvent)(event) || event.type !== "vtxo_spent") return;
|
|
1839
1839
|
enqueue(() => handleSpend(event));
|
|
1840
1840
|
});
|
|
1841
1841
|
return {
|
|
@@ -3811,6 +3811,7 @@ function arkadeRefunder(deps) {
|
|
|
3811
3811
|
|
|
3812
3812
|
// src/swapManager.ts
|
|
3813
3813
|
var import_base16 = require("@scure/base");
|
|
3814
|
+
var import_sdk18 = require("@arkade-os/sdk");
|
|
3814
3815
|
function nextOnchainAction(input) {
|
|
3815
3816
|
switch (input.phase.phase) {
|
|
3816
3817
|
case "unfunded":
|
|
@@ -4300,6 +4301,7 @@ var RfqSwapManager = class {
|
|
|
4300
4301
|
});
|
|
4301
4302
|
return;
|
|
4302
4303
|
}
|
|
4304
|
+
if (!(0, import_sdk18.isContractVtxoEvent)(event)) return;
|
|
4303
4305
|
const swap = this.byLockupScript.get(event.contractScript);
|
|
4304
4306
|
if (!swap) return;
|
|
4305
4307
|
void this.pollSwap(swap).catch(() => {
|
|
@@ -4846,7 +4848,7 @@ var errorMessage = (error) => error instanceof Error ? error.message : String(er
|
|
|
4846
4848
|
var outpointKey = (vtxo) => `${vtxo.txid}:${vtxo.vout}`;
|
|
4847
4849
|
|
|
4848
4850
|
// src/activity.ts
|
|
4849
|
-
var
|
|
4851
|
+
var import_sdk19 = require("@arkade-os/sdk");
|
|
4850
4852
|
var import_base17 = require("@scure/base");
|
|
4851
4853
|
var LABELS = {
|
|
4852
4854
|
lightning_send: "Lightning send",
|
|
@@ -4922,7 +4924,7 @@ async function activityInputOf(record, indexer) {
|
|
|
4922
4924
|
async function lockupTxids(indexer, record, wantFunding) {
|
|
4923
4925
|
let script;
|
|
4924
4926
|
try {
|
|
4925
|
-
script = import_base17.hex.encode(
|
|
4927
|
+
script = import_base17.hex.encode(import_sdk19.ArkAddress.decode(record.lockupAddress).pkScript);
|
|
4926
4928
|
} catch {
|
|
4927
4929
|
return [];
|
|
4928
4930
|
}
|
package/dist/index.js
CHANGED
|
@@ -1417,6 +1417,7 @@ async function restoreAssetSwaps(indexer, txs, existingIds, opts) {
|
|
|
1417
1417
|
import { base64 as base642, hex as hex6 } from "@scure/base";
|
|
1418
1418
|
import {
|
|
1419
1419
|
ArkAddress as ArkAddress3,
|
|
1420
|
+
isContractVtxoEvent,
|
|
1420
1421
|
RestIndexerProvider as RestIndexerProvider3,
|
|
1421
1422
|
Transaction as Transaction2
|
|
1422
1423
|
} from "@arkade-os/sdk";
|
|
@@ -1487,7 +1488,7 @@ async function watchOfferSwaps({
|
|
|
1487
1488
|
}
|
|
1488
1489
|
};
|
|
1489
1490
|
const unsubscribe = manager.onContractEvent((event) => {
|
|
1490
|
-
if (event.type !== "vtxo_spent") return;
|
|
1491
|
+
if (!isContractVtxoEvent(event) || event.type !== "vtxo_spent") return;
|
|
1491
1492
|
enqueue(() => handleSpend(event));
|
|
1492
1493
|
});
|
|
1493
1494
|
return {
|
|
@@ -2460,6 +2461,9 @@ function arkadeRefunder(deps) {
|
|
|
2460
2461
|
|
|
2461
2462
|
// src/swapManager.ts
|
|
2462
2463
|
import { hex as hex12 } from "@scure/base";
|
|
2464
|
+
import {
|
|
2465
|
+
isContractVtxoEvent as isContractVtxoEvent2
|
|
2466
|
+
} from "@arkade-os/sdk";
|
|
2463
2467
|
function nextOnchainAction(input) {
|
|
2464
2468
|
switch (input.phase.phase) {
|
|
2465
2469
|
case "unfunded":
|
|
@@ -2949,6 +2953,7 @@ var RfqSwapManager = class {
|
|
|
2949
2953
|
});
|
|
2950
2954
|
return;
|
|
2951
2955
|
}
|
|
2956
|
+
if (!isContractVtxoEvent2(event)) return;
|
|
2952
2957
|
const swap = this.byLockupScript.get(event.contractScript);
|
|
2953
2958
|
if (!swap) return;
|
|
2954
2959
|
void this.pollSwap(swap).catch(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkade-os/swap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Client-side Arkade Intents asset swaps: discover markets, quote, create/track/cancel offers, restore from chain.",
|
|
6
6
|
"repository": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@noble/hashes": "2.0.1",
|
|
71
71
|
"@scure/base": "2.0.0",
|
|
72
72
|
"@scure/btc-signer": "2.0.1",
|
|
73
|
-
"@arkade-os/sdk": "0.4.
|
|
73
|
+
"@arkade-os/sdk": "0.4.71"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"nostr-tools": "^2.12.0"
|