@openocean.finance/openocean-sdk 1.2.84 → 1.2.86

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