bip39gen

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMnemonic

func GenerateMnemonic(length int) []string

func GenerateMnemonicAndEntropy

func GenerateMnemonicAndEntropy(length int) (mnemonic string, entropy []byte)

Types

type AddressData

type AddressData struct {
	Address        string
	Name           string
	Entropy        string
	PubKey         string
	PrivKey        string
	Mnemonic       string
	Seed           string
	WalletIndex    int
	DerivationPath string
	Hardened       bool
}

AddressData contains generated data for an address derived from a hdwallet.

func GenerateAddress

func GenerateAddress(params *types.GeneratorParams) AddressData

GenerateAddress returns a AddressData struct initialized using random values for entropy, seed, mnemonic, and wallet index.

func GenerateAddressesSingleMnemonic

func GenerateAddressesSingleMnemonic(params *types.GeneratorParams, num int) (addrs []AddressData)

GenerateAddressesSingleMnemonic generates a slice of AddressData structs, all of which are initialized using the same entropy, seed, and mnemonic.

func (AddressData) BuildOutput

func (a AddressData) BuildOutput() (ad AddressDataOutput)

func (AddressData) FormatOutput

func (a AddressData) FormatOutput(excludes map[string]bool) AddressDataOutput

type AddressDataOutput

type AddressDataOutput struct {
	Address        *string  `json:"address" yaml:"address" toml:"address"`
	Name           *string  `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
	Pubkey         *string  `json:"pubkey,omitempty" yaml:"pubkey,omitempty" toml:"pubkey,omitempty"`
	Privkey        *string  `json:"privkey,omitempty" yaml:"privkey,omitempty" toml:"privkey,omitempty"`
	Mnemonic       []string `json:"mnemonic,omitempty" yaml:"mnemonic,omitempty" toml:"mnemonic,omitempty"`
	Seed           *string  `json:"seed,omitempty" yaml:"seed,omitempty" toml:"seed,omitempty"`
	Entropy        *string  `json:"entropy,omitempty" yaml:"entropy,omitempty" toml:"entropy,omitempty"`
	WalletIndex    *int     `json:"wallet_index,omitempty" yaml:"wallet_index,omitempty" toml:"wallet_index,omitempty"`
	DerivationPath *string  `json:"derivation_path,omitempty" yaml:"derivation_path,omitempty" toml:"derivation_path,omitempty"`
	Hardened       *bool    `json:"hardened,omitempty" yaml:"hardened,omitempty" toml:"hardened,omitempty"`
}

AddressDataOutput is only used for data output, and is almost always created by AddressData.BuildOutput.

func (AddressDataOutput) FormatJSON

func (a AddressDataOutput) FormatJSON() []byte

func (AddressDataOutput) FormatTOML

func (a AddressDataOutput) FormatTOML() []byte

func (AddressDataOutput) FormatText

func (a AddressDataOutput) FormatText() []byte

func (AddressDataOutput) FormatYAML

func (a AddressDataOutput) FormatYAML() []byte

type AddressDataOutputSlice

type AddressDataOutputSlice []AddressDataOutput

func (AddressDataOutputSlice) FormatJSON

func (s AddressDataOutputSlice) FormatJSON() []byte

func (AddressDataOutputSlice) FormatTOML

func (s AddressDataOutputSlice) FormatTOML() []byte

func (AddressDataOutputSlice) FormatText

func (s AddressDataOutputSlice) FormatText() []byte

func (AddressDataOutputSlice) FormatYAML

func (s AddressDataOutputSlice) FormatYAML() []byte

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL