log "github.com/sirupsen/logrus"
- "github.com/bytom/blockchain/pseudohsm"
- "github.com/bytom/blockchain/txbuilder"
- "github.com/bytom/crypto/ed25519/chainkd"
+ "github.com/bytom/bytom/blockchain/txbuilder"
+ "github.com/bytom/bytom/crypto/ed25519/chainkd"
)
type createKeyResp struct {
return NewSuccessResponse(&createKeyResp{Alias: xpub.Alias, XPub: xpub.XPub, File: xpub.File, Mnemonic: *mnemonic})
}
-type importKeyResp struct {
- Xpub *pseudohsm.XPub `json:"xpub"`
+func (a *API) pseudohsmUpdateKeyAlias(ctx context.Context, in struct {
+ XPub chainkd.XPub `json:"xpub"`
+ NewAlias string `json:"new_alias"`
+}) Response {
+ if err := a.wallet.Hsm.UpdateKeyAlias(in.XPub, in.NewAlias); err != nil {
+ return NewErrorResponse(err)
+ }
+ return NewSuccessResponse(nil)
}
func (a *API) pseudohsmListKeys(ctx context.Context) Response {