@xchainjs/xchain-thorchain-amm 1.1.17 → 2.0.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/lib/index.esm.js CHANGED
@@ -9,9 +9,9 @@ import { DOGEChain, Client as Client$6, defaultDogeParams } from '@xchainjs/xcha
9
9
  import { AssetETH, ETHChain, Client as Client$5, defaultEthParams } from '@xchainjs/xchain-ethereum';
10
10
  import { abi, MAX_APPROVAL } from '@xchainjs/xchain-evm';
11
11
  import { LTCChain, Client as Client$7, defaultLtcParams } from '@xchainjs/xchain-litecoin';
12
- import { THORChain, Client, defaultClientConfig, RUNE_DECIMAL, AssetRuneNative } from '@xchainjs/xchain-thorchain';
12
+ import { THORChain, Client, defaultClientConfig, AssetRuneNative, RUNE_DECIMAL } from '@xchainjs/xchain-thorchain';
13
13
  import { ThorchainQuery, ThorchainCache, Thornode } from '@xchainjs/xchain-thorchain-query';
14
- import { eqAsset, getContractAddressFromAsset, baseAmount, CryptoAmount } from '@xchainjs/xchain-util';
14
+ import { eqAsset, isSynthAsset, getContractAddressFromAsset, baseAmount, isTradeAsset, assetToString, AssetCryptoAmount, CryptoAmount } from '@xchainjs/xchain-util';
15
15
  import { Wallet } from '@xchainjs/xchain-wallet';
16
16
  import { ethers } from 'ethers';
17
17
 
