github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/cmd/hdwallet/hdwallet.go (about) 1 // Copyright (c) 2022 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package hdwallet 7 8 import ( 9 "github.com/pkg/errors" 10 "github.com/spf13/cobra" 11 12 "github.com/iotexproject/iotex-core/ioctl/config" 13 ) 14 15 // Multi-language support 16 var ( 17 _hdwalletCmdShorts = map[config.Language]string{ 18 config.English: "Manage hdwallets of IoTeX blockchain", 19 config.Chinese: "管理IoTeX区块链上的钱包", 20 } 21 ) 22 23 // Errors 24 var ( 25 ErrPasswdNotMatch = errors.New("password doesn't match") 26 ) 27 28 // HdwalletCmd represents the hdwallet command 29 var HdwalletCmd = &cobra.Command{ 30 Use: "hdwallet", 31 Short: config.TranslateInLang(_hdwalletCmdShorts, config.UILanguage), 32 } 33 34 // DefaultRootDerivationPath for iotex 35 // https://github.com/satoshilabs/slips/blob/master/slip-0044.md 36 const DefaultRootDerivationPath = "m/44'/304'" 37 38 var _hdWalletConfigFile = config.ReadConfig.Wallet + "/hdwallet" 39 40 func init() { 41 HdwalletCmd.AddCommand(_hdwalletCreateCmd) 42 HdwalletCmd.AddCommand(_hdwalletDeleteCmd) 43 HdwalletCmd.AddCommand(_hdwalletImportCmd) 44 HdwalletCmd.AddCommand(_hdwalletExportCmd) 45 HdwalletCmd.AddCommand(_hdwalletDeriveCmd) 46 }