Skip to content

Commit

Permalink
feat: add fork support, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Sep 6, 2023
1 parent f434f67 commit f240a9e
Show file tree
Hide file tree
Showing 5 changed files with 681 additions and 200 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VITE_SUBSQUID_URL="https://squid.subsquid.io/origin-squid/v/v4/graphql"
# VITE_CUSTOM_RPC="https://rpc.tenderly.co/fork/751e79c6-6420-4ea9-ac13-1f6b20f318bc"
VITE_CUSTOM_RPC="http://127.0.0.1:8545"
VITE_WALLET_CONNECT_PROJECT_ID=
VITE_ALCHEMY_ID=
1 change: 1 addition & 0 deletions apps/oeth/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface ImportMetaEnv {
readonly VITE_WALLET_CONNECT_PROJECT_ID: string;
readonly VITE_ALCHEMY_ID: string;
readonly VITE_SUBSQUID_URL: string;
readonly VITE_CUSTOM_RPC?: string;
}

interface ImportMeta {
Expand Down
22 changes: 18 additions & 4 deletions libs/oeth/shared/src/clients/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { isNilOrEmpty } from '@origin/shared/utils';
import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import {
argentWallet,
Expand All @@ -14,14 +16,26 @@ import {
import { configureChains, createConfig } from 'wagmi';
import { goerli, localhost, mainnet } from 'wagmi/chains';
import { alchemyProvider } from 'wagmi/providers/alchemy';
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc';
import { publicProvider } from 'wagmi/providers/public';

const providers = [
...(isNilOrEmpty(import.meta.env?.VITE_CUSTOM_RPC)
? []
: [
jsonRpcProvider({
rpc: () => ({
http: import.meta.env.VITE_CUSTOM_RPC,
}),
}),
]),
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_ID }),
publicProvider(),
];

export const { chains, publicClient, webSocketPublicClient } = configureChains(
[mainnet, goerli, localhost],
[
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_ID }),
publicProvider(),
],
providers as any,
);

const connectors = connectorsForWallets([
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.3",
"@rainbow-me/rainbowkit": "^1.0.9",
"@rainbow-me/rainbowkit": "^1.0.10",
"@react-hookz/web": "^23.1.0",
"@tanstack/react-query": "^4.32.6",
"@tanstack/react-table": "^8.9.3",
"@wagmi/core": "^1.3.9",
"@wagmi/core": "^1.4.1",
"axios": "^1.4.0",
"graphql": "^16.8.0",
"ethers": "^6.7.1",
"graphql": "^16.8.0",
"immer": "^10.0.2",
"ramda": "^0.29.0",
"react": "18.2.0",
Expand All @@ -31,8 +31,8 @@
"react-router-dom": "6.14.2",
"react-tracked": "^1.7.11",
"tslib": "^2.6.1",
"viem": "^1.7.0",
"wagmi": "^1.3.10"
"viem": "^1.10.3",
"wagmi": "^1.4.1"
},
"devDependencies": {
"@babel/preset-react": "^7.14.5",
Expand Down
Loading

0 comments on commit f240a9e

Please sign in to comment.