wallet

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressByPublicKey

func AddressByPublicKey(publicKey string) (string, error)

Get Minter address from public key.

func AddressToHex

func AddressToHex(address string) ([]byte, error)

func BytesToAddress

func BytesToAddress(address [20]byte) string

func IsValidAddress

func IsValidAddress(address string) bool

func NewMnemonic

func NewMnemonic() (string, error)

Generate mnemonic.

func PrivateKeyBySeed

func PrivateKeyBySeed(seed []byte) (string, error)

Get private key from seed.

func PubPrefix04ToMp

func PubPrefix04ToMp(key string) string

func PublicKeyByPrivateKey

func PublicKeyByPrivateKey(privateKey string) (string, error)

Get public key from private key.

func Seed

func Seed(mnemonic string) ([]byte, error)

Get seed from mnemonic.

Types

type Data

type Data struct {
	Mnemonic   string
	Seed       string
	PrivateKey string
	PublicKey  string
	Address    string
}

func Create

func Create() (*Data, error)

Create wallet. This method returns generated seed, private key, public key, mnemonic and Minter address.

type Wallet

type Wallet struct {
	*Data
}

func NewWallet

func NewWallet(seed []byte) (*Wallet, error)

func (*Wallet) Address

func (w *Wallet) Address() string

func (*Wallet) PrivateKey

func (w *Wallet) PrivateKey() string

func (*Wallet) PublicKey

func (w *Wallet) PublicKey() string

Jump to

Keyboard shortcuts

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