github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/newcmd/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"
    13  	"github.com/iotexproject/iotex-core/ioctl/config"
    14  )
    15  
    16  // Errors
    17  var (
    18  	ErrPasswdNotMatch = errors.New("password doesn't match")
    19  )
    20  
    21  // DefaultRootDerivationPath for iotex
    22  // https://github.com/satoshilabs/slips/blob/master/slip-0044.md
    23  const DefaultRootDerivationPath = "m/44'/304'"
    24  
    25  // Multi-language support
    26  var (
    27  	_hdwalletCmdShorts = map[config.Language]string{
    28  		config.English: "Manage hdwallets of IoTeX blockchain",
    29  		config.Chinese: "管理IoTeX区块链上的钱包",
    30  	}
    31  )
    32  
    33  // NewHdwalletCmd represents the new hdwallet command.
    34  func NewHdwalletCmd(client ioctl.Client) *cobra.Command {
    35  	hdwalletShorts, _ := client.SelectTranslation(_hdwalletCmdShorts)
    36  	cmd := &cobra.Command{
    37  		Use:   "hdwallet",
    38  		Short: hdwalletShorts,
    39  	}
    40  	cmd.AddCommand(NewHdwalletCreateCmd(client))
    41  	cmd.AddCommand(NewHdwalletDeleteCmd(client))
    42  	cmd.AddCommand(NewHdwalletDeriveCmd(client))
    43  	cmd.AddCommand(NewHdwalletExportCmd(client))
    44  	cmd.AddCommand(NewHdwalletImportCmd(client))
    45  	return cmd
    46  }