@openocean.finance/openocean-sdk 1.6.26 → 1.6.28

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.
@@ -670,7 +670,9 @@ var Swap = /** @class */ (function () {
670
670
  _this.transactionHashCallback(transactionHash);
671
671
  })
672
672
  .on("receipt", function (receipt) {
673
- _this.receiptCallback(receipt);
673
+ console.log('receipt', receipt);
674
+ var transactionHash = (receipt || {}).transactionHash;
675
+ _this.receiptCallback(transactionHash);
674
676
  // this.getSuccess()
675
677
  });
676
678
  return [2 /*return*/];
@@ -764,8 +766,9 @@ var Swap = /** @class */ (function () {
764
766
  _this.transactionHashCallback(transactionHash);
765
767
  })
766
768
  .on("receipt", function (receipt) {
767
- _this.receiptCallback(receipt);
768
- // this.getSuccess()
769
+ console.log('receipt', receipt);
770
+ var transactionHash = (receipt || {}).transactionHash;
771
+ _this.receiptCallback(transactionHash);
769
772
  });
770
773
  return [2 /*return*/];
771
774
  }
@@ -120,7 +120,16 @@ var SwapSdk = /** @class */ (function () {
120
120
  }
121
121
  console.log('this.wallet.sdk.eth.getGasPrice', swapData.gasPrice);
122
122
  this.swap(swapData)
123
- .on('transactionHash', resolve)
123
+ .on('transactionHash', function (res) {
124
+ if (!swapData.permit) {
125
+ resolve(res);
126
+ }
127
+ })
128
+ .on('receipt', function (res) {
129
+ if (swapData.permit) {
130
+ resolve(res);
131
+ }
132
+ })
124
133
  .on('error', reject);
125
134
  return [2 /*return*/];
126
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/openocean-sdk",
3
- "version": "1.6.26",
3
+ "version": "1.6.28",
4
4
  "description": "Openocean sdk",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {