@ape.swap/bonds-sdk 3.0.66 → 3.0.67

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.
@@ -38,5 +38,6 @@ export declare const QUERY_KEYS: {
38
38
  ACTIVE_VIEW: string;
39
39
  PRE_TGE_LIST: string;
40
40
  PRE_TGE_BONDS: string;
41
+ PRE_TGE_USER_BONDS: string;
41
42
  USER_TOKENS_BALANCES: string;
42
43
  };
package/dist/main.js CHANGED
@@ -18130,6 +18130,7 @@ var types = {};
18130
18130
  BillArtCollection['AITECH_Collection1'] = 'AITECH_Collection1';
18131
18131
  BillArtCollection['GPT_Collection1'] = 'GPT_Collection1';
18132
18132
  BillArtCollection['GoldenTicket_Collection1'] = 'GoldenTicket_Collection1';
18133
+ BillArtCollection['Berachain_Collection1'] = 'Berachain_Collection1';
18133
18134
  })((BillArtCollection = exports.BillArtCollection || (exports.BillArtCollection = {})));
18134
18135
  exports.defaultBillArtCollection = BillArtCollection.ApeBond_Collection1;
18135
18136
  exports.MigrationVestingTerms = {
@@ -18889,6 +18890,7 @@ const QUERY_KEYS = {
18889
18890
  ACTIVE_VIEW: 'ApeBond-SDK-activeView',
18890
18891
  PRE_TGE_LIST: 'ApeBond-SDK-preTGEList',
18891
18892
  PRE_TGE_BONDS: 'ApeBond-SDK-preTGEBonds',
18893
+ PRE_TGE_USER_BONDS: 'ApeBond-SDK-preTGEUserBonds',
18892
18894
  USER_TOKENS_BALANCES: 'ApeBond-SDK-userTokensBalances',
18893
18895
  };
18894
18896
 
@@ -19029,39 +19031,6 @@ const TokenInfoAndName = ({ tokenSymbol, chain, tag, vestEnds, isHotBond, }) =>
19029
19031
  }, children: jsx$2(Flex, { sx: { display: isHotBond ? 'flex' : ['none', 'none', 'none', 'none', 'flex'] }, children: tag && jsx$2(ListTag, { text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }) })] }));
19030
19032
  };
19031
19033
 
