status-im / community-dapp

Community directory curator dApp for Status
https://status-community-dapp.vercel.app
2 stars 5 forks source link

Add support for WalletConnect #68

Open osmaczko opened 1 year ago

osmaczko commented 1 year ago

https://usedapp-docs.netlify.app/docs/Guides/Connecting/Wallet%20Connectors

Should be as simple as:

  import { MetamaskConnector } from '@usedapp/core'
  import { WalletConnectConnector } from '@usedapp/wallet-connect-connector'

  const config: Config = {
    readOnlyChainId: 420,
    readOnlyUrls,
    connectors: {
      metamask: new MetamaskConnector(),
      walletConnect: new WalletConnectConnector({ infuraId: 'd8df2cb7844e4a54ab0a782f608749dd' }),
    },
  }
    const { activateBrowserWallet, account, deactivate } = useEthers()

    if (!account) {
      <div>
        <button onClick={() => activateBrowserWallet({ type: 'metamask' })}> Connect Metamask </button>
        <button onClick={() => activateBrowserWallet({ type: 'walletConnect' })}> Connect Wallet Connect </button>
      </div>
    }