@arkade-os/boltz-swap 0.3.32 → 0.3.33

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.
Files changed (31) hide show
  1. package/README.md +22 -26
  2. package/dist/{arkade-swaps-CS8FZSVL.d.cts → arkade-swaps-9M7FRuq1.d.cts} +57 -5
  3. package/dist/{arkade-swaps-WiKCanCL.d.ts → arkade-swaps-DNsyWeFr.d.ts} +57 -5
  4. package/dist/{chunk-NHBWNN6H.js → chunk-HNQDJOLM.js} +8 -27
  5. package/dist/{chunk-B3Q4TFWT.js → chunk-SJ5SYSMK.js} +551 -779
  6. package/dist/chunk-SJQJQO7P.js +25 -0
  7. package/dist/expo/background.cjs +573 -805
  8. package/dist/expo/background.d.cts +3 -3
  9. package/dist/expo/background.d.ts +3 -3
  10. package/dist/expo/background.js +8 -20
  11. package/dist/expo/index.cjs +574 -783
  12. package/dist/expo/index.d.cts +7 -5
  13. package/dist/expo/index.d.ts +7 -5
  14. package/dist/expo/index.js +17 -20
  15. package/dist/index.cjs +732 -931
  16. package/dist/index.d.cts +80 -10
  17. package/dist/index.d.ts +80 -10
  18. package/dist/index.js +126 -115
  19. package/dist/repositories/realm/index.cjs +10 -22
  20. package/dist/repositories/realm/index.d.cts +7 -5
  21. package/dist/repositories/realm/index.d.ts +7 -5
  22. package/dist/repositories/realm/index.js +8 -22
  23. package/dist/repositories/sqlite/index.cjs +12 -23
  24. package/dist/repositories/sqlite/index.d.cts +1 -1
  25. package/dist/repositories/sqlite/index.d.ts +1 -1
  26. package/dist/repositories/sqlite/index.js +10 -23
  27. package/dist/{swapsPollProcessor-wYOMzldd.d.ts → swapsPollProcessor-CEgeGlbP.d.ts} +3 -3
  28. package/dist/{swapsPollProcessor-BF3uTFae.d.cts → swapsPollProcessor-CuITxZie.d.cts} +3 -3
  29. package/dist/{types-BBI7-KJ0.d.cts → types-CrKkVzBB.d.cts} +9 -3
  30. package/dist/{types-BBI7-KJ0.d.ts → types-CrKkVzBB.d.ts} +9 -3
  31. package/package.json +10 -25
@@ -1,7 +1,7 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps, V as VhtlcTimeouts } from '../arkade-swaps-CS8FZSVL.cjs';
2
- import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, g as SubmarineRefundOutcome, h as SubmarineRecoveryInfo, i as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, k as ArkToBtcResponse, l as BtcToArkResponse, d as Chain, j as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-BBI7-KJ0.cjs';
3
- import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-BF3uTFae.cjs';
4
- export { D as DefineSwapBackgroundTaskOptions, c as ExpoArkadeLightningConfig, b as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-BF3uTFae.cjs';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-9M7FRuq1.cjs';
2
+ import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, g as SubmarineRefundOutcome, h as SubmarineRecoveryInfo, i as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, k as ArkToBtcResponse, l as BtcToArkResponse, d as Chain, j as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CrKkVzBB.cjs';
3
+ import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-CuITxZie.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-CuITxZie.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';
@@ -144,7 +144,9 @@ declare class ExpoArkadeSwaps implements IArkadeSwaps {
144
144
  swap: BoltzChainSwap;
145
145
  arkInfo: ArkInfo;
146
146
  }): Promise<boolean>;
147
- quoteSwap(swapId: string): Promise<number>;
147
+ quoteSwap(swapId: string, options?: QuoteSwapOptions): Promise<number>;
148
+ getSwapQuote(swapId: string): Promise<number>;
149
+ acceptSwapQuote(swapId: string, amount: number, options?: QuoteSwapOptions): Promise<number>;
148
150
  joinBatch(identity: Identity, input: ArkTxInput, output: TransactionOutput, arkInfo: ArkInfo, isRecoverable?: boolean): Promise<string>;
