@arkade-os/boltz-swap 0.3.40 → 0.3.42
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/README.md +29 -0
- package/dist/{arkade-swaps-DnRiRcdW.d.ts → arkade-swaps-C3sUFr5f.d.cts} +59 -5
- package/dist/{arkade-swaps-CObmwpZQ.d.cts → arkade-swaps-LvsGHtre.d.ts} +59 -5
- package/dist/{chunk-WGLBFONB.js → chunk-CWY37W4B.js} +1 -1
- package/dist/{chunk-GYWMQOCP.js → chunk-UXYHW7KV.js} +138 -35
- package/dist/expo/background.cjs +137 -35
- package/dist/expo/background.d.cts +3 -3
- package/dist/expo/background.d.ts +3 -3
- package/dist/expo/background.js +2 -2
- package/dist/expo/index.cjs +140 -35
- package/dist/expo/index.d.cts +9 -5
- package/dist/expo/index.d.ts +9 -5
- package/dist/expo/index.js +5 -2
- package/dist/index.cjs +156 -35
- package/dist/index.d.cts +21 -9
- package/dist/index.d.ts +21 -9
- package/dist/index.js +20 -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/{swapsPollProcessor-BlyUrhtO.d.cts → swapsPollProcessor-CGMXUKPe.d.cts} +1 -1
- package/dist/{swapsPollProcessor-Bv4Z2R7g.d.ts → swapsPollProcessor-CuDM6sxV.d.ts} +1 -1
- package/dist/{types-D97i1LFu.d.cts → types-8NrCdOpS.d.cts} +51 -1
- package/dist/{types-D97i1LFu.d.ts → types-8NrCdOpS.d.ts} +51 -1
- package/package.json +2 -2
|
@@ -25,6 +25,27 @@ declare const isSubmarineFinalStatus: (status: BoltzSwapStatus) => boolean;
|
|
|
25
25
|
declare const isSubmarinePendingStatus: (status: BoltzSwapStatus) => boolean;
|
|
26
26
|
/** Returns true if the submarine swap is eligible for refund. */
|
|
27
27
|
declare const isSubmarineRefundableStatus: (status: BoltzSwapStatus) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Canonical progression of a successful submarine swap, in order. Failure
|
|
30
|
+
* statuses are intentionally absent. This defines relative ordering, NOT a
|
|
31
|
+
* guaranteed sequence: statuses can be skipped (e.g. "transaction.mempool"
|
|
32
|
+
* jumps straight to "invoice.pending" when Boltz accepts 0-conf, and a
|
|
33
|
+
* subscription only ever reports the current status). Consumers must treat
|
|
34
|
+
* any later status as implying the earlier ones — which is exactly what
|
|
35
|
+
* hasSubmarineStatusReached does.
|
|
36
|
+
*/
|
|
37
|
+
declare const SUBMARINE_STATUS_PROGRESSION: readonly ["swap.created", "invoice.set", "transaction.mempool", "transaction.confirmed", "invoice.pending", "invoice.paid", "transaction.claim.pending", "transaction.claimed"];
|
|
38
|
+
/**
|
|
39
|
+
* A status in the successful submarine swap progression — the only valid
|
|
40
|
+
* targets for optimistic settlement resolution.
|
|
41
|
+
*/
|
|
42
|
+
type SubmarineProgressionStatus = (typeof SUBMARINE_STATUS_PROGRESSION)[number];
|
|
43
|
+
/**
|
|
44
|
+
* Returns true if `status` is at or beyond `target` in the successful
|
|
45
|
+
* submarine swap progression. Returns false when the observed status is not
|
|
46
|
+
* part of the progression (e.g. failure statuses like "swap.expired").
|
|
47
|
+
*/
|
|
48
|
+
declare const hasSubmarineStatusReached: (status: BoltzSwapStatus, target: SubmarineProgressionStatus) => boolean;
|
|
28
49
|
/** Returns true if the submarine swap completed successfully. */
|
|
29
50
|
declare const isSubmarineSuccessStatus: (status: BoltzSwapStatus) => boolean;
|
|
30
51
|
/** Returns true if the reverse swap failed. */
|
|
@@ -914,6 +935,22 @@ interface CreateLightningInvoiceResponse {
|
|
|
914
935
|
interface SendLightningPaymentRequest {
|
|
915
936
|
/** BOLT11-encoded Lightning invoice to pay. */
|
|
916
937
|
invoice: string;
|
|
938
|
+
/**
|
|
939
|
+
* When the returned promise resolves (default "settled").
|
|
940
|
+
*
|
|
941
|
+
* - "settled": at the terminal "transaction.claimed" status, once Boltz
|
|
942
|
+
* has swept the HTLC. The preimage is included in the response.
|
|
943
|
+
* - "funded": optimistically, as soon as the lockup transaction is
|
|
944
|
+
* observed ("transaction.mempool" or any later status — statuses can be
|
|
945
|
+
* skipped since subscriptions report only the current one). The sender's
|
|
946
|
+
* funds are committed and the swap is refundable from this point, so
|
|
947
|
+
* most wallets show the payment as "sent" here. No preimage is available
|
|
948
|
+
* yet; monitoring continues in the background and keeps persisting
|
|
949
|
+
* status updates until a terminal status, but a late failure no longer
|
|
950
|
+
* rejects — keep the SwapManager enabled so refunds are handled
|
|
951
|
+
* automatically.
|
|
952
|
+
*/
|
|
953
|
+
waitFor?: "settled" | "funded";
|
|
917
954
|
}
|
|
918
955
|
/** Response after a successful Lightning payment. */
|
|
919
956
|
interface SendLightningPaymentResponse {
|
|
@@ -924,6 +961,19 @@ interface SendLightningPaymentResponse {
|
|
|
924
961
|
/** Transaction ID of the Arkade payment. */
|
|
925
962
|
txid: string;
|
|
926
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Response after a Lightning payment sent with `waitFor: "funded"` — the
|
|
966
|
+
* payment is in flight but may not be settled yet, so the preimage may not
|
|
967
|
+
* be available.
|
|
968
|
+
*/
|
|
969
|
+
interface OptimisticSendLightningPaymentResponse {
|
|
970
|
+
/** Amount paid in satoshis. */
|
|
971
|
+
amount: number;
|
|
972
|
+
/** Payment preimage (hex-encoded). Undefined when the call resolved before the swap settled. */
|
|
973
|
+
preimage?: string;
|
|
974
|
+
/** Transaction ID of the Arkade payment. */
|
|
975
|
+
txid: string;
|
|
976
|
+
}
|
|
927
977
|
/** Tracks an in-progress reverse swap (Lightning → Arkade). */
|
|
928
978
|
interface BoltzReverseSwap {
|
|
929
979
|
/** Unique swap ID from Boltz. */
|
|
@@ -1180,4 +1230,4 @@ interface ChainFeesResponse {
|
|
|
1180
1230
|
};
|
|
1181
1231
|
}
|
|
1182
1232
|
|
|
1183
|
-
export {
|
|
1233
|
+
export { isPendingSubmarineSwap as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, type SwapManagerConfig as E, type FeesResponse as F, type GetSwapStatusResponse as G, type SwapManagerEvents as H, type IncomingPaymentSubscription as I, hasSubmarineStatusReached as J, isChainClaimableStatus as K, type LimitsResponse as L, isChainFailedStatus as M, type Network as N, type OptimisticSendLightningPaymentResponse as O, type PendingChainSwap as P, isChainFinalStatus as Q, isChainPendingStatus as R, type SendLightningPaymentRequest as S, isChainRefundableStatus as T, isChainSignableStatus as U, type Vtxo as V, isChainSuccessStatus as W, isChainSwapClaimable as X, isChainSwapRefundable as Y, isPendingChainSwap as Z, isPendingReverseSwap as _, type BoltzChainSwap as a, isReverseClaimableStatus as a0, isReverseFailedStatus as a1, isReverseFinalStatus as a2, isReversePendingStatus as a3, isReverseSuccessStatus as a4, isReverseSwapClaimable as a5, isSubmarineFailedStatus as a6, isSubmarineFinalStatus as a7, isSubmarinePendingStatus as a8, isSubmarineRefundableStatus as a9, isSubmarineSuccessStatus as aa, isSubmarineSwapRefundable as ab, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SubmarineRefundOutcome as f, type SubmarineRecoveryInfo as g, type SubmarineRecoveryResult as h, type ChainFeesResponse as i, type ArkToBtcResponse as j, type BtcToArkResponse as k, type ChainArkRefundOutcome as l, type SwapRepository as m, type SwapManagerClient as n, type SendLightningPaymentResponse as o, type GetSwapsFilter as p, type ArkadeSwapsCreateConfig as q, BoltzSwapProvider as r, type BoltzSwapStatus as s, type PendingReverseSwap as t, type PendingSubmarineSwap as u, type PendingSwap as v, type SubmarineProgressionStatus as w, type SubmarineRecoveryStatus as x, SwapManager as y, type SwapManagerCallbacks as z };
|
|
@@ -25,6 +25,27 @@ declare const isSubmarineFinalStatus: (status: BoltzSwapStatus) => boolean;
|
|
|
25
25
|
declare const isSubmarinePendingStatus: (status: BoltzSwapStatus) => boolean;
|
|
26
26
|
/** Returns true if the submarine swap is eligible for refund. */
|
|
27
27
|
declare const isSubmarineRefundableStatus: (status: BoltzSwapStatus) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Canonical progression of a successful submarine swap, in order. Failure
|
|
30
|
+
* statuses are intentionally absent. This defines relative ordering, NOT a
|
|
31
|
+
* guaranteed sequence: statuses can be skipped (e.g. "transaction.mempool"
|
|
32
|
+
* jumps straight to "invoice.pending" when Boltz accepts 0-conf, and a
|
|
33
|
+
* subscription only ever reports the current status). Consumers must treat
|
|
34
|
+
* any later status as implying the earlier ones — which is exactly what
|
|
35
|
+
* hasSubmarineStatusReached does.
|
|
36
|
+
*/
|
|
37
|
+
declare const SUBMARINE_STATUS_PROGRESSION: readonly ["swap.created", "invoice.set", "transaction.mempool", "transaction.confirmed", "invoice.pending", "invoice.paid", "transaction.claim.pending", "transaction.claimed"];
|
|
38
|
+
/**
|
|
39
|
+
* A status in the successful submarine swap progression — the only valid
|
|
40
|
+
* targets for optimistic settlement resolution.
|
|
41
|
+
*/
|
|
42
|
+
type SubmarineProgressionStatus = (typeof SUBMARINE_STATUS_PROGRESSION)[number];
|
|
43
|
+
/**
|
|
44
|
+
* Returns true if `status` is at or beyond `target` in the successful
|
|
45
|
+
* submarine swap progression. Returns false when the observed status is not
|
|
46
|
+
* part of the progression (e.g. failure statuses like "swap.expired").
|
|
47
|
+
*/
|
|
48
|
+
declare const hasSubmarineStatusReached: (status: BoltzSwapStatus, target: SubmarineProgressionStatus) => boolean;
|
|
28
49
|
/** Returns true if the submarine swap completed successfully. */
|
|
29
50
|
declare const isSubmarineSuccessStatus: (status: BoltzSwapStatus) => boolean;
|
|
30
51
|
/** Returns true if the reverse swap failed. */
|
|
@@ -914,6 +935,22 @@ interface CreateLightningInvoiceResponse {
|
|
|
914
935
|
interface SendLightningPaymentRequest {
|
|
915
936
|
/** BOLT11-encoded Lightning invoice to pay. */
|
|
916
937
|
invoice: string;
|
|
938
|
+
/**
|
|
939
|
+
* When the returned promise resolves (default "settled").
|
|
940
|
+
*
|
|
941
|
+
* - "settled": at the terminal "transaction.claimed" status, once Boltz
|
|
942
|
+
* has swept the HTLC. The preimage is included in the response.
|
|
943
|
+
* - "funded": optimistically, as soon as the lockup transaction is
|
|
944
|
+
* observed ("transaction.mempool" or any later status — statuses can be
|
|
945
|
+
* skipped since subscriptions report only the current one). The sender's
|
|
946
|
+
* funds are committed and the swap is refundable from this point, so
|
|
947
|
+
* most wallets show the payment as "sent" here. No preimage is available
|
|
948
|
+
* yet; monitoring continues in the background and keeps persisting
|
|
949
|
+
* status updates until a terminal status, but a late failure no longer
|
|
950
|
+
* rejects — keep the SwapManager enabled so refunds are handled
|
|
951
|
+
* automatically.
|
|
952
|
+
*/
|
|
953
|
+
waitFor?: "settled" | "funded";
|
|
917
954
|
}
|
|
918
955
|
/** Response after a successful Lightning payment. */
|
|
919
956
|
interface SendLightningPaymentResponse {
|
|
@@ -924,6 +961,19 @@ interface SendLightningPaymentResponse {
|
|
|
924
961
|
/** Transaction ID of the Arkade payment. */
|
|
925
962
|
txid: string;
|
|
926
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Response after a Lightning payment sent with `waitFor: "funded"` — the
|
|
966
|
+
* payment is in flight but may not be settled yet, so the preimage may not
|
|
967
|
+
* be available.
|
|
968
|
+
*/
|
|
969
|
+
interface OptimisticSendLightningPaymentResponse {
|
|
970
|
+
/** Amount paid in satoshis. */
|
|
971
|
+
amount: number;
|
|
972
|
+
/** Payment preimage (hex-encoded). Undefined when the call resolved before the swap settled. */
|
|
973
|
+
preimage?: string;
|
|
974
|
+
/** Transaction ID of the Arkade payment. */
|
|
975
|
+
txid: string;
|
|
976
|
+
}
|
|
927
977
|
/** Tracks an in-progress reverse swap (Lightning → Arkade). */
|
|
928
978
|
interface BoltzReverseSwap {
|
|
929
979
|
/** Unique swap ID from Boltz. */
|
|
@@ -1180,4 +1230,4 @@ interface ChainFeesResponse {
|
|
|
1180
1230
|
};
|
|
1181
1231
|
}
|
|
1182
1232
|
|
|
1183
|
-
export {
|
|
1233
|
+
export { isPendingSubmarineSwap as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, type SwapManagerConfig as E, type FeesResponse as F, type GetSwapStatusResponse as G, type SwapManagerEvents as H, type IncomingPaymentSubscription as I, hasSubmarineStatusReached as J, isChainClaimableStatus as K, type LimitsResponse as L, isChainFailedStatus as M, type Network as N, type OptimisticSendLightningPaymentResponse as O, type PendingChainSwap as P, isChainFinalStatus as Q, isChainPendingStatus as R, type SendLightningPaymentRequest as S, isChainRefundableStatus as T, isChainSignableStatus as U, type Vtxo as V, isChainSuccessStatus as W, isChainSwapClaimable as X, isChainSwapRefundable as Y, isPendingChainSwap as Z, isPendingReverseSwap as _, type BoltzChainSwap as a, isReverseClaimableStatus as a0, isReverseFailedStatus as a1, isReverseFinalStatus as a2, isReversePendingStatus as a3, isReverseSuccessStatus as a4, isReverseSwapClaimable as a5, isSubmarineFailedStatus as a6, isSubmarineFinalStatus as a7, isSubmarinePendingStatus as a8, isSubmarineRefundableStatus as a9, isSubmarineSuccessStatus as aa, isSubmarineSwapRefundable as ab, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SubmarineRefundOutcome as f, type SubmarineRecoveryInfo as g, type SubmarineRecoveryResult as h, type ChainFeesResponse as i, type ArkToBtcResponse as j, type BtcToArkResponse as k, type ChainArkRefundOutcome as l, type SwapRepository as m, type SwapManagerClient as n, type SendLightningPaymentResponse as o, type GetSwapsFilter as p, type ArkadeSwapsCreateConfig as q, BoltzSwapProvider as r, type BoltzSwapStatus as s, type PendingReverseSwap as t, type PendingSubmarineSwap as u, type PendingSwap as v, type SubmarineProgressionStatus as w, type SubmarineRecoveryStatus as x, SwapManager as y, type SwapManagerCallbacks as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkade-os/boltz-swap",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A production-ready TypeScript package that brings Boltz submarine-swaps to Arkade.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@scure/btc-signer": "2.0.1",
|
|
77
77
|
"bip68": "1.0.4",
|
|
78
78
|
"light-bolt11-decoder": "3.2.0",
|
|
79
|
-
"@arkade-os/sdk": "0.4.
|
|
79
|
+
"@arkade-os/sdk": "0.4.37"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"expo-task-manager": ">=3.0.0",
|