-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
The trust wallet adapter returns signIn method as existing, but upon calling the sigIn method, it throws an error that the method is not implemented.
To Reproduce
Pseudo code to reproduce the issue. This assumes trust wallet extension is installed and selected on the wallet modal.
const { wallet, publicKey, connected, signMessage, signIn } = useWallet();
const connectWallet = () => {
// After selecting trust wallet from modal
// fetch SIWS message from backend
const input = await fetchSIWSMessage(address);
if (signIn && typeof signIn === 'function') {
const output = await signIn(input); <-- Fails here with exception
await verifySIWSSignature(input, output);
} else if (typeof signMessage === 'function') {
const msg = new TextEncoder().encode(input.statement);
const signedMessageSignature = await signMessage(msg);
const output: SolanaSignInOutput = {
signature: signedMessageSignature,
signedMessage: signedMessageSignature,
account: {
address: publicKey.toBase58(),
publicKey: publicKey.toBytes(),
chains: [],
features: [],
},
};
await verifyMessageSignature(input, output);
} else {
throw new Error('Wallet does not support message signing');
}
}
Expected behavior
That the signIn method would be undefined, for example solflare wallet adapter returns undefined for signIn method.
Desktop (please complete the following information):
- OS: Macos sequoia 15.6.1
- Browser Chrome
- Version 140.0.7339.133
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels