accounts, console, internal: support trezor hardware wallet

This commit is contained in:
Péter Szilágyi
2017-08-01 17:45:17 +02:00
parent 17ce0a37de
commit db568a61e2
38 changed files with 17063 additions and 38 deletions

View File

@ -246,6 +246,22 @@ func (s *PrivateAccountAPI) ListWallets() []rawWallet {
return wallets
}
// OpenWallet initiates a hardware wallet opening procedure, establishing a USB
// connection and attempting to authenticate via the provided passphrase. Note,
// the method may return an extra challenge requiring a second open (e.g. the
// Trezor PIN matrix challenge).
func (s *PrivateAccountAPI) OpenWallet(url string, passphrase *string) error {
wallet, err := s.am.Wallet(url)
if err != nil {
return err
}
pass := ""
if passphrase != nil {
pass = *passphrase
}
return wallet.Open(pass)
}
// DeriveAccount requests a HD wallet to derive a new account, optionally pinning
// it for later reuse.
func (s *PrivateAccountAPI) DeriveAccount(url string, path string, pin *bool) (accounts.Account, error) {