You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/routes/docs/[...3]modules/core.md
+26-17Lines changed: 26 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ npm install @web3-onboard/core
27
27
</TabPanel>
28
28
</Tabs>
29
29
30
+
#### All Wallet Modules
30
31
If you would like to support all wallets, then you can install all of the wallet modules:
31
32
32
33
<Tabs values={['yarn', 'npm']}>
@@ -95,16 +96,17 @@ type InitOptions {
95
96
}
96
97
97
98
```
99
+
---
98
100
99
-
### Options
100
-
101
-
#### **wallets**
101
+
#### wallets
102
102
103
-
An array of wallet modules that you would like to be presented to the user to select from when connecting a wallet. A wallet module is an abstraction that allows for easy interaction without needing to know the specifics of how that wallet works and are separate packages that can be included.
103
+
An array of wallet modules that you would like to be presented to the user to select from when connecting a wallet. A wallet module is an abstraction that allows for easy interaction without needing to know the specifics of how that wallet works and are separate packages that can be included.
104
+
These modules are separate @web3-onboard packages such as `@web3-onboard/injected-wallets` or `@web3-onboard/ledger`.
105
+
For a full list click [here](#all-wallet-modules).
104
106
105
107
---
106
108
107
-
#### **chains**
109
+
#### chains
108
110
109
111
An array of Chains that your app supports:
110
112
@@ -124,7 +126,7 @@ type Chain = {
124
126
125
127
---
126
128
127
-
#### **appMetadata**
129
+
#### appMetadata
128
130
129
131
An object that defines your app:
130
132
@@ -169,7 +171,7 @@ type RecommendedInjectedWallets = {
169
171
170
172
---
171
173
172
-
#### **connectModal**
174
+
#### connectModal
173
175
174
176
An object that allows for customizing the connect modal layout and behavior
175
177
@@ -208,7 +210,7 @@ type ConnectModalOptions = {
208
210
209
211
---
210
212
211
-
#### **i18n**
213
+
#### i18n
212
214
213
215
An object that defines the display text for different locales. Can also be used to override the default text. To override the default text, pass in an object for the `en` locale.
214
216
@@ -222,7 +224,7 @@ Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syn
222
224
223
225
---
224
226
225
-
#### **theme**
227
+
#### theme
226
228
227
229
A string or an object that defines the color theme web3-onboard will render the components.
228
230
@@ -266,7 +268,7 @@ It will allow you to customize the look and feel of web3-onboard, try different
266
268
267
269
---
268
270
269
-
#### **accountCenter**
271
+
#### accountCenter
270
272
271
273
An object that defines whether the account center UI (default and minimal) is enabled and its position on the screen. Currently the account center is enabled for both desktop and mobile devices.
An object mapping for W3O components with the key being the DOM element to mount the specified component to.
300
302
This defines the DOM container element for svelte to attach the component.
@@ -321,7 +323,7 @@ type ContainerElements = {
321
323
322
324
---
323
325
324
-
#### **`notify`**
326
+
#### notify
325
327
326
328
Notify provides by default transaction notifications for all connected wallets on the current blockchain. When switching chains the previous chain listeners remain active for 60 seconds to allow capture and report of remaining transactions that may be in flight.
327
329
By default transaction notifications are captured if a DAppID is provided in the Onboard config along with the Account Center being enabled.
@@ -458,6 +460,12 @@ const onboard = Onboard({
458
460
token: 'ARB-ETH',
459
461
label: 'Arbitrum',
460
462
rpcUrl: 'https://rpc.ankr.com/arbitrum'
463
+
},
464
+
{
465
+
id: 84531,
466
+
token: 'ETH',
467
+
label: 'Base Goerli',
468
+
rpcUrl: 'https://goerli.base.org'
461
469
}
462
470
],
463
471
appMetadata: {
@@ -1478,21 +1486,23 @@ export default config
1478
1486
1479
1487
If an error presents around `window` being undefined remove the `define.global` block.
1480
1488
Add this to your `app.html`
1489
+
1481
1490
```html
1482
1491
<script>
1483
-
varglobal=global||window
1492
+
varglobal=global||window
1484
1493
</script>
1485
1494
```
1486
1495
1487
1496
##### Buffer polyfill
1497
+
1488
1498
It seems some component or dependency requires Node's Buffer. To polyfill this, the simplest way I could find was to install the buffer package and include the following in web3-onboard.ts:
1489
1499
1490
1500
```javascript
1491
1501
import { Buffer } from'buffer'
1492
1502
globalThis.Buffer= Buffer
1493
1503
```
1494
-
See [this github issue](https://github.com/blocknative/web3-onboard/issues/1568#issuecomment-1463963462) for further troubleshooting
1495
1504
1505
+
See [this github issue](https://github.com/blocknative/web3-onboard/issues/1568#issuecomment-1463963462) for further troubleshooting
1496
1506
1497
1507
### Vite
1498
1508
@@ -1575,20 +1585,19 @@ Checkout a boilerplate example for NextJS v13 (here)[https://github.com/blocknat
1575
1585
1576
1586
Checkout a boilerplate example for NextJS (here)[https://github.com/blocknative/web3-onboard/tree/develop/examples/with-nextjs]
1577
1587
1578
-
1579
1588
:::admonition type=note
1580
1589
1581
1590
If you are seeing an error during builds when dynamically importing Web3Onboard in a NextJS v13 project, try upgrading to to the Canary beta release of NextJS where this issue is fixed.
1582
1591
1583
1592
:::
1584
1593
1585
-
1586
1594
## Package Managers
1587
1595
1588
1596
### npm and yarn
1589
1597
1590
1598
Web3-Onboard will work out of the box with `npm` and `yarn` support.
1591
1599
1592
1600
### pnpm
1601
+
1593
1602
We have had issues reported when using `pnpm` as the package manager when working with web3-onboard.
1594
-
As we work to understand this new manager more and the issues around it we recommend using `npm` or `yarn` for now.
1603
+
As we work to understand this new manager more and the issues around it we recommend using `npm` or `yarn` for now.
0 commit comments