wallet

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(input []byte) []byte

Base58Decode to assist in getting the decoded value

func Base58Encode

func Base58Encode(input []byte) []byte

Base58Encode to assist in encoding the value

func GenerateCheckSum

func GenerateCheckSum(payload []byte) []byte

GenerateCheckSum to generate the checksum

func NewKeyPair

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

NewKeyPair to create a new KeyPair

func PanicHandle added in v0.0.2

func PanicHandle(err error)

PanicHandle to Panic throw errors

func PublicKeyHash

func PublicKeyHash(publicKey []byte) []byte

PublicKeyHash to create the public hash

func ReturnHandle added in v0.0.2

func ReturnHandle(err error) error

ReturnHandle to return throw errors

func ValidateAddress added in v0.0.2

func ValidateAddress(address string) bool

ValidateAddress to validate the address that is passed into the blockchain

Types

type Wallet

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

Wallet structure for the Wallet type in the blockchain

func MakeWallet

func MakeWallet() *Wallet

MakeWallet to create a wallet

func (Wallet) Address

func (w Wallet) Address() []byte

Address to find the address of the Wallet

type Wallets

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

Wallets structure for map of wallets

func CreateWallets

func CreateWallets() (*Wallets, error)

CreateWallets to create a wallets file

func (*Wallets) AddWallet

func (wallets *Wallets) AddWallet() string

AddWallet to add the wallet to the wallets file

func (*Wallets) GetAllAddresses

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

GetAllAddresses to get the addresses in the wallets file

func (Wallets) GetWallet

func (wallets Wallets) GetWallet(address string) Wallet

GetWallet to get the wallet

func (*Wallets) LoadFile

func (wallets *Wallets) LoadFile() error

LoadFile to load a file into the application

func (*Wallets) SaveFile

func (wallets *Wallets) SaveFile()

SaveFile to save the file after edit

Jump to

Keyboard shortcuts

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