Skip to content

Commit

Permalink
feat: solana
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Nov 7, 2024
1 parent 046099f commit 7b5f8c6
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 144 deletions.
38 changes: 0 additions & 38 deletions hooks/useWhyDidYouUpdate.tsx

This file was deleted.

158 changes: 79 additions & 79 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
18 changes: 0 additions & 18 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,3 @@ export default function Wrapper(): ReactElement {
</>
);
}

// Wrapper.getStaticProps = async (): Promise<unknown> => {
// 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};
// }
// };
30 changes: 21 additions & 9 deletions utils/tools.chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
}
}
});
Expand All @@ -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: {
Expand Down

0 comments on commit 7b5f8c6

Please sign in to comment.