@@ -56,7 +56,18 @@ const isProtocolEVMChain = (chain) => {
56
56
  const isProtocolERC20Asset = (asset) => {
57
57
  return isProtocolEVMChain(asset.chain)
58
58
  ? [AssetETH, AssetAVAX, AssetBSC].findIndex((nativeEVMAsset) => eqAsset(nativeEVMAsset, asset)) === -1 &&
59
- !asset.synth
59
+ !isSynthAsset(asset)
60
+ : false;
61
+ };
62
+ /**
63
+ * Check if asset is ERC20
64
+ * @param {Asset} asset to check
65
+ * @returns true if asset is ERC20, otherwise, false
66
+ */
67
+ const isTokenCryptoAmount = (amount) => {
68
+ return isProtocolEVMChain(amount.asset.chain)
69
+ ? [AssetETH, AssetAVAX, AssetBSC].findIndex((nativeEVMAsset) => eqAsset(nativeEVMAsset, amount.asset)) === -1 &&
70
+ !isSynthAsset(amount.asset)
60
71
  : false;
61
72
  };
62
73
  /**
@@ -182,12 +193,16 @@ class ThorchainAction {
182
193
  });
183
194
  }
184
195
  static isNonProtocolParams(params) {
185
- if ((params.assetAmount.asset.chain === THORChain || params.assetAmount.asset.synth) &&
196
+ if ((params.assetAmount.asset.chain === THORChain ||
197
+ isSynthAsset(params.assetAmount.asset) ||
198
+ isTradeAsset(params.assetAmount.asset)) &&
186
199
  'address' in params &&
187
200
  !!params.address) {
188
201
  throw Error('Inconsistent params. Native actions do not support recipient');
189
202
  }
190
- return params.assetAmount.asset.chain !== THORChain && !params.assetAmount.asset.synth;
203
+ return (params.assetAmount.asset.chain !== THORChain &&
204
+ !isSynthAsset(params.assetAmount.asset) &&
205
+ !isTradeAsset(params.assetAmount.asset));
191
206
  }
192
207
  }
193
208
 
@@ -262,9 +277,15 @@ class ThorchainAMM {
262
277
  return __awaiter(this, void 0, void 0, function* () {
263
278
  const errors = [];
264
279
  if (destinationAddress &&
265
- !validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, destinationAsset.synth ? THORChain : destinationAsset.chain, destinationAddress)) {
280
+ !validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, isSynthAsset(destinationAsset) || isTradeAsset(destinationAsset) ? THORChain : destinationAsset.chain, destinationAddress)) {
266
281
  errors.push(`destinationAddress ${destinationAddress} is not a valid address`);
267
282
  }
283
+ if (!isTradeAsset(fromAsset) && !eqAsset(fromAsset, AssetRuneNative) && isTradeAsset(destinationAsset)) {
284
+ errors.push('Can not make swap from non trade asset or non Rune asset to trade asset. Use addToTrade (TRADE+) operation');
285
+ }
286
+ if (isTradeAsset(fromAsset) && !isTradeAsset(destinationAsset) && !eqAsset(destinationAsset, AssetRuneNative)) {
287
+ errors.push('Can not make swap from trade asset to non trade asset or non Rune asset. Use withdrawFromTrade (TRADE-) operation');
288
+ }
268
289
  if (affiliateAddress) {
269
290
  const isThorAddress = validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, THORChain, affiliateAddress);
270
291
  const isThorname = !!(yield this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.getTHORNameDetails(affiliateAddress));
@@ -281,12 +302,17 @@ class ThorchainAMM {
281
302
  errors.push(`streamingQuantity ${streamingQuantity} can not be lower than zero`);
282
303
  }
283
304
  if (isProtocolERC20Asset(fromAsset) && fromAddress) {
284
- const approveErrors = yield this.isRouterApprovedToSpend({
285
- asset: fromAsset,
286
- address: fromAddress,
287
- amount,
288
- });
289
- errors.push(...approveErrors);
305
+ if (!isTokenCryptoAmount(amount)) {
306
+ errors.push(`${assetToString(amount.asset)} is not Token asset amount`);
307
+ }
308
+ else {
309
+ const approveErrors = yield this.isRouterApprovedToSpend({
310
+ asset: fromAsset,
311
+ address: fromAddress,
312
+ amount,
313
+ });
314
+ errors.push(...approveErrors);
315
+ }
290
316
  }
291
317
  return errors;
292
318
  });
@@ -653,7 +679,7 @@ class ThorchainAMM {
653
679
  return {
654
680
  memo: '',
655
681
  errors,
656
- value: new CryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
682
+ value: new AssetCryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
657
683
  allowed: false,
658
684
  };
659
685
  }
@@ -666,7 +692,7 @@ class ThorchainAMM {
666
692
  return {
667
693
  memo: '',
668
694
  errors: ['message' in e ? e.message : `Unknown error: ${e}`],
669
- value: new CryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
695
+ value: new AssetCryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
670
696
  allowed: false,
671
697
  };
672
698
  }
@@ -696,7 +722,7 @@ class ThorchainAMM {
696
722
  return {
697
723
  memo: '',
698
724
  errors,
699
- value: new CryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
725
+ value: new AssetCryptoAmount(baseAmount(0, RUNE_DECIMAL), AssetRuneNative),
700
726
  allowed: false,
701
727
  };
702
728
  }
@@ -749,6 +775,197 @@ class ThorchainAMM {
749
775
  });
750
776
  });
751
777
  }
778
+ /**
779
+ * Estimate adding trade amount to account
780
+ * @param {AddToTradeAccountParams} param Add to trade account params
781
+ * @returns {AddToTradeAccount} Estimation to add amount to trade account
782
+ */
783
+ estimateAddToTradeAccount({ amount, address }) {
784
+ return __awaiter(this, void 0, void 0, function* () {
785
+ const errors = [];
786
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, THORChain, address)) {
787
+ errors.push('Invalid trade account address');
788
+ }
789
+ let inboundDetails;
790
+ try {
791
+ inboundDetails = yield this.thorchainQuery.getChainInboundDetails(amount.asset.chain);
792
+ }
793
+ catch (_a) {
794
+ errors.push(`Can not get inbound address for ${amount.asset.chain}`);
795
+ }
796
+ if (errors.length) {
797
+ return {
798
+ allowed: false,
799
+ errors,
800
+ value: new CryptoAmount(baseAmount(0, amount.assetAmount.decimal), amount.asset),
801
+ memo: '',
802
+ toAddress: '',
803
+ };
804
+ }
805
+ return {
806
+ toAddress: inboundDetails ? inboundDetails.address : '',
807
+ memo: `TRADE+:${address}`,
808
+ value: amount,
809
+ allowed: true,
810
+ errors,
811
+ };
812
+ });
813
+ }
814
+ /**
815
+ * Add trade amount to account
816
+ * @param {AddToTradeAccountParams} param Add to trade account params
817
+ * @returns {TxSubmitted} Transaction made to add the trade amount
818
+ */
819
+ addToTradeAccount({ amount, address }) {
820
+ return __awaiter(this, void 0, void 0, function* () {
821
+ const quote = yield this.estimateAddToTradeAccount({ amount, address });
822
+ if (!quote.allowed)
823
+ throw Error(`Can not add to trade account. ${quote.errors.join(' ')}`);
824
+ return ThorchainAction.makeAction({
825
+ wallet: this.wallet,
826
+ assetAmount: quote.value,
827
+ memo: quote.memo,
828
+ recipient: quote.toAddress,
829
+ });
830
+ });
831
+ }
832
+ /**
833
+ * Estimate withdrawing trade amount from account
834
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
835
+ * @returns {WithdrawFromTradeAccount} Estimation to withdraw amount from trade account
836
+ */
837
+ estimateWithdrawFromTradeAccount({ amount, address, }) {
838
+ return __awaiter(this, void 0, void 0, function* () {
839
+ const errors = [];
840
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, amount.asset.chain, address)) {
841
+ errors.push('Invalid address to send the withdraw');
842
+ }
843
+ if (errors.length) {
844
+ return {
845
+ allowed: false,
846
+ errors,
847
+ value: new CryptoAmount(baseAmount(0, amount.assetAmount.decimal), amount.asset),
848
+ memo: '',
849
+ };
850
+ }
851
+ return {
852
+ memo: `TRADE-:${address}`,
853
+ value: amount,
854
+ allowed: true,
855
+ errors,
856
+ };
857
+ });
858
+ }
859
+ /**
860
+ * Withdraw trade amount from account
861
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
862
+ * @returns {TxSubmitted} Estimation to withdraw amount from trade account
863
+ */
864
+ withdrawFromTradeAccount({ amount, address }) {
865
+ return __awaiter(this, void 0, void 0, function* () {
866
+ const quote = yield this.estimateWithdrawFromTradeAccount({ amount, address });
867
+ if (!quote.allowed)
868
+ throw Error(`Can not withdraw from trade account. ${quote.errors.join(' ')}`);
869
+ return ThorchainAction.makeAction({
870
+ wallet: this.wallet,
871
+ assetAmount: quote.value,
872
+ memo: quote.memo,
873
+ });
874
+ });
875
+ }
876
+ /**
877
+ * Estimate Rune pool deposit
878
+ * @param {DepositToRunePoolParams} params Deposit to Rune pool params
879
+ * @returns {EstimateDepositToRunePool} Estimation to make the deposit
880
+ */
881
+ estimateDepositToRunePool({ amount }) {
882
+ return __awaiter(this, void 0, void 0, function* () {
883
+ const constants = yield this.thorchainQuery.thorchainCache.thornode.getTcConstants();
884
+ return {
885
+ allowed: true,
886
+ maturityBlocks: Number(constants['RUNEPoolDepositMaturityBlocks']),
887
+ amount,
888
+ errors: [],
889
+ memo: 'POOL+',
890
+ };
891
+ });
892
+ }
893
+ /**
894
+ * Deposit amount to Rune pool
895
+ * @param {DepositToRunePoolParams} amount Amount to deposit to Rune pool
896
+ * @returns {TxSubmitted} Transaction made to deposit to Rune pool
897
+ */
898
+ depositToRunePool(params) {
899
+ return __awaiter(this, void 0, void 0, function* () {
900
+ const quote = yield this.estimateDepositToRunePool(params);
901
+ if (!quote.allowed)
902
+ throw Error(`Can not deposit to Rune pool. ${quote.errors.join(' ')}`);
903
+ return ThorchainAction.makeAction({
904
+ wallet: this.wallet,
905
+ assetAmount: quote.amount,
906
+ memo: quote.memo,
907
+ });
908
+ });
909
+ }
910
+ /**
911
+ * Estimate Rune pool withdraw
912
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
913
+ * @returns {EstimateWithdrawFromRunePool} Estimation to make a withdraw from Rune pool
914
+ */
915
+ estimateWithdrawFromRunePool({ withdrawBps, affiliate, feeBps, }) {
916
+ return __awaiter(this, void 0, void 0, function* () {
917
+ const errors = [];
918
+ if (withdrawBps <= 0 || withdrawBps > 10000) {
919
+ errors.push('withdrawBps out of range. Range 0-10000');
920
+ }
921
+ if (affiliate) {
922
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, THORChain, affiliate) &&
923
+ !(yield this.isTHORName(affiliate))) {
924
+ errors.push('Invalid affiliate. Affiliate must be a THORName or THOR address');
925
+ }
926
+ if (!feeBps || feeBps <= 0 || feeBps > 1000) {
927
+ errors.push('feeBps out of range. Range 0-1000');
928
+ }
929
+ }
930
+ if (errors.length) {
931
+ return {
932
+ amount: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
933
+ memo: '',
934
+ allowed: false,
935
+ errors,
936
+ };
937
+ }
938
+ return {
939
+ amount: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
940
+ memo: `POOL-:${withdrawBps}:${affiliate || ''}:${affiliate ? feeBps : ''}`,
941
+ allowed: true,
942
+ errors,
943
+ };
944
+ });
945
+ }
946
+ /**
947
+ * Withdraw amount from Rune pool
948
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
949
+ * @returns {TxSubmitted} Transaction made to withdraw from Rune pool
950
+ */
951
+ withdrawFromRunePool(params) {
952
+ return __awaiter(this, void 0, void 0, function* () {
953
+ const quote = yield this.estimateWithdrawFromRunePool(params);
954
+ if (!quote.allowed)
955
+ throw Error(`Can not withdraw from Rune pool. ${quote.errors.join(' ')}`);
956
+ return ThorchainAction.makeAction({
957
+ wallet: this.wallet,
958
+ assetAmount: quote.amount,
959
+ memo: quote.memo,
960
+ });
961
+ });
962
+ }
963
+ isTHORName(thorname) {
964
+ return __awaiter(this, void 0, void 0, function* () {
965
+ const details = yield this.thorchainQuery.getThornameDetails(thorname);
966
+ return details.owner !== '';
967
+ });
968
+ }
752
969
  }
