I have a problem with the method “recoverPublicKey()” in the latest version of “js-ethereum-cryptography”. In my code snippet, which I am sharing with you here, I can get the values of “{ r, s, recovery }”, but I cannot recover the public key, I get the “undefined” error on my browser. Thanks for your help!
app.post("/send", (req, res) => {
const { sender, recipient, amount, signature } = req.body;
const { r, s, recovery } = signature;
const publicKey = secp.secp256k1.recoverPublicKey({ r, s, recovery }, sender);
console.log(publicKey.toString());