From 298bcff5f39fa02113ab3e236c8020cf71aaba24 Mon Sep 17 00:00:00 2001 From: Edouard Bougon <15703023+EdouardBougon@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:52:53 +0200 Subject: [PATCH] feat: improve vite example --- examples/with-vite/.env.local.example | 1 + examples/with-vite/src/wagmi.ts | 39 +++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 examples/with-vite/.env.local.example diff --git a/examples/with-vite/.env.local.example b/examples/with-vite/.env.local.example new file mode 100644 index 0000000000..ac7312170a --- /dev/null +++ b/examples/with-vite/.env.local.example @@ -0,0 +1 @@ +VITE_PUBLIC_WALLETCONNECT_PROJECT_ID= # Required for WalletConnect v2 diff --git a/examples/with-vite/src/wagmi.ts b/examples/with-vite/src/wagmi.ts index 96a3659854..20e01732a1 100644 --- a/examples/with-vite/src/wagmi.ts +++ b/examples/with-vite/src/wagmi.ts @@ -1,9 +1,44 @@ import { getDefaultConfig } from '@rainbow-me/rainbowkit'; import { arbitrum, base, mainnet, optimism, polygon } from 'wagmi/chains'; +import { + metaMaskWallet, + safeWallet, + rainbowWallet, + coinbaseWallet, + walletConnectWallet, + rabbyWallet, + trustWallet, + uniswapWallet +} from '@rainbow-me/rainbowkit/wallets'; + +// Enable Smart Wallet and EOA +// Testing `preference` type +coinbaseWallet.preference = 'all'; export const config = getDefaultConfig({ appName: 'RainbowKit demo', - projectId: 'YOUR_PROJECT_ID', - chains: [mainnet, polygon, optimism, arbitrum, base], + projectId: import.meta.env.VITE_PUBLIC_WALLETCONNECT_PROJECT_ID ?? 'YOUR_PROJECT_ID', + chains: [mainnet, + polygon, optimism, arbitrum, base], + wallets: [ + { + groupName: 'Popular', + wallets: [ + safeWallet, + rainbowWallet, + coinbaseWallet, + metaMaskWallet, + walletConnectWallet, + ], + }, + { + groupName: 'Other', + wallets: [ + rabbyWallet, + trustWallet, + uniswapWallet, + ], + }, + ] });