apiclient

package
v0.0.0-...-74f9a32 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitGetHistoricCandlesDuration

func LimitGetHistoricCandlesDuration(interval domain.CandleInterval) time.Duration

Types

type ApiClient

type ApiClient interface {
	GetCandles(figi string, from time.Time, to time.Time, interval domain.CandleInterval) ([]*domain.HistoricCandle, error)
	GetShares() ([]*domain.Share, error)
	PostOrder(figi string, lots int64, price decimal.Decimal, direction domain.OrderDirection, accountId string, orderType domain.OrderType) (*domain.PostOrderResponse, error)
	GetLastPrices() ([]*domain.LastPrice, error)
	GetAccounts() ([]*domain.Account, error)
	GetSandboxAccounts() ([]*domain.Account, error)
	OpenSandboxAccount() (string, error)
	GetSandboxPositions(accountId string) (*domain.PositionsResponse, error)
	SandboxPayIn(accountId string, amount *domain.MoneyValue) error
	PostSandboxOrder(figi string, lots int64, price decimal.Decimal, direction domain.OrderDirection, accountId string, orderType domain.OrderType) (*domain.PostOrderResponse, error)
	GetSandboxPortfolio(accountId string) ([]*domain.PortfolioPosition, error)
	GetPortfolio(accountId string) ([]*domain.PortfolioPosition, error)
	GetOrders(accountId string) ([]*domain.OrderState, error)
	GetSandboxOrders(accountId string) ([]*domain.OrderState, error)
}

type RealClient

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

func (*RealClient) GetAccounts

func (a *RealClient) GetAccounts() ([]*domain.Account, error)

func (*RealClient) GetCandles

func (a *RealClient) GetCandles(figi string, from time.Time, to time.Time, interval domain.CandleInterval) ([]*domain.HistoricCandle, error)

func (*RealClient) GetLastPrices

func (a *RealClient) GetLastPrices() ([]*domain.LastPrice, error)

func (*RealClient) GetOrders

func (a *RealClient) GetOrders(accountId string) ([]*domain.OrderState, error)

func (*RealClient) GetPortfolio

func (a *RealClient) GetPortfolio(accountId string) ([]*domain.PortfolioPosition, error)

func (*RealClient) GetSandboxAccounts

func (a *RealClient) GetSandboxAccounts() ([]*domain.Account, error)

func (*RealClient) GetSandboxOrders

func (a *RealClient) GetSandboxOrders(accountId string) ([]*domain.OrderState, error)

func (*RealClient) GetSandboxPortfolio

func (a *RealClient) GetSandboxPortfolio(accountId string) ([]*domain.PortfolioPosition, error)

func (*RealClient) GetSandboxPositions

func (a *RealClient) GetSandboxPositions(accountId string) (*domain.PositionsResponse, error)

func (*RealClient) GetShares

func (a *RealClient) GetShares() ([]*domain.Share, error)

func (*RealClient) OpenSandboxAccount

func (a *RealClient) OpenSandboxAccount() (string, error)

func (*RealClient) PostOrder

func (a *RealClient) PostOrder(figi string, lots int64, price decimal.Decimal, direction domain.OrderDirection, accountId string, orderType domain.OrderType) (*domain.PostOrderResponse, error)

func (*RealClient) PostSandboxOrder

func (a *RealClient) PostSandboxOrder(figi string, lots int64, price decimal.Decimal, direction domain.OrderDirection, accountId string, orderType domain.OrderType) (*domain.PostOrderResponse, error)

func (*RealClient) SandboxPayIn

func (a *RealClient) SandboxPayIn(accountId string, amount *domain.MoneyValue) error

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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