@ape.swap/bonds-sdk 1.1.0-test.42 → 1.1.0-test.44
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/components/BondRows/BondRow.d.ts +1 -0
- package/dist/components/BondRows/BondRowsByChain.d.ts +2 -1
- package/dist/components/BondRows/BondRowsWithTitle.d.ts +2 -1
- package/dist/main.js +46 -42
- package/dist/scss/index.scss +11 -11
- package/dist/views/BondModal/helper.d.ts +1 -1
- package/dist/views/Bonds/Bonds.d.ts +1 -0
- package/package.json +3 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsByChain.scss';
|
|
3
|
-
declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, chains, }: {
|
|
3
|
+
declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, chains, modalVariant }: {
|
|
4
4
|
bonds: BondsData[];
|
|
5
5
|
hotBonds?: string[];
|
|
6
6
|
hideTitles: boolean;
|
|
7
7
|
chains?: number[];
|
|
8
|
+
modalVariant?: "standard" | "alt";
|
|
8
9
|
}) => import("react").JSX.Element;
|
|
9
10
|
export default BondRowsByChain;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsWithTitle.scss';
|
|
3
|
-
declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, }: {
|
|
3
|
+
declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, modalVariant }: {
|
|
4
4
|
chain: number;
|
|
5
5
|
bonds: BondsData[];
|
|
6
6
|
hotBonds?: string[];
|
|
7
7
|
hideTitles: boolean;
|
|
8
|
+
modalVariant?: "standard" | "alt";
|
|
8
9
|
}) => import("react").JSX.Element;
|
|
9
10
|
export default BondRowsWithTitle;
|
package/dist/main.js
CHANGED
|
@@ -7730,9 +7730,11 @@ const getDefaultTransition = (valueKey, { keyframes }) => {
|
|
|
7730
7730
|
};
|
|
7731
7731
|
|
|
7732
7732
|
function getValueTransition(transition, key) {
|
|
7733
|
-
return
|
|
7734
|
-
transition[
|
|
7735
|
-
|
|
7733
|
+
return transition
|
|
7734
|
+
? transition[key] ||
|
|
7735
|
+
transition["default"] ||
|
|
7736
|
+
transition
|
|
7737
|
+
: undefined;
|
|
7736
7738
|
}
|
|
7737
7739
|
|
|
7738
7740
|
const MotionGlobalConfig = {
|
|
@@ -9358,6 +9360,8 @@ const isEasingArray = (ease) => {
|
|
|
9358
9360
|
return Array.isArray(ease) && typeof ease[0] !== "number";
|
|
9359
9361
|
};
|
|
9360
9362
|
|
|
9363
|
+
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
|
|
9364
|
+
|
|
9361
9365
|
const easingLookup = {
|
|
9362
9366
|
linear: noop,
|
|
9363
9367
|
easeIn,
|
|
@@ -9372,7 +9376,7 @@ const easingLookup = {
|
|
|
9372
9376
|
anticipate,
|
|
9373
9377
|
};
|
|
9374
9378
|
const easingDefinitionToFunction = (definition) => {
|
|
9375
|
-
if (
|
|
9379
|
+
if (isBezierDefinition(definition)) {
|
|
9376
9380
|
// If cubic bezier definition, create bezier curve
|
|
9377
9381
|
invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
|
|
9378
9382
|
const [x1, y1, x2, y2] = definition;
|
|
@@ -10163,8 +10167,6 @@ const acceleratedValues = new Set([
|
|
|
10163
10167
|
// "background-color"
|
|
10164
10168
|
]);
|
|
10165
10169
|
|
|
10166
|
-
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
|
|
10167
|
-
|
|
10168
10170
|
// Create a linear easing point for every 10 ms
|
|
10169
10171
|
const resolution = 10;
|
|
10170
10172
|
const generateLinearEasing = (easing, duration // as milliseconds
|
|
@@ -10839,7 +10841,7 @@ class MotionValue {
|
|
|
10839
10841
|
* This will be replaced by the build step with the latest version number.
|
|
10840
10842
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
10841
10843
|
*/
|
|
10842
|
-
this.version = "11.11.
|
|
10844
|
+
this.version = "11.11.7";
|
|
10843
10845
|
/**
|
|
10844
10846
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
10845
10847
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -15544,9 +15546,8 @@ const useIsomorphicLayoutEffect = isBrowser$1 ? useLayoutEffect : useEffect;
|
|
|
15544
15546
|
|
|
15545
15547
|
const LazyContext = createContext({ strict: false });
|
|
15546
15548
|
|
|
15547
|
-
let scheduleHandoffComplete = false;
|
|
15548
15549
|
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
15549
|
-
var _a;
|
|
15550
|
+
var _a, _b;
|
|
15550
15551
|
const { visualElement: parent } = useContext(MotionContext);
|
|
15551
15552
|
const lazyContext = useContext(LazyContext);
|
|
15552
15553
|
const presenceContext = useContext(PresenceContext);
|
|
@@ -15589,11 +15590,12 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
15589
15590
|
*/
|
|
15590
15591
|
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
15591
15592
|
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
|
|
15592
|
-
!window.MotionHandoffIsComplete &&
|
|
15593
|
-
((
|
|
15593
|
+
!((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&
|
|
15594
|
+
((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));
|
|
15594
15595
|
useIsomorphicLayoutEffect(() => {
|
|
15595
15596
|
if (!visualElement)
|
|
15596
15597
|
return;
|
|
15598
|
+
window.MotionIsMounted = true;
|
|
15597
15599
|
visualElement.updateFeatures();
|
|
15598
15600
|
microtask.render(visualElement.render);
|
|
15599
15601
|
/**
|
|
@@ -15616,18 +15618,17 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
15616
15618
|
if (!wantsHandoff.current && visualElement.animationState) {
|
|
15617
15619
|
visualElement.animationState.animateChanges();
|
|
15618
15620
|
}
|
|
15619
|
-
wantsHandoff.current
|
|
15620
|
-
|
|
15621
|
-
|
|
15622
|
-
|
|
15623
|
-
|
|
15621
|
+
if (wantsHandoff.current) {
|
|
15622
|
+
// This ensures all future calls to animateChanges() in this component will run in useEffect
|
|
15623
|
+
queueMicrotask(() => {
|
|
15624
|
+
var _a;
|
|
15625
|
+
(_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);
|
|
15626
|
+
});
|
|
15627
|
+
wantsHandoff.current = false;
|
|
15624
15628
|
}
|
|
15625
15629
|
});
|
|
15626
15630
|
return visualElement;
|
|
15627
15631
|
}
|
|
15628
|
-
function completeHandoff() {
|
|
15629
|
-
window.MotionHandoffIsComplete = true;
|
|
15630
|
-
}
|
|
15631
15632
|
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
15632
15633
|
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
|
|
15633
15634
|
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
|
|
@@ -16616,7 +16617,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
16616
16617
|
* and warn against mismatches.
|
|
16617
16618
|
*/
|
|
16618
16619
|
if (process.env.NODE_ENV === "development") {
|
|
16619
|
-
warnOnce(nextValue.version === "11.11.
|
|
16620
|
+
warnOnce(nextValue.version === "11.11.7", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.11.7 may not work as expected.`);
|
|
16620
16621
|
}
|
|
16621
16622
|
}
|
|
16622
16623
|
else if (isMotionValue(prevValue)) {
|
|
@@ -17319,19 +17320,20 @@ function PopChild({ children, isPresent }) {
|
|
|
17319
17320
|
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {
|
|
17320
17321
|
const presenceChildren = useConstant(newChildrenMap);
|
|
17321
17322
|
const id = useId();
|
|
17323
|
+
const memoizedOnExitComplete = useCallback((childId) => {
|
|
17324
|
+
presenceChildren.set(childId, true);
|
|
17325
|
+
for (const isComplete of presenceChildren.values()) {
|
|
17326
|
+
if (!isComplete)
|
|
17327
|
+
return; // can stop searching when any is incomplete
|
|
17328
|
+
}
|
|
17329
|
+
onExitComplete && onExitComplete();
|
|
17330
|
+
}, [presenceChildren, onExitComplete]);
|
|
17322
17331
|
const context = useMemo(() => ({
|
|
17323
17332
|
id,
|
|
17324
17333
|
initial,
|
|
17325
17334
|
isPresent,
|
|
17326
17335
|
custom,
|
|
17327
|
-
onExitComplete:
|
|
17328
|
-
presenceChildren.set(childId, true);
|
|
17329
|
-
for (const isComplete of presenceChildren.values()) {
|
|
17330
|
-
if (!isComplete)
|
|
17331
|
-
return; // can stop searching when any is incomplete
|
|
17332
|
-
}
|
|
17333
|
-
onExitComplete && onExitComplete();
|
|
17334
|
-
},
|
|
17336
|
+
onExitComplete: memoizedOnExitComplete,
|
|
17335
17337
|
register: (childId) => {
|
|
17336
17338
|
presenceChildren.set(childId, false);
|
|
17337
17339
|
return () => presenceChildren.delete(childId);
|
|
@@ -17342,7 +17344,9 @@ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, p
|
|
|
17342
17344
|
* we want to make a new context value to ensure they get re-rendered
|
|
17343
17345
|
* so they can detect that layout change.
|
|
17344
17346
|
*/
|
|
17345
|
-
presenceAffectsLayout
|
|
17347
|
+
presenceAffectsLayout
|
|
17348
|
+
? [Math.random(), memoizedOnExitComplete]
|
|
17349
|
+
: [isPresent, memoizedOnExitComplete]);
|
|
17346
17350
|
useMemo(() => {
|
|
17347
17351
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
17348
17352
|
}, [isPresent]);
|
|
@@ -65191,7 +65195,7 @@ const youGet = (bond, inputValue) => {
|
|
|
65191
65195
|
var _a;
|
|
65192
65196
|
const bigValue = new BigNumber$1(inputValue).times(new BigNumber$1(10).pow(18));
|
|
65193
65197
|
const billValue = bigValue.div(new BigNumber$1((_a = bond.trueBillPrice) !== null && _a !== void 0 ? _a : 0));
|
|
65194
|
-
return
|
|
65198
|
+
return lodashExports.toNumber(billValue);
|
|
65195
65199
|
};
|
|
65196
65200
|
const youGetUSD = (bond, inputValue) => {
|
|
65197
65201
|
var _a;
|
|
@@ -66039,7 +66043,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
66039
66043
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
66040
66044
|
};
|
|
66041
66045
|
|
|
66042
|
-
const version = '2.21.
|
|
66046
|
+
const version = '2.21.21';
|
|
66043
66047
|
|
|
66044
66048
|
let errorConfig = {
|
|
66045
66049
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|
|
@@ -72340,25 +72344,25 @@ const BondModal = ({ bondAddress, bondChain, accordionTitle = 'What are Bonds?',
|
|
|
72340
72344
|
//
|
|
72341
72345
|
//
|
|
72342
72346
|
// <Flex className="modal-backdrop" onClick={handleClose}>
|
|
72343
|
-
jsxs(Flex, { className: "modal-content font-small gpt", children: [window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"", modalVariant, "\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), toastMessage && jsx$2(Flex, { className: "toast", children: toastMessage }),
|
|
72344
|
-
lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(
|
|
72347
|
+
jsxs(Flex, { className: "modal-content font-small gpt", children: [window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"", modalVariant, "\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), toastMessage && jsx$2(Flex, { className: "toast", children: toastMessage }), 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: (_s = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bondData.chainId]) !== null && _s !== void 0 ? _s : 'question' })] }) }), jsxs(Flex, { sx: { justifyContent: 'space-between', flexGrow: 1 }, children: [jsx$2(TokenImage, { symbol: (_t = bondData.showcaseTokenName) !== null && _t !== void 0 ? _t : 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: (_u = bondData.showcaseTokenName) !== null && _u !== void 0 ? _u : bondData.earnToken.symbol, size: 20 }) }), (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, " + \u00A0", (youGet(bondData, inputValue) -
|
|
72348
|
+
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: userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button button-narrow", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) || !account, onClick: (event) => {
|
|
72345
72349
|
event.stopPropagation();
|
|
72346
72350
|
switchChain({ chainId: bondData.chainId });
|
|
72347
72351
|
}, children: !account ? 'Connect Wallet' : `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsxs(Button, { className: "action-button", load: load, disabled: load || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) || !account || !inputValue || parseFloat(inputValue) === 0, onClick: handleBothPurchases, children: ["buy ", isZap ? 'zap' : 'normal'] })) : (jsxs(Button, { className: "action-button", load: approvalState === ApprovalState.PENDING, disabled: approvalState === ApprovalState.PENDING ||
|
|
72348
72352
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
72349
72353
|
!account ||
|
|
72350
72354
|
!inputValue ||
|
|
72351
|
-
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), jsx$2(Flex, { sx: { width: '100%', marginTop: '10px', marginBottom: '10px' }, children: jsx$2("hr", { className: "fading-hr" }) }), jsxs(Flex, { sx: { width: '100%' }, children: [jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["Market Price: $", formatUSDNumber((
|
|
72355
|
+
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), jsx$2(Flex, { sx: { width: '100%', marginTop: '10px', marginBottom: '10px' }, children: jsx$2("hr", { className: "fading-hr" }) }), jsxs(Flex, { sx: { width: '100%' }, children: [jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["Market Price: $", formatUSDNumber((youGet(bondData, inputValue) * lodashExports.toNumber(earnTokenPrice(bondData))).toString()), jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Our price: " }), jsxs("span", { className: "flex-inline", children: ["$", formatUSDNumber((lodashExports.toNumber(inputValue) * lodashExports.toNumber(bondData.principalTokenPrice)).toString()), ' '] }), jsxs("span", { className: "text-highlight flex-inline", children: ["(discount rate ", bondData === null || bondData === void 0 ? void 0 : bondData.discount.toFixed(2), "%)"] })] }), jsx$2(Flex, { sx: { width: '50px', alignItems: 'center', justifyContent: 'center' }, children: "vs." }), jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["If purchased from market:", ' ', (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Amount you will get:" }), ' ', youGet(bondData, inputValue).toFixed(0), " ", jsx$2("span", { className: "flex-inline", children: bondData.earnToken.symbol })] })] })] })] })] }), jsxs(Flex, { className: "footer-details", children: [jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting start date: ", moment().format('DD-MMM-YYYY')] }), jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting end date:", ' ', moment()
|
|
72352
72356
|
.add(vestingTime((_v = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _v !== void 0 ? _v : 0).days, 'days')
|
|
72353
72357
|
.format('DD-MMM-YYYY')] }), jsx$2(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: "Vesting type: Linear" }), jsx$2(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: "What are bonds?" })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })
|
|
72354
72358
|
// </Flex>
|
|
72355
72359
|
) }))] }));
|
|
72356
72360
|
};
|
|
72357
72361
|
|
|
72358
|
-
const BondRow = ({ bond, hotBonds }) => {
|
|
72362
|
+
const BondRow = ({ bond, hotBonds, modalVariant }) => {
|
|
72359
72363
|
var _a, _b, _c;
|
|
72360
72364
|
// Modal
|
|
72361
|
-
const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
|
|
72365
|
+
const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId, variant: modalVariant }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
|
|
72362
72366
|
const handleOpenModal = () => {
|
|
72363
72367
|
openBuyModal();
|
|
72364
72368
|
if (typeof window !== 'undefined') {
|
|
@@ -72411,7 +72415,7 @@ const BondRow = ({ bond, hotBonds }) => {
|
|
|
72411
72415
|
})})` }) }), jsx$2(Flex$1, { className: "column column-hotbond", children: jsx$2(Flex$1, { className: "column column-icon", children: (hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.includes(bond.billAddress.toLowerCase())) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (jsx$2(Svg, { icon: "hot", width: "20px" })) }) })] })] }, bond.billAddress));
|
|
72412
72416
|
};
|
|
72413
72417
|
|
|
72414
|
-
const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, }) => {
|
|
72418
|
+
const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, modalVariant }) => {
|
|
72415
72419
|
const billsFilteredByChain = bonds.filter((bill) => bill.chainId === chain);
|
|
72416
72420
|
const key = chain;
|
|
72417
72421
|
const [isOpen, setIsOpen] = useState(true);
|
|
@@ -72421,13 +72425,13 @@ const BondRowsWithTitle = ({ chain, bonds, hotBonds, hideTitles, }) => {
|
|
|
72421
72425
|
width: '100%',
|
|
72422
72426
|
marginTop: '0px',
|
|
72423
72427
|
}, children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond) => {
|
|
72424
|
-
return jsx$2(BondRow, { bond: bond, hotBonds: hotBonds }, bond.billAddress);
|
|
72428
|
+
return jsx$2(BondRow, { bond: bond, hotBonds: hotBonds, modalVariant: modalVariant }, bond.billAddress);
|
|
72425
72429
|
}) }, key))] }) }, key));
|
|
72426
72430
|
};
|
|
72427
72431
|
|
|
72428
|
-
const BondRowsByChain = ({ bonds, hotBonds, hideTitles, chains, }) => {
|
|
72432
|
+
const BondRowsByChain = ({ bonds, hotBonds, hideTitles, chains, modalVariant }) => {
|
|
72429
72433
|
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: MAINNET_CHAINS.map((chain, index) => {
|
|
72430
|
-
return ((!chains || chains.length === 0 || chains.includes(chain)) && (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles }, chain)));
|
|
72434
|
+
return ((!chains || chains.length === 0 || chains.includes(chain)) && (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, modalVariant: modalVariant }, chain)));
|
|
72431
72435
|
}) }));
|
|
72432
72436
|
};
|
|
72433
72437
|
|
|
@@ -72580,7 +72584,7 @@ const CheckUrl = () => {
|
|
|
72580
72584
|
return jsx$2(Fragment$1, {});
|
|
72581
72585
|
};
|
|
72582
72586
|
|
|
72583
|
-
const Bonds = ({ chains = [] }) => {
|
|
72587
|
+
const Bonds = ({ chains = [], modalVariant = 'standard' }) => {
|
|
72584
72588
|
// Fetch data
|
|
72585
72589
|
const { data: bondData } = useBondsData();
|
|
72586
72590
|
const { data: hotBonds } = useHotBonds();
|
|
@@ -72627,7 +72631,7 @@ const Bonds = ({ chains = [] }) => {
|
|
|
72627
72631
|
const handleChangeFilterOption = useCallback((newOption) => {
|
|
72628
72632
|
setFilterOption(newOption);
|
|
72629
72633
|
}, []);
|
|
72630
|
-
return (jsxs(Flex$1, { className: "bonds-container table-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondRowHeader, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { chains: chains, bonds: billsToRender, hotBonds: hotBonds, hideTitles: searchQuery !== '' })) : searchQuery ? (jsx$2(Fragment$1, { children: "No results" })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72634
|
+
return (jsxs(Flex$1, { className: "bonds-container table-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondRowHeader, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { chains: chains, bonds: billsToRender, hotBonds: hotBonds, hideTitles: searchQuery !== '', modalVariant: modalVariant })) : searchQuery ? (jsx$2(Fragment$1, { children: "No results" })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
|
|
72631
72635
|
};
|
|
72632
72636
|
|
|
72633
72637
|
var BondsViewOptions;
|
package/dist/scss/index.scss
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
@use 'AccordionText';
|
|
2
|
-
@use 'BondMenu';
|
|
3
|
-
@use 'BondModal';
|
|
4
|
-
@use 'BondRow';
|
|
5
|
-
@use 'BondRowHeader';
|
|
6
|
-
@use 'BondRowsByChain';
|
|
7
|
-
@use 'BondRowsWithTitle';
|
|
8
|
-
@use 'Bonds';
|
|
9
|
-
@use 'ProgressBar';
|
|
10
|
-
@use 'TokenInfoName';
|
|
11
|
-
@use 'YourBonds';
|
|
1
|
+
@use 'AccordionText';
|
|
2
|
+
@use 'BondMenu';
|
|
3
|
+
@use 'BondModal';
|
|
4
|
+
@use 'BondRow';
|
|
5
|
+
@use 'BondRowHeader';
|
|
6
|
+
@use 'BondRowsByChain';
|
|
7
|
+
@use 'BondRowsWithTitle';
|
|
8
|
+
@use 'Bonds';
|
|
9
|
+
@use 'ProgressBar';
|
|
10
|
+
@use 'TokenInfoName';
|
|
11
|
+
@use 'YourBonds';
|
|
12
12
|
@use 'YourBondsModal';
|
|
@@ -3,7 +3,7 @@ declare function formatNumber(input: string): string;
|
|
|
3
3
|
declare function formatUSDNumber(input: string): string;
|
|
4
4
|
declare const youSpend: (inputValue: string) => string;
|
|
5
5
|
declare const youSpendUSD: (bond: BondsData, inputValue: string) => string;
|
|
6
|
-
declare const youGet: (bond: BondsData, inputValue: string) =>
|
|
6
|
+
declare const youGet: (bond: BondsData, inputValue: string) => number;
|
|
7
7
|
declare const youGetUSD: (bond: BondsData, inputValue: string) => string;
|
|
8
8
|
declare const premium: (bond: BondsData, inputValue: string) => string;
|
|
9
9
|
declare const getPremiumColor: (bond: BondsData, inputValue: string) => string;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ape Bond SDK",
|
|
4
4
|
"author": "Ape Bond",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.1.0-test.
|
|
6
|
+
"version": "1.1.0-test.44",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -92,5 +92,6 @@
|
|
|
92
92
|
"last 1 firefox version",
|
|
93
93
|
"last 1 safari version"
|
|
94
94
|
]
|
|
95
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
96
97
|
}
|