@ape.swap/bonds-sdk 1.0.285 → 1.0.287
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.
|
@@ -163,7 +163,7 @@ var BondModal = function (_a) {
|
|
|
163
163
|
return parseFloat(getPremium) < 0 ? 'premium-negative' : 'premium-positive';
|
|
164
164
|
};
|
|
165
165
|
var handleBuy = function (bond) { return __awaiter(void 0, void 0, void 0, function () {
|
|
166
|
-
var provider, signer, bondContract, maxPrice, maxPrice2, amount, tx, error_1;
|
|
166
|
+
var provider, signer, bondContract, maxPrice, maxPrice2, amount, amountWei, tx, error_1;
|
|
167
167
|
return __generator(this, function (_a) {
|
|
168
168
|
switch (_a.label) {
|
|
169
169
|
case 0:
|
|
@@ -182,15 +182,18 @@ var BondModal = function (_a) {
|
|
|
182
182
|
maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102);
|
|
183
183
|
maxPrice2 = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
|
|
184
184
|
amount = adjustDecimals(inputValue);
|
|
185
|
+
amountWei = ethers.utils.parseUnits(amount.toString(), "ether");
|
|
185
186
|
console.log('-------!');
|
|
186
187
|
console.log(amount);
|
|
187
|
-
console.log(
|
|
188
|
-
console.log(
|
|
189
|
-
console.log(
|
|
188
|
+
console.log(amountWei.toString());
|
|
189
|
+
console.log('%%%%%');
|
|
190
|
+
console.log(maxPrice.toString());
|
|
191
|
+
console.log(maxPrice2.toString());
|
|
192
|
+
console.log('%%%%%');
|
|
190
193
|
console.log(maxPrice2.valueOf());
|
|
191
194
|
console.log(bondData[0].trueBillPrice);
|
|
192
195
|
console.log('-------');
|
|
193
|
-
return [4 /*yield*/, bondContract.deposit(
|
|
196
|
+
return [4 /*yield*/, bondContract.deposit(amountWei.toString(), maxPrice2.valueOf(), account)];
|
|
194
197
|
case 2:
|
|
195
198
|
tx = _a.sent();
|
|
196
199
|
return [4 /*yield*/, tx.wait()];
|