@arkade-os/boltz-swap 0.3.18 → 0.3.20

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 { m as BoltzSwapProvider, V as SwapManager, j as SwapRepository, X as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, h as ArkToBtcResponse, a as BoltzChainSwap, i as BtcToArkResponse, d as Chain, F as FeesResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-CKxFfdEH.cjs';
2
+ import { m as BoltzSwapProvider, V as SwapManager, j as SwapRepository, X as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, h as ArkToBtcResponse, a as BoltzChainSwap, i as BtcToArkResponse, d as Chain, F as FeesResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-OyAdK824.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 { m as BoltzSwapProvider, V as SwapManager, j as SwapRepository, X as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, h as ArkToBtcResponse, a as BoltzChainSwap, i as BtcToArkResponse, d as Chain, F as FeesResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-CKxFfdEH.js';
2
+ import { m as BoltzSwapProvider, V as SwapManager, j as SwapRepository, X as ArkadeSwapsCreateConfig, A as ArkadeSwapsConfig, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, b as BoltzReverseSwap, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, h as ArkToBtcResponse, a as BoltzChainSwap, i as BtcToArkResponse, d as Chain, F as FeesResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from './types-OyAdK824.js';
3
3
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
4
4
 
5
5
  /**
@@ -2,8 +2,8 @@ import {
2
2
  defineExpoSwapBackgroundTask,
3
3
  registerExpoSwapBackgroundTask,
4
4
  unregisterExpoSwapBackgroundTask
5
- } from "./chunk-GSCLW33R.js";
6
- import "./chunk-CS6UXZP6.js";
5
+ } from "./chunk-EQK2BJQC.js";
6
+ import "./chunk-K3QEFL7D.js";
7
7
  import "./chunk-3RG5ZIWI.js";
8
8
  export {
9
9
  defineExpoSwapBackgroundTask,
@@ -8,7 +8,7 @@ import {
8
8
  isSubmarineFinalStatus,
9
9
  isSubmarineSwapRefundable,
10
10
  logger
11
- } from "./chunk-CS6UXZP6.js";
11
+ } from "./chunk-K3QEFL7D.js";
12
12
  import {
13
13
  __require
14
14
  } from "./chunk-3RG5ZIWI.js";
@@ -2982,6 +2982,8 @@ function scriptFromTapLeafScript(leaf) {
2982
2982
  }
2983
2983
 
2984
2984
  // src/arkade-swaps.ts
2985
+ var CLAIM_VTXO_RETRY_ATTEMPTS = 3;
2986
+ var CLAIM_VTXO_RETRY_DELAY_MS = 500;
2985
2987
  var ArkadeSwaps = class _ArkadeSwaps {
2986
2988
  /** The Arkade wallet instance used for signing and address generation. */
2987
2989
  wallet;
@@ -3286,14 +3288,26 @@ var ArkadeSwaps = class _ArkadeSwaps {
3286
3288
  throw new Error(
3287
3289
  `Swap ${pendingSwap.id}: VHTLC address mismatch. Expected ${lockupAddress}, got ${vhtlcAddress}`
3288
3290
  );
3289
- const { vtxos } = await this.indexerProvider.getVtxos({
3290
- scripts: [hex8.encode(vhtlcScript.pkScript)]
3291
- });
3292
- if (vtxos.length === 0)
3291
+ let vtxo;
3292
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
3293
+ const { vtxos } = await this.indexerProvider.getVtxos({
3294
+ scripts: [hex8.encode(vhtlcScript.pkScript)]
3295
+ });
3296
+ if (vtxos.length > 0) {
3297
+ vtxo = vtxos[0];
3298
+ break;
3299
+ }
3300
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
3301
+ await new Promise(
3302
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
3303
+ );
3304
+ }
3305
+ }
3306
+ if (!vtxo) {
3293
3307
  throw new Error(
3294
3308
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
3295
3309
  );
3296
- const vtxo = vtxos[0];
3310
+ }
3297
3311
  if (vtxo.isSpent) {
3298
3312
  throw new Error(`Swap ${pendingSwap.id}: VHTLC is already spent`);
3299
3313
  }
@@ -4239,15 +4253,27 @@ var ArkadeSwaps = class _ArkadeSwaps {
4239
4253
  message: "Unable to claim: invalid VHTLC address"
4240
4254
  });
4241
4255
  }
4242
- const spendableVtxos = await this.indexerProvider.getVtxos({
4243
- scripts: [hex8.encode(vhtlcScript.pkScript)],
4244
- spendableOnly: true
4245
- });
4246
- if (spendableVtxos.vtxos.length === 0)
4256
+ let vtxo;
4257
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
4258
+ const spendableVtxos = await this.indexerProvider.getVtxos({
4259
+ scripts: [hex8.encode(vhtlcScript.pkScript)],
4260
+ spendableOnly: true
4261
+ });
4262
+ if (spendableVtxos.vtxos.length > 0) {
4263
+ vtxo = spendableVtxos.vtxos[0];
4264
+ break;
4265
+ }
4266
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
4267
+ await new Promise(
4268
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
4269
+ );
4270
+ }
4271
+ }
4272
+ if (!vtxo) {
4247
4273
  throw new Error(
4248
4274
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
4249
4275
  );
4250
- const vtxo = spendableVtxos.vtxos[0];
4276
+ }
4251
4277
  const input = {
4252
4278
  ...vtxo,
4253
4279
  tapLeafScript: vhtlcScript.claim(),
@@ -2964,7 +2964,7 @@ var init_vhtlc = __esm({
2964
2964
  });
2965
2965
 
2966
2966
  // src/arkade-swaps.ts
2967
- var import_sdk8, import_sha23, import_base9, import_secp256k13, import_utils3, import_btc_signer5, import_utils4, ArkadeSwaps;
2967
+ var import_sdk8, import_sha23, import_base9, import_secp256k13, import_utils3, import_btc_signer5, import_utils4, CLAIM_VTXO_RETRY_ATTEMPTS, CLAIM_VTXO_RETRY_DELAY_MS, ArkadeSwaps;
2968
2968
  var init_arkade_swaps = __esm({
2969
2969
  "src/arkade-swaps.ts"() {
2970
2970
  "use strict";
@@ -2988,6 +2988,8 @@ var init_arkade_swaps = __esm({
2988
2988
  init_swap_repository();
2989
2989
  init_identity();
2990
2990
  init_vhtlc();
2991
+ CLAIM_VTXO_RETRY_ATTEMPTS = 3;
2992
+ CLAIM_VTXO_RETRY_DELAY_MS = 500;
2991
2993
  ArkadeSwaps = class _ArkadeSwaps {
2992
2994
  /** The Arkade wallet instance used for signing and address generation. */
2993
2995
  wallet;
@@ -3292,14 +3294,26 @@ var init_arkade_swaps = __esm({
3292
3294
  throw new Error(
3293
3295
  `Swap ${pendingSwap.id}: VHTLC address mismatch. Expected ${lockupAddress}, got ${vhtlcAddress}`
3294
3296
  );
3295
- const { vtxos } = await this.indexerProvider.getVtxos({
3296
- scripts: [import_base9.hex.encode(vhtlcScript.pkScript)]
3297
- });
3298
- if (vtxos.length === 0)
3297
+ let vtxo;
3298
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
3299
+ const { vtxos } = await this.indexerProvider.getVtxos({
3300
+ scripts: [import_base9.hex.encode(vhtlcScript.pkScript)]
3301
+ });
3302
+ if (vtxos.length > 0) {
3303
+ vtxo = vtxos[0];
3304
+ break;
3305
+ }
3306
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
3307
+ await new Promise(
3308
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
3309
+ );
3310
+ }
3311
+ }
3312
+ if (!vtxo) {
3299
3313
  throw new Error(
3300
3314
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
3301
3315
  );
3302
- const vtxo = vtxos[0];
3316
+ }
3303
3317
  if (vtxo.isSpent) {
3304
3318
  throw new Error(`Swap ${pendingSwap.id}: VHTLC is already spent`);
3305
3319
  }
@@ -4245,15 +4259,27 @@ var init_arkade_swaps = __esm({
4245
4259
  message: "Unable to claim: invalid VHTLC address"
4246
4260
  });
4247
4261
  }
4248
- const spendableVtxos = await this.indexerProvider.getVtxos({
4249
- scripts: [import_base9.hex.encode(vhtlcScript.pkScript)],
4250
- spendableOnly: true
4251
- });
4252
- if (spendableVtxos.vtxos.length === 0)
4262
+ let vtxo;
4263
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
4264
+ const spendableVtxos = await this.indexerProvider.getVtxos({
4265
+ scripts: [import_base9.hex.encode(vhtlcScript.pkScript)],
4266
+ spendableOnly: true
4267
+ });
4268
+ if (spendableVtxos.vtxos.length > 0) {
4269
+ vtxo = spendableVtxos.vtxos[0];
4270
+ break;
4271
+ }
4272
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
4273
+ await new Promise(
4274
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
4275
+ );
4276
+ }
4277
+ }
4278
+ if (!vtxo) {
4253
4279
  throw new Error(
4254
4280
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
4255
4281
  );
4256
- const vtxo = spendableVtxos.vtxos[0];
4282
+ }
4257
4283
  const input = {
4258
4284
  ...vtxo,
4259
4285
  tapLeafScript: vhtlcScript.claim(),
@@ -1,5 +1,5 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-BlK0ASlg.cjs';
2
- import { A as ArkadeSwapsConfig, j as SwapRepository, m as BoltzSwapProvider, N as Network, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, F as FeesResponse, a as BoltzChainSwap, h as ArkToBtcResponse, i as BtcToArkResponse, d as Chain, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CKxFfdEH.cjs';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-CvA3RP7_.cjs';
2
+ import { A as ArkadeSwapsConfig, j as SwapRepository, m as BoltzSwapProvider, N as Network, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, F as FeesResponse, a as BoltzChainSwap, h as ArkToBtcResponse, i as BtcToArkResponse, d as Chain, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-OyAdK824.cjs';
3
3
  import { Identity, ArkProvider, IndexerProvider, IWallet, ArkInfo, ArkTxInput, VHTLC } from '@arkade-os/sdk';
4
4
  import { AsyncStorageTaskQueue, TaskProcessor } from '@arkade-os/sdk/worker/expo';
5
5
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
@@ -1,5 +1,5 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-CM-UQ9-5.js';
2
- import { A as ArkadeSwapsConfig, j as SwapRepository, m as BoltzSwapProvider, N as Network, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, F as FeesResponse, a as BoltzChainSwap, h as ArkToBtcResponse, i as BtcToArkResponse, d as Chain, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CKxFfdEH.js';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-DEvf-2g2.js';
2
+ import { A as ArkadeSwapsConfig, j as SwapRepository, m as BoltzSwapProvider, N as Network, k as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, F as FeesResponse, a as BoltzChainSwap, h as ArkToBtcResponse, i as BtcToArkResponse, d as Chain, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-OyAdK824.js';
3
3
  import { Identity, ArkProvider, IndexerProvider, IWallet, ArkInfo, ArkTxInput, VHTLC } from '@arkade-os/sdk';
4
4
  import { AsyncStorageTaskQueue, TaskProcessor } from '@arkade-os/sdk/worker/expo';
5
5
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
@@ -4,10 +4,10 @@ import {
4
4
  registerExpoSwapBackgroundTask,
5
5
  swapsPollProcessor,
6
6
  unregisterExpoSwapBackgroundTask
7
- } from "../chunk-GSCLW33R.js";
7
+ } from "../chunk-EQK2BJQC.js";
8
8
  import {
9
9
  ArkadeSwaps
10
- } from "../chunk-CS6UXZP6.js";
10
+ } from "../chunk-K3QEFL7D.js";
11
11
  import "../chunk-3RG5ZIWI.js";
12
12
 
13
13
  // src/expo/arkade-lightning.ts
@@ -56,7 +56,7 @@ var ExpoArkadeSwaps = class _ExpoArkadeSwaps {
56
56
  await instance.seedSwapPollTask();
57
57
  if (config.background.minimumBackgroundInterval) {
58
58
  try {
59
- const { registerExpoSwapBackgroundTask: registerExpoSwapBackgroundTask2 } = await import("../background-65LGXZHJ.js");
59
+ const { registerExpoSwapBackgroundTask: registerExpoSwapBackgroundTask2 } = await import("../background-EHOJZDKT.js");
60
60
  await registerExpoSwapBackgroundTask2(
61
61
  config.background.taskName,
62
62
  {
@@ -129,7 +129,7 @@ var ExpoArkadeSwaps = class _ExpoArkadeSwaps {
129
129
  }
130
130
  await this.inner.dispose();
131
131
  try {
132
- const { unregisterExpoSwapBackgroundTask: unregisterExpoSwapBackgroundTask2 } = await import("../background-65LGXZHJ.js");
132
+ const { unregisterExpoSwapBackgroundTask: unregisterExpoSwapBackgroundTask2 } = await import("../background-EHOJZDKT.js");
133
133
  await unregisterExpoSwapBackgroundTask2(this.taskName);
134
134
  } catch (err) {
135
135
  const message = err instanceof Error ? err.message : String(err);
package/dist/index.cjs CHANGED
@@ -3042,6 +3042,8 @@ function scriptFromTapLeafScript(leaf) {
3042
3042
  }
3043
3043
 
3044
3044
  // src/arkade-swaps.ts
3045
+ var CLAIM_VTXO_RETRY_ATTEMPTS = 3;
3046
+ var CLAIM_VTXO_RETRY_DELAY_MS = 500;
3045
3047
  var ArkadeSwaps = class _ArkadeSwaps {
3046
3048
  /** The Arkade wallet instance used for signing and address generation. */
3047
3049
  wallet;
@@ -3346,14 +3348,26 @@ var ArkadeSwaps = class _ArkadeSwaps {
3346
3348
  throw new Error(
3347
3349
  `Swap ${pendingSwap.id}: VHTLC address mismatch. Expected ${lockupAddress}, got ${vhtlcAddress}`
3348
3350
  );
3349
- const { vtxos } = await this.indexerProvider.getVtxos({
3350
- scripts: [import_base9.hex.encode(vhtlcScript.pkScript)]
3351
- });
3352
- if (vtxos.length === 0)
3351
+ let vtxo;
3352
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
3353
+ const { vtxos } = await this.indexerProvider.getVtxos({
3354
+ scripts: [import_base9.hex.encode(vhtlcScript.pkScript)]
3355
+ });
3356
+ if (vtxos.length > 0) {
3357
+ vtxo = vtxos[0];
3358
+ break;
3359
+ }
3360
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
3361
+ await new Promise(
3362
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
3363
+ );
3364
+ }
3365
+ }
3366
+ if (!vtxo) {
3353
3367
  throw new Error(
3354
3368
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
3355
3369
  );
3356
- const vtxo = vtxos[0];
3370
+ }
3357
3371
  if (vtxo.isSpent) {
3358
3372
  throw new Error(`Swap ${pendingSwap.id}: VHTLC is already spent`);
3359
3373
  }
@@ -4299,15 +4313,27 @@ var ArkadeSwaps = class _ArkadeSwaps {
4299
4313
  message: "Unable to claim: invalid VHTLC address"
4300
4314
  });
4301
4315
  }
4302
- const spendableVtxos = await this.indexerProvider.getVtxos({
4303
- scripts: [import_base9.hex.encode(vhtlcScript.pkScript)],
4304
- spendableOnly: true
4305
- });
4306
- if (spendableVtxos.vtxos.length === 0)
4316
+ let vtxo;
4317
+ for (let attempt = 1; attempt <= CLAIM_VTXO_RETRY_ATTEMPTS; attempt++) {
4318
+ const spendableVtxos = await this.indexerProvider.getVtxos({
4319
+ scripts: [import_base9.hex.encode(vhtlcScript.pkScript)],
4320
+ spendableOnly: true
4321
+ });
4322
+ if (spendableVtxos.vtxos.length > 0) {
4323
+ vtxo = spendableVtxos.vtxos[0];
4324
+ break;
4325
+ }
4326
+ if (attempt < CLAIM_VTXO_RETRY_ATTEMPTS) {
4327
+ await new Promise(
4328
+ (resolve) => setTimeout(resolve, CLAIM_VTXO_RETRY_DELAY_MS)
4329
+ );
4330
+ }
4331
+ }
4332
+ if (!vtxo) {
4307
4333
  throw new Error(
4308
4334
  `Swap ${pendingSwap.id}: no spendable virtual coins found`
4309
4335
  );
4310
- const vtxo = spendableVtxos.vtxos[0];
4336
+ }
4311
4337
  const input = {
4312
4338
  ...vtxo,
4313
4339
  tapLeafScript: vhtlcScript.claim(),
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IArkadeSwaps } from './arkade-swaps-BlK0ASlg.cjs';
2
- export { A as ArkadeSwaps } from './arkade-swaps-BlK0ASlg.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, f as SendLightningPaymentResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, h as ArkToBtcResponse, i as BtcToArkResponse, j as SwapRepository, k as SwapManagerClient, l as GetSwapsFilter } from './types-CKxFfdEH.cjs';
4
- export { X as ArkadeSwapsCreateConfig, m as BoltzSwapProvider, n as BoltzSwapStatus, W as IncomingPaymentSubscription, V as SwapManager, $ as SwapManagerCallbacks, Z as SwapManagerConfig, _ as SwapManagerEvents, Y as Vtxo, o as isChainClaimableStatus, p as isChainFailedStatus, q as isChainFinalStatus, r as isChainPendingStatus, s as isChainRefundableStatus, t as isChainSignableStatus, u as isChainSuccessStatus, v as isChainSwapClaimable, w as isChainSwapRefundable, x as isPendingChainSwap, y as isPendingReverseSwap, z as isPendingSubmarineSwap, E as isReverseClaimableStatus, H as isReverseFailedStatus, I as isReverseFinalStatus, J as isReversePendingStatus, K as isReverseSuccessStatus, M as isReverseSwapClaimable, O as isSubmarineFailedStatus, P as isSubmarineFinalStatus, Q as isSubmarinePendingStatus, T as isSubmarineRefundableStatus, R as isSubmarineSuccessStatus, U as isSubmarineSwapRefundable } from './types-CKxFfdEH.cjs';
1
+ import { I as IArkadeSwaps } from './arkade-swaps-CvA3RP7_.cjs';
2
+ export { A as ArkadeSwaps } from './arkade-swaps-CvA3RP7_.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, f as SendLightningPaymentResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, h as ArkToBtcResponse, i as BtcToArkResponse, j as SwapRepository, k as SwapManagerClient, l as GetSwapsFilter } from './types-OyAdK824.cjs';
4
+ export { X as ArkadeSwapsCreateConfig, m as BoltzSwapProvider, n as BoltzSwapStatus, W as IncomingPaymentSubscription, _ as PendingChainSwap, Z as PendingReverseSwap, Y as PendingSubmarineSwap, $ as PendingSwap, V as SwapManager, a3 as SwapManagerCallbacks, a1 as SwapManagerConfig, a2 as SwapManagerEvents, a0 as Vtxo, o as isChainClaimableStatus, p as isChainFailedStatus, q as isChainFinalStatus, r as isChainPendingStatus, s as isChainRefundableStatus, t as isChainSignableStatus, u as isChainSuccessStatus, v as isChainSwapClaimable, w as isChainSwapRefundable, x as isPendingChainSwap, y as isPendingReverseSwap, z as isPendingSubmarineSwap, E as isReverseClaimableStatus, H as isReverseFailedStatus, I as isReverseFinalStatus, J as isReversePendingStatus, K as isReverseSuccessStatus, M as isReverseSwapClaimable, O as isSubmarineFailedStatus, P as isSubmarineFinalStatus, Q as isSubmarinePendingStatus, T as isSubmarineRefundableStatus, R as isSubmarineSuccessStatus, U as isSubmarineSwapRefundable } from './types-OyAdK824.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 { I as IArkadeSwaps } from './arkade-swaps-CM-UQ9-5.js';
2
- export { A as ArkadeSwaps } from './arkade-swaps-CM-UQ9-5.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, f as SendLightningPaymentResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, h as ArkToBtcResponse, i as BtcToArkResponse, j as SwapRepository, k as SwapManagerClient, l as GetSwapsFilter } from './types-CKxFfdEH.js';
4
- export { X as ArkadeSwapsCreateConfig, m as BoltzSwapProvider, n as BoltzSwapStatus, W as IncomingPaymentSubscription, V as SwapManager, $ as SwapManagerCallbacks, Z as SwapManagerConfig, _ as SwapManagerEvents, Y as Vtxo, o as isChainClaimableStatus, p as isChainFailedStatus, q as isChainFinalStatus, r as isChainPendingStatus, s as isChainRefundableStatus, t as isChainSignableStatus, u as isChainSuccessStatus, v as isChainSwapClaimable, w as isChainSwapRefundable, x as isPendingChainSwap, y as isPendingReverseSwap, z as isPendingSubmarineSwap, E as isReverseClaimableStatus, H as isReverseFailedStatus, I as isReverseFinalStatus, J as isReversePendingStatus, K as isReverseSuccessStatus, M as isReverseSwapClaimable, O as isSubmarineFailedStatus, P as isSubmarineFinalStatus, Q as isSubmarinePendingStatus, T as isSubmarineRefundableStatus, R as isSubmarineSuccessStatus, U as isSubmarineSwapRefundable } from './types-CKxFfdEH.js';
1
+ import { I as IArkadeSwaps } from './arkade-swaps-DEvf-2g2.js';
2
+ export { A as ArkadeSwaps } from './arkade-swaps-DEvf-2g2.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, f as SendLightningPaymentResponse, g as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, h as ArkToBtcResponse, i as BtcToArkResponse, j as SwapRepository, k as SwapManagerClient, l as GetSwapsFilter } from './types-OyAdK824.js';
4
+ export { X as ArkadeSwapsCreateConfig, m as BoltzSwapProvider, n as BoltzSwapStatus, W as IncomingPaymentSubscription, _ as PendingChainSwap, Z as PendingReverseSwap, Y as PendingSubmarineSwap, $ as PendingSwap, V as SwapManager, a3 as SwapManagerCallbacks, a1 as SwapManagerConfig, a2 as SwapManagerEvents, a0 as Vtxo, o as isChainClaimableStatus, p as isChainFailedStatus, q as isChainFinalStatus, r as isChainPendingStatus, s as isChainRefundableStatus, t as isChainSignableStatus, u as isChainSuccessStatus, v as isChainSwapClaimable, w as isChainSwapRefundable, x as isPendingChainSwap, y as isPendingReverseSwap, z as isPendingSubmarineSwap, E as isReverseClaimableStatus, H as isReverseFailedStatus, I as isReverseFinalStatus, J as isReversePendingStatus, K as isReverseSuccessStatus, M as isReverseSwapClaimable, O as isSubmarineFailedStatus, P as isSubmarineFinalStatus, Q as isSubmarinePendingStatus, T as isSubmarineRefundableStatus, R as isSubmarineSuccessStatus, U as isSubmarineSwapRefundable } from './types-OyAdK824.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
@@ -50,7 +50,7 @@ import {
50
50
  updateReverseSwapStatus,
51
51
  updateSubmarineSwapStatus,
52
52
  verifySignatures
53
- } from "./chunk-CS6UXZP6.js";
53
+ } from "./chunk-K3QEFL7D.js";
54
54
  import "./chunk-3RG5ZIWI.js";
55
55
 
56
56
  // src/serviceWorker/arkade-swaps-message-handler.ts
@@ -1,4 +1,4 @@
1
- import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.cjs';
1
+ import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-OyAdK824.cjs';
2
2
  import '@arkade-os/sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.js';
1
+ import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-OyAdK824.js';
2
2
  import '@arkade-os/sdk';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { SQLExecutor } from '@arkade-os/sdk/repositories/sqlite';
2
- import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.cjs';
2
+ import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-OyAdK824.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 { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.js';
2
+ import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-OyAdK824.js';
3
3
  import '@arkade-os/sdk';
4
4
 
5
5
  /**
@@ -883,6 +883,14 @@ interface BoltzChainSwap {
883
883
  }
884
884
  /** Union type of all pending swap types. */
885
885
  type BoltzSwap = BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap;
886
+ /** Pending- swap type aliases for backwards compatibility */
887
+ interface PendingReverseSwap extends BoltzReverseSwap {
888
+ }
889
+ interface PendingSubmarineSwap extends BoltzSubmarineSwap {
890
+ }
891
+ interface PendingChainSwap extends BoltzChainSwap {
892
+ }
893
+ type PendingSwap = PendingReverseSwap | PendingSubmarineSwap | PendingChainSwap;
886
894
  /** Configuration for initializing ArkadeSwaps via the constructor (swapProvider is required). */
887
895
  interface ArkadeSwapsConfig {
888
896
  /** An IWallet instance from @arkade-os/sdk (must expose arkProvider and indexerProvider). */
@@ -991,4 +999,4 @@ interface ChainFeesResponse {
991
999
  };
992
1000
  }
993
1001
 
994
- export { type SwapManagerCallbacks as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, isReverseClaimableStatus as E, type FeesResponse as F, type GetSwapStatusResponse as G, isReverseFailedStatus as H, isReverseFinalStatus as I, isReversePendingStatus as J, isReverseSuccessStatus as K, type LimitsResponse as L, isReverseSwapClaimable as M, type Network as N, isSubmarineFailedStatus as O, isSubmarineFinalStatus as P, isSubmarinePendingStatus as Q, isSubmarineSuccessStatus as R, type SendLightningPaymentRequest as S, isSubmarineRefundableStatus as T, isSubmarineSwapRefundable as U, SwapManager as V, type IncomingPaymentSubscription as W, type ArkadeSwapsCreateConfig as X, type Vtxo as Y, type SwapManagerConfig as Z, type SwapManagerEvents as _, type BoltzChainSwap as a, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type ChainFeesResponse as g, type ArkToBtcResponse as h, type BtcToArkResponse as i, type SwapRepository as j, type SwapManagerClient as k, type GetSwapsFilter as l, BoltzSwapProvider as m, type BoltzSwapStatus as n, isChainClaimableStatus as o, isChainFailedStatus as p, isChainFinalStatus as q, isChainPendingStatus as r, isChainRefundableStatus as s, isChainSignableStatus as t, isChainSuccessStatus as u, isChainSwapClaimable as v, isChainSwapRefundable as w, isPendingChainSwap as x, isPendingReverseSwap as y, isPendingSubmarineSwap as z };
1002
+ export { type PendingSwap as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, isReverseClaimableStatus as E, type FeesResponse as F, type GetSwapStatusResponse as G, isReverseFailedStatus as H, isReverseFinalStatus as I, isReversePendingStatus as J, isReverseSuccessStatus as K, type LimitsResponse as L, isReverseSwapClaimable as M, type Network as N, isSubmarineFailedStatus as O, isSubmarineFinalStatus as P, isSubmarinePendingStatus as Q, isSubmarineSuccessStatus as R, type SendLightningPaymentRequest as S, isSubmarineRefundableStatus as T, isSubmarineSwapRefundable as U, SwapManager as V, type IncomingPaymentSubscription as W, type ArkadeSwapsCreateConfig as X, type PendingSubmarineSwap as Y, type PendingReverseSwap as Z, type PendingChainSwap as _, type BoltzChainSwap as a, type Vtxo as a0, type SwapManagerConfig as a1, type SwapManagerEvents as a2, type SwapManagerCallbacks as a3, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type ChainFeesResponse as g, type ArkToBtcResponse as h, type BtcToArkResponse as i, type SwapRepository as j, type SwapManagerClient as k, type GetSwapsFilter as l, BoltzSwapProvider as m, type BoltzSwapStatus as n, isChainClaimableStatus as o, isChainFailedStatus as p, isChainFinalStatus as q, isChainPendingStatus as r, isChainRefundableStatus as s, isChainSignableStatus as t, isChainSuccessStatus as u, isChainSwapClaimable as v, isChainSwapRefundable as w, isPendingChainSwap as x, isPendingReverseSwap as y, isPendingSubmarineSwap as z };
@@ -883,6 +883,14 @@ interface BoltzChainSwap {
883
883
  }
884
884
  /** Union type of all pending swap types. */
885
885
  type BoltzSwap = BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap;
886
+ /** Pending- swap type aliases for backwards compatibility */
887
+ interface PendingReverseSwap extends BoltzReverseSwap {
888
+ }
889
+ interface PendingSubmarineSwap extends BoltzSubmarineSwap {
890
+ }
891
+ interface PendingChainSwap extends BoltzChainSwap {
892
+ }
893
+ type PendingSwap = PendingReverseSwap | PendingSubmarineSwap | PendingChainSwap;
886
894
  /** Configuration for initializing ArkadeSwaps via the constructor (swapProvider is required). */
887
895
  interface ArkadeSwapsConfig {
888
896
  /** An IWallet instance from @arkade-os/sdk (must expose arkProvider and indexerProvider). */
@@ -991,4 +999,4 @@ interface ChainFeesResponse {
991
999
  };
992
1000
  }
993
1001
 
994
- export { type SwapManagerCallbacks as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, isReverseClaimableStatus as E, type FeesResponse as F, type GetSwapStatusResponse as G, isReverseFailedStatus as H, isReverseFinalStatus as I, isReversePendingStatus as J, isReverseSuccessStatus as K, type LimitsResponse as L, isReverseSwapClaimable as M, type Network as N, isSubmarineFailedStatus as O, isSubmarineFinalStatus as P, isSubmarinePendingStatus as Q, isSubmarineSuccessStatus as R, type SendLightningPaymentRequest as S, isSubmarineRefundableStatus as T, isSubmarineSwapRefundable as U, SwapManager as V, type IncomingPaymentSubscription as W, type ArkadeSwapsCreateConfig as X, type Vtxo as Y, type SwapManagerConfig as Z, type SwapManagerEvents as _, type BoltzChainSwap as a, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type ChainFeesResponse as g, type ArkToBtcResponse as h, type BtcToArkResponse as i, type SwapRepository as j, type SwapManagerClient as k, type GetSwapsFilter as l, BoltzSwapProvider as m, type BoltzSwapStatus as n, isChainClaimableStatus as o, isChainFailedStatus as p, isChainFinalStatus as q, isChainPendingStatus as r, isChainRefundableStatus as s, isChainSignableStatus as t, isChainSuccessStatus as u, isChainSwapClaimable as v, isChainSwapRefundable as w, isPendingChainSwap as x, isPendingReverseSwap as y, isPendingSubmarineSwap as z };
1002
+ export { type PendingSwap as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, isReverseClaimableStatus as E, type FeesResponse as F, type GetSwapStatusResponse as G, isReverseFailedStatus as H, isReverseFinalStatus as I, isReversePendingStatus as J, isReverseSuccessStatus as K, type LimitsResponse as L, isReverseSwapClaimable as M, type Network as N, isSubmarineFailedStatus as O, isSubmarineFinalStatus as P, isSubmarinePendingStatus as Q, isSubmarineSuccessStatus as R, type SendLightningPaymentRequest as S, isSubmarineRefundableStatus as T, isSubmarineSwapRefundable as U, SwapManager as V, type IncomingPaymentSubscription as W, type ArkadeSwapsCreateConfig as X, type PendingSubmarineSwap as Y, type PendingReverseSwap as Z, type PendingChainSwap as _, type BoltzChainSwap as a, type Vtxo as a0, type SwapManagerConfig as a1, type SwapManagerEvents as a2, type SwapManagerCallbacks as a3, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type ChainFeesResponse as g, type ArkToBtcResponse as h, type BtcToArkResponse as i, type SwapRepository as j, type SwapManagerClient as k, type GetSwapsFilter as l, BoltzSwapProvider as m, type BoltzSwapStatus as n, isChainClaimableStatus as o, isChainFailedStatus as p, isChainFinalStatus as q, isChainPendingStatus as r, isChainRefundableStatus as s, isChainSignableStatus as t, isChainSuccessStatus as u, isChainSwapClaimable as v, isChainSwapRefundable as w, isPendingChainSwap as x, isPendingReverseSwap as y, isPendingSubmarineSwap as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/boltz-swap",
3
- "version": "0.3.18",
3
+ "version": "0.3.20",
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",
@@ -60,7 +60,7 @@
60
60
  "author": "Arkade-OS",
61
61
  "license": "MIT",
62
62
  "dependencies": {
63
- "@arkade-os/sdk": "0.4.17",
63
+ "@arkade-os/sdk": "0.4.19",
64
64
  "@noble/hashes": "2.0.1",
65
65
  "@scure/base": "2.0.0",
66
66
  "@scure/btc-signer": "2.0.1",