@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.
- package/lib/swapSdk/Swap.js +6 -3
- package/lib/swapSdk/index.js +10 -1
- package/package.json +1 -1
package/lib/swapSdk/Swap.js
CHANGED
|
@@ -670,7 +670,9 @@ var Swap = /** @class */ (function () {
|
|
|
670
670
|
_this.transactionHashCallback(transactionHash);
|
|
671
671
|
})
|
|
672
672
|
.on("receipt", function (receipt) {
|
|
673
|
-
|
|
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
|
-
|
|
768
|
-
|
|
769
|
+
console.log('receipt', receipt);
|
|
770
|
+
var transactionHash = (receipt || {}).transactionHash;
|
|
771
|
+
_this.receiptCallback(transactionHash);
|
|
769
772
|
});
|
|
770
773
|
return [2 /*return*/];
|
|
771
774
|
}
|
package/lib/swapSdk/index.js
CHANGED
|
@@ -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',
|
|
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
|
}
|