Skip to content

Commit

Permalink
chore: migrate create-rainbowkit template to src/ dir (#2014)
Browse files Browse the repository at this point in the history
chore: migrate create-rainbowkit template to src/ dir

chore: migrate example dapp to src/ dir
  • Loading branch information
DanielSinclair authored May 30, 2024
1 parent c1e4b61 commit 28470ab
Show file tree
Hide file tree
Showing 18 changed files with 270 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,9 @@ import type { AppProps } from 'next/app';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';
import {
arbitrum,
base,
mainnet,
optimism,
polygon,
sepolia,
} from 'wagmi/chains';
import { getDefaultConfig, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { RainbowKitProvider } from '@rainbow-me/rainbowkit';

const config = getDefaultConfig({
appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
arbitrum,
base,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
ssr: true,
});
import { config } from '../wagmi';

const client = new QueryClient();

Expand Down
23 changes: 23 additions & 0 deletions packages/create-rainbowkit/generated-test-app/src/wagmi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { getDefaultConfig } from '@rainbow-me/rainbowkit';
import {
arbitrum,
base,
mainnet,
optimism,
polygon,
sepolia,
} from 'wagmi/chains';

export const config = getDefaultConfig({
appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
arbitrum,
base,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
ssr: true,
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,9 @@ import type { AppProps } from 'next/app';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';
import {
arbitrum,
base,
mainnet,
optimism,
polygon,
sepolia,
} from 'wagmi/chains';
import { getDefaultConfig, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { RainbowKitProvider } from '@rainbow-me/rainbowkit';

const config = getDefaultConfig({
appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
arbitrum,
base,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
ssr: true,
});
import { config } from '../wagmi';

const client = new QueryClient();

Expand Down
23 changes: 23 additions & 0 deletions packages/create-rainbowkit/templates/next-app/src/wagmi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { getDefaultConfig } from '@rainbow-me/rainbowkit';
import {
arbitrum,
base,
mainnet,
optimism,
polygon,
sepolia,
} from 'wagmi/chains';

export const config = getDefaultConfig({
appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
arbitrum,
base,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
ssr: true,
});
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,243 +1,34 @@
import '@rainbow-me/rainbowkit/styles.css';
import './global.css';

import type { Session } from 'next-auth';
import { SessionProvider, signOut } from 'next-auth/react';
import type { AppProps } from 'next/app';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';

import {
AvatarComponent,
type Chain,
DisclaimerComponent,
Locale,
RainbowKitProvider,
darkTheme,
getDefaultConfig,
getDefaultWallets,
lightTheme,
midnightTheme,
} from '@rainbow-me/rainbowkit';
import {
GetSiweMessageOptions,
RainbowKitSiweNextAuthProvider,
} from '@rainbow-me/rainbowkit-siwe-next-auth';
import {
argentWallet,
bifrostWallet,
bitgetWallet,
bitskiWallet,
bitverseWallet,
bloomWallet,
bybitWallet,
clvWallet,
coin98Wallet,
compassWallet,
coreWallet,
dawnWallet,
desigWallet,
enkryptWallet,
foxWallet,
frameWallet,
frontierWallet,
gateWallet,
imTokenWallet,
kaikasWallet,
krakenWallet,
kresusWallet,
ledgerWallet,
magicEdenWallet,
mewWallet,
nestWallet,
oktoWallet,
okxWallet,
omniWallet,
oneInchWallet,
oneKeyWallet,
phantomWallet,
rabbyWallet,
ramperWallet,
roninWallet,
safeheronWallet,
safepalWallet,
subWallet,
tahoWallet,
talismanWallet,
tokenPocketWallet,
tokenaryWallet,
trustWallet,
uniswapWallet,
xdefiWallet,
zealWallet,
zerionWallet,
} from '@rainbow-me/rainbowkit/wallets';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { Session } from 'next-auth';
import { SessionProvider, signOut } from 'next-auth/react';
import type { AppProps } from 'next/app';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { WagmiProvider, useDisconnect } from 'wagmi';
import {
arbitrum,
arbitrumSepolia,
avalancheFuji,
base,
baseSepolia,
blast,
blastSepolia,
bsc,
holesky,
klaytn,
klaytnBaobab,
mainnet,
optimism,
optimismSepolia,
polygon,
polygonMumbai,
ronin,
sepolia,
zetachain,
zetachainAthensTestnet,
zkSync,
zora,
zoraSepolia,
} from 'wagmi/chains';

import { AppContextProps } from '../lib/AppContextProps';
import { config } from '../wagmi';

const RAINBOW_TERMS = 'https://rainbow.me/terms-of-use';

const projectId =
process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?? 'YOUR_PROJECT_ID';

const { wallets } = getDefaultWallets();

const avalanche = {
id: 43_114,
name: 'Avalanche',
iconUrl: 'https://s2.coinmarketcap.com/static/img/coins/64x64/5805.png',
iconBackground: '#fff',
nativeCurrency: { name: 'Avalanche', symbol: 'AVAX', decimals: 18 },
rpcUrls: {
default: { http: ['https://api.avax.network/ext/bc/C/rpc'] },
},
blockExplorers: {
default: { name: 'SnowTrace', url: 'https://snowtrace.io' },
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 11_907_934,
},
},
} as const satisfies Chain;

const sei = {
id: 713715,
name: 'Sei',
iconUrl:
'https://s3.coinmarketcap.com/static-gravity/image/992744cfbd5e40f5920018ee7a830b98.png',
iconBackground: '#fff',
nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
rpcUrls: {
default: { http: ['https://evm-rpc.arctic-1.seinetwork.io'] },
},
blockExplorers: {
default: { name: 'Sei Explorer', url: 'https://www.seiscan.app' },
},
contracts: {},
} as const satisfies Chain;

const config = getDefaultConfig({
appName: 'RainbowKit Demo',
projectId,
chains: [
mainnet,
polygon,
optimism,
arbitrum,
base,
bsc,
avalanche,
zora,
blast,
zkSync,
zetachain,
ronin,
klaytn,
sei,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true'
? [
sepolia,
holesky,
polygonMumbai,
optimismSepolia,
arbitrumSepolia,
baseSepolia,
zoraSepolia,
blastSepolia,
avalancheFuji,
zetachainAthensTestnet,
klaytnBaobab,
]
: []),
],
wallets: [
...wallets,
{
groupName: 'Other',
wallets: [
argentWallet,
bifrostWallet,
bitgetWallet,
bitskiWallet,
bitverseWallet,
bloomWallet,
bybitWallet,
clvWallet,
compassWallet,
coin98Wallet,
coreWallet,
dawnWallet,
desigWallet,
enkryptWallet,
foxWallet,
frameWallet,
frontierWallet,
gateWallet,
imTokenWallet,
kresusWallet,
krakenWallet,
kaikasWallet,
ledgerWallet,
magicEdenWallet,
mewWallet,
nestWallet,
oktoWallet,
okxWallet,
omniWallet,
oneInchWallet,
oneKeyWallet,
phantomWallet,
rabbyWallet,
ramperWallet,
roninWallet,
safeheronWallet,
safepalWallet,
subWallet,
tahoWallet,
talismanWallet,
tokenPocketWallet,
tokenaryWallet,
trustWallet,
uniswapWallet,
xdefiWallet,
zealWallet,
zerionWallet,
],
},
],
ssr: true,
});

const demoAppInfo = {
appName: 'Rainbowkit Demo',
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 28470ab

Please sign in to comment.