Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateMnemonic ¶
*
GenerateMnemonic function generate a random mnemonic. Returns: string: A random mnemonic phrase. error: An error if the generation of mnemonic fails.
func GenerateSeed ¶
*
GenerateSeed generates a seed string from a mnemonic and passphrase. Params: mnemonic (string): The mnemonic for seed generation. passphrase (string): The passphrase for seed generation. Returns: string: The seed string in hexadecimal format. error: An error if the generation seed fails.
func IsMnemonic ¶
*
IsMnemonic checks if a given mnemonic pgrase is valid. Params: mnemonic (string): The mnemonic phrase to validate. Returns: bool: true if the mnemonic is valid, false otherwise.
Types ¶
type HDWallet ¶
type HDWallet struct { RootXprivKey bip32.XPrv XPrivKey bip32.XPrv Path string Seed []byte Mnemonic string Passphrase string Entropy string }
func NewHDWalletFromMnemonic ¶
func NewHDWalletFromSeed ¶
*
NewHDWalletFromSeed creates a new HDWallet instance from a seed string. Params: seed (string): The input seed string. Returns: *HDWallet: A new HDWallet instance. error: An error if the new wallet fails.
func (*HDWallet) Derive ¶
*
Derive function derives a new HDWallet from the current wallet based on an index and a flag. Params: index (uint32): The index for derivation. hardened (bool): A flag indicating whether to perform a hardened derivation. Returns: *HDWallet: A new HDWallet derived based on the index and hardening flag.
func (*HDWallet) DerivePath ¶
*
DerivePath derives a new HDWallet from the current wallet based on the path. Params: path (string): The derivation path in the format "m/". Returns: *HDWallet: A new HDWallet derived based on the path. error: An error if the derived path fails.
Click to show internal directories.
Click to hide internal directories.