keeper

package
v0.0.0-...-8024cb9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountExists = errors.New("error account exists")
View Source
var ErrAccountNotFound = errors.New("error account not found")
View Source
var ErrNotSupport = errors.New("error not supported")

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type Account

type Account struct {
	Account   string   `json:"account"`
	Balance   float64  `json:"balance"`
	Addresses []string `json:"addresses"`
}

type Keeper

type Keeper interface {
	GetBlockCount() (int64, error)

	// check if the coin core service avaliable or not,
	// the error might caused by misconfiguration or
	// runtime error. Error happend indicates fatal and
	// could not recover, suicide might be the best choice.
	Ping() error

	// create a new account
	CreateAccount(account string) (Account, error)

	// Get account, together with balance and address
	// return error if account not exist
	GetAccountInfo(account string, conf int) (Account, error)

	// Returns address under accont, use default account if
	// not provided
	GetAddress(account string) (string, error)

	// Return new address under account
	GetNewAddress(account string) (string, error)

	// Return addresses under certain account, default account if
	// no account specicied
	GetAddressesByAccount(account string) ([]string, error)

	// List all accounts/labels together with how much satoshi remains.
	ListAccountsMinConf(conf int) (map[string]float64, error)

	// send bitcoin to address
	SendToAddress(address string, amount float64) (string, error)

	// send bitcoin from some account to target address
	SendFrom(account, address string, amount float64) (string, error)

	// list all UXTO
	ListUnspentMin(minConf int) ([]btcjson.ListUnspentResult, error)

	// Move from one account to another under same wallet
	Move(from, to string, amount float64) (bool, error)
}

Keeper interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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