Skip to content

Commit 0260756

Browse files
authored
Merge pull request #1798 from blocknative/release/2.24.2
Release 2.24.2
2 parents 1b6df15 + da67b95 commit 0260756

File tree

46 files changed

+2060
-1742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2060
-1742
lines changed

docs/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@web3-onboard/blocto": "^2.0.0-alpha.1",
5353
"@web3-onboard/cede-store": "^2.0.2",
5454
"@web3-onboard/coinbase": "^2.2.4",
55-
"@web3-onboard/core": "^2.20.3-alpha.1",
55+
"@web3-onboard/core": "^2.20.4-alpha.1",
5656
"@web3-onboard/dcent": "^2.2.7",
5757
"@web3-onboard/enkrypt": "^2.0.4",
5858
"@web3-onboard/fortmatic": "^2.0.19",
@@ -64,20 +64,20 @@
6464
"@web3-onboard/injected-wallets": "^2.10.1",
6565
"@web3-onboard/keepkey": "^2.3.7",
6666
"@web3-onboard/keystone": "^2.3.7",
67-
"@web3-onboard/ledger": "^2.4.6",
67+
"@web3-onboard/ledger": "^2.5.0-alpha.1",
6868
"@web3-onboard/magic": "^2.1.7",
6969
"@web3-onboard/mew-wallet": "^2.0.4",
7070
"@web3-onboard/phantom": "^2.0.2",
7171
"@web3-onboard/portis": "^2.1.7",
7272
"@web3-onboard/sequence": "^2.0.8",
73-
"@web3-onboard/taho": "^2.0.4",
73+
"@web3-onboard/taho": "^2.0.5-alpha.1",
7474
"@web3-onboard/torus": "^2.2.5",
7575
"@web3-onboard/transaction-preview": "^2.0.8",
7676
"@web3-onboard/trezor": "^2.4.2",
7777
"@web3-onboard/trust": "^2.0.4",
78-
"@web3-onboard/uauth": "^2.0.5",
78+
"@web3-onboard/uauth": "^2.1.0-alpha.1",
7979
"@web3-onboard/venly": "^2.0.0",
80-
"@web3-onboard/walletconnect": "^2.3.9",
80+
"@web3-onboard/walletconnect": "^2.4.0-alpha.2",
8181
"@web3-onboard/web3auth": "^2.2.3",
8282
"@web3-onboard/xdefi": "^2.0.4",
8383
"@web3-onboard/zeal": "^2.0.4",