753
970
 
754
971
  export { ThorchainAMM };
package/lib/index.js CHANGED
@@ -60,7 +60,18 @@ const isProtocolEVMChain = (chain) => {
60
60
  const isProtocolERC20Asset = (asset) => {
61
61
  return isProtocolEVMChain(asset.chain)
62
62
  ? [xchainEthereum.AssetETH, xchainAvax.AssetAVAX, xchainBsc.AssetBSC].findIndex((nativeEVMAsset) => xchainUtil.eqAsset(nativeEVMAsset, asset)) === -1 &&
63
- !asset.synth
63
+ !xchainUtil.isSynthAsset(asset)
64
+ : false;
65
+ };
66
+ /**
67
+ * Check if asset is ERC20
68
+ * @param {Asset} asset to check
69
+ * @returns true if asset is ERC20, otherwise, false
70
+ */
71
+ const isTokenCryptoAmount = (amount) => {
72
+ return isProtocolEVMChain(amount.asset.chain)
73
+ ? [xchainEthereum.AssetETH, xchainAvax.AssetAVAX, xchainBsc.AssetBSC].findIndex((nativeEVMAsset) => xchainUtil.eqAsset(nativeEVMAsset, amount.asset)) === -1 &&
74
+ !xchainUtil.isSynthAsset(amount.asset)
64
75
  : false;
65
76
  };
66
77
  /**
@@ -186,12 +197,16 @@ class ThorchainAction {
186
197
  });
187
198
  }
188
199
  static isNonProtocolParams(params) {
189
- if ((params.assetAmount.asset.chain === xchainThorchain.THORChain || params.assetAmount.asset.synth) &&
200
+ if ((params.assetAmount.asset.chain === xchainThorchain.THORChain ||
201
+ xchainUtil.isSynthAsset(params.assetAmount.asset) ||
202
+ xchainUtil.isTradeAsset(params.assetAmount.asset)) &&
190
203
  'address' in params &&
191
204
  !!params.address) {
192
205
  throw Error('Inconsistent params. Native actions do not support recipient');
193
206
  }
194
- return params.assetAmount.asset.chain !== xchainThorchain.THORChain && !params.assetAmount.asset.synth;
207
+ return (params.assetAmount.asset.chain !== xchainThorchain.THORChain &&
208
+ !xchainUtil.isSynthAsset(params.assetAmount.asset) &&
209
+ !xchainUtil.isTradeAsset(params.assetAmount.asset));
195
210
  }
196
211
  }
197
212
 
@@ -266,9 +281,15 @@ class ThorchainAMM {
266
281
  return __awaiter(this, void 0, void 0, function* () {
267
282
  const errors = [];
268
283
  if (destinationAddress &&
269
- !validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, destinationAsset.synth ? xchainThorchain.THORChain : destinationAsset.chain, destinationAddress)) {
284
+ !validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, xchainUtil.isSynthAsset(destinationAsset) || xchainUtil.isTradeAsset(destinationAsset) ? xchainThorchain.THORChain : destinationAsset.chain, destinationAddress)) {
270
285
  errors.push(`destinationAddress ${destinationAddress} is not a valid address`);
271
286
  }
287
+ if (!xchainUtil.isTradeAsset(fromAsset) && !xchainUtil.eqAsset(fromAsset, xchainThorchain.AssetRuneNative) && xchainUtil.isTradeAsset(destinationAsset)) {
288
+ errors.push('Can not make swap from non trade asset or non Rune asset to trade asset. Use addToTrade (TRADE+) operation');
289
+ }
290
+ if (xchainUtil.isTradeAsset(fromAsset) && !xchainUtil.isTradeAsset(destinationAsset) && !xchainUtil.eqAsset(destinationAsset, xchainThorchain.AssetRuneNative)) {
291
+ errors.push('Can not make swap from trade asset to non trade asset or non Rune asset. Use withdrawFromTrade (TRADE-) operation');
292
+ }
272
293
  if (affiliateAddress) {
273
294
  const isThorAddress = validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, xchainThorchain.THORChain, affiliateAddress);
274
295
  const isThorname = !!(yield this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.getTHORNameDetails(affiliateAddress));
@@ -285,12 +306,17 @@ class ThorchainAMM {
285
306
  errors.push(`streamingQuantity ${streamingQuantity} can not be lower than zero`);
286
307
  }
287
308
  if (isProtocolERC20Asset(fromAsset) && fromAddress) {
288
- const approveErrors = yield this.isRouterApprovedToSpend({
289
- asset: fromAsset,
290
- address: fromAddress,
291
- amount,
292
- });
293
- errors.push(...approveErrors);
309
+ if (!isTokenCryptoAmount(amount)) {
310
+ errors.push(`${xchainUtil.assetToString(amount.asset)} is not Token asset amount`);
311
+ }
312
+ else {
313
+ const approveErrors = yield this.isRouterApprovedToSpend({
314
+ asset: fromAsset,
315
+ address: fromAddress,
316
+ amount,
317
+ });
318
+ errors.push(...approveErrors);
319
+ }
294
320
  }
295
321
  return errors;
296
322
  });
@@ -657,7 +683,7 @@ class ThorchainAMM {
657
683
  return {
658
684
  memo: '',
659
685
  errors,
660
- value: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
686
+ value: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
661
687
  allowed: false,
662
688
  };
663
689
  }
@@ -670,7 +696,7 @@ class ThorchainAMM {
670
696
  return {
671
697
  memo: '',
672
698
  errors: ['message' in e ? e.message : `Unknown error: ${e}`],
673
- value: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
699
+ value: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
674
700
  allowed: false,
675
701
  };
676
702
  }
@@ -700,7 +726,7 @@ class ThorchainAMM {
700
726
  return {
701
727
  memo: '',
702
728
  errors,
703
- value: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
729
+ value: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0, xchainThorchain.RUNE_DECIMAL), xchainThorchain.AssetRuneNative),
704
730
  allowed: false,
705
731
  };
706
732
  }
@@ -753,6 +779,197 @@ class ThorchainAMM {
753
779
  });
754
780
  });
755
781
  }
782
+ /**
783
+ * Estimate adding trade amount to account
784
+ * @param {AddToTradeAccountParams} param Add to trade account params
785
+ * @returns {AddToTradeAccount} Estimation to add amount to trade account
786
+ */
787
+ estimateAddToTradeAccount({ amount, address }) {
788
+ return __awaiter(this, void 0, void 0, function* () {
789
+ const errors = [];
790
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, xchainThorchain.THORChain, address)) {
791
+ errors.push('Invalid trade account address');
792
+ }
793
+ let inboundDetails;
794
+ try {
795
+ inboundDetails = yield this.thorchainQuery.getChainInboundDetails(amount.asset.chain);
796
+ }
797
+ catch (_a) {
798
+ errors.push(`Can not get inbound address for ${amount.asset.chain}`);
799
+ }
800
+ if (errors.length) {
801
+ return {
802
+ allowed: false,
803
+ errors,
804
+ value: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0, amount.assetAmount.decimal), amount.asset),
805
+ memo: '',
806
+ toAddress: '',
807
+ };
808
+ }
809
+ return {
810
+ toAddress: inboundDetails ? inboundDetails.address : '',
811
+ memo: `TRADE+:${address}`,
812
+ value: amount,
813
+ allowed: true,
814
+ errors,
815
+ };
816
+ });
817
+ }
818
+ /**
819
+ * Add trade amount to account
820
+ * @param {AddToTradeAccountParams} param Add to trade account params
821
+ * @returns {TxSubmitted} Transaction made to add the trade amount
822
+ */
823
+ addToTradeAccount({ amount, address }) {
824
+ return __awaiter(this, void 0, void 0, function* () {
825
+ const quote = yield this.estimateAddToTradeAccount({ amount, address });
826
+ if (!quote.allowed)
827
+ throw Error(`Can not add to trade account. ${quote.errors.join(' ')}`);
828
+ return ThorchainAction.makeAction({
829
+ wallet: this.wallet,
830
+ assetAmount: quote.value,
831
+ memo: quote.memo,
832
+ recipient: quote.toAddress,
833
+ });
834
+ });
835
+ }
836
+ /**
837
+ * Estimate withdrawing trade amount from account
838
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
839
+ * @returns {WithdrawFromTradeAccount} Estimation to withdraw amount from trade account
840
+ */
841
+ estimateWithdrawFromTradeAccount({ amount, address, }) {
842
+ return __awaiter(this, void 0, void 0, function* () {
843
+ const errors = [];
844
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, amount.asset.chain, address)) {
845
+ errors.push('Invalid address to send the withdraw');
846
+ }
847
+ if (errors.length) {
848
+ return {
849
+ allowed: false,
850
+ errors,
851
+ value: new xchainUtil.CryptoAmount(xchainUtil.baseAmount(0, amount.assetAmount.decimal), amount.asset),
852
+ memo: '',
853
+ };
854
+ }
855
+ return {
856
+ memo: `TRADE-:${address}`,
857
+ value: amount,
858
+ allowed: true,
859
+ errors,
860
+ };
861
+ });
862
+ }
863
+ /**
864
+ * Withdraw trade amount from account
865
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
866
+ * @returns {TxSubmitted} Estimation to withdraw amount from trade account
867
+ */
868
+ withdrawFromTradeAccount({ amount, address }) {
869
+ return __awaiter(this, void 0, void 0, function* () {
870
+ const quote = yield this.estimateWithdrawFromTradeAccount({ amount, address });
871
+ if (!quote.allowed)
872
+ throw Error(`Can not withdraw from trade account. ${quote.errors.join(' ')}`);
873
+ return ThorchainAction.makeAction({
874
+ wallet: this.wallet,
875
+ assetAmount: quote.value,
876
+ memo: quote.memo,
877
+ });
878
+ });
879
+ }
880
+ /**
881
+ * Estimate Rune pool deposit
882
+ * @param {DepositToRunePoolParams} params Deposit to Rune pool params
883
+ * @returns {EstimateDepositToRunePool} Estimation to make the deposit
884
+ */
885
+ estimateDepositToRunePool({ amount }) {
886
+ return __awaiter(this, void 0, void 0, function* () {
887
+ const constants = yield this.thorchainQuery.thorchainCache.thornode.getTcConstants();
888
+ return {
889
+ allowed: true,
890
+ maturityBlocks: Number(constants['RUNEPoolDepositMaturityBlocks']),
891
+ amount,
892
+ errors: [],
893
+ memo: 'POOL+',
894
+ };
895
+ });
896
+ }
897
+ /**
898
+ * Deposit amount to Rune pool
899
+ * @param {DepositToRunePoolParams} amount Amount to deposit to Rune pool
900
+ * @returns {TxSubmitted} Transaction made to deposit to Rune pool
901
+ */
902
+ depositToRunePool(params) {
903
+ return __awaiter(this, void 0, void 0, function* () {
904
+ const quote = yield this.estimateDepositToRunePool(params);
905
+ if (!quote.allowed)
906
+ throw Error(`Can not deposit to Rune pool. ${quote.errors.join(' ')}`);
907
+ return ThorchainAction.makeAction({
908
+ wallet: this.wallet,
909
+ assetAmount: quote.amount,
910
+ memo: quote.memo,
911
+ });
912
+ });
913
+ }
914
+ /**
915
+ * Estimate Rune pool withdraw
916
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
917
+ * @returns {EstimateWithdrawFromRunePool} Estimation to make a withdraw from Rune pool
918
+ */
919
+ estimateWithdrawFromRunePool({ withdrawBps, affiliate, feeBps, }) {
920
+ return __awaiter(this, void 0, void 0, function* () {
921
+ const errors = [];
922
+ if (withdrawBps <= 0 || withdrawBps > 10000) {
923
+ errors.push('withdrawBps out of range. Range 0-10000');
924
+ }
925
+ if (affiliate) {
926
+ if (!validateAddress(this.thorchainQuery.thorchainCache.midgardQuery.midgardCache.midgard.network, xchainThorchain.THORChain, affiliate) &&
927
+ !(yield this.isTHORName(affiliate))) {
928
+ errors.push('Invalid affiliate. Affiliate must be a THORName or THOR address');
929
+ }
930
+ if (!feeBps || feeBps <= 0 || feeBps > 1000) {
931
+ errors.push('feeBps out of range. Range 0-1000');
932
+ }
933
+ }
934
+ if (errors.length) {
935
+ return {
936
+ amount: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0), xchainThorchain.AssetRuneNative),
937
+ memo: '',
938
+ allowed: false,
939
+ errors,
940
+ };
941
+ }
942
+ return {
943
+ amount: new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(0), xchainThorchain.AssetRuneNative),
944
+ memo: `POOL-:${withdrawBps}:${affiliate || ''}:${affiliate ? feeBps : ''}`,
945
+ allowed: true,
946
+ errors,
947
+ };
948
+ });
949
+ }
950
+ /**
951
+ * Withdraw amount from Rune pool
952
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
953
+ * @returns {TxSubmitted} Transaction made to withdraw from Rune pool
954
+ */
955
+ withdrawFromRunePool(params) {
956
+ return __awaiter(this, void 0, void 0, function* () {
957
+ const quote = yield this.estimateWithdrawFromRunePool(params);
958
+ if (!quote.allowed)
959
+ throw Error(`Can not withdraw from Rune pool. ${quote.errors.join(' ')}`);
960
+ return ThorchainAction.makeAction({
961
+ wallet: this.wallet,
962
+ assetAmount: quote.amount,
963
+ memo: quote.memo,
964
+ });
965
+ });
966
+ }
967
+ isTHORName(thorname) {
968
+ return __awaiter(this, void 0, void 0, function* () {
969
+ const details = yield this.thorchainQuery.getThornameDetails(thorname);
970
+ return details.owner !== '';
971
+ });
972
+ }
756
973
  }
