ledger

package
v0.0.0-...-2a3d9f8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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.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.

Jump to

Keyboard shortcuts

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