aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/account_manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/account_manager.go')
-rw-r--r--accounts/account_manager.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go
index 21ef46991..f063f8ca5 100644
--- a/accounts/account_manager.go
+++ b/accounts/account_manager.go
@@ -239,3 +239,15 @@ func (am *Manager) Import(path string, keyAuth string) (Account, error) {
}
return Account{Address: key.Address}, nil
}
+
+func (am *Manager) ImportPreSaleKey(keyJSON []byte, password string) (acc Account, err error) {
+ var key *crypto.Key
+ key, err = crypto.ImportPreSaleKey(am.keyStore, keyJSON, password)
+ if err != nil {
+ return
+ }
+ if err = am.keyStore.StoreKey(key, password); err != nil {
+ return
+ }
+ return Account{Address: key.Address}, nil
+}