suiet / wallet-kit

The first choice to connect all wallets on Sui blockchain
https://kit.suiet.app
MIT License
166 stars 60 forks source link

signPersonalMessage can't result valid signature #286

Closed chaoyi7 closed 5 months ago

chaoyi7 commented 8 months ago

Problem

Can @suiet/wallet-kit support wallet switch?

simple code below

wallet.adapter?.signPersonalMessage({ account: account!, message: new TextEncoder().encode('HelloXXX') })

Let's say I've logged in to a wallet now, and there's a ListBox comp in the upper right corner of my page to switch wallet addresses, when I switch, I call thesignPersonalMessage method, and then request the API after getting the signature, but I find that I can't get a valid signature using SignPersonalMessage

const verifyResult = await wallet.verifySignedMessage(res, account.publicKey)
console.log('verify signedMessage', verifyResult)  // is false
bruceeewong commented 8 months ago

Hi, currently our wallet kit does not support wallet switching from the DApp side. May I know how do you implement the switching logic? Can you also verify if the account of the "account.publicKey" is the one that the DApp connects to?

bruceeewong commented 5 months ago

Close due to no response for a long time.