account

package
v0.0.0-...-9ae6259 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	GetAddressBalance(addr string) (float64, error)
	GetAddressTransactions(addr string) ([]string, error)
	GetAddressUnspentOutputs(addr string) ([]*mongo.Unspent, error)
	GetAddressResult(addr string) (*UserData, error)
}

Account provides worker with all account relevant information

func New

func New(customLogger *log.Logger, customLogger2 logger.CustomLogger, config *Config) Account

New creates an instance of Account

type Config

type Config struct {
	Btcd  btcd.Btcd
	Mongo mongo.Mongo
	Redis rs.Redis
}

Config includes all necessary arguments during operation

type UserData

type UserData struct {
	Balance      float64         `json:"balance"`
	Transactions []string        `json:"transactions"`
	Unspents     []mongo.Unspent `json:"unspents"`
}

UserData is ideal data schema for 'GetAddressResult'

func (UserData) ToJSON

func (u UserData) ToJSON() ([]byte, error)

ToJSON encodes itself to JSON string represented in []byte

Jump to

Keyboard shortcuts

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