I am using this code below and I got an error:
await web3.eth.getTransactionReceipt(this.state.transactionHash, (err, txReceipt)=>{
console.log(err,txReceipt);
this.setState({txReceipt})
}); //await for getTransactionReceipt
await this.setState({transactionHash: this.state.txReceipt.transactionHash});
await this.setState({blockNumber: this.state.txReceipt.blockNumber});
await this.setState({gasUsed: this.state.txReceipt.gasUsed});
The error is:
MetaMask - RPC Error: invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Hash
Can you please tell me how to solve this error?