@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
package/dist/expo/index.d.ts
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-BfHIKMq0.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-x542EUL6.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';
|
|
@@ -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 */
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IArkadeSwaps } from './arkade-swaps-
|
|
2
|
-
export { A as ArkadeSwaps } from './arkade-swaps-
|
|
3
|
-
import {
|
|
4
|
-
export { X as ArkadeSwapsCreateConfig,
|
|
1
|
+
import { I as IArkadeSwaps } from './arkade-swaps-CwQbGdU9.cjs';
|
|
2
|
+
export { A as ArkadeSwaps } from './arkade-swaps-CwQbGdU9.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-x542EUL6.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-x542EUL6.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';
|
|
@@ -15,7 +15,7 @@ interface ErrorOptions {
|
|
|
15
15
|
/** Whether the swap's funds can be refunded. */
|
|
16
16
|
isRefundable?: boolean;
|
|
17
17
|
/** The associated pending swap, if available. */
|
|
18
|
-
pendingSwap?:
|
|
18
|
+
pendingSwap?: BoltzSwap;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Base error class for all swap-related errors.
|
|
@@ -27,7 +27,7 @@ declare class SwapError extends Error {
|
|
|
27
27
|
/** Whether the swap can be refunded (default: false). */
|
|
28
28
|
isRefundable: boolean;
|
|
29
29
|
/** The pending swap associated with this error, if available. */
|
|
30
|
-
pendingSwap?:
|
|
30
|
+
pendingSwap?: BoltzSwap;
|
|
31
31
|
constructor(options?: ErrorOptions);
|
|
32
32
|
}
|
|
33
33
|
/** Thrown when a Lightning invoice expires before being paid. The swap may be refundable. */
|
|
@@ -99,35 +99,35 @@ declare const verifySignatures: (tx: Transaction, inputIndex: number, requiredSi
|
|
|
99
99
|
* Generic type for swap save functions
|
|
100
100
|
*/
|
|
101
101
|
type SwapSaver = {
|
|
102
|
-
saveChainSwap?: (swap:
|
|
103
|
-
saveReverseSwap?: (swap:
|
|
104
|
-
saveSubmarineSwap?: (swap:
|
|
102
|
+
saveChainSwap?: (swap: BoltzChainSwap) => Promise<void>;
|
|
103
|
+
saveReverseSwap?: (swap: BoltzReverseSwap) => Promise<void>;
|
|
104
|
+
saveSubmarineSwap?: (swap: BoltzSubmarineSwap) => Promise<void>;
|
|
105
105
|
};
|
|
106
106
|
/**
|
|
107
107
|
* Save a swap of any type using the appropriate saver function
|
|
108
108
|
* This eliminates the need for type checking in multiple places
|
|
109
109
|
*/
|
|
110
|
-
declare function saveSwap(swap:
|
|
110
|
+
declare function saveSwap(swap: BoltzSwap, saver: SwapSaver): Promise<void>;
|
|
111
111
|
/**
|
|
112
112
|
* Update a reverse swap's status and save it
|
|
113
113
|
*/
|
|
114
|
-
declare function updateReverseSwapStatus(swap:
|
|
114
|
+
declare function updateReverseSwapStatus(swap: BoltzReverseSwap, status: BoltzReverseSwap["status"], saveFunc: (swap: BoltzReverseSwap) => Promise<void>, additionalFields?: Partial<BoltzReverseSwap>): Promise<void>;
|
|
115
115
|
/**
|
|
116
116
|
* Update a submarine swap's status and save it
|
|
117
117
|
*/
|
|
118
|
-
declare function updateSubmarineSwapStatus(swap:
|
|
118
|
+
declare function updateSubmarineSwapStatus(swap: BoltzSubmarineSwap, status: BoltzSubmarineSwap["status"], saveFunc: (swap: BoltzSubmarineSwap) => Promise<void>, additionalFields?: Partial<BoltzSubmarineSwap>): Promise<void>;
|
|
119
119
|
/**
|
|
120
120
|
* Update a chain swap's status and save it
|
|
121
121
|
*/
|
|
122
|
-
declare function updateChainSwapStatus(swap:
|
|
122
|
+
declare function updateChainSwapStatus(swap: BoltzChainSwap, status: BoltzChainSwap["status"], saveFunc: (swap: BoltzChainSwap) => Promise<void>, additionalFields?: Partial<BoltzChainSwap>): Promise<void>;
|
|
123
123
|
/**
|
|
124
124
|
* Enrich a reverse swap with its preimage after validation.
|
|
125
125
|
*/
|
|
126
|
-
declare function enrichReverseSwapPreimage(swap:
|
|
126
|
+
declare function enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
127
127
|
/**
|
|
128
128
|
* Enrich a submarine swap with its invoice after validation.
|
|
129
129
|
*/
|
|
130
|
-
declare function enrichSubmarineSwapInvoice(swap:
|
|
130
|
+
declare function enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
131
131
|
|
|
132
132
|
type RequestInitArkSwaps = RequestEnvelope & {
|
|
133
133
|
type: "INIT_ARKADE_SWAPS";
|
|
@@ -164,7 +164,7 @@ type RequestCreateSubmarineSwap = RequestEnvelope & {
|
|
|
164
164
|
};
|
|
165
165
|
type ResponseCreateSubmarineSwap = ResponseEnvelope & {
|
|
166
166
|
type: "SUBMARINE_SWAP_CREATED";
|
|
167
|
-
payload:
|
|
167
|
+
payload: BoltzSubmarineSwap;
|
|
168
168
|
};
|
|
169
169
|
type RequestCreateReverseSwap = RequestEnvelope & {
|
|
170
170
|
type: "CREATE_REVERSE_SWAP";
|
|
@@ -172,25 +172,25 @@ type RequestCreateReverseSwap = RequestEnvelope & {
|
|
|
172
172
|
};
|
|
173
173
|
type ResponseCreateReverseSwap = ResponseEnvelope & {
|
|
174
174
|
type: "REVERSE_SWAP_CREATED";
|
|
175
|
-
payload:
|
|
175
|
+
payload: BoltzReverseSwap;
|
|
176
176
|
};
|
|
177
177
|
type RequestClaimVhtlc = RequestEnvelope & {
|
|
178
178
|
type: "CLAIM_VHTLC";
|
|
179
|
-
payload:
|
|
179
|
+
payload: BoltzReverseSwap;
|
|
180
180
|
};
|
|
181
181
|
type ResponseClaimVhtlc = ResponseEnvelope & {
|
|
182
182
|
type: "VHTLC_CLAIMED";
|
|
183
183
|
};
|
|
184
184
|
type RequestRefundVhtlc = RequestEnvelope & {
|
|
185
185
|
type: "REFUND_VHTLC";
|
|
186
|
-
payload:
|
|
186
|
+
payload: BoltzSubmarineSwap;
|
|
187
187
|
};
|
|
188
188
|
type ResponseRefundVhtlc = ResponseEnvelope & {
|
|
189
189
|
type: "VHTLC_REFUNDED";
|
|
190
190
|
};
|
|
191
191
|
type RequestWaitAndClaim = RequestEnvelope & {
|
|
192
192
|
type: "WAIT_AND_CLAIM";
|
|
193
|
-
payload:
|
|
193
|
+
payload: BoltzReverseSwap;
|
|
194
194
|
};
|
|
195
195
|
type ResponseWaitAndClaim = ResponseEnvelope & {
|
|
196
196
|
type: "WAIT_AND_CLAIMED";
|
|
@@ -200,7 +200,7 @@ type ResponseWaitAndClaim = ResponseEnvelope & {
|
|
|
200
200
|
};
|
|
201
201
|
type RequestWaitForSwapSettlement = RequestEnvelope & {
|
|
202
202
|
type: "WAIT_FOR_SWAP_SETTLEMENT";
|
|
203
|
-
payload:
|
|
203
|
+
payload: BoltzSubmarineSwap;
|
|
204
204
|
};
|
|
205
205
|
type ResponseWaitForSwapSettlement = ResponseEnvelope & {
|
|
206
206
|
type: "SWAP_SETTLED";
|
|
@@ -215,32 +215,32 @@ type RequestRestoreSwaps = RequestEnvelope & {
|
|
|
215
215
|
type ResponseRestoreSwaps = ResponseEnvelope & {
|
|
216
216
|
type: "SWAPS_RESTORED";
|
|
217
217
|
payload: {
|
|
218
|
-
chainSwaps:
|
|
219
|
-
reverseSwaps:
|
|
220
|
-
submarineSwaps:
|
|
218
|
+
chainSwaps: BoltzChainSwap[];
|
|
219
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
220
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
type RequestEnrichReverseSwapPreimage = RequestEnvelope & {
|
|
224
224
|
type: "ENRICH_REVERSE_SWAP_PREIMAGE";
|
|
225
225
|
payload: {
|
|
226
|
-
swap:
|
|
226
|
+
swap: BoltzReverseSwap;
|
|
227
227
|
preimage: string;
|
|
228
228
|
};
|
|
229
229
|
};
|
|
230
230
|
type ResponseEnrichReverseSwapPreimage = ResponseEnvelope & {
|
|
231
231
|
type: "REVERSE_SWAP_PREIMAGE_ENRICHED";
|
|
232
|
-
payload:
|
|
232
|
+
payload: BoltzReverseSwap;
|
|
233
233
|
};
|
|
234
234
|
type RequestEnrichSubmarineSwapInvoice = RequestEnvelope & {
|
|
235
235
|
type: "ENRICH_SUBMARINE_SWAP_INVOICE";
|
|
236
236
|
payload: {
|
|
237
|
-
swap:
|
|
237
|
+
swap: BoltzSubmarineSwap;
|
|
238
238
|
invoice: string;
|
|
239
239
|
};
|
|
240
240
|
};
|
|
241
241
|
type ResponseEnrichSubmarineSwapInvoice = ResponseEnvelope & {
|
|
242
242
|
type: "SUBMARINE_SWAP_INVOICE_ENRICHED";
|
|
243
|
-
payload:
|
|
243
|
+
payload: BoltzSubmarineSwap;
|
|
244
244
|
};
|
|
245
245
|
type RequestGetFees = RequestEnvelope & {
|
|
246
246
|
type: "GET_FEES";
|
|
@@ -279,28 +279,28 @@ type RequestGetPendingSubmarineSwaps = RequestEnvelope & {
|
|
|
279
279
|
};
|
|
280
280
|
type ResponseGetPendingSubmarineSwaps = ResponseEnvelope & {
|
|
281
281
|
type: "PENDING_SUBMARINE_SWAPS";
|
|
282
|
-
payload:
|
|
282
|
+
payload: BoltzSubmarineSwap[];
|
|
283
283
|
};
|
|
284
284
|
type RequestGetPendingReverseSwaps = RequestEnvelope & {
|
|
285
285
|
type: "GET_PENDING_REVERSE_SWAPS";
|
|
286
286
|
};
|
|
287
287
|
type ResponseGetPendingReverseSwaps = ResponseEnvelope & {
|
|
288
288
|
type: "PENDING_REVERSE_SWAPS";
|
|
289
|
-
payload:
|
|
289
|
+
payload: BoltzReverseSwap[];
|
|
290
290
|
};
|
|
291
291
|
type RequestGetPendingChainSwaps = RequestEnvelope & {
|
|
292
292
|
type: "GET_PENDING_CHAIN_SWAPS";
|
|
293
293
|
};
|
|
294
294
|
type ResponseGetPendingChainSwaps = ResponseEnvelope & {
|
|
295
295
|
type: "PENDING_CHAIN_SWAPS";
|
|
296
|
-
payload:
|
|
296
|
+
payload: BoltzChainSwap[];
|
|
297
297
|
};
|
|
298
298
|
type RequestGetSwapHistory = RequestEnvelope & {
|
|
299
299
|
type: "GET_SWAP_HISTORY";
|
|
300
300
|
};
|
|
301
301
|
type ResponseGetSwapHistory = ResponseEnvelope & {
|
|
302
302
|
type: "SWAP_HISTORY";
|
|
303
|
-
payload: (
|
|
303
|
+
payload: (BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap)[];
|
|
304
304
|
};
|
|
305
305
|
type RequestRefreshSwapsStatus = RequestEnvelope & {
|
|
306
306
|
type: "REFRESH_SWAPS_STATUS";
|
|
@@ -346,11 +346,11 @@ type RequestCreateChainSwap = RequestEnvelope & {
|
|
|
346
346
|
};
|
|
347
347
|
type ResponseCreateChainSwap = ResponseEnvelope & {
|
|
348
348
|
type: "CHAIN_SWAP_CREATED";
|
|
349
|
-
payload:
|
|
349
|
+
payload: BoltzChainSwap;
|
|
350
350
|
};
|
|
351
351
|
type RequestWaitAndClaimChain = RequestEnvelope & {
|
|
352
352
|
type: "WAIT_AND_CLAIM_CHAIN";
|
|
353
|
-
payload:
|
|
353
|
+
payload: BoltzChainSwap;
|
|
354
354
|
};
|
|
355
355
|
type ResponseWaitAndClaimChain = ResponseEnvelope & {
|
|
356
356
|
type: "CHAIN_CLAIMED";
|
|
@@ -360,7 +360,7 @@ type ResponseWaitAndClaimChain = ResponseEnvelope & {
|
|
|
360
360
|
};
|
|
361
361
|
type RequestWaitAndClaimArk = RequestEnvelope & {
|
|
362
362
|
type: "WAIT_AND_CLAIM_ARK";
|
|
363
|
-
payload:
|
|
363
|
+
payload: BoltzChainSwap;
|
|
364
364
|
};
|
|
365
365
|
type ResponseWaitAndClaimArk = ResponseEnvelope & {
|
|
366
366
|
type: "ARK_CLAIMED";
|
|
@@ -370,7 +370,7 @@ type ResponseWaitAndClaimArk = ResponseEnvelope & {
|
|
|
370
370
|
};
|
|
371
371
|
type RequestWaitAndClaimBtc = RequestEnvelope & {
|
|
372
372
|
type: "WAIT_AND_CLAIM_BTC";
|
|
373
|
-
payload:
|
|
373
|
+
payload: BoltzChainSwap;
|
|
374
374
|
};
|
|
375
375
|
type ResponseWaitAndClaimBtc = ResponseEnvelope & {
|
|
376
376
|
type: "BTC_CLAIMED";
|
|
@@ -380,28 +380,28 @@ type ResponseWaitAndClaimBtc = ResponseEnvelope & {
|
|
|
380
380
|
};
|
|
381
381
|
type RequestClaimArk = RequestEnvelope & {
|
|
382
382
|
type: "CLAIM_ARK";
|
|
383
|
-
payload:
|
|
383
|
+
payload: BoltzChainSwap;
|
|
384
384
|
};
|
|
385
385
|
type ResponseClaimArk = ResponseEnvelope & {
|
|
386
386
|
type: "ARK_CLAIM_EXECUTED";
|
|
387
387
|
};
|
|
388
388
|
type RequestClaimBtc = RequestEnvelope & {
|
|
389
389
|
type: "CLAIM_BTC";
|
|
390
|
-
payload:
|
|
390
|
+
payload: BoltzChainSwap;
|
|
391
391
|
};
|
|
392
392
|
type ResponseClaimBtc = ResponseEnvelope & {
|
|
393
393
|
type: "BTC_CLAIM_EXECUTED";
|
|
394
394
|
};
|
|
395
395
|
type RequestRefundArk = RequestEnvelope & {
|
|
396
396
|
type: "REFUND_ARK";
|
|
397
|
-
payload:
|
|
397
|
+
payload: BoltzChainSwap;
|
|
398
398
|
};
|
|
399
399
|
type ResponseRefundArk = ResponseEnvelope & {
|
|
400
400
|
type: "ARK_REFUND_EXECUTED";
|
|
401
401
|
};
|
|
402
402
|
type RequestSignServerClaim = RequestEnvelope & {
|
|
403
403
|
type: "SIGN_SERVER_CLAIM";
|
|
404
|
-
payload:
|
|
404
|
+
payload: BoltzChainSwap;
|
|
405
405
|
};
|
|
406
406
|
type ResponseSignServerClaim = ResponseEnvelope & {
|
|
407
407
|
type: "SERVER_CLAIM_SIGNED";
|
|
@@ -411,7 +411,7 @@ type RequestVerifyChainSwap = RequestEnvelope & {
|
|
|
411
411
|
payload: {
|
|
412
412
|
to: Chain;
|
|
413
413
|
from: Chain;
|
|
414
|
-
swap:
|
|
414
|
+
swap: BoltzChainSwap;
|
|
415
415
|
arkInfo: ArkInfo;
|
|
416
416
|
};
|
|
417
417
|
};
|
|
@@ -447,7 +447,7 @@ type ResponseSwapManagerStop = ResponseEnvelope & {
|
|
|
447
447
|
};
|
|
448
448
|
type RequestSwapManagerAddSwap = RequestEnvelope & {
|
|
449
449
|
type: "SM-ADD_SWAP";
|
|
450
|
-
payload:
|
|
450
|
+
payload: BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap;
|
|
451
451
|
};
|
|
452
452
|
type ResponseSwapManagerAddSwap = ResponseEnvelope & {
|
|
453
453
|
type: "SM-SWAP_ADDED";
|
|
@@ -466,7 +466,7 @@ type RequestSwapManagerGetPending = RequestEnvelope & {
|
|
|
466
466
|
};
|
|
467
467
|
type ResponseSwapManagerGetPending = ResponseEnvelope & {
|
|
468
468
|
type: "SM-PENDING_SWAPS";
|
|
469
|
-
payload: (
|
|
469
|
+
payload: (BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap)[];
|
|
470
470
|
};
|
|
471
471
|
type RequestSwapManagerHasSwap = RequestEnvelope & {
|
|
472
472
|
type: "SM-HAS_SWAP";
|
|
@@ -573,20 +573,20 @@ declare class ServiceWorkerArkadeSwaps implements IArkadeSwaps {
|
|
|
573
573
|
getSwapManager(): SwapManagerClient | null;
|
|
574
574
|
createLightningInvoice(args: CreateLightningInvoiceRequest): Promise<CreateLightningInvoiceResponse>;
|
|
575
575
|
sendLightningPayment(args: SendLightningPaymentRequest): Promise<SendLightningPaymentResponse>;
|
|
576
|
-
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<
|
|
577
|
-
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<
|
|
578
|
-
claimVHTLC(pendingSwap:
|
|
579
|
-
refundVHTLC(pendingSwap:
|
|
580
|
-
waitAndClaim(pendingSwap:
|
|
576
|
+
createSubmarineSwap(args: SendLightningPaymentRequest): Promise<BoltzSubmarineSwap>;
|
|
577
|
+
createReverseSwap(args: CreateLightningInvoiceRequest): Promise<BoltzReverseSwap>;
|
|
578
|
+
claimVHTLC(pendingSwap: BoltzReverseSwap): Promise<void>;
|
|
579
|
+
refundVHTLC(pendingSwap: BoltzSubmarineSwap): Promise<void>;
|
|
580
|
+
waitAndClaim(pendingSwap: BoltzReverseSwap): Promise<{
|
|
581
581
|
txid: string;
|
|
582
582
|
}>;
|
|
583
|
-
waitForSwapSettlement(pendingSwap:
|
|
583
|
+
waitForSwapSettlement(pendingSwap: BoltzSubmarineSwap): Promise<{
|
|
584
584
|
preimage: string;
|
|
585
585
|
}>;
|
|
586
586
|
restoreSwaps(boltzFees?: FeesResponse): Promise<{
|
|
587
|
-
chainSwaps:
|
|
588
|
-
reverseSwaps:
|
|
589
|
-
submarineSwaps:
|
|
587
|
+
chainSwaps: BoltzChainSwap[];
|
|
588
|
+
reverseSwaps: BoltzReverseSwap[];
|
|
589
|
+
submarineSwaps: BoltzSubmarineSwap[];
|
|
590
590
|
}>;
|
|
591
591
|
arkToBtc(args: {
|
|
592
592
|
btcAddress: string;
|
|
@@ -606,29 +606,29 @@ declare class ServiceWorkerArkadeSwaps implements IArkadeSwaps {
|
|
|
606
606
|
feeSatsPerByte?: number;
|
|
607
607
|
senderLockAmount?: number;
|
|
608
608
|
receiverLockAmount?: number;
|
|
609
|
-
}): Promise<
|
|
610
|
-
waitAndClaimChain(pendingSwap:
|
|
609
|
+
}): Promise<BoltzChainSwap>;
|
|
610
|
+
waitAndClaimChain(pendingSwap: BoltzChainSwap): Promise<{
|
|
611
611
|
txid: string;
|
|
612
612
|
}>;
|
|
613
|
-
waitAndClaimArk(pendingSwap:
|
|
613
|
+
waitAndClaimArk(pendingSwap: BoltzChainSwap): Promise<{
|
|
614
614
|
txid: string;
|
|
615
615
|
}>;
|
|
616
|
-
waitAndClaimBtc(pendingSwap:
|
|
616
|
+
waitAndClaimBtc(pendingSwap: BoltzChainSwap): Promise<{
|
|
617
617
|
txid: string;
|
|
618
618
|
}>;
|
|
619
|
-
claimArk(pendingSwap:
|
|
620
|
-
claimBtc(pendingSwap:
|
|
621
|
-
refundArk(pendingSwap:
|
|
622
|
-
signCooperativeClaimForServer(pendingSwap:
|
|
619
|
+
claimArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
620
|
+
claimBtc(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
621
|
+
refundArk(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
622
|
+
signCooperativeClaimForServer(pendingSwap: BoltzChainSwap): Promise<void>;
|
|
623
623
|
verifyChainSwap(args: {
|
|
624
624
|
to: Chain;
|
|
625
625
|
from: Chain;
|
|
626
|
-
swap:
|
|
626
|
+
swap: BoltzChainSwap;
|
|
627
627
|
arkInfo: ArkInfo;
|
|
628
628
|
}): Promise<boolean>;
|
|
629
629
|
quoteSwap(swapId: string): Promise<number>;
|
|
630
|
-
enrichReverseSwapPreimage(swap:
|
|
631
|
-
enrichSubmarineSwapInvoice(swap:
|
|
630
|
+
enrichReverseSwapPreimage(swap: BoltzReverseSwap, preimage: string): BoltzReverseSwap;
|
|
631
|
+
enrichSubmarineSwapInvoice(swap: BoltzSubmarineSwap, invoice: string): BoltzSubmarineSwap;
|
|
632
632
|
createVHTLCScript(_args: {
|
|
633
633
|
network: string;
|
|
634
634
|
preimageHash: Uint8Array;
|
|
@@ -651,10 +651,10 @@ declare class ServiceWorkerArkadeSwaps implements IArkadeSwaps {
|
|
|
651
651
|
getLimits(): Promise<LimitsResponse>;
|
|
652
652
|
getLimits(from: Chain, to: Chain): Promise<LimitsResponse>;
|
|
653
653
|
getSwapStatus(swapId: string): Promise<GetSwapStatusResponse>;
|
|
654
|
-
getPendingSubmarineSwaps(): Promise<
|
|
655
|
-
getPendingReverseSwaps(): Promise<
|
|
656
|
-
getPendingChainSwaps(): Promise<
|
|
657
|
-
getSwapHistory(): Promise<(
|
|
654
|
+
getPendingSubmarineSwaps(): Promise<BoltzSubmarineSwap[]>;
|
|
655
|
+
getPendingReverseSwaps(): Promise<BoltzReverseSwap[]>;
|
|
656
|
+
getPendingChainSwaps(): Promise<BoltzChainSwap[]>;
|
|
657
|
+
getSwapHistory(): Promise<(BoltzReverseSwap | BoltzSubmarineSwap | BoltzChainSwap)[]>;
|
|
658
658
|
refreshSwapsStatus(): Promise<void>;
|
|
659
659
|
/**
|
|
660
660
|
* Reset all swap state: stops the SwapManager and clears the swap repository.
|
|
@@ -717,9 +717,9 @@ declare class IndexedDbSwapRepository implements SwapRepository {
|
|
|
717
717
|
private db;
|
|
718
718
|
constructor(dbName?: string);
|
|
719
719
|
private getDB;
|
|
720
|
-
saveSwap<T extends
|
|
720
|
+
saveSwap<T extends BoltzSwap>(swap: T): Promise<void>;
|
|
721
721
|
deleteSwap(id: string): Promise<void>;
|
|
722
|
-
getAllSwaps<T extends
|
|
722
|
+
getAllSwaps<T extends BoltzSwap>(filter?: GetSwapsFilter): Promise<T[]>;
|
|
723
723
|
clear(): Promise<void>;
|
|
724
724
|
private getSwapsByIndexValues;
|
|
725
725
|
private getAllSwapsFromStore;
|
|
@@ -729,4 +729,4 @@ declare class IndexedDbSwapRepository implements SwapRepository {
|
|
|
729
729
|
[Symbol.asyncDispose](): Promise<void>;
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
-
export { ArkToBtcResponse, ArkadeSwapsMessageHandler as ArkadeLightningMessageHandler, ArkadeSwapsConfig, ArkadeSwapsMessageHandler, BtcToArkResponse, Chain, ChainFeesResponse, CreateLightningInvoiceRequest, CreateLightningInvoiceResponse, DecodedInvoice, FeesResponse, IndexedDbSwapRepository, InsufficientFundsError, InvoiceExpiredError, InvoiceFailedToPayError, LimitsResponse, type Logger, Network, NetworkError,
|
|
732
|
+
export { ArkToBtcResponse, ArkadeSwapsMessageHandler as ArkadeLightningMessageHandler, ArkadeSwapsConfig, ArkadeSwapsMessageHandler, BoltzChainSwap, BoltzReverseSwap, BoltzSubmarineSwap, BoltzSwap, BtcToArkResponse, Chain, ChainFeesResponse, CreateLightningInvoiceRequest, CreateLightningInvoiceResponse, DecodedInvoice, FeesResponse, IndexedDbSwapRepository, InsufficientFundsError, InvoiceExpiredError, InvoiceFailedToPayError, LimitsResponse, type Logger, Network, NetworkError, PreimageFetchError, SchemaError, SendLightningPaymentRequest, SendLightningPaymentResponse, ServiceWorkerArkadeSwaps as ServiceWorkerArkadeLightning, ServiceWorkerArkadeSwaps, SwapError, SwapExpiredError, SwapManagerClient, SwapRepository, type SwapSaver, TransactionFailedError, decodeInvoice, enrichReverseSwapPreimage, enrichSubmarineSwapInvoice, getInvoicePaymentHash, getInvoiceSatoshis, isValidArkAddress, logger, migrateToSwapRepository, saveSwap, setLogger, updateChainSwapStatus, updateReverseSwapStatus, updateSubmarineSwapStatus, verifySignatures };
|