@ape.swap/bonds-sdk 4.0.0-test.41 → 4.0.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.
Files changed (2) hide show
  1. package/dist/main.js +9 -11
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -63377,7 +63377,6 @@ const stagingUrls = {
63377
63377
  const useSDKConfig = (config) => {
63378
63378
  const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
63379
63379
  const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [types$1.ChainId.BSC, types$1.ChainId.MATIC], useHotBonds: true, connector: 'default', useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined, namingPreference: 'Bonus' }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.2.0' });
63380
- console.log(initialData);
63381
63380
  const { data } = useQuery({
63382
63381
  queryKey: [QUERY_KEYS.SDK_CONFIG],
63383
63382
  queryFn: () => {
@@ -65298,7 +65297,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$
65298
65297
  const billIds = yield multicall(chainId, BOND_ABI, billIdCalls, true, 15);
65299
65298
  const billDataCalls = [];
65300
65299
  const billVersions = [];
65301
- billIds.forEach((idArray, index) => idArray[0].forEach((id) => id.gt(0) &&
65300
+ billIds === null || billIds === void 0 ? void 0 : billIds.forEach((idArray, index) => idArray[0].forEach((id) => id.gt(0) &&
65302
65301
  (billDataCalls.push({
65303
65302
  address: bonds[index].contractAddress[bonds[index].chainId],
65304
65303
  name: bonds[index].billVersion !== types$1.BillVersion.V1 ? 'getBillInfo' : 'billInfo',
@@ -67522,8 +67521,6 @@ function useUserBonds() {
67522
67521
  const { address } = useEVMAccount();
67523
67522
  const { publicKey } = useSOLAccount();
67524
67523
  const solanaAccount = publicKey === null || publicKey === void 0 ? void 0 : publicKey.toBase58();
67525
- console.log(address);
67526
- console.log(solanaAccount);
67527
67524
  const SDKConfig = useSDKConfig();
67528
67525
  const { data: tokenPrices } = useTokenPrices();
67529
67526
  const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
@@ -85223,7 +85220,7 @@ const BondModalMinTierHeader = ({ minTier }) => {
85223
85220
  width: ['100%', '100%', '100%', 'auto', 'auto'],
85224
85221
  }, children: Object.values(TIERS_NAMES).map((tier, index) => {
85225
85222
  if (index >= minTier) {
85226
- return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '25px', height: '25px', marginLeft: '3px', zIndex: 1 } }, `tier-logo-${index}`) }, tier));
85223
+ return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `https://ape.bond/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '25px', height: '25px', marginLeft: '3px', zIndex: 1 } }, `tier-logo-${index}`) }, tier));
85227
85224
  }
85228
85225
  }) })) }));
85229
85226
  };
@@ -85354,7 +85351,7 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
85354
85351
  zIndex: 1,
85355
85352
  background: 'primaryButton',
85356
85353
  opacity: 0.3,
85357
- } }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center' }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: ['12px', '12px', '12px', '14px'], mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
85354
+ } }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center' }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: ['12px', '12px', '12px', '14px'], mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
85358
85355
  color: bonusWithFee && bonusWithFee > 0 ? 'success' : 'error',
85359
85356
  fontSize: ['12px', '12px', '12px', '14px'],
85360
85357
  }, children: ["$", discountEarnTokenPrice(bondData, true)] })] })] })) : (jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", discountEarnTokenPrice(bondData)] }))] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], ml: '10px' }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) })] })] }));
@@ -85405,7 +85402,7 @@ const BonusTable = ({ trueBondPrices, minTier, hideTitle, }) => {
85405
85402
  alignItems: 'center',
85406
85403
  px: '8px',
85407
85404
  mb: '1px',
85408
- }, children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [tier.points !== '0' && (jsx$2("img", { src: `/images/launch/${(_b = TIERS_NAMES[tierToUse]) === null || _b === void 0 ? void 0 : _b.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } })), jsx$2(Flex, { children: tier.points === '0' ? 'No Tier' : tierName }), you && jsx$2(YouTooltip, {})] }), isUnavailable ? (jsx$2(Flex, { sx: { fontWeight: 600, opacity: 0.8 }, children: "UNAVAILABLE" })) : (jsxs(Flex, { sx: { color: tier.bonusWithFee > 0 ? 'success' : 'text', fontWeight: 700, alignItems: 'center' }, children: [tier.bonusWithFee > 0 ? tier.bonusWithFee.toFixed(2) : '0', "%", tier.points !== '0' && (jsx$2(Flex, { sx: {
85405
+ }, children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [tier.points !== '0' && (jsx$2("img", { src: `https://ape.bond/images/launch/${(_b = TIERS_NAMES[tierToUse]) === null || _b === void 0 ? void 0 : _b.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } })), jsx$2(Flex, { children: tier.points === '0' ? 'No Tier' : tierName }), you && jsx$2(YouTooltip, {})] }), isUnavailable ? (jsx$2(Flex, { sx: { fontWeight: 600, opacity: 0.8 }, children: "UNAVAILABLE" })) : (jsxs(Flex, { sx: { color: tier.bonusWithFee > 0 ? 'success' : 'text', fontWeight: 700, alignItems: 'center' }, children: [tier.bonusWithFee > 0 ? tier.bonusWithFee.toFixed(2) : '0', "%", tier.points !== '0' && (jsx$2(Flex, { sx: {
85409
85406
  borderRadius: 'normal',
85410
85407
  border: '1px solid var(--theme-ui-colors-success)',
85411
85408
  px: '4px',
@@ -85441,7 +85438,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
85441
85438
  zIndex: 1,
85442
85439
  background: 'primaryButton',
85443
85440
  opacity: 0.3,
85444
- } }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center', justifyContent: 'center' }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: ['12px', '12px', '14px', '14px'], mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
85441
+ } }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center', justifyContent: 'center' }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: ['12px', '12px', '14px', '14px'], mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
85445
85442
  color: (highestPointsElement === null || highestPointsElement === void 0 ? void 0 : highestPointsElement.bonusWithFee) && (highestPointsElement === null || highestPointsElement === void 0 ? void 0 : highestPointsElement.bonusWithFee) > 0
85446
85443
  ? 'success'
85447
85444
  : 'error',
@@ -85557,7 +85554,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
85557
85554
  background: 'primaryButton',
85558
85555
  opacity: 0.3,
85559
85556
  borderRadius: 'normal',
85560
- } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `${(_c = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _c !== void 0 ? _c : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), !!bondData.feeInPayout && (jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Fee:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the protocol fee (", bondData.feeInPayout, "%)."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val`, children: ["$ ", formatNumberSI(feeUSD)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", vestingTime(((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0) - ((_e = bondData.vestingCliff) !== null && _e !== void 0 ? _e : 0)).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumberSI(estimatedOutputAmount, 4), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatNumberSI(estimatedOutputUSD)] }))] })] }));
85557
+ } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `${(_c = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _c !== void 0 ? _c : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), !!bondData.feeInPayout && (jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Fee:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the protocol fee (", bondData.feeInPayout, "%)."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val`, children: ["$ ", formatNumberSI(feeUSD)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", vestingTime(((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0) - ((_e = bondData.vestingCliff) !== null && _e !== void 0 ? _e : 0)).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumberSI(estimatedOutputAmount, 4), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatNumberSI(estimatedOutputUSD)] }))] })] }));
85561
85558
  };
85562
85559
 
85563
85560
  const ProjectDescription = ({ description, isProjectView }) => {
@@ -85696,7 +85693,7 @@ const GetUpToComponent = ({ bond, depositAmount }) => {
85696
85693
  zIndex: 0,
85697
85694
  background: 'primaryButton',
85698
85695
  opacity: 0.3,
85699
- } }), jsxs(Flex, { sx: { alignItems: 'center', display: ['ruby', 'ruby', 'ruby', 'flex'] }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), "Get up to", jsx$2(Flex, { sx: { color: 'success', mx: '3px', fontWeight: 700 }, children: `+${(_a = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _a !== void 0 ? _a : 0}%` }), "Boost By locking ABOND"] }), !!depositAmount && parseFloat(depositAmount) !== 0 && (jsxs(Flex, { sx: { color: 'success', fontWeight: 700, minWidth: '65px', justifyContent: 'flex-end' }, children: ["$ ", formatUSDNumber(boostAmount.toString()), jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }))] }), jsx$2(AnimatePresence, { children: isOpen && (jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%', marginTop: '5px' }, children: jsx$2(BonusTable, { trueBondPrices: bond === null || bond === void 0 ? void 0 : bond.trueBondPrices, minTier: bond.minTier, hideTitle: true }) })) })] })));
85696
+ } }), jsxs(Flex, { sx: { alignItems: 'center', display: ['ruby', 'ruby', 'ruby', 'flex'] }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), "Get up to", jsx$2(Flex, { sx: { color: 'success', mx: '3px', fontWeight: 700 }, children: `+${(_a = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _a !== void 0 ? _a : 0}%` }), "Boost By locking ABOND"] }), !!depositAmount && parseFloat(depositAmount) !== 0 && (jsxs(Flex, { sx: { color: 'success', fontWeight: 700, minWidth: '65px', justifyContent: 'flex-end' }, children: ["$ ", formatUSDNumber(boostAmount.toString()), jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }))] }), jsx$2(AnimatePresence, { children: isOpen && (jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%', marginTop: '5px' }, children: jsx$2(BonusTable, { trueBondPrices: bond === null || bond === void 0 ? void 0 : bond.trueBondPrices, minTier: bond.minTier, hideTitle: true }) })) })] })));
85700
85697
  };
85701
85698
 
85702
85699
  const StepBubble = ({ number, title, currentStep, hideBar, loading, }) => {
@@ -87546,9 +87543,10 @@ const useActiveView = () => {
87546
87543
  const { data: activeView = BondsViewOptions$1.BONDSMARKET } = useQuery({
87547
87544
  queryKey: [QUERY_KEYS.ACTIVE_VIEW],
87548
87545
  queryFn: () => {
87546
+ var _a;
87549
87547
  // Initialize from the URL if on first load
87550
87548
  if (typeof window !== 'undefined') {
87551
- const isYourBonds = window.location.search === '?yourBonds';
87549
+ const isYourBonds = (_a = window.location.search) === null || _a === void 0 ? void 0 : _a.includes('?yourBonds');
87552
87550
  return isYourBonds ? BondsViewOptions$1.YOURBONDS : BondsViewOptions$1.BONDSMARKET;
87553
87551
  }
87554
87552
  return BondsViewOptions$1.BONDSMARKET;
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": "4.0.0-test.41",
6
+ "version": "4.0.0-test.45",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",