wallet

package
v0.0.0-...-e701cd2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAddressFromXPub

func GenerateAddressFromXPub(currency request.Currency, testnet bool, xpub string, i uint32) string

*

  • Generate address *
  • @param currency type of blockchain
  • @param testnet testnet or mainnet version of address
  • @param xpub extended public key to generate address from
  • @param i derivation index of address to generate. Up to 2^32 addresses can be generated.
  • @return the string
  • @throws Exception the exception
  • @returns blockchain address

func GeneratePrivateKeyFromMnemonic

func GeneratePrivateKeyFromMnemonic(currency request.Currency, testnet bool, mnemonic string, i uint32) string

*

  • Generate private key from mnemonic seed *
  • @param currency type of blockchain
  • @param testnet testnet or mainnet version of address
  • @param mnemonic mnemonic to generate private key from
  • @param i derivation index of private key to generate.
  • @return the string
  • @throws Exception the exception
  • @returns blockchain private key to the address

Types

type Wallet

type Wallet struct {

	/**
	 * mnemonic seed
	 */
	Mnemonic string

	/**
	 * extended public key to derive addresses from
	 */
	Xpub string

	/**
	 * address
	 */
	Address string

	/**
	 * secret
	 */
	Secret string
}

func GenerateWallet

func GenerateWallet(currency request.Currency, testnet bool, mnemonic string) *Wallet

*

  • Generate wallet *
  • @param currency blockchain to generate wallet for
  • @param testnet testnet or mainnet version of address
  • @param mnemonic mnemonic seed to use. If not present, new one will be generated
  • @return the wallet
  • @throws Exception the exception
  • @returns wallet or a combination of address and private key

Jump to

Keyboard shortcuts

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