@atomiqlabs/sdk 8.1.8 → 8.3.1
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/wallet/BitcoinWallet.d.ts +41 -5
- package/dist/bitcoin/wallet/BitcoinWallet.js +36 -1
- package/dist/bitcoin/wallet/IBitcoinWallet.d.ts +52 -2
- package/dist/bitcoin/wallet/IBitcoinWallet.js +2 -1
- package/dist/bitcoin/wallet/SingleAddressBitcoinWallet.d.ts +42 -7
- package/dist/bitcoin/wallet/SingleAddressBitcoinWallet.js +36 -1
- package/dist/enums/FeeType.d.ts +7 -0
- package/dist/enums/FeeType.js +7 -0
- package/dist/enums/SwapAmountType.d.ts +7 -0
- package/dist/enums/SwapAmountType.js +7 -0
- package/dist/enums/SwapDirection.d.ts +7 -0
- package/dist/enums/SwapDirection.js +7 -0
- package/dist/enums/SwapType.d.ts +62 -1
- package/dist/enums/SwapType.js +62 -1
- package/dist/errors/IntermediaryError.d.ts +4 -0
- package/dist/errors/IntermediaryError.js +1 -0
- package/dist/errors/RequestError.d.ts +15 -1
- package/dist/errors/RequestError.js +8 -0
- package/dist/errors/UserError.d.ts +1 -0
- package/dist/errors/UserError.js +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +3 -4
- package/dist/intermediaries/Intermediary.d.ts +57 -10
- package/dist/intermediaries/Intermediary.js +37 -10
- package/dist/intermediaries/IntermediaryDiscovery.d.ts +55 -22
- package/dist/intermediaries/IntermediaryDiscovery.js +35 -22
- package/dist/prices/RedundantSwapPrice.d.ts +24 -3
- package/dist/prices/RedundantSwapPrice.js +21 -1
- package/dist/prices/SingleSwapPrice.d.ts +9 -6
- package/dist/prices/SingleSwapPrice.js +10 -7
- package/dist/prices/SwapPriceWithChain.d.ts +54 -16
- package/dist/prices/SwapPriceWithChain.js +58 -20
- package/dist/prices/abstract/ISwapPrice.d.ts +94 -45
- package/dist/prices/abstract/ISwapPrice.js +103 -55
- package/dist/prices/providers/BinancePriceProvider.d.ts +7 -0
- package/dist/prices/providers/BinancePriceProvider.js +7 -0
- package/dist/prices/providers/CoinGeckoPriceProvider.d.ts +6 -0
- package/dist/prices/providers/CoinGeckoPriceProvider.js +6 -0
- package/dist/prices/providers/CoinPaprikaPriceProvider.d.ts +6 -0
- package/dist/prices/providers/CoinPaprikaPriceProvider.js +6 -0
- package/dist/prices/providers/CustomPriceProvider.d.ts +11 -0
- package/dist/prices/providers/CustomPriceProvider.js +11 -0
- package/dist/prices/providers/KrakenPriceProvider.d.ts +9 -0
- package/dist/prices/providers/KrakenPriceProvider.js +9 -0
- package/dist/prices/providers/OKXPriceProvider.d.ts +6 -0
- package/dist/prices/providers/OKXPriceProvider.js +6 -0
- package/dist/prices/providers/abstract/ExchangePriceProvider.d.ts +3 -0
- package/dist/prices/providers/abstract/ExchangePriceProvider.js +3 -0
- package/dist/storage/IUnifiedStorage.d.ts +19 -7
- package/dist/storage/UnifiedSwapStorage.d.ts +33 -3
- package/dist/storage/UnifiedSwapStorage.js +29 -1
- package/dist/storage-browser/IndexedDBUnifiedStorage.d.ts +31 -7
- package/dist/storage-browser/IndexedDBUnifiedStorage.js +29 -6
- package/dist/storage-browser/LocalStorageManager.d.ts +25 -1
- package/dist/storage-browser/LocalStorageManager.js +25 -1
- package/dist/swapper/Swapper.d.ts +302 -221
- package/dist/swapper/Swapper.js +376 -344
- package/dist/swapper/SwapperFactory.d.ts +41 -17
- package/dist/swapper/SwapperFactory.js +23 -2
- package/dist/swapper/SwapperUtils.d.ts +75 -28
- package/dist/swapper/SwapperUtils.js +107 -60
- package/dist/swapper/SwapperWithChain.d.ts +286 -91
- package/dist/swapper/SwapperWithChain.js +218 -64
- package/dist/swapper/SwapperWithSigner.d.ts +229 -80
- package/dist/swapper/SwapperWithSigner.js +190 -44
- package/dist/swaps/IAddressSwap.d.ts +10 -1
- package/dist/swaps/IAddressSwap.js +2 -1
- package/dist/swaps/IBTCWalletSwap.d.ts +24 -6
- package/dist/swaps/IBTCWalletSwap.js +2 -1
- package/dist/swaps/IClaimableSwap.d.ts +36 -4
- package/dist/swaps/IClaimableSwap.js +2 -1
- package/dist/swaps/IClaimableSwapWrapper.d.ts +11 -1
- package/dist/swaps/IRefundableSwap.d.ts +29 -3
- package/dist/swaps/IRefundableSwap.js +2 -1
- package/dist/swaps/ISwap.d.ts +159 -21
- package/dist/swaps/ISwap.js +90 -33
- package/dist/swaps/ISwapWithGasDrop.d.ts +6 -0
- package/dist/swaps/ISwapWithGasDrop.js +1 -0
- package/dist/swaps/ISwapWrapper.d.ts +157 -48
- package/dist/swaps/ISwapWrapper.js +130 -72
- package/dist/swaps/escrow_swaps/IEscrowSelfInitSwap.d.ts +49 -6
- package/dist/swaps/escrow_swaps/IEscrowSelfInitSwap.js +22 -12
- package/dist/swaps/escrow_swaps/IEscrowSwap.d.ts +65 -12
- package/dist/swaps/escrow_swaps/IEscrowSwap.js +38 -19
- package/dist/swaps/escrow_swaps/IEscrowSwapWrapper.d.ts +39 -9
- package/dist/swaps/escrow_swaps/IEscrowSwapWrapper.js +30 -21
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.d.ts +31 -15
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.js +33 -18
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.d.ts +94 -29
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.js +90 -27
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCWrapper.d.ts +22 -9
- package/dist/swaps/escrow_swaps/frombtc/IFromBTCWrapper.js +24 -11
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.d.ts +275 -58
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.js +516 -239
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.d.ts +76 -25
- package/dist/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.js +131 -49
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.d.ts +311 -51
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.js +542 -193
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.d.ts +87 -26
- package/dist/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.js +147 -58
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.d.ts +209 -53
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.js +449 -242
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.d.ts +77 -23
- package/dist/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.js +116 -46
- package/dist/swaps/escrow_swaps/tobtc/IToBTCSwap.d.ts +197 -56
- package/dist/swaps/escrow_swaps/tobtc/IToBTCSwap.js +326 -189
- package/dist/swaps/escrow_swaps/tobtc/IToBTCWrapper.d.ts +30 -5
- package/dist/swaps/escrow_swaps/tobtc/IToBTCWrapper.js +44 -19
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.d.ts +60 -19
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.js +74 -31
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.d.ts +76 -50
- package/dist/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.js +106 -101
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.d.ts +36 -13
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.js +65 -19
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.d.ts +46 -17
- package/dist/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.js +82 -27
- package/dist/swaps/spv_swaps/SpvFromBTCSwap.d.ts +328 -92
- package/dist/swaps/spv_swaps/SpvFromBTCSwap.js +460 -219
- package/dist/swaps/spv_swaps/SpvFromBTCWrapper.d.ts +76 -24
- package/dist/swaps/spv_swaps/SpvFromBTCWrapper.js +244 -124
- package/dist/swaps/trusted/ln/LnForGasSwap.d.ts +146 -18
- package/dist/swaps/trusted/ln/LnForGasSwap.js +173 -43
- package/dist/swaps/trusted/ln/LnForGasWrapper.d.ts +29 -10
- package/dist/swaps/trusted/ln/LnForGasWrapper.js +30 -11
- package/dist/swaps/trusted/onchain/OnchainForGasSwap.d.ts +200 -47
- package/dist/swaps/trusted/onchain/OnchainForGasSwap.js +230 -78
- package/dist/swaps/trusted/onchain/OnchainForGasWrapper.d.ts +34 -12
- package/dist/swaps/trusted/onchain/OnchainForGasWrapper.js +33 -14
- package/dist/types/AmountData.d.ts +2 -1
- package/dist/types/CustomPriceFunction.d.ts +7 -1
- package/dist/types/SwapExecutionAction.d.ts +74 -4
- package/dist/types/SwapWithSigner.d.ts +4 -1
- package/dist/types/SwapWithSigner.js +5 -2
- package/dist/types/Token.d.ts +11 -5
- package/dist/types/Token.js +6 -3
- package/dist/types/TokenAmount.d.ts +3 -0
- package/dist/types/TokenAmount.js +2 -0
- package/dist/types/fees/Fee.d.ts +2 -1
- package/dist/types/fees/FeeBreakdown.d.ts +2 -1
- package/dist/types/fees/PercentagePPM.d.ts +2 -0
- package/dist/types/fees/PercentagePPM.js +1 -0
- package/dist/types/lnurl/LNURLPay.d.ts +14 -6
- package/dist/types/lnurl/LNURLPay.js +6 -2
- package/dist/types/lnurl/LNURLWithdraw.d.ts +12 -5
- package/dist/types/lnurl/LNURLWithdraw.js +6 -2
- package/dist/types/wallets/LightningInvoiceCreateService.d.ts +20 -0
- package/dist/types/wallets/LightningInvoiceCreateService.js +15 -0
- package/dist/types/wallets/MinimalBitcoinWalletInterface.d.ts +3 -1
- package/dist/types/wallets/MinimalLightningNetworkWalletInterface.d.ts +3 -1
- package/dist/utils/BitcoinUtils.d.ts +1 -0
- package/dist/utils/BitcoinUtils.js +5 -1
- package/dist/utils/SwapUtils.d.ts +56 -1
- package/dist/utils/SwapUtils.js +53 -1
- package/dist/utils/TokenUtils.d.ts +10 -2
- package/dist/utils/TokenUtils.js +12 -4
- package/package.json +3 -3
- package/src/bitcoin/wallet/BitcoinWallet.ts +41 -5
- package/src/bitcoin/wallet/IBitcoinWallet.ts +57 -2
- package/src/bitcoin/wallet/SingleAddressBitcoinWallet.ts +42 -6
- package/src/enums/FeeType.ts +7 -0
- package/src/enums/SwapAmountType.ts +7 -0
- package/src/enums/SwapDirection.ts +7 -0
- package/src/enums/SwapType.ts +62 -2
- package/src/errors/IntermediaryError.ts +4 -0
- package/src/errors/RequestError.ts +15 -1
- package/src/errors/UserError.ts +1 -0
- package/src/index.ts +6 -5
- package/src/intermediaries/Intermediary.ts +57 -10
- package/src/intermediaries/IntermediaryDiscovery.ts +60 -27
- package/src/prices/RedundantSwapPrice.ts +24 -4
- package/src/prices/SingleSwapPrice.ts +10 -7
- package/src/prices/SwapPriceWithChain.ts +59 -21
- package/src/prices/abstract/ISwapPrice.ts +114 -65
- package/src/prices/providers/BinancePriceProvider.ts +7 -0
- package/src/prices/providers/CoinGeckoPriceProvider.ts +6 -0
- package/src/prices/providers/CoinPaprikaPriceProvider.ts +6 -0
- package/src/prices/providers/CustomPriceProvider.ts +11 -0
- package/src/prices/providers/KrakenPriceProvider.ts +9 -0
- package/src/prices/providers/OKXPriceProvider.ts +6 -0
- package/src/prices/providers/abstract/ExchangePriceProvider.ts +3 -0
- package/src/storage/IUnifiedStorage.ts +19 -7
- package/src/storage/UnifiedSwapStorage.ts +33 -3
- package/src/storage-browser/IndexedDBUnifiedStorage.ts +31 -8
- package/src/storage-browser/LocalStorageManager.ts +25 -1
- package/src/swapper/Swapper.ts +512 -378
- package/src/swapper/SwapperFactory.ts +44 -21
- package/src/swapper/SwapperUtils.ts +107 -60
- package/src/swapper/SwapperWithChain.ts +320 -81
- package/src/swapper/SwapperWithSigner.ts +263 -56
- package/src/swaps/IAddressSwap.ts +11 -1
- package/src/swaps/IBTCWalletSwap.ts +24 -8
- package/src/swaps/IClaimableSwap.ts +39 -4
- package/src/swaps/IClaimableSwapWrapper.ts +11 -2
- package/src/swaps/IRefundableSwap.ts +32 -3
- package/src/swaps/ISwap.ts +221 -82
- package/src/swaps/ISwapWithGasDrop.ts +6 -0
- package/src/swaps/ISwapWrapper.ts +212 -94
- package/src/swaps/escrow_swaps/IEscrowSelfInitSwap.ts +62 -18
- package/src/swaps/escrow_swaps/IEscrowSwap.ts +83 -37
- package/src/swaps/escrow_swaps/IEscrowSwapWrapper.ts +61 -30
- package/src/swaps/escrow_swaps/frombtc/IFromBTCLNWrapper.ts +37 -19
- package/src/swaps/escrow_swaps/frombtc/IFromBTCSelfInitSwap.ts +120 -51
- package/src/swaps/escrow_swaps/frombtc/IFromBTCWrapper.ts +24 -11
- package/src/swaps/escrow_swaps/frombtc/ln/FromBTCLNSwap.ts +559 -256
- package/src/swaps/escrow_swaps/frombtc/ln/FromBTCLNWrapper.ts +155 -61
- package/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap.ts +590 -226
- package/src/swaps/escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper.ts +177 -74
- package/src/swaps/escrow_swaps/frombtc/onchain/FromBTCSwap.ts +470 -243
- package/src/swaps/escrow_swaps/frombtc/onchain/FromBTCWrapper.ts +141 -59
- package/src/swaps/escrow_swaps/tobtc/IToBTCSwap.ts +352 -193
- package/src/swaps/escrow_swaps/tobtc/IToBTCWrapper.ts +48 -23
- package/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNSwap.ts +86 -39
- package/src/swaps/escrow_swaps/tobtc/ln/ToBTCLNWrapper.ts +110 -110
- package/src/swaps/escrow_swaps/tobtc/onchain/ToBTCSwap.ts +88 -33
- package/src/swaps/escrow_swaps/tobtc/onchain/ToBTCWrapper.ts +101 -31
- package/src/swaps/spv_swaps/SpvFromBTCSwap.ts +534 -263
- package/src/swaps/spv_swaps/SpvFromBTCWrapper.ts +289 -148
- package/src/swaps/trusted/ln/LnForGasSwap.ts +184 -45
- package/src/swaps/trusted/ln/LnForGasWrapper.ts +34 -15
- package/src/swaps/trusted/onchain/OnchainForGasSwap.ts +260 -86
- package/src/swaps/trusted/onchain/OnchainForGasWrapper.ts +41 -19
- package/src/types/AmountData.ts +2 -1
- package/src/types/CustomPriceFunction.ts +7 -1
- package/src/types/SwapExecutionAction.ts +84 -5
- package/src/types/SwapWithSigner.ts +7 -3
- package/src/types/Token.ts +12 -5
- package/src/types/TokenAmount.ts +3 -0
- package/src/types/fees/Fee.ts +2 -1
- package/src/types/fees/FeeBreakdown.ts +2 -1
- package/src/types/fees/PercentagePPM.ts +2 -0
- package/src/types/lnurl/LNURLPay.ts +14 -6
- package/src/types/lnurl/LNURLWithdraw.ts +12 -5
- package/src/types/wallets/LightningInvoiceCreateService.ts +26 -0
- package/src/types/wallets/MinimalBitcoinWalletInterface.ts +3 -1
- package/src/types/wallets/MinimalLightningNetworkWalletInterface.ts +3 -1
- package/src/utils/BitcoinUtils.ts +5 -0
- package/src/utils/SwapUtils.ts +61 -1
- package/src/utils/TokenUtils.ts +12 -4
- package/dist/bitcoin/BitcoinRpcWithAddressIndex.d.ts +0 -68
- package/dist/bitcoin/BitcoinRpcWithAddressIndex.js +0 -2
- package/dist/bitcoin/LightningNetworkApi.d.ts +0 -12
- package/dist/bitcoin/LightningNetworkApi.js +0 -2
- package/dist/bitcoin/mempool/MempoolApi.d.ts +0 -350
- package/dist/bitcoin/mempool/MempoolApi.js +0 -311
- package/dist/bitcoin/mempool/MempoolBitcoinBlock.d.ts +0 -44
- package/dist/bitcoin/mempool/MempoolBitcoinBlock.js +0 -48
- package/dist/bitcoin/mempool/MempoolBitcoinRpc.d.ts +0 -119
- package/dist/bitcoin/mempool/MempoolBitcoinRpc.js +0 -361
- package/dist/bitcoin/mempool/synchronizer/MempoolBtcRelaySynchronizer.d.ts +0 -22
- package/dist/bitcoin/mempool/synchronizer/MempoolBtcRelaySynchronizer.js +0 -105
- package/dist/errors/PaymentAuthError.d.ts +0 -11
- package/dist/errors/PaymentAuthError.js +0 -23
- package/src/errors/PaymentAuthError.ts +0 -26
|
@@ -14,83 +14,219 @@ import { BtcToken, SCToken } from "../../../../types/Token";
|
|
|
14
14
|
import { LoggerType } from "../../../../utils/Logger";
|
|
15
15
|
import { LNURLWithdraw } from "../../../../types/lnurl/LNURLWithdraw";
|
|
16
16
|
/**
|
|
17
|
-
* State enum for
|
|
17
|
+
* State enum for legacy Lightning -> Smart chain swaps
|
|
18
18
|
* @category Swaps
|
|
19
19
|
*/
|
|
20
20
|
export declare enum FromBTCLNSwapState {
|
|
21
|
+
/**
|
|
22
|
+
* Swap has failed as the user didn't settle the HTLC on the destination before expiration
|
|
23
|
+
*/
|
|
21
24
|
FAILED = -4,
|
|
25
|
+
/**
|
|
26
|
+
* Swap has expired for good and there is no way how it can be executed anymore
|
|
27
|
+
*/
|
|
22
28
|
QUOTE_EXPIRED = -3,
|
|
29
|
+
/**
|
|
30
|
+
* A swap is almost expired, and it should be presented to the user as expired, though
|
|
31
|
+
* there is still a chance that it will be processed
|
|
32
|
+
*/
|
|
23
33
|
QUOTE_SOFT_EXPIRED = -2,
|
|
34
|
+
/**
|
|
35
|
+
* Swap HTLC on the destination chain has expired, it is not safe anymore to settle (claim) the
|
|
36
|
+
* swap on the destination smart chain.
|
|
37
|
+
*/
|
|
24
38
|
EXPIRED = -1,
|
|
39
|
+
/**
|
|
40
|
+
* Swap quote was created, use {@link FromBTCLNSwap.getAddress} or {@link FromBTCLNSwap.getHyperlink}
|
|
41
|
+
* to get the bolt11 lightning network invoice to pay to initiate the swap, then use the
|
|
42
|
+
* {@link FromBTCLNSwap.waitForPayment} to wait till the lightning network payment is received
|
|
43
|
+
* by the intermediary (LP)
|
|
44
|
+
*/
|
|
25
45
|
PR_CREATED = 0,
|
|
46
|
+
/**
|
|
47
|
+
* Lightning network payment has been received by the intermediary (LP), the user can now settle
|
|
48
|
+
* the swap on the destination smart chain side with {@link FromBTCLNSwap.commitAndClaim} (if
|
|
49
|
+
* the underlying chain supports it - check with {@link FromBTCLNSwap.canCommitAndClaimInOneShot}),
|
|
50
|
+
* or by calling {@link FromBTCLNSwap.commit} and {@link FromBTCLNSwap.claim} separately.
|
|
51
|
+
*/
|
|
26
52
|
PR_PAID = 1,
|
|
53
|
+
/**
|
|
54
|
+
* Swap escrow HTLC has been created on the destination chain. Continue by claiming it with the
|
|
55
|
+
* {@link FromBTCLNSwap.claim} or {@link FromBTCLNSwap.txsClaim} function.
|
|
56
|
+
*/
|
|
27
57
|
CLAIM_COMMITED = 2,
|
|
58
|
+
/**
|
|
59
|
+
* Swap successfully settled and funds received on the destination chain
|
|
60
|
+
*/
|
|
28
61
|
CLAIM_CLAIMED = 3
|
|
29
62
|
}
|
|
30
63
|
export type FromBTCLNSwapInit<T extends SwapData> = IEscrowSelfInitSwapInit<T> & {
|
|
31
|
-
pr
|
|
32
|
-
secret
|
|
64
|
+
pr?: string;
|
|
65
|
+
secret?: string;
|
|
33
66
|
initialSwapData: T;
|
|
34
67
|
lnurl?: string;
|
|
35
68
|
lnurlK1?: string;
|
|
36
69
|
lnurlCallback?: string;
|
|
37
70
|
};
|
|
38
71
|
export declare function isFromBTCLNSwapInit<T extends SwapData>(obj: any): obj is FromBTCLNSwapInit<T>;
|
|
72
|
+
/**
|
|
73
|
+
* Legacy escrow (HTLC) based swap for Bitcoin Lightning -> Smart chains, requires manual settlement
|
|
74
|
+
* of the swap on the destination network once the lightning network payment is received by the LP.
|
|
75
|
+
*
|
|
76
|
+
* @category Swaps
|
|
77
|
+
*/
|
|
39
78
|
export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFromBTCSelfInitSwap<T, FromBTCLNDefinition<T>, FromBTCLNSwapState> implements IAddressSwap, IClaimableSwap<T, FromBTCLNDefinition<T>, FromBTCLNSwapState> {
|
|
79
|
+
protected readonly TYPE = SwapType.FROM_BTCLN;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
40
83
|
protected readonly logger: LoggerType;
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
41
87
|
protected readonly inputToken: BtcToken<true>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
88
|
+
private readonly lnurlFailSignal;
|
|
89
|
+
private readonly usesClaimHashAsId;
|
|
90
|
+
private readonly initialSwapData;
|
|
91
|
+
/**
|
|
92
|
+
* In case the swap is recovered from on-chain data, the pr saved here is just a payment hash,
|
|
93
|
+
* as it is impossible to retrieve the actual lightning network invoice paid purely from on-chain
|
|
94
|
+
* data
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
private pr?;
|
|
98
|
+
private secret?;
|
|
99
|
+
private lnurl?;
|
|
100
|
+
private lnurlK1?;
|
|
101
|
+
private lnurlCallback?;
|
|
102
|
+
private prPosted?;
|
|
103
|
+
/**
|
|
104
|
+
* Sets the LNURL data for the swap
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
_setLNURLData(lnurl: string, lnurlK1: string, lnurlCallback: string): void;
|
|
52
109
|
constructor(wrapper: FromBTCLNWrapper<T>, init: FromBTCLNSwapInit<T["Data"]>);
|
|
53
110
|
constructor(wrapper: FromBTCLNWrapper<T>, obj: any);
|
|
111
|
+
/**
|
|
112
|
+
* @inheritDoc
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
protected getSwapData(): T["Data"];
|
|
116
|
+
/**
|
|
117
|
+
* @inheritDoc
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
54
120
|
protected upgradeVersion(): void;
|
|
121
|
+
/**
|
|
122
|
+
* @inheritDoc
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
55
125
|
protected getIdentifierHash(): Buffer;
|
|
56
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Returns the payment hash of the swap and lightning network invoice, or `null` if not known (i.e. if
|
|
128
|
+
* the swap was recovered from on-chain data, the payment hash might not be known)
|
|
129
|
+
*
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
protected getPaymentHash(): Buffer | null;
|
|
133
|
+
/**
|
|
134
|
+
* @inheritDoc
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
57
137
|
protected canCommit(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* @inheritDoc
|
|
140
|
+
*/
|
|
58
141
|
getInputAddress(): string | null;
|
|
59
|
-
getInputTxId(): string;
|
|
60
142
|
/**
|
|
61
|
-
*
|
|
143
|
+
* @inheritDoc
|
|
144
|
+
*/
|
|
145
|
+
getInputTxId(): string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the lightning network BOLT11 invoice that needs to be paid as an input to the swap.
|
|
148
|
+
*
|
|
149
|
+
* In case the swap is recovered from on-chain data, the address returned might be just a payment hash,
|
|
150
|
+
* as it is impossible to retrieve the actual lightning network invoice paid purely from on-chain
|
|
151
|
+
* data.
|
|
62
152
|
*/
|
|
63
153
|
getAddress(): string;
|
|
154
|
+
/**
|
|
155
|
+
* In case the swap is recovered from on-chain data, the address returned might be just a payment hash,
|
|
156
|
+
* as it is impossible to retrieve the actual lightning network invoice paid purely from on-chain
|
|
157
|
+
* data.
|
|
158
|
+
*
|
|
159
|
+
* @inheritDoc
|
|
160
|
+
*/
|
|
64
161
|
getHyperlink(): string;
|
|
65
162
|
/**
|
|
66
163
|
* Returns the timeout time (in UNIX milliseconds) when the swap will definitelly be considered as expired
|
|
67
164
|
* if the LP doesn't make it expired sooner
|
|
68
165
|
*/
|
|
69
166
|
getDefinitiveExpiryTime(): number;
|
|
167
|
+
/**
|
|
168
|
+
* Returns timeout time (in UNIX milliseconds) when the swap htlc will expire
|
|
169
|
+
*/
|
|
170
|
+
getHtlcTimeoutTime(): number | null;
|
|
70
171
|
/**
|
|
71
172
|
* Returns timeout time (in UNIX milliseconds) when the LN invoice will expire
|
|
72
173
|
*/
|
|
73
174
|
getTimeoutTime(): number;
|
|
74
175
|
/**
|
|
75
|
-
*
|
|
176
|
+
* @inheritDoc
|
|
76
177
|
*/
|
|
77
|
-
getHtlcTimeoutTime(): number;
|
|
78
178
|
isFinished(): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* @inheritDoc
|
|
181
|
+
*/
|
|
79
182
|
isClaimable(): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* @inheritDoc
|
|
185
|
+
*/
|
|
80
186
|
isSuccessful(): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* @inheritDoc
|
|
189
|
+
*/
|
|
81
190
|
isFailed(): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* @inheritDoc
|
|
193
|
+
*/
|
|
82
194
|
isQuoteExpired(): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* @inheritDoc
|
|
197
|
+
*/
|
|
83
198
|
isQuoteSoftExpired(): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* @inheritDoc
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
84
203
|
_verifyQuoteDefinitelyExpired(): Promise<boolean>;
|
|
85
|
-
|
|
204
|
+
/**
|
|
205
|
+
* @inheritDoc
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
208
|
+
_verifyQuoteValid(): Promise<boolean>;
|
|
209
|
+
/**
|
|
210
|
+
* @inheritDoc
|
|
211
|
+
*/
|
|
86
212
|
getInputToken(): BtcToken<true>;
|
|
213
|
+
/**
|
|
214
|
+
* @inheritDoc
|
|
215
|
+
*/
|
|
87
216
|
getInput(): TokenAmount<T["ChainId"], BtcToken<true>>;
|
|
217
|
+
/**
|
|
218
|
+
* @inheritDoc
|
|
219
|
+
*/
|
|
88
220
|
getSmartChainNetworkFee(): Promise<TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>>;
|
|
221
|
+
/**
|
|
222
|
+
* @inheritDoc
|
|
223
|
+
*/
|
|
89
224
|
hasEnoughForTxFees(): Promise<{
|
|
90
225
|
enoughBalance: boolean;
|
|
91
226
|
balance: TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>;
|
|
92
227
|
required: TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>;
|
|
93
228
|
}>;
|
|
229
|
+
private isValidSecretPreimage;
|
|
94
230
|
/**
|
|
95
231
|
* Executes the swap with the provided bitcoin lightning network wallet or LNURL
|
|
96
232
|
*
|
|
@@ -101,6 +237,8 @@ export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFro
|
|
|
101
237
|
* link, wallet is not required and the LN invoice can be paid externally as well (just pass null or undefined here)
|
|
102
238
|
* @param callbacks Callbacks to track the progress of the swap
|
|
103
239
|
* @param options Optional options for the swap like feeRate, AbortSignal, and timeouts/intervals
|
|
240
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
241
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
104
242
|
*/
|
|
105
243
|
execute(dstSigner: T["Signer"] | T["NativeSigner"], walletOrLnurlWithdraw?: MinimalLightningNetworkWalletInterface | LNURLWithdraw | string | null | undefined, callbacks?: {
|
|
106
244
|
onSourceTransactionReceived?: (sourceTxId: string) => void;
|
|
@@ -111,14 +249,25 @@ export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFro
|
|
|
111
249
|
abortSignal?: AbortSignal;
|
|
112
250
|
lightningTxCheckIntervalSeconds?: number;
|
|
113
251
|
delayBetweenCommitAndClaimSeconds?: number;
|
|
114
|
-
}): Promise<void>;
|
|
252
|
+
}, secret?: string): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
* @inheritDoc
|
|
255
|
+
*
|
|
256
|
+
* @param options
|
|
257
|
+
* @param options.skipChecks Skip checks like making sure init signature is still valid and swap
|
|
258
|
+
* wasn't commited yet (this is handled on swap creation, if you commit right after quoting, you
|
|
259
|
+
* can use `skipChecks=true`)
|
|
260
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
261
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
262
|
+
*/
|
|
115
263
|
txsExecute(options?: {
|
|
116
264
|
skipChecks?: boolean;
|
|
117
|
-
}): Promise<{
|
|
265
|
+
}, secret?: string): Promise<{
|
|
118
266
|
name: "Payment";
|
|
119
267
|
description: string;
|
|
120
|
-
chain:
|
|
268
|
+
chain: "LIGHTNING";
|
|
121
269
|
txs: {
|
|
270
|
+
type: "BOLT11_PAYMENT_REQUEST";
|
|
122
271
|
address: string;
|
|
123
272
|
hyperlink: string;
|
|
124
273
|
}[];
|
|
@@ -137,6 +286,8 @@ export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFro
|
|
|
137
286
|
* Checks whether the LP received the LN payment and we can continue by committing & claiming the HTLC on-chain
|
|
138
287
|
*
|
|
139
288
|
* @param save If the new swap state should be saved
|
|
289
|
+
*
|
|
290
|
+
* @internal
|
|
140
291
|
*/
|
|
141
292
|
_checkIntermediaryPaymentReceived(save?: boolean): Promise<boolean | null>;
|
|
142
293
|
/**
|
|
@@ -145,108 +296,142 @@ export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFro
|
|
|
145
296
|
* @param signer Smart chain signer's address initiating the swap
|
|
146
297
|
* @param data Parsed swap data as returned by the intermediary
|
|
147
298
|
* @param signature Signature data as returned by the intermediary
|
|
148
|
-
*
|
|
299
|
+
*
|
|
149
300
|
* @throws {IntermediaryError} If the returned are not valid
|
|
150
301
|
* @throws {SignatureVerificationError} If the returned signature is not valid
|
|
151
302
|
* @throws {Error} If the swap is already committed on-chain
|
|
303
|
+
*
|
|
304
|
+
* @internal
|
|
152
305
|
*/
|
|
153
306
|
protected checkIntermediaryReturnedAuthData(signer: string, data: T["Data"], signature: SignatureData): Promise<void>;
|
|
154
307
|
/**
|
|
155
|
-
* Waits till
|
|
308
|
+
* Waits till a lightning network payment is received by the intermediary and client
|
|
309
|
+
* can continue by initiating (committing) & settling (claiming) the HTLC by calling
|
|
310
|
+
* either the {@link commitAndClaim} function (if the underlying chain allows commit
|
|
311
|
+
* and claim in a single transaction - check with {@link canCommitAndClaimInOneShot}).
|
|
312
|
+
* Or call {@link commit} and then {@link claim} separately.
|
|
313
|
+
*
|
|
314
|
+
* If this swap is using an LNURL-withdraw link as input, it automatically posts the
|
|
315
|
+
* generated invoice to the LNURL service to pay it.
|
|
156
316
|
*
|
|
157
317
|
* @param onPaymentReceived Callback as for when the LP reports having received the ln payment
|
|
158
318
|
* @param abortSignal Abort signal to stop waiting for payment
|
|
159
|
-
* @param checkIntervalSeconds How often to poll the intermediary for answer
|
|
319
|
+
* @param checkIntervalSeconds How often to poll the intermediary for answer (default 5 seconds)
|
|
160
320
|
*/
|
|
161
321
|
waitForPayment(onPaymentReceived?: (txId: string) => void, checkIntervalSeconds?: number, abortSignal?: AbortSignal): Promise<boolean>;
|
|
162
322
|
/**
|
|
163
|
-
*
|
|
323
|
+
* @inheritDoc
|
|
164
324
|
*
|
|
165
|
-
* @param _signer Signer to sign the transactions with, must be the same as used in the initialization
|
|
166
|
-
* @param abortSignal Abort signal to stop waiting for the transaction confirmation and abort
|
|
167
|
-
* @param skipChecks Skip checks like making sure init signature is still valid and swap wasn't commited yet
|
|
168
|
-
* (this is handled when swap is created (quoted), if you commit right after quoting, you can use skipChecks=true)
|
|
169
|
-
* @param onBeforeTxSent
|
|
170
325
|
* @throws {Error} If invalid signer is provided that doesn't match the swap data
|
|
171
326
|
*/
|
|
172
327
|
commit(_signer: T["Signer"] | T["NativeSigner"], abortSignal?: AbortSignal, skipChecks?: boolean, onBeforeTxSent?: (txId: string) => void): Promise<string>;
|
|
328
|
+
/**
|
|
329
|
+
* @inheritDoc
|
|
330
|
+
*/
|
|
173
331
|
waitTillCommited(abortSignal?: AbortSignal): Promise<void>;
|
|
174
332
|
/**
|
|
175
333
|
* Unsafe txs claim getter without state checking!
|
|
176
334
|
*
|
|
177
335
|
* @param _signer
|
|
178
|
-
* @
|
|
336
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
337
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
338
|
+
*
|
|
339
|
+
* @internal
|
|
179
340
|
*/
|
|
180
341
|
private _txsClaim;
|
|
181
342
|
/**
|
|
182
|
-
*
|
|
183
|
-
* (hash preimage)
|
|
343
|
+
* @inheritDoc
|
|
184
344
|
*
|
|
185
345
|
* @param _signer Optional signer address to use for claiming the swap, can also be different from the initializer
|
|
186
|
-
* @
|
|
346
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
347
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
348
|
+
*
|
|
349
|
+
* @throws {Error} If in invalid state (must be {@link FromBTCLNSwapState.CLAIM_COMMITED})
|
|
187
350
|
*/
|
|
188
|
-
txsClaim(_signer?: T["Signer"] | T["NativeSigner"]): Promise<T["TX"][]>;
|
|
351
|
+
txsClaim(_signer?: T["Signer"] | T["NativeSigner"], secret?: string): Promise<T["TX"][]>;
|
|
189
352
|
/**
|
|
190
|
-
*
|
|
353
|
+
* @inheritDoc
|
|
191
354
|
*
|
|
192
|
-
* @param _signer
|
|
193
|
-
* @param abortSignal
|
|
355
|
+
* @param _signer
|
|
356
|
+
* @param abortSignal
|
|
194
357
|
* @param onBeforeTxSent
|
|
358
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
359
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
195
360
|
*/
|
|
196
|
-
claim(_signer: T["Signer"] | T["NativeSigner"], abortSignal?: AbortSignal, onBeforeTxSent?: (txId: string) => void): Promise<string>;
|
|
361
|
+
claim(_signer: T["Signer"] | T["NativeSigner"], abortSignal?: AbortSignal, onBeforeTxSent?: (txId: string) => void, secret?: string): Promise<string>;
|
|
197
362
|
/**
|
|
198
|
-
*
|
|
363
|
+
* @inheritDoc
|
|
199
364
|
*
|
|
200
|
-
* @
|
|
201
|
-
* @param abortSignal AbortSignal
|
|
202
|
-
* @throws {Error} If swap is in invalid state (must be BTC_TX_CONFIRMED)
|
|
365
|
+
* @throws {Error} If swap is in invalid state (must be {@link FromBTCLNSwapState.CLAIM_COMMITED})
|
|
203
366
|
* @throws {Error} If the LP refunded sooner than we were able to claim
|
|
204
367
|
* @returns {boolean} whether the swap was claimed in time or not
|
|
205
368
|
*/
|
|
206
369
|
waitTillClaimed(maxWaitTimeSeconds?: number, abortSignal?: AbortSignal): Promise<boolean>;
|
|
207
370
|
/**
|
|
208
|
-
* Estimated transaction fee for commit & claim
|
|
371
|
+
* Estimated transaction fee for commit & claim transactions combined, required
|
|
372
|
+
* to settle the swap on the smart chain destination side.
|
|
373
|
+
*/
|
|
374
|
+
getCommitAndClaimNetworkFee(): Promise<TokenAmount<T["ChainId"], SCToken<T["ChainId"]>, true>>;
|
|
375
|
+
/**
|
|
376
|
+
* Returns whether the underlying chain supports calling commit and claim in a single call,
|
|
377
|
+
* such that you can use the {@link commitAndClaim} function. If not you have to manually
|
|
378
|
+
* call {@link commit} first and then {@link claim}.
|
|
209
379
|
*/
|
|
210
|
-
getCommitAndClaimFee(): Promise<bigint>;
|
|
211
380
|
canCommitAndClaimInOneShot(): boolean;
|
|
212
381
|
/**
|
|
213
382
|
* Returns transactions for both commit & claim operation together, such that they can be signed all at once by
|
|
214
|
-
* the wallet.
|
|
383
|
+
* the wallet. **WARNING**: transactions must be sent sequentially, such that the claim (2nd) transaction is only
|
|
215
384
|
* sent after the commit (1st) transaction confirms. Failure to do so can reveal the HTLC pre-image too soon,
|
|
216
|
-
* opening a possibility for the LP to steal funds
|
|
385
|
+
* opening a possibility for the LP to steal funds!
|
|
217
386
|
*
|
|
218
387
|
* @param skipChecks Skip checks like making sure init signature is still valid and swap wasn't commited yet
|
|
219
388
|
* (this is handled when swap is created (quoted), if you commit right after quoting, you can use skipChecks=true)
|
|
389
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
390
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
220
391
|
*
|
|
221
392
|
* @throws {Error} If in invalid state (must be PR_PAID or CLAIM_COMMITED)
|
|
222
393
|
*/
|
|
223
|
-
txsCommitAndClaim(skipChecks?: boolean): Promise<T["TX"][]>;
|
|
394
|
+
txsCommitAndClaim(skipChecks?: boolean, secret?: string): Promise<T["TX"][]>;
|
|
224
395
|
/**
|
|
225
|
-
* Commits and claims the swap, in a way that the transactions can be signed together by the
|
|
226
|
-
* then sent sequentially
|
|
396
|
+
* Commits and claims the swap, in a way that the transactions can be signed together by the provided signer and
|
|
397
|
+
* then automatically sent sequentially by the SDK. To check if the underlying chain supports this flow check
|
|
398
|
+
* the {@link canCommitAndClaimInOneShot} function.
|
|
227
399
|
*
|
|
228
400
|
* @param _signer Signer to sign the transactions with, must be the same as used in the initialization
|
|
229
401
|
* @param abortSignal Abort signal to stop waiting for the transaction confirmation and abort
|
|
230
402
|
* @param skipChecks Skip checks like making sure init signature is still valid and swap wasn't commited yet
|
|
231
403
|
* (this is handled when swap is created (quoted), if you commit right after quoting, you can use skipChecks=true)
|
|
232
|
-
* @param onBeforeCommitTxSent
|
|
233
|
-
*
|
|
404
|
+
* @param onBeforeCommitTxSent Optional callback called before the initialization (commit) transaction is
|
|
405
|
+
* broadcasted
|
|
406
|
+
* @param onBeforeClaimTxSent Optional callback called before the settlement (claim) transaction is
|
|
407
|
+
* broadcasted
|
|
408
|
+
* @param secret A swap secret to use for the claim transaction, generally only needed if the swap
|
|
409
|
+
* was recovered from on-chain data, or the pre-image was generated outside the SDK
|
|
410
|
+
*
|
|
234
411
|
* @throws {Error} If in invalid state (must be PR_PAID or CLAIM_COMMITED)
|
|
235
412
|
* @throws {Error} If invalid signer is provided that doesn't match the swap data
|
|
236
413
|
*/
|
|
237
|
-
commitAndClaim(_signer: T["Signer"] | T["NativeSigner"], abortSignal?: AbortSignal, skipChecks?: boolean, onBeforeCommitTxSent?: (txId: string) => void, onBeforeClaimTxSent?: (txId: string) => void): Promise<string[]>;
|
|
414
|
+
commitAndClaim(_signer: T["Signer"] | T["NativeSigner"], abortSignal?: AbortSignal, skipChecks?: boolean, onBeforeCommitTxSent?: (txId: string) => void, onBeforeClaimTxSent?: (txId: string) => void, secret?: string): Promise<string[]>;
|
|
238
415
|
/**
|
|
239
|
-
*
|
|
416
|
+
* Whether this swap uses an LNURL-withdraw link
|
|
240
417
|
*/
|
|
241
418
|
isLNURL(): boolean;
|
|
242
419
|
/**
|
|
243
|
-
* Gets the used LNURL or null if this is not an LNURL-withdraw swap
|
|
420
|
+
* Gets the used LNURL or `null` if this is not an LNURL-withdraw swap
|
|
244
421
|
*/
|
|
245
422
|
getLNURL(): string | null;
|
|
246
423
|
/**
|
|
247
|
-
* Pay the generated lightning network invoice with LNURL-withdraw
|
|
424
|
+
* Pay the generated lightning network invoice with an LNURL-withdraw link, this
|
|
425
|
+
* is useful when you want to display a lightning payment QR code and also want to
|
|
426
|
+
* allow payments using LNURL-withdraw NFC cards.
|
|
427
|
+
*
|
|
428
|
+
* Note that the swap needs to be created **without** an LNURL to begin with for this function
|
|
429
|
+
* to work. If this swap is already using an LNURL-withdraw link, this function throws.
|
|
248
430
|
*/
|
|
249
431
|
settleWithLNURLWithdraw(lnurl: string | LNURLWithdraw): Promise<void>;
|
|
432
|
+
/**
|
|
433
|
+
* @inheritDoc
|
|
434
|
+
*/
|
|
250
435
|
serialize(): any;
|
|
251
436
|
/**
|
|
252
437
|
* Checks the swap's state on-chain and compares it to its internal state, updates/changes it according to on-chain
|
|
@@ -255,9 +440,41 @@ export declare class FromBTCLNSwap<T extends ChainType = ChainType> extends IFro
|
|
|
255
440
|
* @private
|
|
256
441
|
*/
|
|
257
442
|
private syncStateFromChain;
|
|
443
|
+
/**
|
|
444
|
+
* @inheritDoc
|
|
445
|
+
* @internal
|
|
446
|
+
*/
|
|
258
447
|
_shouldFetchExpiryStatus(): boolean;
|
|
259
|
-
|
|
448
|
+
/**
|
|
449
|
+
* @inheritDoc
|
|
450
|
+
* @internal
|
|
451
|
+
*/
|
|
452
|
+
_shouldFetchOnchainState(): boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Whether an intermediary (LP) should be contacted to get the state of this swap.
|
|
455
|
+
*
|
|
456
|
+
* @internal
|
|
457
|
+
*/
|
|
260
458
|
_shouldCheckIntermediary(): boolean;
|
|
459
|
+
/**
|
|
460
|
+
* @inheritDoc
|
|
461
|
+
* @internal
|
|
462
|
+
*/
|
|
261
463
|
_sync(save?: boolean, quoteDefinitelyExpired?: boolean, commitStatus?: SwapCommitState, skipLpCheck?: boolean): Promise<boolean>;
|
|
464
|
+
/**
|
|
465
|
+
* @inheritDoc
|
|
466
|
+
* @internal
|
|
467
|
+
*/
|
|
468
|
+
_forciblySetOnchainState(commitStatus: SwapCommitState): Promise<boolean>;
|
|
469
|
+
/**
|
|
470
|
+
* @inheritDoc
|
|
471
|
+
* @internal
|
|
472
|
+
*/
|
|
262
473
|
_tick(save?: boolean): Promise<boolean>;
|
|
474
|
+
/**
|
|
475
|
+
* Forcibly sets the swap secret pre-image from on-chain data
|
|
476
|
+
*
|
|
477
|
+
* @internal
|
|
478
|
+
*/
|
|
479
|
+
_setSwapSecret(secret: string): void;
|
|
263
480
|
}
|