@arkade-os/swap 0.0.24 → 0.0.25

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.
@@ -825,7 +825,7 @@ function onchainHtlcScript(params, network) {
825
825
  "CHECKSIG"
826
826
  ]);
827
827
  const payment = btc.p2tr(
828
- btc.TAPROOT_UNSPENDABLE_KEY,
828
+ btc.taprootNumsKey(),
829
829
  btc.taprootListToTree([{ script: claim }, { script: refund }]),
830
830
  L1_NETWORKS[network],
831
831
  true
package/dist/index.cjs CHANGED
@@ -1842,7 +1842,7 @@ function onchainHtlcScript(params, network) {
1842
1842
  "CHECKSIG"
1843
1843
  ]);
1844
1844
  const payment = btc.p2tr(
1845
- btc.TAPROOT_UNSPENDABLE_KEY,
1845
+ btc.taprootNumsKey(),
1846
1846
  btc.taprootListToTree([{ script: claim }, { script: refund }]),
1847
1847
  L1_NETWORKS[network],
1848
1848
  true
@@ -3882,6 +3882,7 @@ var factsOf = (raw, decode, now) => {
3882
3882
  if (facts.expiresAt <= now) return void 0;
3883
3883
  return facts;
3884
3884
  };
3885
+ var contradicts = (req, facts) => req.amount !== void 0 && req.amount !== facts.amountSats && req.amount !== import_sdk13.BIP21.amountSats(req.raw);
3885
3886
  var solverLightningRendezvous = (markets, amountSats, fallbackEmulatorPubkey) => solverRendezvous(markets, "lightning", amountSats, fallbackEmulatorPubkey);
3886
3887
  function solverLightningRail(deps) {
3887
3888
  const rendezvousFor = async (amountSats) => solverLightningRendezvous(await deps.discover(), amountSats, deps.fallbackEmulatorPubkey);
@@ -3892,7 +3893,7 @@ function solverLightningRail(deps) {
3892
3893
  if ((0, import_sdk13.assetsOf)(req).length > 0) return false;
3893
3894
  const facts = factsOf(req.raw, deps.decodeInvoice, Math.floor(Date.now() / 1e3));
3894
3895
  if (!facts) return false;
3895
- if (req.amount !== void 0 && req.amount !== facts.amountSats) return false;
3896
+ if (contradicts(req, facts)) return false;
3896
3897
  return await rendezvousFor(facts.amountSats) !== void 0;
3897
3898
  },
3898
3899
  quote: async (req, ctx) => {
@@ -3903,7 +3904,7 @@ function solverLightningRail(deps) {
3903
3904
  `${SOLVER_LIGHTNING_RAIL}: the request carries no payable BOLT11 invoice (amountless, expired, or undecodable)`
3904
3905
  );
3905
3906
  }
3906
- if (req.amount !== void 0 && req.amount !== facts.amountSats) {
3907
+ if (contradicts(req, facts)) {
3907
3908
  throw new Error(
3908
3909
  `${SOLVER_LIGHTNING_RAIL}: the request names ${req.amount} sats but the invoice is for ${facts.amountSats} \u2014 the payee is paid the invoice`
3909
3910
  );
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ import {
100
100
  verifyLockupAddress,
101
101
  verifyOfferAddress,
102
102
  verifyReceiveInvoice
103
- } from "./chunk-QJKMTPRQ.js";
103
+ } from "./chunk-ZML76DV3.js";
104
104
  import {
105
105
  InMemoryAssetSwapRepository,
106
106
  RFQ_SWAP_MAX_PAGE_SIZE,
@@ -1407,7 +1407,7 @@ function solverOnchainRail(deps) {
1407
1407
  }
1408
1408
 
1409
1409
  // src/payment/solverLightning.ts
1410
- import { assertNoAssets as assertNoAssets2, assetsOf as assetsOf2, invoiceTarget, makeHandle as makeHandle2 } from "@arkade-os/sdk";
1410
+ import { assertNoAssets as assertNoAssets2, assetsOf as assetsOf2, BIP21, invoiceTarget, makeHandle as makeHandle2 } from "@arkade-os/sdk";
1411
1411
  var SOLVER_LIGHTNING_RAIL = "solver-lightning";
1412
1412
  var factsOf = (raw, decode, now) => {
1413
1413
  const invoice = invoiceTarget(raw);
@@ -1422,6 +1422,7 @@ var factsOf = (raw, decode, now) => {
1422
1422
  if (facts.expiresAt <= now) return void 0;
1423
1423
  return facts;
1424
1424
  };
1425
+ var contradicts = (req, facts) => req.amount !== void 0 && req.amount !== facts.amountSats && req.amount !== BIP21.amountSats(req.raw);
1425
1426
  var solverLightningRendezvous = (markets, amountSats, fallbackEmulatorPubkey) => solverRendezvous(markets, "lightning", amountSats, fallbackEmulatorPubkey);
1426
1427
  function solverLightningRail(deps) {
1427
1428
  const rendezvousFor = async (amountSats) => solverLightningRendezvous(await deps.discover(), amountSats, deps.fallbackEmulatorPubkey);
@@ -1432,7 +1433,7 @@ function solverLightningRail(deps) {
1432
1433
  if (assetsOf2(req).length > 0) return false;
1433
1434
  const facts = factsOf(req.raw, deps.decodeInvoice, Math.floor(Date.now() / 1e3));
1434
1435
  if (!facts) return false;
1435
- if (req.amount !== void 0 && req.amount !== facts.amountSats) return false;
1436
+ if (contradicts(req, facts)) return false;
1436
1437
  return await rendezvousFor(facts.amountSats) !== void 0;
1437
1438
  },
1438
1439
  quote: async (req, ctx) => {
@@ -1443,7 +1444,7 @@ function solverLightningRail(deps) {
1443
1444
  `${SOLVER_LIGHTNING_RAIL}: the request carries no payable BOLT11 invoice (amountless, expired, or undecodable)`
1444
1445
  );
1445
1446
  }
1446
- if (req.amount !== void 0 && req.amount !== facts.amountSats) {
1447
+ if (contradicts(req, facts)) {
1447
1448
  throw new Error(
1448
1449
  `${SOLVER_LIGHTNING_RAIL}: the request names ${req.amount} sats but the invoice is for ${facts.amountSats} \u2014 the payee is paid the invoice`
1449
1450
  );
package/dist/nostr.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  expectQuote,
3
3
  pairOf
4
- } from "./chunk-QJKMTPRQ.js";
4
+ } from "./chunk-ZML76DV3.js";
5
5
 
6
6
  // src/nostr.ts
7
7
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/swap",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
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": {
@@ -66,11 +66,11 @@
66
66
  "dependencies": {
67
67
  "@arkade-os/solver-discovery": "0.2.7",
68
68
  "@noble/ciphers": "2.1.1",
69
- "@noble/curves": "2.0.1",
70
- "@noble/hashes": "2.0.1",
71
- "@scure/base": "2.0.0",
72
- "@scure/btc-signer": "2.0.1",
73
- "@arkade-os/sdk": "0.4.78"
69
+ "@noble/curves": "2.4.0",
70
+ "@noble/hashes": "2.4.0",
71
+ "@scure/base": "2.4.0",
72
+ "@scure/btc-signer": "2.4.1",
73
+ "@arkade-os/sdk": "0.4.79"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "nostr-tools": "^2.12.0"