Pre-requisites
This section is to inform you about the pre-requisites for integrating WalletConnect as an App with React.Cloud Configuration
Create a new project on WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your project (app).Don’t have a project ID?Head over to WalletConnect Dashboard and create a new project now!
Get started
Allowlist
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of origins where your project ID is used. You can manage your allowlist in the WalletConnect Dashboard under the project settings. The allowlist supports a list of origins in the format[scheme://]<hostname[:port]>. Using localhost (or 127.0.0.1) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
example.com- allowshttps://example.comorhttp://example.combut nothttps://www.example.comhttps://example.com- allowshttps://example.combut nothttp://example.comhttps://*.example.com- allowshttps://www.example.combut nothttps://example.com
Installation
Implementation
Here is a sample implementation of WalletConnect App SDK with React. You can also check the example repository below.WalletConnect App SDK Example
Check the WalletConnect App SDK React example
UniversalConnector class. Which simplifies the integration of WalletConnect App SDK by providing a single interface for all the blockchain protocols.
You can configure the Universal Connector with the networks you want to support.
For more information, please visit RPC Reference section from our docs.
We recommend creating a config file to establish a singleton instance for the Universal Connector:
Trigger the modal
To open the WalletConnect modal you need to call theconnect function from the Universal Connector.
Smart Contract Interaction
- Wagmi
- Ethers
- Solana
Wagmi hooks can help us interact with wallets and smart contracts:Read more about Wagmi hooks for smart contract interaction here.