@xchainjs/xchain-mayachain-amm 2.0.12 → 2.0.14

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
@@ -89701,7 +89701,7 @@ class MayachainAMM {
89701
89701
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
89702
89702
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
89703
89703
  */
89704
- estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }) {
89704
+ estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }) {
89705
89705
  return __awaiter$8(this, void 0, void 0, function* () {
89706
89706
  const errors = yield this.validateSwap({
89707
89707
  fromAsset,
@@ -89711,6 +89711,8 @@ class MayachainAMM {
89711
89711
  destinationAddress,
89712
89712
  affiliateAddress,
89713
89713
  affiliateBps,
89714
+ streamingInterval,
89715
+ streamingQuantity,
89714
89716
  });
89715
89717
  if (errors.length > 0) {
89716
89718
  return {
@@ -89722,6 +89724,8 @@ class MayachainAMM {
89722
89724
  asset: destinationAsset,
89723
89725
  affiliateFee: new CryptoAmount(baseAmount(0), destinationAsset),
89724
89726
  outboundFee: new CryptoAmount(baseAmount(0), destinationAsset),
89727
+ liquidityFee: new CryptoAmount(baseAmount(0), destinationAsset),
89728
+ totalFee: new CryptoAmount(baseAmount(0), destinationAsset),
89725
89729
  },
89726
89730
  outboundDelayBlocks: 0,
89727
89731
  outboundDelaySeconds: 0,
@@ -89731,6 +89735,7 @@ class MayachainAMM {
89731
89735
  errors,
89732
89736
  slipBasisPoints: 0,
89733
89737
  totalSwapSeconds: 0,
89738
+ expiry: 0,
89734
89739
  warning: '',
89735
89740
  };
89736
89741
  }
@@ -89743,6 +89748,8 @@ class MayachainAMM {
89743
89748
  affiliateAddress,
89744
89749
  affiliateBps,
89745
89750
  toleranceBps,
89751
+ streamingInterval,
89752
+ streamingQuantity,
89746
89753
  });
89747
89754
  });
89748
89755
  }
@@ -89752,7 +89759,7 @@ class MayachainAMM {
89752
89759
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
89753
89760
  * @returns {string[]} Reasons the swap cannot be executed. Empty array if the swap is valid.
89754
89761
  */
89755
- validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, }) {
89762
+ validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, streamingInterval, streamingQuantity, }) {
89756
89763
  return __awaiter$8(this, void 0, void 0, function* () {
89757
89764
  const errors = [];
89758
89765
  // Validate destination address if provided
@@ -89780,6 +89787,12 @@ class MayachainAMM {
89780
89787
  });
89781
89788
  errors.push(...approveErrors);
89782
89789
  }
89790
+ if (streamingQuantity && streamingQuantity < 0) {
89791
+ errors.push('streaming quantity can not be lower than 0');
89792
+ }
89793
+ if (streamingInterval && streamingInterval < 0) {
89794
+ errors.push('streaming interval can not be lower than 0');
89795
+ }
89783
89796
  return errors;
89784
89797
  });
89785
89798
  }
