wallet

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	foundation.BaseContract
	Balance uint
}

Wallet - basic wallet contract

func New

func New(balance uint) (*Wallet, error)

New creates new allowance

func (*Wallet) Accept

func (w *Wallet) Accept(aRef *core.RecordRef) error

Accept transforms allowance to balance

func (*Wallet) Allocate

func (w *Wallet) Allocate(amount uint, to *core.RecordRef) (core.RecordRef, error)

Allocate returns reference to a new allowance

func (*Wallet) GetTotalBalance

func (w *Wallet) GetTotalBalance() (uint, error)

GetTotalBalance gets total balance

func (*Wallet) Receive

func (w *Wallet) Receive(amount uint, from *core.RecordRef) error

Receive gets money from given wallet

func (*Wallet) ReturnAndDeleteExpiredAllowances

func (w *Wallet) ReturnAndDeleteExpiredAllowances() error

ReturnAndDeleteExpiredAllowances gets all allowances destroy them and update balance

func (*Wallet) Transfer

func (w *Wallet) Transfer(amount uint, to *core.RecordRef) error

Transfer transfers money to given wallet

Jump to

Keyboard shortcuts

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