Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: univ4 bring pool price to target #36

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const subdomainToLabel = {
[subdomains.TRANSACT.base]: "Transact",
[subdomains.CALLDATA.base]: "Calldata",
[subdomains.STORAGE_SLOTS.base]: "Storage Slots",
[subdomains.UNISWAP.base]: "Uniswap V3",
[subdomains.UNISWAP.base]: "Uniswap",
[subdomains.CHARACTER_COUNTER.base]: "Character Counter",
[subdomains.CONTRACT_ADDRESS.base]: "Contract Address",
[subdomains.FOUNDRY.base]: "Foundry",
Expand Down
75 changes: 26 additions & 49 deletions app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ import theme from "@/style/theme";
import "@rainbow-me/rainbowkit/styles.css";

import {
connectorsForWallets,
getDefaultConfig,
RainbowKitProvider,
darkTheme,
} from "@rainbow-me/rainbowkit";
import { WagmiProvider } from "wagmi";

import {
metaMaskWallet,
walletConnectWallet,
rainbowWallet,
safeWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { configureChains, createConfig, WagmiConfig } from "wagmi";
import {
mainnet,
arbitrum,
Expand All @@ -38,63 +32,46 @@ import {
sepolia,
zora,
} from "wagmi/chains";
import { publicProvider } from "wagmi/providers/public";

const { chains, publicClient } = configureChains(
// the first chain is used by rainbowKit to determine which chain to use
[
mainnet,
arbitrum,
arbitrumSepolia,
avalanche,
base,
baseSepolia,
bsc,
fantom,
gnosis,
goerli,
optimism,
polygon,
polygonMumbai,
sepolia,
zora,
],
[publicProvider()]
);

const projectId = process.env.NEXT_PUBLIC_WC_PROJECT_ID!;
const connectors = connectorsForWallets([
{
groupName: "Recommended",
wallets: [
metaMaskWallet({ projectId, chains }),
walletConnectWallet({ projectId, chains }),
rainbowWallet({ projectId, chains }),
safeWallet({ chains, allowedDomains: [/./s] }),
],
},
]);

export const wagmiConfig = createConfig({
autoConnect: true,
connectors,
publicClient,
export const wagmiConfig = getDefaultConfig({
appName: "Swiss-Knife.xyz",
projectId,
chains:
// the first chain is used by rainbowKit to determine which chain to use
[
mainnet,
arbitrum,
arbitrumSepolia,
avalanche,
base,
baseSepolia,
bsc,
fantom,
gnosis,
goerli,
optimism,
polygon,
polygonMumbai,
sepolia,
zora,
],
});

export const Providers = ({ children }: { children: React.ReactNode }) => {
return (
<CacheProvider>
<ChakraProvider theme={theme}>
<WagmiConfig config={wagmiConfig}>
<WagmiProvider config={wagmiConfig}>
<RainbowKitProvider
chains={chains}
theme={darkTheme()}
modalSize={"compact"}
coolMode={true}
>
{children}
</RainbowKitProvider>
</WagmiConfig>
</WagmiProvider>
</ChakraProvider>
</CacheProvider>
);
Expand Down
Loading