rates

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCalculator added in v1.0.0

func InitCalculator(source ratesSource) *calculator

Types

type Market added in v1.2.0

type Market struct {
	ID                    int64
	Name                  string
	UsdPrice              float64
	ApiURL                string
	TonPriceConverter     func(closer io.ReadCloser) (float64, error)
	FiatPriceConverter    func(closer io.ReadCloser) map[string]float64
	PoolResponseConverter func(tonApiToken string, tonPrice float64, respBody io.ReadCloser) map[ton.AccountID]float64
	DateUpdate            time.Time
}

type Mock added in v1.1.0

type Mock struct {
	TonApiToken string
}

func (*Mock) GetCurrentMarketsTonPrice added in v1.2.0

func (m *Mock) GetCurrentMarketsTonPrice() ([]Market, error)

func (*Mock) GetCurrentRates added in v1.1.0

func (m *Mock) GetCurrentRates() (map[string]float64, error)

func (Mock) GetMarketsTonPrice added in v1.2.0

func (m Mock) GetMarketsTonPrice() ([]Market, error)

func (Mock) GetRates added in v1.1.0

func (m Mock) GetRates(date int64) (map[string]float64, error)

func (Mock) GetRatesChart added in v1.1.0

func (m Mock) GetRatesChart(token string, currency string, pointsCount int, startDate *int64, endDate *int64) ([][]any, error)

Jump to

Keyboard shortcuts

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