@atomiqlabs/sdk 8.3.1 → 8.3.6
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/bitcoin/coinselect2/utils.d.ts +6 -0
- package/dist/bitcoin/wallet/SingleAddressBitcoinWallet.d.ts +4 -0
- package/dist/bitcoin/wallet/SingleAddressBitcoinWallet.js +6 -0
- package/dist/enums/FeeType.d.ts +1 -1
- package/dist/enums/FeeType.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/intermediaries/Intermediary.d.ts +4 -4
- package/dist/intermediaries/Intermediary.js +1 -1
- package/dist/intermediaries/IntermediaryDiscovery.d.ts +7 -7
- package/dist/intermediaries/IntermediaryDiscovery.js +4 -2
- package/dist/prices/RedundantSwapPrice.d.ts +2 -2
- package/dist/prices/RedundantSwapPrice.js +1 -1
- package/dist/prices/SingleSwapPrice.d.ts +1 -1
- package/dist/prices/SingleSwapPrice.js +1 -1
- package/dist/prices/SwapPriceWithChain.d.ts +5 -6
- package/dist/prices/SwapPriceWithChain.js +6 -7
- package/dist/prices/abstract/IPriceProvider.d.ts +4 -4
- package/dist/prices/abstract/IPriceProvider.js +1 -1
- package/dist/prices/abstract/ISwapPrice.d.ts +1 -1
- package/dist/prices/abstract/ISwapPrice.js +1 -1
- package/dist/prices/providers/BinancePriceProvider.d.ts +1 -1
- package/dist/prices/providers/BinancePriceProvider.js +1 -1
- package/dist/prices/providers/CoinGeckoPriceProvider.d.ts +1 -1
- package/dist/prices/providers/CoinGeckoPriceProvider.js +1 -1
- package/dist/prices/providers/CoinPaprikaPriceProvider.d.ts +1 -1
- package/dist/prices/providers/CoinPaprikaPriceProvider.js +1 -1
- package/dist/prices/providers/CustomPriceProvider.d.ts +1 -1
- package/dist/prices/providers/CustomPriceProvider.js +1 -1
- package/dist/prices/providers/KrakenPriceProvider.d.ts +1 -1
- package/dist/prices/providers/KrakenPriceProvider.js +1 -1
- package/dist/prices/providers/OKXPriceProvider.d.ts +1 -1
- package/dist/prices/providers/OKXPriceProvider.js +1 -1
- package/dist/swapper/Swapper.d.ts +80 -7
- package/dist/swapper/Swapper.js +7 -5
- package/dist/swapper/SwapperFactory.d.ts +25 -1
- package/dist/swapper/SwapperFactory.js +1 -1
- package/dist/swaps/IAddressSwap.d.ts +2 -2
- package/dist/swaps/IAddressSwap.js +1 -1
- package/dist/swaps/IBTCWalletSwap.d.ts +2 -2
- package/dist/swaps/IBTCWalletSwap.js +1 -1
- package/dist/swaps/IClaimableSwap.d.ts +3 -3
- package/dist/swaps/IClaimableSwap.js +1 -1
- package/dist/swaps/IClaimableSwapWrapper.d.ts +1 -1
- package/dist/swaps/IRefundableSwap.d.ts +2 -2
- package/dist/swaps/IRefundableSwap.js +1 -1
- package/dist/swaps/ISwap.d.ts +3 -3
- package/dist/swaps/ISwap.js +2 -2
- package/dist/swaps/ISwapWithGasDrop.d.ts +2 -2
- package/dist/swaps/ISwapWithGasDrop.js +1 -1
- package/dist/swaps/ISwapWrapper.d.ts +4 -4
- package/dist/swaps/ISwapWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/IEscrowSelfInitSwap.d.ts +4 -2
- package/dist/swaps/escrow_swaps/IEscrowSelfInitSwap.js +1 -1
- package/dist/swaps/escrow_swaps/IEscrowSwap.d.ts +1 -1
- package/dist/swaps/escrow_swaps/IEscrowSwap.js +1 -1
- package/dist/swaps/escrow_swaps/IEscrowSwapWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/IEscrowSwapWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.d.ts +9 -5
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.js +5 -4
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.d.ts +6 -5
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.js +6 -5
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.d.ts +4 -3
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.js +4 -3
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.d.ts +18 -7
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.js +18 -7
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/tobtc/IToBTCSwap.d.ts +3 -7
- package/dist/swaps/escrow_swaps/tobtc/IToBTCSwap.js +3 -7
- package/dist/swaps/escrow_swaps/tobtc/IToBTCWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/tobtc/IToBTCWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.d.ts +1 -1
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.js +1 -1
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.js +1 -1
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.d.ts +1 -1
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.js +1 -1
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.d.ts +1 -1
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.js +1 -1
- package/dist/swaps/spv_swaps/SpvFromBTCSwap.d.ts +36 -10
- package/dist/swaps/spv_swaps/SpvFromBTCSwap.js +36 -10
- package/dist/swaps/spv_swaps/SpvFromBTCWrapper.d.ts +1 -1
- package/dist/swaps/spv_swaps/SpvFromBTCWrapper.js +7 -4
- package/dist/swaps/trusted/ln/LnForGasSwap.d.ts +2 -2
- package/dist/swaps/trusted/ln/LnForGasSwap.js +2 -2
- package/dist/swaps/trusted/ln/LnForGasWrapper.d.ts +1 -1
- package/dist/swaps/trusted/ln/LnForGasWrapper.js +1 -1
- package/dist/swaps/trusted/onchain/OnchainForGasSwap.d.ts +2 -2
- package/dist/swaps/trusted/onchain/OnchainForGasSwap.js +2 -2
- package/dist/swaps/trusted/onchain/OnchainForGasWrapper.d.ts +1 -1
- package/dist/swaps/trusted/onchain/OnchainForGasWrapper.js +1 -1
- package/dist/types/CustomPriceFunction.d.ts +1 -1
- package/dist/types/PriceInfoType.d.ts +4 -4
- package/dist/types/PriceInfoType.js +3 -3
- package/dist/types/SwapExecutionAction.d.ts +17 -6
- package/dist/types/SwapWithSigner.d.ts +1 -1
- package/dist/types/fees/Fee.d.ts +1 -1
- package/dist/types/fees/FeeBreakdown.d.ts +1 -1
- package/dist/types/fees/PercentagePPM.d.ts +2 -2
- package/dist/types/fees/PercentagePPM.js +1 -1
- package/dist/types/lnurl/LNURLPay.d.ts +6 -6
- package/dist/types/lnurl/LNURLPay.js +2 -2
- package/dist/types/lnurl/LNURLWithdraw.d.ts +5 -5
- package/dist/types/lnurl/LNURLWithdraw.js +2 -2
- package/dist/types/wallets/LightningInvoiceCreateService.d.ts +4 -0
- package/dist/types/wallets/MinimalLightningNetworkWalletInterface.d.ts +1 -1
- package/dist/utils/SwapUtils.d.ts +2 -0
- package/dist/utils/SwapUtils.js +2 -0
- package/package.json +1 -1
- package/src/bitcoin/coinselect2/utils.ts +6 -0
- package/src/bitcoin/wallet/SingleAddressBitcoinWallet.ts +7 -0
- package/src/enums/FeeType.ts +1 -1
- package/src/index.ts +6 -0
- package/src/intermediaries/Intermediary.ts +4 -4
- package/src/intermediaries/IntermediaryDiscovery.ts +9 -7
- package/src/prices/RedundantSwapPrice.ts +2 -2
- package/src/prices/SingleSwapPrice.ts +1 -1
- package/src/prices/SwapPriceWithChain.ts +6 -7
- package/src/prices/abstract/IPriceProvider.ts +4 -4
- package/src/prices/abstract/ISwapPrice.ts +1 -1
- package/src/prices/providers/BinancePriceProvider.ts +1 -1
- package/src/prices/providers/CoinGeckoPriceProvider.ts +1 -1
- package/src/prices/providers/CoinPaprikaPriceProvider.ts +1 -1
- package/src/prices/providers/CustomPriceProvider.ts +1 -1
- package/src/prices/providers/KrakenPriceProvider.ts +1 -1
- package/src/prices/providers/OKXPriceProvider.ts +1 -1
- package/src/swapper/Swapper.ts +88 -13
- package/src/swapper/SwapperFactory.ts +29 -3
- package/src/swaps/IAddressSwap.ts +2 -2
- package/src/swaps/IBTCWalletSwap.ts +2 -2
- package/src/swaps/IClaimableSwap.ts +3 -3
- package/src/swaps/IClaimableSwapWrapper.ts +1 -1
- package/src/swaps/IRefundableSwap.ts +2 -2
- package/src/swaps/ISwap.ts +3 -3
- package/src/swaps/ISwapWithGasDrop.ts +2 -2
- package/src/swaps/ISwapWrapper.ts +4 -4
- package/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts +4 -2
- package/src/swaps/escrow_swaps/IEscrowSwap.ts +1 -1
- package/src/swaps/escrow_swaps/IEscrowSwapWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts +9 -5
- package/src/swaps/escrow_swaps/frombtc/IFromBTCWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.ts +6 -5
- package/src/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts +4 -3
- package/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.ts +18 -7
- package/src/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts +3 -7
- package/src/swaps/escrow_swaps/tobtc/IToBTCWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts +1 -1
- package/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.ts +1 -1
- package/src/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.ts +1 -1
- package/src/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.ts +1 -1
- package/src/swaps/spv_swaps/SpvFromBTCSwap.ts +36 -10
- package/src/swaps/spv_swaps/SpvFromBTCWrapper.ts +7 -4
- package/src/swaps/trusted/ln/LnForGasSwap.ts +2 -2
- package/src/swaps/trusted/ln/LnForGasWrapper.ts +1 -1
- package/src/swaps/trusted/onchain/OnchainForGasSwap.ts +2 -2
- package/src/swaps/trusted/onchain/OnchainForGasWrapper.ts +1 -1
- package/src/types/CustomPriceFunction.ts +1 -1
- package/src/types/PriceInfoType.ts +4 -4
- package/src/types/SwapExecutionAction.ts +19 -6
- package/src/types/SwapWithSigner.ts +1 -1
- package/src/types/fees/Fee.ts +1 -1
- package/src/types/fees/FeeBreakdown.ts +1 -1
- package/src/types/fees/PercentagePPM.ts +2 -2
- package/src/types/lnurl/LNURLPay.ts +6 -6
- package/src/types/lnurl/LNURLWithdraw.ts +5 -5
- package/src/types/wallets/LightningInvoiceCreateService.ts +4 -0
- package/src/types/wallets/MinimalLightningNetworkWalletInterface.ts +1 -1
- package/src/utils/SwapUtils.ts +2 -0
|
@@ -2,7 +2,7 @@ import {toBigInt} from "../utils/Utils";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pricing information for swap validation
|
|
5
|
-
* @category Pricing
|
|
5
|
+
* @category Pricing
|
|
6
6
|
*/
|
|
7
7
|
export type PriceInfoType = {
|
|
8
8
|
isValid: boolean,
|
|
@@ -16,7 +16,7 @@ export type PriceInfoType = {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Type guard for PriceInfoType
|
|
19
|
-
* @category Pricing
|
|
19
|
+
* @category Pricing
|
|
20
20
|
*/
|
|
21
21
|
export function isPriceInfoType(obj: any): obj is PriceInfoType {
|
|
22
22
|
return obj != null &&
|
|
@@ -31,7 +31,7 @@ export function isPriceInfoType(obj: any): obj is PriceInfoType {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Serializes PriceInfoType for storage
|
|
34
|
-
* @category Pricing
|
|
34
|
+
* @category Pricing
|
|
35
35
|
*/
|
|
36
36
|
export function serializePriceInfoType(obj: PriceInfoType | undefined): any {
|
|
37
37
|
if (obj == null) return null;
|
|
@@ -48,7 +48,7 @@ export function serializePriceInfoType(obj: PriceInfoType | undefined): any {
|
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Deserializes PriceInfoType from storage
|
|
51
|
-
* @category Pricing
|
|
51
|
+
* @category Pricing
|
|
52
52
|
*/
|
|
53
53
|
export function deserializePriceInfoType(obj: any): PriceInfoType | undefined {
|
|
54
54
|
if (obj == null) return;
|
|
@@ -4,7 +4,7 @@ import {Transaction} from "@scure/btc-signer";
|
|
|
4
4
|
/**
|
|
5
5
|
* Swap execution action requiring a payment of the provided bolt11 lightning network invoice
|
|
6
6
|
*
|
|
7
|
-
* @category
|
|
7
|
+
* @category Swap Actions
|
|
8
8
|
*/
|
|
9
9
|
export type SwapExecutionActionLightning = {
|
|
10
10
|
name: "Payment",
|
|
@@ -24,7 +24,7 @@ export type SwapExecutionActionLightning = {
|
|
|
24
24
|
* - `"RAW_PSBT"` - Raw PSBT without the inputs, the implementor needs to add the input UTXOs before signing
|
|
25
25
|
* the transaction
|
|
26
26
|
*
|
|
27
|
-
* @category
|
|
27
|
+
* @category Swap Actions
|
|
28
28
|
*/
|
|
29
29
|
export type SwapExecutionActionBitcoin<
|
|
30
30
|
T extends "ADDRESS" | "FUNDED_PSBT" | "RAW_PSBT" = "ADDRESS" | "FUNDED_PSBT" | "RAW_PSBT"
|
|
@@ -55,7 +55,7 @@ export type SwapExecutionActionBitcoin<
|
|
|
55
55
|
/**
|
|
56
56
|
* Swap execution action for committing (initiating) the escrow on the smart chain side
|
|
57
57
|
*
|
|
58
|
-
* @category
|
|
58
|
+
* @category Swap Actions
|
|
59
59
|
*/
|
|
60
60
|
export type SwapExecutionActionCommit<T extends ChainType> = {
|
|
61
61
|
name: "Commit",
|
|
@@ -67,7 +67,7 @@ export type SwapExecutionActionCommit<T extends ChainType> = {
|
|
|
67
67
|
/**
|
|
68
68
|
* Swap execution action for claiming (settling) the swap on the smart chain side
|
|
69
69
|
*
|
|
70
|
-
* @category
|
|
70
|
+
* @category Swap Actions
|
|
71
71
|
*/
|
|
72
72
|
export type SwapExecutionActionClaim<T extends ChainType> = {
|
|
73
73
|
name: "Claim",
|
|
@@ -76,12 +76,25 @@ export type SwapExecutionActionClaim<T extends ChainType> = {
|
|
|
76
76
|
txs: T["TX"][]
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Swap execution action for refunding the swap on the smart chain side after it fails
|
|
81
|
+
*
|
|
82
|
+
* @category Swap Actions
|
|
83
|
+
*/
|
|
84
|
+
export type SwapExecutionActionRefund<T extends ChainType> = {
|
|
85
|
+
name: "Refund",
|
|
86
|
+
description: string,
|
|
87
|
+
chain: T["ChainId"],
|
|
88
|
+
txs: T["TX"][]
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
/**
|
|
80
92
|
* Swap execution action, a single step in the swapping process
|
|
81
93
|
*
|
|
82
|
-
* @category
|
|
94
|
+
* @category Swap Actions
|
|
83
95
|
*/
|
|
84
96
|
export type SwapExecutionAction<T extends ChainType> = SwapExecutionActionLightning |
|
|
85
97
|
SwapExecutionActionBitcoin |
|
|
86
98
|
SwapExecutionActionCommit<T> |
|
|
87
|
-
SwapExecutionActionClaim<T
|
|
99
|
+
SwapExecutionActionClaim<T> |
|
|
100
|
+
SwapExecutionActionRefund<T>;
|
|
@@ -9,7 +9,7 @@ import {SpvFromBTCSwap} from "../swaps/spv_swaps/SpvFromBTCSwap";
|
|
|
9
9
|
/**
|
|
10
10
|
* Proxy type that auto-injects a smart chain signer into swap methods
|
|
11
11
|
*
|
|
12
|
-
* @category Swaps
|
|
12
|
+
* @category Swaps/Base
|
|
13
13
|
*/
|
|
14
14
|
export type SwapWithSigner<T extends ISwap> = {
|
|
15
15
|
[K in keyof T]:
|
package/src/types/fees/Fee.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {Token} from "../Token";
|
|
|
6
6
|
* Fee represented in both, source and destination tokens, as well as providing USD valuation helpers and
|
|
7
7
|
* fee composition
|
|
8
8
|
*
|
|
9
|
-
* @category Pricing
|
|
9
|
+
* @category Pricing
|
|
10
10
|
*/
|
|
11
11
|
export type Fee<
|
|
12
12
|
ChainIdentifier extends string = string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parts-per-million fee representation with conversion helpers
|
|
3
3
|
*
|
|
4
|
-
* @category Pricing
|
|
4
|
+
* @category Pricing
|
|
5
5
|
*/
|
|
6
6
|
export type PercentagePPM = {
|
|
7
7
|
ppm: bigint,
|
|
@@ -13,7 +13,7 @@ export type PercentagePPM = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Converts parts-per-million to percentage representation
|
|
15
15
|
*
|
|
16
|
-
* @category Pricing
|
|
16
|
+
* @category Pricing
|
|
17
17
|
*/
|
|
18
18
|
export function ppmToPercentage(ppm: bigint): PercentagePPM {
|
|
19
19
|
const percentage = Number(ppm) / 10_000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Response of the LNURL-pay link
|
|
3
3
|
*
|
|
4
|
-
* @category
|
|
4
|
+
* @category Lightning
|
|
5
5
|
*/
|
|
6
6
|
export type LNURLPayParams = {
|
|
7
7
|
tag: "payRequest";
|
|
@@ -17,14 +17,14 @@ export type LNURLPayParams = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Response of the LNURL-pay link with the added original url
|
|
19
19
|
*
|
|
20
|
-
* @category
|
|
20
|
+
* @category Lightning
|
|
21
21
|
*/
|
|
22
22
|
export type LNURLPayParamsWithUrl = LNURLPayParams & { url: string };
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Parsed LNURL-pay specification
|
|
26
26
|
*
|
|
27
|
-
* @category
|
|
27
|
+
* @category Lightning
|
|
28
28
|
*/
|
|
29
29
|
export type LNURLPay = {
|
|
30
30
|
type: "pay",
|
|
@@ -40,7 +40,7 @@ export type LNURLPay = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Type guard for {@link LNURLPayParams}
|
|
42
42
|
*
|
|
43
|
-
* @category
|
|
43
|
+
* @category Lightning
|
|
44
44
|
* @internal
|
|
45
45
|
*/
|
|
46
46
|
export function isLNURLPayParams(obj: any): obj is LNURLPayParams {
|
|
@@ -50,7 +50,7 @@ export function isLNURLPayParams(obj: any): obj is LNURLPayParams {
|
|
|
50
50
|
/**
|
|
51
51
|
* Type guard for {@link LNURLPay}
|
|
52
52
|
*
|
|
53
|
-
* @category
|
|
53
|
+
* @category Lightning
|
|
54
54
|
* @internal
|
|
55
55
|
*/
|
|
56
56
|
export function isLNURLPay(value: any): value is LNURLPay {
|
|
@@ -71,7 +71,7 @@ export function isLNURLPay(value: any): value is LNURLPay {
|
|
|
71
71
|
/**
|
|
72
72
|
* Decoded LNURL-pay success action, revealed after a lightning payment is finished
|
|
73
73
|
*
|
|
74
|
-
* @category
|
|
74
|
+
* @category Lightning
|
|
75
75
|
*/
|
|
76
76
|
export type LNURLDecodedSuccessAction = {
|
|
77
77
|
description: string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Response of the LNURL-withdraw link
|
|
3
3
|
*
|
|
4
|
-
* @category
|
|
4
|
+
* @category Lightning
|
|
5
5
|
*/
|
|
6
6
|
export type LNURLWithdrawParams = {
|
|
7
7
|
tag: "withdrawRequest";
|
|
@@ -18,14 +18,14 @@ export type LNURLWithdrawParams = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Response of the LNURL-withdraw link with the added original url
|
|
20
20
|
*
|
|
21
|
-
* @category
|
|
21
|
+
* @category Lightning
|
|
22
22
|
*/
|
|
23
23
|
export type LNURLWithdrawParamsWithUrl = LNURLWithdrawParams & { url: string };
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Parsed LNURL-withdraw specification
|
|
27
27
|
*
|
|
28
|
-
* @category
|
|
28
|
+
* @category Lightning
|
|
29
29
|
*/
|
|
30
30
|
export type LNURLWithdraw = {
|
|
31
31
|
type: "withdraw",
|
|
@@ -37,7 +37,7 @@ export type LNURLWithdraw = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Type guard for {@link LNURLWithdraw}
|
|
39
39
|
*
|
|
40
|
-
* @category
|
|
40
|
+
* @category Lightning
|
|
41
41
|
* @internal
|
|
42
42
|
*/
|
|
43
43
|
export function isLNURLWithdraw(value: any): value is LNURLWithdraw {
|
|
@@ -54,7 +54,7 @@ export function isLNURLWithdraw(value: any): value is LNURLWithdraw {
|
|
|
54
54
|
/**
|
|
55
55
|
* Type guard for {@link LNURLWithdrawParams}
|
|
56
56
|
*
|
|
57
|
-
* @category
|
|
57
|
+
* @category Lightning
|
|
58
58
|
* @internal
|
|
59
59
|
*/
|
|
60
60
|
export function isLNURLWithdrawParams(obj: any): obj is LNURLWithdrawParams {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Invoice getter callback for the {@link LightningInvoiceCreateService}
|
|
3
|
+
*
|
|
4
|
+
* @category Lightning
|
|
3
5
|
*/
|
|
4
6
|
export type LightningWalletCallback = (valueSats: number, abortSignal?: AbortSignal) => Promise<string>;
|
|
5
7
|
/**
|
|
6
8
|
* Service that creates on-demand fixed amount bolt11 lightning network invoices, optionally
|
|
7
9
|
* specifying minimum and maximum swappable sats amount. This used for exact input Smart chain ->
|
|
8
10
|
* Lightning swaps.
|
|
11
|
+
*
|
|
12
|
+
* @category Lightning
|
|
9
13
|
*/
|
|
10
14
|
export type LightningInvoiceCreateService = {
|
|
11
15
|
getInvoice: LightningWalletCallback,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A type with minimum possible required functionality to be usable with lightning network swaps, i.e.
|
|
3
3
|
* a function to pay bolt11 lightning network invoices.
|
|
4
4
|
*
|
|
5
|
-
* @category
|
|
5
|
+
* @category Lightning
|
|
6
6
|
*/
|
|
7
7
|
export type MinimalLightningNetworkWalletInterface = {
|
|
8
8
|
payInvoice: (bolt11PaymentRequest: string) => Promise<string>
|
package/src/utils/SwapUtils.ts
CHANGED
|
@@ -49,6 +49,8 @@ export function isSwapType<T extends ChainType, S extends SwapType>(swap: ISwap<
|
|
|
49
49
|
* arbitrary transactions
|
|
50
50
|
* - `supportsGasDrop`: Whether a swap supports the "gas drop" feature, allowing to user to receive a small
|
|
51
51
|
* amount of native token as part of the swap when swapping to smart chains
|
|
52
|
+
*
|
|
53
|
+
* @category Core
|
|
52
54
|
*/
|
|
53
55
|
export const SwapProtocolInfo = {
|
|
54
56
|
[SwapType.TO_BTC]: {
|