port

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCurrencyNotFound = errors.New("can't convert currencies, currency not found")
)

Functions

This section is empty.

Types

type MockRateService

type MockRateService struct {
	mock.Mock
}

MockRateService is an autogenerated mock type for the RateService type

func (*MockRateService) ConvertCurrency

func (_m *MockRateService) ConvertCurrency(ctx context.Context, source string, target string) (decimal.Decimal, error)

ConvertCurrency provides a mock function with given fields: ctx, source, target

func (*MockRateService) GetAssetCurrency

func (_m *MockRateService) GetAssetCurrency(assetId string) (string, error)

GetAssetCurrency provides a mock function with given fields: assetId

func (*MockRateService) IsFiatSymbolSupported

func (_m *MockRateService) IsFiatSymbolSupported(symbol string) (bool, error)

IsFiatSymbolSupported provides a mock function with given fields: symbol

type RateService

type RateService interface {
	// ConvertCurrency converts 1 unit of source currency to target currency
	//e.g. ConvertCurrency("EUR", "USD") would convert 1 EUR to USD (1.12 USD)
	ConvertCurrency(ctx context.Context, source, target string) (decimal.Decimal, error)

	// IsFiatSymbolSupported checks if fiat symbol is supported by the rate provider
	IsFiatSymbolSupported(symbol string) (bool, error)

	// GetAssetCurrency returns the currency of the asset
	GetAssetCurrency(assetId string) (string, error)
}

Jump to

Keyboard shortcuts

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