I am able to connect omni wallet with wallet connect in my app. I want to transfer CELO to a blockchain address, when I request for a transaction, I am able to confirm the window on omni wallet and when I confirm the transaction, it shows success window on omni app, but transaction on blockchain didn't create and I am getting this error on the browser:
{success: false, error: 'could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.1)'}
Error: Failed to check for transaction receipt:
{
"code": -32602,
"message": "invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Hash"
}
Below is the code I am using to connect omni wallet using walletconnect:
async function ConnectWallet() {
try {
provider = await EthereumProvider.init({
projectId: 'xyz...',
showQrModal: true,
qrModalOptions: { themeMode: "light" },
chains: [42220]
});
await provider.enable();
} catch (error) {
console.log(error);
}
}
And this is code I am using to send the transaction:
async function SendTransaction() {
const web3 = new Web3(provider);
const accounts = await web3.eth.getAccounts();
web3.eth.sendTransaction({
from: accounts[0],
to: "0x5165dc9e9e57b5abb12bc79c419e0078d7b99116",
value: parseEther("1").toString()
})
.on('transactionHash', function (hash) {
console.log(hash);
})
.on('receipt', function (receipt) {
console.log(receipt);
})
.on('confirmation', function (confirmationNumber, receipt) {
console.log(confirmationNumber);
console.log(receipt);
})
.on('error', function (error) {
console.log(error);
});
}
The transaction confirm on omni wallet looks fine. Can somebody please tell me why am I getting this error?