tdexmarketloader

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	BaseBalance  int
	QuoteBalance int
}

type LiquidityProvider

type LiquidityProvider struct {
	Name     string `json:"name"`
	Endpoint string `json:"endpoint"`
	Markets  []Market
}

type Market

type Market struct {
	Url        string
	QuoteAsset string
	BaseAsset  string
}

type Price

type Price struct {
	BasePrice  decimal.Decimal
	QuotePrice decimal.Decimal
}

type Service

type Service interface {
	FetchProvidersMarkets(ctx context.Context) ([]LiquidityProvider, error)
	FetchBalance(ctx context.Context, market Market) (*Balance, error)
	FetchPrice(ctx context.Context, market Market) (*Price, error)
}

func NewService

func NewService(torProxyUrl, registryUrl string, priceAmount int) Service

Jump to

Keyboard shortcuts

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