wallet

package
v0.0.0-...-1f6f007 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bucket    = "wallet"
	Extension = ".dat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	Wallet map[string]*address.Address
}

Wallet stores a collection of Wallet

func NewWallet

func NewWallet(fileName string) (*Wallet, error)

NewWallet creates Wallet and fills it from a file if it exists

func (*Wallet) CreateAddress

func (ws *Wallet) CreateAddress() string

CreateAddress adds an Address to Wallet

func (Wallet) GetAddress

func (ws Wallet) GetAddress(address string) address.Address

GetAddress returns an Address by its address

func (*Wallet) GetAddresses

func (ws *Wallet) GetAddresses() []string

GetAddresses returns an array of addresses stored in the wallet file

func (*Wallet) GetInitialAddress

func (ws *Wallet) GetInitialAddress() string

GetInitialAddress returns the first address in the wallet

func (*Wallet) LoadFromFile

func (ws *Wallet) LoadFromFile(fileName string) error

LoadFromFile loads Wallet from a file

func (Wallet) SaveToFile

func (ws Wallet) SaveToFile(fileName string)

SaveToFile saves Wallet to a file

Jump to

Keyboard shortcuts

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