wallet

package
v0.0.0-...-2a7043a Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(payload []byte) []byte

func NewKeyPair

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

func PublicKeyHash

func PublicKeyHash(publicKey []byte) []byte

func ValidateAddress

func ValidateAddress(address string) bool

Types

type PrivateKey

type PrivateKey struct {
	D          *big.Int
	PublicKeyX *big.Int
	PublicKeyY *big.Int
}

type Wallet

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

func NewWallet

func NewWallet() *Wallet

func (*Wallet) Address

func (w *Wallet) Address() []byte

func (*Wallet) GobDecode

func (w *Wallet) GobDecode(data []byte) error

func (*Wallet) GobEncode

func (w *Wallet) GobEncode() ([]byte, error)

type Wallets

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

func NewWallets

func NewWallets() (*Wallets, error)

func (*Wallets) AddWallet

func (w *Wallets) AddWallet() string

func (*Wallets) GetAllAddresses

func (w *Wallets) GetAllAddresses() []string

func (*Wallets) GetWallet

func (w *Wallets) GetWallet(address string) Wallet

func (*Wallets) LoadFile

func (w *Wallets) LoadFile() error

func (*Wallets) SaveFile

func (w *Wallets) SaveFile()

Jump to

Keyboard shortcuts

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