@xchainjs/xchain-thorchain-amm 0.8.8 → 0.8.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 +8 -8
- package/lib/index.js +1 -1
- package/lib/thorchain-amm.d.ts +2 -1
- package/lib/types.d.ts +2 -2
- package/lib/wallet.d.ts +4 -3
- package/package.json +32 -31
package/lib/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Client as Client$5, BNBChain } from '@xchainjs/xchain-binance';
|
|
|
3
3
|
import { Client as Client$1, defaultBTCParams, BTCChain } from '@xchainjs/xchain-bitcoin';
|
|
4
4
|
import { Client, defaultBchParams, BCHChain } from '@xchainjs/xchain-bitcoincash';
|
|
5
5
|
import { Client as Client$a, defaultBscParams, BSCChain } from '@xchainjs/xchain-bsc';
|
|
6
|
-
import {
|
|
6
|
+
import { Protocol, FeeOption } from '@xchainjs/xchain-client';
|
|
7
7
|
import { Client as Client$6, GAIAChain } from '@xchainjs/xchain-cosmos';
|
|
8
8
|
import { Client as Client$2, defaultDogeParams, DOGEChain } from '@xchainjs/xchain-doge';
|
|
9
9
|
import { Client as Client$8, defaultEthParams, ETHChain } from '@xchainjs/xchain-ethereum';
|
|
@@ -11,7 +11,7 @@ import { Client as Client$3, defaultLtcParams, LTCChain } from '@xchainjs/xchain
|
|
|
11
11
|
import { Client as Client$7, MAYAChain } from '@xchainjs/xchain-mayachain';
|
|
12
12
|
import { Client as Client$4, THORChain } from '@xchainjs/xchain-thorchain';
|
|
13
13
|
import { eqAsset, getContractAddressFromAsset, baseAmount, assetFromString } from '@xchainjs/xchain-util';
|
|
14
|
-
import {
|
|
14
|
+
import { abi, MAX_APPROVAL } from '@xchainjs/xchain-evm';
|
|
15
15
|
import { ethers } from 'ethers';
|
|
16
16
|
import { ThorchainQuery } from '@xchainjs/xchain-thorchain-query';
|
|
17
17
|
|
|
@@ -400,7 +400,7 @@ class Wallet {
|
|
|
400
400
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
401
401
|
}
|
|
402
402
|
else if (this.isUTXOChain(assetAmount.asset)) {
|
|
403
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
403
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
404
404
|
const addParams = {
|
|
405
405
|
wallIndex: 0,
|
|
406
406
|
asset: assetAmount.asset,
|
|
@@ -460,7 +460,7 @@ class Wallet {
|
|
|
460
460
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
461
461
|
}
|
|
462
462
|
else if (this.isUTXOChain(assetAmount.asset)) {
|
|
463
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
463
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
464
464
|
const addParams = {
|
|
465
465
|
wallIndex: 0,
|
|
466
466
|
asset: assetAmount.asset,
|
|
@@ -513,7 +513,7 @@ class Wallet {
|
|
|
513
513
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
514
514
|
}
|
|
515
515
|
else if (this.isUTXOChain(params.amount.asset)) {
|
|
516
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
516
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
517
517
|
const addParams = {
|
|
518
518
|
wallIndex: 0,
|
|
519
519
|
asset: params.amount.asset,
|
|
@@ -566,7 +566,7 @@ class Wallet {
|
|
|
566
566
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
567
567
|
}
|
|
568
568
|
else if (this.isUTXOChain(params.amount.asset)) {
|
|
569
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
569
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
570
570
|
const addParams = {
|
|
571
571
|
wallIndex: 0,
|
|
572
572
|
asset: params.amount.asset,
|
|
@@ -688,7 +688,7 @@ class Wallet {
|
|
|
688
688
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
689
689
|
}
|
|
690
690
|
else if (this.isUTXOChain(params.asset.asset)) {
|
|
691
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
691
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
692
692
|
const addParams = {
|
|
693
693
|
wallIndex: 0,
|
|
694
694
|
asset: params.asset.asset,
|
|
@@ -749,7 +749,7 @@ class Wallet {
|
|
|
749
749
|
return { hash, url: assetClient.getExplorerTxUrl(hash) };
|
|
750
750
|
}
|
|
751
751
|
else if (this.isUTXOChain(params.assetFee.asset)) {
|
|
752
|
-
const feeRates = yield assetClient.getFeeRates(Protocol
|
|
752
|
+
const feeRates = yield assetClient.getFeeRates(Protocol.THORCHAIN);
|
|
753
753
|
const withdrawParams = {
|
|
754
754
|
wallIndex: 0,
|
|
755
755
|
asset: params.assetFee.asset,
|
package/lib/index.js
CHANGED
|
@@ -72,7 +72,7 @@ class EvmHelper {
|
|
|
72
72
|
throw new Error('Vault address is not defined');
|
|
73
73
|
}
|
|
74
74
|
const address = yield this.client.getAddressAsync(params.walletIndex);
|
|
75
|
-
const gasPrice = yield this.evmClient.estimateGasPrices(
|
|
75
|
+
const gasPrice = yield this.evmClient.estimateGasPrices(xchainClient.Protocol.THORCHAIN);
|
|
76
76
|
if (xchainUtil.eqAsset(params.asset, this.evmClient.config.gasAsset)) {
|
|
77
77
|
// simple transfer
|
|
78
78
|
return yield this.evmClient.transfer({
|
package/lib/thorchain-amm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AddliquidityPosition,
|
|
1
|
+
import { AddliquidityPosition, EstimateAddLP, EstimateAddSaver, EstimateWithdrawLP, EstimateWithdrawSaver, LoanCloseParams, LoanCloseQuote, LoanOpenParams, LoanOpenQuote, QuoteSwapParams, SaversPosition, SaversWithdraw, ThorchainQuery, TxDetails, WithdrawLiquidityPosition, getSaver } from '@xchainjs/xchain-thorchain-query';
|
|
2
|
+
import { CryptoAmount } from '@xchainjs/xchain-util';
|
|
2
3
|
import { TxSubmitted } from './types';
|
|
3
4
|
import { Wallet } from './wallet';
|
|
4
5
|
export type AmmEstimateSwapParams = QuoteSwapParams & {
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Balance, FeeOption } from '@xchainjs/xchain-client';
|
|
2
|
-
import {
|
|
3
|
-
import { Address, Asset, BaseAmount, Chain } from '@xchainjs/xchain-util';
|
|
2
|
+
import { LiquidityPool } from '@xchainjs/xchain-thorchain-query';
|
|
3
|
+
import { Address, Asset, BaseAmount, Chain, CryptoAmount } from '@xchainjs/xchain-util';
|
|
4
4
|
export type AllBalances = {
|
|
5
5
|
chain: Chain;
|
|
6
6
|
address: string;
|
package/lib/wallet.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BNBChain } from '@xchainjs/xchain-binance';
|
|
|
3
3
|
import { BTCChain } from '@xchainjs/xchain-bitcoin';
|
|
4
4
|
import { BCHChain } from '@xchainjs/xchain-bitcoincash';
|
|
5
5
|
import { BSCChain } from '@xchainjs/xchain-bsc';
|
|
6
|
-
import { Network,
|
|
6
|
+
import { Network, XChainClient, XChainClientParams } from '@xchainjs/xchain-client';
|
|
7
7
|
import { GAIAChain } from '@xchainjs/xchain-cosmos';
|
|
8
8
|
import { DOGEChain } from '@xchainjs/xchain-doge';
|
|
9
9
|
import { ETHChain } from '@xchainjs/xchain-ethereum';
|
|
@@ -11,8 +11,9 @@ import { EVMClientParams } from '@xchainjs/xchain-evm';
|
|
|
11
11
|
import { LTCChain } from '@xchainjs/xchain-litecoin';
|
|
12
12
|
import { MAYAChain, MayachainClientParams } from '@xchainjs/xchain-mayachain';
|
|
13
13
|
import { THORChain, ThorchainClientParams } from '@xchainjs/xchain-thorchain';
|
|
14
|
-
import {
|
|
15
|
-
import { Address } from '@xchainjs/xchain-util';
|
|
14
|
+
import { ThorchainQuery } from '@xchainjs/xchain-thorchain-query';
|
|
15
|
+
import { Address, CryptoAmount } from '@xchainjs/xchain-util';
|
|
16
|
+
import { UtxoClientParams } from '@xchainjs/xchain-utxo';
|
|
16
17
|
import { AddLiquidity, AllBalances, ExecuteSwap, LoanCloseParams, LoanOpenParams, RegisterThornameParams, TxSubmitted, UpdateThornameParams, WithdrawLiquidity } from './types';
|
|
17
18
|
import { EvmHelper } from './utils/evm-helper';
|
|
18
19
|
export type NodeUrls = Record<Network, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thorchain-amm",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
4
4
|
"description": "module that exposes estimating & swappping cryptocurrency assets on thorchain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"THORChain",
|
|
@@ -35,29 +35,31 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/xchainjs/xchainjs-lib/issues"
|
|
37
37
|
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@xchainjs/xchain-thorchain-query": "0.7.0"
|
|
40
|
+
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@binance-chain/javascript-sdk": "^4.2.0",
|
|
40
43
|
"@cosmos-client/core": "0.46.1",
|
|
41
44
|
"@psf/bitcoincashjs-lib": "^4.0.3",
|
|
42
|
-
"@xchainjs/xchain-avax": "^0.4.
|
|
43
|
-
"@xchainjs/xchain-binance": "^5.7.
|
|
44
|
-
"@xchainjs/xchain-bitcoin": "^0.23.
|
|
45
|
-
"@xchainjs/xchain-bitcoincash": "^0.17.
|
|
46
|
-
"@xchainjs/xchain-client": "^0.
|
|
47
|
-
"@xchainjs/xchain-cosmos": "^0.21.
|
|
48
|
-
"@xchainjs/xchain-bsc": "^0.4.
|
|
45
|
+
"@xchainjs/xchain-avax": "^0.4.3",
|
|
46
|
+
"@xchainjs/xchain-binance": "^5.7.8",
|
|
47
|
+
"@xchainjs/xchain-bitcoin": "^0.23.9",
|
|
48
|
+
"@xchainjs/xchain-bitcoincash": "^0.17.7",
|
|
49
|
+
"@xchainjs/xchain-client": "^0.16.0",
|
|
50
|
+
"@xchainjs/xchain-cosmos": "^0.21.9",
|
|
51
|
+
"@xchainjs/xchain-bsc": "^0.4.4",
|
|
49
52
|
"@xchainjs/xchain-crypto": "^0.3.0",
|
|
50
|
-
"@xchainjs/xchain-doge": "^0.7.
|
|
51
|
-
"@xchainjs/xchain-ethereum": "^0.31.
|
|
53
|
+
"@xchainjs/xchain-doge": "^0.7.9",
|
|
54
|
+
"@xchainjs/xchain-ethereum": "^0.31.3",
|
|
52
55
|
"@xchainjs/xchain-thornode": "^0.3.8",
|
|
53
|
-
"@xchainjs/xchain-
|
|
54
|
-
"@xchainjs/xchain-
|
|
55
|
-
"@xchainjs/xchain-
|
|
56
|
-
"@xchainjs/xchain-mayachain": "^0.2.10",
|
|
56
|
+
"@xchainjs/xchain-evm": "^0.4.3",
|
|
57
|
+
"@xchainjs/xchain-litecoin": "^0.13.8",
|
|
58
|
+
"@xchainjs/xchain-mayachain": "^0.2.13",
|
|
57
59
|
"@xchainjs/xchain-midgard": "^0.5.2",
|
|
58
|
-
"@xchainjs/xchain-thorchain": "^0.28.
|
|
60
|
+
"@xchainjs/xchain-thorchain": "^0.28.16",
|
|
59
61
|
"@xchainjs/xchain-util": "^0.13.1",
|
|
60
|
-
"@xchainjs/xchain-utxo-providers": "^0.2.
|
|
62
|
+
"@xchainjs/xchain-utxo-providers": "^0.2.10",
|
|
61
63
|
"axios": "^1.3.6",
|
|
62
64
|
"axios-retry": "^3.2.5",
|
|
63
65
|
"bchaddrjs": "^0.5.2",
|
|
@@ -75,25 +77,24 @@
|
|
|
75
77
|
"@binance-chain/javascript-sdk": "^4.2.0",
|
|
76
78
|
"@cosmos-client/core": "0.46.1",
|
|
77
79
|
"@psf/bitcoincashjs-lib": "^4.0.3",
|
|
78
|
-
"@xchainjs/xchain-avax": "^0.4.
|
|
79
|
-
"@xchainjs/xchain-binance": "^5.7.
|
|
80
|
-
"@xchainjs/xchain-bitcoin": "^0.23.
|
|
81
|
-
"@xchainjs/xchain-bitcoincash": "^0.17.
|
|
82
|
-
"@xchainjs/xchain-client": "^0.
|
|
83
|
-
"@xchainjs/xchain-cosmos": "^0.21.
|
|
84
|
-
"@xchainjs/xchain-bsc": "^0.4.
|
|
80
|
+
"@xchainjs/xchain-avax": "^0.4.3",
|
|
81
|
+
"@xchainjs/xchain-binance": "^5.7.8",
|
|
82
|
+
"@xchainjs/xchain-bitcoin": "^0.23.9",
|
|
83
|
+
"@xchainjs/xchain-bitcoincash": "^0.17.7",
|
|
84
|
+
"@xchainjs/xchain-client": "^0.16.0",
|
|
85
|
+
"@xchainjs/xchain-cosmos": "^0.21.9",
|
|
86
|
+
"@xchainjs/xchain-bsc": "^0.4.4",
|
|
85
87
|
"@xchainjs/xchain-crypto": "^0.3.0",
|
|
86
|
-
"@xchainjs/xchain-doge": "^0.7.
|
|
87
|
-
"@xchainjs/xchain-ethereum": "^0.31.
|
|
88
|
+
"@xchainjs/xchain-doge": "^0.7.9",
|
|
89
|
+
"@xchainjs/xchain-ethereum": "^0.31.3",
|
|
88
90
|
"@xchainjs/xchain-thornode": "^0.3.8",
|
|
89
|
-
"@xchainjs/xchain-
|
|
90
|
-
"@xchainjs/xchain-
|
|
91
|
-
"@xchainjs/xchain-
|
|
92
|
-
"@xchainjs/xchain-mayachain": "^0.2.10",
|
|
91
|
+
"@xchainjs/xchain-evm": "^0.4.3",
|
|
92
|
+
"@xchainjs/xchain-litecoin": "^0.13.8",
|
|
93
|
+
"@xchainjs/xchain-mayachain": "^0.2.13",
|
|
93
94
|
"@xchainjs/xchain-midgard": "^0.5.2",
|
|
94
|
-
"@xchainjs/xchain-thorchain": "^0.28.
|
|
95
|
+
"@xchainjs/xchain-thorchain": "^0.28.16",
|
|
95
96
|
"@xchainjs/xchain-util": "^0.13.1",
|
|
96
|
-
"@xchainjs/xchain-utxo-providers": "^0.2.
|
|
97
|
+
"@xchainjs/xchain-utxo-providers": "^0.2.10",
|
|
97
98
|
"axios": "^1.3.6",
|
|
98
99
|
"axios-retry": "^3.2.5",
|
|
99
100
|
"bchaddrjs": "^0.5.2",
|