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
+20-31Lines changed: 20 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,11 @@ type ConnectModalOptions = {
167
167
* Defaults to false
168
168
*/
169
169
disableClose?:boolean
170
+
/**If set to true, the last connected wallet will store in local storage.
171
+
* Then on init, onboard will try to reconnect to that wallet with
172
+
* no modals displayed
173
+
*/
174
+
autoConnectLastWallet?:boolean// defaults to false
170
175
}
171
176
```
172
177
@@ -482,40 +487,16 @@ connectWallet()
482
487
483
488
### Auto Selecting a Wallet
484
489
485
-
A common UX pattern is to remember the wallet(s) that a user has previously connected by storing them in localStorage and then automatically selecting them for the user next time they visit your app.
486
-
You could enable this in your app by first syncing the `wallets` array to localStorage:
490
+
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.
491
+
You can enable this in your app by using the `autoConnectLastWallet` parameter when initializing and Onboard will take care of it:
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.
// The transaction will automatically be picked up and simulated with a UI displaying in the upper right corner
74
73
```
75
74
75
+
### Standalone Usage
76
+
77
+
78
+
To use the Transaction Preview package without web3-onboard all a developer needs to do is:
79
+
- Execute the entry function from the `@web3-onboard/transaction-preview` package and optional params
80
+
- Run the returned `init` function with their [Blocknative API key](https://onboard.blocknative.com/docs/overview/introduction#optional-use-an-api-key-to-fetch-real-time-transaction-data-balances-gas), an initialized instance of their [Blocknative SDK](https://www.npmjs.com/package/bnc-sdk) and a containerElement string with the html ID of the target element to append the visualization to
81
+
- Finally pass a transaction meant for a wallet provider (created using libraries like Ethers or Web3)
82
+
83
+
With the above steps a UI will be rendered with the balance changes and gas used.
0 commit comments