I'm trying to sign a transaction without broadcast using metamask. I have tried web3js and etherjs (eth_signTransaction) but neither worked. How to do this?
I think opensea is signing message and then using it for transaction. How did they do this?
- using web3js. I have tried this. But I get
MetaMask - RPC Error: Method not supported
const signedTx = await web3.eth.signTransaction(tx, accounts[0])
- using etherjs. I have tried this. But I get
Error: signing transactions is unsupported (operation="signTransaction", code=UNSUPPORTED_OPERATION
const signedTx = await signer.signTransaction(tx)