@ape.swap/bonds-sdk 1.0.284 → 1.0.286
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,16 @@ 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
|
-
|
|
185
|
+
amountWei = ethers.utils.parseUnits(amount.toString(), "ether");
|
|
186
|
+
console.log('-------!');
|
|
186
187
|
console.log(amount);
|
|
187
|
-
console.log(
|
|
188
|
+
console.log(amountWei.toString());
|
|
188
189
|
console.log(maxPrice);
|
|
189
190
|
console.log(maxPrice2);
|
|
190
191
|
console.log(maxPrice2.valueOf());
|
|
191
192
|
console.log(bondData[0].trueBillPrice);
|
|
192
193
|
console.log('-------');
|
|
193
|
-
return [4 /*yield*/, bondContract.deposit(
|
|
194
|
+
return [4 /*yield*/, bondContract.deposit(amountWei.toString(), maxPrice2.valueOf(), account)];
|
|
194
195
|
case 2:
|
|
195
196
|
tx = _a.sent();
|
|
196
197
|
return [4 /*yield*/, tx.wait()];
|