currency

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCurrencyTickUpdateFormat walletevent.EventType = "wallet-currency-tick-update-format"
)

Variables

This section is empty.

Functions

func GetAllFiatCurrencySymbols

func GetAllFiatCurrencySymbols() []string

func IsCurrencyFiat

func IsCurrencyFiat(symbol string) bool

Types

type Currency

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

func NewCurrency

func NewCurrency(marketManager *market.Manager) *Currency

func (*Currency) FetchTokenCurrencyFormats

func (cm *Currency) FetchTokenCurrencyFormats(symbols []string) (FormatPerSymbol, error)

type DB

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

func NewCurrencyDB

func NewCurrencyDB(sqlDb *sql.DB) *DB

func (*DB) GetCachedFormats

func (cdb *DB) GetCachedFormats() (FormatPerSymbol, error)

func (*DB) UpdateCachedFormats

func (cdb *DB) UpdateCachedFormats(formats FormatPerSymbol) error

type Format

type Format struct {
	Symbol              string `json:"symbol"`
	DisplayDecimals     uint   `json:"displayDecimals"`
	StripTrailingZeroes bool   `json:"stripTrailingZeroes"`
}

type FormatPerSymbol

type FormatPerSymbol = map[string]Format

func GetFiatCurrencyFormats

func GetFiatCurrencyFormats(symbols []string) (FormatPerSymbol, error)

type Service

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

func NewService

func NewService(db *sql.DB, walletFeed *event.Feed, tokenManager *token.Manager, marketManager *market.Manager) *Service

func (*Service) FetchAllCurrencyFormats

func (s *Service) FetchAllCurrencyFormats() (FormatPerSymbol, error)

func (*Service) GetCachedCurrencyFormats

func (s *Service) GetCachedCurrencyFormats() (FormatPerSymbol, error)

func (*Service) Start

func (s *Service) Start()

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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