diff --git a/hooks/useWhyDidYouUpdate.tsx b/hooks/useWhyDidYouUpdate.tsx deleted file mode 100644 index 0c07707..0000000 --- a/hooks/useWhyDidYouUpdate.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import {useEffect, useRef} from 'react'; - -function useWhyDidYouUpdate(name: string, props: any): void { - // Get a mutable ref object where we can store props ... - // ... for comparison next time this hook runs. - const previousProps = useRef(); - - useEffect((): void => { - if (previousProps.current) { - // Get all keys from previous and current props - const allKeys = Object.keys({...previousProps.current, ...props}); - // Use this object to keep track of changed props - const changesObj: any = {}; - // Iterate through keys - allKeys.forEach((key): void => { - // If previous is different from current - if (previousProps.current[key] !== props[key]) { - // Add to changesObj - changesObj[key] = { - from: previousProps.current[key], - to: props[key] - }; - } - }); - - // If changesObj not empty then output to console - if (Object.keys(changesObj).length) { - console.log('[why-did-you-update]', name, changesObj); - } - } - - // Finally update previousProps with current props for next hook call - previousProps.current = props; - }); -} - -export default useWhyDidYouUpdate; diff --git a/package.json b/package.json index a07ed87..0722849 100644 --- a/package.json +++ b/package.json @@ -1,81 +1,81 @@ { - "name": "smol", - "version": "1.0.0", - "private": false, - "homepage": "./", - "scripts": { - "dev": "next", - "dev:ts": "tsc --watch", - "start": "tsc && next build && next start", - "build": "tsc && next build", - "prepare": "husky install", - "prettier": "prettier --check \"./**/**/*.{json,js,ts,tsx,scss}\"", - "prettier-format": "prettier --config .prettierrc \"./**/**/*.{json,js,ts,tsx,scss,md}\" --write", - "export": "tsc && next build && next export -o ipfs", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx" - }, - "dependencies": { - "@builtbymom/web3": "^0.0.140", - "@headlessui/react": "^2.1.2", - "@rainbow-me/rainbowkit": "^2.1.3", - "@react-hookz/web": "^24.0.4", - "@tailwindcss/forms": "^0.5.7", - "@tailwindcss/typography": "^0.5.13", - "@vercel/analytics": "^1.3.1", - "@wagmi/core": "^2.13.0", - "axios": "^1.7.2", - "dayjs": "^1.11.11", - "framer-motion": "^11.3.3", - "graphql-request": "^7.1.0", - "lottie-react": "^2.4.0", - "next": "^14.2.5", - "next-pwa": "^5.6.0", - "next-seo": "^6.5.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-hot-toast": "^2.4.1", - "sharp": "^0.33.4", - "swr": "^2.2.5", - "tailwindcss": "^3.4.5", - "tailwindcss-animate": "^1.0.7", - "viem": "^2.17.11", - "wagmi": "^2.12.0" - }, - "devDependencies": { - "@commitlint/cli": "^19.3.0", - "@commitlint/config-conventional": "^19.2.2", - "@total-typescript/ts-reset": "^0.5.1", - "@types/node": "^20.14.10", - "@types/nprogress": "^0.2.3", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^7.16.1", - "@typescript-eslint/parser": "^7.16.1", - "autoprefixer": "^10.4.19", - "babel-loader": "^9.1.3", - "bun-types": "^1.0.30", - "eslint": "^8.57.0", - "eslint-config-next": "^14.1.3", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-brackets": "^0.1.3", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-react": "^7.34.4", - "eslint-plugin-react-hooks": "^4.6.2", - "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-tailwindcss": "^3.17.4", - "eslint-plugin-unused-imports": "^4.0.0", - "husky": "^9.0.11", - "lint-staged": "^15.2.7", - "next-transpile-modules": "^10.0.1", - "postcss": "^8.4.39", - "postcss-import": "^16.1.0", - "postcss-nesting": "^12.1.5", - "prettier": "^3.3.3", - "sass": "^1.77.8", - "stylelint": "^16.7.0", - "stylelint-config-standard": "^36.0.1", - "ts-loader": "^9.5.1", - "typescript": "^5.5.3" - } + "name": "smol", + "version": "1.0.0", + "private": false, + "homepage": "./", + "scripts": { + "dev": "next", + "dev:ts": "tsc --watch", + "start": "tsc && next build && next start", + "build": "tsc && next build", + "prepare": "husky install", + "prettier": "prettier --check \"./**/**/*.{json,js,ts,tsx,scss}\"", + "prettier-format": "prettier --config .prettierrc \"./**/**/*.{json,js,ts,tsx,scss,md}\" --write", + "export": "tsc && next build && next export -o ipfs", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx" + }, + "dependencies": { + "@builtbymom/web3": "^0.0.140", + "@headlessui/react": "^2.1.2", + "@rainbow-me/rainbowkit": "^2.1.3", + "@react-hookz/web": "^24.0.4", + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/typography": "^0.5.13", + "@vercel/analytics": "^1.3.1", + "@wagmi/core": "^2.13.0", + "axios": "^1.7.2", + "dayjs": "^1.11.11", + "framer-motion": "^11.3.3", + "graphql-request": "^7.1.0", + "lottie-react": "^2.4.0", + "next": "^14.2.5", + "next-pwa": "^5.6.0", + "next-seo": "^6.5.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hot-toast": "^2.4.1", + "sharp": "^0.33.4", + "swr": "^2.2.5", + "tailwindcss": "^3.4.5", + "tailwindcss-animate": "^1.0.7", + "viem": "^2.17.11", + "wagmi": "^2.12.0" + }, + "devDependencies": { + "@commitlint/cli": "^19.3.0", + "@commitlint/config-conventional": "^19.2.2", + "@total-typescript/ts-reset": "^0.5.1", + "@types/node": "^20.14.10", + "@types/nprogress": "^0.2.3", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^7.16.1", + "@typescript-eslint/parser": "^7.16.1", + "autoprefixer": "^10.4.19", + "babel-loader": "^9.1.3", + "bun-types": "^1.0.30", + "eslint": "^8.57.0", + "eslint-config-next": "^14.1.3", + "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-brackets": "^0.1.3", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-react": "^7.34.4", + "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-tailwindcss": "^3.17.4", + "eslint-plugin-unused-imports": "^4.0.0", + "husky": "^9.0.11", + "lint-staged": "^15.2.7", + "next-transpile-modules": "^10.0.1", + "postcss": "^8.4.39", + "postcss-import": "^16.1.0", + "postcss-nesting": "^12.1.5", + "prettier": "^3.3.3", + "sass": "^1.77.8", + "stylelint": "^16.7.0", + "stylelint-config-standard": "^36.0.1", + "ts-loader": "^9.5.1", + "typescript": "^5.5.3" + } } diff --git a/pages/index.tsx b/pages/index.tsx index 54d376a..befc162 100755 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -364,21 +364,3 @@ export default function Wrapper(): ReactElement { ); } - -// Wrapper.getStaticProps = async (): Promise => { -// try { -// const shaRes = await fetch('https://api.github.com/repos/smoldapp/tokenlists/commits?sha=main&per_page=1'); -// const shaJson = await shaRes.json(); -// const gihubCallResponse = shaJson as [{sha: string}]; -// const [{sha}] = gihubCallResponse; -// const listRes = await fetch(`https://raw.githubusercontent.com/smoldapp/tokenLists/${sha}/lists/summary.json`); -// const tokenListResponse = await listRes.json(); - -// return {props: {summary: tokenListResponse}, revalidate: 86400}; -// } catch (error) { -// const listRes = await fetch('https://raw.githubusercontent.com/smoldapp/tokenLists/main/lists/summary.json'); -// const tokenListResponse = await listRes.json(); - -// return {props: {summary: tokenListResponse}, revalidate: 86400}; -// } -// }; diff --git a/utils/tools.chains.ts b/utils/tools.chains.ts index 5c3ab94..6d6e5c3 100644 --- a/utils/tools.chains.ts +++ b/utils/tools.chains.ts @@ -34,14 +34,27 @@ const rari = defineChain({ blockExplorers: { default: { name: 'RARI chain explorer', - url: 'https://mainnet.explorer.rarichain.org/', - apiUrl: 'https://mainnet.explorer.rarichain.org/api' + url: 'https://mainnet.explorer.rarichain.org/' + } + } +}); + +/************************************************************************************************* + ** The SOLANA chain is not available on the Viem library, so we define it here manually. + *************************************************************************************************/ +const solana = defineChain({ + id: 1151111081099710, + name: 'Solana', + nativeCurrency: {name: 'Solana', symbol: 'SOL', decimals: 9}, + rpcUrls: { + default: { + http: ['https://api.mainnet-beta.solana.com'] } }, - contracts: { - multicall3: { - address: '0xb6D5B39F96d379569d47cC84024f3Cd78c5Ef651', - blockCreated: 0 + blockExplorers: { + default: { + name: 'Solana Explorer', + url: 'https://solana.fm/' } } }); @@ -58,13 +71,12 @@ export const supportedNetworks = [ zkSync, base, arbitrum, - rari + rari, + solana ]; export const supportedTestNetworks = [goerli, baseGoerli]; export const networks = [...supportedNetworks, ...supportedTestNetworks]; -console.warn(indexedWagmiChains); - export type TAppExtendedChain = TExtendedChain & { safeApiUri?: string; contracts: {