package/lib/index.js CHANGED
@@ -89709,7 +89709,7 @@ class MayachainAMM {
89709
89709
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
89710
89710
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
89711
89711
  */
89712
- estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }) {
89712
+ estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }) {
89713
89713
  return __awaiter$8(this, void 0, void 0, function* () {
89714
89714
  const errors = yield this.validateSwap({
89715
89715
  fromAsset,
@@ -89719,6 +89719,8 @@ class MayachainAMM {
89719
89719
  destinationAddress,
89720
89720
  affiliateAddress,
89721
89721
  affiliateBps,
89722
+ streamingInterval,
89723
+ streamingQuantity,
89722
89724
  });
89723
89725
  if (errors.length > 0) {
89724
89726
  return {
@@ -89730,6 +89732,8 @@ class MayachainAMM {
89730
89732
  asset: destinationAsset,
89731
89733
  affiliateFee: new CryptoAmount(baseAmount(0), destinationAsset),
89732
89734
  outboundFee: new CryptoAmount(baseAmount(0), destinationAsset),
89735
+ liquidityFee: new CryptoAmount(baseAmount(0), destinationAsset),
89736
+ totalFee: new CryptoAmount(baseAmount(0), destinationAsset),
89733
89737
  },
89734
89738
  outboundDelayBlocks: 0,
89735
89739
  outboundDelaySeconds: 0,
@@ -89739,6 +89743,7 @@ class MayachainAMM {
89739
89743
  errors,
89740
89744
  slipBasisPoints: 0,
89741
89745
  totalSwapSeconds: 0,
89746
+ expiry: 0,
89742
89747
  warning: '',
89743
89748
  };
89744
89749
  }
@@ -89751,6 +89756,8 @@ class MayachainAMM {
89751
89756
  affiliateAddress,
89752
89757
  affiliateBps,
89753
89758
  toleranceBps,
89759
+ streamingInterval,
89760
+ streamingQuantity,
89754
89761
  });
89755
89762
  });
89756
89763
  }
@@ -89760,7 +89767,7 @@ class MayachainAMM {
89760
89767
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
89761
89768
  * @returns {string[]} Reasons the swap cannot be executed. Empty array if the swap is valid.
89762
89769
  */
89763
- validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, }) {
89770
+ validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, streamingInterval, streamingQuantity, }) {
89764
89771
  return __awaiter$8(this, void 0, void 0, function* () {
89765
89772
  const errors = [];
89766
89773
  // Validate destination address if provided
@@ -89788,6 +89795,12 @@ class MayachainAMM {
89788
89795
  });
89789
89796
  errors.push(...approveErrors);
89790
89797
  }
89798
+ if (streamingQuantity && streamingQuantity < 0) {
89799
+ errors.push('streaming quantity can not be lower than 0');
89800
+ }
89801
+ if (streamingInterval && streamingInterval < 0) {
89802
+ errors.push('streaming interval can not be lower than 0');
89803
+ }
89791
89804
  return errors;
89792
89805
  });
89793
89806
  }
@@ -25,14 +25,14 @@ export declare class MayachainAMM {
25
25
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
26
26
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
27
27
  */
28
- estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }: QuoteSwapParams): Promise<QuoteSwap>;
28
+ estimateSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }: QuoteSwapParams): Promise<QuoteSwap>;
29
29
  /**
30
30
  * Validate swap parameters before performing a swap operation.
31
31
  *
32
32
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters.
33
33
  * @returns {string[]} Reasons the swap cannot be executed. Empty array if the swap is valid.
34
34
  */
35
- validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, }: QuoteSwapParams): Promise<string[]>;
35
+ validateSwap({ fromAsset, fromAddress, destinationAsset, destinationAddress, amount, affiliateAddress, affiliateBps, streamingInterval, streamingQuantity, }: QuoteSwapParams): Promise<string[]>;
36
36
  /**
37
37
  * Perform a swap operation between assets.
38
38
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-mayachain-amm",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "module that exposes estimating & swapping cryptocurrency assets on mayachain",
5
5
  "keywords": [
6
6
  "MAYAChain",
@@ -43,7 +43,7 @@
43
43
  "@xchainjs/xchain-ethereum": "0.32.6",
44
44
  "@xchainjs/xchain-kujira": "0.1.21",
45
45
  "@xchainjs/xchain-mayachain": "1.0.11",
46
- "@xchainjs/xchain-mayachain-query": "0.1.19",
46
+ "@xchainjs/xchain-mayachain-query": "0.1.21",
47
47
  "@xchainjs/xchain-thorchain": "1.1.1",
48
48
  "@xchainjs/xchain-wallet": "0.1.19",
49
49
  "ethers": "5.7.2"