@arkade-os/boltz-swap 0.3.44 → 0.3.45

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.
@@ -1,5 +1,5 @@
1
1
  import { IWallet, ArkProvider, IndexerProvider, ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
2
- import { r as BoltzSwapProvider, y as SwapManager, m as SwapRepository, q as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, j as ArkToBtcResponse, a as BoltzChainSwap, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, F as FeesResponse, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-8NrCdOpS.cjs';
2
+ import { r as BoltzSwapProvider, y as SwapManager, m as SwapRepository, q as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, j as ArkToBtcResponse, a as BoltzChainSwap, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, F as FeesResponse, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-CS62-oEy.cjs';
3
3
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { IWallet, ArkProvider, IndexerProvider, ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
2
- import { r as BoltzSwapProvider, y as SwapManager, m as SwapRepository, q as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, j as ArkToBtcResponse, a as BoltzChainSwap, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, F as FeesResponse, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-8NrCdOpS.js';
2
+ import { r as BoltzSwapProvider, y as SwapManager, m as SwapRepository, q as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, j as ArkToBtcResponse, a as BoltzChainSwap, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, F as FeesResponse, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-CS62-oEy.js';
3
3
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
4
4
 
5
5
  /**
@@ -571,20 +571,26 @@ var BoltzSwapProvider = class {
571
571
  invoiceAmount,
572
572
  claimPublicKey,
573
573
  preimageHash,
574
- description
574
+ description,
575
+ descriptionHash
575
576
  }) {
576
577
  if (claimPublicKey.length != 66) {
577
578
  throw new SwapError({
578
579
  message: "claimPublicKey must be a compressed public key"
579
580
  });
580
581
  }
582
+ if (descriptionHash !== void 0 && !/^[0-9a-fA-F]{64}$/.test(descriptionHash)) {
583
+ throw new SwapError({
584
+ message: "descriptionHash must be a 32-byte SHA256 (64 hex chars)"
585
+ });
586
+ }
581
587
  const requestBody = {
582
588
  from: "BTC",
583
589
  to: "ARK",
584
590
  invoiceAmount,
585
591
  claimPublicKey,
586
592
  preimageHash,
587
- description: description?.trim() || "Send to Arkade address",
593
+ ...descriptionHash ? { descriptionHash } : { description: description?.trim() || "Send to Arkade address" },
588
594
  ...this.referralId ? { referralId: this.referralId } : {}
589
595
  };
590
596
  const response = await this.request(
@@ -997,6 +1003,12 @@ var decodeInvoice = (invoice) => {
997
1003
  expiry: decoded.expiry ?? 3600,
998
1004
  amountSats: Number(millisats / 1000n),
999
1005
  description: decoded.sections.find((s) => s.name === "description")?.value ?? "",
1006
+ // description_hash (BOLT11 `h`) is missing from light-bolt11-decoder's
1007
+ // Section union even though the decoder emits it. Widen just this lookup
1008
+ // rather than patch the library's types (separate repo, out of scope).
1009
+ descriptionHash: decoded.sections.find(
1010
+ (s) => s.name === "description_hash"
1011
+ )?.value ?? "",
1000
1012
  paymentHash: decoded.sections.find((s) => s.name === "payment_hash")?.value ?? ""
1001
1013
  };
1002
1014
  };
@@ -3440,7 +3452,7 @@ var ArkadeSwaps = class _ArkadeSwaps {
3440
3452
  invoiceAmount: args.amount,
3441
3453
  claimPublicKey,
3442
3454
  preimageHash,
3443
- ...args.description?.trim() ? { description: args.description.trim() } : {}
3455
+ ...args.descriptionHash !== void 0 ? { descriptionHash: args.descriptionHash } : args.description?.trim() ? { description: args.description.trim() } : {}
3444
3456
  };
3445
3457
  const swapResponse = await this.swapProvider.createReverseSwap(swapRequest);
3446
3458
  const decodedInvoice = decodeInvoice(swapResponse.invoice);
@@ -7,7 +7,7 @@ import {
7
7
  isSubmarineFinalStatus,
8
8
  isSubmarineSwapRefundable,
9
9
  logger
10
- } from "./chunk-QVXFEX5F.js";
10
+ } from "./chunk-5GBBRBFS.js";
11
11
 
12
12
  // src/expo/swapsPollProcessor.ts
13
13
  var SWAP_POLL_TASK_TYPE = "swap-poll";
@@ -544,20 +544,26 @@ var BoltzSwapProvider = class {
544
544
  invoiceAmount,
545
545
  claimPublicKey,
546
546
  preimageHash,
547
- description
547
+ description,
548
+ descriptionHash
548
549
  }) {
549
550
  if (claimPublicKey.length != 66) {
550
551
  throw new SwapError({
551
552
  message: "claimPublicKey must be a compressed public key"
552
553
  });
553
554
  }
555
+ if (descriptionHash !== void 0 && !/^[0-9a-fA-F]{64}$/.test(descriptionHash)) {
556
+ throw new SwapError({
557
+ message: "descriptionHash must be a 32-byte SHA256 (64 hex chars)"
558
+ });
559
+ }
554
560
  const requestBody = {
555
561
  from: "BTC",
556
562
  to: "ARK",
557
563
  invoiceAmount,
558
564
  claimPublicKey,
559
565
  preimageHash,
560
- description: description?.trim() || "Send to Arkade address",
566
+ ...descriptionHash ? { descriptionHash } : { description: description?.trim() || "Send to Arkade address" },
561
567
  ...this.referralId ? { referralId: this.referralId } : {}
562
568
  };
563
569
  const response = await this.request(
@@ -1312,6 +1318,12 @@ var decodeInvoice = (invoice) => {
1312
1318
  expiry: decoded.expiry ?? 3600,
1313
1319
  amountSats: Number(millisats / 1000n),
1314
1320
  description: decoded.sections.find((s) => s.name === "description")?.value ?? "",
1321
+ // description_hash (BOLT11 `h`) is missing from light-bolt11-decoder's
1322
+ // Section union even though the decoder emits it. Widen just this lookup
1323
+ // rather than patch the library's types (separate repo, out of scope).
1324
+ descriptionHash: decoded.sections.find(
1325
+ (s) => s.name === "description_hash"
1326
+ )?.value ?? "",
1315
1327
  paymentHash: decoded.sections.find((s) => s.name === "payment_hash")?.value ?? ""
1316
1328
  };
1317
1329
  };
@@ -3383,7 +3395,7 @@ var ArkadeSwaps = class _ArkadeSwaps {
3383
3395
  invoiceAmount: args.amount,
3384
3396
  claimPublicKey,
3385
3397
  preimageHash,
3386
- ...args.description?.trim() ? { description: args.description.trim() } : {}
3398
+ ...args.descriptionHash !== void 0 ? { descriptionHash: args.descriptionHash } : args.description?.trim() ? { description: args.description.trim() } : {}
3387
3399
  };
3388
3400
  const swapResponse = await this.swapProvider.createReverseSwap(swapRequest);
3389
3401
  const decodedInvoice = decodeInvoice(swapResponse.invoice);
@@ -1,8 +1,8 @@
1
- import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-CGMXUKPe.cjs';
2
- export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-CGMXUKPe.cjs';
1
+ import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-B98F6MQF.cjs';
2
+ export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-B98F6MQF.cjs';
3
3
  import '@arkade-os/sdk/worker/expo';
4
4
  import '@arkade-os/sdk';
5
- import '../types-8NrCdOpS.cjs';
5
+ import '../types-CS62-oEy.cjs';
6
6
 
7
7
  /**
8
8
  * Define the Expo background task handler for swap polling.
@@ -1,8 +1,8 @@
1
- import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-CuDM6sxV.js';
2
- export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-CuDM6sxV.js';
1
+ import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-Ov-wp17v.js';
2
+ export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-Ov-wp17v.js';
3
3
  import '@arkade-os/sdk/worker/expo';
4
4
  import '@arkade-os/sdk';
5
- import '../types-8NrCdOpS.js';
5
+ import '../types-CS62-oEy.js';
6
6
 
7
7
  /**
8
8
  * Define the Expo background task handler for swap polling.
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SWAP_POLL_TASK_TYPE,
3
3
  swapsPollProcessor
4
- } from "../chunk-PHF6C2NE.js";
4
+ } from "../chunk-WPAI2ECT.js";
5
5
  import {
6
6
  BoltzSwapProvider
7
- } from "../chunk-QVXFEX5F.js";
7
+ } from "../chunk-5GBBRBFS.js";
8
8
  import "../chunk-SJQJQO7P.js";
9
9
 
10
10
  // src/expo/background.ts
@@ -535,20 +535,26 @@ var BoltzSwapProvider = class {
535
535
  invoiceAmount,
536
536
  claimPublicKey,
537
537
  preimageHash,
538
- description
538
+ description,
539
+ descriptionHash
539
540
  }) {
540
541
  if (claimPublicKey.length != 66) {
541
542
  throw new SwapError({
542
543
  message: "claimPublicKey must be a compressed public key"
543
544
  });
544
545
  }
546
+ if (descriptionHash !== void 0 && !/^[0-9a-fA-F]{64}$/.test(descriptionHash)) {
547
+ throw new SwapError({
548
+ message: "descriptionHash must be a 32-byte SHA256 (64 hex chars)"
549
+ });
550
+ }
545
551
  const requestBody = {
546
552
  from: "BTC",
547
553
  to: "ARK",
548
554
  invoiceAmount,
549
555
  claimPublicKey,
550
556
  preimageHash,
551
- description: description?.trim() || "Send to Arkade address",
557
+ ...descriptionHash ? { descriptionHash } : { description: description?.trim() || "Send to Arkade address" },
552
558
  ...this.referralId ? { referralId: this.referralId } : {}
553
559
  };
554
560
  const response = await this.request(
@@ -1302,6 +1308,12 @@ var decodeInvoice = (invoice) => {
1302
1308
  expiry: decoded.expiry ?? 3600,
1303
1309
  amountSats: Number(millisats / 1000n),
1304
1310
  description: decoded.sections.find((s) => s.name === "description")?.value ?? "",
1311
+ // description_hash (BOLT11 `h`) is missing from light-bolt11-decoder's
1312
+ // Section union even though the decoder emits it. Widen just this lookup
1313
+ // rather than patch the library's types (separate repo, out of scope).
1314
+ descriptionHash: decoded.sections.find(
1315
+ (s) => s.name === "description_hash"
1316
+ )?.value ?? "",
1305
1317
  paymentHash: decoded.sections.find((s) => s.name === "payment_hash")?.value ?? ""
1306
1318
  };
1307
1319
  };
@@ -3373,7 +3385,7 @@ var ArkadeSwaps = class _ArkadeSwaps {
3373
3385
  invoiceAmount: args.amount,
3374
3386
  claimPublicKey,
3375
3387
  preimageHash,
3376
- ...args.description?.trim() ? { description: args.description.trim() } : {}
3388
+ ...args.descriptionHash !== void 0 ? { descriptionHash: args.descriptionHash } : args.description?.trim() ? { description: args.description.trim() } : {}
3377
3389
  };
3378
3390
  const swapResponse = await this.swapProvider.createReverseSwap(swapRequest);
3379
3391
  const decodedInvoice = decodeInvoice(swapResponse.invoice);
@@ -1,7 +1,7 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-DwgfLCMY.cjs';
2
- import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, j as ArkToBtcResponse, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-8NrCdOpS.cjs';
3
- import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-CGMXUKPe.cjs';
4
- export { D as DefineSwapBackgroundTaskOptions, b as ExpoArkadeLightningConfig, c as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-CGMXUKPe.cjs';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-C8CmzknM.cjs';
2
+ import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, j as ArkToBtcResponse, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CS62-oEy.cjs';
3
+ import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-B98F6MQF.cjs';
4
+ export { D as DefineSwapBackgroundTaskOptions, b as ExpoArkadeLightningConfig, c as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-B98F6MQF.cjs';
5
5
  import { ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
6
6
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
7
7
  import '@arkade-os/sdk/worker/expo';
@@ -1,7 +1,7 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-2q3VSgb4.js';
2
- import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, j as ArkToBtcResponse, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-8NrCdOpS.js';
3
- import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-CuDM6sxV.js';
4
- export { D as DefineSwapBackgroundTaskOptions, b as ExpoArkadeLightningConfig, c as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-CuDM6sxV.js';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-gXHRbR09.js';
2
+ import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, o as SendLightningPaymentResponse, O as OptimisticSendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, j as ArkToBtcResponse, l as ChainArkRefundOutcome, k as BtcToArkResponse, d as Chain, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CS62-oEy.js';
3
+ import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-Ov-wp17v.js';
4
+ export { D as DefineSwapBackgroundTaskOptions, b as ExpoArkadeLightningConfig, c as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-Ov-wp17v.js';
5
5
  import { ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
6
6
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
7
7
  import '@arkade-os/sdk/worker/expo';
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SWAP_POLL_TASK_TYPE
3
- } from "../chunk-PHF6C2NE.js";
3
+ } from "../chunk-WPAI2ECT.js";
4
4
  import {
5
5
  ArkadeSwaps
6
- } from "../chunk-QVXFEX5F.js";
6
+ } from "../chunk-5GBBRBFS.js";
7
7
  import "../chunk-SJQJQO7P.js";
8
8
 
9
9
  // src/expo/arkade-lightning.ts
package/dist/index.cjs CHANGED
@@ -95,7 +95,7 @@ __export(index_exports, {
95
95
  module.exports = __toCommonJS(index_exports);
96
96
 
97
97
  // package.json
98
- var version = "0.3.44";
98
+ var version = "0.3.45";
99
99
 
100
100
  // src/errors.ts
101
101
  var SwapError = class extends Error {
@@ -667,20 +667,26 @@ var BoltzSwapProvider = class {
667
667
  invoiceAmount,
668
668
  claimPublicKey,
669
669
  preimageHash,
670
- description
670
+ description,
671
+ descriptionHash
671
672
  }) {
672
673
  if (claimPublicKey.length != 66) {
673
674
  throw new SwapError({
674
675
  message: "claimPublicKey must be a compressed public key"
675
676
  });
676
677
  }
678
+ if (descriptionHash !== void 0 && !/^[0-9a-fA-F]{64}$/.test(descriptionHash)) {
679
+ throw new SwapError({
680
+ message: "descriptionHash must be a 32-byte SHA256 (64 hex chars)"
681
+ });
682
+ }
677
683
  const requestBody = {
678
684
  from: "BTC",
679
685
  to: "ARK",
680
686
  invoiceAmount,
681
687
  claimPublicKey,
682
688
  preimageHash,
683
- description: description?.trim() || "Send to Arkade address",
689
+ ...descriptionHash ? { descriptionHash } : { description: description?.trim() || "Send to Arkade address" },
684
690
  ...this.referralId ? { referralId: this.referralId } : {}
685
691
  };
686
692
  const response = await this.request(
@@ -1434,6 +1440,12 @@ var decodeInvoice = (invoice) => {
1434
1440
  expiry: decoded.expiry ?? 3600,
1435
1441
  amountSats: Number(millisats / 1000n),
1436
1442
  description: decoded.sections.find((s) => s.name === "description")?.value ?? "",
1443
+ // description_hash (BOLT11 `h`) is missing from light-bolt11-decoder's
1444
+ // Section union even though the decoder emits it. Widen just this lookup
1445
+ // rather than patch the library's types (separate repo, out of scope).
1446
+ descriptionHash: decoded.sections.find(
1447
+ (s) => s.name === "description_hash"
1448
+ )?.value ?? "",
1437
1449
  paymentHash: decoded.sections.find((s) => s.name === "payment_hash")?.value ?? ""
1438
1450
  };
1439
1451
  };
@@ -3526,7 +3538,7 @@ var ArkadeSwaps = class _ArkadeSwaps {
3526
3538
  invoiceAmount: args.amount,
3527
3539
  claimPublicKey,
3528
3540
  preimageHash,
3529
- ...args.description?.trim() ? { description: args.description.trim() } : {}
3541
+ ...args.descriptionHash !== void 0 ? { descriptionHash: args.descriptionHash } : args.description?.trim() ? { description: args.description.trim() } : {}
3530
3542
  };
3531
3543
  const swapResponse = await this.swapProvider.createReverseSwap(swapRequest);
3532
3544
  const decodedInvoice = decodeInvoice(swapResponse.invoice);
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-DwgfLCMY.cjs';
2
- export { A as ArkadeSwaps } from './arkade-swaps-DwgfLCMY.cjs';
3
- import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-8NrCdOpS.cjs';
4
- export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-8NrCdOpS.cjs';
1
+ import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-C8CmzknM.cjs';
2
+ export { A as ArkadeSwaps } from './arkade-swaps-C8CmzknM.cjs';
3
+ import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-CS62-oEy.cjs';
4
+ export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-CS62-oEy.cjs';
5
5
  import { Transaction } from '@scure/btc-signer';
6
6
  import { MessageHandler, RequestEnvelope, ArkInfo, ResponseEnvelope, IWallet, IReadonlyWallet, VHTLC, Identity, ArkTxInput } from '@arkade-os/sdk';
7
7
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-2q3VSgb4.js';
2
- export { A as ArkadeSwaps } from './arkade-swaps-2q3VSgb4.js';
3
- import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-8NrCdOpS.js';
4
- export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-8NrCdOpS.js';
1
+ import { Q as QuoteSwapOptions, I as IArkadeSwaps, V as VhtlcTimeouts } from './arkade-swaps-gXHRbR09.js';
2
+ export { A as ArkadeSwaps } from './arkade-swaps-gXHRbR09.js';
3
+ import { B as BoltzSwap, D as DecodedInvoice, a as BoltzChainSwap, b as BoltzReverseSwap, c as BoltzSubmarineSwap, A as ArkadeSwapsConfig, N as Network, C as CreateLightningInvoiceRequest, S as SendLightningPaymentRequest, F as FeesResponse, d as Chain, e as CreateLightningInvoiceResponse, O as OptimisticSendLightningPaymentResponse, f as SubmarineRefundOutcome, g as SubmarineRecoveryInfo, h as SubmarineRecoveryResult, i as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, j as ArkToBtcResponse, k as BtcToArkResponse, l as ChainArkRefundOutcome, m as SwapRepository, n as SwapManagerClient, o as SendLightningPaymentResponse, p as GetSwapsFilter } from './types-CS62-oEy.js';
4
+ export { q as ArkadeSwapsCreateConfig, r as BoltzSwapProvider, s as BoltzSwapStatus, I as IncomingPaymentSubscription, P as PendingChainSwap, t as PendingReverseSwap, u as PendingSubmarineSwap, v as PendingSwap, w as SubmarineProgressionStatus, x as SubmarineRecoveryStatus, y as SwapManager, z as SwapManagerCallbacks, E as SwapManagerConfig, H as SwapManagerEvents, V as Vtxo, J as hasSubmarineStatusReached, K as isChainClaimableStatus, M as isChainFailedStatus, Q as isChainFinalStatus, R as isChainPendingStatus, T as isChainRefundableStatus, U as isChainSignableStatus, W as isChainSuccessStatus, X as isChainSwapClaimable, Y as isChainSwapRefundable, Z as isPendingChainSwap, _ as isPendingReverseSwap, $ as isPendingSubmarineSwap, a0 as isReverseClaimableStatus, a1 as isReverseFailedStatus, a2 as isReverseFinalStatus, a3 as isReversePendingStatus, a4 as isReverseSuccessStatus, a5 as isReverseSwapClaimable, a6 as isSubmarineFailedStatus, a7 as isSubmarineFinalStatus, a8 as isSubmarinePendingStatus, a9 as isSubmarineRefundableStatus, aa as isSubmarineSuccessStatus, ab as isSubmarineSwapRefundable } from './types-CS62-oEy.js';
5
5
  import { Transaction } from '@scure/btc-signer';
6
6
  import { MessageHandler, RequestEnvelope, ArkInfo, ResponseEnvelope, IWallet, IReadonlyWallet, VHTLC, Identity, ArkTxInput } from '@arkade-os/sdk';
7
7
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
package/dist/index.js CHANGED
@@ -53,14 +53,14 @@ import {
53
53
  updateReverseSwapStatus,
54
54
  updateSubmarineSwapStatus,
55
55
  verifySignatures
56
- } from "./chunk-QVXFEX5F.js";
56
+ } from "./chunk-5GBBRBFS.js";
57
57
  import {
58
58
  applyCreatedAtOrder,
59
59
  applySwapsFilter
60
60
  } from "./chunk-SJQJQO7P.js";
61
61
 
62
62
  // package.json
63
- var version = "0.3.44";
63
+ var version = "0.3.45";
64
64
 
65
65
  // src/serviceWorker/arkade-swaps-message-handler.ts
66
66
  import { RestArkProvider, RestIndexerProvider } from "@arkade-os/sdk";
@@ -1,5 +1,5 @@
1
1
  import { RealmLike } from '@arkade-os/sdk/repositories/realm';
2
- import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-8NrCdOpS.cjs';
2
+ import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-CS62-oEy.cjs';
3
3
  import '@arkade-os/sdk';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { RealmLike } from '@arkade-os/sdk/repositories/realm';
2
- import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-8NrCdOpS.js';
2
+ import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-CS62-oEy.js';
3
3
  import '@arkade-os/sdk';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
2
- import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-8NrCdOpS.cjs';
2
+ import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-CS62-oEy.cjs';
3
3
  import '@arkade-os/sdk';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
2
- import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-8NrCdOpS.js';
2
+ import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-CS62-oEy.js';
3
3
  import '@arkade-os/sdk';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { AsyncStorageTaskQueue, TaskProcessor } from '@arkade-os/sdk/worker/expo';
2
2
  import { Identity, ArkProvider, IndexerProvider, IWallet } from '@arkade-os/sdk';
3
- import { m as SwapRepository, N as Network, r as BoltzSwapProvider, A as ArkadeSwapsConfig } from './types-8NrCdOpS.cjs';
3
+ import { m as SwapRepository, N as Network, r as BoltzSwapProvider, A as ArkadeSwapsConfig } from './types-CS62-oEy.cjs';
4
4
 
5
5
  /**
6
6
  * Dependencies injected into every swap processor at runtime.
@@ -1,6 +1,6 @@
1
1
  import { AsyncStorageTaskQueue, TaskProcessor } from '@arkade-os/sdk/worker/expo';
2
2
  import { Identity, ArkProvider, IndexerProvider, IWallet } from '@arkade-os/sdk';
3
- import { m as SwapRepository, N as Network, r as BoltzSwapProvider, A as ArkadeSwapsConfig } from './types-8NrCdOpS.js';
3
+ import { m as SwapRepository, N as Network, r as BoltzSwapProvider, A as ArkadeSwapsConfig } from './types-CS62-oEy.js';
4
4
 
5
5
  /**
6
6
  * Dependencies injected into every swap processor at runtime.
@@ -144,6 +144,12 @@ type CreateReverseSwapRequest = {
144
144
  preimageHash: string;
145
145
  /** Optional description for the BOLT11 invoice. */
146
146
  description?: string;
147
+ /**
148
+ * Optional SHA256 description hash (hex, 32 bytes / 64 chars) to commit
149
+ * into the invoice instead of a plaintext description. BOLT11 carries one
150
+ * or the other, never both; when set, `description` is omitted.
151
+ */
152
+ descriptionHash?: string;
147
153
  };
148
154
  /** Response from creating a reverse swap. */
149
155
  type CreateReverseSwapResponse = {
@@ -345,7 +351,7 @@ declare class BoltzSwapProvider {
345
351
  /** Creates a submarine swap (Arkade → Lightning) on Boltz. */
346
352
  createSubmarineSwap({ invoice, refundPublicKey, }: CreateSubmarineSwapRequest): Promise<CreateSubmarineSwapResponse>;
347
353
  /** Creates a reverse swap (Lightning → Arkade) on Boltz. */
348
- createReverseSwap({ invoiceAmount, claimPublicKey, preimageHash, description, }: CreateReverseSwapRequest): Promise<CreateReverseSwapResponse>;
354
+ createReverseSwap({ invoiceAmount, claimPublicKey, preimageHash, description, descriptionHash, }: CreateReverseSwapRequest): Promise<CreateReverseSwapResponse>;
349
355
  /** Creates a chain swap (ARK ↔ BTC) on Boltz. */
350
356
  createChainSwap({ to, from, preimageHash, feeSatsPerByte, claimPublicKey, refundPublicKey, serverLockAmount, userLockAmount, }: CreateChainSwapRequest): Promise<CreateChainSwapResponse>;
351
357
  /** Requests Boltz co-signature for a submarine swap refund. Returns signed transaction + checkpoint. */
@@ -915,6 +921,15 @@ interface CreateLightningInvoiceRequest {
915
921
  amount: number;
916
922
  /** Optional description embedded in the BOLT11 invoice. */
917
923
  description?: string;
924
+ /**
925
+ * Optional SHA256 description hash (hex, 32 bytes) to commit into the
926
+ * BOLT11 invoice instead of a plaintext description. A BOLT11 invoice
927
+ * carries either a description or a description hash, never both, so when
928
+ * this is set `description` is ignored. Use this for flows that must bind
929
+ * the invoice to an external document — e.g. NIP-57 zaps, where the hash
930
+ * is SHA256 of the zap request and the receipt later proves the match.
931
+ */
932
+ descriptionHash?: string;
918
933
  }
919
934
  /** Response containing the created Lightning invoice and swap details. */
920
935
  interface CreateLightningInvoiceResponse {
@@ -1161,8 +1176,10 @@ interface DecodedInvoice {
1161
1176
  expiry: number;
1162
1177
  /** Invoice amount in satoshis. */
1163
1178
  amountSats: number;
1164
- /** Invoice description string. */
1179
+ /** Invoice description string (BOLT11 `d` field; "" if none). */
1165
1180
  description: string;
1181
+ /** Invoice description hash (BOLT11 `h` field, hex; "" if none). */
1182
+ descriptionHash: string;
1166
1183
  /** Payment hash (hex-encoded). */
1167
1184
  paymentHash: string;
1168
1185
  }
@@ -144,6 +144,12 @@ type CreateReverseSwapRequest = {
144
144
  preimageHash: string;
145
145
  /** Optional description for the BOLT11 invoice. */
146
146
  description?: string;
147
+ /**
148
+ * Optional SHA256 description hash (hex, 32 bytes / 64 chars) to commit
149
+ * into the invoice instead of a plaintext description. BOLT11 carries one
150
+ * or the other, never both; when set, `description` is omitted.
151
+ */
152
+ descriptionHash?: string;
147
153
  };
148
154
  /** Response from creating a reverse swap. */
149
155
  type CreateReverseSwapResponse = {
@@ -345,7 +351,7 @@ declare class BoltzSwapProvider {
345
351
  /** Creates a submarine swap (Arkade → Lightning) on Boltz. */
346
352
  createSubmarineSwap({ invoice, refundPublicKey, }: CreateSubmarineSwapRequest): Promise<CreateSubmarineSwapResponse>;
347
353
  /** Creates a reverse swap (Lightning → Arkade) on Boltz. */
348
- createReverseSwap({ invoiceAmount, claimPublicKey, preimageHash, description, }: CreateReverseSwapRequest): Promise<CreateReverseSwapResponse>;
354
+ createReverseSwap({ invoiceAmount, claimPublicKey, preimageHash, description, descriptionHash, }: CreateReverseSwapRequest): Promise<CreateReverseSwapResponse>;
349
355
  /** Creates a chain swap (ARK ↔ BTC) on Boltz. */
350
356
  createChainSwap({ to, from, preimageHash, feeSatsPerByte, claimPublicKey, refundPublicKey, serverLockAmount, userLockAmount, }: CreateChainSwapRequest): Promise<CreateChainSwapResponse>;
351
357
  /** Requests Boltz co-signature for a submarine swap refund. Returns signed transaction + checkpoint. */
@@ -915,6 +921,15 @@ interface CreateLightningInvoiceRequest {
915
921
  amount: number;
916
922
  /** Optional description embedded in the BOLT11 invoice. */
917
923
  description?: string;
924
+ /**
925
+ * Optional SHA256 description hash (hex, 32 bytes) to commit into the
926
+ * BOLT11 invoice instead of a plaintext description. A BOLT11 invoice
927
+ * carries either a description or a description hash, never both, so when
928
+ * this is set `description` is ignored. Use this for flows that must bind
929
+ * the invoice to an external document — e.g. NIP-57 zaps, where the hash
930
+ * is SHA256 of the zap request and the receipt later proves the match.
931
+ */
932
+ descriptionHash?: string;
918
933
  }
919
934
  /** Response containing the created Lightning invoice and swap details. */
920
935
  interface CreateLightningInvoiceResponse {
@@ -1161,8 +1176,10 @@ interface DecodedInvoice {
1161
1176
  expiry: number;
1162
1177
  /** Invoice amount in satoshis. */
1163
1178
  amountSats: number;
1164
- /** Invoice description string. */
1179
+ /** Invoice description string (BOLT11 `d` field; "" if none). */
1165
1180
  description: string;
1181
+ /** Invoice description hash (BOLT11 `h` field, hex; "" if none). */
1182
+ descriptionHash: string;
1166
1183
  /** Payment hash (hex-encoded). */
1167
1184
  paymentHash: string;
1168
1185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/boltz-swap",
3
- "version": "0.3.44",
3
+ "version": "0.3.45",
4
4
  "type": "module",
5
5
  "description": "A production-ready TypeScript package that brings Boltz submarine-swaps to Arkade.",
6
6
  "main": "./dist/index.js",
@@ -76,7 +76,7 @@
76
76
  "@scure/btc-signer": "2.0.1",
77
77
  "bip68": "1.0.4",
78
78
  "light-bolt11-decoder": "3.2.0",
79
- "@arkade-os/sdk": "0.4.39"
79
+ "@arkade-os/sdk": "0.4.40"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "expo-task-manager": ">=3.0.0",