@xchainjs/xchain-thorchain-query 2.0.9 → 2.0.11
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 +7 -0
- package/lib/index.js +7 -0
- package/lib/types.d.ts +3 -0
- package/package.json +3 -3
package/lib/index.esm.js
CHANGED
|
@@ -1291,6 +1291,7 @@ class ThorchainQuery {
|
|
|
1291
1291
|
asset: destinationAsset,
|
|
1292
1292
|
affiliateFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
|
|
1293
1293
|
outboundFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
|
|
1294
|
+
liquidityFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
|
|
1294
1295
|
},
|
|
1295
1296
|
slipBasisPoints: 0,
|
|
1296
1297
|
netOutput: new CryptoAmount(baseAmount(0), destinationAsset),
|
|
@@ -1305,6 +1306,8 @@ class ThorchainQuery {
|
|
|
1305
1306
|
streamingSwapBlocks: 0,
|
|
1306
1307
|
streamingSwapSeconds: 0,
|
|
1307
1308
|
totalSwapSeconds: 0,
|
|
1309
|
+
recommendedGasRate: '0',
|
|
1310
|
+
router: '',
|
|
1308
1311
|
warning: '',
|
|
1309
1312
|
},
|
|
1310
1313
|
};
|
|
@@ -1330,6 +1333,7 @@ class ThorchainQuery {
|
|
|
1330
1333
|
asset: destinationAsset,
|
|
1331
1334
|
affiliateFee: getCryptoAmountWithNotation(new CryptoAmount(baseAmount(swapQuote.fees.affiliate), feeAsset), feeAssetDecimals),
|
|
1332
1335
|
outboundFee: getCryptoAmountWithNotation(new CryptoAmount(baseAmount(swapQuote.fees.outbound), feeAsset), feeAssetDecimals),
|
|
1336
|
+
liquidityFee: getCryptoAmountWithNotation(new CryptoAmount(baseAmount(swapQuote.fees.liquidity), feeAsset), feeAssetDecimals),
|
|
1333
1337
|
},
|
|
1334
1338
|
slipBasisPoints: swapQuote.fees.slippage_bps,
|
|
1335
1339
|
netOutput: getCryptoAmountWithNotation(new CryptoAmount(baseAmount(swapQuote.expected_amount_out), destinationAsset), destinationAssetDecimals),
|
|
@@ -1344,6 +1348,8 @@ class ThorchainQuery {
|
|
|
1344
1348
|
streamingSwapSeconds: swapQuote.streaming_swap_seconds ? swapQuote.streaming_swap_seconds : 0,
|
|
1345
1349
|
totalSwapSeconds: swapQuote.total_swap_seconds ? swapQuote.total_swap_seconds : 0,
|
|
1346
1350
|
canSwap: !swapQuote.memo || errors.length > 0 ? false : true,
|
|
1351
|
+
recommendedGasRate: swapQuote.recommended_gas_rate ? swapQuote.recommended_gas_rate : '0',
|
|
1352
|
+
router: swapQuote.router ? swapQuote.router : '',
|
|
1347
1353
|
errors,
|
|
1348
1354
|
warning: swapQuote.warning,
|
|
1349
1355
|
},
|
|
@@ -1427,6 +1433,7 @@ class ThorchainQuery {
|
|
|
1427
1433
|
// swapFee: await this.convert(fees.swapFee, asset),
|
|
1428
1434
|
outboundFee: yield this.convert(fees.outboundFee, asset),
|
|
1429
1435
|
affiliateFee: yield this.convert(fees.affiliateFee, asset),
|
|
1436
|
+
liquidityFee: yield this.convert(fees.liquidityFee, asset),
|
|
1430
1437
|
// totatBps: fees.totatBps,
|
|
1431
1438
|
};
|
|
1432
1439
|
});
|
package/lib/index.js
CHANGED
|
@@ -1299,6 +1299,7 @@ class ThorchainQuery {
|
|
|
1299
1299
|
asset: destinationAsset,
|
|
1300
1300
|
affiliateFee: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0), AssetRuneNative),
|
|
1301
1301
|
outboundFee: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0), AssetRuneNative),
|
|
1302
|
+
liquidityFee: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0), AssetRuneNative),
|
|
1302
1303
|
},
|
|
1303
1304
|
slipBasisPoints: 0,
|
|
1304
1305
|
netOutput: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0), destinationAsset),
|
|
@@ -1313,6 +1314,8 @@ class ThorchainQuery {
|
|
|
1313
1314
|
streamingSwapBlocks: 0,
|
|
1314
1315
|
streamingSwapSeconds: 0,
|
|
1315
1316
|
totalSwapSeconds: 0,
|
|
1317
|
+
recommendedGasRate: '0',
|
|
1318
|
+
router: '',
|
|
1316
1319
|
warning: '',
|
|
1317
1320
|
},
|
|
1318
1321
|
};
|
|
@@ -1338,6 +1341,7 @@ class ThorchainQuery {
|
|
|
1338
1341
|
asset: destinationAsset,
|
|
1339
1342
|
affiliateFee: getCryptoAmountWithNotation(new xchainUtil.CryptoAmount(xchainUtil.baseAmount(swapQuote.fees.affiliate), feeAsset), feeAssetDecimals),
|
|
1340
1343
|
outboundFee: getCryptoAmountWithNotation(new xchainUtil.CryptoAmount(xchainUtil.baseAmount(swapQuote.fees.outbound), feeAsset), feeAssetDecimals),
|
|
1344
|
+
liquidityFee: getCryptoAmountWithNotation(new xchainUtil.CryptoAmount(xchainUtil.baseAmount(swapQuote.fees.liquidity), feeAsset), feeAssetDecimals),
|
|
1341
1345
|
},
|
|
1342
1346
|
slipBasisPoints: swapQuote.fees.slippage_bps,
|
|
1343
1347
|
netOutput: getCryptoAmountWithNotation(new xchainUtil.CryptoAmount(xchainUtil.baseAmount(swapQuote.expected_amount_out), destinationAsset), destinationAssetDecimals),
|
|
@@ -1352,6 +1356,8 @@ class ThorchainQuery {
|
|
|
1352
1356
|
streamingSwapSeconds: swapQuote.streaming_swap_seconds ? swapQuote.streaming_swap_seconds : 0,
|
|
1353
1357
|
totalSwapSeconds: swapQuote.total_swap_seconds ? swapQuote.total_swap_seconds : 0,
|
|
1354
1358
|
canSwap: !swapQuote.memo || errors.length > 0 ? false : true,
|
|
1359
|
+
recommendedGasRate: swapQuote.recommended_gas_rate ? swapQuote.recommended_gas_rate : '0',
|
|
1360
|
+
router: swapQuote.router ? swapQuote.router : '',
|
|
1355
1361
|
errors,
|
|
1356
1362
|
warning: swapQuote.warning,
|
|
1357
1363
|
},
|
|
@@ -1435,6 +1441,7 @@ class ThorchainQuery {
|
|
|
1435
1441
|
// swapFee: await this.convert(fees.swapFee, asset),
|
|
1436
1442
|
outboundFee: yield this.convert(fees.outboundFee, asset),
|
|
1437
1443
|
affiliateFee: yield this.convert(fees.affiliateFee, asset),
|
|
1444
|
+
liquidityFee: yield this.convert(fees.liquidityFee, asset),
|
|
1438
1445
|
// totatBps: fees.totatBps,
|
|
1439
1446
|
};
|
|
1440
1447
|
});
|
package/lib/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type TotalFees = {
|
|
|
10
10
|
asset: CompatibleAsset;
|
|
11
11
|
affiliateFee: CryptoAmount<CompatibleAsset>;
|
|
12
12
|
outboundFee: CryptoAmount<CompatibleAsset>;
|
|
13
|
+
liquidityFee: CryptoAmount<CompatibleAsset>;
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
16
|
* Represents an estimate for a swap transaction.
|
|
@@ -28,6 +29,8 @@ export type SwapEstimate = {
|
|
|
28
29
|
streamingSwapBlocks: number;
|
|
29
30
|
streamingSwapSeconds: number;
|
|
30
31
|
totalSwapSeconds: number;
|
|
32
|
+
router: string;
|
|
33
|
+
recommendedGasRate: string;
|
|
31
34
|
canSwap: boolean;
|
|
32
35
|
errors: string[];
|
|
33
36
|
warning: string;
|
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.11",
|
|
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,8 +33,8 @@
|
|
|
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.
|
|
36
|
+
"@xchainjs/xchain-client": "2.0.8",
|
|
37
|
+
"@xchainjs/xchain-midgard-query": "2.0.8",
|
|
38
38
|
"@xchainjs/xchain-thornode": "1.0.5",
|
|
39
39
|
"@xchainjs/xchain-util": "2.0.4",
|
|
40
40
|
"axios": "1.8.4",
|