@ape.swap/bonds-sdk 1.1.0-test.44 → 1.1.0-test.45
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,10 +1,11 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsByChain.scss';
|
|
3
|
-
|
|
3
|
+
export interface BondRowsByChainProps {
|
|
4
4
|
bonds: BondsData[];
|
|
5
5
|
hotBonds?: string[];
|
|
6
6
|
hideTitles: boolean;
|
|
7
7
|
chains?: number[];
|
|
8
|
-
modalVariant?:
|
|
9
|
-
}
|
|
8
|
+
modalVariant?: 'standard' | 'alt';
|
|
9
|
+
}
|
|
10
|
+
declare const BondRowsByChain: React.FC<BondRowsByChainProps>;
|
|
10
11
|
export default BondRowsByChain;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BondsData } from '../../types/bonds';
|
|
2
2
|
import '../../scss/BondRowsWithTitle.scss';
|
|
3
|
-
|
|
3
|
+
export interface BondRowsWithTitleProps {
|
|
4
4
|
chain: number;
|
|
5
5
|
bonds: BondsData[];
|
|
6
6
|
hotBonds?: string[];
|
|
7
7
|
hideTitles: boolean;
|
|
8
|
-
modalVariant?:
|
|
9
|
-
}
|
|
8
|
+
modalVariant?: 'standard' | 'alt';
|
|
9
|
+
}
|
|
10
|
+
declare const BondRowsWithTitle: React.FC<BondRowsWithTitleProps>;
|
|
10
11
|
export default BondRowsWithTitle;
|
package/dist/main.js
CHANGED
|
@@ -7730,11 +7730,9 @@ const getDefaultTransition = (valueKey, { keyframes }) => {
|
|
|
7730
7730
|
};
|
|
7731
7731
|
|
|
7732
7732
|
function getValueTransition(transition, key) {
|
|
7733
|
-
return transition
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
transition
|
|
7737
|
-
: undefined;
|
|
7733
|
+
return (transition[key] ||
|
|
7734
|
+
transition["default"] ||
|
|
7735
|
+
transition);
|
|
7738
7736
|
}
|
|
7739
7737
|
|
|
7740
7738
|
const MotionGlobalConfig = {
|
|
@@ -9360,8 +9358,6 @@ const isEasingArray = (ease) => {
|
|
|
9360
9358
|
return Array.isArray(ease) && typeof ease[0] !== "number";
|
|
9361
9359
|
};
|
|
9362
9360
|
|
|
9363
|
-
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
|
|
9364
|
-
|
|
9365
9361
|
const easingLookup = {
|
|
9366
9362
|
linear: noop,
|
|
9367
9363
|
easeIn,
|
|
@@ -9376,7 +9372,7 @@ const easingLookup = {
|
|
|
9376
9372
|
anticipate,
|
|
9377
9373
|
};
|
|
9378
9374
|
const easingDefinitionToFunction = (definition) => {
|
|
9379
|
-
if (
|
|
9375
|
+
if (Array.isArray(definition)) {
|
|
9380
9376
|
// If cubic bezier definition, create bezier curve
|
|
9381
9377
|
invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
|
|
9382
9378
|
const [x1, y1, x2, y2] = definition;
|
|
@@ -10167,6 +10163,8 @@ const acceleratedValues = new Set([
|
|
|
10167
10163
|
// "background-color"
|
|
10168
10164
|
]);
|
|
10169
10165
|
|
|
10166
|
+
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
|
|
10167
|
+
|
|
10170
10168
|
// Create a linear easing point for every 10 ms
|
|
10171
10169
|
const resolution = 10;
|
|
10172
10170
|
const generateLinearEasing = (easing, duration // as milliseconds
|
|
@@ -10841,7 +10839,7 @@ class MotionValue {
|
|
|
10841
10839
|
* This will be replaced by the build step with the latest version number.
|
|
10842
10840
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
10843
10841
|
*/
|
|
10844
|
-
this.version = "11.11.
|
|
10842
|
+
this.version = "11.11.0";
|
|
10845
10843
|
/**
|
|
10846
10844
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
10847
10845
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -15546,8 +15544,9 @@ const useIsomorphicLayoutEffect = isBrowser$1 ? useLayoutEffect : useEffect;
|
|
|
15546
15544
|
|
|
15547
15545
|
const LazyContext = createContext({ strict: false });
|
|
15548
15546
|
|
|
15547
|
+
let scheduleHandoffComplete = false;
|
|
15549
15548
|
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
15550
|
-
var _a
|
|
15549
|
+
var _a;
|
|
15551
15550
|
const { visualElement: parent } = useContext(MotionContext);
|
|
15552
15551
|
const lazyContext = useContext(LazyContext);
|
|
15553
15552
|
const presenceContext = useContext(PresenceContext);
|
|
@@ -15590,12 +15589,11 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
15590
15589
|
*/
|
|
15591
15590
|
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
15592
15591
|
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
|
|
15593
|
-
!
|
|
15594
|
-
((
|
|
15592
|
+
!window.MotionHandoffIsComplete &&
|
|
15593
|
+
((_a = window.MotionHasOptimisedAnimation) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)));
|
|
15595
15594
|
useIsomorphicLayoutEffect(() => {
|
|
15596
15595
|
if (!visualElement)
|
|
15597
15596
|
return;
|
|
15598
|
-
window.MotionIsMounted = true;
|
|
15599
15597
|
visualElement.updateFeatures();
|
|
15600
15598
|
microtask.render(visualElement.render);
|
|
15601
15599
|
/**
|
|
@@ -15618,17 +15616,18 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
15618
15616
|
if (!wantsHandoff.current && visualElement.animationState) {
|
|
15619
15617
|
visualElement.animationState.animateChanges();
|
|
15620
15618
|
}
|
|
15621
|
-
|
|
15622
|
-
|
|
15623
|
-
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
});
|
|
15627
|
-
wantsHandoff.current = false;
|
|
15619
|
+
wantsHandoff.current = false;
|
|
15620
|
+
// This ensures all future calls to animateChanges() will run in useEffect
|
|
15621
|
+
if (!scheduleHandoffComplete) {
|
|
15622
|
+
scheduleHandoffComplete = true;
|
|
15623
|
+
queueMicrotask(completeHandoff);
|
|
15628
15624
|
}
|
|
15629
15625
|
});
|
|
15630
15626
|
return visualElement;
|
|
15631
15627
|
}
|
|
15628
|
+
function completeHandoff() {
|
|
15629
|
+
window.MotionHandoffIsComplete = true;
|
|
15630
|
+
}
|
|
15632
15631
|
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
15633
15632
|
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
|
|
15634
15633
|
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
|
|
@@ -16617,7 +16616,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
16617
16616
|
* and warn against mismatches.
|
|
16618
16617
|
*/
|
|
16619
16618
|
if (process.env.NODE_ENV === "development") {
|
|
16620
|
-
warnOnce(nextValue.version === "11.11.
|
|
16619
|
+
warnOnce(nextValue.version === "11.11.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.11.0 may not work as expected.`);
|
|
16621
16620
|
}
|
|
16622
16621
|
}
|
|
16623
16622
|
else if (isMotionValue(prevValue)) {
|
|
@@ -17320,20 +17319,19 @@ function PopChild({ children, isPresent }) {
|
|
|
17320
17319
|
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {
|
|
17321
17320
|
const presenceChildren = useConstant(newChildrenMap);
|
|
17322
17321
|
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]);
|
|
17331
17322
|
const context = useMemo(() => ({
|
|
17332
17323
|
id,
|
|
17333
17324
|
initial,
|
|
17334
17325
|
isPresent,
|
|
17335
17326
|
custom,
|
|
17336
|
-
onExitComplete:
|
|
17327
|
+
onExitComplete: (childId) => {
|
|
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
|
+
},
|
|
17337
17335
|
register: (childId) => {
|
|
17338
17336
|
presenceChildren.set(childId, false);
|
|
17339
17337
|
return () => presenceChildren.delete(childId);
|
|
@@ -17344,9 +17342,7 @@ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, p
|
|
|
17344
17342
|
* we want to make a new context value to ensure they get re-rendered
|
|
17345
17343
|
* so they can detect that layout change.
|
|
17346
17344
|
*/
|
|
17347
|
-
presenceAffectsLayout
|
|
17348
|
-
? [Math.random(), memoizedOnExitComplete]
|
|
17349
|
-
: [isPresent, memoizedOnExitComplete]);
|
|
17345
|
+
presenceAffectsLayout ? [Math.random()] : [isPresent]);
|
|
17350
17346
|
useMemo(() => {
|
|
17351
17347
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
17352
17348
|
}, [isPresent]);
|
|
@@ -66043,7 +66039,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
66043
66039
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
66044
66040
|
};
|
|
66045
66041
|
|
|
66046
|
-
const version = '2.21.
|
|
66042
|
+
const version = '2.21.17';
|
|
66047
66043
|
|
|
66048
66044
|
let errorConfig = {
|
|
66049
66045
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|
|
@@ -72344,7 +72340,7 @@ const BondModal = ({ bondAddress, bondChain, accordionTitle = 'What are Bonds?',
|
|
|
72344
72340
|
//
|
|
72345
72341
|
//
|
|
72346
72342
|
// <Flex className="modal-backdrop" onClick={handleClose}>
|
|
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) -
|
|
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 }), jsx$2(Flex, { className: "modal-header", children: jsx$2(Flex, { className: "svg-close", onClick: handleClose, children: jsx$2(Svg, { icon: "close" }) }) }), 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
72344
|
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) => {
|
|
72349
72345
|
event.stopPropagation();
|
|
72350
72346
|
switchChain({ chainId: bondData.chainId });
|
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.45",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -92,6 +92,5 @@
|
|
|
92
92
|
"last 1 firefox version",
|
|
93
93
|
"last 1 safari version"
|
|
94
94
|
]
|
|
95
|
-
}
|
|
96
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
95
|
+
}
|
|
97
96
|
}
|