+
-
diff --git a/src/components/layouts/ecosystem/Iqwiki.tsx b/src/components/layouts/ecosystem/Iqwiki.tsx
index 727b748..3441b6d 100644
--- a/src/components/layouts/ecosystem/Iqwiki.tsx
+++ b/src/components/layouts/ecosystem/Iqwiki.tsx
@@ -1,95 +1,95 @@
-'use client';
+"use client";
-import InViewAnimateBottom from '@/components/transitions/InViewAnimateBottom';
-import { useTheme } from 'next-themes';
-import Image from 'next/image';
-import React, { useEffect, useState } from 'react';
-import { TokenBrief } from '../Iqtoken';
+import InViewAnimateBottom from "@/components/transitions/InViewAnimateBottom";
+import { useTheme } from "next-themes";
+import Image from "next/image";
+import React, { useEffect, useState } from "react";
+import { TokenBrief } from "../Iqtoken";
const Iqwiki = () => {
const { theme } = useTheme();
- const [appTheme, setAppTheme] = useState('');
+ const [appTheme, setAppTheme] = useState("");
useEffect(() => {
- setAppTheme(theme ?? '');
+ setAppTheme(theme ?? "");
}, [theme]);
let imageUrl: string | undefined = undefined;
let imageUrl2: string | undefined = undefined;
let imageUrl3: string | undefined = undefined;
- if (appTheme === 'light') {
- imageUrl = '/images/iqwiki-widget-new.png';
- imageUrl2 = '/images/wiki-rank.png';
- imageUrl3 = '/images/wiki-homepage.png';
+ if (appTheme === "light") {
+ imageUrl = "/images/iqwiki-widget-new.png";
+ imageUrl2 = "/images/wiki-rank.png";
+ imageUrl3 = "/images/wiki-homepage.png";
}
- if (appTheme === 'dark') {
- imageUrl = '/images/iqwiki-widget-new-dark.png';
- imageUrl2 = '/images/wiki-rank-dark.png';
- imageUrl3 = '/images/wiki-homepage-dark.png';
+ if (appTheme === "dark") {
+ imageUrl = "/images/iqwiki-widget-new-dark.png";
+ imageUrl2 = "/images/wiki-rank-dark.png";
+ imageUrl3 = "/images/wiki-homepage-dark.png";
}
return (
-
+
-
-
-
+
+
+
Explore a diverse range of wikis designed to guide you through the
- realms of{' '}
-
+ realms of{" "}
+
cryptocurrency and blockchain.
-
-
-
-
+
+
{imageUrl && (
)}
-
-
+
+
{imageUrl2 && (
)}
-
-
+
+
Integrations:
-
-
-
-
+
+
+
+
diff --git a/src/modules/alchemyFetch.ts b/src/modules/alchemyFetch.ts
index fe8f817..8d883e3 100644
--- a/src/modules/alchemyFetch.ts
+++ b/src/modules/alchemyFetch.ts
@@ -5,25 +5,25 @@ export const WEI_TO_ETHER_DIVISOR = 10e17;
// biome-ignore lint/suspicious/noExplicitAny:
export const alchemyFetch = async (method: string, params: any[]) => {
- const response = await fetch(
- `https://eth-mainnet.alchemyapi.io/v2/${config.alchemyApiKey}`,
- {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- jsonrpc: "2.0",
- id: 1,
- method: method,
- params: params,
- }),
- },
- );
+ const response = await fetch(
+ `https://eth-mainnet.alchemyapi.io/v2/${config.alchemyApiKey}`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ jsonrpc: "2.0",
+ id: 1,
+ method: method,
+ params: params,
+ }),
+ }
+ );
- const data = await response.json();
- if (data.error) {
- throw new Error(data.error.message);
- }
- return data.result;
+ const data = await response.json();
+ if (data.error) {
+ throw new Error(data.error.message);
+ }
+ return data.result;
};
diff --git a/src/modules/fetchCoinMarketData.ts b/src/modules/fetchCoinMarketData.ts
index b19602a..33273e6 100644
--- a/src/modules/fetchCoinMarketData.ts
+++ b/src/modules/fetchCoinMarketData.ts
@@ -1,37 +1,37 @@
import config from "@/config";
export const formatNumber = new Intl.NumberFormat("en", {
- notation: "compact",
+ notation: "compact",
}).format;
export const fetchCoinMarketData = async (tokenName = "IQ") => {
- try {
- const response = await fetch(
- `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=${tokenName}`,
- {
- headers: {
- "X-CMC_PRO_API_KEY": config.cmcApiKey,
- },
- },
- );
+ try {
+ const response = await fetch(
+ `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=${tokenName}`,
+ {
+ headers: {
+ "X-CMC_PRO_API_KEY": config.cmcApiKey,
+ },
+ }
+ );
- if (!response.ok) {
- throw new Error("Network response was not ok");
- }
+ if (!response.ok) {
+ throw new Error("Network response was not ok");
+ }
- const data = await response.json();
- const tokenDetails = data.data[tokenName];
- const circulatingSupply = tokenDetails.circulating_supply;
- const marketCap = tokenDetails.quote.USD.market_cap;
- const volume = tokenDetails.quote.USD.volume_24h;
+ const data = await response.json();
+ const tokenDetails = data.data[tokenName];
+ const circulatingSupply = tokenDetails.circulating_supply;
+ const marketCap = tokenDetails.quote.USD.market_cap;
+ const volume = tokenDetails.quote.USD.volume_24h;
- return {
- circulatingSupply,
- marketCap,
- volume,
- };
- } catch (error) {
- console.error("Error fetching data:", error);
- return null;
- }
+ return {
+ circulatingSupply,
+ marketCap,
+ volume,
+ };
+ } catch (error) {
+ console.error("Error fetching data:", error);
+ return null;
+ }
};
diff --git a/src/modules/getLockOverview.ts b/src/modules/getLockOverview.ts
index d391ed8..a9fc29c 100644
--- a/src/modules/getLockOverview.ts
+++ b/src/modules/getLockOverview.ts
@@ -2,29 +2,29 @@ import config from "@/config";
import { HEX_BASE, WEI_TO_ETHER_DIVISOR, alchemyFetch } from "./alchemyFetch";
const getTotalHiiqSupply = async () => {
- try {
- const data = await alchemyFetch("eth_call", [
- {
- to: config.hiiqAddress,
- data: "0x18160ddd",
- },
- "latest",
- ]);
+ try {
+ const data = await alchemyFetch("eth_call", [
+ {
+ to: config.hiiqAddress,
+ data: "0x18160ddd",
+ },
+ "latest",
+ ]);
- const totalHiiq = Number.parseInt(data, HEX_BASE) / WEI_TO_ETHER_DIVISOR;
- return totalHiiq;
- } catch (error) {
- console.error("🚨 Error getting total hiIQ supply", error);
- throw new Error("🚨 Error getting total hiIQ supply");
- }
+ const totalHiiq = Number.parseInt(data, HEX_BASE) / WEI_TO_ETHER_DIVISOR;
+ return totalHiiq;
+ } catch (error) {
+ console.error("🚨 Error getting total hiIQ supply", error);
+ throw new Error("🚨 Error getting total hiIQ supply");
+ }
};
export const getLockOverview = async () => {
- const totalHiiqSupply = await getTotalHiiqSupply();
+ const totalHiiqSupply = await getTotalHiiqSupply();
- return {
- totalSupplyError: totalHiiqSupply === 0,
- isFetchingTotalSupply: false,
- totalHiiqSupply,
- };
+ return {
+ totalSupplyError: totalHiiqSupply === 0,
+ isFetchingTotalSupply: false,
+ totalHiiqSupply,
+ };
};
diff --git a/src/modules/getTVL.ts b/src/modules/getTVL.ts
index f92a991..19083e9 100644
--- a/src/modules/getTVL.ts
+++ b/src/modules/getTVL.ts
@@ -2,21 +2,24 @@ import config from "@/config";
import { HEX_BASE, WEI_TO_ETHER_DIVISOR, alchemyFetch } from "./alchemyFetch";
export const getTvl = async () => {
- try {
- const data = await alchemyFetch("eth_call", [
- {
- from: "0x0000000000000000000000000000000000000000",
- to: config.iqAddress,
- data: `0x70a08231000000000000000000000000${config.hiiqAddress.replace("0x", "")}`,
- },
- "latest",
- ]);
+ try {
+ const data = await alchemyFetch("eth_call", [
+ {
+ from: "0x0000000000000000000000000000000000000000",
+ to: config.iqAddress,
+ data: `0x70a08231000000000000000000000000${config.hiiqAddress.replace(
+ "0x",
+ ""
+ )}`,
+ },
+ "latest",
+ ]);
- let tvl = Number.parseInt(data, HEX_BASE);
- tvl = tvl / WEI_TO_ETHER_DIVISOR;
- return Math.floor(tvl);
- } catch (error) {
- console.error("🚨 Error getting TVL", error);
- throw new Error("🚨 Error getting TVL");
- }
+ let tvl = Number.parseInt(data, HEX_BASE);
+ tvl = tvl / WEI_TO_ETHER_DIVISOR;
+ return Math.floor(tvl);
+ } catch (error) {
+ console.error("🚨 Error getting TVL", error);
+ throw new Error("🚨 Error getting TVL");
+ }
};
diff --git a/src/modules/helpers/numFormatter.ts b/src/modules/helpers/numFormatter.ts
index e2d0105..3611582 100644
--- a/src/modules/helpers/numFormatter.ts
+++ b/src/modules/helpers/numFormatter.ts
@@ -1,3 +1,3 @@
export const numFormatter = Intl.NumberFormat("en", {
- notation: "compact",
+ notation: "compact",
}).format;