From 47365974dc64ac8be46c319401539e3e0f5bde7e Mon Sep 17 00:00:00 2001 From: Daniel Sinclair Date: Thu, 4 Jan 2024 16:03:29 -0500 Subject: [PATCH] chore: migrate goerli examples to sepolia (#1684) --- examples/with-create-react-app/src/index.tsx | 17 +++++++------ .../app/[locale]/providers.tsx | 12 ++++----- examples/with-next-app/app/providers.tsx | 12 ++++----- .../with-next-custom-button/pages/_app.tsx | 13 +++++----- examples/with-next-mint-nft/pages/_app.tsx | 3 ++- .../pages/_app.tsx | 15 +++++------ .../with-next-siwe-next-auth/pages/_app.tsx | 14 ++++++----- examples/with-next/pages/_app.tsx | 15 +++++------ examples/with-remix/app/root.tsx | 25 ++++++++++--------- examples/with-vite/src/main.tsx | 16 +++++++++--- .../generated-test-app/pages/_app.tsx | 11 ++++---- .../templates/next-app/pages/_app.tsx | 11 ++++---- 12 files changed, 91 insertions(+), 73 deletions(-) diff --git a/examples/with-create-react-app/src/index.tsx b/examples/with-create-react-app/src/index.tsx index 3e0eecc325..a826756332 100644 --- a/examples/with-create-react-app/src/index.tsx +++ b/examples/with-create-react-app/src/index.tsx @@ -1,22 +1,23 @@ import './polyfills'; +import './index.css'; +import '@rainbow-me/rainbowkit/styles.css'; import React from 'react'; import ReactDOM from 'react-dom/client'; import reportWebVitals from './reportWebVitals'; -import './index.css'; -import '@rainbow-me/rainbowkit/styles.css'; import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; + import App from './App'; const { chains, publicClient, webSocketPublicClient } = configureChains( @@ -27,7 +28,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.REACT_APP_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.REACT_APP_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next-app-i18n/app/[locale]/providers.tsx b/examples/with-next-app-i18n/app/[locale]/providers.tsx index 91bac80c7b..2781cecbd1 100644 --- a/examples/with-next-app-i18n/app/[locale]/providers.tsx +++ b/examples/with-next-app-i18n/app/[locale]/providers.tsx @@ -13,16 +13,16 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -32,7 +32,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next-app/app/providers.tsx b/examples/with-next-app/app/providers.tsx index c8b203bb4b..8287b075f0 100644 --- a/examples/with-next-app/app/providers.tsx +++ b/examples/with-next-app/app/providers.tsx @@ -12,16 +12,16 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -31,7 +31,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next-custom-button/pages/_app.tsx b/examples/with-next-custom-button/pages/_app.tsx index abdb22bebc..0b6568f43a 100644 --- a/examples/with-next-custom-button/pages/_app.tsx +++ b/examples/with-next-custom-button/pages/_app.tsx @@ -1,6 +1,7 @@ import '../styles/global.css'; import '@rainbow-me/rainbowkit/styles.css'; import type { AppProps } from 'next/app'; + import { RainbowKitProvider, getDefaultWallets, @@ -12,16 +13,16 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -31,7 +32,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next-mint-nft/pages/_app.tsx b/examples/with-next-mint-nft/pages/_app.tsx index a3ae7a51c1..d1ff715e70 100644 --- a/examples/with-next-mint-nft/pages/_app.tsx +++ b/examples/with-next-mint-nft/pages/_app.tsx @@ -1,6 +1,7 @@ import '../styles/global.css'; import '@rainbow-me/rainbowkit/styles.css'; import type { AppProps } from 'next/app'; + import { RainbowKitProvider, getDefaultWallets, @@ -8,8 +9,8 @@ import { } from '@rainbow-me/rainbowkit'; import { argentWallet, trustWallet } from '@rainbow-me/rainbowkit/wallets'; import { createConfig, configureChains, WagmiConfig } from 'wagmi'; -import { Chain } from 'wagmi/chains'; import { publicProvider } from 'wagmi/providers/public'; +import { Chain } from 'wagmi/chains'; const rinkeby: Chain = { id: 4, diff --git a/examples/with-next-siwe-iron-session/pages/_app.tsx b/examples/with-next-siwe-iron-session/pages/_app.tsx index e08dcdbe87..269a6a5d50 100644 --- a/examples/with-next-siwe-iron-session/pages/_app.tsx +++ b/examples/with-next-siwe-iron-session/pages/_app.tsx @@ -3,6 +3,8 @@ import '../styles/global.css'; import '@rainbow-me/rainbowkit/styles.css'; import type { AppProps } from 'next/app'; +import { useEffect, useMemo, useRef, useState } from 'react'; + import { RainbowKitProvider, getDefaultWallets, @@ -17,18 +19,17 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; import { SiweMessage } from 'siwe'; -import { useEffect, useMemo, useRef, useState } from 'react'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -38,7 +39,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next-siwe-next-auth/pages/_app.tsx b/examples/with-next-siwe-next-auth/pages/_app.tsx index 5e3293f30b..74e93be032 100644 --- a/examples/with-next-siwe-next-auth/pages/_app.tsx +++ b/examples/with-next-siwe-next-auth/pages/_app.tsx @@ -1,6 +1,7 @@ import '../styles/global.css'; import '@rainbow-me/rainbowkit/styles.css'; import type { AppProps } from 'next/app'; + import { RainbowKitProvider, getDefaultWallets, @@ -12,16 +13,17 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; + import { SessionProvider } from 'next-auth/react'; import type { Session } from 'next-auth'; import { @@ -37,7 +39,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-next/pages/_app.tsx b/examples/with-next/pages/_app.tsx index f46143086a..3f60dfbd7c 100644 --- a/examples/with-next/pages/_app.tsx +++ b/examples/with-next/pages/_app.tsx @@ -1,6 +1,8 @@ import '../styles/global.css'; import '@rainbow-me/rainbowkit/styles.css'; import type { AppProps } from 'next/app'; +import { useRouter } from 'next/router'; + import { RainbowKitProvider, getDefaultWallets, @@ -13,17 +15,16 @@ import { ledgerWallet, } from '@rainbow-me/rainbowkit/wallets'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; -import { useRouter } from 'next/router'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -33,7 +34,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/examples/with-remix/app/root.tsx b/examples/with-remix/app/root.tsx index fb0b77d908..ef56547352 100644 --- a/examples/with-remix/app/root.tsx +++ b/examples/with-remix/app/root.tsx @@ -14,23 +14,24 @@ import type { LinksFunction, LoaderFunction, } from '@remix-run/node'; + +import { + RainbowKitProvider, + ConnectButton, + getDefaultWallets, +} from '@rainbow-me/rainbowkit'; +import type { Chain } from 'wagmi'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { - mainnet, - polygon, - optimism, arbitrum, base, + mainnet, + optimism, + polygon, + sepolia, zora, - goerli, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; -import type { Chain } from 'wagmi'; -import { - RainbowKitProvider, - ConnectButton, - getDefaultWallets, -} from '@rainbow-me/rainbowkit'; import globalStylesUrl from './styles/global.css'; import rainbowStylesUrl from '@rainbow-me/rainbowkit/styles.css'; @@ -70,7 +71,7 @@ export default function App() { // and a lazy initialization function. // See: https://remix.run/docs/en/v1/guides/constraints#no-module-side-effects const [{ config, chains }] = useState(() => { - const testChains = ENV.PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []; + const testChains = ENV.PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []; const { chains, publicClient } = configureChains( [mainnet, polygon, optimism, arbitrum, base, zora, ...testChains], diff --git a/examples/with-vite/src/main.tsx b/examples/with-vite/src/main.tsx index 4f05931579..4eda6e6476 100644 --- a/examples/with-vite/src/main.tsx +++ b/examples/with-vite/src/main.tsx @@ -1,14 +1,22 @@ import './polyfills'; import './global.css'; import '@rainbow-me/rainbowkit/styles.css'; -import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; -import { configureChains, createConfig, WagmiConfig } from 'wagmi'; -import { mainnet, polygon, optimism, arbitrum, base, zora } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; +import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; +import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; +import { + arbitrum, + base, + mainnet, + optimism, + polygon, + zora, +} from 'wagmi/chains'; + const { chains, publicClient } = configureChains( [mainnet, polygon, optimism, arbitrum, base, zora], [publicProvider()] diff --git a/packages/create-rainbowkit/generated-test-app/pages/_app.tsx b/packages/create-rainbowkit/generated-test-app/pages/_app.tsx index 3af78c2da5..ad8f05fd86 100644 --- a/packages/create-rainbowkit/generated-test-app/pages/_app.tsx +++ b/packages/create-rainbowkit/generated-test-app/pages/_app.tsx @@ -1,18 +1,19 @@ import '../styles/globals.css'; import '@rainbow-me/rainbowkit/styles.css'; -import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; import type { AppProps } from 'next/app'; + +import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { arbitrum, - goerli, + base, mainnet, optimism, polygon, - base, + sepolia, zora, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -22,7 +23,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] ); diff --git a/packages/create-rainbowkit/templates/next-app/pages/_app.tsx b/packages/create-rainbowkit/templates/next-app/pages/_app.tsx index 3af78c2da5..ad8f05fd86 100644 --- a/packages/create-rainbowkit/templates/next-app/pages/_app.tsx +++ b/packages/create-rainbowkit/templates/next-app/pages/_app.tsx @@ -1,18 +1,19 @@ import '../styles/globals.css'; import '@rainbow-me/rainbowkit/styles.css'; -import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; import type { AppProps } from 'next/app'; + +import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public'; import { arbitrum, - goerli, + base, mainnet, optimism, polygon, - base, + sepolia, zora, } from 'wagmi/chains'; -import { publicProvider } from 'wagmi/providers/public'; const { chains, publicClient, webSocketPublicClient } = configureChains( [ @@ -22,7 +23,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( arbitrum, base, zora, - ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []), + ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], [publicProvider()] );