@xchainjs/xchain-thorchain-query 2.0.0 → 2.0.2
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/lib/index.esm.js +4 -4
- package/lib/index.js +4 -4
- package/lib/thorchain-query.d.ts +1 -1
- package/lib/types.d.ts +1 -0
- package/lib/utils/thornode.d.ts +1 -1
- package/package.json +4 -4
package/lib/index.esm.js
CHANGED
|
@@ -748,11 +748,11 @@ class Thornode {
|
|
|
748
748
|
* @param height - block height
|
|
749
749
|
* @returns quotes swap object response
|
|
750
750
|
*/
|
|
751
|
-
getSwapQuote(fromAsset, toAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, height, refundAddress) {
|
|
751
|
+
getSwapQuote(fromAsset, toAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, liquidityToleranceBps, affiliateBps, affiliate, height, refundAddress) {
|
|
752
752
|
return __awaiter(this, void 0, void 0, function* () {
|
|
753
753
|
for (const api of this.quoteApi) {
|
|
754
754
|
try {
|
|
755
|
-
const resp = (yield api.quoteswap(height, fromAsset, toAsset, amount, destinationAddress, refundAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate)).data;
|
|
755
|
+
const resp = (yield api.quoteswap(height, fromAsset, toAsset, amount, destinationAddress, refundAddress, streamingInterval, streamingQuantity, toleranceBps, liquidityToleranceBps, affiliateBps, affiliate)).data;
|
|
756
756
|
return resp;
|
|
757
757
|
}
|
|
758
758
|
catch (e) {
|
|
@@ -1232,7 +1232,7 @@ class ThorchainQuery {
|
|
|
1232
1232
|
* @param quoteSwapParams - Input parameters for the swap quote.
|
|
1233
1233
|
* @returns Transaction details including memo, address, fees, etc.
|
|
1234
1234
|
*/
|
|
1235
|
-
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliateAddress, height, }) {
|
|
1235
|
+
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, liquidityToleranceBps, toleranceBps, affiliateBps, affiliateAddress, height, }) {
|
|
1236
1236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1237
1237
|
// Validates swap and pushes error if there is one
|
|
1238
1238
|
const errors = [];
|
|
@@ -1243,7 +1243,7 @@ class ThorchainQuery {
|
|
|
1243
1243
|
const toAssetString = assetToString(destinationAsset);
|
|
1244
1244
|
const inputAmount = getBaseAmountWithDiffDecimals(amount, 8);
|
|
1245
1245
|
// Fetch quote
|
|
1246
|
-
const swapQuote = yield this.thorchainCache.thornode.getSwapQuote(fromAssetString, toAssetString, inputAmount.toNumber(), destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliateAddress, height);
|
|
1246
|
+
const swapQuote = yield this.thorchainCache.thornode.getSwapQuote(fromAssetString, toAssetString, inputAmount.toNumber(), destinationAddress, streamingInterval, streamingQuantity, liquidityToleranceBps, toleranceBps, affiliateBps, affiliateAddress, height);
|
|
1247
1247
|
let response;
|
|
1248
1248
|
// Check if swapQuote is a string, which we assume indicates an error message
|
|
1249
1249
|
if (typeof swapQuote === 'string') {
|
package/lib/index.js
CHANGED
|
@@ -755,11 +755,11 @@ class Thornode {
|
|
|
755
755
|
* @param height - block height
|
|
756
756
|
* @returns quotes swap object response
|
|
757
757
|
*/
|
|
758
|
-
getSwapQuote(fromAsset, toAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, height, refundAddress) {
|
|
758
|
+
getSwapQuote(fromAsset, toAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, liquidityToleranceBps, affiliateBps, affiliate, height, refundAddress) {
|
|
759
759
|
return __awaiter(this, void 0, void 0, function* () {
|
|
760
760
|
for (const api of this.quoteApi) {
|
|
761
761
|
try {
|
|
762
|
-
const resp = (yield api.quoteswap(height, fromAsset, toAsset, amount, destinationAddress, refundAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate)).data;
|
|
762
|
+
const resp = (yield api.quoteswap(height, fromAsset, toAsset, amount, destinationAddress, refundAddress, streamingInterval, streamingQuantity, toleranceBps, liquidityToleranceBps, affiliateBps, affiliate)).data;
|
|
763
763
|
return resp;
|
|
764
764
|
}
|
|
765
765
|
catch (e) {
|
|
@@ -1239,7 +1239,7 @@ class ThorchainQuery {
|
|
|
1239
1239
|
* @param quoteSwapParams - Input parameters for the swap quote.
|
|
1240
1240
|
* @returns Transaction details including memo, address, fees, etc.
|
|
1241
1241
|
*/
|
|
1242
|
-
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliateAddress, height, }) {
|
|
1242
|
+
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, liquidityToleranceBps, toleranceBps, affiliateBps, affiliateAddress, height, }) {
|
|
1243
1243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1244
1244
|
// Validates swap and pushes error if there is one
|
|
1245
1245
|
const errors = [];
|
|
@@ -1250,7 +1250,7 @@ class ThorchainQuery {
|
|
|
1250
1250
|
const toAssetString = xchainUtil.assetToString(destinationAsset);
|
|
1251
1251
|
const inputAmount = getBaseAmountWithDiffDecimals(amount, 8);
|
|
1252
1252
|
// Fetch quote
|
|
1253
|
-
const swapQuote = yield this.thorchainCache.thornode.getSwapQuote(fromAssetString, toAssetString, inputAmount.toNumber(), destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliateAddress, height);
|
|
1253
|
+
const swapQuote = yield this.thorchainCache.thornode.getSwapQuote(fromAssetString, toAssetString, inputAmount.toNumber(), destinationAddress, streamingInterval, streamingQuantity, liquidityToleranceBps, toleranceBps, affiliateBps, affiliateAddress, height);
|
|
1254
1254
|
let response;
|
|
1255
1255
|
// Check if swapQuote is a string, which we assume indicates an error message
|
|
1256
1256
|
if (typeof swapQuote === 'string') {
|
package/lib/thorchain-query.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class ThorchainQuery {
|
|
|
22
22
|
* @param quoteSwapParams - Input parameters for the swap quote.
|
|
23
23
|
* @returns Transaction details including memo, address, fees, etc.
|
|
24
24
|
*/
|
|
25
|
-
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliateAddress, height, }: QuoteSwapParams): Promise<TxDetails>;
|
|
25
|
+
quoteSwap({ fromAsset, destinationAsset, amount, destinationAddress, streamingInterval, streamingQuantity, liquidityToleranceBps, toleranceBps, affiliateBps, affiliateAddress, height, }: QuoteSwapParams): Promise<TxDetails>;
|
|
26
26
|
/**
|
|
27
27
|
* Validate a cryptoAmount is well formed
|
|
28
28
|
* @param {CryptoAmount} cryptoAmount - CryptoAmount to validate
|
package/lib/types.d.ts
CHANGED
package/lib/utils/thornode.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export declare class Thornode {
|
|
|
147
147
|
* @param height - block height
|
|
148
148
|
* @returns quotes swap object response
|
|
149
149
|
*/
|
|
150
|
-
getSwapQuote(fromAsset: string, toAsset: string, amount: number, destinationAddress?: string, streamingInterval?: number, streamingQuantity?: number, toleranceBps?: number, affiliateBps?: number, affiliate?: string, height?: number, refundAddress?: string): Promise<QuoteSwapResponse>;
|
|
150
|
+
getSwapQuote(fromAsset: string, toAsset: string, amount: number, destinationAddress?: string, streamingInterval?: number, streamingQuantity?: number, toleranceBps?: number, liquidityToleranceBps?: number, affiliateBps?: number, affiliate?: string, height?: number, refundAddress?: string): Promise<QuoteSwapResponse>;
|
|
151
151
|
/**
|
|
152
152
|
*
|
|
153
153
|
* @param height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thorchain-query",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Thorchain query module that is responsible for estimating swap calculations and add/remove liquidity for thorchain ",
|
|
6
6
|
"keywords": [
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"postversion": "git push --follow-tags"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@xchainjs/xchain-client": "2.0.
|
|
37
|
-
"@xchainjs/xchain-midgard-query": "2.0.
|
|
38
|
-
"@xchainjs/xchain-thornode": "1.0.
|
|
36
|
+
"@xchainjs/xchain-client": "2.0.1",
|
|
37
|
+
"@xchainjs/xchain-midgard-query": "2.0.1",
|
|
38
|
+
"@xchainjs/xchain-thornode": "1.0.1",
|
|
39
39
|
"@xchainjs/xchain-util": "2.0.0",
|
|
40
40
|
"axios": "1.8.4",
|
|
41
41
|
"axios-retry": "3.2.5",
|