@ape.swap/bonds-sdk 1.0.620 → 1.0.622
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,25 +66,32 @@ var YourBondsModal = function (_a) {
|
|
|
66
66
|
hash: hash,
|
|
67
67
|
}), isConfirming = _u.isLoading, isConfirmed = _u.isSuccess;
|
|
68
68
|
var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
-
var address;
|
|
69
|
+
var address, tx, error_1;
|
|
70
70
|
return __generator(this, function (_a) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
address = billAddress;
|
|
74
|
+
_a.label = 1;
|
|
75
|
+
case 1:
|
|
76
|
+
_a.trys.push([1, 3, , 4]);
|
|
77
|
+
return [4 /*yield*/, writeContractAsync({
|
|
78
|
+
address: address,
|
|
79
|
+
abi: BOND_ABI,
|
|
80
|
+
functionName: 'redeem',
|
|
81
|
+
args: [billId],
|
|
82
|
+
})];
|
|
83
|
+
case 2:
|
|
84
|
+
tx = _a.sent();
|
|
85
|
+
if (tx) {
|
|
86
|
+
setClaimTx(tx);
|
|
87
|
+
}
|
|
88
|
+
return [3 /*break*/, 4];
|
|
89
|
+
case 3:
|
|
90
|
+
error_1 = _a.sent();
|
|
91
|
+
console.error('Approval failed:', error_1);
|
|
92
|
+
return [3 /*break*/, 4];
|
|
93
|
+
case 4: return [2 /*return*/];
|
|
83
94
|
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
console.error('Approval failed:', error);
|
|
86
|
-
}
|
|
87
|
-
return [2 /*return*/];
|
|
88
95
|
});
|
|
89
96
|
}); };
|
|
90
97
|
var _v = useState(null), claimTx = _v[0], setClaimTx = _v[1];
|