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
@@ -229,11 +232,10 @@ type ConnectModalOptions = {
229
232
*/
230
233
wheresMyWalletLink?:string
231
234
/**
232
-
* Define support for Unstoppable Domains resolutions
233
-
* after a user connects. Similar to ens, uns can be used for users who
234
-
* have minted an Unstoppable Domain and associated it with their wallet.
235
-
* ENS resolution takes precedent over UNS
236
-
* Defaults to false
235
+
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
236
+
* package has been added and passed into the web3-onboard initialization
237
+
* In this case remove the `@web3-onboard/unstoppable-resolution` package
238
+
* to remove unstoppableDomain resolution support
237
239
*/
238
240
disableUDResolution?:boolean
239
241
}
@@ -253,6 +255,29 @@ type i18nOptions = Record<Locale, i18n>
253
255
To see a list of all of the text values that can be internationalized or replaced, check out the [default en file](https://github.com/blocknative/web3-onboard/blob/develop/packages/core/src/i18n/en.json).
254
256
Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syntax/) for formatting under the hood.
255
257
258
+
For example, to update the connect interface language for Metamask, while giving a different message for other wallets, you can include the following:
259
+
260
+
```typescript
261
+
i18n: {
262
+
en: {
263
+
connect: {
264
+
connectingWallet: {
265
+
paragraph:"{wallet, select, MetaMask {{wallet} can only present one account, so connect just the one account you want.} other {Please connect to all of your accounts in {wallet}.}}"
266
+
}
267
+
}
268
+
}
269
+
}
270
+
```
271
+
272
+
MetaMask message:
273
+
<img src="{customConnect2}" alt="Web3-Onboard connect wallet modal with custom message"/>
274
+
275
+
All other wallets:
276
+
<img src="{customConnect1}" alt="Web3-Onboard connect wallet modal with custom message"/>
277
+
278
+
Default Message- with no i18n override:
279
+
<img src="{customConnectDefault}" alt="Web3-Onboard connect wallet modal with default message"/>
280
+
256
281
---
257
282
258
283
#### theme
@@ -429,7 +454,8 @@ unsubscribe()
429
454
```
430
455
431
456
##### **Notifications as Toast Messages**
432
-
The Notifications messages can also be used to send fully customized Dapp toast messages and updated. Check out the [customNotifications API docs for examples and code snippets](#customnotification)
457
+
458
+
The Notifications messages can also be used to send fully customized Dapp toast messages and updated. Check out the [customNotifications API docs for examples and code snippets](#customnotification)
433
459
434
460
```ts
435
461
typeNotifyOptions= {
@@ -640,6 +666,7 @@ const onboard = Onboard({
640
666
```
641
667
642
668
---
669
+
643
670
## Connecting a Wallet
644
671
645
672
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`.
@@ -1016,7 +1043,7 @@ The `customNotification` method also returns a `dismiss` method that is called w
1016
1043
1017
1044
#### **preflightNotifications**
1018
1045
1019
-
Notify can be used to deliver standard notifications along with preflight updates by passing a `PreflightNotificationsOptions` object to the `preflightNotifications` API action.
1046
+
Notify can be used to deliver standard notifications along with preflight updates by passing a `PreflightNotificationsOptions` object to the `preflightNotifications` API action.
This API call will return a promise that resolves to the transaction hash (if `sendTransaction` resolves the transaction hash and is successful), the internal notification id (if no `sendTransaction` function is provided) or return nothing if an error occurs or `sendTransaction` is not provided or doesn't resolve to a string.
1034
1061
1035
1062
Example:
1063
+
1036
1064
```typescript copy
1037
1065
const balanceValue =Object.values(balance)[0]
1038
1066
// if using ethers v6 this is:
@@ -1483,7 +1511,7 @@ module.exports = function override(config) {
0 commit comments