aboutsummaryrefslogtreecommitdiffstats
path: root/internal/ethapi
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-01 23:45:17 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-09 16:30:17 +0800
commitdb568a61e2a98880ab308bf2224aa34073dc7f39 (patch)
tree97da46661ad3002b6ff9f6dca07e3105da5a9c5a /internal/ethapi
parent17ce0a37de5a2712a8bf9d58df705e718b3b2cd6 (diff)
downloaddexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.gz
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.bz2
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.lz
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.xz
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.zst
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.zip
accounts, console, internal: support trezor hardware wallet
Diffstat (limited to 'internal/ethapi')
-rw-r--r--internal/ethapi/api.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 7874b7101..6b9c151cf 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -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) {