Documentation
¶
Overview ¶
Copyright © 2022 Polygon <engineering@polygon.technology>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MnemonicCmd = &cobra.Command{ Use: "mnemonic", Short: "Generate a bip39 mnemonic seed", Long: `This is a basic function to generate a random seed phrase. If you're looking to generate a full HD wallet, you'll need to use some of the other commands, this command is meant only for generating the mnemonic phrase rather than a full set of wallets and addresses `, RunE: func(cmd *cobra.Command, args []string) error { mnemonic, err := hdwallet.NewMnemonic(*inputMnemonicWords, *inputMnemonicLang) if err != nil { return err } cmd.Println(mnemonic) return nil }, PreRunE: func(cmd *cobra.Command, args []string) error { if *inputMnemonicWords < 12 { return fmt.Errorf("the number of words in the mnemonic must be 12 or more. Given: %d", *inputMnemonicWords) } if *inputMnemonicWords > 24 { return fmt.Errorf("the number of words in the mnemonic must be 24 or less. Given: %d", *inputMnemonicWords) } if *inputMnemonicWords%3 != 0 { return fmt.Errorf("the number of words in the mnemonic must be a multiple of 3") } return nil }, }
mnemonicCmd represents the mnemonic command
Functions ¶
This section is empty.
Types ¶
This section is empty.