I am using the exactly same wallet on both Wallet Connect (Chrome) + MetaMask (mobile)
and MetaMask (Chrome)
in calling a mint function of my smart contract. With MetaMask (Chrome)
, the process goes smoothly; but with Wallet Connect (Chrome) + MetaMask (mobile)
, this error occurs:
inpage.js:1 MetaMask - RPC Error: The requested account and/or method has not been authorized by the user.
I am simply use
const contract = new web3.eth.Contract(
abi,
contractAddress
);
contract.methods.mintBatch(something).send({from: walletId, value: value}, (err, res) => callback(err, res));
with both Wallet Connect (Chrome) + MetaMask (mobile)
and MetaMask (Chrome)
. Does it require additional set-up for Wallet Connect?
Best Answer
Turns out I need to use the following to replace the usual web3 to make it work:
The web3 has to be walletConnect web3.