@ape.swap/bonds-sdk 1.0.638 → 1.0.639
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.
|
@@ -89,14 +89,9 @@ var BondModal = function (_a) {
|
|
|
89
89
|
_a.label = 1;
|
|
90
90
|
case 1:
|
|
91
91
|
_a.trys.push([1, 3, , 4]);
|
|
92
|
-
console.log('HANDLEBUY CLICKED');
|
|
93
92
|
maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102).div(100).toFixed(0);
|
|
94
93
|
rawAmount = adjustDecimals(inputValue);
|
|
95
94
|
amount = new BigNumber(rawAmount).times(new BigNumber(10).pow(decimals !== null && decimals !== void 0 ? decimals : 18)).toString();
|
|
96
|
-
console.log('BillAddress:', billAddress);
|
|
97
|
-
console.log('Amount:', amount);
|
|
98
|
-
console.log('MaxPrice:', maxPrice);
|
|
99
|
-
console.log('Price:', bondData[0].trueBillPrice);
|
|
100
95
|
return [4 /*yield*/, writeContractAsync({
|
|
101
96
|
address: billAddress,
|
|
102
97
|
abi: BOND_ABI,
|
|
@@ -105,16 +100,13 @@ var BondModal = function (_a) {
|
|
|
105
100
|
})];
|
|
106
101
|
case 2:
|
|
107
102
|
tx = _a.sent();
|
|
108
|
-
console.log('BuyTransaction:', hash);
|
|
109
103
|
if (tx) {
|
|
110
104
|
setBuyTx(tx);
|
|
111
|
-
console.log('setBuyTx:', hash);
|
|
112
105
|
}
|
|
113
106
|
return [3 /*break*/, 4];
|
|
114
107
|
case 3:
|
|
115
108
|
error_1 = _a.sent();
|
|
116
109
|
console.error('Buy error', error_1);
|
|
117
|
-
alert('Buy Failed');
|
|
118
110
|
return [3 /*break*/, 4];
|
|
119
111
|
case 4: return [2 /*return*/];
|
|
120
112
|
}
|
|
@@ -147,7 +139,6 @@ var BondModal = function (_a) {
|
|
|
147
139
|
case 3:
|
|
148
140
|
error_2 = _a.sent();
|
|
149
141
|
console.error('Approval failed:', error_2);
|
|
150
|
-
alert('Approval Failed');
|
|
151
142
|
return [3 /*break*/, 4];
|
|
152
143
|
case 4: return [2 /*return*/];
|
|
153
144
|
}
|
|
@@ -134,7 +134,6 @@ var YourBonds = function (_a) {
|
|
|
134
134
|
results = _a.sent();
|
|
135
135
|
mappedBills = results.flat().flatMap(function (results) { return results.userOwnedBills; });
|
|
136
136
|
setMappedUserBills(mappedBills);
|
|
137
|
-
console.log('User owned bills data:', mappedBills);
|
|
138
137
|
return [3 /*break*/, 4];
|
|
139
138
|
case 3:
|
|
140
139
|
error_2 = _a.sent();
|
|
@@ -226,7 +225,6 @@ var YourBonds = function (_a) {
|
|
|
226
225
|
var _k = useState(false), isModalOpen = _k[0], setIsModalOpen = _k[1];
|
|
227
226
|
var _l = useState(undefined), selectedBill = _l[0], setSelectedBill = _l[1];
|
|
228
227
|
var rowClick = function (bill) {
|
|
229
|
-
console.log(bill);
|
|
230
228
|
setSelectedBill(bill);
|
|
231
229
|
setIsModalOpen(true);
|
|
232
230
|
};
|