logic

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAmount        = errors.New("ERROR: Amount is invalid (must be > 0)")
	ErrInvalidAddress       = errors.New("ERROR: Address is invalid")
	ErrInvalidSenderAddress = errors.New("ERROR: Sender address is invalid")
	ErrInvalidRcverAddress  = errors.New("ERROR: Receiver address is invalid")
	ErrPasswordNotMatch     = errors.New("ERROR: Password not correct")
	ErrPathEmpty            = errors.New("ERROR: Path empty")
	ErrPasswordEmpty        = errors.New("ERROR: Password empty")
)

Functions

func AddWallet added in v0.1.2

func AddWallet() (*client.Wallet, error)

create a wallet

func CreateBlockchain

func CreateBlockchain(address core.Address, db storage.Storage, consensus core.Consensus, transactionPoolLimit uint32) (*core.Blockchain, error)

create a blockchain

func CreateWallet

func CreateWallet(path string, password string) (*client.Wallet, error)

create a wallet from path

func CreateWalletWithpassphrase added in v0.1.2

func CreateWalletWithpassphrase(password string) (*client.Wallet, error)

create a wallet with passphrase

func GetAllAddressesByPath added in v0.1.2

func GetAllAddressesByPath(path string) ([]core.Address, error)

get all addresses

func GetBalance

func GetBalance(address core.Address, db storage.Storage) (*common.Amount, error)

get balance

func GetMinerAddress added in v0.1.2

func GetMinerAddress() string

func GetTestWalletPath added in v0.1.2

func GetTestWalletPath() string

func GetUnlockDuration added in v0.1.2

func GetUnlockDuration() time.Duration

Get duration

func GetWallet added in v0.1.2

func GetWallet() (*client.Wallet, error)

get wallet

func GetWalletManager added in v0.1.2

func GetWalletManager(path string) (*client.WalletManager, error)

func IsTestWalletEmpty added in v0.1.2

func IsTestWalletEmpty() (bool, error)

func IsWalletEmpty added in v0.1.2

func IsWalletEmpty() (bool, error)

Tell if the file empty or not exist

func IsWalletLocked added in v0.1.2

func IsWalletLocked() (bool, error)

Get lock flag

func Send

func Send(senderWallet *client.Wallet, to core.Address, amount *common.Amount, tip uint64, contract string, bc *core.Blockchain, node *network.Node) ([]byte, error)

func SendFromMiner added in v0.1.2

func SendFromMiner(address core.Address, amount *common.Amount, bc *core.Blockchain) error

add balance

func SetLockWallet added in v0.1.2

func SetLockWallet() error

Set lock flag

func SetMinerKeyPair added in v0.1.2

func SetMinerKeyPair(key string)

func SetUnLockWallet added in v0.1.2

func SetUnLockWallet() error

Set unlock and timer

Types

This section is empty.

Jump to

Keyboard shortcuts

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