@ape.swap/bonds-sdk 1.0.547 → 1.0.549
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.
|
@@ -66,7 +66,6 @@ import { fetchUserOwnedBillsDataAsync } from './fetchBillsUser';
|
|
|
66
66
|
import { Input } from '../../components/uikit-sdk/Input';
|
|
67
67
|
import { YourBondsModal } from "../../index";
|
|
68
68
|
import BOND_ABI from '../../config/abi/bond.json';
|
|
69
|
-
import { ethers } from 'ethers';
|
|
70
69
|
var YourBonds = function (_a) {
|
|
71
70
|
//const toastError = useToastError()
|
|
72
71
|
// const { onClaimBill } = useClaimBill(billAddress, billIds)
|
|
@@ -87,33 +86,30 @@ var YourBonds = function (_a) {
|
|
|
87
86
|
// setPendingTrx(false);
|
|
88
87
|
// };
|
|
89
88
|
var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
var
|
|
89
|
+
var tx, error_1;
|
|
91
90
|
return __generator(this, function (_a) {
|
|
92
91
|
switch (_a.label) {
|
|
93
92
|
case 0:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
case 1:
|
|
97
|
-
_a.trys.push([1, 3, , 4]);
|
|
93
|
+
_a.trys.push([0, 2, , 3]);
|
|
94
|
+
//const uint256BillId = ethers.BigNumber.from(billId);
|
|
98
95
|
console.log('claimClicked');
|
|
99
|
-
console.log('billId:',
|
|
96
|
+
// console.log('billId:', uint256BillId);
|
|
100
97
|
console.log('billAddress:', billAddress);
|
|
101
|
-
uint256BillId = ethers.BigNumber.from(billId);
|
|
102
98
|
return [4 /*yield*/, writeContract({
|
|
103
99
|
address: billAddress,
|
|
104
100
|
abi: BOND_ABI,
|
|
105
|
-
functionName: '
|
|
106
|
-
args: [
|
|
101
|
+
functionName: 'redeem',
|
|
102
|
+
args: [billId],
|
|
107
103
|
})];
|
|
108
|
-
case
|
|
104
|
+
case 1:
|
|
109
105
|
tx = _a.sent();
|
|
110
106
|
console.log('Transaction:', tx);
|
|
111
|
-
return [3 /*break*/,
|
|
112
|
-
case
|
|
107
|
+
return [3 /*break*/, 3];
|
|
108
|
+
case 2:
|
|
113
109
|
error_1 = _a.sent();
|
|
114
110
|
console.error('Approval failed:', error_1);
|
|
115
|
-
return [3 /*break*/,
|
|
116
|
-
case
|
|
111
|
+
return [3 /*break*/, 3];
|
|
112
|
+
case 3: return [2 /*return*/];
|
|
117
113
|
}
|
|
118
114
|
});
|
|
119
115
|
}); };
|