showQrModal
has been deprecated as WalletConnect’s Web3Modal is now rebranded as Reown’s AppKit. If you are looking to use this, please refer to the “Use with AppKit” section below.init
method and passing down the required arguments:
url
from metadata
matches your domain and subdomain. This will later be used by Verify API to confirm if your application has been verified or not.optionalChains
(optional namespaces) over chains
(required namespaces).chains
, methods
or events
will create a Required Namespaces object internally.optionalMethods
and optionalChains
default to the following methods and events: Read source code.rpcMap
is not defined it will fallback to Blockchain API RPCs. Keep in mind that Blockchain API supports a limited list of chains.init
method takes the following parameters:
Value | Description | Type | Required |
---|---|---|---|
projectId | Your project ID obtained from Reown Dashboard: https://dashboard.reown.com/ | string | true |
optionalChains | An array of the chain IDs you want to support. It is highly recommended to use “optionalChains” over “chains” for multi-chain dapps, ensuring compatibility with Smart Contract Wallets. | number[] | false |
optionalMethods | The Ethereum methods you want to support and send in the session proposal under the “optionalNamespaces” scope. If undefined, it defaults to all EIP-1193 compatible methods. | string[] | false |
optionalEvents | The Ethereum events you want to support and send in the session proposal under the “optionalNamespaces” scope. If undefined, it defaults to all EIP-1193 compatible events. | string[] | false |
rpcMap | An object whose keys are chain IDs and values are their RPC endpoints. | Record<number, string> | false |
metadata | Your application’s metadata. It is important to set the correct URL, as this will later be used by the Verify API to check if your domain has been verified. | Metadata | false |
qrModalOptions | An array of WalletConnectModal options. See WalletConnectModal options. | QrModalOptions | false |
chains | An array of required chain IDs you want to support. If the wallet does not support these chains, it will not be able to connect. Not recommended for multi-chain applications. | number[] | false |
methods | The required methods you want to support. Not recommended for multi-chain applications. | string[] | false |
events | The required events you want to support. Not recommended for multi-chain applications. | string[] | false |
display_uri
event and handle the URI yourself.
provider.session
object.
The session object includes the following properties, among others:
session.namespaces
is an object that contains the approved session data.chains
object is an optional parameter and may be undefined. Therefore, we encourage apps to obtain the approved chains from the session.accounts
object instead.session.peer.metadata
object contains the metadata of the connected wallet.session
object here.