757
974
 
758
975
  exports.ThorchainAMM = ThorchainAMM;
@@ -1,15 +1,16 @@
1
- import { Address, CryptoAmount } from '@xchainjs/xchain-util';
1
+ import { CompatibleAsset } from '@xchainjs/xchain-thorchain-query';
2
+ import { Address, Asset, CryptoAmount, TokenAsset } from '@xchainjs/xchain-util';
2
3
  import { Wallet } from '@xchainjs/xchain-wallet';
3
4
  import { TxSubmitted } from './types';
4
5
  export type NonProtocolActionParams = {
5
6
  wallet: Wallet;
6
- assetAmount: CryptoAmount;
7
+ assetAmount: CryptoAmount<Asset | TokenAsset>;
7
8
  recipient: Address;
8
9
  memo: string;
9
10
  };
10
11
  export type ProtocolActionParams = {
11
12
  wallet: Wallet;
12
- assetAmount: CryptoAmount;
13
+ assetAmount: CryptoAmount<CompatibleAsset>;
13
14
  memo: string;
14
15
  };
15
16
  export type ActionParams = ProtocolActionParams | NonProtocolActionParams;
@@ -1,7 +1,7 @@
1
1
  import { AddliquidityPosition, EstimateAddLP, EstimateAddSaver, EstimateWithdrawLP, EstimateWithdrawSaver, LoanCloseParams, LoanCloseQuote, LoanOpenParams, LoanOpenQuote, QuoteSwapParams, RegisterTHORName, SaversPosition, SaversWithdraw, ThorchainQuery, TxDetails, UpdateTHORName, WithdrawLiquidityPosition, getSaver } from '@xchainjs/xchain-thorchain-query';
