-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5ef1bd
commit ca28523
Showing
8 changed files
with
163 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useMemo } from "react"; | ||
import { useNetworkConfig } from "./useNetworkConfig"; | ||
import { getDefaultConfig } from "@rainbow-me/rainbowkit"; | ||
import { mainnet, sepolia } from "viem/chains"; | ||
import { http, createConfig } from 'wagmi' | ||
|
||
const useWagmiRainbowConfig = () => { | ||
const { network } = useNetworkConfig() | ||
|
||
const isMainnet = useMemo(() => { | ||
return network === 'mainnet' | ||
}, [network]) | ||
const config = getDefaultConfig({ | ||
appName: 'SuperProof explorer', | ||
projectId: '876a28d2d23153fe7f76c24bacbabb72', | ||
chains: [isMainnet ? mainnet : sepolia], | ||
ssr: true | ||
}); | ||
return config | ||
} | ||
|
||
export default useWagmiRainbowConfig; | ||
|
||
|
||
const useWagmiConfig = () => { | ||
const { network } = useNetworkConfig() | ||
const isMainnet = useMemo(() => { | ||
return network === 'mainnet' | ||
}, [network]) | ||
const config = useMemo(() => createConfig({ | ||
chains: [isMainnet ? mainnet : sepolia], | ||
transports: { | ||
[mainnet.id]: http(), | ||
[sepolia.id]: http(), | ||
}, | ||
}), [isMainnet]) | ||
return config | ||
} | ||
|
||
export { | ||
useWagmiConfig | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters