I'm following this code from Phantom doc.
const provider = getProvider();
const message = "To avoid digital dognappers, sign below to authenticate with CryptoCorgis";
const encodedMessage = new TextEncoder().encode(message);
const signedMessage = await provider.signMessage(encodedMessage, "utf8");
console.log('Signature : ' + JSON.stringify( signedMessage ) );
And the console output for signedMessage
is below.
Signature : {"signature":{"type":"Buffer","data":[124,66,191,12,89,236,90,243,235,24,181,69,221,212,190,153,225,201,69,131,231,221,125,229,101,202,245,39,75,81,243,119,109,131,223,7,174,98,249,148,18,227,51,54,3,218,200,74,118,189,57,96,187,145,0,146,137,192,147,113,107,19,94,1]},"publicKey":"zGmof8SeyvHZqsTBjsKXSV"}
If I do signedMessage.toString(), I get
Signature : [object Object]
So how do I get just the typical message hash signature in hexadecimal string?