2
- import { CryptoAmount } from '@xchainjs/xchain-util';
2
+ import { Asset, CryptoAmount, TokenAsset } from '@xchainjs/xchain-util';
3
3
  import { Wallet } from '@xchainjs/xchain-wallet';
4
- import { ApproveParams, IsApprovedParams, QuoteTHORName, TxSubmitted } from './types';
4
+ import { AddToTradeAccount, AddToTradeAccountParams, ApproveParams, DepositToRunePoolParams, EstimateDepositToRunePool, EstimateWithdrawFromRunePool, IsApprovedParams, QuoteTHORName, TxSubmitted, WithdrawFromRunePoolParams, WithdrawFromTradeAccount, WithdrawFromTradeAccountParams } from './types';
5
5
  /**
6
6
  * THORChain Class for interacting with THORChain.
7
7
  * Recommended main class to use for swapping with THORChain
@@ -84,7 +84,7 @@ export declare class ThorchainAMM {
84
84
  * @param addAssetAmount The amount to add to the saver.
85
85
  * @returns The estimated addition to the saver object.
86
86
  */
87
- estimateAddSaver(addAssetAmount: CryptoAmount): Promise<EstimateAddSaver>;
87
+ estimateAddSaver(addAssetAmount: CryptoAmount<Asset | TokenAsset>): Promise<EstimateAddSaver>;
88
88
  /**
89
89
  * Estimates withdrawing from a saver.
90
90
  * @param withdrawParams The parameters for withdrawing from the saver.
@@ -103,7 +103,7 @@ export declare class ThorchainAMM {
103
103
  * @param addAssetAmount - The amount to add to the saver.
104
104
  * @returns - The submitted transaction.
105
105
  */
