wallet

package
v0.0.0-...-0ef9f9d Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInsufficientFunds = errors.New("cannot withdraw, insufficient funds")

ErrInsufficientFunds nto having enough founds

Functions

This section is empty.

Types

type Bitcoin

type Bitcoin int

Bitcoin is an int

func (Bitcoin) String

func (b Bitcoin) String() string

String representation of bitcin

type Stringer

type Stringer interface {
	String() string
}

Stringer something into an string

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet that hold bitcoins

func (*Wallet) Balance

func (w *Wallet) Balance() Bitcoin

Balance of our wallet

func (*Wallet) Deposit

func (w *Wallet) Deposit(amount Bitcoin)

Deposit some amount in our wallet

func (*Wallet) Withdraw

func (w *Wallet) Withdraw(amount Bitcoin) error

Withdraw an amount from our walllet

Jump to

Keyboard shortcuts

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