priceupdater

package
v1.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UpdateMethodTypeBitFinexV2 is the http API used by bitfinex V2
	UpdateMethodTypeBitFinexV2 string = "bitfinexV2"
	// UpdateMethodTypeCoingeckoV3 is the http API used by copingecko V3
	UpdateMethodTypeCoingeckoV3 string = "CoinGeckoV3"
	// UpdateMethodTypeIgnore indicates to not update the value, to set value 0
	// it's better to use UpdateMethodTypeStatic
	UpdateMethodTypeIgnore string = "ignore"
)

Variables

This section is empty.

Functions

func ProviderValidation added in v1.4.0

func ProviderValidation(sl validator.StructLevel)

ProviderValidation method is for validation of Provider struct

Types

type Fiat added in v1.4.0

type Fiat struct {
	APIKey       string
	URL          string
	BaseCurrency string
	Currencies   string
}

Fiat definition

type PriceUpdater

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

PriceUpdater definition

func NewPriceUpdater

func NewPriceUpdater(
	updateMethodTypesPriority string,
	providers []Provider,
	staticTokens string,
	fiat Fiat,
	db *historydb.HistoryDB,
) (*PriceUpdater, error)

NewPriceUpdater is the constructor for the updater

func (*PriceUpdater) UpdateFiatPrices added in v1.4.0

func (p *PriceUpdater) UpdateFiatPrices(ctx context.Context) error

UpdateFiatPrices updates the fiat prices

func (*PriceUpdater) UpdateFiatPricesMock added in v1.4.0

func (p *PriceUpdater) UpdateFiatPricesMock(ctx context.Context) error

UpdateFiatPricesMock updates the fiat prices

func (*PriceUpdater) UpdatePrices

func (p *PriceUpdater) UpdatePrices(ctx context.Context)

UpdatePrices is triggered by the Coordinator, and internally will update the token prices in the db

func (*PriceUpdater) UpdateTokenList

func (p *PriceUpdater) UpdateTokenList() error

UpdateTokenList get the registered token symbols from HistoryDB

type Provider added in v1.4.0

type Provider struct {
	Provider       string
	BaseURL        string
	URL            string
	URLExtraParams string
	SymbolsMap     symbolsMap
	AddressesMap   addressesMap
	Symbols        string
	Addresses      string
}

Provider definition

Jump to

Keyboard shortcuts

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