Skip to content

Commit 26c3464

Browse files
authored
Update docs to reflect the non-bias RPC provider ability (#1214)
1 parent 68e307b commit 26c3464

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

packages/core/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ An array of Chains that your app supports:
4848
type Chain = {
4949
id: ChainId // hex encoded string, eg '0x1' for Ethereum Mainnet
5050
namespace?: 'evm' // string indicating chain namespace. Defaults to 'evm' but will allow other chain namespaces in the future
51-
rpcUrl: string // used for network requests
51+
rpcUrl: string // used for network requests (eg Alchemy or Infura end point)
5252
label: string // used for display, eg Ethereum Mainnet
5353
token: TokenSymbol // the native token symbol, eg ETH, BNB, MATIC
5454
color?: string // the color used to represent the chain and will be used as a background for the icon
@@ -251,26 +251,31 @@ import injectedModule from '@web3-onboard/injected-wallets'
251251

252252
const injected = injectedModule()
253253

254+
// Only one RPC endpoint required per chain
255+
const ETH_MAINNET_RPC = `https://mainnet.infura.io/v3/${INFURA_KEY}` || `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`
256+
const ETH_ROPSTEN_RPC = `https://ropsten.infura.io/v3/${INFURA_ID}` || `https://eth-ropsten.g.alchemy.com/v2/${ALCHEMY_KEY}`
257+
const ETH_RINKEBY_RPC = `https://rinkeby.infura.io/v3/${INFURA_KEY}` || `https://eth-rinkeby.g.alchemy.com/v2/${ALCHEMY_KEY}`
258+
254259
const onboard = Onboard({
255260
wallets: [injected],
256261
chains: [
257262
{
258263
id: '0x1',
259264
token: 'ETH',
260265
label: 'Ethereum Mainnet',
261-
rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}`
266+
rpcUrl: ETH_MAINNET_RPC
262267
},
263268
{
264269
id: '0x3',
265270
token: 'tROP',
266271
label: 'Ethereum Ropsten Testnet',
267-
rpcUrl: `https://ropsten.infura.io/v3/${INFURA_ID}`
272+
rpcUrl: ETH_ROPSTEN_RPC
268273
},
269274
{
270275
id: '0x4',
271276
token: 'rETH',
272277
label: 'Ethereum Rinkeby Testnet',
273-
rpcUrl: `https://rinkeby.infura.io/v3/${INFURA_ID}`
278+
rpcUrl: ETH_RINKEBY_RPC
274279
},
275280
{
276281
id: '0x38',
@@ -580,7 +585,8 @@ const onboard = Onboard({
580585
id: '0x1',
581586
token: 'ETH',
582587
label: 'Ethereum Mainnet',
583-
rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}`
588+
// Only one RPC required
589+
rpcUrl: `https://mainnet.infura.io/v3/${INFURA_KEY}` || `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`
584590
}
585591
]
586592
})

packages/react/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ const dappId = '1730eff0-9d50-4382-a3fe-89f0d34a2070'
2525

2626
const injected = injectedModule()
2727

28-
const infuraKey = '<INFURA_KEY>'
29-
const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}`
28+
// Only one RPC endpoint required per chain
29+
const rpcAPIKey = '<INFURA_KEY>' || '<ALCHEMY_KEY>'
30+
const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || `https://mainnet.infura.io/v3/${rpcAPIKey}`
3031

3132
// initialize Onboard
3233
init({

packages/vue/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import { init } from '@web3-onboard/vue'
1717
import injectedModule from '@web3-onboard/injected-wallets'
1818

1919
const injected = injectedModule()
20-
const infuraKey = '<INFURA_KEY>'
21-
const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}`
20+
21+
// Only one RPC endpoint required per chain
22+
const rpcAPIKey = '<INFURA_KEY>' || '<ALCHEMY_KEY>'
23+
const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${rpcAPIKey}` || `https://mainnet.infura.io/v3/${rpcAPIKey}`
2224

2325
const web3Onboard = init({
2426
wallets: [injected],

0 commit comments

Comments
 (0)