web3modal
web3modal copied to clipboard
WalletConnectV2 Support
I have attempted to build WalletConnectV2 support into the application. It's working with the latest version of @walletconnect/ethereum-provider
. I'm looking for someone to assist in helping me develop this integration since I'm receiving the error: Error initializing with WalletConnect
when trying to connect RainbowWallet from my phone.
Docs https://docs.walletconnect.com/2.0/quick-start/dapps/ethereum-provider
"custom-walletconnectv2": {
display: {
name: "WalletConnectV2",
description: "Connect to WalletConnect(V2)",
},
package: true,
connector: async () => {
console.log("hi");
const client = await WalletConnectClient.init({
projectId: "PROJECT_ID",
relayUrl: "wss://relay.walletconnect.com",
metadata: {
name: "Candy Chain Dapp",
description: "Candy",
url: "#",
icons: ["https://walletconnect.com/walletconnect-logo.png"],
},
});
// Should subscribe to client here but skipping for now
client.on(
CLIENT_EVENTS.pairing.proposal,
async (proposal: PairingTypes.Proposal) => {
// Display the QRCode modal on a new pairing request.
const { uri } = proposal.signal.params;
console.log("EVENT", "QR Code Modal opened");
QRCodeModal.open(uri, () => {
console.log("EVENT", "QR Code Modal closed");
});
}
);
client.on(
CLIENT_EVENTS.session.deleted,
(deletedSession: SessionTypes.Settled) => {
// Perform some cleanup after session was deleted (e.g. via `provider.disconnect()`)
console.log(deletedSession);
}
);
const provider = new EthereumProvider({
chainId: 1,
client,
rpc: {
infuraId: "INFURA_ID",
},
});
await provider.enable();
return provider;
},
},
I am starting to believe that most wallets utilizing WalletConnect have not migrated to the V2 API. This may be the cause of the issue.
Quote https://docs.walletconnect.com/2.0/migration
"Most importantly we must migrate Wallets before Dapps can start supporting v2.0. This is because Wallets can support both versions in parallel and route connection requests to corresponding clients using the version number specified in the URI present in the QR Code or Deep Link."
@kyokosdream From their discord it looks like its just not ready to integrate into Web3Modal yet
Not sure if it's best to close this issue or leave it as a reference for when it is time to integrate V2.
I just wanted to signal my interest for a web3modal beta branch with support for walletconnect v2. Thanks for working on it!
This is on the roadmap and should be in beta within the coming months.
With stable version 2.0.0 of Web3Modal now released, we are officially dropping support for version 1.x Due to this this issue/pr was marked for closing. It is highly recommended to upgrade as 2.x will be receiving further updates that will enable functionality for some of our newer sdks like auth and push as well as support for WalletConnect v2 (See this post about WalletConnect v1 being deprecated https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e)
If you need to continue using Web3Modal 1.x and require this feature/fix implemented, we suggest adding it via forking V1 branch.