149
151
  createVHTLCScript(params: {
150
152
  network: string;
@@ -1,7 +1,7 @@
1
- import { I as IArkadeSwaps, A as ArkadeSwaps, V as VhtlcTimeouts } from '../arkade-swaps-WiKCanCL.js';
2
- import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, g as SubmarineRefundOutcome, h as SubmarineRecoveryInfo, i as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, k as ArkToBtcResponse, l as BtcToArkResponse, d as Chain, j as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-BBI7-KJ0.js';
3
- import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-wYOMzldd.js';
4
- export { D as DefineSwapBackgroundTaskOptions, c as ExpoArkadeLightningConfig, b as ExpoSwapBackgroundConfig, P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies } from '../swapsPollProcessor-wYOMzldd.js';
1
+ import { I as IArkadeSwaps, A as ArkadeSwaps, Q as QuoteSwapOptions, V as VhtlcTimeouts } from '../arkade-swaps-DNsyWeFr.js';
2
+ import { n as SwapManagerClient, C as CreateLightningInvoiceRequest, e as CreateLightningInvoiceResponse, S as SendLightningPaymentRequest, f as SendLightningPaymentResponse, c as BoltzSubmarineSwap, b as BoltzReverseSwap, g as SubmarineRefundOutcome, h as SubmarineRecoveryInfo, i as SubmarineRecoveryResult, F as FeesResponse, a as BoltzChainSwap, k as ArkToBtcResponse, l as BtcToArkResponse, d as Chain, j as ChainFeesResponse, L as LimitsResponse, G as GetSwapStatusResponse, B as BoltzSwap } from '../types-CrKkVzBB.js';
3
+ import { E as ExpoArkadeSwapsConfig } from '../swapsPollProcessor-CEgeGlbP.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-CEgeGlbP.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';
@@ -144,7 +144,9 @@ declare class ExpoArkadeSwaps implements IArkadeSwaps {
144
144
  swap: BoltzChainSwap;
145
145
  arkInfo: ArkInfo;
146
146
  }): Promise<boolean>;
147
- quoteSwap(swapId: string): Promise<number>;
147
+ quoteSwap(swapId: string, options?: QuoteSwapOptions): Promise<number>;
148
+ getSwapQuote(swapId: string): Promise<number>;
149
+ acceptSwapQuote(swapId: string, amount: number, options?: QuoteSwapOptions): Promise<number>;
148
150
  joinBatch(identity: Identity, input: ArkTxInput, output: TransactionOutput, arkInfo: ArkInfo, isRecoverable?: boolean): Promise<string>;
149
151
  createVHTLCScript(params: {
150
152
  network: string;
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  SWAP_POLL_TASK_TYPE
3
- } from "../chunk-NHBWNN6H.js";
3
+ } from "../chunk-HNQDJOLM.js";
4
4
  import {
5
5
  ArkadeSwaps
6
- } from "../chunk-B3Q4TFWT.js";
6
+ } from "../chunk-SJ5SYSMK.js";
7
+ import "../chunk-SJQJQO7P.js";
7
8
 
8
9
  // src/expo/arkade-lightning.ts
9
- function getRandomId() {
10
- return Math.random().toString(36).slice(2) + Date.now().toString(36);
11
- }
10
+ import {
11
+ getRandomId
12
+ } from "@arkade-os/sdk";
12
13
  function warnOnRemovedBackgroundFields(bg) {
13
14
  if (!bg || typeof bg !== "object") return;
14
15
  const removed = [];
@@ -64,9 +65,7 @@ var ExpoArkadeSwaps = class _ExpoArkadeSwaps {
64
65
  const instance = new _ExpoArkadeSwaps(inner, config);
65
66
  await instance.seedSwapPollTask();
66
67
  if (config.background.foregroundIntervalMs && config.background.foregroundIntervalMs > 0) {
67
- instance.startForegroundPolling(
68
- config.background.foregroundIntervalMs
69
- );
68
+ instance.startForegroundPolling(config.background.foregroundIntervalMs);
70
69
  }
71
70
  return instance;
72
71
  }
@@ -80,9 +79,7 @@ var ExpoArkadeSwaps = class _ExpoArkadeSwaps {
80
79
  const { taskQueue } = this.config.background;
81
80
  const results = await taskQueue.getResults();
82
81
  if (results.length > 0) {
83
- await taskQueue.acknowledgeResults(
84
- results.map((r) => r.id)
85
- );
82
+ await taskQueue.acknowledgeResults(results.map((r) => r.id));
86
83
  }
87
84
  await this.seedSwapPollTask();
88
85
  }
@@ -208,17 +205,17 @@ var ExpoArkadeSwaps = class _ExpoArkadeSwaps {
208
205
  verifyChainSwap(args) {
209
206
  return this.inner.verifyChainSwap(args);
210
207
  }
211
- quoteSwap(swapId) {
212
- return this.inner.quoteSwap(swapId);
208
+ quoteSwap(swapId, options) {
209
+ return this.inner.quoteSwap(swapId, options);
210
+ }
211
+ getSwapQuote(swapId) {
212
+ return this.inner.getSwapQuote(swapId);
213
+ }
214
+ acceptSwapQuote(swapId, amount, options) {
215
+ return this.inner.acceptSwapQuote(swapId, amount, options);
213
216
  }
214
217
  joinBatch(identity, input, output, arkInfo, isRecoverable) {
215
- return this.inner.joinBatch(
216
- identity,
217
- input,
218
- output,
219
- arkInfo,
220
- isRecoverable
221
- );
218
+ return this.inner.joinBatch(identity, input, output, arkInfo, isRecoverable);
222
219
  }
223
220
  createVHTLCScript(params) {
224
221
  return this.inner.createVHTLCScript(params);