106
- addSaver(addAssetAmount: CryptoAmount): Promise<TxSubmitted>;
106
+ addSaver(addAssetAmount: CryptoAmount<Asset | TokenAsset>): Promise<TxSubmitted>;
107
107
  /**
108
108
  * Withdraws assets from a saver.
109
109
  * @param withdrawParams - The parameters for withdrawing from the saver.
@@ -164,4 +164,53 @@ export declare class ThorchainAMM {
164
164
  * @returns {TxSubmitted} Transaction made to update the THORName
165
165
  */
166
166
  updateTHORName(params: UpdateTHORName): Promise<TxSubmitted>;
167
+ /**
168
+ * Estimate adding trade amount to account
169
+ * @param {AddToTradeAccountParams} param Add to trade account params
170
+ * @returns {AddToTradeAccount} Estimation to add amount to trade account
171
+ */
172
+ estimateAddToTradeAccount({ amount, address }: AddToTradeAccountParams): Promise<AddToTradeAccount>;
173
+ /**
174
+ * Add trade amount to account
175
+ * @param {AddToTradeAccountParams} param Add to trade account params
176
+ * @returns {TxSubmitted} Transaction made to add the trade amount
177
+ */
178
+ addToTradeAccount({ amount, address }: AddToTradeAccountParams): Promise<TxSubmitted>;
179
+ /**
180
+ * Estimate withdrawing trade amount from account
181
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
182
+ * @returns {WithdrawFromTradeAccount} Estimation to withdraw amount from trade account
183
+ */
184
+ estimateWithdrawFromTradeAccount({ amount, address, }: WithdrawFromTradeAccountParams): Promise<WithdrawFromTradeAccount>;
185
+ /**
186
+ * Withdraw trade amount from account
187
+ * @param {WithdrawFromTradeAccountParams} param Withdraw from trade account params
188
+ * @returns {TxSubmitted} Estimation to withdraw amount from trade account
189
+ */
190
+ withdrawFromTradeAccount({ amount, address }: WithdrawFromTradeAccountParams): Promise<TxSubmitted>;
191
+ /**
192
+ * Estimate Rune pool deposit
193
+ * @param {DepositToRunePoolParams} params Deposit to Rune pool params
194
+ * @returns {EstimateDepositToRunePool} Estimation to make the deposit
195
+ */
196
+ estimateDepositToRunePool({ amount }: DepositToRunePoolParams): Promise<EstimateDepositToRunePool>;
197
+ /**
198
+ * Deposit amount to Rune pool
199
+ * @param {DepositToRunePoolParams} amount Amount to deposit to Rune pool
200
+ * @returns {TxSubmitted} Transaction made to deposit to Rune pool
201
+ */
202
+ depositToRunePool(params: DepositToRunePoolParams): Promise<TxSubmitted>;
203
+ /**
204
+ * Estimate Rune pool withdraw
205
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
206
+ * @returns {EstimateWithdrawFromRunePool} Estimation to make a withdraw from Rune pool
207
+ */
208
+ estimateWithdrawFromRunePool({ withdrawBps, affiliate, feeBps, }: WithdrawFromRunePoolParams): Promise<EstimateWithdrawFromRunePool>;
209
+ /**
210
+ * Withdraw amount from Rune pool
211
+ * @param {WithdrawFromRunePoolParams} params Withdraw from Rune pool params
212
+ * @returns {TxSubmitted} Transaction made to withdraw from Rune pool
213
+ */
214
+ withdrawFromRunePool(params: WithdrawFromRunePoolParams): Promise<TxSubmitted>;
215
+ private isTHORName;
167
216
  }
