accounter

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounter

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

Accounter is the main struct that can tally the balance for a given wallet. The main elements of Accounter are backend and deriver. Deriver is used to derive new addresses for a given config, and backend fetches transactions for each address.

Note:

  • We don't track fees. I.e. we don't answer the question: how much have we spent in fees. It shouldn't be hard to answer that question.

func New

func New(b backend.Backend, addressDeriver *deriver.AddressDeriver, lookahead uint32, blockHeight uint32) *Accounter

New instantiates a new Accounter. TODO: find a better way to pass options to the NewCounter. Maybe thru a config or functional option params?

func (*Accounter) ComputeBalance

func (a *Accounter) ComputeBalance() uint64

Jump to

Keyboard shortcuts

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