@openocean.finance/openocean-sdk 1.6.17 → 1.6.18
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 +5 -4
- package/package.json +1 -1
package/lib/swapSdk/Swap.js
CHANGED
|
@@ -50,6 +50,7 @@ var ontology_ts_sdk_1 = require("ontology-ts-sdk");
|
|
|
50
50
|
var aptos_1 = require("aptos");
|
|
51
51
|
var ethers_1 = require("ethers");
|
|
52
52
|
var bn_js_1 = __importDefault(require("bn.js"));
|
|
53
|
+
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
53
54
|
var borsh_1 = require("borsh");
|
|
54
55
|
var ontology_dapi_1 = require("@ont-dev/ontology-dapi");
|
|
55
56
|
var NotoMobile_1 = require("./NotoMobile");
|
|
@@ -566,7 +567,7 @@ var Swap = /** @class */ (function () {
|
|
|
566
567
|
from: this.wallet.address,
|
|
567
568
|
to: to,
|
|
568
569
|
data: data,
|
|
569
|
-
value: +gmxFee > 0 ? new
|
|
570
|
+
value: +gmxFee > 0 ? new bignumber_js_1.default(value).plus(gmxFee).toNumber() : value,
|
|
570
571
|
})];
|
|
571
572
|
case 1:
|
|
572
573
|
gas = _b.sent();
|
|
@@ -598,7 +599,7 @@ var Swap = /** @class */ (function () {
|
|
|
598
599
|
.swap(invitee, path, amounts, swapAddr, swapExtraData)
|
|
599
600
|
.estimateGas({
|
|
600
601
|
from: this.wallet.address,
|
|
601
|
-
value: +gmxFee > 0 ? new
|
|
602
|
+
value: +gmxFee > 0 ? new bignumber_js_1.default(value).plus(gmxFee).toNumber() : value,
|
|
602
603
|
})];
|
|
603
604
|
case 1:
|
|
604
605
|
gas = _b.sent();
|
|
@@ -652,7 +653,7 @@ var Swap = /** @class */ (function () {
|
|
|
652
653
|
swapParams.value = inAmount;
|
|
653
654
|
}
|
|
654
655
|
if (+gmxFee) {
|
|
655
|
-
swapParams.value = new
|
|
656
|
+
swapParams.value = new bignumber_js_1.default(swapParams.value).plus(gmxFee).toNumber();
|
|
656
657
|
}
|
|
657
658
|
contract.methods
|
|
658
659
|
.swap(invitee, path, amounts, swapAddr, swapExtraData)
|
|
@@ -700,7 +701,7 @@ var Swap = /** @class */ (function () {
|
|
|
700
701
|
swapParams.value = inAmount;
|
|
701
702
|
}
|
|
702
703
|
if (+gmxFee) {
|
|
703
|
-
swapParams.value = new
|
|
704
|
+
swapParams.value = new bignumber_js_1.default(swapParams.value).plus(gmxFee).toNumber();
|
|
704
705
|
}
|
|
705
706
|
if (!(this.wallet.key === "GnosisSafeWallet")) return [3 /*break*/, 5];
|
|
706
707
|
console.log('sendEthTransaction swapParams', JSON.stringify(swapParams));
|