anza-xyz / anza-xyz/wallet-adapter

Trust Wallet Adapter does not support signIn method, yet the method is not marked as undefined

Open
#1,125 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
1.1k
Avg merge
10h 19m
Merged PRs (30d)
3

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.