implement key import and export

This commit is contained in:
whyrusleeping
2019-10-08 18:17:03 +09:00
parent 49e8b5d334
commit b40de6995b
5 changed files with 113 additions and 4 deletions
+8
View File
@@ -68,3 +68,11 @@ func (a *WalletAPI) WalletDefaultAddress(ctx context.Context) (address.Address,
// TODO: store a default address in the config or 'wallet' portion of the repo
return addrs[0], nil
}
func (a *WalletAPI) WalletExport(ctx context.Context, addr address.Address) ([]byte, error) {
return a.Wallet.Export(addr)
}
func (a *WalletAPI) WalletImport(ctx context.Context, b []byte) (address.Address, error) {
return a.Wallet.Import(b)
}