@ape.swap/bonds-sdk 1.0.295 → 1.0.296
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.
|
@@ -315,9 +315,10 @@ var YourBonds = function (_a) {
|
|
|
315
315
|
}); };
|
|
316
316
|
var chainId = useWeb3React().chainId;
|
|
317
317
|
var totalPending = function (userBill) {
|
|
318
|
-
var _a, _b, _c, _d;
|
|
318
|
+
var _a, _b, _c, _d, _e, _f;
|
|
319
319
|
console.log(userBill);
|
|
320
|
-
|
|
320
|
+
console.log((_b = (_a = userBill.bond.earnToken) === null || _a === void 0 ? void 0 : _a.decimals) === null || _b === void 0 ? void 0 : _b[chainId]);
|
|
321
|
+
return getBalanceNumber(new BigNumber((_c = userBill === null || userBill === void 0 ? void 0 : userBill.totalPayout) !== null && _c !== void 0 ? _c : 0), (_f = (_e = (_d = userBill.bond.earnToken) === null || _d === void 0 ? void 0 : _d.decimals) === null || _e === void 0 ? void 0 : _e[chainId]) !== null && _f !== void 0 ? _f : 18);
|
|
321
322
|
};
|
|
322
323
|
var claimable = function (userBill) {
|
|
323
324
|
var _a, _b, _c;
|
|
@@ -327,7 +328,7 @@ var YourBonds = function (_a) {
|
|
|
327
328
|
var _a;
|
|
328
329
|
return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
|
|
329
330
|
};
|
|
330
|
-
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [
|
|
331
|
+
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, { className: "column column-tokeninfoname" }) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-claimable" }, { children: _jsx(Text, { children: "Claimable" }) })), _jsx(Flex, __assign({ className: "column column-pending" }, { children: _jsx(Text, { children: "Pending" }) })), _jsx(Flex, __assign({ className: "column column-term" }, { children: _jsx(Text, { children: "Terms" }) })), _jsx(Flex, __assign({ className: "column column-claimall" }, { children: _jsx(Button, __assign({ disabled: !account, sx: {
|
|
331
332
|
height: ['36px', '36px', '36px', '26px'],
|
|
332
333
|
lineHeight: '12px',
|
|
333
334
|
fontSize: '14px',
|
|
@@ -336,7 +337,7 @@ var YourBonds = function (_a) {
|
|
|
336
337
|
} }, { children: "Claim All" })) }))] }))] })), userOwnedBillsData.flat().map(function (data) {
|
|
337
338
|
return data.userOwnedBills.map(function (bill) {
|
|
338
339
|
var _a, _b;
|
|
339
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [
|
|
340
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bond: bill.bond }) })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")")] })), _jsxs(Flex, __assign({ className: "column column-pending" }, { children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")")] })), _jsx(Flex, __assign({ className: "column column-term" }, { children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") })), _jsx(Flex, __assign({ className: "column column-claimall" }, { children: _jsx(Flex, __assign({ className: "column-claimall button" }, { children: _jsx(Button, __assign({ disabled: !account, sx: {
|
|
340
341
|
height: ['36px', '36px', '36px', '26px'],
|
|
341
342
|
lineHeight: '12px',
|
|
342
343
|
fontSize: '14px',
|
package/dist/scss/YourBonds.scss
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
justify-content: start;
|
|
49
|
-
width:
|
|
49
|
+
width: 30%;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.column.column-tokeninfoname {
|
|
@@ -58,26 +58,11 @@
|
|
|
58
58
|
padding-left: 20px;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.column.column-tokenname {
|
|
62
|
-
width: 100%;
|
|
63
|
-
flex-direction: row;
|
|
64
|
-
justify-content: start;
|
|
65
|
-
align-items: center;
|
|
66
|
-
padding-left: 20px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.column.column-tokenicons {
|
|
70
|
-
width: 30%;
|
|
71
|
-
flex-direction: row;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: start;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
61
|
.column.column-bondinfo {
|
|
77
62
|
flex-direction: row;
|
|
78
63
|
align-items: center;
|
|
79
64
|
justify-content: end;
|
|
80
|
-
width:
|
|
65
|
+
width: 70%;
|
|
81
66
|
}
|
|
82
67
|
|
|
83
68
|
.column.column-claimable {
|
|
@@ -105,7 +90,7 @@
|
|
|
105
90
|
flex-direction: column;
|
|
106
91
|
justify-content: center;
|
|
107
92
|
align-items: center;
|
|
108
|
-
width:
|
|
93
|
+
width: 30%;
|
|
109
94
|
}
|
|
110
95
|
|
|
111
96
|
.column-claimall.button {
|