@atomiqlabs/lp-lib 11.0.4 → 12.0.0-beta.0
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/info/InfoHandler.js +3 -12
- package/dist/plugins/IPlugin.d.ts +34 -35
- package/dist/plugins/IPlugin.js +7 -8
- package/dist/plugins/PluginManager.d.ts +29 -30
- package/dist/plugins/PluginManager.js +160 -188
- package/dist/prices/BinanceSwapPrice.d.ts +1 -2
- package/dist/prices/BinanceSwapPrice.js +56 -70
- package/dist/prices/CoinGeckoSwapPrice.d.ts +2 -3
- package/dist/prices/CoinGeckoSwapPrice.js +30 -42
- package/dist/prices/OKXSwapPrice.d.ts +1 -2
- package/dist/prices/OKXSwapPrice.js +56 -70
- package/dist/storage/IIntermediaryStorage.d.ts +8 -5
- package/dist/storagemanager/IntermediaryStorageManager.d.ts +8 -5
- package/dist/storagemanager/IntermediaryStorageManager.js +52 -61
- package/dist/storagemanager/StorageManager.js +42 -59
- package/dist/swaps/FromBtcBaseSwap.d.ts +7 -8
- package/dist/swaps/FromBtcBaseSwap.js +2 -3
- package/dist/swaps/FromBtcBaseSwapHandler.d.ts +44 -31
- package/dist/swaps/FromBtcBaseSwapHandler.js +217 -196
- package/dist/swaps/FromBtcLnBaseSwapHandler.d.ts +1 -2
- package/dist/swaps/FromBtcLnBaseSwapHandler.js +13 -24
- package/dist/swaps/ISwapPrice.d.ts +4 -5
- package/dist/swaps/ISwapPrice.js +8 -30
- package/dist/swaps/SwapHandler.d.ts +26 -15
- package/dist/swaps/SwapHandler.js +107 -66
- package/dist/swaps/SwapHandlerSwap.d.ts +22 -11
- package/dist/swaps/SwapHandlerSwap.js +32 -8
- package/dist/swaps/ToBtcBaseSwap.d.ts +16 -17
- package/dist/swaps/ToBtcBaseSwap.js +4 -4
- package/dist/swaps/ToBtcBaseSwapHandler.d.ts +17 -17
- package/dist/swaps/ToBtcBaseSwapHandler.js +140 -155
- package/dist/swaps/frombtc_abstract/FromBtcAbs.d.ts +8 -15
- package/dist/swaps/frombtc_abstract/FromBtcAbs.js +131 -196
- package/dist/swaps/frombtc_abstract/FromBtcSwapAbs.d.ts +3 -5
- package/dist/swaps/frombtc_abstract/FromBtcSwapAbs.js +4 -4
- package/dist/swaps/frombtc_trusted/FromBtcTrusted.d.ts +10 -8
- package/dist/swaps/frombtc_trusted/FromBtcTrusted.js +330 -362
- package/dist/swaps/frombtc_trusted/FromBtcTrustedSwap.d.ts +10 -10
- package/dist/swaps/frombtc_trusted/FromBtcTrustedSwap.js +7 -4
- package/dist/swaps/frombtcln_abstract/FromBtcLnAbs.d.ts +8 -8
- package/dist/swaps/frombtcln_abstract/FromBtcLnAbs.js +330 -400
- package/dist/swaps/frombtcln_abstract/FromBtcLnSwapAbs.d.ts +10 -4
- package/dist/swaps/frombtcln_abstract/FromBtcLnSwapAbs.js +36 -6
- package/dist/swaps/frombtcln_trusted/FromBtcLnTrusted.d.ts +8 -7
- package/dist/swaps/frombtcln_trusted/FromBtcLnTrusted.js +251 -273
- package/dist/swaps/frombtcln_trusted/FromBtcLnTrustedSwap.d.ts +5 -5
- package/dist/swaps/frombtcln_trusted/FromBtcLnTrustedSwap.js +7 -5
- package/dist/swaps/tobtc_abstract/ToBtcAbs.d.ts +13 -12
- package/dist/swaps/tobtc_abstract/ToBtcAbs.js +261 -323
- package/dist/swaps/tobtc_abstract/ToBtcSwapAbs.d.ts +4 -4
- package/dist/swaps/tobtc_abstract/ToBtcSwapAbs.js +7 -6
- package/dist/swaps/tobtcln_abstract/ToBtcLnAbs.d.ts +22 -21
- package/dist/swaps/tobtcln_abstract/ToBtcLnAbs.js +402 -453
- package/dist/swaps/tobtcln_abstract/ToBtcLnSwapAbs.d.ts +3 -2
- package/dist/swaps/tobtcln_abstract/ToBtcLnSwapAbs.js +10 -6
- package/dist/utils/Utils.d.ts +2 -3
- package/dist/utils/Utils.js +4 -14
- package/dist/utils/paramcoders/LegacyParamEncoder.js +3 -14
- package/dist/utils/paramcoders/ParamDecoder.js +53 -65
- package/dist/utils/paramcoders/SchemaVerifier.d.ts +4 -5
- package/dist/utils/paramcoders/SchemaVerifier.js +8 -9
- package/dist/utils/paramcoders/server/ServerParamDecoder.js +1 -1
- package/dist/utils/paramcoders/server/ServerParamEncoder.js +3 -14
- package/dist/wallets/IBitcoinWallet.d.ts +4 -5
- package/dist/wallets/ILightningWallet.d.ts +20 -21
- package/dist/wallets/ILightningWallet.js +1 -1
- package/package.json +4 -6
- package/src/plugins/IPlugin.ts +28 -29
- package/src/plugins/PluginManager.ts +21 -22
- package/src/prices/BinanceSwapPrice.ts +3 -4
- package/src/prices/CoinGeckoSwapPrice.ts +4 -5
- package/src/prices/OKXSwapPrice.ts +3 -4
- package/src/storage/IIntermediaryStorage.ts +4 -5
- package/src/storagemanager/IntermediaryStorageManager.ts +17 -9
- package/src/swaps/FromBtcBaseSwap.ts +9 -10
- package/src/swaps/FromBtcBaseSwapHandler.ts +133 -91
- package/src/swaps/FromBtcLnBaseSwapHandler.ts +2 -3
- package/src/swaps/ISwapPrice.ts +10 -20
- package/src/swaps/SwapHandler.ts +101 -35
- package/src/swaps/SwapHandlerSwap.ts +42 -17
- package/src/swaps/ToBtcBaseSwap.ts +20 -18
- package/src/swaps/ToBtcBaseSwapHandler.ts +33 -33
- package/src/swaps/frombtc_abstract/FromBtcAbs.ts +64 -97
- package/src/swaps/frombtc_abstract/FromBtcSwapAbs.ts +7 -8
- package/src/swaps/frombtc_trusted/FromBtcTrusted.ts +56 -55
- package/src/swaps/frombtc_trusted/FromBtcTrustedSwap.ts +28 -21
- package/src/swaps/frombtcln_abstract/FromBtcLnAbs.ts +81 -116
- package/src/swaps/frombtcln_abstract/FromBtcLnSwapAbs.ts +73 -9
- package/src/swaps/frombtcln_trusted/FromBtcLnTrusted.ts +39 -36
- package/src/swaps/frombtcln_trusted/FromBtcLnTrustedSwap.ts +26 -12
- package/src/swaps/tobtc_abstract/ToBtcAbs.ts +82 -98
- package/src/swaps/tobtc_abstract/ToBtcSwapAbs.ts +25 -20
- package/src/swaps/tobtcln_abstract/ToBtcLnAbs.ts +110 -118
- package/src/swaps/tobtcln_abstract/ToBtcLnSwapAbs.ts +17 -9
- package/src/utils/Utils.ts +3 -4
- package/src/utils/paramcoders/ParamDecoder.ts +5 -5
- package/src/utils/paramcoders/SchemaVerifier.ts +10 -11
- package/src/utils/paramcoders/server/ServerParamDecoder.ts +1 -1
- package/src/wallets/IBitcoinWallet.ts +4 -5
- package/src/wallets/ILightningWallet.ts +21 -22
package/dist/info/InfoHandler.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.InfoHandler = void 0;
|
|
13
4
|
const express = require("express");
|
|
@@ -28,7 +19,7 @@ class InfoHandler {
|
|
|
28
19
|
*/
|
|
29
20
|
startRestServer(restServer) {
|
|
30
21
|
restServer.use(this.path + "/info", express.json());
|
|
31
|
-
restServer.post(this.path + "/info", (req, res) =>
|
|
22
|
+
restServer.post(this.path + "/info", async (req, res) => {
|
|
32
23
|
if (req.body == null ||
|
|
33
24
|
req.body.nonce == null ||
|
|
34
25
|
typeof (req.body.nonce) !== "string" ||
|
|
@@ -53,7 +44,7 @@ class InfoHandler {
|
|
|
53
44
|
const singleChain = this.chainData.chains[chainIdentifier];
|
|
54
45
|
chains[chainIdentifier] = {
|
|
55
46
|
address: singleChain.signer.getAddress(),
|
|
56
|
-
signature:
|
|
47
|
+
signature: await singleChain.swapContract.getDataSignature(singleChain.signer, envelopeBuffer)
|
|
57
48
|
};
|
|
58
49
|
}
|
|
59
50
|
const defaults = chains[this.chainData.default];
|
|
@@ -64,7 +55,7 @@ class InfoHandler {
|
|
|
64
55
|
chains
|
|
65
56
|
};
|
|
66
57
|
res.status(200).json(response);
|
|
67
|
-
})
|
|
58
|
+
});
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
61
|
exports.InfoHandler = InfoHandler;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BitcoinRpc } from "@atomiqlabs/base";
|
|
2
2
|
import { FromBtcLnRequestType, FromBtcRequestType, ISwapPrice, MultichainData, RequestData, SwapHandler, ToBtcLnRequestType, ToBtcRequestType } from "..";
|
|
3
3
|
import { SwapHandlerSwap } from "../swaps/SwapHandlerSwap";
|
|
4
|
-
import * as BN from "bn.js";
|
|
5
4
|
import { Command } from "@atomiqlabs/server-base";
|
|
6
5
|
import { FromBtcLnTrustedRequestType } from "../swaps/frombtcln_trusted/FromBtcLnTrusted";
|
|
7
6
|
import { IBitcoinWallet } from "../wallets/IBitcoinWallet";
|
|
@@ -13,23 +12,23 @@ export type QuoteThrow = {
|
|
|
13
12
|
export declare function isQuoteThrow(obj: any): obj is QuoteThrow;
|
|
14
13
|
export type QuoteSetFees = {
|
|
15
14
|
type: "fees";
|
|
16
|
-
baseFee?:
|
|
17
|
-
feePPM?:
|
|
15
|
+
baseFee?: bigint;
|
|
16
|
+
feePPM?: bigint;
|
|
18
17
|
};
|
|
19
18
|
export declare function isQuoteSetFees(obj: any): obj is QuoteSetFees;
|
|
20
19
|
export type QuoteAmountTooLow = {
|
|
21
20
|
type: "low";
|
|
22
21
|
data: {
|
|
23
|
-
min:
|
|
24
|
-
max:
|
|
22
|
+
min: bigint;
|
|
23
|
+
max: bigint;
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
export declare function isQuoteAmountTooLow(obj: any): obj is QuoteAmountTooLow;
|
|
28
27
|
export type QuoteAmountTooHigh = {
|
|
29
28
|
type: "high";
|
|
30
29
|
data: {
|
|
31
|
-
min:
|
|
32
|
-
max:
|
|
30
|
+
min: bigint;
|
|
31
|
+
max: bigint;
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
export declare function isQuoteAmountTooHigh(obj: any): obj is QuoteAmountTooHigh;
|
|
@@ -37,18 +36,18 @@ export type PluginQuote = {
|
|
|
37
36
|
type: "success";
|
|
38
37
|
amount: {
|
|
39
38
|
input: boolean;
|
|
40
|
-
amount:
|
|
39
|
+
amount: bigint;
|
|
41
40
|
};
|
|
42
41
|
swapFee: {
|
|
43
|
-
inInputTokens:
|
|
44
|
-
inOutputTokens:
|
|
42
|
+
inInputTokens: bigint;
|
|
43
|
+
inOutputTokens: bigint;
|
|
45
44
|
};
|
|
46
45
|
};
|
|
47
46
|
export declare function isPluginQuote(obj: any): obj is PluginQuote;
|
|
48
47
|
export type ToBtcPluginQuote = PluginQuote & {
|
|
49
48
|
networkFee: {
|
|
50
|
-
inInputTokens:
|
|
51
|
-
inOutputTokens:
|
|
49
|
+
inInputTokens: bigint;
|
|
50
|
+
inOutputTokens: bigint;
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
53
|
export declare function isToBtcPluginQuote(obj: any): obj is ToBtcPluginQuote;
|
|
@@ -72,45 +71,45 @@ export interface IPlugin {
|
|
|
72
71
|
onSwapRemove?(swap: SwapHandlerSwap): Promise<void>;
|
|
73
72
|
onHandlePreFromBtcQuote?(request: RequestData<FromBtcLnRequestType | FromBtcRequestType | FromBtcLnTrustedRequestType>, requestedAmount: {
|
|
74
73
|
input: boolean;
|
|
75
|
-
amount:
|
|
74
|
+
amount: bigint;
|
|
76
75
|
}, chainIdentifier: string, token: string, constraints: {
|
|
77
|
-
minInBtc:
|
|
78
|
-
maxInBtc:
|
|
76
|
+
minInBtc: bigint;
|
|
77
|
+
maxInBtc: bigint;
|
|
79
78
|
}, fees: {
|
|
80
|
-
baseFeeInBtc:
|
|
81
|
-
feePPM:
|
|
79
|
+
baseFeeInBtc: bigint;
|
|
80
|
+
feePPM: bigint;
|
|
82
81
|
}): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh>;
|
|
83
82
|
onHandlePostFromBtcQuote?(request: RequestData<FromBtcLnRequestType | FromBtcRequestType | FromBtcLnTrustedRequestType>, requestedAmount: {
|
|
84
83
|
input: boolean;
|
|
85
|
-
amount:
|
|
84
|
+
amount: bigint;
|
|
86
85
|
}, chainIdentifier: string, token: string, constraints: {
|
|
87
|
-
minInBtc:
|
|
88
|
-
maxInBtc:
|
|
86
|
+
minInBtc: bigint;
|
|
87
|
+
maxInBtc: bigint;
|
|
89
88
|
}, fees: {
|
|
90
|
-
baseFeeInBtc:
|
|
91
|
-
feePPM:
|
|
92
|
-
}, pricePrefetchPromise?: Promise<
|
|
89
|
+
baseFeeInBtc: bigint;
|
|
90
|
+
feePPM: bigint;
|
|
91
|
+
}, pricePrefetchPromise?: Promise<bigint> | null): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh | PluginQuote>;
|
|
93
92
|
onHandlePreToBtcQuote?(request: RequestData<ToBtcLnRequestType | ToBtcRequestType>, requestedAmount: {
|
|
94
93
|
input: boolean;
|
|
95
|
-
amount:
|
|
94
|
+
amount: bigint;
|
|
96
95
|
}, chainIdentifier: string, token: string, constraints: {
|
|
97
|
-
minInBtc:
|
|
98
|
-
maxInBtc:
|
|
96
|
+
minInBtc: bigint;
|
|
97
|
+
maxInBtc: bigint;
|
|
99
98
|
}, fees: {
|
|
100
|
-
baseFeeInBtc:
|
|
101
|
-
feePPM:
|
|
99
|
+
baseFeeInBtc: bigint;
|
|
100
|
+
feePPM: bigint;
|
|
102
101
|
}): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh>;
|
|
103
102
|
onHandlePostToBtcQuote?(request: RequestData<ToBtcLnRequestType | ToBtcRequestType>, requestedAmount: {
|
|
104
103
|
input: boolean;
|
|
105
|
-
amount:
|
|
104
|
+
amount: bigint;
|
|
106
105
|
}, chainIdentifier: string, token: string, constraints: {
|
|
107
|
-
minInBtc:
|
|
108
|
-
maxInBtc:
|
|
106
|
+
minInBtc: bigint;
|
|
107
|
+
maxInBtc: bigint;
|
|
109
108
|
}, fees: {
|
|
110
|
-
baseFeeInBtc:
|
|
111
|
-
feePPM:
|
|
112
|
-
networkFeeGetter: (amount:
|
|
113
|
-
}, pricePrefetchPromise?: Promise<
|
|
109
|
+
baseFeeInBtc: bigint;
|
|
110
|
+
feePPM: bigint;
|
|
111
|
+
networkFeeGetter: (amount: bigint) => Promise<bigint>;
|
|
112
|
+
}, pricePrefetchPromise?: Promise<bigint> | null): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh | ToBtcPluginQuote>;
|
|
114
113
|
/**
|
|
115
114
|
* Returns whitelisted bitcoin txIds that are OK to spend even with 0-confs
|
|
116
115
|
*/
|
package/dist/plugins/IPlugin.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isToBtcPluginQuote = exports.isPluginQuote = exports.isQuoteAmountTooHigh = exports.isQuoteAmountTooLow = exports.isQuoteSetFees = exports.isQuoteThrow = void 0;
|
|
4
|
-
const BN = require("bn.js");
|
|
5
4
|
function isQuoteThrow(obj) {
|
|
6
5
|
return obj.type === "throw" && typeof (obj.message) === "string";
|
|
7
6
|
}
|
|
8
7
|
exports.isQuoteThrow = isQuoteThrow;
|
|
9
8
|
function isQuoteSetFees(obj) {
|
|
10
9
|
return obj.type === "fees" &&
|
|
11
|
-
(obj.baseFee == null ||
|
|
12
|
-
(obj.feePPM == null ||
|
|
10
|
+
(obj.baseFee == null || typeof (obj.baseFee) === "bigint") &&
|
|
11
|
+
(obj.feePPM == null || typeof (obj.feePPM) === "bigint");
|
|
13
12
|
}
|
|
14
13
|
exports.isQuoteSetFees = isQuoteSetFees;
|
|
15
14
|
function isQuoteAmountTooLow(obj) {
|
|
16
|
-
return obj.type === "low" && typeof (obj.data) === "object" &&
|
|
15
|
+
return obj.type === "low" && typeof (obj.data) === "object" && typeof (obj.data.min) === "bigint" && typeof (obj.data.max) === "bigint";
|
|
17
16
|
}
|
|
18
17
|
exports.isQuoteAmountTooLow = isQuoteAmountTooLow;
|
|
19
18
|
function isQuoteAmountTooHigh(obj) {
|
|
20
|
-
return obj.type === "high" && typeof (obj.data) === "object" &&
|
|
19
|
+
return obj.type === "high" && typeof (obj.data) === "object" && typeof (obj.data.min) === "bigint" && typeof (obj.data.max) === "bigint";
|
|
21
20
|
}
|
|
22
21
|
exports.isQuoteAmountTooHigh = isQuoteAmountTooHigh;
|
|
23
22
|
function isPluginQuote(obj) {
|
|
24
23
|
return obj.type === "success" &&
|
|
25
|
-
typeof (obj.amount) === "object" && typeof (obj.amount.input) === "boolean" &&
|
|
26
|
-
typeof (obj.swapFee) === "object" &&
|
|
24
|
+
typeof (obj.amount) === "object" && typeof (obj.amount.input) === "boolean" && typeof (obj.amount.amount) === "bigint" &&
|
|
25
|
+
typeof (obj.swapFee) === "object" && typeof (obj.swapFee.inInputTokens) === "bigint" && typeof (obj.swapFee.inOutputTokens) === "bigint";
|
|
27
26
|
}
|
|
28
27
|
exports.isPluginQuote = isPluginQuote;
|
|
29
28
|
function isToBtcPluginQuote(obj) {
|
|
30
|
-
return typeof (obj.networkFee) === "object" &&
|
|
29
|
+
return typeof (obj.networkFee) === "object" && typeof (obj.networkFee.inInputTokens) === "bigint" && typeof (obj.networkFee.inOutputTokens) === "bigint" &&
|
|
31
30
|
isPluginQuote(obj);
|
|
32
31
|
}
|
|
33
32
|
exports.isToBtcPluginQuote = isToBtcPluginQuote;
|
|
@@ -2,7 +2,6 @@ import { BitcoinRpc, SwapData } from "@atomiqlabs/base";
|
|
|
2
2
|
import { IPlugin, PluginQuote, QuoteAmountTooHigh, QuoteAmountTooLow, QuoteSetFees, QuoteThrow, ToBtcPluginQuote } from "./IPlugin";
|
|
3
3
|
import { FromBtcLnRequestType, FromBtcRequestType, ISwapPrice, MultichainData, RequestData, SwapHandler, ToBtcLnRequestType, ToBtcRequestType } from "..";
|
|
4
4
|
import { SwapHandlerSwap } from "../swaps/SwapHandlerSwap";
|
|
5
|
-
import * as BN from "bn.js";
|
|
6
5
|
import { FromBtcLnTrustedRequestType } from "../swaps/frombtcln_trusted/FromBtcLnTrusted";
|
|
7
6
|
import { IBitcoinWallet } from "../wallets/IBitcoinWallet";
|
|
8
7
|
import { ILightningWallet } from "../wallets/ILightningWallet";
|
|
@@ -13,14 +12,14 @@ export type FailSwapResponse = {
|
|
|
13
12
|
};
|
|
14
13
|
export type FeeSwapResponse = {
|
|
15
14
|
type: "fee";
|
|
16
|
-
baseFee:
|
|
17
|
-
feePPM:
|
|
15
|
+
baseFee: bigint;
|
|
16
|
+
feePPM: bigint;
|
|
18
17
|
};
|
|
19
18
|
export type AmountAndFeeSwapResponse = {
|
|
20
19
|
type: "amountAndFee";
|
|
21
|
-
baseFee?:
|
|
22
|
-
feePPM?:
|
|
23
|
-
amount:
|
|
20
|
+
baseFee?: bigint;
|
|
21
|
+
feePPM?: bigint;
|
|
22
|
+
amount: bigint;
|
|
24
23
|
};
|
|
25
24
|
export type SwapResponse = FailSwapResponse | FeeSwapResponse | AmountAndFeeSwapResponse;
|
|
26
25
|
export declare class PluginManager {
|
|
@@ -43,48 +42,48 @@ export declare class PluginManager {
|
|
|
43
42
|
static swapRemove<T extends SwapData>(swap: SwapHandlerSwap<T>): Promise<void>;
|
|
44
43
|
static onHandlePostFromBtcQuote(request: RequestData<FromBtcLnRequestType | FromBtcRequestType | FromBtcLnTrustedRequestType>, requestedAmount: {
|
|
45
44
|
input: boolean;
|
|
46
|
-
amount:
|
|
45
|
+
amount: bigint;
|
|
47
46
|
}, chainIdentifier: string, token: string, constraints: {
|
|
48
|
-
minInBtc:
|
|
49
|
-
maxInBtc:
|
|
47
|
+
minInBtc: bigint;
|
|
48
|
+
maxInBtc: bigint;
|
|
50
49
|
}, fees: {
|
|
51
|
-
baseFeeInBtc:
|
|
52
|
-
feePPM:
|
|
53
|
-
}, pricePrefetchPromise?: Promise<
|
|
50
|
+
baseFeeInBtc: bigint;
|
|
51
|
+
feePPM: bigint;
|
|
52
|
+
}, pricePrefetchPromise?: Promise<bigint> | null): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh | PluginQuote>;
|
|
54
53
|
static onHandlePreFromBtcQuote(request: RequestData<FromBtcLnRequestType | FromBtcRequestType | FromBtcLnTrustedRequestType>, requestedAmount: {
|
|
55
54
|
input: boolean;
|
|
56
|
-
amount:
|
|
55
|
+
amount: bigint;
|
|
57
56
|
}, chainIdentifier: string, token: string, constraints: {
|
|
58
|
-
minInBtc:
|
|
59
|
-
maxInBtc:
|
|
57
|
+
minInBtc: bigint;
|
|
58
|
+
maxInBtc: bigint;
|
|
60
59
|
}, fees: {
|
|
61
|
-
baseFeeInBtc:
|
|
62
|
-
feePPM:
|
|
60
|
+
baseFeeInBtc: bigint;
|
|
61
|
+
feePPM: bigint;
|
|
63
62
|
}): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh>;
|
|
64
63
|
static onHandlePostToBtcQuote<T extends {
|
|
65
|
-
networkFee:
|
|
64
|
+
networkFee: bigint;
|
|
66
65
|
}>(request: RequestData<ToBtcLnRequestType | ToBtcRequestType>, requestedAmount: {
|
|
67
66
|
input: boolean;
|
|
68
|
-
amount:
|
|
67
|
+
amount: bigint;
|
|
69
68
|
}, chainIdentifier: string, token: string, constraints: {
|
|
70
|
-
minInBtc:
|
|
71
|
-
maxInBtc:
|
|
69
|
+
minInBtc: bigint;
|
|
70
|
+
maxInBtc: bigint;
|
|
72
71
|
}, fees: {
|
|
73
|
-
baseFeeInBtc:
|
|
74
|
-
feePPM:
|
|
75
|
-
networkFeeGetter: (amount:
|
|
76
|
-
}, pricePrefetchPromise?: Promise<
|
|
72
|
+
baseFeeInBtc: bigint;
|
|
73
|
+
feePPM: bigint;
|
|
74
|
+
networkFeeGetter: (amount: bigint) => Promise<T>;
|
|
75
|
+
}, pricePrefetchPromise?: Promise<bigint> | null): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh | (ToBtcPluginQuote & {
|
|
77
76
|
networkFeeData: T;
|
|
78
77
|
})>;
|
|
79
78
|
static onHandlePreToBtcQuote(request: RequestData<ToBtcLnRequestType | ToBtcRequestType>, requestedAmount: {
|
|
80
79
|
input: boolean;
|
|
81
|
-
amount:
|
|
80
|
+
amount: bigint;
|
|
82
81
|
}, chainIdentifier: string, token: string, constraints: {
|
|
83
|
-
minInBtc:
|
|
84
|
-
maxInBtc:
|
|
82
|
+
minInBtc: bigint;
|
|
83
|
+
maxInBtc: bigint;
|
|
85
84
|
}, fees: {
|
|
86
|
-
baseFeeInBtc:
|
|
87
|
-
feePPM:
|
|
85
|
+
baseFeeInBtc: bigint;
|
|
86
|
+
feePPM: bigint;
|
|
88
87
|
}): Promise<QuoteThrow | QuoteSetFees | QuoteAmountTooLow | QuoteAmountTooHigh>;
|
|
89
88
|
static getWhitelistedTxIds(): Set<string>;
|
|
90
89
|
}
|