I want to initiate transactions using the following stack. However, Infura doesn't support web3.eth.sendTransaction(tx)
because it requires the server to hold private keys. Here is a link to how it should work https://example.walletconnect.org/ and the repo https://github.com/WalletConnect/walletconnect-example-dapp.
So far this is what I have.
const provider = new WalletConnectProvider({
infuraId: "**************",
})
await provider.enable();
const web3 = new Web3(provider);
web3.eth.getAccounts().then((account) => {
console.log("kk", account)
setAccount(account)
}).catch((err) => {
console.log("Failed to get accounts", err)
})
web3.eth.getBalance(account[0]).then((balance) => {
setAccountBalance(balance)
}).catch((err) => {
console.log("ayre", err)
})