wallet

package
v0.0.0-...-649c49e Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyPair

func NewKeyPair() (ecdsa.PrivateKey, []byte)

generate new private and public keys

func ValidateAddress

func ValidateAddress(addr string) bool

Types

type Wallet

type Wallet struct {
	PrivKey    ecdsa.PrivateKey
	PubKey     []byte
	PubKeyHash []byte
	Address    string
	Balance    int // balance in satoshis
}

func New

func New() *Wallet

type Wallets

type Wallets struct {
	Wallets map[string]*Wallet // map of wallets, where key is address
}

func LoadWallets

func LoadWallets() *Wallets

func NewWallets

func NewWallets() *Wallets

func (*Wallets) Add

func (ws *Wallets) Add(w *Wallet) error

func (*Wallets) Get

func (ws *Wallets) Get(addr string) *Wallet

func (*Wallets) Save

func (ws *Wallets) Save()

Jump to

Keyboard shortcuts

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