@openocean.finance/openocean-sdk 1.2.87 → 1.2.88

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.
@@ -617,14 +617,14 @@ var Swap = /** @class */ (function () {
617
617
  };
618
618
  Swap.prototype.sendEthTransactionNew = function () {
619
619
  return __awaiter(this, void 0, void 0, function () {
620
- var _a, inToken, inAmount, outAmount, outToken, data, to, ethGasPrice, gasPrice, value, myWallet, contract, invitee, path, amounts, swapAddr, swapExtraData, swapParams, maxFeePerGas, maxPriorityFeePerGas;
620
+ var _a, inToken, inAmount, outAmount, outToken, data, to, ethGasPrice, gasPrice, gmxFee, myWallet, contract, invitee, path, amounts, swapAddr, swapExtraData, swapParams, maxFeePerGas, maxPriorityFeePerGas;
621
621
  var _b;
622
622
  var _this = this;
623
623
  return __generator(this, function (_c) {
624
624
  switch (_c.label) {
625
625
  case 0:
626
- _a = this.res, inToken = _a.inToken, inAmount = _a.inAmount, outAmount = _a.outAmount, outToken = _a.outToken, data = _a.data, to = _a.to, ethGasPrice = _a.ethGasPrice, gasPrice = _a.gasPrice, value = _a.value;
627
- console.log('sendEthTransactionNew');
626
+ _a = this.res, inToken = _a.inToken, inAmount = _a.inAmount, outAmount = _a.outAmount, outToken = _a.outToken, data = _a.data, to = _a.to, ethGasPrice = _a.ethGasPrice, gasPrice = _a.gasPrice, gmxFee = _a.gmxFee;
627
+ console.log('sendEthTransactionNew', JSON.stringify(this.res));
628
628
  myWallet = this.wallet.sdk;
629
629
  contract = new myWallet.eth.Contract(aggregator_1.aggregator, (0, config_1.getProxyContract)(this.chain.key));
630
630
  invitee = this.wallet.address;
@@ -654,8 +654,8 @@ var Swap = /** @class */ (function () {
654
654
  if (wallet_1.chainsObj.isNativeToken(this.chain.key, inToken.address)) {
655
655
  swapParams.value = inAmount;
656
656
  }
657
- else if (value) {
658
- swapParams.value = value;
657
+ if (gmxFee) {
658
+ swapParams.value = new bn_js_1.default(swapParams.value).add(new bn_js_1.default(gmxFee)).toNumber();
659
659
  }
660
660
  contract.methods
661
661
  .swap(invitee, path, amounts, swapAddr, swapExtraData)
@@ -677,12 +677,12 @@ var Swap = /** @class */ (function () {
677
677
  };
678
678
  Swap.prototype.sendEthTransaction = function () {
679
679
  return __awaiter(this, void 0, void 0, function () {
680
- var _a, inToken, inAmount, data, to, ethGasPrice, gasPrice, estimatedGas, value, swapParams, maxFeePerGas, maxPriorityFeePerGas, safeTxHash, e_6, gas, e_7;
680
+ var _a, inToken, inAmount, data, to, ethGasPrice, gasPrice, estimatedGas, gmxFee, swapParams, maxFeePerGas, maxPriorityFeePerGas, safeTxHash, e_6, gas, e_7;
681
681
  var _this = this;
682
682
  return __generator(this, function (_b) {
683
683
  switch (_b.label) {
684
684
  case 0:
685
- _a = this.res, inToken = _a.inToken, inAmount = _a.inAmount, data = _a.data, to = _a.to, ethGasPrice = _a.ethGasPrice, gasPrice = _a.gasPrice, estimatedGas = _a.estimatedGas, value = _a.value;
685
+ _a = this.res, inToken = _a.inToken, inAmount = _a.inAmount, data = _a.data, to = _a.to, ethGasPrice = _a.ethGasPrice, gasPrice = _a.gasPrice, estimatedGas = _a.estimatedGas, gmxFee = _a.gmxFee;
686
686
  console.log('sendEthTransaction res', JSON.stringify(this.res));
687
687
  swapParams = {
688
688
  from: this.wallet.address,
@@ -702,8 +702,8 @@ var Swap = /** @class */ (function () {
702
702
  if (wallet_1.chainsObj.isNativeToken(this.chain.key, inToken.address)) {
703
703
  swapParams.value = inAmount;
704
704
  }
705
- else if (value) {
706
- swapParams.value = value;
705
+ if (gmxFee) {
706
+ swapParams.value = new bn_js_1.default(swapParams.value).add(new bn_js_1.default(gmxFee)).toNumber();
707
707
  }
708
708
  console.log('sendEthTransaction swapParams', JSON.stringify(swapParams));
709
709
  if (!(this.wallet.key === "GnosisSafeWallet")) return [3 /*break*/, 5];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/openocean-sdk",
3
- "version": "1.2.87",
3
+ "version": "1.2.88",
4
4
  "description": "Openocean sdk",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {