@xchainjs/xchain-thorchain-amm 0.3.3 → 0.3.5

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
@@ -422,7 +422,7 @@ class EthHelper {
422
422
  */
423
423
  sendDeposit(params) {
424
424
  return __awaiter(this, void 0, void 0, function* () {
425
- const inboundAsgard = (yield this.thorchainCache.getInboundAddresses())[params.asset.chain];
425
+ const inboundAsgard = (yield this.thorchainCache.getInboundDetails())[params.asset.chain];
426
426
  if (!(inboundAsgard === null || inboundAsgard === void 0 ? void 0 : inboundAsgard.router)) {
427
427
  throw new Error('router address is not defined');
428
428
  }
@@ -517,7 +517,7 @@ class EvmHelper {
517
517
  */
518
518
  sendDeposit(params) {
519
519
  return __awaiter(this, void 0, void 0, function* () {
520
- const inboundAsgard = (yield this.thorchainCache.getInboundAddresses())[params.asset.chain];
520
+ const inboundAsgard = (yield this.thorchainCache.getInboundDetails())[params.asset.chain];
521
521
  if (!(inboundAsgard === null || inboundAsgard === void 0 ? void 0 : inboundAsgard.router)) {
522
522
  throw new Error('router address is not defined');
523
523
  }
@@ -1015,14 +1015,14 @@ class ThorchainAMM {
1015
1015
 
1016
1016
  * @returns The SwapEstimate
1017
1017
  */
1018
- estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = 999, affiliateFeePercent = 0, slipLimit, }) {
1018
+ estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = `555`, affiliateFeeBasisPoints = 0, slipLimit, }) {
1019
1019
  return this.thorchainQuery.estimateSwap({
1020
1020
  input,
1021
1021
  destinationAsset,
1022
1022
  destinationAddress,
1023
1023
  affiliateAddress,
1024
1024
  interfaceID,
1025
- affiliateFeePercent,
1025
+ affiliateFeeBasisPoints,
1026
1026
  slipLimit,
1027
1027
  });
1028
1028
  }
@@ -1100,8 +1100,8 @@ class ThorchainAMM {
1100
1100
  // Caution Dust Limits: BTC,BCH,LTC chains 10k sats; DOGE 1m Sats; ETH 0 wei; THOR 0 RUNE.
1101
1101
  const withdrawParams = yield this.thorchainQuery.estimateWithdrawLP(params);
1102
1102
  return wallet.withdrawLiquidity({
1103
- assetFee: withdrawParams.transactionFee.assetFee,
1104
- runeFee: withdrawParams.transactionFee.runeFee,
1103
+ assetFee: withdrawParams.inbound.fees.asset,
1104
+ runeFee: withdrawParams.inbound.fees.rune,
1105
1105
  waitTimeSeconds: withdrawParams.estimatedWaitSeconds,
1106
1106
  percentage: params.percentage,
1107
1107
  assetPool: withdrawParams.assetPool,
package/lib/index.js CHANGED
@@ -426,7 +426,7 @@ class EthHelper {
426
426
  */
427
427
  sendDeposit(params) {
428
428
  return __awaiter(this, void 0, void 0, function* () {
429
- const inboundAsgard = (yield this.thorchainCache.getInboundAddresses())[params.asset.chain];
429
+ const inboundAsgard = (yield this.thorchainCache.getInboundDetails())[params.asset.chain];
430
430
  if (!(inboundAsgard === null || inboundAsgard === void 0 ? void 0 : inboundAsgard.router)) {
431
431
  throw new Error('router address is not defined');
432
432
  }
@@ -521,7 +521,7 @@ class EvmHelper {
521
521
  */
522
522
  sendDeposit(params) {
523
523
  return __awaiter(this, void 0, void 0, function* () {
524
- const inboundAsgard = (yield this.thorchainCache.getInboundAddresses())[params.asset.chain];
524
+ const inboundAsgard = (yield this.thorchainCache.getInboundDetails())[params.asset.chain];
525
525
  if (!(inboundAsgard === null || inboundAsgard === void 0 ? void 0 : inboundAsgard.router)) {
526
526
  throw new Error('router address is not defined');
527
527
  }
@@ -1019,14 +1019,14 @@ class ThorchainAMM {
1019
1019
 
1020
1020
  * @returns The SwapEstimate
1021
1021
  */
1022
- estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = 999, affiliateFeePercent = 0, slipLimit, }) {
1022
+ estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = `555`, affiliateFeeBasisPoints = 0, slipLimit, }) {
1023
1023
  return this.thorchainQuery.estimateSwap({
1024
1024
  input,
1025
1025
  destinationAsset,
1026
1026
  destinationAddress,
1027
1027
  affiliateAddress,
1028
1028
  interfaceID,
1029
- affiliateFeePercent,
1029
+ affiliateFeeBasisPoints,
1030
1030
  slipLimit,
1031
1031
  });
1032
1032
  }
@@ -1104,8 +1104,8 @@ class ThorchainAMM {
1104
1104
  // Caution Dust Limits: BTC,BCH,LTC chains 10k sats; DOGE 1m Sats; ETH 0 wei; THOR 0 RUNE.
1105
1105
  const withdrawParams = yield this.thorchainQuery.estimateWithdrawLP(params);
1106
1106
  return wallet.withdrawLiquidity({
1107
- assetFee: withdrawParams.transactionFee.assetFee,
1108
- runeFee: withdrawParams.transactionFee.runeFee,
1107
+ assetFee: withdrawParams.inbound.fees.asset,
1108
+ runeFee: withdrawParams.inbound.fees.rune,
1109
1109
  waitTimeSeconds: withdrawParams.estimatedWaitSeconds,
1110
1110
  percentage: params.percentage,
1111
1111
  assetPool: withdrawParams.assetPool,
@@ -23,7 +23,7 @@ export declare class ThorchainAMM {
23
23
 
24
24
  * @returns The SwapEstimate
25
25
  */
26
- estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress, interfaceID, affiliateFeePercent, slipLimit, }: EstimateSwapParams): Promise<TxDetails>;
26
+ estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress, interfaceID, affiliateFeeBasisPoints, slipLimit, }: EstimateSwapParams): Promise<TxDetails>;
27
27
  /**
28
28
  * Conducts a swap with the given inputs. Should be called after estimateSwap() to ensure the swap is valid
29
29
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain-amm",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "module that exposes estimating & swappping cryptocurrency assets on thorchain",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -50,10 +50,10 @@
50
50
  "@xchainjs/xchain-ethereum": "^0.27.0",
51
51
  "@xchainjs/xchain-evm": "^0.1.0",
52
52
  "@xchainjs/xchain-avax": "^0.1.0",
53
- "@xchainjs/xchain-litecoin": "^0.10.3",
53
+ "@xchainjs/xchain-litecoin": "^0.10.5",
54
54
  "@xchainjs/xchain-midgard": "0.2.0",
55
55
  "@xchainjs/xchain-thorchain": "^0.27.0",
56
- "@xchainjs/xchain-thorchain-query": "^0.1.4",
56
+ "@xchainjs/xchain-thorchain-query": "^0.1.6",
57
57
  "@xchainjs/xchain-thornode": "^0.1.1",
58
58
  "@xchainjs/xchain-util": "^0.11.0",
59
59
  "axios": "^0.25.0",