From 56d2d2e11dee0f7f333b560f6d655667c257b6f8 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Fri, 12 Aug 2022 09:57:38 -0600 Subject: [PATCH] Update docs to reflect the non-bias RPC provider ability --- packages/core/README.md | 16 +++++++++++----- packages/react/README.md | 5 +++-- packages/vue/README.md | 6 ++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/core/README.md b/packages/core/README.md index 1ca34b042..34b5e98d1 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -48,7 +48,7 @@ An array of Chains that your app supports: type Chain = { id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future - rpcUrl: string // used for network requests + rpcUrl: string // used for network requests (eg Alchemy or Infura end point) label: string // used for display, eg Ethereum Mainnet token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC color?: string // the color used to represent the chain and will be used as a background for the icon @@ -251,6 +251,11 @@ import injectedModule from '@web3-onboard/injected-wallets' const injected = injectedModule() +// Only one RPC endpoint required per chain +const ETH_MAINNET_RPC = `https://mainnet.infura.io/v3/${INFURA_KEY}` || `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` +const ETH_ROPSTEN_RPC = `https://ropsten.infura.io/v3/${INFURA_ID}` || `https://eth-ropsten.g.alchemy.com/v2/${ALCHEMY_KEY}` +const ETH_RINKEBY_RPC = `https://rinkeby.infura.io/v3/${INFURA_KEY}` || `https://eth-rinkeby.g.alchemy.com/v2/${ALCHEMY_KEY}` + const onboard = Onboard({ wallets: [injected], chains: [ @@ -258,19 +263,19 @@ const onboard = Onboard({ id: '0x1', token: 'ETH', label: 'Ethereum Mainnet', - rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}` + rpcUrl: ETH_MAINNET_RPC }, { id: '0x3', token: 'tROP', label: 'Ethereum Ropsten Testnet', - rpcUrl: `https://ropsten.infura.io/v3/${INFURA_ID}` + rpcUrl: ETH_ROPSTEN_RPC }, { id: '0x4', token: 'rETH', label: 'Ethereum Rinkeby Testnet', - rpcUrl: `https://rinkeby.infura.io/v3/${INFURA_ID}` + rpcUrl: ETH_RINKEBY_RPC }, { id: '0x38', @@ -580,7 +585,8 @@ const onboard = Onboard({ id: '0x1', token: 'ETH', label: 'Ethereum Mainnet', - rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}` + // Only one RPC required + rpcUrl: `https://mainnet.infura.io/v3/${INFURA_KEY}` || `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` } ] }) diff --git a/packages/react/README.md b/packages/react/README.md index b3e61b95f..3fbee7ed5 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -25,8 +25,9 @@ const dappId = '1730eff0-9d50-4382-a3fe-89f0d34a2070' const injected = injectedModule() -const infuraKey = '' -const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}` +// Only one RPC endpoint required per chain +const rpcAPIKey = '' || '' +const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || `https://mainnet.infura.io/v3/${rpcAPIKey}` // initialize Onboard init({ diff --git a/packages/vue/README.md b/packages/vue/README.md index 9b0447ee9..4250ec8a6 100644 --- a/packages/vue/README.md +++ b/packages/vue/README.md @@ -17,8 +17,10 @@ import { init } from '@web3-onboard/vue' import injectedModule from '@web3-onboard/injected-wallets' const injected = injectedModule() -const infuraKey = '' -const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}` + +// Only one RPC endpoint required per chain +const rpcAPIKey = '' || '' +const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || `https://mainnet.infura.io/v3/${rpcAPIKey}` const web3Onboard = init({ wallets: [injected],