@xchainjs/xchain-mayachain-amm 3.0.13 → 3.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
@@ -85203,15 +85203,16 @@ class MayachainAction {
85203
85203
  const gasPrices = yield wallet.getFeeRates(assetAmount.asset.chain);
85204
85204
  const unsignedTx = yield routerContract.populateTransaction.depositWithExpiry(...depositParams);
85205
85205
  const nativeAsset = wallet.getAssetInfo(assetAmount.asset.chain);
85206
- const hash = yield wallet.transfer({
85206
+ const tx = {
85207
85207
  asset: nativeAsset.asset,
85208
85208
  amount: isERC20 ? baseAmount(0, nativeAsset.decimal) : assetAmount.baseAmount,
85209
85209
  memo: unsignedTx.data,
85210
85210
  recipient: inboundDetails.router,
85211
85211
  gasPrice: gasPrices.fast,
85212
85212
  isMemoEncoded: true,
85213
- gasLimit: ethers.BigNumber.from(160000),
85214
- });
85213
+ };
85214
+ const gasLimit = yield wallet.estimateGasLimit(tx);
85215
+ const hash = yield wallet.transfer(Object.assign(Object.assign({}, tx), { gasLimit }));
85215
85216
  return {
85216
85217
  hash,
85217
85218
  url: yield wallet.getExplorerTxUrl(assetAmount.asset.chain, hash),
@@ -85366,7 +85367,7 @@ class MayachainAMM {
85366
85367
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters
85367
85368
  * @returns {TxSubmitted} Transaction hash and URL of the swap
85368
85369
  */
85369
- doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }) {
85370
+ doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }) {
85370
85371
  return __awaiter(this, void 0, void 0, function* () {
85371
85372
  const quoteSwap = yield this.estimateSwap({
85372
85373
  fromAsset,
@@ -85377,6 +85378,8 @@ class MayachainAMM {
85377
85378
  affiliateAddress,
85378
85379
  affiliateBps,
85379
85380
  toleranceBps,
85381
+ streamingInterval,
85382
+ streamingQuantity,
85380
85383
  });
85381
85384
  // Check if the swap can be performed
85382
85385
  if (!quoteSwap.canSwap)
package/lib/index.js CHANGED
@@ -85205,15 +85205,16 @@ class MayachainAction {
85205
85205
  const gasPrices = yield wallet.getFeeRates(assetAmount.asset.chain);
85206
85206
  const unsignedTx = yield routerContract.populateTransaction.depositWithExpiry(...depositParams);
85207
85207
  const nativeAsset = wallet.getAssetInfo(assetAmount.asset.chain);
85208
- const hash = yield wallet.transfer({
85208
+ const tx = {
85209
85209
  asset: nativeAsset.asset,
85210
85210
  amount: isERC20 ? baseAmount(0, nativeAsset.decimal) : assetAmount.baseAmount,
85211
85211
  memo: unsignedTx.data,
85212
85212
  recipient: inboundDetails.router,
85213
85213
  gasPrice: gasPrices.fast,
85214
85214
  isMemoEncoded: true,
85215
- gasLimit: ethers.ethers.BigNumber.from(160000),
85216
- });
85215
+ };
85216
+ const gasLimit = yield wallet.estimateGasLimit(tx);
85217
+ const hash = yield wallet.transfer(Object.assign(Object.assign({}, tx), { gasLimit }));
85217
85218
  return {
85218
85219
  hash,
85219
85220
  url: yield wallet.getExplorerTxUrl(assetAmount.asset.chain, hash),
@@ -85368,7 +85369,7 @@ class MayachainAMM {
85368
85369
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters
85369
85370
  * @returns {TxSubmitted} Transaction hash and URL of the swap
85370
85371
  */
85371
- doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }) {
85372
+ doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }) {
85372
85373
  return __awaiter(this, void 0, void 0, function* () {
85373
85374
  const quoteSwap = yield this.estimateSwap({
85374
85375
  fromAsset,
@@ -85379,6 +85380,8 @@ class MayachainAMM {
85379
85380
  affiliateAddress,
85380
85381
  affiliateBps,
85381
85382
  toleranceBps,
85383
+ streamingInterval,
85384
+ streamingQuantity,
85382
85385
  });
85383
85386
  // Check if the swap can be performed
85384
85387
  if (!quoteSwap.canSwap)
@@ -38,7 +38,7 @@ export declare class MayachainAMM {
38
38
  * @param {QuoteSwapParams} quoteSwapParams Swap parameters
39
39
  * @returns {TxSubmitted} Transaction hash and URL of the swap
40
40
  */
41
- doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, }: QuoteSwapParams): Promise<TxSubmitted>;
41
+ doSwap({ fromAsset, fromAddress, amount, destinationAsset, destinationAddress, affiliateAddress, affiliateBps, toleranceBps, streamingInterval, streamingQuantity, }: QuoteSwapParams): Promise<TxSubmitted>;
42
42
  /**
43
43
  * Approve the Mayachain router to spend a certain amount in the asset chain.
44
44
  * @param {ApproveParams} approveParams Parameters for approving the router to spend
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-mayachain-amm",
3
- "version": "3.0.13",
3
+ "version": "3.0.14",
4
4
  "description": "module that exposes estimating & swapping cryptocurrency assets on mayachain",
5
5
  "keywords": [
6
6
  "MAYAChain",
@@ -46,7 +46,7 @@
46
46
  "@xchainjs/xchain-mayachain-query": "1.0.7",
47
47
  "@xchainjs/xchain-radix": "1.1.4",
48
48
  "@xchainjs/xchain-thorchain": "2.0.8",
49
- "@xchainjs/xchain-wallet": "1.0.12",
49
+ "@xchainjs/xchain-wallet": "1.1.0",
50
50
  "ethers": "5.7.2"
51
51
  },
52
52
  "devDependencies": {