Skip to content

Commit 4eff194

Browse files
authored
[UPDATE] - Celo icon and demo support (#2131)
* Bump versions for release and Remove console.log * Update celo icon and add celo support to demo examples * Update more docs * Interact with w3o providers * Use different celo icon * Update docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md * Update versions
1 parent 9b871a1 commit 4eff194

File tree

23 files changed

+172
-54
lines changed

23 files changed

+172
-54
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@web3-onboard/capsule": "^2.0.1",
5959
"@web3-onboard/cede-store": "^2.2.0",
6060
"@web3-onboard/coinbase": "^2.2.7",
61-
"@web3-onboard/core": "^2.21.3",
61+
"@web3-onboard/core": "^2.21.4-alpha.1",
6262
"@web3-onboard/dcent": "^2.2.7",
6363
"@web3-onboard/enkrypt": "^2.0.4",
6464
"@web3-onboard/fortmatic": "^2.0.19",

docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain
3232

3333
- **Notify:** Real-time transaction notifications for all transaction states for the connected wallet address(es). In-notification speedups & cancels for hardware wallet connections.
3434

35-
### Supported Networks
35+
### Natively Supported EVM Chains
3636

37-
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).
37+
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).
3838

3939
- Ethereum
4040
- Arbitrum One
@@ -126,6 +126,12 @@ const onboard = Onboard({
126126
token: 'ETH',
127127
label: 'Base',
128128
rpcUrl: 'https://mainnet.base.org'
129+
},
130+
{
131+
id: '0xa4ec',
132+
token: 'ETH',
133+
label: 'Celo',
134+
rpcUrl: 'https://1rpc.io/celo'
129135
}
130136
]
131137
})

docs/src/routes/docs/[...3]modules/[...1]core/+page.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ const onboard = Onboard({
671671
token: 'OETH',
672672
label: 'Optimism',
673673
rpcUrl: 'https://mainnet.optimism.io'
674+
},
675+
{
676+
id: '0xa4ec',
677+
token: 'ETH',
678+
label: 'Celo',
679+
rpcUrl: 'https://1rpc.io/celo'
674680
}
675681
],
676682
appMetadata: {
@@ -755,6 +761,10 @@ const onboard = Onboard({
755761

756762
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`.
757763

764+
### Wallet Provider
765+
766+
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.
767+
758768
### Example
759769

760770
```javascript
@@ -766,6 +776,10 @@ async function connectWallet() {
766776
connectWallet()
767777
```
768778

779+
### Interacting with the providers - Transfer, Send, Sign using ethers.js
780+
781+
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)
782+
769783
### Auto Selecting a Wallet
770784

771785
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.

docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ title: Injected Wallets
44

55
# {$frontmatter.title}
66

7-
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.
7+
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.
88

99
Note: Make sure to install the core module before installing other modules to w3o.
1010

11+
### Support all EIP-6963 Wallets out of the box
12+
13+
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.
14+
1115
## Install
1216

1317
<Tabs values={['yarn', 'npm']}>

docs/src/routes/examples/[...1]connect-wallet/+page.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ npm install @web3-onboard/react @web3-onboard/injected-wallets @web3-onboard/inf
3838
</TabPanel>
3939
</Tabs>
4040

41-
4241
## Step 2: Import + Configure
4342

4443
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 = [
156155
token: 'ARB-ETH',
157156
label: 'Arbitrum',
158157
rpcUrl: 'https://rpc.ankr.com/arbitrum'
158+
},
159+
{
160+
id: '0xa4ec',
161+
token: 'ETH',
162+
label: 'Celo',
163+
rpcUrl: 'https://1rpc.io/celo'
159164
}
160165
]
161166

@@ -412,6 +417,12 @@ const chains = [
412417
token: 'ARB-ETH',
413418
label: 'Arbitrum',
414419
rpcUrl: 'https://rpc.ankr.com/arbitrum'
420+
},
421+
{
422+
id: '0xa4ec',
423+
token: 'ETH',
424+
label: 'Celo',
425+
rpcUrl: 'https://1rpc.io/celo'
415426
}
416427
]
417428

@@ -497,3 +508,7 @@ Now that we have our wallet connected, let's display some basic information, suc
497508
498509
</TabPanel>
499510
</Tabs>
511+
512+
## Interacting with the providers - Transfer, Send, Sign using ethers.js
513+
514+
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)

examples/with-nextjs-13/web3-onboard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ export default init({
123123
token: 'MATIC',
124124
label: 'Matic Mainnet',
125125
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
126+
},
127+
{
128+
id: '0xa4ec',
129+
token: 'ETH',
130+
label: 'Celo',
131+
rpcUrl: 'https://1rpc.io/celo'
126132
}
127133
],
128134
appMetadata: {

examples/with-nextjs/pages/_app.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,23 @@ const baseMainnet = {
2323
label: 'Base',
2424
rpcUrl: 'https://mainnet.base.org'
2525
}
26+
const celoMainnet = {
27+
id: '0xa4ec',
28+
token: 'ETH',
29+
label: 'Celo',
30+
rpcUrl: 'https://1rpc.io/celo'
31+
}
2632

27-
const chains = [ethereumRopsten, polygonMainnet, baseMainnet]
33+
const chains = [ethereumRopsten, polygonMainnet, baseMainnet,celoMainnet]
2834
const wallets = [injectedModule()]
2935

3036
const web3Onboard = init({
3137
wallets,
3238
chains,
3339
appMetadata: {
34-
name: "Web3-Onboard Demo",
40+
name: 'Web3-Onboard Demo',
3541
icon: '<svg>My App Icon</svg>',
36-
description: "A demo of Web3-Onboard."
42+
description: 'A demo of Web3-Onboard.'
3743
}
3844
})
3945

@@ -45,4 +51,4 @@ function MyApp({ Component, pageProps }) {
4551
)
4652
}
4753

48-
export default MyApp
54+
export default MyApp

examples/with-solidjs/src/providers/onboard-provider/options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ export const chains = [
2828
token: 'ETH',
2929
label: 'Base',
3030
rpcUrl: 'https://mainnet.base.org'
31+
},
32+
{
33+
id: '0xa4ec',
34+
token: 'ETH',
35+
label: 'Celo',
36+
rpcUrl: 'https://1rpc.io/celo'
3137
}
3238
];
3339

examples/with-sveltekit/src/lib/web3-onboard.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const chains = [
3333
token: 'ETH',
3434
label: 'Base',
3535
rpcUrl: 'https://mainnet.base.org'
36+
},
37+
{
38+
id: '0xa4ec',
39+
token: 'ETH',
40+
label: 'Celo',
41+
rpcUrl: 'https://1rpc.io/celo'
3642
}
3743
]
3844

examples/with-vanilla-js/src/onboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ const chains = [
2929
token: 'ETH',
3030
label: 'Base',
3131
rpcUrl: 'https://mainnet.base.org'
32+
},
33+
{
34+
id: '0xa4ec',
35+
token: 'ETH',
36+
label: 'Celo',
37+
rpcUrl: 'https://1rpc.io/celo'
3238
}
3339
]
3440

0 commit comments

Comments
 (0)