Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -251,26 +251,31 @@ 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: [
{
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',
Expand Down Expand Up @@ -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}`
}
]
})
Expand Down
5 changes: 3 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const dappId = '1730eff0-9d50-4382-a3fe-89f0d34a2070'

const injected = injectedModule()

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

// initialize Onboard
init({
Expand Down
6 changes: 4 additions & 2 deletions packages/vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import { init } from '@web3-onboard/vue'
import injectedModule from '@web3-onboard/injected-wallets'

const injected = injectedModule()
const infuraKey = '<INFURA_KEY>'
const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}`

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

const web3Onboard = init({
wallets: [injected],
Expand Down