@ape.swap/bonds-sdk 2.0.3 → 2.0.4-testseed.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
2
2
|
export declare const supportedByLIFI: ChainId[];
|
|
3
3
|
export declare const APESWAP_LIST_REPO = "https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging";
|
|
4
|
-
export declare const STRAPI_URL = "https://
|
|
5
|
-
export declare const SOUL_ZAP_API = "https://
|
|
4
|
+
export declare const STRAPI_URL = "https://strapi-api.ape.bond";
|
|
5
|
+
export declare const SOUL_ZAP_API = "https://zap-api.ape.bond/zap?batch=1";
|
package/dist/main.js
CHANGED
|
@@ -18517,8 +18517,8 @@ const supportedByLIFI = [
|
|
|
18517
18517
|
];
|
|
18518
18518
|
// we should be good just by using staging on this, as it is only used for token images
|
|
18519
18519
|
const APESWAP_LIST_REPO = `https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging`;
|
|
18520
|
-
const STRAPI_URL = `https://
|
|
18521
|
-
const SOUL_ZAP_API = `https://
|
|
18520
|
+
const STRAPI_URL = `https://strapi-api.ape.bond`;
|
|
18521
|
+
const SOUL_ZAP_API = `https://zap-api.ape.bond/zap?batch=1`;
|
|
18522
18522
|
|
|
18523
18523
|
const TokenImage = ({ symbol, symbol2, size, chain, }) => {
|
|
18524
18524
|
var _a, _b;
|
|
@@ -73077,6 +73077,17 @@ const ProjectDescription = ({ description }) => {
|
|
|
73077
73077
|
}, onClick: () => setIsOpen(true), children: ["View More ", '>'] }))] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'] }, children: jsx$2(SafeHTMLComponent, { html: description !== null && description !== void 0 ? description : '' }) })] }));
|
|
73078
73078
|
};
|
|
73079
73079
|
|
|
73080
|
+
const BondModalHeaderAlt = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
73081
|
+
const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
|
|
73082
|
+
const handleClose = () => {
|
|
73083
|
+
if (typeof window !== 'undefined') {
|
|
73084
|
+
window.history.pushState({}, '', `/bonds`);
|
|
73085
|
+
}
|
|
73086
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
73087
|
+
};
|
|
73088
|
+
return (jsx$2(Flex, { className: "modaltable-container title-container", children: jsx$2(Flex, { className: "slipagge-close-icons", sx: { flexDirection: 'row' }, children: onDismiss ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mb: '-5px', pr: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose })] })) : (jsx$2(Flex, { sx: {}, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) }) }));
|
|
73089
|
+
};
|
|
73090
|
+
|
|
73080
73091
|
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
73081
73092
|
// ??
|
|
73082
73093
|
accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = false, }) => {
|
|
@@ -73281,7 +73292,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
73281
73292
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
73282
73293
|
!account ||
|
|
73283
73294
|
!inputValue ||
|
|
73284
|
-
parseFloat(inputValue) === 0, onClick: handleApprove, children: "enable" })) })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })] })) })) : (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content font-small gpt", children: [typeof window !== 'undefined' && window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"alt\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsx$2(Flex, { className: "
|
|
73295
|
+
parseFloat(inputValue) === 0, onClick: handleApprove, children: "enable" })) })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })] })) })) : (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content font-small gpt", children: [typeof window !== 'undefined' && window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"alt\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsx$2(Flex, { className: "bondmodal-header-alt", sx: { mb: '20px' }, children: jsx$2(BondModalHeaderAlt, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }) }), jsxs(Flex, { className: "modaltable-container", sx: { flexDirection: 'row', gap: '20px' }, children: [jsxs(Flex, { sx: { width: '500px', flexDirection: 'column' }, children: [jsx$2("img", { src: "https://placehold.co/400x200" }), jsx$2(Flex, { className: "modaltable-container description-container paragraph-spaced", sx: { marginTop: '20px' }, children: bondData === null || bondData === void 0 ? void 0 : bondData.shortDescription })] }), jsxs(Flex, { sx: { flexDirection: 'column', width: '600px' }, children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: { minWidth: '300px' }, children: jsxs("h2", { sx: { margin: '0px' }, children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, ' ', jsx$2(Svg, { width: 20, height: 20, icon: (_k = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bondData.chainId]) !== null && _k !== void 0 ? _k : 'question' })] }) }), jsxs(Flex, { sx: { justifyContent: 'space-between', flexGrow: 1 }, children: [jsx$2(TokenImage, { symbol: (_l = bondData.showcaseTokenName) !== null && _l !== void 0 ? _l : bondData.earnToken.symbol, size: 20 }), jsx$2("span", { children: bondData.earnToken.symbol }), " ", jsx$2("span", { children: "|" }), ' ', jsxs("span", { children: ["Market Price: $", earnTokenPrice(bondData)] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', marginTop: '20px' }, children: [jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: true, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { sx: { justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { children: ["You will receive:", jsx$2(Flex, { sx: { marginLeft: '15px', marginRight: '5px' }, children: jsx$2(TokenImage, { symbol: (_m = bondData.showcaseTokenName) !== null && _m !== void 0 ? _m : bondData.earnToken.symbol, size: 20 }) }), (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, " + \u00A0", (youGet(bondData, inputValue) -
|
|
73285
73296
|
lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), jsx$2("span", { className: "text-highlight", children: "\u00A0additional" })] }), jsx$2(Flex, { className: "button-container buy", sx: { justifyContent: 'end' }, children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button button-narrow", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
73286
73297
|
event.stopPropagation();
|
|
73287
73298
|
switchChain({ chainId: bondData.chainId });
|
|
@@ -73650,8 +73661,7 @@ const BondRowsByChain = ({ bonds, hideTitles }) => {
|
|
|
73650
73661
|
const getUserApiStats = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73651
73662
|
if (!account)
|
|
73652
73663
|
return null;
|
|
73653
|
-
const { data } = yield axios.get(`
|
|
73654
|
-
https://bonds-dashboard-api-deaf0d7d55b7.herokuapp.com/collector/userSalesInfo/purchased/${account}`);
|
|
73664
|
+
const { data } = yield axios.get(`https://dashboard-api.ape.bond/collector/userSalesInfo/purchased/${account}`);
|
|
73655
73665
|
return data;
|
|
73656
73666
|
});
|
|
73657
73667
|
function useUserApiStats() {
|
|
@@ -74867,7 +74877,7 @@ const NavPanel = ({ contractAddress }) => {
|
|
|
74867
74877
|
justifyContent: 'space-between',
|
|
74868
74878
|
alignItems: 'center',
|
|
74869
74879
|
mb: ['15px', '15px', '15px', '0px'],
|
|
74870
|
-
}, children: [jsxs(Flex, { onClick: () => window.open(`${window.location.origin}/bonds`, '_self'), sx: { cursor: 'pointer' }, children: ['< ', jsx$2(Flex, { sx: { ml: '4px' }, children: "All Bonds" })] }), jsx$2(Flex, { children: jsxs(Flex, { sx: { p: '5px 10px', background: 'white3', borderRadius: 'small', cursor: 'pointer' }, onClick: () => window.open(`https://
|
|
74880
|
+
}, children: [jsxs(Flex, { onClick: () => window.open(`${window.location.origin}/bonds`, '_self'), sx: { cursor: 'pointer' }, children: ['< ', jsx$2(Flex, { sx: { ml: '4px' }, children: "All Bonds" })] }), jsx$2(Flex, { children: jsxs(Flex, { sx: { p: '5px 10px', background: 'white3', borderRadius: 'small', cursor: 'pointer' }, onClick: () => window.open(`https://dashboard.ape.bond/bond/${contractAddress}`, '_blank', 'noreferrer'), children: ["View insights", jsx$2(Flex, { sx: { ml: '3px' }, children: jsx$2(Svg, { icon: "insight" }) })] }) })] }));
|
|
74871
74881
|
};
|
|
74872
74882
|
|
|
74873
74883
|
const styles$3 = {
|
|
@@ -89387,8 +89397,7 @@ const styles$2 = {
|
|
|
89387
89397
|
};
|
|
89388
89398
|
|
|
89389
89399
|
const getBondApiStats = (contractAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
89390
|
-
const { data } = yield axios.get(`
|
|
89391
|
-
https://bonds-dashboard-api-deaf0d7d55b7.herokuapp.com/collector/salesInfo/bond/${contractAddress}/0`);
|
|
89400
|
+
const { data } = yield axios.get(`https://dashboard-api.ape.bond/collector/salesInfo/bond/${contractAddress}/0`);
|
|
89392
89401
|
return data;
|
|
89393
89402
|
});
|
|
89394
89403
|
function useGetBondApiStats(contractAddress) {
|
|
@@ -89466,7 +89475,7 @@ const BondStats = ({ selectedBond }) => {
|
|
|
89466
89475
|
});
|
|
89467
89476
|
}
|
|
89468
89477
|
}, [bondStats]);
|
|
89469
|
-
return (jsxs(Flex, { sx: styles$2.bondStatsContainer, children: [jsxs(Flex, { sx: styles$2.titleContainer, children: [jsx$2(Flex, { sx: { fontSize: '22px' }, children: "Bond Stats" }), jsxs(Link, { href: `https://
|
|
89478
|
+
return (jsxs(Flex, { sx: styles$2.bondStatsContainer, children: [jsxs(Flex, { sx: styles$2.titleContainer, children: [jsx$2(Flex, { sx: { fontSize: '22px' }, children: "Bond Stats" }), jsxs(Link, { href: `https://dashboard.ape.bond/bond/${selectedBond.billAddress}`, sx: styles$2.link, target: "_blank", rel: "noopener noreferrer", children: ["View More ", '>'] })] }), jsxs(Flex, { sx: styles$2.chartsContainer, children: [jsxs(Flex, { sx: styles$2.salesChart, children: [jsx$2(Flex, { sx: { width: '150px' }, children: jsx$2(MenuSelect, { selectedOption: chartOption, setOption: setChartOption, options: chartOptions }) }), jsx$2(Flex, { sx: { width: '100%', height: '100%', minHeight: '225px' }, children: chartOption === 'amount' ? (jsx$2(Line, { options: options, data: salesAmountChartData })) : (jsx$2(Line, { options: options, data: salesCountChartData })) })] }), (bondStats === null || bondStats === void 0 ? void 0 : bondStats.percentageSold) && (jsxs(Flex, { sx: styles$2.percentageSoldChart, children: [jsxs(Flex, { sx: { mb: '10px' }, children: [selectedBond.earnToken.symbol, " Sold"] }), jsx$2(Knob, { value: bondStats === null || bondStats === void 0 ? void 0 : bondStats.percentageSold, size: 176, valueTemplate: `${(_f = bondStats === null || bondStats === void 0 ? void 0 : bondStats.percentageSold) === null || _f === void 0 ? void 0 : _f.toFixed()}%`, valueColor: "#6560C5", rangeColor: "rgba(250, 250, 250, 0.05)", textColor: "#f6f6f6" }), jsxs(Flex, { sx: { fontSize: '14px', fontWeight: 500, color: 'textDisabledButton' }, children: [soldTokens, " / ", maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toLocaleString(), " ", selectedBond.earnToken.symbol] })] }))] })] }));
|
|
89470
89479
|
};
|
|
89471
89480
|
|
|
89472
89481
|
const styles$1 = {
|
package/dist/styles.css
CHANGED
|
@@ -580,9 +580,9 @@ span.flex-inline {
|
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
.footer-details {
|
|
583
|
-
margin-left: -
|
|
584
|
-
margin-right: -
|
|
585
|
-
margin-bottom: -
|
|
583
|
+
margin-left: -20px !important;
|
|
584
|
+
margin-right: -20px !important;
|
|
585
|
+
margin-bottom: -20px !important;
|
|
586
586
|
margin-top: 20px !important;
|
|
587
587
|
height: 50px;
|
|
588
588
|
align-items: center;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BondsData } from '../../../types/bonds';
|
|
3
|
+
declare const BondModalHeaderAlt: ({ bondData, onDismiss, showProjectInfoButton, }: {
|
|
4
|
+
bondData: BondsData;
|
|
5
|
+
onDismiss?: () => void;
|
|
6
|
+
showProjectInfoButton?: boolean;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default BondModalHeaderAlt;
|