Documentation ¶
Overview ¶
Package ledger aids in doing reconciliations
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNonIndexedTransfer = fmt.Errorf("non-indexed transfer")
Functions ¶
This section is empty.
Types ¶
type Ledger ¶
type Ledger struct { Chain string AccountFor base.Address FirstBlock base.Blknum LastBlock base.Blknum Names map[base.Address]types.Name TestMode bool Contexts map[ledgerContextKey]*ledgerContext AsEther bool NoZero bool Reversed bool UseTraces bool Conn *rpc.Connection // contains filtered or unexported fields }
Ledger is a structure that carries enough information to complate a reconciliation
func NewLedger ¶
func NewLedger(conn *rpc.Connection, acctFor base.Address, fb, lb base.Blknum, asEther, testMode, noZero, useTraces, reversed bool, assetFilters *[]string) *Ledger
NewLedger returns a new empty Ledger struct
func (*Ledger) GetStatements ¶
func (l *Ledger) GetStatements(conn *rpc.Connection, filter *filter.AppearanceFilter, trans *types.Transaction) ([]types.Statement, error)
GetStatements returns a statement from a given transaction
func (*Ledger) SetContexts ¶
func (l *Ledger) SetContexts(chain string, apps []types.Appearance) error
SetContexts visits the list of appearances and notes the block numbers of the next and previous appearance's and if they are the same or different. Because balances are only available per block, we must know this information to be able to calculate the correct post-tx balance.
Click to show internal directories.
Click to hide internal directories.