diff --git a/docs/package.json b/docs/package.json index b61a629ca..dc48623a4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -58,7 +58,7 @@ "@web3-onboard/capsule": "^2.0.1", "@web3-onboard/cede-store": "^2.2.0", "@web3-onboard/coinbase": "^2.2.7", - "@web3-onboard/core": "^2.21.3", + "@web3-onboard/core": "^2.21.4", "@web3-onboard/dcent": "^2.2.7", "@web3-onboard/enkrypt": "^2.0.4", "@web3-onboard/fortmatic": "^2.0.19", diff --git a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md index 91b7302c5..4707e3355 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md @@ -32,9 +32,9 @@ Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain - **Notify:** Real-time transaction notifications for all transaction states for the connected wallet address(es). In-notification speedups & cancels for hardware wallet connections. -### Supported Networks +### Natively Supported EVM Chains -web3-onboard supports all EVM networks. Supporting a new network is simply a matter of adding its details in the Chains section upon initialization. For more information see [initialization options](../../modules/core.md#initialization). +web3-onboard supports ALL EVM networks. Supporting a new network is simply a matter of adding its details in the Chains section upon initialization. For more information see [initialization options](../../modules/core.md#initialization). - Ethereum - Arbitrum One @@ -126,6 +126,12 @@ const onboard = Onboard({ token: 'ETH', label: 'Base', rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ] }) diff --git a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md index 6bb769ac4..087a32e68 100644 --- a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md @@ -671,6 +671,12 @@ const onboard = Onboard({ token: 'OETH', label: 'Optimism', rpcUrl: 'https://mainnet.optimism.io' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ], appMetadata: { @@ -755,6 +761,10 @@ const onboard = Onboard({ To initiate a user to select and connect a wallet you can call the `connectWallet` function on an initialized Onboard instance. It will return a `Promise` that will resolve when the user either successfully connects a wallet, or when they dismiss the UI. The resolved value from the promise will be the latest state of the `wallets` array. The order of the wallets array is last to first, so the most recently selected wallet will be the first item in the array and can be thought of as the "primary wallet". If no wallet was selected, then the `wallets` array will have the same state as it had before calling `connectWallet`. +### Wallet Provider + +Wallets connected through web3-onboard are all passed to the dapp following the EIP-1193 standard. This allows for the same interaction between all wallets connected through web3-onboard and abstracts away the challenges of working with different wallet providers. + ### Example ```javascript @@ -766,6 +776,10 @@ async function connectWallet() { connectWallet() ``` +### Interacting with the providers - Transfer, Send, Sign using ethers.js + +For examples of interacting with the wallet providers please see our demo project [here](/~https://github.com/blocknative/web3-onboard/blob/9b871a1b3117e92a7c87285677fa5b35c544a8e0/packages/demo/src/App.svelte#L447) + ### Auto Selecting a Wallet A common UX pattern is to remember the last wallet that a user has previously connected by storing it in localStorage and then automatically selecting them for the user next time they visit your app. diff --git a/docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md b/docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md index 8f317b0d8..cc84d188b 100644 --- a/docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md @@ -4,10 +4,14 @@ title: Injected Wallets # {$frontmatter.title} -This module lets web3-onboard automatically detect Browser Injected Wallets such as Metamask or Coinbase Wallet. We recommend you install this module to get the most out of your w3o implementation. This module supports [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) and [recognizes many injected wallets natively](#injected-wallets-supported-natively) as well as supports [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) and recognizes any wallet that has implemented 6963 support. +This module lets web3-onboard automatically detect Browser Injected Wallets such as Metamask or Coinbase Wallet. We recommend you install this module to get the most out of your w3o implementation. This module supports [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) and [recognizes many injected wallets natively](#injected-wallets-supported-natively) as well as supports all [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) compatible wallets. Note: Make sure to install the core module before installing other modules to w3o. +### Support all EIP-6963 Wallets out of the box + +Web3-Onboard supports all [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) compatible wallets out of the box and will automatically recognizes any wallet which has integrated 6963 support. + ## Install diff --git a/docs/src/routes/examples/[...1]connect-wallet/+page.md b/docs/src/routes/examples/[...1]connect-wallet/+page.md index 4185ad0b8..f65283af4 100644 --- a/docs/src/routes/examples/[...1]connect-wallet/+page.md +++ b/docs/src/routes/examples/[...1]connect-wallet/+page.md @@ -38,7 +38,6 @@ npm install @web3-onboard/react @web3-onboard/injected-wallets @web3-onboard/inf - ## Step 2: Import + Configure Import the libraries and any wallets you would like to use. For this example, we are going to use the injected wallets module. You can easily add more wallet support to your dapp via our other wallet modules. Additionally, we'll setup web3-onboard to support 2 chains: Ethereum mainnet and Polygon mainnet. @@ -156,6 +155,12 @@ const chains = [ token: 'ARB-ETH', label: 'Arbitrum', rpcUrl: 'https://rpc.ankr.com/arbitrum' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ] @@ -412,6 +417,12 @@ const chains = [ token: 'ARB-ETH', label: 'Arbitrum', rpcUrl: 'https://rpc.ankr.com/arbitrum' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ] @@ -497,3 +508,7 @@ Now that we have our wallet connected, let's display some basic information, suc + +## Interacting with the providers - Transfer, Send, Sign using ethers.js + +For examples of interacting with the wallet providers please see our demo project [here](/~https://github.com/blocknative/web3-onboard/blob/9b871a1b3117e92a7c87285677fa5b35c544a8e0/packages/demo/src/App.svelte#L447) \ No newline at end of file diff --git a/examples/with-nextjs-13/web3-onboard.ts b/examples/with-nextjs-13/web3-onboard.ts index 9ade5bb75..16fb7059d 100644 --- a/examples/with-nextjs-13/web3-onboard.ts +++ b/examples/with-nextjs-13/web3-onboard.ts @@ -123,6 +123,12 @@ export default init({ token: 'MATIC', label: 'Matic Mainnet', rpcUrl: 'https://matic-mainnet.chainstacklabs.com' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ], appMetadata: { diff --git a/examples/with-nextjs/pages/_app.js b/examples/with-nextjs/pages/_app.js index 6f1824185..579c90489 100644 --- a/examples/with-nextjs/pages/_app.js +++ b/examples/with-nextjs/pages/_app.js @@ -23,17 +23,23 @@ const baseMainnet = { label: 'Base', rpcUrl: 'https://mainnet.base.org' } +const celoMainnet = { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' +} -const chains = [ethereumRopsten, polygonMainnet, baseMainnet] +const chains = [ethereumRopsten, polygonMainnet, baseMainnet,celoMainnet] const wallets = [injectedModule()] const web3Onboard = init({ wallets, chains, appMetadata: { - name: "Web3-Onboard Demo", + name: 'Web3-Onboard Demo', icon: 'My App Icon', - description: "A demo of Web3-Onboard." + description: 'A demo of Web3-Onboard.' } }) @@ -45,4 +51,4 @@ function MyApp({ Component, pageProps }) { ) } -export default MyApp \ No newline at end of file +export default MyApp diff --git a/examples/with-solidjs/src/providers/onboard-provider/options.ts b/examples/with-solidjs/src/providers/onboard-provider/options.ts index aa0ffef8a..f151e80a7 100644 --- a/examples/with-solidjs/src/providers/onboard-provider/options.ts +++ b/examples/with-solidjs/src/providers/onboard-provider/options.ts @@ -28,6 +28,12 @@ export const chains = [ token: 'ETH', label: 'Base', rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ]; diff --git a/examples/with-sveltekit/package.json b/examples/with-sveltekit/package.json index dec2e87ef..fbe908030 100644 --- a/examples/with-sveltekit/package.json +++ b/examples/with-sveltekit/package.json @@ -35,7 +35,7 @@ "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "@fontsource/fira-mono": "^4.5.10", "@rollup/plugin-commonjs": "^25.0.7", - "@web3-onboard/core": "^2.21.3-alpha.1", + "@web3-onboard/core": "^2.21.4", "@web3-onboard/injected-wallets": "^2.8.5", "@web3-onboard/walletconnect": "^2.3.6", "assert": "^2.1.0", diff --git a/examples/with-sveltekit/src/lib/web3-onboard.ts b/examples/with-sveltekit/src/lib/web3-onboard.ts index 5ce8d77bf..02ec180c7 100644 --- a/examples/with-sveltekit/src/lib/web3-onboard.ts +++ b/examples/with-sveltekit/src/lib/web3-onboard.ts @@ -33,6 +33,12 @@ const chains = [ token: 'ETH', label: 'Base', rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ] diff --git a/examples/with-vanilla-js/src/onboard.js b/examples/with-vanilla-js/src/onboard.js index 7f799e3be..1b2773aab 100644 --- a/examples/with-vanilla-js/src/onboard.js +++ b/examples/with-vanilla-js/src/onboard.js @@ -29,6 +29,12 @@ const chains = [ token: 'ETH', label: 'Base', rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ] diff --git a/examples/with-vite-react/src/web3-onboard.ts b/examples/with-vite-react/src/web3-onboard.ts index cacb6b1a2..7c7f9c7c9 100644 --- a/examples/with-vite-react/src/web3-onboard.ts +++ b/examples/with-vite-react/src/web3-onboard.ts @@ -33,14 +33,12 @@ const injected = injectedModule({ const walletLink = coinbaseModule() -const walletConnect = walletConnectModule( - { - version: 2, - // Replace with your apiKey - projectId: '4a49c32131502e8c12d54295295e2012', - dappUrl: 'https://onboard.blocknative.com/' - } -) +const walletConnect = walletConnectModule({ + version: 2, + // Replace with your apiKey + projectId: '4a49c32131502e8c12d54295295e2012', + dappUrl: 'https://onboard.blocknative.com/' +}) const portis = portisModule({ // Replace with your apiKey apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b' @@ -137,6 +135,12 @@ export default init({ token: 'ETH', label: 'Base', rpcUrl: 'https://mainnet.base.org' + }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' } ], appMetadata: { diff --git a/examples/with-vuejs-v2/src/components/HelloWorld.vue b/examples/with-vuejs-v2/src/components/HelloWorld.vue index 2b876a0c1..381652e33 100644 --- a/examples/with-vuejs-v2/src/components/HelloWorld.vue +++ b/examples/with-vuejs-v2/src/components/HelloWorld.vue @@ -22,17 +22,17 @@ + + ` diff --git a/packages/dcent/package.json b/packages/dcent/package.json index cdf1f6437..02e5430a5 100644 --- a/packages/dcent/package.json +++ b/packages/dcent/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/dcent", - "version": "2.2.7", + "version": "2.2.8", "description": "D'CENT wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -56,8 +56,8 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/common": "^2.3.3", - "@web3-onboard/hw-common": "^2.3.0", + "@web3-onboard/common": "^2.3.4", + "@web3-onboard/hw-common": "^2.3.1", "@ethereumjs/tx": "^3.4.0", "@ethersproject/providers": "^5.5.0", "eth-dcent-keyring": "^0.2.2" diff --git a/packages/demo/package.json b/packages/demo/package.json index c84465bf5..51569d2cc 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -32,7 +32,7 @@ "@web3-onboard/blocto": "^2.0.1", "@web3-onboard/capsule": "2.0.1", "@web3-onboard/cede-store": "^2.2.0", - "@web3-onboard/core": "^2.21.3", + "@web3-onboard/core": "^2.21.4", "@web3-onboard/coinbase": "^2.2.7", "@web3-onboard/dcent": "^2.2.7", "@web3-onboard/enkrypt": "^2.0.3", @@ -42,7 +42,7 @@ "@web3-onboard/gas": "^2.1.7", "@web3-onboard/gnosis": "^2.2.1", "@web3-onboard/infinity-wallet": "^2.0.3", - "@web3-onboard/injected-wallets": "^2.10.13", + "@web3-onboard/injected-wallets": "^2.10.14", "@web3-onboard/keepkey": "^2.3.8", "@web3-onboard/keystone": "^2.3.8", "@web3-onboard/ledger": "^2.6.0", diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 8b45b67f5..00f14b8d1 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -315,6 +315,12 @@ label: 'Base', rpcUrl: 'https://mainnet.base.org' }, + { + id: '0xa4ec', + token: 'ETH', + label: 'Celo', + rpcUrl: 'https://1rpc.io/celo' + }, { id: '0x38', token: 'BNB', diff --git a/packages/injected/package.json b/packages/injected/package.json index 22779a268..fe8735ca1 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.10.13", + "version": "2.10.14", "description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", diff --git a/packages/injected/src/index.ts b/packages/injected/src/index.ts index e39ce8b33..8ffa6fbb0 100644 --- a/packages/injected/src/index.ts +++ b/packages/injected/src/index.ts @@ -53,10 +53,10 @@ function checkFor6963Providers() { label: name, getIcon: async () => icon, getInterface: async () => ({ - provider: createEIP1193Provider(provider) + provider }), platforms: ['all'], - eip6963Provider: createEIP1193Provider(provider) as InjectedProvider, + eip6963Provider: provider as InjectedProvider, checkProviderIdentity: ({ provider }) => !!provider }) }) diff --git a/packages/react/package.json b/packages/react/package.json index cb9b25596..7c6613baa 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.8.14", + "version": "2.8.15", "description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -62,7 +62,7 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.21.3", + "@web3-onboard/core": "^2.21.4", "use-sync-external-store": "1.0.0" }, "peerDependencies": { diff --git a/packages/solid/package.json b/packages/solid/package.json index dd9dfd56b..6631cb3a0 100644 --- a/packages/solid/package.json +++ b/packages/solid/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/solid", - "version": "2.0.1", + "version": "2.0.2", "description": "A collection of solid Composables for integrating Web3-Onboard in to a Solid project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -63,7 +63,7 @@ }, "dependencies": { "@web3-onboard/common": "^2.3.3", - "@web3-onboard/core": "^2.21.3", + "@web3-onboard/core": "^2.21.4", "solid-js": "^1.8.1" } } diff --git a/packages/vue/package.json b/packages/vue/package.json index 5294a41bb..181fcfddf 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.7.13", + "version": "2.7.14", "description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", @@ -62,7 +62,7 @@ "@vueuse/core": "^8.4.2", "@vueuse/rxjs": "^8.2.0", "@web3-onboard/common": "^2.3.4", - "@web3-onboard/core": "^2.21.3", + "@web3-onboard/core": "^2.21.4", "vue-demi": "^0.12.4" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 89a2c6428..8ab7327a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6293,6 +6293,13 @@ ethers "5.5.4" joi "17.9.1" +"@web3-onboard/injected-wallets@^2.10.14": + version "2.10.14-alpha.1" + dependencies: + "@web3-onboard/common" "^2.3.3" + joi "17.9.1" + lodash.uniqby "^4.7.0" + "@web3-react/abstract-connector@^6.0.7": version "6.0.7" resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6"