exchange

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exchanges

func Exchanges() map[string]Subscriber

func Logger

func Logger() *logrus.Logger

func Register

func Register(name string, s Subscriber)

func SetLogger

func SetLogger(l *logrus.Logger)

Types

type Asset

type Asset struct {
	Code     string         `mapstructure:"code"`
	Pair     Pair           `mapstructure:"pair"`
	Simulate SimulateParams `mapstructure:"simulate"`
}

func NewAsset

func NewAsset(code string, pair Pair) Asset

type CurrencyPair

type CurrencyPair = goex.CurrencyPair

type Pair

type Pair struct {
	BaseAsset  string `mapstructure:"base"`
	QuoteAsset string `mapstructure:"quote"`
}

func NewPair

func NewPair(baseAsset string, quoteAsset string) Pair

func (*Pair) CurrencyPair

func (p *Pair) CurrencyPair() CurrencyPair

func (*Pair) ID

func (p *Pair) ID() string

type SimulateParams

type SimulateParams struct {
	Enabled  bool `mapstructure:"enabled"`
	MinPrice int  `mapstructure:"min_price"`
	MaxPrice int  `mapstructure:"max_price"`
	PeriodS  int  `mapstructure:"period_s"`
}

type Subscriber

type Subscriber interface {
	Subscribe(Asset, chan Ticker) error
}

type Ticker

type Ticker struct {
	Asset      Asset
	Price      sdk.Int
	Exchange   string
	ReceivedAt time.Time
}

func NewTicker

func NewTicker(asset Asset, price sdk.Int, exchange string, receivedAt time.Time) Ticker

func (Ticker) String

func (t Ticker) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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