@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.
@@ -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 { isReverseFinalStatus as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, type SwapManagerEvents as E, type FeesResponse as F, type GetSwapStatusResponse as G, isChainClaimableStatus as H, type IncomingPaymentSubscription as I, isChainFailedStatus as J, isChainFinalStatus as K, type LimitsResponse as L, isChainPendingStatus as M, type Network as N, isChainRefundableStatus as O, type PendingChainSwap as P, isChainSignableStatus as Q, isChainSuccessStatus as R, type SendLightningPaymentRequest as S, isChainSwapClaimable as T, isChainSwapRefundable as U, type Vtxo as V, isPendingChainSwap as W, isPendingReverseSwap as X, isPendingSubmarineSwap as Y, isReverseClaimableStatus as Z, isReverseFailedStatus as _, type BoltzChainSwap as a, isReversePendingStatus as a0, isReverseSuccessStatus as a1, isReverseSwapClaimable as a2, isSubmarineFailedStatus as a3, isSubmarineFinalStatus as a4, isSubmarinePendingStatus as a5, isSubmarineRefundableStatus as a6, isSubmarineSuccessStatus as a7, isSubmarineSwapRefundable as a8, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type SubmarineRefundOutcome as g, type SubmarineRecoveryInfo as h, type SubmarineRecoveryResult as i, type ChainFeesResponse as j, type ArkToBtcResponse as k, type BtcToArkResponse as l, type ChainArkRefundOutcome as m, type SwapRepository as n, type SwapManagerClient 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 SubmarineRecoveryStatus as w, SwapManager as x, type SwapManagerCallbacks as y, type SwapManagerConfig as z };
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 { isReverseFinalStatus as $, type ArkadeSwapsConfig as A, type BoltzSwap as B, type CreateLightningInvoiceRequest as C, type DecodedInvoice as D, type SwapManagerEvents as E, type FeesResponse as F, type GetSwapStatusResponse as G, isChainClaimableStatus as H, type IncomingPaymentSubscription as I, isChainFailedStatus as J, isChainFinalStatus as K, type LimitsResponse as L, isChainPendingStatus as M, type Network as N, isChainRefundableStatus as O, type PendingChainSwap as P, isChainSignableStatus as Q, isChainSuccessStatus as R, type SendLightningPaymentRequest as S, isChainSwapClaimable as T, isChainSwapRefundable as U, type Vtxo as V, isPendingChainSwap as W, isPendingReverseSwap as X, isPendingSubmarineSwap as Y, isReverseClaimableStatus as Z, isReverseFailedStatus as _, type BoltzChainSwap as a, isReversePendingStatus as a0, isReverseSuccessStatus as a1, isReverseSwapClaimable as a2, isSubmarineFailedStatus as a3, isSubmarineFinalStatus as a4, isSubmarinePendingStatus as a5, isSubmarineRefundableStatus as a6, isSubmarineSuccessStatus as a7, isSubmarineSwapRefundable as a8, type BoltzReverseSwap as b, type BoltzSubmarineSwap as c, type Chain as d, type CreateLightningInvoiceResponse as e, type SendLightningPaymentResponse as f, type SubmarineRefundOutcome as g, type SubmarineRecoveryInfo as h, type SubmarineRecoveryResult as i, type ChainFeesResponse as j, type ArkToBtcResponse as k, type BtcToArkResponse as l, type ChainArkRefundOutcome as m, type SwapRepository as n, type SwapManagerClient 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 SubmarineRecoveryStatus as w, SwapManager as x, type SwapManagerCallbacks as y, type SwapManagerConfig as z };
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.40",
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.35"
79
+ "@arkade-os/sdk": "0.4.37"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "expo-task-manager": ">=3.0.0",