Skip to content

Commit 4a3655d

Browse files
committed
Merge branch 'add_stablewallet' of github.com:mathwallet/web3-onboard into add_stablewallet
2 parents eafb72b + b7454bd commit 4a3655d

File tree

38 files changed

+3919
-950
lines changed

38 files changed

+3919
-950
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Nodejs and yarn
4141
uses: actions/setup-node@v2
4242
with:
43-
node-version: "16"
43+
node-version: "18.18"
4444
cache: yarn
4545

4646
- name: Install dependencies

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"tslib": "^2.4.1",
4747
"typescript": "^5.0.4",
4848
"unplugin-icons": "^0.14.0",
49-
"vite": "^4.5.0"
49+
"vite": "^4.5.3"
5050
},
5151
"type": "module",
5252
"dependencies": {
@@ -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",
6262
"@web3-onboard/dcent": "^2.2.7",
6363
"@web3-onboard/enkrypt": "^2.0.4",
6464
"@web3-onboard/fortmatic": "^2.0.19",
@@ -72,7 +72,7 @@
7272
"@web3-onboard/keystone": "^2.3.7",
7373
"@web3-onboard/ledger": "^2.6.0",
7474
"@web3-onboard/magic": "^2.1.7",
75-
"@web3-onboard/metamask": "^2.0.3",
75+
"@web3-onboard/metamask": "^2.0.4-alpha.1",
7676
"@web3-onboard/mew-wallet": "^2.0.4",
7777
"@web3-onboard/phantom": "^2.0.3",
7878
"@web3-onboard/portis": "^2.1.7",

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)

docs/yarn.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,10 +3212,10 @@
32123212
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-3.0.0.tgz#8c2b9073fe0722d48693143b0dc8448840daa3bd"
32133213
integrity sha512-j6Z47VOmVyGMlnKXZmL0fyvWfEYtKWCA9yGZkU3FCsGZUT5lHGmvaV9JA5F2Y+010y7+ROtR3WMXIkvl/nVzqQ==
32143214

3215-
"@metamask/sdk-communication-layer@0.17.0":
3216-
version "0.17.0"
3217-
resolved "https://registry.yarnpkg.com/@metamask/sdk-communication-layer/-/sdk-communication-layer-0.17.0.tgz#890dbcdc983be32fdd9600cc996ede00cc2090fc"
3218-
integrity sha512-au1HzkU4VxAWjIvGGhvv/yPlB+x4jEi70c/GpjhHgJ7EG8TJprYy9jAOxfzc8h7hXRzOA8PCkFMzJu5COrJCYA==
3215+
"@metamask/sdk-communication-layer@0.18.2":
3216+
version "0.18.2"
3217+
resolved "https://registry.yarnpkg.com/@metamask/sdk-communication-layer/-/sdk-communication-layer-0.18.2.tgz#f7cf48a6938890397f39386bcfc82c8b967b7652"
3218+
integrity sha512-5Hf2K+v3PWjmk+yxl9C2UXc7bMp77tBu3nUvZrpETB+bJ5y5rsKSe8Tkz7EFTobP+Xp6zUmqkSGmw24kO+Qqag==
32193219
dependencies:
32203220
bufferutil "^4.0.8"
32213221
date-fns "^2.29.3"
@@ -3230,14 +3230,14 @@
32303230
dependencies:
32313231
qr-code-styling "^1.6.0-rc.1"
32323232

3233-
"@metamask/sdk@^0.17.1":
3234-
version "0.17.2"
3235-
resolved "https://registry.yarnpkg.com/@metamask/sdk/-/sdk-0.17.2.tgz#047e08a6a6460ca84efcfd2ebd477a83ba34c38a"
3236-
integrity sha512-5DkeywTJLf2BLCQ2aa2D7bIcoAc/107uFXlDA/1lpCnbWc9ZHloFomdu3d1e3dRegqCOzDGuJjOA+dPonDQZZw==
3233+
"@metamask/sdk@^0.18.2":
3234+
version "0.18.2"
3235+
resolved "https://registry.yarnpkg.com/@metamask/sdk/-/sdk-0.18.2.tgz#3ecbbe62530de0046fb885e70e3de9f6ce6b641a"
3236+
integrity sha512-iLiadHCDNxPKjOEjVxmhawLm6NdRW+2Cf1mnvQgHk/xueZysruZcwd1cpV63Eya5KfGl5T7fJNUwKur5zCY05g==
32373237
dependencies:
32383238
"@metamask/onboarding" "^1.0.1"
32393239
"@metamask/providers" "^15.0.0"
3240-
"@metamask/sdk-communication-layer" "0.17.0"
3240+
"@metamask/sdk-communication-layer" "0.18.2"
32413241
"@metamask/sdk-install-modal-web" "0.17.0"
32423242
"@types/dom-screen-wake-lock" "^1.0.0"
32433243
bowser "^2.9.0"
@@ -5907,10 +5907,10 @@
59075907
ethers "5.5.4"
59085908
joi "17.9.1"
59095909

