Skip to content

Commit

Permalink
Merge pull request #1235 from yieldprotocol/feat/walletConnectv2
Browse files Browse the repository at this point in the history
projectId for v2 walletconnect
  • Loading branch information
brucedonovan authored Oct 6, 2023
2 parents 9ff0aba + d9de085 commit 529a7e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const nextConfig = {
INFURA_KEY: process.env.INFURA_KEY,
ALCHEMY_ARBITRUM_KEY: process.env.ALCHEMY_ARBITRUM_KEY,
ALCHEMY_MAINNET_KEY: process.env.ALCHEMY_MAINNET_KEY,
WALLETCONNECT_PROJECT_ID: process.env.WALLETCONNECT_PROJECT_ID,
ENV: process.env.NODE_ENV,

TENDERLY_USER: process.env.TENDERLY_USER,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "app-v2",
"version": "2.5.36",
"version": "2.5.37",
"private": true,
"dependencies": {
"@ethersproject/providers": "^5.6.8",
"@multiavatar/multiavatar": "^1.0.6",
"@openzeppelin/merkle-tree": "^1.0.4",
"@rainbow-me/rainbowkit": "^0.12.1",
"@rainbow-me/rainbowkit": "^0.12.0",
"@yield-protocol/ui-math": "^1.0.15",
"@yield-protocol/ui-multicall": "^1.0.9",
"axios": "^1.3.4",
Expand All @@ -31,7 +31,7 @@
"styled-components": "^5.3.1",
"swr": "^2.0.0",
"unique-names-generator": "^4.6.0",
"wagmi": "^0.12.1",
"wagmi": "^0.12.0",
"web-vitals": "^3.3.0"
},
"scripts": {
Expand Down
28 changes: 15 additions & 13 deletions src/contexts/WagmiContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Theme,
AvatarComponent,
lightTheme,
getDefaultWallets
} from '@rainbow-me/rainbowkit';

import {
Expand All @@ -36,6 +37,7 @@ const WagmiContext = ({ children }: { children: ReactNode }) => {
const [useForkedEnv] = useCachedState(Settings.USE_FORKED_ENV, false);
const [forkEnvUrl] = useCachedState(Settings.FORK_ENV_URL, process.env.REACT_APP_DEFAULT_FORK_RPC_URL);
const defaultChainId = parseInt(process.env.REACT_APP_DEFAULT_CHAINID!)
const projectId = process.env.WALLETCONNECT_PROJECT_ID!;

const chainConfig = useMemo(
() =>
Expand All @@ -47,25 +49,25 @@ const WagmiContext = ({ children }: { children: ReactNode }) => {

const { chains, provider } = configureChains(defaultChains, [chainConfig]);

const { wallets } = getDefaultWallets({
appName: 'Yield-App-V2',
projectId,
chains,
});

const connectors = connectorsForWallets([
...wallets,
{
groupName: 'Recommended',
wallets: [metaMaskWallet({ chains }), walletConnectWallet({ chains }), injectedWallet({ chains })],
},
{
groupName: 'Experimental',
wallets: [
coinbaseWallet({ appName: 'yieldProtocol', chains }),
rainbowWallet({ chains }),
ledgerWallet({ chains }),
argentWallet({ chains }),
braveWallet({ chains }),
metaMaskWallet({ projectId, chains }),
walletConnectWallet({ projectId, chains }),
injectedWallet({ chains }),
rainbowWallet({ projectId, chains }),
ledgerWallet({ projectId, chains }),
argentWallet({ projectId, chains }),
],
},
{
groupName: 'Development Environments',
wallets: [],
},
]);

// Set up client
Expand Down

0 comments on commit 529a7e1

Please sign in to comment.