@arkade-os/boltz-swap 0.3.14 → 0.3.16
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-CwQbGdU9.d.cts → arkade-swaps-BlK0ASlg.d.cts} +1 -1
- package/dist/{arkade-swaps-BfHIKMq0.d.ts → arkade-swaps-CM-UQ9-5.d.ts} +1 -1
- package/dist/{background-5XMCGVMS.js → background-DX6SZGGJ.js} +2 -2
- package/dist/{chunk-2TWYSAFO.js → chunk-CNH5DDKV.js} +1 -1
- package/dist/{chunk-AIVWXKNG.js → chunk-RL4PDED5.js} +223 -70
- package/dist/expo/index.cjs +224 -71
- package/dist/expo/index.d.cts +2 -2
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +4 -4
- package/dist/index.cjs +224 -70
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +3 -1
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/{types-x542EUL6.d.cts → types-CKxFfdEH.d.cts} +28 -29
- package/dist/{types-x542EUL6.d.ts → types-CKxFfdEH.d.ts} +28 -29
- package/package.json +1 -1
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 { 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-
|
|
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-
|
|
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';
|
|
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';
|
|
@@ -72,6 +72,14 @@ declare class TransactionFailedError extends SwapError {
|
|
|
72
72
|
declare class PreimageFetchError extends SwapError {
|
|
73
73
|
constructor(options?: ErrorOptions);
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Thrown when the Boltz API rejects a refund request
|
|
77
|
+
* (e.g. outpoint mismatch after an Ark round).
|
|
78
|
+
*/
|
|
79
|
+
declare class BoltzRefundError extends Error {
|
|
80
|
+
readonly cause?: unknown | undefined;
|
|
81
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
82
|
+
}
|
|
75
83
|
|
|
76
84
|
/**
|
|
77
85
|
* Decodes a Lightning invoice.
|
|
@@ -729,4 +737,4 @@ declare class IndexedDbSwapRepository implements SwapRepository {
|
|
|
729
737
|
[Symbol.asyncDispose](): Promise<void>;
|
|
730
738
|
}
|
|
731
739
|
|
|
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 };
|
|
740
|
+
export { ArkToBtcResponse, ArkadeSwapsMessageHandler as ArkadeLightningMessageHandler, ArkadeSwapsConfig, ArkadeSwapsMessageHandler, BoltzChainSwap, BoltzRefundError, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IArkadeSwaps } from './arkade-swaps-
|
|
2
|
-
export { A as ArkadeSwaps } from './arkade-swaps-
|
|
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-
|
|
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-
|
|
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';
|
|
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';
|
|
@@ -72,6 +72,14 @@ declare class TransactionFailedError extends SwapError {
|
|
|
72
72
|
declare class PreimageFetchError extends SwapError {
|
|
73
73
|
constructor(options?: ErrorOptions);
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Thrown when the Boltz API rejects a refund request
|
|
77
|
+
* (e.g. outpoint mismatch after an Ark round).
|
|
78
|
+
*/
|
|
79
|
+
declare class BoltzRefundError extends Error {
|
|
80
|
+
readonly cause?: unknown | undefined;
|
|
81
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
82
|
+
}
|
|
75
83
|
|
|
76
84
|
/**
|
|
77
85
|
* Decodes a Lightning invoice.
|
|
@@ -729,4 +737,4 @@ declare class IndexedDbSwapRepository implements SwapRepository {
|
|
|
729
737
|
[Symbol.asyncDispose](): Promise<void>;
|
|
730
738
|
}
|
|
731
739
|
|
|
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 };
|
|
740
|
+
export { ArkToBtcResponse, ArkadeSwapsMessageHandler as ArkadeLightningMessageHandler, ArkadeSwapsConfig, ArkadeSwapsMessageHandler, BoltzChainSwap, BoltzRefundError, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ArkadeSwaps,
|
|
3
|
+
BoltzRefundError,
|
|
3
4
|
BoltzSwapProvider,
|
|
4
5
|
IndexedDbSwapRepository,
|
|
5
6
|
InsufficientFundsError,
|
|
@@ -49,7 +50,7 @@ import {
|
|
|
49
50
|
updateReverseSwapStatus,
|
|
50
51
|
updateSubmarineSwapStatus,
|
|
51
52
|
verifySignatures
|
|
52
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-RL4PDED5.js";
|
|
53
54
|
import "./chunk-3RG5ZIWI.js";
|
|
54
55
|
|
|
55
56
|
// src/serviceWorker/arkade-swaps-message-handler.ts
|
|
@@ -1363,6 +1364,7 @@ export {
|
|
|
1363
1364
|
ArkadeSwapsMessageHandler as ArkadeLightningMessageHandler,
|
|
1364
1365
|
ArkadeSwaps,
|
|
1365
1366
|
ArkadeSwapsMessageHandler,
|
|
1367
|
+
BoltzRefundError,
|
|
1366
1368
|
BoltzSwapProvider,
|
|
1367
1369
|
IndexedDbSwapRepository,
|
|
1368
1370
|
InsufficientFundsError,
|
|
@@ -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-
|
|
2
|
+
import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.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-
|
|
2
|
+
import { j as SwapRepository, B as BoltzSwap, l as GetSwapsFilter } from '../../types-CKxFfdEH.js';
|
|
3
3
|
import '@arkade-os/sdk';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -81,6 +81,7 @@ type GetSwapStatusResponse = {
|
|
|
81
81
|
transaction?: {
|
|
82
82
|
id: string;
|
|
83
83
|
hex?: string;
|
|
84
|
+
confirmed?: boolean;
|
|
84
85
|
eta?: number;
|
|
85
86
|
preimage?: string;
|
|
86
87
|
};
|
|
@@ -96,16 +97,18 @@ type CreateSubmarineSwapRequest = {
|
|
|
96
97
|
type CreateSubmarineSwapResponse = {
|
|
97
98
|
/** Unique swap ID. */
|
|
98
99
|
id: string;
|
|
99
|
-
/** ARK lockup address to send funds to. */
|
|
100
|
-
address: string;
|
|
101
100
|
/** Amount in satoshis to send. */
|
|
102
101
|
expectedAmount: number;
|
|
102
|
+
/** ARK lockup address to send funds to. */
|
|
103
|
+
address?: string;
|
|
103
104
|
/** Boltz's public key for the claim path. */
|
|
104
|
-
claimPublicKey
|
|
105
|
+
claimPublicKey?: string;
|
|
105
106
|
/** Whether zero-conf transactions are accepted. */
|
|
106
|
-
acceptZeroConf
|
|
107
|
+
acceptZeroConf?: boolean;
|
|
108
|
+
/** Block height for the onchain HTLC timeout. */
|
|
109
|
+
timeoutBlockHeight?: number;
|
|
107
110
|
/** Block heights for various timeout/refund scenarios. */
|
|
108
|
-
timeoutBlockHeights
|
|
111
|
+
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
109
112
|
};
|
|
110
113
|
type GetSwapPreimageResponse = {
|
|
111
114
|
preimage: string;
|
|
@@ -128,13 +131,15 @@ type CreateReverseSwapResponse = {
|
|
|
128
131
|
/** BOLT11-encoded Lightning invoice to be paid. */
|
|
129
132
|
invoice: string;
|
|
130
133
|
/** On-chain amount in satoshis (after Boltz fees). */
|
|
131
|
-
onchainAmount
|
|
134
|
+
onchainAmount?: number;
|
|
132
135
|
/** ARK lockup address where Boltz will lock funds. */
|
|
133
|
-
lockupAddress
|
|
136
|
+
lockupAddress?: string;
|
|
134
137
|
/** Boltz's public key for the refund path. */
|
|
135
|
-
refundPublicKey
|
|
138
|
+
refundPublicKey?: string;
|
|
139
|
+
/** Block height for the onchain HTLC timeout. */
|
|
140
|
+
timeoutBlockHeight?: number;
|
|
136
141
|
/** Block heights for various timeout/refund scenarios. */
|
|
137
|
-
timeoutBlockHeights
|
|
142
|
+
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
138
143
|
};
|
|
139
144
|
type SwapTree = {
|
|
140
145
|
claimLeaf: {
|
|
@@ -223,10 +228,11 @@ type Leaf = {
|
|
|
223
228
|
type Tree = {
|
|
224
229
|
claimLeaf: Leaf;
|
|
225
230
|
refundLeaf: Leaf;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
covenantClaimLeaf?: Leaf;
|
|
232
|
+
refundWithoutBoltzLeaf?: Leaf;
|
|
233
|
+
unilateralClaimLeaf?: Leaf;
|
|
234
|
+
unilateralRefundLeaf?: Leaf;
|
|
235
|
+
unilateralRefundWithoutBoltzLeaf?: Leaf;
|
|
230
236
|
};
|
|
231
237
|
type Details = {
|
|
232
238
|
tree: Tree;
|
|
@@ -238,7 +244,7 @@ type Details = {
|
|
|
238
244
|
};
|
|
239
245
|
lockupAddress: string;
|
|
240
246
|
serverPublicKey: string;
|
|
241
|
-
timeoutBlockHeight
|
|
247
|
+
timeoutBlockHeight?: number;
|
|
242
248
|
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
243
249
|
preimageHash?: string;
|
|
244
250
|
};
|
|
@@ -249,19 +255,10 @@ type RestoredChainSwap = {
|
|
|
249
255
|
createdAt: number;
|
|
250
256
|
from: "ARK" | "BTC";
|
|
251
257
|
to: "ARK" | "BTC";
|
|
252
|
-
preimageHash
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
lockupAddress: string;
|
|
257
|
-
serverPublicKey: string;
|
|
258
|
-
timeoutBlockHeight: number;
|
|
259
|
-
transaction?: {
|
|
260
|
-
id: string;
|
|
261
|
-
vout: number;
|
|
262
|
-
};
|
|
263
|
-
tree: Tree;
|
|
264
|
-
};
|
|
258
|
+
preimageHash?: string;
|
|
259
|
+
invoice?: string;
|
|
260
|
+
refundDetails?: Details;
|
|
261
|
+
claimDetails?: Details;
|
|
265
262
|
};
|
|
266
263
|
type RestoredSubmarineSwap = {
|
|
267
264
|
to: "BTC";
|
|
@@ -269,7 +266,7 @@ type RestoredSubmarineSwap = {
|
|
|
269
266
|
from: "ARK";
|
|
270
267
|
type: "submarine";
|
|
271
268
|
createdAt: number;
|
|
272
|
-
preimageHash
|
|
269
|
+
preimageHash?: string;
|
|
273
270
|
status: BoltzSwapStatus;
|
|
274
271
|
refundDetails: Details;
|
|
275
272
|
invoice?: string;
|
|
@@ -280,7 +277,7 @@ type RestoredReverseSwap = {
|
|
|
280
277
|
from: "BTC";
|
|
281
278
|
type: "reverse";
|
|
282
279
|
createdAt: number;
|
|
283
|
-
preimageHash
|
|
280
|
+
preimageHash?: string;
|
|
284
281
|
status: BoltzSwapStatus;
|
|
285
282
|
claimDetails: Details;
|
|
286
283
|
invoice?: string;
|
|
@@ -309,6 +306,8 @@ declare class BoltzSwapProvider {
|
|
|
309
306
|
getFees(): Promise<FeesResponse>;
|
|
310
307
|
/** Returns current Lightning swap min/max limits from Boltz. */
|
|
311
308
|
getLimits(): Promise<LimitsResponse>;
|
|
309
|
+
/** Returns the current BTC chain tip height from Boltz. */
|
|
310
|
+
getChainHeight(): Promise<number>;
|
|
312
311
|
/** Gets the lockup transaction ID for a reverse swap. */
|
|
313
312
|
getReverseSwapTxId(id: string): Promise<GetReverseSwapTxIdResponse>;
|
|
314
313
|
/** Queries the current status of a swap by ID. */
|
|
@@ -81,6 +81,7 @@ type GetSwapStatusResponse = {
|
|
|
81
81
|
transaction?: {
|
|
82
82
|
id: string;
|
|
83
83
|
hex?: string;
|
|
84
|
+
confirmed?: boolean;
|
|
84
85
|
eta?: number;
|
|
85
86
|
preimage?: string;
|
|
86
87
|
};
|
|
@@ -96,16 +97,18 @@ type CreateSubmarineSwapRequest = {
|
|
|
96
97
|
type CreateSubmarineSwapResponse = {
|
|
97
98
|
/** Unique swap ID. */
|
|
98
99
|
id: string;
|
|
99
|
-
/** ARK lockup address to send funds to. */
|
|
100
|
-
address: string;
|
|
101
100
|
/** Amount in satoshis to send. */
|
|
102
101
|
expectedAmount: number;
|
|
102
|
+
/** ARK lockup address to send funds to. */
|
|
103
|
+
address?: string;
|
|
103
104
|
/** Boltz's public key for the claim path. */
|
|
104
|
-
claimPublicKey
|
|
105
|
+
claimPublicKey?: string;
|
|
105
106
|
/** Whether zero-conf transactions are accepted. */
|
|
106
|
-
acceptZeroConf
|
|
107
|
+
acceptZeroConf?: boolean;
|
|
108
|
+
/** Block height for the onchain HTLC timeout. */
|
|
109
|
+
timeoutBlockHeight?: number;
|
|
107
110
|
/** Block heights for various timeout/refund scenarios. */
|
|
108
|
-
timeoutBlockHeights
|
|
111
|
+
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
109
112
|
};
|
|
110
113
|
type GetSwapPreimageResponse = {
|
|
111
114
|
preimage: string;
|
|
@@ -128,13 +131,15 @@ type CreateReverseSwapResponse = {
|
|
|
128
131
|
/** BOLT11-encoded Lightning invoice to be paid. */
|
|
129
132
|
invoice: string;
|
|
130
133
|
/** On-chain amount in satoshis (after Boltz fees). */
|
|
131
|
-
onchainAmount
|
|
134
|
+
onchainAmount?: number;
|
|
132
135
|
/** ARK lockup address where Boltz will lock funds. */
|
|
133
|
-
lockupAddress
|
|
136
|
+
lockupAddress?: string;
|
|
134
137
|
/** Boltz's public key for the refund path. */
|
|
135
|
-
refundPublicKey
|
|
138
|
+
refundPublicKey?: string;
|
|
139
|
+
/** Block height for the onchain HTLC timeout. */
|
|
140
|
+
timeoutBlockHeight?: number;
|
|
136
141
|
/** Block heights for various timeout/refund scenarios. */
|
|
137
|
-
timeoutBlockHeights
|
|
142
|
+
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
138
143
|
};
|
|
139
144
|
type SwapTree = {
|
|
140
145
|
claimLeaf: {
|
|
@@ -223,10 +228,11 @@ type Leaf = {
|
|
|
223
228
|
type Tree = {
|
|
224
229
|
claimLeaf: Leaf;
|
|
225
230
|
refundLeaf: Leaf;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
covenantClaimLeaf?: Leaf;
|
|
232
|
+
refundWithoutBoltzLeaf?: Leaf;
|
|
233
|
+
unilateralClaimLeaf?: Leaf;
|
|
234
|
+
unilateralRefundLeaf?: Leaf;
|
|
235
|
+
unilateralRefundWithoutBoltzLeaf?: Leaf;
|
|
230
236
|
};
|
|
231
237
|
type Details = {
|
|
232
238
|
tree: Tree;
|
|
@@ -238,7 +244,7 @@ type Details = {
|
|
|
238
244
|
};
|
|
239
245
|
lockupAddress: string;
|
|
240
246
|
serverPublicKey: string;
|
|
241
|
-
timeoutBlockHeight
|
|
247
|
+
timeoutBlockHeight?: number;
|
|
242
248
|
timeoutBlockHeights?: TimeoutBlockHeights;
|
|
243
249
|
preimageHash?: string;
|
|
244
250
|
};
|
|
@@ -249,19 +255,10 @@ type RestoredChainSwap = {
|
|
|
249
255
|
createdAt: number;
|
|
250
256
|
from: "ARK" | "BTC";
|
|
251
257
|
to: "ARK" | "BTC";
|
|
252
|
-
preimageHash
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
lockupAddress: string;
|
|
257
|
-
serverPublicKey: string;
|
|
258
|
-
timeoutBlockHeight: number;
|
|
259
|
-
transaction?: {
|
|
260
|
-
id: string;
|
|
261
|
-
vout: number;
|
|
262
|
-
};
|
|
263
|
-
tree: Tree;
|
|
264
|
-
};
|
|
258
|
+
preimageHash?: string;
|
|
259
|
+
invoice?: string;
|
|
260
|
+
refundDetails?: Details;
|
|
261
|
+
claimDetails?: Details;
|
|
265
262
|
};
|
|
266
263
|
type RestoredSubmarineSwap = {
|
|
267
264
|
to: "BTC";
|
|
@@ -269,7 +266,7 @@ type RestoredSubmarineSwap = {
|
|
|
269
266
|
from: "ARK";
|
|
270
267
|
type: "submarine";
|
|
271
268
|
createdAt: number;
|
|
272
|
-
preimageHash
|
|
269
|
+
preimageHash?: string;
|
|
273
270
|
status: BoltzSwapStatus;
|
|
274
271
|
refundDetails: Details;
|
|
275
272
|
invoice?: string;
|
|
@@ -280,7 +277,7 @@ type RestoredReverseSwap = {
|
|
|
280
277
|
from: "BTC";
|
|
281
278
|
type: "reverse";
|
|
282
279
|
createdAt: number;
|
|
283
|
-
preimageHash
|
|
280
|
+
preimageHash?: string;
|
|
284
281
|
status: BoltzSwapStatus;
|
|
285
282
|
claimDetails: Details;
|
|
286
283
|
invoice?: string;
|
|
@@ -309,6 +306,8 @@ declare class BoltzSwapProvider {
|
|
|
309
306
|
getFees(): Promise<FeesResponse>;
|
|
310
307
|
/** Returns current Lightning swap min/max limits from Boltz. */
|
|
311
308
|
getLimits(): Promise<LimitsResponse>;
|
|
309
|
+
/** Returns the current BTC chain tip height from Boltz. */
|
|
310
|
+
getChainHeight(): Promise<number>;
|
|
312
311
|
/** Gets the lockup transaction ID for a reverse swap. */
|
|
313
312
|
getReverseSwapTxId(id: string): Promise<GetReverseSwapTxIdResponse>;
|
|
314
313
|
/** Queries the current status of a swap by ID. */
|