ledger

package
v0.0.0-...-3f8eaf4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

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.SimpleName
	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.SimpleTransaction) ([]types.SimpleStatement, error)

GetStatements returns a statement from a given transaction

func (*Ledger) SetContexts

func (l *Ledger) SetContexts(chain string, apps []types.SimpleAppearance) 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.

Jump to

Keyboard shortcuts

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