anchor
anchor copied to clipboard
Add option to sign tx with generic wallet interface
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 is attempting to deploy a commit to the coral-xyz Team on Vercel.
A member of the Team first needs to authorize it.
@charlieyou
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
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.