19032
- const formatNumber$3 = (number, minPrecision = 2, maxPrecision = 2) => {
19033
- const options = {
19034
- minimumFractionDigits: minPrecision,
19035
- maximumFractionDigits: maxPrecision,
19036
- };
19037
- return number.toLocaleString('en-US', options);
19038
- };
19039
- // Formats a number with SI (International System of Units) sufixes
19040
- const formatNumberSI = (num, digits = 2) => {
19041
- const number = typeof num === 'string' ? parseFloat(num) : num;
19042
- const lookupSI = [
19043
- { value: 1, symbol: '' },
19044
- { value: 1e6, symbol: 'M' },
19045
- { value: 1e9, symbol: 'B' },
19046
- { value: 1e12, symbol: 'T' },
19047
- ];
19048
- const regEx = /\.0+$|(\.[0-9]*[1-9])0+$/;
19049
- let formatted;
19050
- if (number >= 1e18) {
19051
- formatted = '∞';
19052
- }
19053
- else {
19054
- let i;
19055
- for (i = lookupSI.length - 1; i > 0; i--) {
19056
- if (number >= lookupSI[i].value) {
19057
- break;
19058
- }
19059
- }
19060
- formatted = formatNumber$3(number / lookupSI[i].value, digits, digits).replace(regEx, '$1') + lookupSI[i].symbol;
19061
- }
19062
- return formatted;
19063
- };
19064
-
19065
19034
  /*
19066
19035
  * bignumber.js v9.3.0
19067
19036
  * A JavaScript library for arbitrary-precision arithmetic.
@@ -21968,6 +21937,55 @@ function toFixedPoint(str, e, z) {
21968
21937
 
21969
21938
  var BigNumber$1 = clone$2();
21970
21939
 
21940
+ // Ideally let's keep all formating in this file and DO NOT CREATE MORE FILES
21941
+ const formatNumber$3 = (number, minPrecision = 2, maxPrecision = 2) => {
21942
+ const options = {
21943
+ minimumFractionDigits: minPrecision,
21944
+ maximumFractionDigits: maxPrecision,
21945
+ };
21946
+ return number.toLocaleString('en-US', options);
21947
+ };
21948
+ // Formats a number with SI (International System of Units) sufixes
21949
+ const formatNumberSI = (num, digits = 2) => {
21950
+ const number = typeof num === 'string' ? parseFloat(num) : num;
21951
+ const lookupSI = [
21952
+ { value: 1, symbol: '' },
21953
+ { value: 1e6, symbol: 'M' },
21954
+ { value: 1e9, symbol: 'B' },
21955
+ { value: 1e12, symbol: 'T' },
21956
+ ];
21957
+ const regEx = /\.0+$|(\.[0-9]*[1-9])0+$/;
21958
+ let formatted;
21959
+ if (number >= 1e18) {
21960
+ formatted = '∞';
21961
+ }
21962
+ else {
21963
+ let i;
21964
+ for (i = lookupSI.length - 1; i > 0; i--) {
21965
+ if (number >= lookupSI[i].value) {
21966
+ break;
21967
+ }
21968
+ }
21969
+ formatted = formatNumber$3(number / lookupSI[i].value, digits, digits).replace(regEx, '$1') + lookupSI[i].symbol;
21970
+ }
21971
+ return formatted;
21972
+ };
21973
+ const formatUSDNumber$1 = (input) => {
21974
+ const number = new BigNumber$1(input);
21975
+ if (number.isNaN())
21976
+ return '0';
21977
+ // If the number is greater than 0 but less than 0.01
21978
+ if (number.gt(0) && number.lt(0.01)) {
21979
+ return '<0.01';
21980
+ }
21981
+ // If the number is greater than 1k, round to no decimals.
21982
+ if (number.gt(1000)) {
21983
+ return number.toNumber().toLocaleString('en-US', { maximumFractionDigits: 0 });
21984
+ }
21985
+ // Note: Between 1k and 0.01 show 2 decimals
21986
+ return parseFloat(number.toFixed(2)).toLocaleString('en-US');
21987
+ };
21988
+
21971
21989
  const getBalanceNumber = (balance, decimals = 18) => {
21972
21990
  // use with caution. JS can only safely represent up to 15-17 digits of precision
21973
21991
  // so you will lose precision in decimals and really big numbers, for those cases use getBNWithDecimals
@@ -70239,7 +70257,7 @@ const UserBondRow = ({ bill }) => {
70239
70257
  const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
70240
70258
  return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: bill.bond.earnToken.symbol, chain: bill.bond.chainId, tag: (_c = bill.bond.tags) === null || _c === void 0 ? void 0 : _c[0], vestEnds: `Ends in ${getPendingVestingString(bill)}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_d = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _d === void 0 ? void 0 : _d.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_e = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol) || '', bondContract: (_f = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _f !== void 0 ? _f : '', projectLink: (_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.projectLink, twitter: (_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.twitter, audit: (_j = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _j === void 0 ? void 0 : _j.audit, chain: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
70241
70259
  opacity: 0.8,
70242
- }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * ((_l = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _l !== void 0 ? _l : 0)).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(totalPending(bill) * ((_m = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _m !== void 0 ? _m : 0)).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingTimeRemainingString(bill) }), jsx$2("div", { className: "your-bonds-column-button", children: userChainId !== bill.bond.chainId ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || load, load: load, onClick: (event) => {
70260
+ }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimable(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * ((_l = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _l !== void 0 ? _l : 0)).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(totalPending(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(totalPending(bill) * ((_m = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _m !== void 0 ? _m : 0)).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingTimeRemainingString(bill) }), jsx$2("div", { className: "your-bonds-column-button", children: userChainId !== bill.bond.chainId ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || load, load: load, onClick: (event) => {
70243
70261
  event.stopPropagation();
70244
70262
  // Add your claim logic here
70245
70263
  switchChain({ chainId: bill.bond.chainId });
@@ -73298,6 +73316,10 @@ const getLaunchBondsPublicData = (preTGEBonds, chains, apiUrl) => __awaiter$9(vo
73298
73316
  address: bill.contractAddress,
73299
73317
  name: 'maxPoints',
73300
73318
  },
73319
+ {
73320
+ address: bill.contractAddress,
73321
+ name: 'startVestingTimestamp',
73322
+ },
73301
73323
  ];
73302
73324
  });
73303
73325
  const vals = yield multicall(chainId, launchBondsABI_V2_2_0, launchBondsCalls);
@@ -73306,10 +73328,11 @@ const getLaunchBondsPublicData = (preTGEBonds, chains, apiUrl) => __awaiter$9(vo
73306
73328
  const returnedBills = chunkedBills === null || chunkedBills === void 0 ? void 0 : chunkedBills.map((chunk, index) => {
73307
73329
  const bondConfig = filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.find((bill) => (bill === null || bill === void 0 ? void 0 : bill.index) === preTGEBondsIds[index]);
73308
73330
  const principalTokenPrice = 1;
73309
- const earnTokenPrice = bondConfig.initPrice;
73310
- const [trueBillPrice, terms, totalPrincipalBilled, finalized, minPoints, maxPoints] = chunk;
73331
+ const [trueBillPrice, terms, totalPrincipalBilled, finalized, minPoints, maxPoints, startVestingTimestamp] = chunk;
73311
73332
  const [, , vestingTerm, , , initialRelease, totalRaise, maxTotalPayout] = terms;
73312
- const data = Object.assign(Object.assign({}, bondConfig), { initialRelease, vestingTerm: vestingTerm === null || vestingTerm === void 0 ? void 0 : vestingTerm.toString(), trueBillPrice: trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString(), maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), totalPrincipalBilled: totalPrincipalBilled === null || totalPrincipalBilled === void 0 ? void 0 : totalPrincipalBilled.toString(), earnTokenPrice: earnTokenPrice, principalTokenPrice, totalRaise: totalRaise === null || totalRaise === void 0 ? void 0 : totalRaise.toString(), finalized: finalized[0], minPoints: minPoints.toString(), maxPoints: maxPoints.toString() });
73333
+ const initPrice = getBalanceNumber(trueBillPrice, bondConfig.token.decimals[bondConfig.chainId]);
73334
+ const data = Object.assign(Object.assign({}, bondConfig), { initialRelease: initialRelease / 10000, vestingTerm: vestingTerm === null || vestingTerm === void 0 ? void 0 : vestingTerm.toString(), trueBillPrice: trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString(), maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), totalPrincipalBilled: totalPrincipalBilled === null || totalPrincipalBilled === void 0 ? void 0 : totalPrincipalBilled.toString(), earnTokenPrice: initPrice, // This should eventually be changed for the real market price?
73335
+ principalTokenPrice, totalRaise: totalRaise === null || totalRaise === void 0 ? void 0 : totalRaise.toString(), finalized: finalized[0], minPoints: minPoints.toString(), maxPoints: maxPoints.toString(), startVestingTimestamp: startVestingTimestamp === null || startVestingTimestamp === void 0 ? void 0 : startVestingTimestamp.toString(), initTime: terms.startTime.toString(), finishTime: terms.endTime.toString(), initPrice });
73313
73336
  return data;
73314
73337
  });
73315
73338
  data.push(returnedBills);
@@ -73332,9 +73355,9 @@ function usePreTGEUserBonds() {
73332
73355
  const { address } = useAccount();
73333
73356
  const apiUrl = useURLByEnvironment('apiV2');
73334
73357
  return useQuery({
73335
- queryKey: [QUERY_KEYS.PRE_TGE_BONDS, (_a = preTGEBonds === null || preTGEBonds === void 0 ? void 0 : preTGEBonds.length) !== null && _a !== void 0 ? _a : '', address],
73358
+ queryKey: [QUERY_KEYS.PRE_TGE_USER_BONDS, (_a = preTGEBonds === null || preTGEBonds === void 0 ? void 0 : preTGEBonds.length) !== null && _a !== void 0 ? _a : '', address],
73336
73359
  queryFn: () => fetchPreTGEUserBonds(preTGEBonds, address, apiUrl),
73337
- staleTime: 30000,
73360
+ refetchInterval: 30000,
73338
73361
  refetchOnWindowFocus: false,
73339
73362
  enabled: !!preTGEBonds && preTGEBonds.length > 0 && !!address,
73340
73363
  });
@@ -73432,27 +73455,119 @@ const fetchPreTGEUserBonds = (preTGEBonds, account, apiUrl) => __awaiter$9(void
73432
73455
  });
73433
73456
 
73434
73457
  const PreTgeActions = ({ userBond }) => {
73435
- var _a;
73458
+ var _a, _b;
73459
+ //Hooks
73460
+ const { writeContractAsync } = useWriteContract();
73461
+ const { address: account } = useAccount();
73462
+ const SDKConfig = useSDKConfig();
73463
+ const { addToastError } = usePopups();
73464
+ const { refetch } = usePreTGEUserBonds();
73465
+ //State
73466
+ const [loading, setLoading] = useState(false);
73467
+ const [hash, setHash] = useState('');
73468
+ // Data
73469
+ const { isLoading: isLoadingOnChain, isSuccess } = useMonitorTxHash(hash, userBond === null || userBond === void 0 ? void 0 : userBond.chainId);
73470
+ const hasRedeemed = (_a = userBond === null || userBond === void 0 ? void 0 : userBond.accountInfo) === null || _a === void 0 ? void 0 : _a.hasRedeemed;
73436
73471
  const now = new Date().getTime();
73437
- const redeemTime = ((_a = userBond === null || userBond === void 0 ? void 0 : userBond.redeemTime) !== null && _a !== void 0 ? _a : 0) * 1000;
73438
- // const isRedeemable = now > redeemTime
73472
+ const redeemTime = ((_b = userBond === null || userBond === void 0 ? void 0 : userBond.redeemTime) !== null && _b !== void 0 ? _b : 0) * 1000;
73439
73473
  const timeDiff = Math.abs(redeemTime - now);
73440
73474
  const hoursLeft = Math.floor((timeDiff - (timeDiff % (1000 * 60 * 60))) / (1000 * 60 * 60));
73441
73475
  const minsLeft = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
73442
- return (jsxs(Button, { disabled: true, fullWidth: true, sx: { fontSize: '14px', height: '30px', background: 'var(--theme-ui-colors-white4) !important' }, children: ["Claimable in ", hoursLeft > 0 ? `${hoursLeft}h` : `${minsLeft}m`] }));
73476
+ const saleFinalized = userBond === null || userBond === void 0 ? void 0 : userBond.finalized;
73477
+ const handleRedeem = () => __awaiter$9(void 0, void 0, void 0, function* () {
73478
+ setLoading(true);
73479
+ writeContractAsync({
73480
+ address: userBond.contractAddress,
73481
+ abi: launchBondsABI_V2_2_0,
73482
+ functionName: 'redeem',
73483
+ chain: userBond.chainId,
73484
+ account,
73485
+ })
73486
+ .then((r) => {
73487
+ setHash(r);
73488
+ })
73489
+ .catch((e) => {
73490
+ var _a;
73491
+ console.error(e.message);
73492
+ reportError({
73493
+ apiUrl: (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2,
73494
+ error: e.message,
73495
+ extraInfo: { type: 'redeemLaunchBond', error: e.message },
73496
+ chainId: userBond.chainId,
73497
+ account,
73498
+ });
73499
+ addToastError(e.shortMessage);
73500
+ })
73501
+ .finally(() => setLoading(false));
73502
+ });
73503
+ const handleClaim = () => __awaiter$9(void 0, void 0, void 0, function* () {
73504
+ var _a, _b;
73505
+ setLoading(true);
73506
+ setHash('');
73507
+ if (!((_a = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _a === void 0 ? void 0 : _a.id))
73508
+ return;
73509
+ writeContractAsync({
73510
+ address: userBond.contractAddress,
73511
+ abi: launchBondsABI_V2_2_0,
73512
+ functionName: 'claim',
73513
+ args: [(_b = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _b === void 0 ? void 0 : _b.id],
73514
+ chain: userBond.chainId,
73515
+ account,
73516
+ })
73517
+ .then((r) => {
73518
+ setHash(r);
73519
+ })
73520
+ .catch((e) => {
73521
+ var _a;
73522
+ console.error(e.message);
73523
+ reportError({
73524
+ apiUrl: (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2,
73525
+ error: e.message,
73526
+ extraInfo: { type: 'claimLaunchBond', error: e.message },
73527
+ chainId: userBond.chainId,
73528
+ account,
73529
+ });
73530
+ addToastError(e.shortMessage);
73531
+ })
73532
+ .finally(() => setLoading(false));
73533
+ });
73534
+ useEffect(() => {
73535
+ // trigger refetch user bonds once tx is confirmed
73536
+ if (!!hash && isSuccess && !isLoadingOnChain) {
73537
+ console.log('trigger user refetch');
73538
+ refetch();
73539
+ }
73540
+ }, [hash, isSuccess, isLoadingOnChain]);
73541
+ return (jsx$2(Button, { disabled: !saleFinalized || loading || isLoadingOnChain, load: loading || isLoadingOnChain, fullWidth: true, sx: {
73542
+ fontSize: '14px',
73543
+ height: '30px',
73544
+ background: !saleFinalized && 'var(--theme-ui-colors-white4) !important',
73545
+ }, onClick: hasRedeemed ? handleClaim : handleRedeem, children: saleFinalized ? 'Claim' : `Claimable in ${hoursLeft > 0 ? `${hoursLeft}h` : `${minsLeft}m`}` }));
73443
73546
  };
73444
73547
 
73445
73548
  const PreTgeUserRow = ({ userBond }) => {
73446
- var _a, _b, _c, _d;
73549
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
73550
+ const saleFinalized = userBond.finalized;
73551
+ const hasRedeemed = userBond.accountInfo.hasRedeemed;
73447
73552
  const depositAmount = getBalanceNumber(new BigNumber$1((_a = userBond.accountInfo.depositAmount) !== null && _a !== void 0 ? _a : '0'), userBond.token.decimals[userBond.chainId]);
73448
73553
  const truePricePaid = getBalanceNumber(new BigNumber$1((_b = userBond.accountInfo.truePricePaid) !== null && _b !== void 0 ? _b : '0'), userBond.token.decimals[userBond.chainId]);
73449
- const pendingAmount = depositAmount / truePricePaid;
73450
- const pendingUSD = pendingAmount * userBond.earnTokenPrice;
73451
73554
  const vestingTimePeriods = getTimePeriods(parseFloat(userBond.vestingTerm), false);
73452
- const vestingString = `${vestingTimePeriods.months} Months`;
73453
- return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: userBond.earnToken.symbol, chain: userBond.chainId, tag: (_c = userBond.tags) === null || _c === void 0 ? void 0 : _c[0], vestEnds: `Ends in ${vestingString}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.address[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', earnTokenSymbol: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.symbol) || '', bondContract: (_d = userBond.contractAddress) !== null && _d !== void 0 ? _d : '', projectLink: userBond === null || userBond === void 0 ? void 0 : userBond.projectLink, twitter: userBond === null || userBond === void 0 ? void 0 : userBond.twitter, audit: userBond === null || userBond === void 0 ? void 0 : userBond.audit, chain: userBond === null || userBond === void 0 ? void 0 : userBond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
73555
+ const vestingString = hasRedeemed
73556
+ ? getPendingVestingString(userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData)
73557
+ : `${vestingTimePeriods.months} Months`;
73558
+ const userAllocation = depositAmount / (userBond === null || userBond === void 0 ? void 0 : userBond.initPrice);
73559
+ const initialRelease = !hasRedeemed && saleFinalized ? userAllocation * (userBond === null || userBond === void 0 ? void 0 : userBond.initialRelease) : 0;
73560
+ // pendingRewards variable follows the naming of the SC, but it actually means currently claimable tokens
73561
+ const pendingRewards = getBalanceNumber(new BigNumber$1((_c = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _c === void 0 ? void 0 : _c.pendingRewards), (_e = (_d = userBond === null || userBond === void 0 ? void 0 : userBond.earnToken) === null || _d === void 0 ? void 0 : _d.decimals) === null || _e === void 0 ? void 0 : _e[userBond.chainId]);
73562
+ // payout variable follows the naming of the SC, but it actually means total tokens vested
73563
+ const payout = getBalanceNumber(new BigNumber$1((_f = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _f === void 0 ? void 0 : _f.payout), (_h = (_g = userBond === null || userBond === void 0 ? void 0 : userBond.earnToken) === null || _g === void 0 ? void 0 : _g.decimals) === null || _h === void 0 ? void 0 : _h[userBond.chainId]);
73564
+ const claimableAmount = hasRedeemed ? pendingRewards : initialRelease;
73565
+ const claimableUSD = claimableAmount * userBond.initPrice;
73566
+ const pendingAmount = hasRedeemed ? payout : depositAmount / truePricePaid;
73567
+ const pendingUSD = pendingAmount * userBond.earnTokenPrice;
73568
+ return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: userBond.earnToken.symbol, chain: userBond.chainId, tag: (_j = userBond.tags) === null || _j === void 0 ? void 0 : _j[0], vestEnds: `Ends in ${vestingString}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.address[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', earnTokenSymbol: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.symbol) || '', bondContract: (_k = userBond.contractAddress) !== null && _k !== void 0 ? _k : '', projectLink: userBond === null || userBond === void 0 ? void 0 : userBond.projectLink, twitter: userBond === null || userBond === void 0 ? void 0 : userBond.twitter, audit: userBond === null || userBond === void 0 ? void 0 : userBond.audit, chain: userBond === null || userBond === void 0 ? void 0 : userBond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
73454
73569
  opacity: 0.8,
73455
- }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: ["0", jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: "($0.00)" })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [pendingAmount.toFixed(), jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", pendingUSD.toFixed(2), ")"] })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingString }), jsx$2("div", { className: "your-bonds-column-button", children: jsx$2(PreTgeActions, { userBond: userBond }) })] })] }));
73570
+ }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimableAmount, 3), jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(claimableUSD), ")"] })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pendingAmount, 3), jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(pendingUSD), ")"] })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingString }), jsx$2("div", { className: "your-bonds-column-button", children: jsx$2(PreTgeActions, { userBond: userBond }) })] })] }));
73456
73571
  };
73457
73572
 
73458
73573
  const YourBonds = ({ showOnly }) => {
@@ -79355,7 +79470,7 @@ const BondCards = ({ bond }) => {
79355
79470
  borderBottomRightRadius: 'normal',
79356
79471
  borderBottomLeftRadius: 'normal',
79357
79472
  },
79358
- }, children: [jsxs("div", { className: "bond-card-title", children: ["Initial Release", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the percentage of tokens you can claim immediately on ", bond.tgeString, ". The rest follows the vesting schedule."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), "25%"] }), jsxs("div", { className: "bond-card-block", sx: {
79473
+ }, children: [jsxs("div", { className: "bond-card-title", children: ["Initial Release", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the percentage of tokens you can claim immediately on ", bond.tgeString, ". The rest follows the vesting schedule."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), bond.initialRelease * 100, "%"] }), jsxs("div", { className: "bond-card-block", sx: {
79359
79474
  borderRadius: ['0px', '0px', '0px', 'normal'],
79360
79475
  '&:first-of-type': {
79361
79476
  borderTopRightRadius: 'normal',
@@ -79369,12 +79484,10 @@ const BondCards = ({ bond }) => {
79369
79484
  };
79370
79485
 
79371
79486
  const BuyComponent = ({ bondAddress, bondChain, onDismiss, }) => {
79372
- var _a, _b, _c, _d, _e, _f, _g;
79487
+ var _a, _b, _c, _d;
79373
79488
  const { data: preTGEBonds } = usePreTGEBondsData();
79374
79489
  const bond = preTGEBonds === null || preTGEBonds === void 0 ? void 0 : preTGEBonds.find((bond) => bond.contractAddress.toLowerCase() === bondAddress.toLowerCase() && bond.chainId === bondChain);
79375
79490
  // Hooks
79376
- const { data: userEscrowWeight } = useTierPoints();
79377
- const userTier = getUserTier(userEscrowWeight);
79378
79491
  const { address } = useAccount();
79379
79492
  const { data: principalTokenBalance } = useCurrencyBalance(bond.token, address, bond.chainId);
79380
79493
  // Local state
@@ -79388,19 +79501,13 @@ const BuyComponent = ({ bondAddress, bondChain, onDismiss, }) => {
79388
79501
  const youGet = parseFloat(inputValue) / (bond === null || bond === void 0 ? void 0 : bond.initPrice);
79389
79502
  const youGetUSD = youGet * (bond === null || bond === void 0 ? void 0 : bond.tgePrice);
79390
79503
  const bonusUSD = youGetUSD - inputValueToDisplayUSD;
79391
- const airdropBonus = (_c = bond === null || bond === void 0 ? void 0 : bond.tiersAirdrop) === null || _c === void 0 ? void 0 : _c[userTier !== null && userTier !== void 0 ? userTier : 'noTier'];
79392
- (parseFloat(inputValue) * airdropBonus) / (bond === null || bond === void 0 ? void 0 : bond.initPrice);
79393
- `${bond === null || bond === void 0 ? void 0 : bond.totalAllocation}`;
79394
- new Date().getTime();
79395
- ((_d = bond === null || bond === void 0 ? void 0 : bond.initTime) !== null && _d !== void 0 ? _d : 0) * 1000;
79396
- ((_e = bond === null || bond === void 0 ? void 0 : bond.finishTime) !== null && _e !== void 0 ? _e : 0) * 1000;
79397
79504
  const handleClose = () => {
79398
79505
  if (typeof window !== 'undefined') {
79399
79506
  window.history.pushState({}, '', `/bonds`);
79400
79507
  }
79401
79508
  onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
79402
79509
  };
79403
- return (jsxs(Modal, { onDismiss: handleClose, sx: { width: '740px' }, children: [jsx$2(ModalHeader, { onDismiss: handleClose, hideDivider: true }), jsx$2(Flex, { sx: styles$8.buyContainer, children: jsxs(Flex, { sx: styles$8.cardContainer, children: [jsx$2(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: jsxs(Flex, { children: [jsxs(Flex, { children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: bond.earnToken.symbol, size: 50, chain: bond.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bond.earnToken.symbol, jsx$2(ListTag, { text: (_f = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _f === void 0 ? void 0 : _f[0] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '15px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", bond.tgePrice] }), jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", bond.initPrice] })] })] }) }), jsx$2(ProjectDescription, { description: bond.shortDescription, isProjectView: true }), jsx$2(BondCards, { bond: bond }), jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoRowsContainer), { mt: '10px' }), children: [jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Spend:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(parseFloat(inputValueToDisplay)) ? 0 : inputValueToDisplay, " ", bond === null || bond === void 0 ? void 0 : bond.token.symbol, " = $", isNaN(inputValueToDisplayUSD) ? '0' : inputValueToDisplayUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoTitle), { alignItems: 'center' }), children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), 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" }) }) })] }), jsxs(Text, { sx: Object.assign(Object.assign({}, styles$8.infoData), { color: 'success' }), children: ["$", isNaN(bonusUSD) ? '0' : bonusUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Get:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(youGet) ? 0 : formatNumberSI(youGet, 0), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, " = $", isNaN(youGetUSD) ? '0' : youGetUSD.toFixed(2)] })] })] }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: bond === null || bond === void 0 ? void 0 : bond.token, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(principalTokenBalance !== null && principalTokenBalance !== void 0 ? principalTokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: () => null, chainId: bond === null || bond === void 0 ? void 0 : bond.chainId, enableZap: false, bondPrincipalToken: bond === null || bond === void 0 ? void 0 : bond.token, tokenBalance: principalTokenBalance, selectedTokenPrice: bond.principalTokenPrice, inputDisabled: false }), jsxs(Flex, { sx: {
79510
+ return (jsxs(Modal, { onDismiss: handleClose, sx: { width: '740px' }, children: [jsx$2(ModalHeader, { onDismiss: handleClose, hideDivider: true }), jsx$2(Flex, { sx: styles$8.buyContainer, children: jsxs(Flex, { sx: styles$8.cardContainer, children: [jsx$2(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: jsxs(Flex, { children: [jsxs(Flex, { children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: bond.earnToken.symbol, size: 50, chain: bond.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bond.earnToken.symbol, jsx$2(ListTag, { text: (_c = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _c === void 0 ? void 0 : _c[0] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '15px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", bond.tgePrice] }), jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", bond.initPrice] })] })] }) }), jsx$2(ProjectDescription, { description: bond.shortDescription, isProjectView: true }), jsx$2(BondCards, { bond: bond }), jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoRowsContainer), { mt: '10px' }), children: [jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Spend:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(parseFloat(inputValueToDisplay)) ? 0 : inputValueToDisplay, " ", bond === null || bond === void 0 ? void 0 : bond.token.symbol, " = $", isNaN(inputValueToDisplayUSD) ? '0' : inputValueToDisplayUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoTitle), { alignItems: 'center' }), children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), 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" }) }) })] }), jsxs(Text, { sx: Object.assign(Object.assign({}, styles$8.infoData), { color: 'success' }), children: ["$", isNaN(bonusUSD) ? '0' : bonusUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Get:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(youGet) ? 0 : formatNumberSI(youGet, 0), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, " = $", isNaN(youGetUSD) ? '0' : youGetUSD.toFixed(2)] })] })] }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: bond === null || bond === void 0 ? void 0 : bond.token, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(principalTokenBalance !== null && principalTokenBalance !== void 0 ? principalTokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: () => null, chainId: bond === null || bond === void 0 ? void 0 : bond.chainId, enableZap: false, bondPrincipalToken: bond === null || bond === void 0 ? void 0 : bond.token, tokenBalance: principalTokenBalance, selectedTokenPrice: bond.principalTokenPrice, inputDisabled: false }), jsxs(Flex, { sx: {
79404
79511
  width: '100%',
79405
79512
  background: '#DE62F366',
79406
79513
  justifyContent: 'center',
@@ -79418,7 +79525,7 @@ const BuyComponent = ({ bondAddress, bondChain, onDismiss, }) => {
79418
79525
  }, children: [jsx$2(Flex, { sx: { width: ['100%', '100%', '100%', '45%'], justifyContent: 'center' }, children: jsxs(Button, { variant: "secondary", onClick: () => {
79419
79526
  var _a;
79420
79527
  return window.open(`/swap?outputCurrency=${(_a = bond === null || bond === void 0 ? void 0 : bond.token) === null || _a === void 0 ? void 0 : _a.address[bond === null || bond === void 0 ? void 0 : bond.chainId]}&outputChain=${bond === null || bond === void 0 ? void 0 : bond.chainId}`, '_blank');
79421
- }, fullWidth: true, children: ["Get ", (_g = bond === null || bond === void 0 ? void 0 : bond.token) === null || _g === void 0 ? void 0 : _g.symbol] }) }), (bond === null || bond === void 0 ? void 0 : bond.contractAddress) ? (jsx$2(BuyAction, { launchBond: bond, inputValue: inputValue, selectedCurrency: bond === null || bond === void 0 ? void 0 : bond.token, soldout: (bond === null || bond === void 0 ? void 0 : bond.billType) === 'fcfs' && percentageSold === 100 })) : (jsx$2(Button, { disabled: true, fullWidth: true, sx: { ml: ['0', '0', '0', '10px'] }, children: `Sale hasn't started` }))] })] }) })] }));
79528
+ }, fullWidth: true, children: ["Get ", (_d = bond === null || bond === void 0 ? void 0 : bond.token) === null || _d === void 0 ? void 0 : _d.symbol] }) }), (bond === null || bond === void 0 ? void 0 : bond.contractAddress) ? (jsx$2(BuyAction, { launchBond: bond, inputValue: inputValue, selectedCurrency: bond === null || bond === void 0 ? void 0 : bond.token, soldout: (bond === null || bond === void 0 ? void 0 : bond.billType) === 'fcfs' && percentageSold === 100 })) : (jsx$2(Button, { disabled: true, fullWidth: true, sx: { ml: ['0', '0', '0', '10px'] }, children: `Sale hasn't started` }))] })] }) })] }));
79422
79529
  };
79423
79530
 
79424
79531
  /*
@@ -79828,10 +79935,14 @@ const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFil
79828
79935
  }, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: ["BONUS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
79829
79936
  };
79830
79937
 
79831
- const PreTGERows = () => {
79938
+ const PreTGERows = ({ showSoldout }) => {
79832
79939
  usePreTGEUserBonds();
79833
79940
  const { data: preTGEBondsData } = usePreTGEBondsData();
79834
- return (jsxs(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: [(preTGEBondsData === null || preTGEBondsData === void 0 ? void 0 : preTGEBondsData.length) > 0 && (jsx$2(Flex, { sx: {
79941
+ const activePreTGEBonds = preTGEBondsData === null || preTGEBondsData === void 0 ? void 0 : preTGEBondsData.filter((bond) => {
79942
+ const isActive = !bond.finalized && bond.finishTime > Date.now() / 1000 && !bond.soldOut;
79943
+ return showSoldout ? !isActive : isActive;
79944
+ });
79945
+ return (jsxs(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: [(activePreTGEBonds === null || activePreTGEBonds === void 0 ? void 0 : activePreTGEBonds.length) > 0 && (jsx$2(Flex, { sx: {
79835
79946
  pt: '5px',
79836
79947
  pb: '10px',
79837
79948
  color: 'textDisabledButton',
@@ -79842,7 +79953,7 @@ const PreTGERows = () => {
79842
79953
  display: 'flex',
79843
79954
  width: '300px',
79844
79955
  alignItems: 'center',
79845
- }, children: "Pre-TGE Bonds" })), preTGEBondsData === null || preTGEBondsData === void 0 ? void 0 : preTGEBondsData.map((bond, i) => {
79956
+ }, children: "Pre-TGE Bonds" })), activePreTGEBonds === null || activePreTGEBonds === void 0 ? void 0 : activePreTGEBonds.map((bond, i) => {
79846
79957
  var _a, _b, _c, _d, _e, _f, _g, _h;
79847
79958
  const totalPrincipalBilled = Math.round(getBalanceNumber(new BigNumber$1((_a = bond === null || bond === void 0 ? void 0 : bond.totalPrincipalBilled) !== null && _a !== void 0 ? _a : '0'), (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.token) === null || _b === void 0 ? void 0 : _b.decimals) === null || _c === void 0 ? void 0 : _c[bond === null || bond === void 0 ? void 0 : bond.chainId])) / bond.initPrice;
79848
79959
  const raiseGoal = Math.round(getBalanceNumber(new BigNumber$1((_d = bond === null || bond === void 0 ? void 0 : bond.totalRaise) !== null && _d !== void 0 ? _d : '0'), (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.token) === null || _e === void 0 ? void 0 : _e.decimals) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId])) / bond.initPrice;
@@ -80019,7 +80130,7 @@ const Bonds = () => {
80019
80130
  const handleChangeFilterOption = useCallback((newOption) => {
80020
80131
  setFilterOption(newOption);
80021
80132
  }, []);
80022
- return (jsxs(Flex$1, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondsMenu, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), SDKConfig.useHotBonds && jsx$2(BuyAgainRow, {}), SDKConfig.useTGEBonds && jsx$2(PreTGERows, {}), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { bonds: billsToRender, hideTitles: searchQuery !== '' })) : searchQuery ? (jsx$2(PlaceholderMonkey, { text: 'No results' })) : filterOption === 'FAVORITES' ? (jsxs(Flex$1, { sx: {
80133
+ return (jsxs(Flex$1, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondsMenu, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), SDKConfig.useHotBonds && jsx$2(BuyAgainRow, {}), SDKConfig.useTGEBonds && jsx$2(PreTGERows, { showSoldout: filterOption === 'SOLD OUT' }), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { bonds: billsToRender, hideTitles: searchQuery !== '' })) : searchQuery ? (jsx$2(PlaceholderMonkey, { text: 'No results' })) : filterOption === 'FAVORITES' ? (jsxs(Flex$1, { sx: {
80023
80134
  width: '100%',
80024
80135
  height: '300px',
80025
80136
  background: 'white2',
@@ -14,6 +14,11 @@ export interface PreTGEBondData extends PreTGEBond {
14
14
  minPoints?: string;
15
15
  maxPoints?: string;
16
16
  vestingTerm: string;
17
+ initTime: number;
18
+ finishTime: number;
19
+ startVestingTimestamp: number;
20
+ initPrice: number;
21
+ initialRelease: number;
17
22
  }
18
23
  export default function usePreTGEBondsData(): UseQueryResult<PreTGEBondData[]>;
19
24
  export declare const getLaunchBondsPublicData: (preTGEBonds: PreTGEBond[], chains?: number[], apiUrl?: string) => Promise<PreTGEBondData[]>;
@@ -28,6 +28,11 @@ export interface PreTGEUserBonds extends PreTGEBond {
28
28
  minPoints?: string;
29
29
  maxPoints?: string;
30
30
  vestingTerm: string;
31
+ initTime: number;
32
+ finishTime: number;
33
+ startVestingTimestamp: number;
34
+ initPrice: number;
35
+ initialRelease: number;
31
36
  }
32
37
  export default function usePreTGEUserBonds(): UseQueryResult<PreTGEUserBonds[]>;
33
38
  export declare const fetchPreTGEUserBonds: (preTGEBonds: PreTGEBondData[], account: string, apiUrl: string) => Promise<PreTGEUserBonds[]>;
@@ -1,2 +1,3 @@
1
1
  export declare const formatNumber: (number: number, minPrecision?: number, maxPrecision?: number) => string;
2
2
  export declare const formatNumberSI: (num: number | string, digits?: number) => string;
3
+ export declare const formatUSDNumber: (input: string | number) => string;
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const PreTGERows: () => React.JSX.Element;
2
+ declare const PreTGERows: ({ showSoldout }: {
3
+ showSoldout: boolean;
4
+ }) => React.JSX.Element;
3
5
  export default PreTGERows;
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": "3.0.66",
6
+ "version": "3.0.67",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -57,7 +57,7 @@
57
57
  "yalc": "^1.0.0-pre.53"
58
58
  },
59
59
  "dependencies": {
60
- "@ape.swap/apeswap-lists": "4.3.15",
60
+ "@ape.swap/apeswap-lists": "4.3.16",
61
61
  "@emotion/react": "11.11.4",
62
62
  "bignumber.js": "^9.1.2",
63
63
  "chart.js": "4.2.0",