exchanges

package
v0.0.0-...-d3d1593 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseExchangeClient

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

func NewBaseExchangeClient

func NewBaseExchangeClient(name string, url string, client ExchangeClient) *BaseExchangeClient

func (*BaseExchangeClient) Connect

func (c *BaseExchangeClient) Connect(ctx context.Context) error

func (*BaseExchangeClient) Disconnect

func (c *BaseExchangeClient) Disconnect()

func (*BaseExchangeClient) GetOrderBook

func (c *BaseExchangeClient) GetOrderBook(symbol string) *orderbook.OrderBook

func (*BaseExchangeClient) Name

func (c *BaseExchangeClient) Name() string

func (*BaseExchangeClient) ReadMessages

func (c *BaseExchangeClient) ReadMessages(
	ctx context.Context,
	handleMessage func(WebSocketMessage) error,
	pingInterval time.Duration,
) error

func (*BaseExchangeClient) RegisterOrderBook

func (c *BaseExchangeClient) RegisterOrderBook(symbol string, ob *orderbook.OrderBook)

func (*BaseExchangeClient) SendPing

func (c *BaseExchangeClient) SendPing() error

type BinanceClient

type BinanceClient struct {
	*BaseExchangeClient
	// contains filtered or unexported fields
}

func NewBinanceClient

func NewBinanceClient() *BinanceClient

func (*BinanceClient) ReadMessages

func (c *BinanceClient) ReadMessages(ctx context.Context) error

func (*BinanceClient) Subscribe

func (c *BinanceClient) Subscribe(symbols []string) error

type BitflyerClient

type BitflyerClient struct {
	*BaseExchangeClient
	// contains filtered or unexported fields
}

func NewBitflyerClient

func NewBitflyerClient() *BitflyerClient

func (*BitflyerClient) ReadMessages

func (c *BitflyerClient) ReadMessages(ctx context.Context) error

func (*BitflyerClient) Subscribe

func (c *BitflyerClient) Subscribe(symbols []string) error

type ExchangeClient

type ExchangeClient interface {
	Name() string
	Connect(ctx context.Context) error
	Disconnect()
	RegisterOrderBook(symbol string, ob *orderbook.OrderBook)
	GetOrderBook(symbol string) *orderbook.OrderBook
	Subscribe(pairs []string) error
	ReadMessages(ctx context.Context) error
	SendPing() error
}

type ExchangePair

type ExchangePair struct {
	Exchange string
	Symbol   string
}

type KrakenClient

type KrakenClient struct {
	*BaseExchangeClient
	// contains filtered or unexported fields
}

func NewKrakenClient

func NewKrakenClient() *KrakenClient

func (*KrakenClient) ReadMessages

func (c *KrakenClient) ReadMessages(ctx context.Context) error

type Pair

type Pair struct {
	StandardSymbol  string
	ExchangePairs   []ExchangePair
	ProfitThreshold decimal.Decimal
}

type PoloniexClient

type PoloniexClient struct {
	*BaseExchangeClient
	// contains filtered or unexported fields
}

func NewPoloniexClient

func NewPoloniexClient() *PoloniexClient

func (*PoloniexClient) ReadMessages

func (c *PoloniexClient) ReadMessages(ctx context.Context) error

func (*PoloniexClient) SendPing

func (c *PoloniexClient) SendPing() error

func (*PoloniexClient) Subscribe

func (c *PoloniexClient) Subscribe(symbols []string) error

type WebSocketMessage

type WebSocketMessage struct {
	Type int
	Data []byte
}

Jump to

Keyboard shortcuts

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