Skip to content

Commit

Permalink
Merge pull request #15 from plottables/main
Browse files Browse the repository at this point in the history
Migrating to WalletConnect v2
  • Loading branch information
jakerockland authored Jun 27, 2023
2 parents 9f91e8e + 6237737 commit a787769
Show file tree
Hide file tree
Showing 5 changed files with 1,408 additions and 360 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ In order to customize your specific implementation, you will need to edit the de

You must specify an API key from [Infura](https://www.infura.io/) as well as a chain id in your environment file. Use
`1` for mainnet or `5` for goerli. Alternative providers can be used by modifying the `src/components/Providers.tsx`
file. Use multiple `.env` fiels to set up `development` or `staging` environments on `testnet` if you wish to do so.
file. Use multiple `.env` fields to set up `development` or `staging` environments on `testnet` if you wish to do so.

You must also obtain and supply a projectId from [WalletConnect Cloud](https://cloud.walletconnect.com/). This is free
and only takes a few minutes.

Additionally, you will need to edit the default configuration in the `src/contractConfig.ts` file -
here you will find arrays for your mainnet and testnet contracts. Further configuration values like the number of
Expand Down
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
REACT_APP_EXPECTED_CHAIN_ID=3
REACT_APP_GRAPHQL_URL=https://api.thegraph.com/subgraphs/name/artblocks/art-blocks-artist-staging-goerli

REACT_APP_WALLET_CONNECT_PROJECT_ID=xyz789
REACT_APP_INFURA_KEY=abc123
REACT_APP_MERKLE_PROOF_API_URL=https://media.plottables.io/api/getMerkleProof
REACT_APP_HOLDER_PROOF_API_URL=https://media.plottables.io/api/getHolderProof
5 changes: 3 additions & 2 deletions src/components/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { mainnet, goerli } from 'wagmi/chains'
import { infuraProvider } from "wagmi/providers/infura"
import { publicProvider } from "wagmi/providers/public"
import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"
import { GRAPHQL_URL, INFURA_KEY, EXPECTED_CHAIN_ID } from "config"
import { GRAPHQL_URL, INFURA_KEY, EXPECTED_CHAIN_ID, WALLET_CONNECT_PROJECT_ID } from "config"

const client = new ApolloClient({
uri: GRAPHQL_URL,
Expand All @@ -29,7 +29,8 @@ const { chains, provider, webSocketProvider } = configureChains(

const { connectors } = getDefaultWallets({
appName: "Engine",
chains
chains,
projectId: WALLET_CONNECT_PROJECT_ID
})

const wagmiClient = createClient({
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { mainnetContractConfig, testnetContractConfig } from "./contractConfig";

export const EXPECTED_CHAIN_ID = Number(process.env.REACT_APP_EXPECTED_CHAIN_ID)
export const GRAPHQL_URL = process.env.REACT_APP_GRAPHQL_URL
export const WALLET_CONNECT_PROJECT_ID = process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID || ""
export const INFURA_KEY = process.env.REACT_APP_INFURA_KEY || ""
export const PROJECTS_PER_PAGE = 8
export const TOKENS_PER_PAGE = 9
Expand Down
Loading

1 comment on commit a787769

@vercel
Copy link

@vercel vercel bot commented on a787769 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.