package/lib/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Balance, FeeOption } from '@xchainjs/xchain-client';
2
2
  import { LiquidityPool, QuoteTHORName as BaseQuoteTHORName } from '@xchainjs/xchain-thorchain-query';
3
- import { Address, Asset, BaseAmount, Chain, CryptoAmount } from '@xchainjs/xchain-util';
3
+ import { Address, Asset, AssetCryptoAmount, BaseAmount, Chain, CryptoAmount, SynthAsset, TokenAsset, TradeCryptoAmount } from '@xchainjs/xchain-util';
4
4
  /**
5
5
  * Represents the balance information for all assets on a particular chain.
6
6
  */
@@ -13,8 +13,8 @@ export type AllBalances = {
13
13
  * Represents the parameters for executing a swap transaction.
14
14
  */
15
15
  export type ExecuteSwap = {
16
- input: CryptoAmount;
17
- destinationAsset: Asset;
16
+ input: CryptoAmount<Asset | TokenAsset | SynthAsset>;
17
+ destinationAsset: Asset | TokenAsset | SynthAsset;
18
18
  destinationAddress?: Address;
19
19
  memo: string;
20
20
  feeOption?: FeeOption;
@@ -32,16 +32,16 @@ export type TxSubmitted = {
32
32
  */
33
33
  export type LiquidityPosition = {
34
34
  assetPool: LiquidityPool;
35
- assetAmount: CryptoAmount;
36
- runeAmount: CryptoAmount;
35
+ assetAmount: CryptoAmount<Asset | TokenAsset>;
36
+ runeAmount: AssetCryptoAmount;
37
37
  impermanentLossProtection: number;
38
38
  };
39
39
  /**
40
40
  * Represents the parameters for adding liquidity to a pool.
41
41
  */
42
42
  export type AddLiquidity = {
43
- asset: CryptoAmount;
44
- rune: CryptoAmount;
43
+ asset: CryptoAmount<Asset | TokenAsset>;
44
+ rune: AssetCryptoAmount;
45
45
  waitTimeSeconds: number;
46
46
  assetPool: string;
47
47
  };
@@ -49,8 +49,8 @@ export type AddLiquidity = {
49
49
  * Represents the parameters for withdrawing liquidity from a pool.
50
50
  */
51
51
  export type WithdrawLiquidity = {
52
- assetFee: CryptoAmount;
53
- runeFee: CryptoAmount;
52
+ assetFee: CryptoAmount<Asset | TokenAsset>;
53
+ runeFee: AssetCryptoAmount;
54
54
  waitTimeSeconds: number;
55
55
  percentage: number;
56
56
  assetPool: string;
@@ -106,13 +106,13 @@ export type UpdateThornameParams = {
106
106
  expirity?: Date;
107
107
  };
108
108
  export type IsApprovedParams = {
109
- asset: Asset;
110
- amount: CryptoAmount;
109
+ asset: TokenAsset;
110
+ amount: CryptoAmount<TokenAsset>;
111
111
  address: Address;
112
112
  };
113
113
  export type ApproveParams = {
114
- asset: Asset;
115
- amount: CryptoAmount | undefined;
114
+ asset: TokenAsset;
115
+ amount?: CryptoAmount<TokenAsset>;
116
116
  };
117
117
  /**
118
118
  * Estimation quote to register or update a THORName
@@ -127,3 +127,147 @@ export type QuoteTHORName = BaseQuoteTHORName & {
127
127
  */
128
128
  errors: string[];
129
129
  };
130
+ /**
131
+ * Add to trade account params
132
+ */
133
+ export type AddToTradeAccountParams = {
134
+ /**
135
+ * Amount to add to the account
136
+ */
137
+ amount: CryptoAmount<Asset | TokenAsset>;
138
+ /**
139
+ * Trade account address
140
+ */
141
+ address: Address;
142
+ };
143
+ /**
144
+ * Estimation to add amount to trade account
145
+ */
146
+ export type AddToTradeAccount = {
147
+ /**
148
+ * Address to send transaction
149
+ */
150
+ toAddress: string;
151
+ /**
152
+ * Memo to add to the transaction to add the trade amount
153
+ */
154
+ memo: string;
155
+ /**
156
+ * Amount to send to the address
157
+ */
158
+ value: CryptoAmount<Asset | TokenAsset>;
159
+ /**
160
+ * If the action can be or not can be done
161
+ */
162
+ allowed: boolean;
163
+ /**
164
+ * If any, list of errors with the reason the operation is not allowed
165
+ */
166
+ errors: string[];
167
+ };
168
+ /**
169
+ * Withdraw from trade account params
170
+ */
171
+ export type WithdrawFromTradeAccountParams = {
172
+ /**
173
+ * Amount to withdraw from the account
174
+ */
175
+ amount: TradeCryptoAmount;
176
+ /**
177
+ * Address to make to the withdraw to
178
+ */
179
+ address: Address;
180
+ };
181
+ /**
182
+ * Estimation to add amount to trade account
183
+ */
184
+ export type WithdrawFromTradeAccount = {
185
+ /**
186
+ * Memo to add to the transaction to add the trade amount
187
+ */
188
+ memo: string;
189
+ /**
190
+ * Amount to send to the address
191
+ */
192
+ value: TradeCryptoAmount;
193
+ /**
194
+ * If the action can be or not can be done
195
+ */
196
+ allowed: boolean;
197
+ /**
198
+ * If any, list of errors with the reason the operation is not allowed
199
+ */
200
+ errors: string[];
201
+ };
202
+ /**
203
+ * Estimation to quote to deposit to Rune pool
204
+ */
205
+ export type EstimateDepositToRunePool = {
206
+ /**
207
+ * Amount to send in the transaction to make the deposit
208
+ */
209
+ amount: AssetCryptoAmount;
210
+ /**
211
+ * Memo to send in the transaction to make the deposit
212
+ */
213
+ memo: string;
214
+ /**
215
+ * Number of blocks from the last deposit that a withdraw is allowed
216
+ */
217
+ maturityBlocks: number;
218
+ /**
219
+ * If the action can be or not can be done
220
+ */
221
+ allowed: boolean;
222
+ /**
223
+ * If any, list of errors with the reason the operation is not allowed
224
+ */
225
+ errors: string[];
226
+ };
227
+ /**
228
+ * Deposit to Rune pool params
229
+ */
230
+ export type DepositToRunePoolParams = {
231
+ /**
232
+ * Rune amount to deposit to the Rune pool
233
+ */
234
+ amount: AssetCryptoAmount;
235
+ };
236
+ /**
237
+ * Estimation to quote to withdraw from Rune pool
238
+ */
239
+ export type EstimateWithdrawFromRunePool = {
240
+ /**
241
+ * Amount to send in the transaction to make the withdraw
242
+ */
243
+ amount: AssetCryptoAmount;
244
+ /**
245
+ * Memo to send in the transaction to make the withdraw
246
+ */
247
+ memo: string;
248
+ /**
249
+ * If the action can be or not can be done
250
+ */
251
+ allowed: boolean;
252
+ /**
253
+ * If any, list of errors with the reason the operation is not allowed
254
+ */
255
+ errors: string[];
256
+ };
257
+ /**
258
+ * Withdraw from Rune pool params
259
+ */
260
+ export type WithdrawFromRunePoolParams = {
261
+ /**
262
+ * Basis points to retrieve from the Rune pool position. Range 0-10000, where 10000 = 100%.
263
+ */
264
+ withdrawBps: number;
265
+ /**
266
+ * Affiliate address
267
+ */
268
+ affiliate?: Address;
269
+ /**
270
+ * Basis points to send to the affiliate address. Ranges from 0 to 1000 Basis Points.
271
+ */
272
+ feeBps?: number;
273
+ };
package/lib/utils.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Network } from '@xchainjs/xchain-client';
2
- import { Address, Asset, Chain } from '@xchainjs/xchain-util';
2
+ import { CompatibleAsset } from '@xchainjs/xchain-thorchain-query';
3
+ import { Address, Chain, CryptoAmount, TokenAsset, TokenCryptoAmount } from '@xchainjs/xchain-util';
3
4
  /**
4
5
  * Check if a chain is EVM and supported by the protocol
5
6
  * @param {Chain} chain to check
@@ -11,7 +12,13 @@ export declare const isProtocolEVMChain: (chain: Chain) => boolean;
11
12
  * @param {Asset} asset to check
12
13
  * @returns true if asset is ERC20, otherwise, false
13
14
  */
14
- export declare const isProtocolERC20Asset: (asset: Asset) => boolean;
15
+ export declare const isProtocolERC20Asset: (asset: CompatibleAsset) => asset is TokenAsset;
16
+ /**
17
+ * Check if asset is ERC20
18
+ * @param {Asset} asset to check
19
+ * @returns true if asset is ERC20, otherwise, false
20
+ */
21
+ export declare const isTokenCryptoAmount: (amount: CryptoAmount) => amount is TokenCryptoAmount;
15
22
  /**
16
23
  * Check if a chain is EVM and supported by the protocol
17
24
  * @param {Chain} chain to check
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain-amm",
3
- "version": "1.1.17",
3
+ "version": "2.0.0",
4
4
  "description": "module that exposes estimating & swappping cryptocurrency assets on thorchain",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -36,21 +36,21 @@
36
36
  "url": "https://github.com/xchainjs/xchainjs-lib/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@xchainjs/xchain-avax": "0.5.6",
40
- "@xchainjs/xchain-binance": "5.7.17",
41
- "@xchainjs/xchain-bitcoin": "0.23.19",
42
- "@xchainjs/xchain-bitcoincash": "0.17.17",
43
- "@xchainjs/xchain-bsc": "0.5.6",
44
- "@xchainjs/xchain-client": "0.16.8",
45
- "@xchainjs/xchain-cosmos": "1.1.6",
46
- "@xchainjs/xchain-doge": "0.7.20",
47
- "@xchainjs/xchain-ethereum": "0.32.6",
48
- "@xchainjs/xchain-evm": "0.6.4",
49
- "@xchainjs/xchain-litecoin": "0.14.6",
50
- "@xchainjs/xchain-thorchain": "1.1.1",
51
- "@xchainjs/xchain-thorchain-query": "0.7.16",
52
- "@xchainjs/xchain-util": "0.13.7",
53
- "@xchainjs/xchain-wallet": "0.1.19",
39
+ "@xchainjs/xchain-avax": "1.0.0",
40
+ "@xchainjs/xchain-binance": "6.0.0",
41
+ "@xchainjs/xchain-bitcoin": "1.0.0",
42
+ "@xchainjs/xchain-bitcoincash": "1.0.0",
43
+ "@xchainjs/xchain-bsc": "1.0.0",
44
+ "@xchainjs/xchain-client": "1.0.0",
45
+ "@xchainjs/xchain-cosmos": "2.0.0",
46
+ "@xchainjs/xchain-doge": "1.0.0",
47
+ "@xchainjs/xchain-ethereum": "1.0.0",
48
+ "@xchainjs/xchain-evm": "1.0.0",
49
+ "@xchainjs/xchain-litecoin": "1.0.0",
50
+ "@xchainjs/xchain-thorchain": "2.0.0",
51
+ "@xchainjs/xchain-thorchain-query": "1.0.0",
52
+ "@xchainjs/xchain-util": "1.0.0",
53
+ "@xchainjs/xchain-wallet": "1.0.0",
54
54
  "ethers": "5.7.2"
55
55
  },
56
56
  "devDependencies": {