Skip to content

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

@briankariuki

Description

@briankariuki

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions