@ape.swap/bonds-sdk 1.0.290 → 1.0.291
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.
|
@@ -69,6 +69,7 @@ import multicall from '../../utils/multicall';
|
|
|
69
69
|
import billAbi from '../../config/abi/bond.json';
|
|
70
70
|
import { getBalanceNumber } from '../../utils/getBalanceNumber';
|
|
71
71
|
import { getFirstNonZeroDigits } from '../../utils/roundNumber';
|
|
72
|
+
import { formatNumberSI } from '../../utils/formatNumber';
|
|
72
73
|
var YourBonds = function (_a) {
|
|
73
74
|
var connectionString = _a.connectionString;
|
|
74
75
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
@@ -347,10 +348,16 @@ var YourBonds = function (_a) {
|
|
|
347
348
|
var _a;
|
|
348
349
|
return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
|
|
349
350
|
};
|
|
350
|
-
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: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, { className: "column column-tokenname" }), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-
|
|
351
|
+
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: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, { className: "column column-tokenname" }), _jsx(Flex, { className: "column column-tokenicons" })] })), _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: {
|
|
352
|
+
height: ['36px', '36px', '36px', '26px'],
|
|
353
|
+
lineHeight: '12px',
|
|
354
|
+
fontSize: '14px',
|
|
355
|
+
fontWeight: 600,
|
|
356
|
+
width: '100%',
|
|
357
|
+
} }, { children: "Claim All" })) }))] }))] })), userOwnedBillsData.flat().map(function (data) {
|
|
351
358
|
return data.userOwnedBills.map(function (bill) {
|
|
352
359
|
var _a, _b, _c, _d;
|
|
353
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bond: bill.bond }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [
|
|
360
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bond: bill.bond }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")")] })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_c = (_b = bill.bond) === null || _b === void 0 ? void 0 : _b.discount) !== null && _c !== void 0 ? _c : 0) * 365) / vestingTime(bill.bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bill.bond.vestingTerm).days ? "".concat(vestingTime(bill.bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bill.bond) }), style: {
|
|
354
361
|
width: '127px',
|
|
355
362
|
height: '25px',
|
|
356
363
|
flexDirection: 'column',
|
package/dist/scss/YourBonds.scss
CHANGED
|
@@ -80,24 +80,14 @@
|
|
|
80
80
|
width: 60%;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
.column.column-
|
|
83
|
+
.column.column-claimable {
|
|
84
84
|
flex-direction: column;
|
|
85
85
|
justify-content: center;
|
|
86
86
|
align-items: center;
|
|
87
87
|
width: 20%;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
.
|
|
91
|
-
color: #38A611;
|
|
92
|
-
width: 20%;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.discount-negative {
|
|
96
|
-
color: #DF4141;
|
|
97
|
-
width: 20%;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.column.column-arr {
|
|
90
|
+
.column.column-pending {
|
|
101
91
|
flex-direction: column;
|
|
102
92
|
justify-content: center;
|
|
103
93
|
align-items: center;
|
|
@@ -111,23 +101,9 @@
|
|
|
111
101
|
width: 20%;
|
|
112
102
|
}
|
|
113
103
|
|
|
114
|
-
.column.column-
|
|
104
|
+
.column.column-claimall {
|
|
115
105
|
flex-direction: column;
|
|
116
106
|
justify-content: center;
|
|
117
107
|
align-items: center;
|
|
118
108
|
width: 20%;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.column.column-hotbond {
|
|
122
|
-
flex-direction: column;
|
|
123
|
-
justify-content: center;
|
|
124
|
-
align-items: center;
|
|
125
|
-
width: 10%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.column.header-icon {
|
|
129
|
-
padding-left: 5px;
|
|
130
|
-
align-items: start;
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
opacity: 0.6;
|
|
133
109
|
}
|