@ape.swap/bonds-sdk 3.0.52 → 3.0.53
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.
- package/dist/main.js +5 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -72018,7 +72018,7 @@ const YourBonds = ({ showOnly }) => {
|
|
|
72018
72018
|
const handleFilterOption = useCallback((newOption) => {
|
|
72019
72019
|
setFilterOption(newOption);
|
|
72020
72020
|
}, []);
|
|
72021
|
-
return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0 ? (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill) => jsx$2(UserBondRow, { bill: bill }, bill.id))) : inputValue !== '' || !chainFilterOption.includes('All Chains') ? (jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' })) : userBondsFetched && (userBonds === null || userBonds === void 0 ? void 0 : userBonds.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72021
|
+
return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0 ? (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill, index) => jsx$2(UserBondRow, { bill: bill }, `${bill.id}-${index}`))) : inputValue !== '' || !chainFilterOption.includes('All Chains') ? (jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' })) : userBondsFetched && (userBonds === null || userBonds === void 0 ? void 0 : userBonds.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72022
72022
|
};
|
|
72023
72023
|
|
|
72024
72024
|
// This basically returns the 2 tags with the higher active bond count
|
|
@@ -94154,11 +94154,11 @@ const styles = {
|
|
|
94154
94154
|
};
|
|
94155
94155
|
|
|
94156
94156
|
const PriceChart = ({ selectedBond, historicalPrices, }) => {
|
|
94157
|
-
var _a, _b, _c, _d
|
|
94157
|
+
var _a, _b, _c, _d;
|
|
94158
94158
|
const earnTokenPrice = parseFloat((_a = selectedBond === null || selectedBond === void 0 ? void 0 : selectedBond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
|
|
94159
94159
|
const trueBondPrice = findHighestTrueBondPrice(TIERS_WEIGHT[types.LaunchBondTiers.Legend], selectedBond);
|
|
94160
|
-
const bondPrice =
|
|
94161
|
-
const hasDiscount = ((
|
|
94160
|
+
const bondPrice = discountEarnTokenPrice(selectedBond, true);
|
|
94161
|
+
const hasDiscount = ((_b = trueBondPrice.bonus) !== null && _b !== void 0 ? _b : 0) > 0;
|
|
94162
94162
|
const [show, setShow] = useState(false);
|
|
94163
94163
|
const [chartOption, setChartOption] = useState('line');
|
|
94164
94164
|
useEffect(() => {
|
|
@@ -94173,7 +94173,7 @@ const PriceChart = ({ selectedBond, historicalPrices, }) => {
|
|
|
94173
94173
|
}, 50);
|
|
94174
94174
|
return () => clearTimeout(timer);
|
|
94175
94175
|
}, [selectedBond.billAddress]);
|
|
94176
|
-
return (jsxs(Flex, { sx: styles.priceContainer, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mb: '15px', pr: '20px' }, children: [jsx$2(Flex, { children: "Prices" }), jsxs(Flex, { children: [jsxs(Flex, { sx: { color: hasDiscount ? 'success' : 'error', fontSize: '12px', fontWeight: 500, mr: '15px' }, children: ["Bond Price: $", bondPrice] }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 500 }, children: ["Market Price: $", getFirstNonZeroDigits(earnTokenPrice !== null && earnTokenPrice !== void 0 ? earnTokenPrice : 0)] })] })] }), show && (jsxs(Flex, { sx: styles.container, children: [jsxs(Flex, { sx: styles.buttonsContainer, children: [jsx$2(Flex, { sx: Object.assign(Object.assign({}, styles.button), { mr: '15px' }), onClick: () => setChartOption('line'), children: jsx$2(Svg, { icon: "lineChart", width: 20 }) }), jsx$2(Flex, { sx: styles.button, onClick: () => setChartOption('candleStick'), children: "D" })] }), historicalPrices && historicalPrices.length > 0 ? (chartOption === 'line' ? (jsx$2(LineChart, { historicalPrices: historicalPrices, hasDiscount: hasDiscount, bondPrice: bondPrice, tokenPrice: (
|
|
94176
|
+
return (jsxs(Flex, { sx: styles.priceContainer, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mb: '15px', pr: '20px' }, children: [jsx$2(Flex, { children: "Prices" }), jsxs(Flex, { children: [jsxs(Flex, { sx: { color: hasDiscount ? 'success' : 'error', fontSize: '12px', fontWeight: 500, mr: '15px' }, children: ["Bond Price: $", bondPrice] }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 500 }, children: ["Market Price: $", getFirstNonZeroDigits(earnTokenPrice !== null && earnTokenPrice !== void 0 ? earnTokenPrice : 0)] })] })] }), show && (jsxs(Flex, { sx: styles.container, children: [jsxs(Flex, { sx: styles.buttonsContainer, children: [jsx$2(Flex, { sx: Object.assign(Object.assign({}, styles.button), { mr: '15px' }), onClick: () => setChartOption('line'), children: jsx$2(Svg, { icon: "lineChart", width: 20 }) }), jsx$2(Flex, { sx: styles.button, onClick: () => setChartOption('candleStick'), children: "D" })] }), historicalPrices && historicalPrices.length > 0 ? (chartOption === 'line' ? (jsx$2(LineChart, { historicalPrices: historicalPrices, hasDiscount: hasDiscount, bondPrice: bondPrice, tokenPrice: (_c = selectedBond.payoutTokenPrice) !== null && _c !== void 0 ? _c : '0' })) : (jsx$2(CandleStickChart, { historicalPrices: historicalPrices, hasDiscount: hasDiscount, bondPrice: bondPrice, tokenPrice: (_d = selectedBond.payoutTokenPrice) !== null && _d !== void 0 ? _d : '0' }))) : (jsxs(Flex, { sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'center', width: '100%' }, children: [jsx$2(Svg, { icon: "placeholderMonkey" }), jsx$2(Flex, { sx: { mt: '15px' }, children: "No Historical Price for this Token" })] }))] }))] }));
|
|
94177
94177
|
};
|
|
94178
94178
|
|
|
94179
94179
|
const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|