service

package
v0.0.0-...-abc9c84 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 18 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 {
	// contains filtered or unexported fields
}

func NewBalance

func NewBalance(
	storage *storage.Storage,
	eventBroker *broker.Broker,
	accEventBroker *broker.Broker,
	wsSvc *WS,
	logger *zerolog.Logger,
) *Balance

func (*Balance) GetBalance

func (s *Balance) GetBalance(ctx context.Context) error

func (*Balance) UpdateStorageBalances

func (s *Balance) UpdateStorageBalances(balances []*response.Balance) error

func (*Balance) WaitForSufficientBalance

func (s *Balance) WaitForSufficientBalance(ctx context.Context, pair string, amount *big.Float) error

type Conversion

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

func NewConversion

func NewConversion(storage *storage.Storage, logger *zerolog.Logger) *Conversion

func (*Conversion) GetAskUSDTPrice

func (s *Conversion) GetAskUSDTPrice(currency string) *big.Float

func (*Conversion) GetBidUSDTPrice

func (s *Conversion) GetBidUSDTPrice(currency string) *big.Float

func (*Conversion) GetUSDTPrice

func (s *Conversion) GetUSDTPrice(currency string) (*big.Float, error)

type Manager

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

func NewManager

func NewManager(logger *zerolog.Logger) *Manager

func (*Manager) ListenSignal

func (s *Manager) ListenSignal() (context.Context, chan<- os.Signal)

type Order

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

func NewOrder

func NewOrder(
	cfg *conf.Bot,
	storage *storage.Storage,
	wsEventBroker *broker.Broker,
	wsSvc *WS,
	logger *zerolog.Logger,
) *Order

func (*Order) CancelOrder

func (s *Order) CancelOrder(orderID int64) error

func (*Order) SendCancelOrderRequest

func (s *Order) SendCancelOrderRequest(orderID int64) error

func (*Order) UpdateOrderState

func (s *Order) UpdateOrderState(ctx context.Context, rid int64) (*storage.Order, error)

func (*Order) UpdateOrdersStates

func (s *Order) UpdateOrdersStates(ctx context.Context) error

type Telegram

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

func NewTelegram

func NewTelegram(cfg *conf.Bot, bot *tb.Bot, logger *zerolog.Logger) *Telegram

func (*Telegram) SendAsync

func (s *Telegram) SendAsync(msg string)

func (*Telegram) SendSync

func (s *Telegram) SendSync(msg string)

func (*Telegram) Start

func (s *Telegram) Start()

type WS

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

func NewWS

func NewWS(cfg *conf.Bot, eventBroker *broker.Broker, logger *zerolog.Logger) *WS

func (*WS) AlterOrder

func (s *WS) AlterOrder(pair, volume, limitPrice string, tradeIntent int, orderID int64) (int64, string, error)

func (*WS) CancelOrder

func (s *WS) CancelOrder(orderID int64) (int64, error)

func (*WS) Close

func (s *WS) Close()

func (*WS) Connect

func (s *WS) Connect(g *errgroup.Group) error

func (*WS) CreateOrder

func (s *WS) CreateOrder(pair, volume, limitPrice string, tradeIntent int) (int64, string, error)

func (*WS) GetBalance

func (s *WS) GetBalance() (int64, error)

func (*WS) GetOrder

func (s *WS) GetOrder(orderID int64) (int64, error)

func (*WS) GetOrderBookAndSubscribe

func (s *WS) GetOrderBookAndSubscribe(pairs string) (int64, error)

func (*WS) GetOrderByExtID

func (s *WS) GetOrderByExtID(extID string) (int64, error)

func (*WS) GetPairsAndSubscribe

func (s *WS) GetPairsAndSubscribe() (int64, error)

func (*WS) Start

func (s *WS) Start(ctx context.Context) error

func (*WS) SubscribeAccounting

func (s *WS) SubscribeAccounting(includeDeals bool) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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