Skip to content

Commit 9945944

Browse files
committed
Fix docs
1 parent 64e4832 commit 9945944

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Onboard V2
2-
3-
_NOTE: not currently ready for production use_
1+
# Web3-Onboard
42

53
## Features
64

@@ -14,15 +12,15 @@ _NOTE: not currently ready for production use_
1412

1513
Install the core Onboard library and the injected wallets module to support browser extension and mobile wallets:
1614

17-
`npm i @bn-onboard/core @bn-onboard/injected-wallets`
15+
`npm i @web3-onboard/core @web3-onboard/injected-wallets`
1816

19-
- [@bn-onboard/core Official NPM Documentation](https://www.npmjs.com/package/@bn-onboard/core)
17+
- [@web3-onboard/core Official NPM Documentation](https://www.npmjs.com/package/@web3-onboard/core)
2018

2119
Then initialize in your app:
2220

2321
```javascript
24-
import Onboard from '@bn-onboard/core'
25-
import injectedModule from '@bn-onboard/injected-wallets'
22+
import Onboard from '@web3-onboard/core'
23+
import injectedModule from '@web3-onboard/injected-wallets'
2624

2725
const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/<INFURA_KEY>'
2826

packages/core/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ A common UX pattern is to remember the wallet(s) that a user has previously conn
164164
You could enable this in your app by first syncing the `wallets` array to localStorage:
165165

166166
```javascript
167-
const walletsSub = onboard.selectState('wallets')
167+
const walletsSub = onboard.state.select('wallets')
168168
const { unsubscribe } = walletsSub.subscribe(wallets => {
169169
const connectedWallets = wallets.map(({ label }) => label)
170170
window.localStorage.setItem(
@@ -186,12 +186,12 @@ const previouslyConnectedWallets = JSON.parse(
186186

187187
if (previouslyConnectedWallets) {
188188
// Connect the most recently connected wallet (first in the array)
189-
await onboard.connectWallet(previouslyConnectedWallets[0])
189+
await onboard.connectWallet({ autoSelect: previouslyConnectedWallets[0] })
190190

191191
// OR - loop through and initiate connection for all previously connected wallets
192192
// note: This UX might not be great as the user may need to login to each wallet one after the other
193193
// for (walletLabel in previouslyConnectedWallets) {
194-
// await onboard.connectWallet(walletLabel)
194+
// await onboard.connectWallet({ autoSelect: walletLabel })
195195
// }
196196
}
197197
```
@@ -203,7 +203,7 @@ A wallet can be disconnected, which will cleanup any background operations the w
203203
```javascript
204204
// disconnect the first wallet in the wallets array
205205
const [primaryWallet] = onboard.state.get().wallets
206-
await onboard.disconnectWallet(primaryWallet.label)
206+
await onboard.disconnectWallet({ label: primaryWallet.label })
207207
```
208208

209209
The `disconnectWallet` method takes the `wallet.label` value and returns a `Promise` that resolves to the current state of the `wallets` array.

0 commit comments

Comments
 (0)