WalletConnect can be linked to an HTML application using the WalletConnect JavaScript library. Here are the steps to do so:
npm install --save @walletconnect/client
<script src="node_modules/@walletconnect/client/dist/walletconnect.min.js"></script>
const connector = new WalletConnect({
bridge: "https://bridge.walletconnect.org",
qrcodeModalOptions: {
mobileLinks: [
"rainbow://wc?uri=",
"metamask://wc?uri=",
"https://metamask.app.link/wc?uri=",
],
},
});
await connector.createSession();
const provider = connector.getProvider();
const accounts = await provider.request({ method: "eth_accounts" });
await connector.killSession();
Asked: 2023-06-12 02:11:51 +0000
Seen: 14 times
Last updated: Jun 12 '23