docs/src/lib/services/onboard.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const intiOnboard = async (theme) => {
6969
mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar']
7070
}
7171
})
72-
const ledger = ledgerModule()
72+
const ledger = ledgerModule({ projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5' })
7373
const keystone = keystoneModule()
7474
const keepkey = keepkeyModule()
7575
const gnosis = gnosisModule()
@@ -99,7 +99,8 @@ const intiOnboard = async (theme) => {
9999
const uauthOptions = {
100100
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
101101
redirectUri: 'http://localhost:8080/',
102-
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional'
102+
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional',
103+
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5'
103104
}
104105
const uauth = uauthModule(uauthOptions)
105106

docs/src/routes/docs/[...3]modules/[...1]core/+page.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This is the core package that contains all of the UI and logic to be able to sea
1919

2020
:::admonition type="tip"
2121
_note: Release 2.24.0 moves the default position of the account center from topRight to bottomRight. To reset your application to topRight, include the following when initializing onboard:_
22+
2223
```typescript
2324
accountCenter: {
2425
desktop: {
@@ -31,6 +32,7 @@ _note: Release 2.24.0 moves the default position of the account center from topR
3132
}
3233
}
3334
```
35+
3436
:::
3537

3638
## Install
@@ -279,6 +281,10 @@ type ConnectModalOptions = {
279281
* Defaults to `https://www.blocknative.com/blog/metamask-wont-connect-web3-wallet-troubleshooting`
280282
*/
281283
wheresMyWalletLink?: string
284+
/**
285+
* Hide the where is my wallet link notice displayed in the connect modal
286+
*/
287+
removeWhereIsMyWalletWarning?: boolean
282288
/**
283289
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
284290
* package has been added and passed into the web3-onboard initialization

docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,44 @@ npm install @web3-onboard/core @web3-onboard/ledger
2828
## Options
2929

3030
```typescript
31-
interface LedgerOptions {
31+
type LedgerOptionsWCv1 = {
32+
/**
33+
* @deprecated
34+
* Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available.
35+
* To use version 1 a custom bridge url will need to be provided.
36+
* Support will be completely remove from Web3-Onboard in the future
37+
*/
38+
walletConnectVersion?: 1
39+
enableDebugLogs?: boolean
3240
chainId?: number
3341
bridge?: string
3442
infuraId?: string
3543
rpc?: { [chainId: number]: string }
3644
}
45+
46+
type LedgerOptionsWCv2 = {
47+
walletConnectVersion: 2
48+
enableDebugLogs?: boolean
49+
/**
50+
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
51+
*/
52+
projectId: string
53+
/**
54+
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
55+
* Defaults to the chains provided within the web3-onboard init chain property
56+
*/
57+
requiredChains?: string[] | number[]
58+
requiredMethods?: string[]
59+
/**
60+
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
61+
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
62+
*/
63+
optionalMethods?: string[]
64+
requiredEvents?: string[]
65+
optionalEvents?: string[]
66+
}
67+
68+
type LedgerOptions = LedgerOptionsWCv1 | LedgerOptionsWCv2
3769
```
3870
3971
## Usage
@@ -42,7 +74,16 @@ interface LedgerOptions {
4274
import Onboard from '@web3-onboard/core'
4375
import ledgerModule from '@web3-onboard/ledger'
4476

45-
const ledger = ledgerModule()
77+
const ledger = ledgerModule({
78+
/**
79+
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
80+
*/
81+
projectId: 'abc123...',
82+
/**
83+
* Chains required to be supported by all wallets connecting to your DApp
84+
*/
85+
requiredChains: [1, 137]
86+
})
4687

4788
const onboard = Onboard({
4889
// ... other Onboard options

docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,49 @@ Follow the [Login Client Congifuration Docs](https://docs.unstoppabledomains.com
3232

3333
```typescript
3434
type UauthInitOptions = {
35-
clientID: string // required and will throw an error if not included: links dapp to Unstoppable Domains for customization
36-
redirectUri: string // required and will throw an error if not included: used for pop-up and callback redirection
37-
scope?: string // default = 'openid wallet'
38-
shouldLoginWithRedirect?: boolean // if true, redirects to your callback page
39-
bridge?: string // default = 'https://bridge.walletconnect.org'
40-
qrcodeModalOptions?: {
41-
mobileLinks: string[] // set the order and list of mobile linking wallets
42-
}
43-
connectFirstChainId?: boolean // if true, connects to the first network chain provided
35+
/**
36+
* Required and will throw an error if not included: links dapp to Unstoppable Domains for customization
37+
*/
38+
clientID: string
39+
/**
40+
* Required and will throw an error if not included: used for pop-up and callback redirection
41+
*/
42+
redirectUri: string
43+
/**
44+
* Optional string: Default = 'openid wallet'
45+
*/
46+
scope?: string
47+
/**
48+
* Optional boolean: If true, redirects to your callback page
49+
*/
50+
shouldLoginWithRedirect?: boolean
51+
/**
52+
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
53+
*/
54+
walletConnectProjectId: string
55+
/**
56+
* Defaults to version: 2
57+
*/
58+
version?: 2
59+
/**
60+
* List of Required Chain(s) ID for wallets to support in number format (integer or hex)
61+
* Defaults to [1] - Ethereum
62+
*/
63+
requiredChains?: number[] | undefined
64+
/**
65+
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
66+
* Defaults to the chains provided within the web3-onboard init chain property
67+
*/
68+
optionalChains?: number[] | undefined
69+
/**
70+
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
71+
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
72+
*/
73+
additionalOptionalMethods?: string[] | undefined
74+
/**
75+
* Optional function to handle WalletConnect URI when it becomes available
76+
*/
77+
handleUri?: (uri: string) => Promise<unknown>
4478
}
4579
```
4680
@@ -52,21 +86,18 @@ import uauthModule from '@web3-onboard/uauth'
5286

5387
// initialize the module with options
5488
const uauth = uauthModule({
55-
clientID: 'YOUR_CLIENT_ID',
56-
redirectUri: 'YOUR_REDIRECT_URI',
57-
scope?: 'YOUR_SCOPES',
58-
shouldLoginWithRedirect?: false
59-
bridge?: 'YOUR_CUSTOM_BRIDGE_SERVER',
60-
qrcodeModalOptions?: {
61-
mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar']
62-
},
63-
connectFirstChainId?: true
89+
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
90+
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
91+
redirectUri: 'http://localhost:8080/',
92+
scope:
93+
'openid wallet email:optional humanity_check:optional profile:optional social:optional'
6494
})
6595

6696
// can also initialize with basic options...
6797
// const uauth = uauthModule({
6898
// clientID: "YOUR_CLIENT_ID",
69-
// redirectUri: "YOUR_REDIRECT_URI"
99+
// redirectUri: "YOUR_REDIRECT_URI",
100+
// walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
70101
// })
71102

72103
const onboard = Onboard({

docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: WalletConnect
77
Wallet module for connecting WalletConnect to web3-onboard, currently supporting both v1 and v2.
88

99
:::admonition type=warning
10-
_Not all Wallets support WalletConnect V2 currently. For an up to date list please see the [WalletConnect Explorer](https://explorer.walletconnect.com/?version=2)_
10+
_Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available. Upgrading to use WalletConnect v2 is recommended. Support will be completely removed from Web3-Onboard in the future_
1111
:::
1212

1313
## Install
@@ -33,42 +33,59 @@ npm install @web3-onboard/walletconnect
3333

3434
```typescript
3535
type WalletConnectOptions = {
36-
bridge?: string // default = 'https://bridge.walletconnect.org'
37-
qrcodeModalOptions?: {
38-
mobileLinks: string[] // set the order and list of mobile linking wallets
39-
}
40-
connectFirstChainId?: boolean // if true, connects to the first network chain provided
4136
/**
4237
* Optional function to handle WalletConnect URI when it becomes available
4338
*/
4439
handleUri?: (uri: string) => Promise<unknown>
4540
} & (
4641
| {
4742
/**
48-
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
43+
* @deprecated
44+
* Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available.
45+
* To use version 1 a custom bridge url will need to be provided.
46+
* Support will be completely remove from Web3-Onboard in the future
4947
*/
50-
version?: 1
48+
version: 1
49+
/**
50+
* Custom URL Bridge must be defined for V1 usage.
51+
* WalletConnect no longer supports a v1 bridge.
52+
* Upgrading to use WalletConnect v2 is recommended.
53+
* A potential bridge can be found here: 'https://derelay.rabby.io'
54+
*/
55+
bridge: string
56+
connectFirstChainId?: boolean
57+
qrcodeModalOptions?: {
58+
mobileLinks: string[]
59+
}
5160
}
5261
| {
5362
/**
5463
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
5564
*/
5665
projectId: string
5766
/**
58-
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
67+
* Defaults to version: 2
5968
*/
60-
version: 2
69+
version?: 2
6170
/**
6271
* List of Required Chain(s) ID for wallets to support in number format (integer or hex)
6372
* Defaults to [1] - Ethereum
64-
* The chains defined within the web3-onboard config will define the
65-
* optional chains for the WalletConnect module
6673
*/
6774
requiredChains?: number[] | undefined
75+
/**
76+
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
77+
* Defaults to the chains provided within the web3-onboard init chain property
78+
*/
79+
optionalChains?: number[] | undefined
6880
/**
6981
* `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
7082
*/
7183
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
84+
/**
85+
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
86+
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
87+
*/
88+
additionalOptionalMethods?: string[] | undefined
7289
}
7390
)
7491
```
@@ -79,36 +96,23 @@ type WalletConnectOptions = {
7996
import Onboard from '@web3-onboard/core'
8097
import walletConnectModule from '@web3-onboard/walletconnect'
8198

82-
const wcV1InitOptions = {
83-
bridge: 'YOUR_CUSTOM_BRIDGE_SERVER',
84-
qrcodeModalOptions: {
85-
mobileLinks: ['metamask', 'argent', 'trust']
86-
},
87-
connectFirstChainId: true
88-
}
89-
9099
const wcV2InitOptions = {
91-
version: 2,
92100
/**
93101
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
94102
*/
95103
projectId: 'abc123...',
96-
/**
97-
* Optional function to handle WalletConnect URI when it becomes available
98-
*/
99-
handleUri: (uri) => console.log(uri),
100104
/**
101105
* Chains required to be supported by all wallets connecting to your DApp
102106
*/
103107
requiredChains: [1, 56]
104108
}
105109

106110
// initialize the module with options
107-
// If version isn't set it will default to V1 until V1 sunset
108-
const walletConnect = walletConnectModule(wcV2InitOptions || wcV1InitOptions)
111+
// If version isn't set it will default to V2 - V1 support will be completely removed shortly as it is deprecated
112+
const walletConnect = walletConnectModule(wcV2InitOptions)
109113

110114
// can also initialize with no options...
111-
// Defaults to V1 until V1 sunset
115+
// Defaults to V2 - V1 support will be completely removed shortly as it is deprecated
112116
// const walletConnect = walletConnectModule()
113117

114118
const onboard = Onboard({

0 commit comments

Comments
 (0)