5910-
"@web3-onboard/core@^2.21.3":
5911-
version "2.21.3"
5912-
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.3.tgz#12f1561da218bae9d9d4c48cd132fa6ebaf4beca"
5913-
integrity sha512-PVQtsk5eLHNIxrLqjEtbF+w8yDxovTmgIQobrJj0D4m3wZE0Cr7AQay1q5u+bC1FKmTvQ7ZVzEXMFdquPxjA2A==
5910+
"@web3-onboard/core@^2.21.4":
5911+
version "2.21.4"
5912+
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.21.4.tgz#0bf80a30c32f5fd8d5330cda4b6c6729c40ca316"
5913+
integrity sha512-+nOKj3hudHXfS5J8Ej5P5v/NWuG1b/863Ikaob/UHsCrulle5ILmBNrJqs2LESLdbHjZPFQBoJG+IxTPo7yIAA==
59145914
dependencies:
59155915
"@web3-onboard/common" "^2.3.4"
59165916
bignumber.js "^9.0.0"
@@ -6004,9 +6004,9 @@
60046004
"@infinitywallet/infinity-connector" "^1.0.6"
60056005

60066006
"@web3-onboard/injected-wallets@^2.10.13":
6007-
version "2.10.13-alpha.1"
6008-
resolved "https://registry.yarnpkg.com/@web3-onboard/injected-wallets/-/injected-wallets-2.10.13-alpha.1.tgz#6e7c54e242079d621ddd0c5aa79eec4ff5df8e5b"
6009-
integrity sha512-yBPt+25q6e3L3QbL8gxlGinhABVMRsaLMmpraAH+dfkRDxwrsvINcfrkZAOJu5K4ZOr1u9S3HUxd3bz5Eq8IPw==
6007+
version "2.10.14"
6008+
resolved "https://registry.yarnpkg.com/@web3-onboard/injected-wallets/-/injected-wallets-2.10.14.tgz#ad4f7585927651050caec232a62774f422fb9c01"
6009+
integrity sha512-lU/YCCYNr7+Qgg1lJ1vQofmJhMPZrkRTYO0lgkGsmLFVWZZ4rJIU1dm31h5iHm4nVUbw3ItYDICKsI1NgX46AQ==
60106010
dependencies:
60116011
"@web3-onboard/common" "^2.3.3"
60126012
joi "17.9.1"
@@ -6058,12 +6058,12 @@
60586058
magic-sdk "^8.1.0"
60596059
rxjs "^7.5.2"
60606060

6061-
"@web3-onboard/metamask@^2.0.3":
6062-
version "2.0.3"
6063-
resolved "https://registry.yarnpkg.com/@web3-onboard/metamask/-/metamask-2.0.3.tgz#ea9ef80e90700134f99f7f0a8667ca6c3dad8775"
6064-
integrity sha512-kf+4jMtJfokSFNhOyV1WxOGtmvibUK58Lho+6cvDFGSzmFQ+q+U5jK9gWMm2gkb5+l70UibUHqVCrHPFdgey+w==
6061+
"@web3-onboard/metamask@^2.0.4-alpha.1":
6062+
version "2.0.4-alpha.1"
6063+
resolved "https://registry.yarnpkg.com/@web3-onboard/metamask/-/metamask-2.0.4-alpha.1.tgz#82a2c38642ceca806ef9e336cb3f14fce4815d56"
6064+
integrity sha512-CF/ue+zYSm3Qz4rJaBRrfk6jqrity/rG/H+JOcZ5ajZPeCUm9T4O7W3bFvZtwmaoIE0WQVxzOWqRCzpVSgP79A==
60656065
dependencies:
6066-
"@metamask/sdk" "^0.17.1"
6066+
"@metamask/sdk" "^0.18.2"
60676067
"@web3-onboard/common" "^2.3.3"
60686068

60696069
"@web3-onboard/mew-wallet@^2.0.4":
@@ -13285,10 +13285,10 @@ viem@^1.0.0:
1328513285
isomorphic-ws "5.0.0"
1328613286
ws "8.12.0"
1328713287

13288-
vite@^4.5.0:
13289-
version "4.5.0"
13290-
resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.0.tgz#ec406295b4167ac3bc23e26f9c8ff559287cff26"
13291-
integrity sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==
13288+
vite@^4.5.3:
13289+
version "4.5.3"
13290+
resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a"
13291+
integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==
1329213292
dependencies:
1329313293
esbuild "^0.18.10"
1329413294
postcss "^8.4.27"

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/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"solid-js": "^1.7.8"
1313
},
1414
"devDependencies": {
15-
"vite": "^4.4.5",
15+
"vite": "^4.5.3",
1616
"vite-plugin-solid": "^2.7.0"
1717
}
1818
}

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-solidjs/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,10 +758,10 @@ vite-plugin-solid@^2.7.0:
758758
solid-refresh "^0.5.3"
759759
vitefu "^0.2.4"
760760

761-
vite@^4.4.5:
762-
version "4.4.11"
763-
resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.11.tgz#babdb055b08c69cfc4c468072a2e6c9ca62102b0"
764-
integrity sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==
761+
vite@^4.5.3:
762+
version "4.5.3"
763+
resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a"
764+
integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==
765765
dependencies:
766766
esbuild "^0.18.10"
767767
postcss "^8.4.27"

examples/with-sveltekit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"svelte-preprocess": "^5.0.1",
2828
"tslib": "^2.5.0",
2929
"typescript": "^4.9.5",
30-
"vite": "^4.0.5"
30+
"vite": "^4.5.3"
3131
},
3232
"type": "module",
3333
"dependencies": {
3434
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
3535
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
3636
"@fontsource/fira-mono": "^4.5.10",
3737
"@rollup/plugin-commonjs": "^25.0.7",
38-
"@web3-onboard/core": "^2.21.3-alpha.1",
38+
"@web3-onboard/core": "^2.21.4",
3939
"@web3-onboard/injected-wallets": "^2.8.5",
4040
"@web3-onboard/walletconnect": "^2.3.6",
4141
"assert": "^2.1.0",

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

0 commit comments

Comments
 (0)