@ape.swap/bonds-sdk 2.3.0 → 2.3.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.
package/dist/main.js CHANGED
@@ -18326,7 +18326,6 @@ var types = {};
18326
18326
  (_c[LiquidityDex.PancakeSwapV2] = {
18327
18327
  factory: '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73',
18328
18328
  protocol: Protocols.V2,
18329
- router: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
18330
18329
  }),
18331
18330
  (_c[LiquidityDex.ApeSwapV3] = {
18332
18331
  factory: '0x7Bc382DdC5928964D7af60e7e2f6299A1eA6F48d',
@@ -39210,6 +39209,10 @@ const vestingTimeRemaining = (userBill) => {
39210
39209
  const currentTime = new Date().getTime() / 1000;
39211
39210
  return getTimePeriods(parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime, true);
39212
39211
  };
39212
+ const vestingTimeRemainingYourBonds = (userBill) => {
39213
+ const currentTime = new Date().getTime() / 1000;
39214
+ return (parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime);
39215
+ };
39213
39216
  const discountEarnTokenPrice = (bond) => {
39214
39217
  var _a, _b;
39215
39218
  const earnTokenPrice = parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
@@ -71709,9 +71712,9 @@ const YourBonds = () => {
71709
71712
  return;
71710
71713
  if (sortConfig === null) {
71711
71714
  const sortedBills = (_a = [...userBonds]) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
71712
- const claimableDifference = parseFloat(claimable(b).toFixed(3)) - parseFloat(claimable(a).toFixed(3));
71713
- if (claimableDifference !== 0) {
71714
- return claimableDifference;
71715
+ const vestingDifference = parseFloat(vestingTimeRemainingYourBonds(b).toFixed(3)) - parseFloat(vestingTimeRemainingYourBonds(a).toFixed(3));
71716
+ if (vestingDifference !== 0) {
71717
+ return vestingDifference;
71715
71718
  }
71716
71719
  return 0;
71717
71720
  });
@@ -74112,6 +74115,7 @@ const ProjectDescription = ({ description }) => {
74112
74115
  };
74113
74116
 
74114
74117
  const BondModalHeaderAlt = ({ bondData, onDismiss, showProjectInfoButton, }) => {
74118
+ var _a, _b, _c, _d, _e, _f;
74115
74119
  const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
74116
74120
  const handleClose = () => {
74117
74121
  if (typeof window !== 'undefined') {
@@ -74131,7 +74135,7 @@ const BondModalHeaderAlt = ({ bondData, onDismiss, showProjectInfoButton, }) =>
74131
74135
  // },
74132
74136
  // })
74133
74137
  // }
74134
- 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: { 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" }) })) }) }));
74138
+ 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(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_c = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bondData.billAddress) !== null && _f !== void 0 ? _f : '', projectLink: bondData === null || bondData === void 0 ? void 0 : bondData.projectLink, twitter: bondData === null || bondData === void 0 ? void 0 : bondData.twitter, audit: bondData === null || bondData === void 0 ? void 0 : bondData.audit, chain: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }), jsx$2(Flex, { sx: { 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" }) })) }) }));
74135
74139
  };
74136
74140
 
74137
74141
  const ImageAndShortDescription = ({ bondData, onDismiss }) => {
@@ -12,6 +12,7 @@ export declare const vestingTimeRemaining: (userBill: UserBill) => {
12
12
  minutes: number;
13
13
  seconds: number;
14
14
  };
15
+ export declare const vestingTimeRemainingYourBonds: (userBill: UserBill) => number;
15
16
  export declare const discountEarnTokenPrice: (bond: BondsData) => string;
16
17
  export declare const maxBuy: (bond: BondsData) => 0 | BigNumber;
17
18
  export declare function formatNumber(input: 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": "2.3.0",
6
+ "version": "2.3.2",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",