@goodaofi/bonds-sdk 3.0.161 → 3.0.162

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
@@ -70803,14 +70803,14 @@ const VESTING_NFT_ABI = [
70803
70803
  },
70804
70804
  ];
70805
70805
  // Hardcoded vesting NFT contract address
70806
- const VESTING_NFT_ADDRESS = '0xD97197A4bC1db9e160023271B6C6de5B3325b7fd';
70806
+ const VESTING_NFT_ADDRESS$1 = '0xD97197A4bC1db9e160023271B6C6de5B3325b7fd';
70807
70807
  const VESTING_NFT_CHAIN_ID = main.ChainId.BASE;
70808
70808
  const fetchVestingNftBills = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
70809
70809
  try {
70810
70810
  // Get balance first
70811
70811
  const balanceCalls = [
70812
70812
  {
70813
- address: VESTING_NFT_ADDRESS,
70813
+ address: VESTING_NFT_ADDRESS$1,
70814
70814
  name: 'balanceOf',
70815
70815
  params: [account],
70816
70816
  },
@@ -70821,7 +70821,7 @@ const fetchVestingNftBills = (account) => __awaiter$9(void 0, void 0, void 0, fu
70821
70821
  return [];
70822
70822
  // Get all token IDs
70823
70823
  const tokenIdCalls = Array.from({ length: balance }, (_, i) => ({
70824
- address: VESTING_NFT_ADDRESS,
70824
+ address: VESTING_NFT_ADDRESS$1,
70825
70825
  name: 'tokenOfOwnerByIndex',
70826
70826
  params: [account, i],
70827
70827
  }));
@@ -70830,12 +70830,12 @@ const fetchVestingNftBills = (account) => __awaiter$9(void 0, void 0, void 0, fu
70830
70830
  // Get vesting schedule and claimable for each token
70831
70831
  const detailCalls = tokenIds.flatMap((tokenId) => [
70832
70832
  {
70833
- address: VESTING_NFT_ADDRESS,
70833
+ address: VESTING_NFT_ADDRESS$1,
70834
70834
  name: 'getVestingSchedule',
70835
70835
  params: [tokenId],
70836
70836
  },
70837
70837
  {
70838
- address: VESTING_NFT_ADDRESS,
70838
+ address: VESTING_NFT_ADDRESS$1,
70839
70839
  name: 'claimablePayout',
70840
70840
  params: [tokenId],
70841
70841
  },
@@ -70848,25 +70848,31 @@ const fetchVestingNftBills = (account) => __awaiter$9(void 0, void 0, void 0, fu
70848
70848
  const schedule = scheduleResult[0];
70849
70849
  const totalPayout = new BigNumber$1(schedule.totalPayout.toString());
70850
70850
  const payoutClaimed = new BigNumber$1(schedule.payoutClaimed.toString());
70851
+ const vestingStart = new BigNumber$1(schedule.vestingStart.toString()).toNumber();
70851
70852
  const vestingEnd = new BigNumber$1(schedule.vestingEnd.toString()).toNumber();
70853
+ const cliffEnd = new BigNumber$1(schedule.cliffEnd.toString()).toNumber();
70852
70854
  const claimable = new BigNumber$1(claimableResult[0].toString());
70855
+ // Calculate durations in seconds (expected by displayHelpers)
70856
+ const vestingDuration = vestingEnd - vestingStart;
70857
+ const vestingCliff = cliffEnd - vestingStart;
70853
70858
  // Map to UserBill format
70854
70859
  result.push({
70855
- address: VESTING_NFT_ADDRESS,
70860
+ address: VESTING_NFT_ADDRESS$1,
70856
70861
  id: tokenIds[i],
70857
- vesting: vestingEnd.toString(), // vestingEnd timestamp
70862
+ vesting: vestingDuration.toString(), // vesting duration in seconds
70858
70863
  payout: totalPayout.minus(payoutClaimed).toString(), // remaining payout
70859
70864
  totalPayout: totalPayout.toString(),
70860
70865
  truePricePaid: '0',
70861
- lastBlockTimestamp: schedule.vestingStart.toString(),
70866
+ lastBlockTimestamp: vestingStart.toString(),
70862
70867
  pendingRewards: claimable.toString(),
70863
- billNftAddress: VESTING_NFT_ADDRESS,
70868
+ billNftAddress: VESTING_NFT_ADDRESS$1,
70864
70869
  payoutClaimed: payoutClaimed.toString(),
70865
70870
  bond: {
70866
70871
  billType: 'vesting',
70867
70872
  chainId: VESTING_NFT_CHAIN_ID,
70868
- contractAddress: { [VESTING_NFT_CHAIN_ID]: VESTING_NFT_ADDRESS },
70869
- billNnftAddress: { [VESTING_NFT_CHAIN_ID]: VESTING_NFT_ADDRESS },
70873
+ contractAddress: { [VESTING_NFT_CHAIN_ID]: VESTING_NFT_ADDRESS$1 },
70874
+ billNnftAddress: { [VESTING_NFT_CHAIN_ID]: VESTING_NFT_ADDRESS$1 },
70875
+ vestingCliff: vestingCliff > 0 ? vestingCliff : undefined,
70870
70876
  earnToken: {
70871
70877
  symbol: 'GOO',
70872
70878
  name: 'Goo Token',
@@ -70946,8 +70952,19 @@ const getUserBonds = (account, bondList, chains, tokenPrices, apiUrl) => __await
70946
70952
  }
70947
70953
  });
70948
70954
 
70955
+ // Minimal ABI for vesting NFT claim
70956
+ const VESTING_NFT_CLAIM_ABI$1 = [
70957
+ {
70958
+ inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }],
70959
+ name: 'claim',
70960
+ outputs: [],
70961
+ stateMutability: 'nonpayable',
70962
+ type: 'function',
70963
+ },
70964
+ ];
70965
+ const VESTING_NFT_ADDRESS = '0xD97197A4bC1db9e160023271B6C6de5B3325b7fd';
70949
70966
  const YourBondsModal = ({ onDismiss, bill }) => {
70950
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
70967
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
70951
70968
  // Hooks
70952
70969
  const SDKConfig = useSDKConfig();
70953
70970
  const chainId = useChainId();
@@ -70967,19 +70984,22 @@ const YourBondsModal = ({ onDismiss, bill }) => {
70967
70984
  const load = loadingTx || (isLoading && !isConfirmed);
70968
70985
  // Cliff display info:
70969
70986
  const vestingCliff = (_c = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _c === void 0 ? void 0 : _c.vestingCliff;
70987
+ console.log(userBill);
70970
70988
  const currentTime = Math.round(new Date().getTime() / 1000);
70971
70989
  const lastBlockTimestamp = parseInt((_d = userBill === null || userBill === void 0 ? void 0 : userBill.lastBlockTimestamp) !== null && _d !== void 0 ? _d : '0');
70972
70990
  const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
70973
70991
  const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
70992
+ const showImage = false;
70974
70993
  const handleClaim = (billId, billAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
70975
70994
  var _a, _b, _c, _d, _e, _f, _g;
70976
70995
  const address = billAddress;
70996
+ const isVestingNft = (billAddress === null || billAddress === void 0 ? void 0 : billAddress.toLowerCase()) === VESTING_NFT_ADDRESS.toLowerCase();
70977
70997
  try {
70978
70998
  setLoadingTx(true);
70979
70999
  const tx = yield writeContractAsync({
70980
71000
  address: address,
70981
- abi: BOND_ABI,
70982
- functionName: 'redeem',
71001
+ abi: isVestingNft ? VESTING_NFT_CLAIM_ABI$1 : BOND_ABI,
71002
+ functionName: isVestingNft ? 'claim' : 'redeem',
70983
71003
  args: [billId],
70984
71004
  chain: chainId,
70985
71005
  account: account,
@@ -71027,10 +71047,7 @@ const YourBondsModal = ({ onDismiss, bill }) => {
71027
71047
  };
71028
71048
  const earnTokenPrice = useCurrencyPrice((_f = (_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.earnToken) !== null && _f !== void 0 ? _f : null, (_h = (_g = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _g === void 0 ? void 0 : _g.chainId) !== null && _h !== void 0 ? _h : null);
71029
71049
  const BILL_ATTRIBUTES = ['The Legend', 'The Location', 'The Moment', 'The Trend', 'The Innovation'];
71030
- const attributes = (_j = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.attributes) === null || _j === void 0 ? void 0 : _j.filter((attrib) => BILL_ATTRIBUTES.includes(attrib.trait_type));
71031
- const handleImageLoad = () => {
71032
- setImgLoaded(true);
71033
- };
71050
+ (_j = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.attributes) === null || _j === void 0 ? void 0 : _j.filter((attrib) => BILL_ATTRIBUTES.includes(attrib.trait_type));
71034
71051
  const [onTransferBondModal] = useModal(jsx$2(TransferBondModal, { userBill: userBill }), true, true, `transferModal${userBill === null || userBill === void 0 ? void 0 : userBill.id}}`);
71035
71052
  useEffect(() => {
71036
71053
  if (isConfirmed) {
@@ -71039,32 +71056,9 @@ const YourBondsModal = ({ onDismiss, bill }) => {
71039
71056
  }
71040
71057
  /* eslint-disable react-hooks/exhaustive-deps */
71041
71058
  }, [isConfirmed]);
71042
- return (jsx$2(Modal, { className: "modal", children: jsxs(Flex$1, { className: "yourbondsmodal-content", children: [jsx$2(Flex$1, { className: "yourbondsmodal-header", children: jsx$2(Flex$1, { className: "svg-close", onClick: onDismiss, children: jsx$2(Svg, { icon: "close" }) }) }), jsxs(Flex$1, { className: "yourbondsmodal table-container", children: [jsxs(Flex$1, { className: "yourbondsmodal bondimage", children: [(bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.image) && (jsx$2("img", { src: `${bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.image}?img-width=720`, onLoad: handleImageLoad, style: { zIndex: 2 } })), !imgLoaded && (jsx$2(Flex$1, { sx: {
71043
- position: 'absolute',
71044
- top: 'calc(50% - 24px)',
71045
- right: 'calc(50% - 50px)',
71046
- justifyContent: 'center',
71047
- alignItems: 'center',
71048
- zIndex: 1,
71049
- }, children: jsx$2(Spinner, { width: 100 }) }))] }), jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (_l = (_k = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _k === void 0 ? void 0 : _k.showcaseTokenName) !== null && _l !== void 0 ? _l : (_o = (_m = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _m === void 0 ? void 0 : _m.earnToken) === null || _o === void 0 ? void 0 : _o.symbol, size: 40, chain: (_p = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _p === void 0 ? void 0 : _p.chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: (_r = (_q = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _q === void 0 ? void 0 : _q.showcaseTokenName) !== null && _r !== void 0 ? _r : (_s = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _s === void 0 ? void 0 : _s.earnToken.symbol }), jsx$2(Flex$1, { className: "title-container tokentags", children: (_u = (_t = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _t === void 0 ? void 0 : _t.tags) === null || _u === void 0 ? void 0 : _u.slice(0, 1).map((tag) => {
71059
+ return (jsx$2(Modal, { className: "modal", children: jsxs(Flex$1, { className: "yourbondsmodal-content", children: [jsx$2(Flex$1, { className: "yourbondsmodal-header", children: jsx$2(Flex$1, { className: "svg-close", onClick: onDismiss, children: jsx$2(Svg, { icon: "close" }) }) }), jsxs(Flex$1, { className: "yourbondsmodal table-container", children: [showImage, jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (_l = (_k = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _k === void 0 ? void 0 : _k.showcaseTokenName) !== null && _l !== void 0 ? _l : (_o = (_m = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _m === void 0 ? void 0 : _m.earnToken) === null || _o === void 0 ? void 0 : _o.symbol, size: 40, chain: (_p = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _p === void 0 ? void 0 : _p.chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: (_r = (_q = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _q === void 0 ? void 0 : _q.showcaseTokenName) !== null && _r !== void 0 ? _r : (_s = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _s === void 0 ? void 0 : _s.earnToken.symbol }), jsx$2(Flex$1, { className: "title-container tokentags", children: (_u = (_t = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _t === void 0 ? void 0 : _t.tags) === null || _u === void 0 ? void 0 : _u.slice(0, 1).map((tag) => {
71050
71060
  return (jsx$2(Flex$1, { sx: { marginRight: '10px' }, children: jsx$2(ListTag, { text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }, tag));
71051
- }) }), jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["#", userBill === null || userBill === void 0 ? void 0 : userBill.id] })] }), jsxs(Flex$1, { className: "yourbondinfo blocks-container", children: [jsxs(Flex$1, { className: "attributes-container", children: [jsxs(Flex$1, { className: "attributes-header", sx: {
71052
- borderRadius: `${isOpenTraits ? '6px 6px 0px 0px' : 'normal'}`,
71053
- }, onClick: () => setIsOpenTraits(!isOpenTraits), children: [jsxs(Flex$1, { sx: { gap: '10px', alignItems: 'center' }, children: [jsx$2(Svg, { icon: "tag", direction: "down" }), jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'text', opacity: '0.6' }, children: "Traits" })] }), jsx$2(Svg, { icon: "caret", direction: isOpenTraits ? 'up' : 'down' })] }), ((_v = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _v === void 0 ? void 0 : _v.billType) === 'staking' && (jsxs(Flex$1, { sx: {
71054
- p: '5px 10px',
71055
- width: '100%',
71056
- background: '#8E568F',
71057
- borderRadius: 'normal',
71058
- mt: '10px',
71059
- fontSize: '12px',
71060
- fontWeight: 400,
71061
- justifyContent: 'center',
71062
- display: 'block',
71063
- }, children: ["Tokens bought through this bond went directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a 365 days lock."] })), jsx$2(AnimatePresence, { children: isOpenTraits && (jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%' }, children: jsx$2(Flex$1, { sx: { flexDirection: 'column', gap: '1px' }, children: attributes
71064
- ? attributes.map((a) => (jsxs(Flex$1, { sx: { background: 'white4', width: '100%', padding: '2px 8px' }, children: [jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.trait_type }), jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.value })] }, a.value)))
71065
- : BILL_ATTRIBUTES.map((attrib) => {
71066
- return (jsxs(Flex$1, { sx: { background: 'white4', width: '100%', padding: '2px 8px' }, children: [jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: attrib }), jsx$2(Skeleton, { width: "150px" })] }, attrib));
71067
- }) }) })) })] }), ((_w = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _w === void 0 ? void 0 : _w.deposit) && (jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "You Spent" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.YouSpent }), width: "270px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsx$2(Flex$1, { className: "yourbondinfo-block info", children: jsx$2(Flex$1, { className: "block-info text", children: jsxs(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: ["$", (_x = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _x === void 0 ? void 0 : _x.dollarValue.toFixed(2)] }) }) })] })), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Fully Vested" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon" }), jsx$2(Flex$1, { className: "block-info text", children: jsxs(Flex$1, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: [vestingTimeRemainingString(userBill), isPendingCliff && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex$1, { children: ["Bond will be claimable in", ' ', `${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`, "."] }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex$1, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }) })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-pending", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Pending" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_z = (_y = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _y === void 0 ? void 0 : _y.showcaseTokenName) !== null && _z !== void 0 ? _z : (_1 = (_0 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _0 === void 0 ? void 0 : _0.earnToken) === null || _1 === void 0 ? void 0 : _1.symbol, size: 25, chain: (_2 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _2 === void 0 ? void 0 : _2.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4) }), jsx$2(Text, { sx: {
71061
+ }) }), jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["#", userBill === null || userBill === void 0 ? void 0 : userBill.id] })] }), jsxs(Flex$1, { className: "yourbondinfo blocks-container", children: [showImage, ((_w = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _w === void 0 ? void 0 : _w.deposit) && (jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "You Spent" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.YouSpent }), width: "270px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsx$2(Flex$1, { className: "yourbondinfo-block info", children: jsx$2(Flex$1, { className: "block-info text", children: jsxs(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: ["$", (_x = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _x === void 0 ? void 0 : _x.dollarValue.toFixed(2)] }) }) })] })), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Fully Vested" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon" }), jsx$2(Flex$1, { className: "block-info text", children: jsxs(Flex$1, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: [vestingTimeRemainingString(userBill), isPendingCliff && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex$1, { children: ["Bond will be claimable in", ' ', `${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`, "."] }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex$1, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }) })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-pending", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Pending" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_z = (_y = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _y === void 0 ? void 0 : _y.showcaseTokenName) !== null && _z !== void 0 ? _z : (_1 = (_0 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _0 === void 0 ? void 0 : _0.earnToken) === null || _1 === void 0 ? void 0 : _1.symbol, size: 25, chain: (_2 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _2 === void 0 ? void 0 : _2.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4) }), jsx$2(Text, { sx: {
71068
71062
  fontSize: ['10px', '10px', '10px', '12px'],
71069
71063
  fontWeight: [500, 500, 500, 400],
71070
71064
  paddingLeft: '10px',
@@ -74226,6 +74220,7 @@ const getSaleInfo = (isFake, apiAddress) => __awaiter$9(void 0, void 0, void 0,
74226
74220
  nextStage: null,
74227
74221
  isInBreakPeriod: false,
74228
74222
  isRefundPeriod: false,
74223
+ isSaleEnded: false,
74229
74224
  refundStage: null,
74230
74225
  totalHardCap: 0,
74231
74226
  totalBilled: 0,
@@ -74318,12 +74313,16 @@ const transformSaleData = (rawData, isFake) => {
74318
74313
  // Find refund stage by key and determine if we're in refund period
74319
74314
  const refundStage = stages.find((stage) => stage.key === 'refund') || null;
74320
74315
  const isRefundPeriod = (_a = refundStage === null || refundStage === void 0 ? void 0 : refundStage.isActive) !== null && _a !== void 0 ? _a : false;
74316
+ // Determine if the sale has completely ended (TGE stage has started)
74317
+ const tgeStage = stages.find((stage) => stage.key === 'TGE') || null;
74318
+ const isSaleEnded = tgeStage ? now >= tgeStage.startTime : false;
74321
74319
  return {
74322
74320
  stages,
74323
74321
  currentStage,
74324
74322
  nextStage,
74325
74323
  isInBreakPeriod,
74326
74324
  isRefundPeriod,
74325
+ isSaleEnded,
74327
74326
  refundStage,
74328
74327
  totalHardCap,
74329
74328
  totalBilled,
@@ -100254,7 +100253,7 @@ const YourGoo = ({ yourGoo, isLoading, isFetching, }) => {
100254
100253
  textAlign: 'center',
100255
100254
  fontWeight: 'bold',
100256
100255
  fontSize: ['12px', '12px', '14px', '14px'],
100257
- }, children: `${depositBtcTotal.toFixed(3)} BTC` })] })] })] }, key)) : (jsx$2(Flex, { sx: {
100256
+ }, children: `${depositBtcTotal.toFixed(3)} BTC` })] }), jsx$2(Flex, { sx: { justifyContent: 'center', mt: '20px' }, children: jsx$2(Button, { onClick: () => (window.location.href = '/bonds?yourBonds'), children: "Claim Here" }) })] })] }, key)) : (jsx$2(Flex, { sx: {
100258
100257
  flexDirection: 'column',
100259
100258
  width: '100%',
100260
100259
  background: 'white2',
@@ -100832,11 +100831,20 @@ const GooSale = () => {
100832
100831
  return 'GOO Token Generation Event';
100833
100832
  return 'Buy GOO at a discount';
100834
100833
  }, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod, (_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _e === void 0 ? void 0 : _e.key]);
100835
- return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), pageTitle && (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', width: '100%' }, children: jsx$2(Text, { sx: { fontSize: '24px', fontWeight: 700, opacity: '0.9' }, children: pageTitle }) })), ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) && !isLoadingSaleInfo && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _f === void 0 ? void 0 : _f.key) === 'refund'
100834
+ return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), pageTitle && (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', width: '100%' }, children: jsx$2(Text, { sx: { fontSize: '24px', fontWeight: 700, opacity: '0.9' }, children: pageTitle }) })), ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) &&
100835
+ (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) &&
100836
+ !isLoadingSaleInfo &&
100837
+ !(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isSaleEnded) && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _f === void 0 ? void 0 : _f.key) === 'refund'
100836
100838
  ? 'Refund Period '
100837
100839
  : ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.key) === 'TGE'
100838
100840
  ? 'TGE '
100839
- : 'Stage ' + ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.stageNumber) + ' ', "starts in:"] }), jsx$2(CountdownTimer, { targetTime: ((_j = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _j === void 0 ? void 0 : _j.startTime) || 0 }), !(((_k = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _k === void 0 ? void 0 : _k.key) === 'refund' || ((_l = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _l === void 0 ? void 0 : _l.key) === 'TGE') ? (jsxs(Fragment$1, { children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', mt: '30px' }, children: [address && (jsxs(Flex, { sx: { mr: '1rem', p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { mr: '10px' }, children: jsx$2(Svg, { icon: "wallet" }) }), jsxs(Text, { sx: { fontSize: '14px', fontWeight: 400 }, children: [address === null || address === void 0 ? void 0 : address.slice(0, 4), "...", address === null || address === void 0 ? void 0 : address.slice((address === null || address === void 0 ? void 0 : address.length) - 4, address === null || address === void 0 ? void 0 : address.length)] })] })), jsx$2(Flex, { sx: { fontSize: '18px', fontWeight: 500 }, children: "Are You Eligible?" })] }), !address ? (jsx$2(Flex, { sx: { my: '20px', width: '100%' }, children: jsx$2(ConnectButton, {}) })) : (whitelisted === null ||
100841
+ : 'Stage ' + ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.stageNumber) + ' ', "starts in:"] }), jsx$2(CountdownTimer, { targetTime: ((_j = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _j === void 0 ? void 0 : _j.startTime) || 0 }), !(((_k = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _k === void 0 ? void 0 : _k.key) === 'refund' || ((_l = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _l === void 0 ? void 0 : _l.key) === 'TGE') ? (jsxs(Fragment$1, { children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', mt: '30px' }, children: [address && (jsxs(Flex, { sx: {
100842
+ mr: '1rem',
100843
+ p: '10px',
100844
+ borderRadius: 'normal',
100845
+ background: 'white3',
100846
+ alignItems: 'center',
100847
+ }, children: [jsx$2(Flex, { sx: { mr: '10px' }, children: jsx$2(Svg, { icon: "wallet" }) }), jsxs(Text, { sx: { fontSize: '14px', fontWeight: 400 }, children: [address === null || address === void 0 ? void 0 : address.slice(0, 4), "...", address === null || address === void 0 ? void 0 : address.slice((address === null || address === void 0 ? void 0 : address.length) - 4, address === null || address === void 0 ? void 0 : address.length)] })] })), jsx$2(Flex, { sx: { fontSize: '18px', fontWeight: 500 }, children: "Are You Eligible?" })] }), !address ? (jsx$2(Flex, { sx: { my: '20px', width: '100%' }, children: jsx$2(ConnectButton, {}) })) : (whitelisted === null ||
100840
100848
  (whitelisted === undefined && !cbBTCBalanceChecked && (jsx$2(Button, { sx: { m: '20px', width: '100%' }, onClick: handleCheckEligibility, children: "CHECK ELIGIBILITY" }))))] }), whitelisted !== null && whitelisted !== undefined && (jsxs(Flex, { sx: {
100841
100849
  flexDirection: 'row',
100842
100850
  alignItems: 'center',
@@ -32,6 +32,7 @@ export interface SaleInfo {
32
32
  nextStage: StageInfo | null;
33
33
  isInBreakPeriod: boolean;
34
34
  isRefundPeriod: boolean;
35
+ isSaleEnded: boolean;
35
36
  refundStage: StageInfo | null;
36
37
  totalHardCap: number;
37
38
  totalBilled: number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Goo Money Bond SDK",
4
4
  "author": "Goo Money",
5
5
  "license": "MIT",
6
- "version": "3.0.161",
6
+ "version": "3.0.162",
7
7
  "proxy": "https://realtime-api-pr-99.herokuapp.com",
8
8
  "module": "dist/main.js",
9
9
  "type": "module",