Skip to content

Commit 2ab62a6

Browse files
authored
Merge pull request #1386 from blocknative/docs_add_uauth
Add UAuth(unstoppable domains), Enkrypt, Mew-wallet & Mew deprecation notice
2 parents d73ff44 + 34ffcc6 commit 2ab62a6

File tree

4 files changed

+182
-0
lines changed

4 files changed

+182
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Enkrypt
2+
3+
Wallet module for connecting Enkrypt wallet through web3-onboard
4+
5+
### Install
6+
7+
<Tabs values={['yarn', 'npm']}>
8+
<TabPanel value="yarn">
9+
10+
```sh copy
11+
yarn add @web3-onboard/enkrypt
12+
```
13+
14+
</TabPanel>
15+
<TabPanel value="npm">
16+
17+
```sh copy
18+
npm install @web3-onboard/enkrypt
19+
```
20+
21+
</TabPanel>
22+
</Tabs>
23+
24+
## Usage
25+
26+
```typescript
27+
import Onboard from '@web3-onboard/core'
28+
import enrkypt from '@web3-onboard/enkrypt'
29+
30+
const enrkyptModule = enrkypt()
31+
32+
const onboard = Onboard({
33+
// ... other Onboard options
34+
wallets: [
35+
enrkyptModule
36+
//... other wallets
37+
]
38+
})
39+
40+
const connectedWallets = await onboard.connectWallet()
41+
console.log(connectedWallets)
42+
```

docs/src/routes/docs/[...4]wallets/mew.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Mew
22

3+
:::admonition type=warning
4+
_Wallet module for connecting Mew to web3-onboard is now deprecated. Please use [@web3-onboard/mew-wallet](./mew-wallet.md)_
5+
:::
6+
37
Wallet module for connecting Mew wallet to web3-onboard
48

59
## Install
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Mew Wallet
2+
3+
Wallet module for connecting Mew wallet through web3-onboard
4+
5+
### Install
6+
7+
<Tabs values={['yarn', 'npm']}>
8+
<TabPanel value="yarn">
9+
10+
```sh copy
11+
yarn add @web3-onboard/mew-wallet
12+
```
13+
14+
</TabPanel>
15+
<TabPanel value="npm">
16+
17+
```sh copy
18+
npm install @web3-onboard/mew-wallet
19+
```
20+
21+
</TabPanel>
22+
</Tabs>
23+
24+
## Usage
25+
26+
```typescript
27+
import Onboard from '@web3-onboard/core'
28+
import mewWallet from '@web3-onboard/mew-wallet'
29+
30+
const mewWalletModule = mewWallet()
31+
32+
const onboard = Onboard({
33+
// ... other Onboard options
34+
wallets: [
35+
mewWalletModule
36+
//... other wallets
37+
]
38+
})
39+
40+
const connectedWallets = await onboard.connectWallet()
41+
console.log(connectedWallets)
42+
```
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# UAuth
2+
3+
Wallet module for connecting Unstoppable Domains to web3-onboard
4+
5+
### Install
6+
7+
<Tabs values={['yarn', 'npm']}>
8+
<TabPanel value="yarn">
9+
10+
```sh copy
11+
yarn add @web3-onboard/uauth
12+
```
13+
14+
</TabPanel>
15+
<TabPanel value="npm">
16+
17+
```sh copy
18+
npm install @web3-onboard/uauth
19+
```
20+
21+
</TabPanel>
22+
</Tabs>
23+
24+
## Options
25+
26+
Follow the [Login Client Congifuration Docs](https://docs.unstoppabledomains.com/login-with-unstoppable/login-integration-guides/login-client-configuration/) on the Unstoppable Domains website to get setup with your clientID and redirectUri.
27+
**Note:** The Redirection URI value(s) in the client configuration MUST exactly match the redirect_uri parameter value used in `UauthInitOptions`. More specifics can be found in the [Rules for Redirect URIs Docs](https://docs.unstoppabledomains.com/login-with-unstoppable/login-integration-guides/login-client-configuration/#rules-for-redirect-uris).
28+
29+
```typescript
30+
type UauthInitOptions = {
31+
clientID: string // required and will throw an error if not included: links dapp to Unstoppable Domains for customization
32+
redirectUri: string // required and will throw an error if not included: used for pop-up and callback redirection
33+
scope?: string // default = 'openid wallet'
34+
shouldLoginWithRedirect?: boolean // if true, redirects to your callback page
35+
bridge?: string // default = 'https://bridge.walletconnect.org'
36+
qrcodeModalOptions?: {
37+
mobileLinks: string[] // set the order and list of mobile linking wallets
38+
}
39+
connectFirstChainId?: boolean // if true, connects to the first network chain provided
40+
}
41+
```
42+
43+
## Usage
44+
45+
```typescript
46+
import Onboard from '@web3-onboard/core'
47+
import uauthModule from '@web3-onboard/uauth'
48+
49+
// initialize the module with options
50+
const uauth = uauthModule({
51+
clientID: 'YOUR_CLIENT_ID',
52+
redirectUri: 'YOUR_REDIRECT_URI',
53+
scope?: 'YOUR_SCOPES',
54+
shouldLoginWithRedirect?: false
55+
bridge?: 'YOUR_CUSTOM_BRIDGE_SERVER',
56+
qrcodeModalOptions?: {
57+
mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar']
58+
},
59+
connectFirstChainId?: true
60+
})
61+
62+
// can also initialize with basic options...
63+
// const uauth = uauthModule({
64+
// clientID: "YOUR_CLIENT_ID",
65+
// redirectUri: "YOUR_REDIRECT_URI"
66+
// })
67+
68+
const onboard = Onboard({
69+
// ... other Onboard options
70+
wallets: [
71+
uauth
72+
//... other wallets
73+
]
74+
})
75+
76+
const connectedWallets = await onboard.connectWallet()
77+
console.log(connectedWallets)
78+
```
79+
80+
### Accessing the UAuth configuration
81+
82+
When Unstoppable Domains is connected the UAuth user instance is exposed.
83+
This can be used to get information related to the user scopes requested through the `UauthInitOptions`.
84+
85+
```typescript
86+
const wallets$ = onboard.state.select('wallets').pipe(share())
87+
wallets$.subscribe((wallet) => {
88+
const unstoppableUser = wallet.find((provider) => provider.label === 'Unstoppable')
89+
if (unstoppableUser) {
90+
// This will allow insight into the approved user details
91+
console.log(unstoppableUser.instance.user)
92+
}
93+
})
94+
```

0 commit comments

Comments
 (0)