Documentation ¶
Index ¶
- func LimitGetHistoricCandlesDuration(interval domain.CandleInterval) time.Duration
- type ApiClient
- type RealClient
- func (a *RealClient) GetAccounts() ([]*domain.Account, error)
- func (a *RealClient) GetCandles(figi string, from time.Time, to time.Time, interval domain.CandleInterval) ([]*domain.HistoricCandle, error)
- func (a *RealClient) GetLastPrices() ([]*domain.LastPrice, error)
- func (a *RealClient) GetOrders(accountId string) ([]*domain.OrderState, error)
- func (a *RealClient) GetPortfolio(accountId string) ([]*domain.PortfolioPosition, error)
- func (a *RealClient) GetSandboxAccounts() ([]*domain.Account, error)
- func (a *RealClient) GetSandboxOrders(accountId string) ([]*domain.OrderState, error)
- func (a *RealClient) GetSandboxPortfolio(accountId string) ([]*domain.PortfolioPosition, error)
- func (a *RealClient) GetSandboxPositions(accountId string) (*domain.PositionsResponse, error)
- func (a *RealClient) GetShares() ([]*domain.Share, error)
- func (a *RealClient) OpenSandboxAccount() (string, error)
- func (a *RealClient) PostOrder(figi string, lots int64, price decimal.Decimal, ...) (*domain.PostOrderResponse, error)
- func (a *RealClient) PostSandboxOrder(figi string, lots int64, price decimal.Decimal, ...) (*domain.PostOrderResponse, error)
- func (a *RealClient) SandboxPayIn(accountId string, amount *domain.MoneyValue) error
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) 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 NewRealClient ¶
func NewRealClient( cMarket investapi.MarketDataServiceClient, cInstrument investapi.InstrumentsServiceClient, cOrder investapi.OrdersServiceClient, cUsers investapi.UsersServiceClient, cSandbox investapi.SandboxServiceClient, cOperations investapi.OperationsServiceClient, ) *RealClient
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) 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.