anchor icon indicating copy to clipboard operation
anchor copied to clipboard

Add option to sign tx with generic wallet interface

Open yf-castel opened this issue 2 years ago • 3 comments

Problem Client SDK methods for sending transactions, e.g. AnchorProvider.sendAndConfirm and sendAll, only allowing transaction signing using Signer type. Signer type exposes both the public key and the private/secret key.

This doesn't work for hardware wallets, which do not allow the secret key to be exposed.

Solution Expose a generic wallet interface with methods signTransaction and signAllTransactions. Next, in methods like AnchorProvider.sendAndConfirm and sendAll, accept the generic wallet interface and use it to sign transactions.

Users are free to implement their own wallet interface for the hardware wallets (such as ledger).

Backward compatibility with existing interfaces is kept.

yf-castel avatar Aug 15 '22 12:08 yf-castel

@yf-castel is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Aug 15 '22 12:08 vercel[bot]

@charlieyou

yf-castel avatar Aug 16 '22 07:08 yf-castel

Hi @armaniferrante , I would like to see if this feature makes sense for Anchor. There is no issue for it yet. Is it possible to run trigger the github actions? Any other suggestions? Thanks

yf-castel avatar Aug 19 '22 12:08 yf-castel

Unfortunately I don't know enough about the wallet adapter interface to say if this is a safe / sensible change to make. Maybe someone else will come along that does know. Also can't seem to run tests on the PR.

Henry-E avatar Nov 22 '22 16:11 Henry-E