-
Notifications
You must be signed in to change notification settings - Fork 322
/
hdwallet.go
51 lines (42 loc) · 1.59 KB
/
hdwallet.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2019 IoTeX Foundation
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
package hdwallet
import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/iotexproject/iotex-core/ioctl/config"
)
// Multi-language support
var (
hdwalletCmdShorts = map[config.Language]string{
config.English: "Manage hdwallets of IoTeX blockchain",
config.Chinese: "管理IoTeX区块链上的钱包",
}
hdwalletCmdUses = map[config.Language]string{
config.English: "hdwallet",
config.Chinese: "钱包",
}
)
// Errors
var (
ErrPasswdNotMatch = errors.New("password doesn't match")
)
// HdwalletCmd represents the hdwallet command
var HdwalletCmd = &cobra.Command{
Use: config.TranslateInLang(hdwalletCmdUses, config.UILanguage),
Short: config.TranslateInLang(hdwalletCmdShorts, config.UILanguage),
}
// DefaultRootDerivationPath for iotex
// https://github.com/satoshilabs/slips/blob/master/slip-0044.md
const DefaultRootDerivationPath = "m/44'/304'"
var hdWalletConfigFile = config.ReadConfig.Wallet + "/hdwallet"
func init() {
HdwalletCmd.AddCommand(hdwalletCreateCmd)
HdwalletCmd.AddCommand(hdwalletDeleteCmd)
HdwalletCmd.AddCommand(hdwalletImportCmd)
HdwalletCmd.AddCommand(hdwalletExportCmd)
HdwalletCmd.AddCommand(hdwalletDeriveCmd)
}