1

I have this:

ethereum.request({ 
        method: 'eth_sign', 
        params: 
            {
                from: account, //this is the address
                message: '0xfafa'
            }
        
    }).then(data => {
        console.log("data ", data);
    })

Seems like the error states: RPC Error: Invalid parameters: must provide an Ethereum address.

What's the right syntax to make it work ?

1
  • From eth.wiki/json-rpc/API#eth_sign it appears params should be an array. In any case you can inject any web3 version in your project, you shouldn't depend on Metamask copy. – Ismael Mar 10 at 2:52
0

Maybe try using web3.eth.personal.sign(message, account)

-> Returns a promise reference post

Usually this requires a third parameter password but here someone says without providing a pass it uses MetaMask to sign.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.