Skip to content

Commit

Permalink
Merge pull request #1800 from blocknative/release/2.24.2
Browse files Browse the repository at this point in the history
Release 2.24.2 (docs)
  • Loading branch information
Adamj1232 committed Jun 29, 2023
2 parents 346bdba + da67b95 commit 113ee49
Show file tree
Hide file tree
Showing 46 changed files with 2,052 additions and 1,734 deletions.
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@web3-onboard/blocto": "^2.0.0-alpha.1",
"@web3-onboard/cede-store": "^2.0.2",
"@web3-onboard/coinbase": "^2.2.4",
"@web3-onboard/core": "^2.20.3-alpha.1",
"@web3-onboard/core": "^2.20.4-alpha.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.4",
"@web3-onboard/fortmatic": "^2.0.19",
Expand All @@ -64,20 +64,20 @@
"@web3-onboard/injected-wallets": "^2.10.1",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.4.6",
"@web3-onboard/ledger": "^2.5.0-alpha.1",
"@web3-onboard/magic": "^2.1.7",
"@web3-onboard/mew-wallet": "^2.0.4",
"@web3-onboard/phantom": "^2.0.2",
"@web3-onboard/portis": "^2.1.7",
"@web3-onboard/sequence": "^2.0.8",
"@web3-onboard/taho": "^2.0.4",
"@web3-onboard/taho": "^2.0.5-alpha.1",
"@web3-onboard/torus": "^2.2.5",
"@web3-onboard/transaction-preview": "^2.0.8",
"@web3-onboard/trezor": "^2.4.2",
"@web3-onboard/trust": "^2.0.4",
"@web3-onboard/uauth": "^2.0.5",
"@web3-onboard/uauth": "^2.1.0-alpha.1",
"@web3-onboard/venly": "^2.0.0",
"@web3-onboard/walletconnect": "^2.3.9",
"@web3-onboard/walletconnect": "^2.4.0-alpha.2",
"@web3-onboard/web3auth": "^2.2.3",
"@web3-onboard/xdefi": "^2.0.4",
"@web3-onboard/zeal": "^2.0.4",
Expand Down
5 changes: 3 additions & 2 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const intiOnboard = async (theme) => {
mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar']
}
})
const ledger = ledgerModule()
const ledger = ledgerModule({ projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5' })
const keystone = keystoneModule()
const keepkey = keepkeyModule()
const gnosis = gnosisModule()
Expand Down Expand Up @@ -99,7 +99,8 @@ const intiOnboard = async (theme) => {
const uauthOptions = {
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
redirectUri: 'http://localhost:8080/',
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional'
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional',
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5'
}
const uauth = uauthModule(uauthOptions)

Expand Down
6 changes: 6 additions & 0 deletions docs/src/routes/docs/[...3]modules/[...1]core/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This is the core package that contains all of the UI and logic to be able to sea

:::admonition type="tip"
_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:_

```typescript
accountCenter: {
desktop: {
Expand All @@ -31,6 +32,7 @@ _note: Release 2.24.0 moves the default position of the account center from topR
}
}
```

:::

## Install
Expand Down Expand Up @@ -279,6 +281,10 @@ type ConnectModalOptions = {
* Defaults to `https://www.blocknative.com/blog/metamask-wont-connect-web3-wallet-troubleshooting`
*/
wheresMyWalletLink?: string
/**
* Hide the where is my wallet link notice displayed in the connect modal
*/
removeWhereIsMyWalletWarning?: boolean
/**
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
* package has been added and passed into the web3-onboard initialization
Expand Down
45 changes: 43 additions & 2 deletions docs/src/routes/docs/[...4]wallets/[...13]ledger/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,44 @@ npm install @web3-onboard/core @web3-onboard/ledger
## Options

```typescript
interface LedgerOptions {
type LedgerOptionsWCv1 = {
/**
* @deprecated
* Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available.
* To use version 1 a custom bridge url will need to be provided.
* Support will be completely remove from Web3-Onboard in the future
*/
walletConnectVersion?: 1
enableDebugLogs?: boolean
chainId?: number
bridge?: string
infuraId?: string
rpc?: { [chainId: number]: string }
}

type LedgerOptionsWCv2 = {
walletConnectVersion: 2
enableDebugLogs?: boolean
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: string
/**
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
* Defaults to the chains provided within the web3-onboard init chain property
*/
requiredChains?: string[] | number[]
requiredMethods?: string[]
/**
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
optionalMethods?: string[]
requiredEvents?: string[]
optionalEvents?: string[]
}

type LedgerOptions = LedgerOptionsWCv1 | LedgerOptionsWCv2
```
## Usage
Expand All @@ -42,7 +74,16 @@ interface LedgerOptions {
import Onboard from '@web3-onboard/core'
import ledgerModule from '@web3-onboard/ledger'

const ledger = ledgerModule()
const ledger = ledgerModule({
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: 'abc123...',
/**
* Chains required to be supported by all wallets connecting to your DApp
*/
requiredChains: [1, 137]
})

const onboard = Onboard({
// ... other Onboard options
Expand Down
69 changes: 50 additions & 19 deletions docs/src/routes/docs/[...4]wallets/[...23]uauth/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,49 @@ Follow the [Login Client Congifuration Docs](https://docs.unstoppabledomains.com

```typescript
type UauthInitOptions = {
clientID: string // required and will throw an error if not included: links dapp to Unstoppable Domains for customization
redirectUri: string // required and will throw an error if not included: used for pop-up and callback redirection
scope?: string // default = 'openid wallet'
shouldLoginWithRedirect?: boolean // if true, redirects to your callback page
bridge?: string // default = 'https://bridge.walletconnect.org'
qrcodeModalOptions?: {
mobileLinks: string[] // set the order and list of mobile linking wallets
}
connectFirstChainId?: boolean // if true, connects to the first network chain provided
/**
* Required and will throw an error if not included: links dapp to Unstoppable Domains for customization
*/
clientID: string
/**
* Required and will throw an error if not included: used for pop-up and callback redirection
*/
redirectUri: string
/**
* Optional string: Default = 'openid wallet'
*/
scope?: string
/**
* Optional boolean: If true, redirects to your callback page
*/
shouldLoginWithRedirect?: boolean
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
walletConnectProjectId: string
/**
* Defaults to version: 2
*/
version?: 2
/**
* List of Required Chain(s) ID for wallets to support in number format (integer or hex)
* Defaults to [1] - Ethereum
*/
requiredChains?: number[] | undefined
/**
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
* Defaults to the chains provided within the web3-onboard init chain property
*/
optionalChains?: number[] | undefined
/**
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
additionalOptionalMethods?: string[] | undefined
/**
* Optional function to handle WalletConnect URI when it becomes available
*/
handleUri?: (uri: string) => Promise<unknown>
}
```
Expand All @@ -52,21 +86,18 @@ import uauthModule from '@web3-onboard/uauth'

// initialize the module with options
const uauth = uauthModule({
clientID: 'YOUR_CLIENT_ID',
redirectUri: 'YOUR_REDIRECT_URI',
scope?: 'YOUR_SCOPES',
shouldLoginWithRedirect?: false
bridge?: 'YOUR_CUSTOM_BRIDGE_SERVER',
qrcodeModalOptions?: {
mobileLinks: ['rainbow', 'metamask', 'argent', 'trust', 'imtoken', 'pillar']
},
connectFirstChainId?: true
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
redirectUri: 'http://localhost:8080/',
scope:
'openid wallet email:optional humanity_check:optional profile:optional social:optional'
})

// can also initialize with basic options...
// const uauth = uauthModule({
// clientID: "YOUR_CLIENT_ID",
// redirectUri: "YOUR_REDIRECT_URI"
// redirectUri: "YOUR_REDIRECT_URI",
// walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
// })

const onboard = Onboard({
Expand Down
60 changes: 32 additions & 28 deletions docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: WalletConnect
Wallet module for connecting WalletConnect to web3-onboard, currently supporting both v1 and v2.

:::admonition type=warning
_Not all Wallets support WalletConnect V2 currently. For an up to date list please see the [WalletConnect Explorer](https://explorer.walletconnect.com/?version=2)_
_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_
:::

## Install
Expand All @@ -33,42 +33,59 @@ npm install @web3-onboard/walletconnect

```typescript
type WalletConnectOptions = {
bridge?: string // default = 'https://bridge.walletconnect.org'
qrcodeModalOptions?: {
mobileLinks: string[] // set the order and list of mobile linking wallets
}
connectFirstChainId?: boolean // if true, connects to the first network chain provided
/**
* Optional function to handle WalletConnect URI when it becomes available
*/
handleUri?: (uri: string) => Promise<unknown>
} & (
| {
/**
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
* @deprecated
* Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available.
* To use version 1 a custom bridge url will need to be provided.
* Support will be completely remove from Web3-Onboard in the future
*/
version?: 1
version: 1
/**
* Custom URL Bridge must be defined for V1 usage.
* WalletConnect no longer supports a v1 bridge.
* Upgrading to use WalletConnect v2 is recommended.
* A potential bridge can be found here: 'https://derelay.rabby.io'
*/
bridge: string
connectFirstChainId?: boolean
qrcodeModalOptions?: {
mobileLinks: string[]
}
}
| {
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: string
/**
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
* Defaults to version: 2
*/
version: 2
version?: 2
/**
* List of Required Chain(s) ID for wallets to support in number format (integer or hex)
* Defaults to [1] - Ethereum
* The chains defined within the web3-onboard config will define the
* optional chains for the WalletConnect module
*/
requiredChains?: number[] | undefined
/**
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
* Defaults to the chains provided within the web3-onboard init chain property
*/
optionalChains?: number[] | undefined
/**
* `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
/**
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4']
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
additionalOptionalMethods?: string[] | undefined
}
)
```
Expand All @@ -79,36 +96,23 @@ type WalletConnectOptions = {
import Onboard from '@web3-onboard/core'
import walletConnectModule from '@web3-onboard/walletconnect'

const wcV1InitOptions = {
bridge: 'YOUR_CUSTOM_BRIDGE_SERVER',
qrcodeModalOptions: {
mobileLinks: ['metamask', 'argent', 'trust']
},
connectFirstChainId: true
}

const wcV2InitOptions = {
version: 2,
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: 'abc123...',
/**
* Optional function to handle WalletConnect URI when it becomes available
*/
handleUri: (uri) => console.log(uri),
/**
* Chains required to be supported by all wallets connecting to your DApp
*/
requiredChains: [1, 56]
}

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

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

const onboard = Onboard({
Expand Down
Loading

1 comment on commit 113ee49

@vercel
Copy link

@vercel vercel bot commented on 113ee49 Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.