@ape.swap/bonds-sdk 1.0.544 → 1.0.545
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.
|
@@ -65,7 +65,6 @@ import axios from 'axios';
|
|
|
65
65
|
import { fetchUserOwnedBillsDataAsync } from './fetchBillsUser';
|
|
66
66
|
import { Input } from '../../components/uikit-sdk/Input';
|
|
67
67
|
import { YourBondsModal } from "../../index";
|
|
68
|
-
import { adjustDecimals } from '../../utils/convertToTokenValue';
|
|
69
68
|
import BOND_ABI from '../../config/abi/bond.json';
|
|
70
69
|
var YourBonds = function (_a) {
|
|
71
70
|
//const toastError = useToastError()
|
|
@@ -86,7 +85,7 @@ var YourBonds = function (_a) {
|
|
|
86
85
|
// });
|
|
87
86
|
// setPendingTrx(false);
|
|
88
87
|
// };
|
|
89
|
-
var handleClaim = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
var handleClaim = function (billId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
89
|
var tokenAddress, tx, error_1;
|
|
91
90
|
return __generator(this, function (_a) {
|
|
92
91
|
switch (_a.label) {
|
|
@@ -99,7 +98,7 @@ var YourBonds = function (_a) {
|
|
|
99
98
|
address: tokenAddress,
|
|
100
99
|
abi: BOND_ABI,
|
|
101
100
|
functionName: 'redeem',
|
|
102
|
-
args: [
|
|
101
|
+
args: [billId],
|
|
103
102
|
})];
|
|
104
103
|
case 2:
|
|
105
104
|
tx = _a.sent();
|
|
@@ -274,7 +273,7 @@ var YourBonds = function (_a) {
|
|
|
274
273
|
return (_jsxs(Flex, { className: "container bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "column column-tokens", children: _jsx(Flex, { className: "column column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "column column-bondinfo", children: [_jsxs(Flex, { className: "column column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") })] }), _jsxs(Flex, { className: "column column-pending", children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") })] }), _jsx(Flex, { className: "column column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "column column-claimall", children: _jsx(Button, { disabled: !account && (claimableNumber(bill) === 0), onClick: function (event) {
|
|
275
274
|
event.stopPropagation();
|
|
276
275
|
// Add your claim logic here
|
|
277
|
-
handleClaim;
|
|
276
|
+
handleClaim(bill.id);
|
|
278
277
|
}, sx: {
|
|
279
278
|
height: ['36px', '36px', '36px', '26px'],
|
|
280
279
|
lineHeight: '12px',
|