wallet

package
v0.0.0-...-7c9a5d0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChecksumLength = 4
)

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(input []byte) []byte

func Base58Encode

func Base58Encode(input []byte) []byte

func Checksum

func Checksum(payload []byte) []byte

func HandleFatalErrors

func HandleFatalErrors(err error)

func NewKeyPair

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

func PublicKeyHash

func PublicKeyHash(pubKey []byte) []byte

func ValidateAddress

func ValidateAddress(address string) bool

Types

type Wallet

type Wallet struct {
	PrivateKey ecdsa.PrivateKey
	PublicKey  []byte
}

func NewWallet

func NewWallet() *Wallet

func (Wallet) Address

func (w Wallet) Address() []byte

type WalletDB

type WalletDB struct {
	Wallets map[string]*Wallet
}

func CreateWalletDB

func CreateWalletDB() (*WalletDB, error)

func (*WalletDB) AddWallet

func (wdb *WalletDB) AddWallet() string

func (WalletDB) GetAllWallet

func (wdb WalletDB) GetAllWallet() []string

func (WalletDB) GetWallet

func (wdb WalletDB) GetWallet(address string) Wallet

func (*WalletDB) LoadFile

func (wdb *WalletDB) LoadFile() error

func (*WalletDB) SaveFile

func (wdb *WalletDB) SaveFile()

Jump to

Keyboard shortcuts

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