This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
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
3ff04ac
commit b379f1c
Showing
9 changed files
with
19 additions
and
680 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
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 |
---|---|---|
@@ -1,77 +1,3 @@ | ||
import { | ||
getDefaultWallets, | ||
RainbowKitProvider, | ||
connectorsForWallets, | ||
} from "@rainbow-me/rainbowkit"; | ||
import { configureChains, WagmiConfig, createConfig } from "wagmi"; | ||
import * as allChains from "wagmi/chains"; | ||
import { alchemyProvider } from "wagmi/providers/alchemy"; | ||
import { publicProvider } from "wagmi/providers/public"; | ||
|
||
import { baseChain } from "app/hooks/creator-token/utils"; | ||
import { alchemyProviderApiKey } from "app/lib/wallet-public-client"; | ||
import { isDEV } from "app/utilities"; | ||
|
||
const lineaChain = { | ||
id: 59144, | ||
name: "Linea", | ||
network: "mainnet", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Ether", | ||
symbol: "ETH", | ||
}, | ||
rpcUrls: { | ||
default: { | ||
http: ["https://linea-mainnet.infura.io/v3"], | ||
}, | ||
public: { | ||
http: ["https://linea-mainnet.infura.io/v3"], | ||
}, | ||
}, | ||
blockExplorers: { | ||
default: { name: "Lineascan", url: "https://lineascan.build/" }, | ||
}, | ||
}; | ||
|
||
const allChainsArray = [ | ||
// @ts-ignore | ||
...Object.keys(allChains).map((key) => allChains[key]), | ||
baseChain, | ||
lineaChain, | ||
]; | ||
|
||
const provider = isDEV | ||
? [publicProvider()] | ||
: [alchemyProvider({ apiKey: alchemyProviderApiKey }), publicProvider()]; | ||
|
||
const { chains, publicClient, webSocketPublicClient } = configureChains( | ||
allChainsArray, | ||
provider | ||
); | ||
|
||
const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID; | ||
|
||
const { wallets } = getDefaultWallets({ | ||
appName: "Showtime", | ||
projectId, | ||
chains, | ||
}); | ||
const connectors = connectorsForWallets(wallets); | ||
|
||
const wagmiConfig = createConfig({ | ||
autoConnect: true, | ||
connectors, | ||
publicClient, | ||
webSocketPublicClient, | ||
}); | ||
|
||
export const WalletProvider = ({ children }: { children: React.ReactNode }) => { | ||
return ( | ||
<WagmiConfig config={wagmiConfig}> | ||
<RainbowKitProvider chains={chains} initialChain={baseChain}> | ||
{children} | ||
</RainbowKitProvider> | ||
</WagmiConfig> | ||
); | ||
return children; | ||
}; |
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
Oops, something went wrong.