Closed beargrilo closed 1 year ago
if (wallet.publicKey.value && wallet.signMessage.value) {
const encodedMessage = new TextEncoder().encode("Message content");
const signatureBuffer = await wallet.signMessage.value(encodedMessage);
const signature = bs58.encode(signatureBuffer);
console.log(`Public Key: ${wallet.publicKey}\nSignature: ${signature}`);
}
That's what I use. I guess depending on the wallet, it may not have signMessage implementation.
Will give it a try, ty.
Hi there, signMessage
is a computed property and therefore needs to be accessed via .value
.
Hi,
in any wallet I connect (phantom, slope, solflare), I'm unable to
signMessage
.Error:
app.js:35644 Uncaught (in promise) TypeError: signMessage is not a function
What am I doing wrong?