From be4526e05e3bc5f17ff1d636a9832aca51e371cc Mon Sep 17 00:00:00 2001 From: avasisht23 Date: Sat, 23 Jul 2022 20:59:56 -0400 Subject: [PATCH 1/2] switch to alchemy rpc for better reliability and data consistency --- README.md | 2 +- packages/core/README.md | 8 ++++---- packages/demo/src/App.svelte | 6 +++--- packages/injected/README.md | 6 +++--- packages/react/README.md | 4 ++-- packages/vue/README.md | 8 ++++---- yarn.lock | 29 ++++++++++------------------- 7 files changed, 27 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index b79787cdd..2a784a6e4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ import Onboard from '@web3-onboard/core' import injectedModule from '@web3-onboard/injected-wallets' import { ethers } from 'ethers' -const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/' +const MAINNET_RPC_URL = 'https://eth-mainnet.g.alchemy.com/v2/' const injected = injectedModule() diff --git a/packages/core/README.md b/packages/core/README.md index fe658dee2..37ba58635 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -230,19 +230,19 @@ const onboard = Onboard({ id: '0x1', token: 'ETH', label: 'Ethereum Mainnet', - rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}` + rpcUrl: `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}` }, { id: '0x3', token: 'tROP', label: 'Ethereum Ropsten Testnet', - rpcUrl: `https://ropsten.infura.io/v3/${INFURA_ID}` + rpcUrl: `https://eth-ropsten.g.alchemy.com/v2/${ALCHEMY_ID}` }, { id: '0x4', token: 'rETH', label: 'Ethereum Rinkeby Testnet', - rpcUrl: `https://rinkeby.infura.io/v3/${INFURA_ID}` + rpcUrl: `https://eth-rinkeby.g.alchemy.com/v2/${ALCHEMY_ID}` }, { id: '0x38', @@ -552,7 +552,7 @@ const onboard = Onboard({ id: '0x1', token: 'ETH', label: 'Ethereum Mainnet', - rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}` + rpcUrl: `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}` } ] }) diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 8ecd45536..e7665a503 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -121,19 +121,19 @@ id: '0x1', token: 'ETH', label: 'Ethereum', - rpcUrl: 'https://mainnet.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e' + rpcUrl: 'https://eth-mainnet.g.alchemy.com/v2/yk36Seh643o-WU1jVcV7nhtqKXdYcW8_' }, { id: 3, token: 'tROP', label: 'Ropsten', - rpcUrl: 'https://ropsten.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e' + rpcUrl: 'https://eth-ropsten.g.alchemy.com/v2/Ujl_rZi5-qud14Hx8FbPKCBrcteFr4mB' }, { id: 4, token: 'rETH', label: 'Rinkeby', - rpcUrl: 'https://rinkeby.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e' + rpcUrl: 'https://eth-rinkeby.g.alchemy.com/v2/_SGaED6MKYWlaZEBazHxPPmnFgrgx9yU' }, { id: 137, diff --git a/packages/injected/README.md b/packages/injected/README.md index 7a7b55b53..e487b32f6 100644 --- a/packages/injected/README.md +++ b/packages/injected/README.md @@ -8,7 +8,7 @@ To allow all injected wallets that are supported, don't pass in any options: import Onboard from '@web3-onboard/core' import injectedModule from '@web3-onboard/injected-wallets' -const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/' +const MAINNET_RPC_URL = 'https://eth-mainnet.g.alchemy.com/v2/' const injected = injectedModule() @@ -42,7 +42,7 @@ Injected wallets that you do not want to support can be filtered based on the `P import Onboard from '@web3-onboard/core' import injectedModule, { ProviderLabel } from '@web3-onboard/injected-wallets' -const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/' +const MAINNET_RPC_URL = 'https://eth-mainnet.g.alchemy.com/v2/' const injected = injectedModule({ filter: { @@ -62,7 +62,7 @@ Or you may want to only filter the 'Detected Wallet' on a select few platforms: import Onboard from '@web3-onboard/core' import injectedModule, { ProviderLabel } from '@web3-onboard/injected-wallets' -const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/' +const MAINNET_RPC_URL = 'https://eth-mainnet.g.alchemy.com/v2/' const injected = injectedModule({ filter: { diff --git a/packages/react/README.md b/packages/react/README.md index b3e61b95f..dc0a7cb2e 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -25,8 +25,8 @@ const dappId = '1730eff0-9d50-4382-a3fe-89f0d34a2070' const injected = injectedModule() -const infuraKey = '' -const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}` +const alchemyKey = '' +const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${alchemyKey}` // initialize Onboard init({ diff --git a/packages/vue/README.md b/packages/vue/README.md index 9b0447ee9..d654328a4 100644 --- a/packages/vue/README.md +++ b/packages/vue/README.md @@ -17,8 +17,8 @@ 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}` +const alchemyKey = '' +const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${alchemyKey}` const web3Onboard = init({ wallets: [injected], @@ -57,8 +57,8 @@ 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}` +const alchemyKey = '' +const rpcUrl = `https://eth-mainnet.g.alchemy.com/v2/${alchemyKey}` const web3Onboard = init({ wallets: [injected], diff --git a/yarn.lock b/yarn.lock index c70893e59..600f06b61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2455,14 +2455,6 @@ dependencies: "@walletconnect/window-getters" "^1.0.0" -"@web3-onboard/coinbase@^2.0.8": - version "2.0.8" - resolved "https://registry.yarnpkg.com/@web3-onboard/coinbase/-/coinbase-2.0.8.tgz#26dbab5728f2a9c07ef4816dfd23ecc741bcf7ef" - integrity sha512-pLvY0Gme1vkqjmYjV2bi0mCeLRCvUfRvBfPZocLF+5XuAgPQuZy1+xYTEc2/1IryAw+wueGhYMHmvBc9dlKKew== - dependencies: - "@coinbase/wallet-sdk" "^3.0.5" - "@web3-onboard/common" "^2.1.5" - "@web3-onboard/common@^2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@web3-onboard/common/-/common-2.1.5.tgz#0bcd562853559a551eaa810ba709fb61a8fd7f09" @@ -2473,6 +2465,16 @@ joi "^17.4.2" rxjs "^7.5.2" +"@web3-onboard/common@^2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@web3-onboard/common/-/common-2.1.6.tgz#29d1a4a98b24a08af9f532707225ad5054e25bb6" + integrity sha512-mVmkjM/hI4WeK9uN3TNt/+v7VtNdwoTbAzTRAOcUSIZRK3q1ptWQoL0tydRimXCTfvv+EUJxlJHb+1+QqmRVPw== + dependencies: + "@ethereumjs/common" "2.6.2" + ethers "5.5.4" + joi "^17.4.2" + rxjs "^7.5.2" + "@web3-onboard/dcent@^2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@web3-onboard/dcent/-/dcent-2.0.5.tgz#395af9a3bbe993f2386d650dc8a9caedb54479e2" @@ -5142,16 +5144,6 @@ eth-json-rpc-filters@4.2.2, eth-json-rpc-filters@^4.2.1: json-rpc-engine "^6.1.0" pify "^5.0.0" -eth-json-rpc-infura@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-5.1.0.tgz#e6da7dc47402ce64c54e7018170d89433c4e8fb6" - integrity sha512-THzLye3PHUSGn1EXMhg6WTLW9uim7LQZKeKaeYsS9+wOBcamRiCQVGHa6D2/4P0oS0vSaxsBnU/J6qvn0MPdow== - dependencies: - eth-json-rpc-middleware "^6.0.0" - eth-rpc-errors "^3.0.0" - json-rpc-engine "^5.3.0" - node-fetch "^2.6.0" - eth-json-rpc-middleware@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-6.0.0.tgz#4fe16928b34231a2537856f08a5ebbc3d0c31175" @@ -10665,7 +10657,6 @@ web3-provider-engine@16.0.1: cross-fetch "^2.1.0" eth-block-tracker "^4.4.2" eth-json-rpc-filters "^4.2.1" - eth-json-rpc-infura "^5.1.0" eth-json-rpc-middleware "^6.0.0" eth-rpc-errors "^3.0.0" eth-sig-util "^1.4.2" From e5f3a4ff5897a8a57cda0cb135118c456e203a46 Mon Sep 17 00:00:00 2001 From: avasisht23 Date: Sat, 23 Jul 2022 21:02:56 -0400 Subject: [PATCH 2/2] update version field in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7690d46d7..c6c9df933 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web3-onboard-monorepo", - "version": "2.5.0", + "version": "2.5.1", "private": true, "workspaces": [ "./packages/*"