@arkade-os/boltz-swap 0.3.12 → 0.3.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/{arkade-swaps-CHMKeBwG.d.ts → arkade-swaps-BfHIKMq0.d.ts} +49 -49
- package/dist/{arkade-swaps-NStISj0-.d.cts → arkade-swaps-CwQbGdU9.d.cts} +49 -49
- package/dist/expo/index.d.cts +26 -26
- package/dist/expo/index.d.ts +26 -26
- package/dist/index.d.cts +70 -70
- package/dist/index.d.ts +70 -70
- package/dist/repositories/realm/index.d.cts +3 -3
- package/dist/repositories/realm/index.d.ts +3 -3
- package/dist/repositories/sqlite/index.d.cts +3 -3
- package/dist/repositories/sqlite/index.d.ts +3 -3
- package/dist/{types-NXkA-o9j.d.cts → types-x542EUL6.d.cts} +43 -43
- package/dist/{types-NXkA-o9j.d.ts → types-x542EUL6.d.ts} +43 -43
- package/package.json +6 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWallet, ArkProvider, IndexerProvider, ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
|
|
2
|
-
import {
|
|
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-x542EUL6.js';
|
|
3
3
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -95,13 +95,13 @@ declare class ArkadeSwaps {
|
|
|
95
95
|
* @returns The pending reverse swap, added to SwapManager if enabled.
|
|
96
96
|
* @throws {SwapError} If amount is <= 0 or key retrieval fails.
|
|
97
97
|
*/
|
|
98
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
98
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
99
99
|
/**
|
|
100
100
|
* Claims the VHTLC for a pending reverse swap, transferring locked funds to the wallet.
|
|
101
101
|
* @param pendingSwap - The reverse swap whose VHTLC should be claimed.
|
|
102
102
|
* @throws {Error} If preimage is missing, VHTLC script creation fails, or no spendable VTXOs found.
|
|
103
103
|
*/
|
|
104
|
-
claimVHTLC(pendingSwap:
|
|
104
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Waits for a reverse swap to be confirmed and claims the VHTLC.
|
|
107
107
|
* Delegates to SwapManager if enabled, otherwise monitors via WebSocket.
|
|
@@ -111,7 +111,7 @@ declare class ArkadeSwaps {
|
|
|
111
111
|
* @throws {SwapExpiredError} If the swap exceeds its time limit.
|
|
112
112
|
* @throws {TransactionFailedError} If the on-chain transaction fails.
|
|
113
113
|
*/
|
|
114
|
-
waitAndClaim(pendingSwap:
|
|
114
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
115
115
|
txid: string;
|
|
116
116
|
}>;
|
|
117
117
|
/**
|
|
@@ -128,14 +128,14 @@ declare class ArkadeSwaps {
|
|
|
128
128
|
* @returns The pending submarine swap, added to SwapManager if enabled.
|
|
129
129
|
* @throws {SwapError} If invoice is missing or key retrieval fails.
|
|
130
130
|
*/
|
|
131
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
131
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
132
132
|
/**
|
|
133
133
|
* Refunds the VHTLC for a failed submarine swap, returning locked funds to the wallet.
|
|
134
134
|
* Uses multi-party signatures (user + Boltz + server) for non-recoverable VTXOs.
|
|
135
135
|
* @param pendingSwap - The submarine swap to refund.
|
|
136
136
|
* @throws {Error} If preimage hash is unavailable, VHTLC not found, or already spent.
|
|
137
137
|
*/
|
|
138
|
-
refundVHTLC(pendingSwap:
|
|
138
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
139
139
|
/**
|
|
140
140
|
* Waits for a submarine swap's Lightning payment to settle.
|
|
141
141
|
* @param pendingSwap - The submarine swap to monitor.
|
|
@@ -144,7 +144,7 @@ declare class ArkadeSwaps {
|
|
|
144
144
|
* @throws {InvoiceFailedToPayError} If Boltz fails to route the payment.
|
|
145
145
|
* @throws {TransactionLockupFailedError} If the lockup transaction fails.
|
|
146
146
|
*/
|
|
147
|
-
waitForSwapSettlement(pendingSwap:
|
|
147
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
148
148
|
preimage: string;
|
|
149
149
|
}>;
|
|
150
150
|
/**
|
|
@@ -167,19 +167,19 @@ declare class ArkadeSwaps {
|
|
|
167
167
|
* @param pendingSwap - The pending chain swap to monitor.
|
|
168
168
|
* @returns The transaction ID of the claimed HTLC.
|
|
169
169
|
*/
|
|
170
|
-
waitAndClaimBtc(pendingSwap:
|
|
170
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
171
171
|
txid: string;
|
|
172
172
|
}>;
|
|
173
173
|
/**
|
|
174
174
|
* Claim sats on BTC chain by claiming the HTLC.
|
|
175
175
|
* @param pendingSwap - The pending chain swap with BTC transaction hex.
|
|
176
176
|
*/
|
|
177
|
-
claimBtc(pendingSwap:
|
|
177
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
178
178
|
/**
|
|
179
179
|
* When an ARK to BTC swap fails, refund sats on ARK chain by claiming the VHTLC.
|
|
180
180
|
* @param pendingSwap - The pending chain swap to refund.
|
|
181
181
|
*/
|
|
182
|
-
refundArk(pendingSwap:
|
|
182
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
183
183
|
/**
|
|
184
184
|
* Creates a chain swap from BTC to ARK.
|
|
185
185
|
* @param args.feeSatsPerByte - Fee rate for BTC transactions (default: 1).
|
|
@@ -198,7 +198,7 @@ declare class ArkadeSwaps {
|
|
|
198
198
|
* @param pendingSwap - The pending chain swap to monitor.
|
|
199
199
|
* @returns The transaction ID of the claimed VHTLC.
|
|
200
200
|
*/
|
|
201
|
-
waitAndClaimArk(pendingSwap:
|
|
201
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
202
202
|
txid: string;
|
|
203
203
|
}>;
|
|
204
204
|
/**
|
|
@@ -206,19 +206,19 @@ declare class ArkadeSwaps {
|
|
|
206
206
|
* Refactored to use claimVHTLCIdentity + claimVHTLCwithOffchainTx utilities.
|
|
207
207
|
* @param pendingSwap - The pending chain swap.
|
|
208
208
|
*/
|
|
209
|
-
claimArk(pendingSwap:
|
|
209
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
210
210
|
/**
|
|
211
211
|
* Sign a cooperative claim for the server in BTC => ARK swaps.
|
|
212
212
|
* @param pendingSwap - The pending chain swap.
|
|
213
213
|
*/
|
|
214
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
214
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
215
215
|
/**
|
|
216
216
|
* Waits for a chain swap to be claimable and then claims it.
|
|
217
217
|
* Dispatches to waitAndClaimArk or waitAndClaimBtc based on swap direction.
|
|
218
218
|
* @param pendingSwap - The pending swap to wait for and claim.
|
|
219
219
|
* @returns The transaction ID of the claim.
|
|
220
220
|
*/
|
|
221
|
-
waitAndClaimChain(pendingSwap:
|
|
221
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
222
222
|
txid: string;
|
|
223
223
|
}>;
|
|
224
224
|
/**
|
|
@@ -233,7 +233,7 @@ declare class ArkadeSwaps {
|
|
|
233
233
|
feeSatsPerByte?: number;
|
|
234
234
|
senderLockAmount?: number;
|
|
235
235
|
receiverLockAmount?: number;
|
|
236
|
-
}): Promise<
|
|
236
|
+
}): Promise<BoltzChainSwap>;
|
|
237
237
|
/**
|
|
238
238
|
* Validates the lockup and claim addresses match the expected scripts.
|
|
239
239
|
* @param args - The arguments for verifying a chain swap.
|
|
@@ -242,7 +242,7 @@ declare class ArkadeSwaps {
|
|
|
242
242
|
verifyChainSwap(args: {
|
|
243
243
|
to: Chain;
|
|
244
244
|
from: Chain;
|
|
245
|
-
swap:
|
|
245
|
+
swap: BoltzChainSwap;
|
|
246
246
|
arkInfo: ArkInfo;
|
|
247
247
|
}): Promise<boolean>;
|
|
248
248
|
/**
|
|
@@ -304,20 +304,20 @@ declare class ArkadeSwaps {
|
|
|
304
304
|
/**
|
|
305
305
|
* Returns pending submarine swaps (those with status `invoice.set`).
|
|
306
306
|
*/
|
|
307
|
-
getPendingSubmarineSwaps(): Promise<
|
|
307
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
308
308
|
/**
|
|
309
309
|
* Returns pending reverse swaps (those with status `swap.created`).
|
|
310
310
|
*/
|
|
311
|
-
getPendingReverseSwaps(): Promise<
|
|
311
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
312
312
|
/**
|
|
313
313
|
* Returns pending chain swaps (those with status `swap.created`).
|
|
314
314
|
*/
|
|
315
|
-
getPendingChainSwaps(): Promise<
|
|
315
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
316
316
|
/**
|
|
317
317
|
* Retrieves swap history from storage.
|
|
318
318
|
* @returns Array of all swaps (reverse + submarine + chain) sorted by creation date (newest first).
|
|
319
319
|
*/
|
|
320
|
-
getSwapHistory(): Promise<
|
|
320
|
+
getSwapHistory(): Promise<BoltzSwap[]>;
|
|
321
321
|
/**
|
|
322
322
|
* Refreshes the status of all pending swaps in the storage provider.
|
|
323
323
|
*/
|
|
@@ -330,18 +330,18 @@ declare class ArkadeSwaps {
|
|
|
330
330
|
* display/monitoring and are not automatically wired into the SwapManager.
|
|
331
331
|
*/
|
|
332
332
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
333
|
-
chainSwaps:
|
|
334
|
-
reverseSwaps:
|
|
335
|
-
submarineSwaps:
|
|
333
|
+
chainSwaps: BoltzChainSwap[];
|
|
334
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
335
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
336
336
|
}>;
|
|
337
337
|
/**
|
|
338
338
|
* Enrich a restored reverse swap with its preimage.
|
|
339
339
|
*/
|
|
340
|
-
enrichReverseSwapPreimage(swap:
|
|
340
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
341
341
|
/**
|
|
342
342
|
* Enrich a restored submarine swap with its invoice.
|
|
343
343
|
*/
|
|
344
|
-
enrichSubmarineSwapInvoice(swap:
|
|
344
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
345
345
|
}
|
|
346
346
|
/** Public interface for ArkadeSwaps, defining all swap operations available to consumers. */
|
|
347
347
|
interface IArkadeSwaps extends AsyncDisposable {
|
|
@@ -350,20 +350,20 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
350
350
|
getSwapManager(): SwapManagerClient | null;
|
|
351
351
|
createLightningInvoice(args: CreateLightningInvoiceRequest): Promise<CreateLightningInvoiceResponse>;
|
|
352
352
|
sendLightningPayment(args: SendLightningPaymentRequest): Promise<SendLightningPaymentResponse>;
|
|
353
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
354
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
355
|
-
claimVHTLC(pendingSwap:
|
|
356
|
-
refundVHTLC(pendingSwap:
|
|
357
|
-
waitAndClaim(pendingSwap:
|
|
353
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
354
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
355
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
356
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
357
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
358
358
|
txid: string;
|
|
359
359
|
}>;
|
|
360
|
-
waitForSwapSettlement(pendingSwap:
|
|
360
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
361
361
|
preimage: string;
|
|
362
362
|
}>;
|
|
363
363
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
364
|
-
chainSwaps:
|
|
365
|
-
reverseSwaps:
|
|
366
|
-
submarineSwaps:
|
|
364
|
+
chainSwaps: BoltzChainSwap[];
|
|
365
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
366
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
367
367
|
}>;
|
|
368
368
|
arkToBtc(args: {
|
|
369
369
|
btcAddress: string;
|
|
@@ -371,22 +371,22 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
371
371
|
receiverLockAmount?: number;
|
|
372
372
|
feeSatsPerByte?: number;
|
|
373
373
|
}): Promise<ArkToBtcResponse>;
|
|
374
|
-
waitAndClaimBtc(pendingSwap:
|
|
374
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
375
375
|
txid: string;
|
|
376
376
|
}>;
|
|
377
|
-
claimBtc(pendingSwap:
|
|
378
|
-
refundArk(pendingSwap:
|
|
377
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
378
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
379
379
|
btcToArk(args: {
|
|
380
380
|
feeSatsPerByte?: number;
|
|
381
381
|
senderLockAmount?: number;
|
|
382
382
|
receiverLockAmount?: number;
|
|
383
383
|
}): Promise<BtcToArkResponse>;
|
|
384
|
-
waitAndClaimArk(pendingSwap:
|
|
384
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
385
385
|
txid: string;
|
|
386
386
|
}>;
|
|
387
|
-
claimArk(pendingSwap:
|
|
388
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
389
|
-
waitAndClaimChain(pendingSwap:
|
|
387
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
388
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
389
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
390
390
|
txid: string;
|
|
391
391
|
}>;
|
|
392
392
|
createChainSwap(args: {
|
|
@@ -396,11 +396,11 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
396
396
|
feeSatsPerByte?: number;
|
|
397
397
|
senderLockAmount?: number;
|
|
398
398
|
receiverLockAmount?: number;
|
|
399
|
-
}): Promise<
|
|
399
|
+
}): Promise<BoltzChainSwap>;
|
|
400
400
|
verifyChainSwap(args: {
|
|
401
401
|
to: Chain;
|
|
402
402
|
from: Chain;
|
|
403
|
-
swap:
|
|
403
|
+
swap: BoltzChainSwap;
|
|
404
404
|
arkInfo: ArkInfo;
|
|
405
405
|
}): Promise<boolean>;
|
|
406
406
|
quoteSwap(swapId: string): Promise<number>;
|
|
@@ -425,14 +425,14 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
425
425
|
getFees(from: Chain, to: Chain): Promise<ChainFeesResponse>;
|
|
426
426
|
getLimits(): Promise<LimitsResponse>;
|
|
427
427
|
getLimits(from: Chain, to: Chain): Promise<LimitsResponse>;
|
|
428
|
-
getPendingSubmarineSwaps(): Promise<
|
|
429
|
-
getPendingReverseSwaps(): Promise<
|
|
430
|
-
getPendingChainSwaps(): Promise<
|
|
431
|
-
getSwapHistory(): Promise<
|
|
428
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
429
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
430
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
431
|
+
getSwapHistory(): Promise<BoltzSwap[]>;
|
|
432
432
|
refreshSwapsStatus(): Promise<void>;
|
|
433
433
|
getSwapStatus(swapId: string): Promise<GetSwapStatusResponse>;
|
|
434
|
-
enrichReverseSwapPreimage(swap:
|
|
435
|
-
enrichSubmarineSwapInvoice(swap:
|
|
434
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
435
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
436
436
|
/**
|
|
437
437
|
* Reset all swap state: stops the SwapManager and clears the swap repository.
|
|
438
438
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWallet, ArkProvider, IndexerProvider, ArkInfo, Identity, ArkTxInput, VHTLC } from '@arkade-os/sdk';
|
|
2
|
-
import {
|
|
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-x542EUL6.cjs';
|
|
3
3
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -95,13 +95,13 @@ declare class ArkadeSwaps {
|
|
|
95
95
|
* @returns The pending reverse swap, added to SwapManager if enabled.
|
|
96
96
|
* @throws {SwapError} If amount is <= 0 or key retrieval fails.
|
|
97
97
|
*/
|
|
98
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
98
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
99
99
|
/**
|
|
100
100
|
* Claims the VHTLC for a pending reverse swap, transferring locked funds to the wallet.
|
|
101
101
|
* @param pendingSwap - The reverse swap whose VHTLC should be claimed.
|
|
102
102
|
* @throws {Error} If preimage is missing, VHTLC script creation fails, or no spendable VTXOs found.
|
|
103
103
|
*/
|
|
104
|
-
claimVHTLC(pendingSwap:
|
|
104
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Waits for a reverse swap to be confirmed and claims the VHTLC.
|
|
107
107
|
* Delegates to SwapManager if enabled, otherwise monitors via WebSocket.
|
|
@@ -111,7 +111,7 @@ declare class ArkadeSwaps {
|
|
|
111
111
|
* @throws {SwapExpiredError} If the swap exceeds its time limit.
|
|
112
112
|
* @throws {TransactionFailedError} If the on-chain transaction fails.
|
|
113
113
|
*/
|
|
114
|
-
waitAndClaim(pendingSwap:
|
|
114
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
115
115
|
txid: string;
|
|
116
116
|
}>;
|
|
117
117
|
/**
|
|
@@ -128,14 +128,14 @@ declare class ArkadeSwaps {
|
|
|
128
128
|
* @returns The pending submarine swap, added to SwapManager if enabled.
|
|
129
129
|
* @throws {SwapError} If invoice is missing or key retrieval fails.
|
|
130
130
|
*/
|
|
131
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
131
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
132
132
|
/**
|
|
133
133
|
* Refunds the VHTLC for a failed submarine swap, returning locked funds to the wallet.
|
|
134
134
|
* Uses multi-party signatures (user + Boltz + server) for non-recoverable VTXOs.
|
|
135
135
|
* @param pendingSwap - The submarine swap to refund.
|
|
136
136
|
* @throws {Error} If preimage hash is unavailable, VHTLC not found, or already spent.
|
|
137
137
|
*/
|
|
138
|
-
refundVHTLC(pendingSwap:
|
|
138
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
139
139
|
/**
|
|
140
140
|
* Waits for a submarine swap's Lightning payment to settle.
|
|
141
141
|
* @param pendingSwap - The submarine swap to monitor.
|
|
@@ -144,7 +144,7 @@ declare class ArkadeSwaps {
|
|
|
144
144
|
* @throws {InvoiceFailedToPayError} If Boltz fails to route the payment.
|
|
145
145
|
* @throws {TransactionLockupFailedError} If the lockup transaction fails.
|
|
146
146
|
*/
|
|
147
|
-
waitForSwapSettlement(pendingSwap:
|
|
147
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
148
148
|
preimage: string;
|
|
149
149
|
}>;
|
|
150
150
|
/**
|
|
@@ -167,19 +167,19 @@ declare class ArkadeSwaps {
|
|
|
167
167
|
* @param pendingSwap - The pending chain swap to monitor.
|
|
168
168
|
* @returns The transaction ID of the claimed HTLC.
|
|
169
169
|
*/
|
|
170
|
-
waitAndClaimBtc(pendingSwap:
|
|
170
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
171
171
|
txid: string;
|
|
172
172
|
}>;
|
|
173
173
|
/**
|
|
174
174
|
* Claim sats on BTC chain by claiming the HTLC.
|
|
175
175
|
* @param pendingSwap - The pending chain swap with BTC transaction hex.
|
|
176
176
|
*/
|
|
177
|
-
claimBtc(pendingSwap:
|
|
177
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
178
178
|
/**
|
|
179
179
|
* When an ARK to BTC swap fails, refund sats on ARK chain by claiming the VHTLC.
|
|
180
180
|
* @param pendingSwap - The pending chain swap to refund.
|
|
181
181
|
*/
|
|
182
|
-
refundArk(pendingSwap:
|
|
182
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
183
183
|
/**
|
|
184
184
|
* Creates a chain swap from BTC to ARK.
|
|
185
185
|
* @param args.feeSatsPerByte - Fee rate for BTC transactions (default: 1).
|
|
@@ -198,7 +198,7 @@ declare class ArkadeSwaps {
|
|
|
198
198
|
* @param pendingSwap - The pending chain swap to monitor.
|
|
199
199
|
* @returns The transaction ID of the claimed VHTLC.
|
|
200
200
|
*/
|
|
201
|
-
waitAndClaimArk(pendingSwap:
|
|
201
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
202
202
|
txid: string;
|
|
203
203
|
}>;
|
|
204
204
|
/**
|
|
@@ -206,19 +206,19 @@ declare class ArkadeSwaps {
|
|
|
206
206
|
* Refactored to use claimVHTLCIdentity + claimVHTLCwithOffchainTx utilities.
|
|
207
207
|
* @param pendingSwap - The pending chain swap.
|
|
208
208
|
*/
|
|
209
|
-
claimArk(pendingSwap:
|
|
209
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
210
210
|
/**
|
|
211
211
|
* Sign a cooperative claim for the server in BTC => ARK swaps.
|
|
212
212
|
* @param pendingSwap - The pending chain swap.
|
|
213
213
|
*/
|
|
214
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
214
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
215
215
|
/**
|
|
216
216
|
* Waits for a chain swap to be claimable and then claims it.
|
|
217
217
|
* Dispatches to waitAndClaimArk or waitAndClaimBtc based on swap direction.
|
|
218
218
|
* @param pendingSwap - The pending swap to wait for and claim.
|
|
219
219
|
* @returns The transaction ID of the claim.
|
|
220
220
|
*/
|
|
221
|
-
waitAndClaimChain(pendingSwap:
|
|
221
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
222
222
|
txid: string;
|
|
223
223
|
}>;
|
|
224
224
|
/**
|
|
@@ -233,7 +233,7 @@ declare class ArkadeSwaps {
|
|
|
233
233
|
feeSatsPerByte?: number;
|
|
234
234
|
senderLockAmount?: number;
|
|
235
235
|
receiverLockAmount?: number;
|
|
236
|
-
}): Promise<
|
|
236
|
+
}): Promise<BoltzChainSwap>;
|
|
237
237
|
/**
|
|
238
238
|
* Validates the lockup and claim addresses match the expected scripts.
|
|
239
239
|
* @param args - The arguments for verifying a chain swap.
|
|
@@ -242,7 +242,7 @@ declare class ArkadeSwaps {
|
|
|
242
242
|
verifyChainSwap(args: {
|
|
243
243
|
to: Chain;
|
|
244
244
|
from: Chain;
|
|
245
|
-
swap:
|
|
245
|
+
swap: BoltzChainSwap;
|
|
246
246
|
arkInfo: ArkInfo;
|
|
247
247
|
}): Promise<boolean>;
|
|
248
248
|
/**
|
|
@@ -304,20 +304,20 @@ declare class ArkadeSwaps {
|
|
|
304
304
|
/**
|
|
305
305
|
* Returns pending submarine swaps (those with status `invoice.set`).
|
|
306
306
|
*/
|
|
307
|
-
getPendingSubmarineSwaps(): Promise<
|
|
307
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
308
308
|
/**
|
|
309
309
|
* Returns pending reverse swaps (those with status `swap.created`).
|
|
310
310
|
*/
|
|
311
|
-
getPendingReverseSwaps(): Promise<
|
|
311
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
312
312
|
/**
|
|
313
313
|
* Returns pending chain swaps (those with status `swap.created`).
|
|
314
314
|
*/
|
|
315
|
-
getPendingChainSwaps(): Promise<
|
|
315
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
316
316
|
/**
|
|
317
317
|
* Retrieves swap history from storage.
|
|
318
318
|
* @returns Array of all swaps (reverse + submarine + chain) sorted by creation date (newest first).
|
|
319
319
|
*/
|
|
320
|
-
getSwapHistory(): Promise<
|
|
320
|
+
getSwapHistory(): Promise<BoltzSwap[]>;
|
|
321
321
|
/**
|
|
322
322
|
* Refreshes the status of all pending swaps in the storage provider.
|
|
323
323
|
*/
|
|
@@ -330,18 +330,18 @@ declare class ArkadeSwaps {
|
|
|
330
330
|
* display/monitoring and are not automatically wired into the SwapManager.
|
|
331
331
|
*/
|
|
332
332
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
333
|
-
chainSwaps:
|
|
334
|
-
reverseSwaps:
|
|
335
|
-
submarineSwaps:
|
|
333
|
+
chainSwaps: BoltzChainSwap[];
|
|
334
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
335
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
336
336
|
}>;
|
|
337
337
|
/**
|
|
338
338
|
* Enrich a restored reverse swap with its preimage.
|
|
339
339
|
*/
|
|
340
|
-
enrichReverseSwapPreimage(swap:
|
|
340
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
341
341
|
/**
|
|
342
342
|
* Enrich a restored submarine swap with its invoice.
|
|
343
343
|
*/
|
|
344
|
-
enrichSubmarineSwapInvoice(swap:
|
|
344
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
345
345
|
}
|
|
346
346
|
/** Public interface for ArkadeSwaps, defining all swap operations available to consumers. */
|
|
347
347
|
interface IArkadeSwaps extends AsyncDisposable {
|
|
@@ -350,20 +350,20 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
350
350
|
getSwapManager(): SwapManagerClient | null;
|
|
351
351
|
createLightningInvoice(args: CreateLightningInvoiceRequest): Promise<CreateLightningInvoiceResponse>;
|
|
352
352
|
sendLightningPayment(args: SendLightningPaymentRequest): Promise<SendLightningPaymentResponse>;
|
|
353
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
354
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
355
|
-
claimVHTLC(pendingSwap:
|
|
356
|
-
refundVHTLC(pendingSwap:
|
|
357
|
-
waitAndClaim(pendingSwap:
|
|
353
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
354
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
355
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
356
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
357
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
358
358
|
txid: string;
|
|
359
359
|
}>;
|
|
360
|
-
waitForSwapSettlement(pendingSwap:
|
|
360
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
361
361
|
preimage: string;
|
|
362
362
|
}>;
|
|
363
363
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
364
|
-
chainSwaps:
|
|
365
|
-
reverseSwaps:
|
|
366
|
-
submarineSwaps:
|
|
364
|
+
chainSwaps: BoltzChainSwap[];
|
|
365
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
366
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
367
367
|
}>;
|
|
368
368
|
arkToBtc(args: {
|
|
369
369
|
btcAddress: string;
|
|
@@ -371,22 +371,22 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
371
371
|
receiverLockAmount?: number;
|
|
372
372
|
feeSatsPerByte?: number;
|
|
373
373
|
}): Promise<ArkToBtcResponse>;
|
|
374
|
-
waitAndClaimBtc(pendingSwap:
|
|
374
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
375
375
|
txid: string;
|
|
376
376
|
}>;
|
|
377
|
-
claimBtc(pendingSwap:
|
|
378
|
-
refundArk(pendingSwap:
|
|
377
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
378
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
379
379
|
btcToArk(args: {
|
|
380
380
|
feeSatsPerByte?: number;
|
|
381
381
|
senderLockAmount?: number;
|
|
382
382
|
receiverLockAmount?: number;
|
|
383
383
|
}): Promise<BtcToArkResponse>;
|
|
384
|
-
waitAndClaimArk(pendingSwap:
|
|
384
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
385
385
|
txid: string;
|
|
386
386
|
}>;
|
|
387
|
-
claimArk(pendingSwap:
|
|
388
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
389
|
-
waitAndClaimChain(pendingSwap:
|
|
387
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
388
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
389
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
390
390
|
txid: string;
|
|
391
391
|
}>;
|
|
392
392
|
createChainSwap(args: {
|
|
@@ -396,11 +396,11 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
396
396
|
feeSatsPerByte?: number;
|
|
397
397
|
senderLockAmount?: number;
|
|
398
398
|
receiverLockAmount?: number;
|
|
399
|
-
}): Promise<
|
|
399
|
+
}): Promise<BoltzChainSwap>;
|
|
400
400
|
verifyChainSwap(args: {
|
|
401
401
|
to: Chain;
|
|
402
402
|
from: Chain;
|
|
403
|
-
swap:
|
|
403
|
+
swap: BoltzChainSwap;
|
|
404
404
|
arkInfo: ArkInfo;
|
|
405
405
|
}): Promise<boolean>;
|
|
406
406
|
quoteSwap(swapId: string): Promise<number>;
|
|
@@ -425,14 +425,14 @@ interface IArkadeSwaps extends AsyncDisposable {
|
|
|
425
425
|
getFees(from: Chain, to: Chain): Promise<ChainFeesResponse>;
|
|
426
426
|
getLimits(): Promise<LimitsResponse>;
|
|
427
427
|
getLimits(from: Chain, to: Chain): Promise<LimitsResponse>;
|
|
428
|
-
getPendingSubmarineSwaps(): Promise<
|
|
429
|
-
getPendingReverseSwaps(): Promise<
|
|
430
|
-
getPendingChainSwaps(): Promise<
|
|
431
|
-
getSwapHistory(): Promise<
|
|
428
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
429
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
430
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
431
|
+
getSwapHistory(): Promise<BoltzSwap[]>;
|
|
432
432
|
refreshSwapsStatus(): Promise<void>;
|
|
433
433
|
getSwapStatus(swapId: string): Promise<GetSwapStatusResponse>;
|
|
434
|
-
enrichReverseSwapPreimage(swap:
|
|
435
|
-
enrichSubmarineSwapInvoice(swap:
|
|
434
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
435
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
436
436
|
/**
|
|
437
437
|
* Reset all swap state: stops the SwapManager and clears the swap repository.
|
|
438
438
|
*
|
package/dist/expo/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-
|
|
2
|
-
import { A as ArkadeSwapsConfig,
|
|
1
|
+
import { I as IArkadeSwaps, A as ArkadeSwaps } from '../arkade-swaps-CwQbGdU9.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-x542EUL6.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';
|
|
@@ -138,45 +138,45 @@ declare class ExpoArkadeSwaps implements IArkadeSwaps {
|
|
|
138
138
|
getSwapManager(): SwapManagerClient | null;
|
|
139
139
|
createLightningInvoice(args: CreateLightningInvoiceRequest): Promise<CreateLightningInvoiceResponse>;
|
|
140
140
|
sendLightningPayment(args: SendLightningPaymentRequest): Promise<SendLightningPaymentResponse>;
|
|
141
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
142
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
143
|
-
claimVHTLC(pendingSwap:
|
|
144
|
-
refundVHTLC(pendingSwap:
|
|
145
|
-
waitAndClaim(pendingSwap:
|
|
141
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
142
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
143
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
144
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
145
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
146
146
|
txid: string;
|
|
147
147
|
}>;
|
|
148
|
-
waitForSwapSettlement(pendingSwap:
|
|
148
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
149
149
|
preimage: string;
|
|
150
150
|
}>;
|
|
151
151
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
152
|
-
chainSwaps:
|
|
153
|
-
reverseSwaps:
|
|
154
|
-
submarineSwaps:
|
|
152
|
+
chainSwaps: BoltzChainSwap[];
|
|
153
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
154
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
155
155
|
}>;
|
|
156
|
-
enrichReverseSwapPreimage(swap:
|
|
157
|
-
enrichSubmarineSwapInvoice(swap:
|
|
156
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
157
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
158
158
|
arkToBtc(args: {
|
|
159
159
|
btcAddress: string;
|
|
160
160
|
senderLockAmount?: number;
|
|
161
161
|
receiverLockAmount?: number;
|
|
162
162
|
feeSatsPerByte?: number;
|
|
163
163
|
}): Promise<ArkToBtcResponse>;
|
|
164
|
-
waitAndClaimBtc(pendingSwap:
|
|
164
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
165
165
|
txid: string;
|
|
166
166
|
}>;
|
|
167
|
-
claimBtc(pendingSwap:
|
|
168
|
-
refundArk(pendingSwap:
|
|
167
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
168
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
169
169
|
btcToArk(args: {
|
|
170
170
|
feeSatsPerByte?: number;
|
|
171
171
|
senderLockAmount?: number;
|
|
172
172
|
receiverLockAmount?: number;
|
|
173
173
|
}): Promise<BtcToArkResponse>;
|
|
174
|
-
waitAndClaimArk(pendingSwap:
|
|
174
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
175
175
|
txid: string;
|
|
176
176
|
}>;
|
|
177
|
-
claimArk(pendingSwap:
|
|
178
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
179
|
-
waitAndClaimChain(pendingSwap:
|
|
177
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
178
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
179
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
180
180
|
txid: string;
|
|
181
181
|
}>;
|
|
182
182
|
createChainSwap(args: {
|
|
@@ -186,11 +186,11 @@ declare class ExpoArkadeSwaps implements IArkadeSwaps {
|
|
|
186
186
|
feeSatsPerByte?: number;
|
|
187
187
|
senderLockAmount?: number;
|
|
188
188
|
receiverLockAmount?: number;
|
|
189
|
-
}): Promise<
|
|
189
|
+
}): Promise<BoltzChainSwap>;
|
|
190
190
|
verifyChainSwap(args: {
|
|
191
191
|
to: Chain;
|
|
192
192
|
from: Chain;
|
|
193
|
-
swap:
|
|
193
|
+
swap: BoltzChainSwap;
|
|
194
194
|
arkInfo: ArkInfo;
|
|
195
195
|
}): Promise<boolean>;
|
|
196
196
|
quoteSwap(swapId: string): Promise<number>;
|
|
@@ -216,10 +216,10 @@ declare class ExpoArkadeSwaps implements IArkadeSwaps {
|
|
|
216
216
|
getLimits(): Promise<LimitsResponse>;
|
|
217
217
|
getLimits(from: Chain, to: Chain): Promise<LimitsResponse>;
|
|
218
218
|
getSwapStatus(swapId: string): Promise<GetSwapStatusResponse>;
|
|
219
|
-
getPendingSubmarineSwaps(): Promise<
|
|
220
|
-
getPendingReverseSwaps(): Promise<
|
|
221
|
-
getPendingChainSwaps(): Promise<
|
|
222
|
-
getSwapHistory(): Promise<
|
|
219
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
220
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
221
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
222
|
+
getSwapHistory(): Promise<BoltzSwap[]>;
|
|
223
223
|
refreshSwapsStatus(): Promise<void>;
|
|
224
224
|
}
|
|
225
225
|
/** @deprecated Use ExpoArkadeSwaps instead */
|