Documentation
¶
Index ¶
- func InvMarketConverter(market, typ string) (string, string)
- func MarketConverter(market, typ string) (string, string)
- type Account
- type LineItem
- type Model
- func (m *Model) AddSingleTxn(txn Transaction) error
- func (m *Model) AddTxns(txns []Transaction) error
- func (m *Model) Checksum(filename string) bool
- func (m *Model) Close() error
- func (m *Model) Commit() error
- func (m *Model) GetNonce() int
- func (m *Model) ProcessModel()
- func (m *Model) Revalue(date time.Time) float64
- func (m *Model) SortTxns()
- func (m *Model) UpdateNonces()
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvMarketConverter ¶
func MarketConverter ¶
Types ¶
type Account ¶
func NewAccount ¶
func (*Account) Credit ¶
Takes a date and an amount to credit, returns the total cost base, the units sold that were over a year old and the cost base amount of those units
func (*Account) Recalculate ¶
func (a *Account) Recalculate()
type Model ¶
type Model struct { GainsDB cgtdb.Database Pricer prices.Pricer Config *config.Config Nonce int Txns []Transaction Files []string Accounts map[string]*Account CapitalGains float64 DiscountAvailableCGTGain float64 TradingGains float64 UnrealisedGains float64 StartDate time.Time EndDate time.Time }
func (*Model) AddSingleTxn ¶
func (m *Model) AddSingleTxn(txn Transaction) error
func (*Model) AddTxns ¶
func (m *Model) AddTxns(txns []Transaction) error
func (*Model) ProcessModel ¶
func (m *Model) ProcessModel()
func (*Model) UpdateNonces ¶
func (m *Model) UpdateNonces()
type Transaction ¶
type Transaction struct { Date time.Time Exchange string ExchangeID string BaseCurrency string BaseSpent float64 QuoteCurrency string QuoteReceived float64 Proceeds float64 CostBase float64 TradingCostBase float64 Gain float64 TradingGain float64 DiscountAvailableCGTGain float64 Trace []byte Nonce int }
func NewTransaction ¶
func NewTransaction(date, buycurrency, buyamount, sellcurrency, sellamount string) *Transaction
func NewTransactionShortDate ¶
func NewTransactionShortDate(date, buycurrency, buyamount, sellcurrency, sellamount string) *Transaction
Click to show internal directories.
Click to hide internal directories.