Versions in this module Expand all Collapse all v0 v0.1.0 Aug 11, 2023 Changes in this version + const BILLION + const WAIT_BETWEEN + func CreateUid() string + func FloatToQuotation(number float64, step *pb.Quotation) *pb.Quotation + func MessageFromHeader(md metadata.MD) string + func RemainingLimitFromHeader(md metadata.MD) int + func TimeToTimestamp(t time.Time) *timestamppb.Timestamp + type AssetResponse struct + Header metadata.MD + func (p *AssetResponse) GetHeader() metadata.MD + type AssetsResponse struct + Header metadata.MD + func (p *AssetsResponse) GetHeader() metadata.MD + type BondResponse struct + Header metadata.MD + func (p *BondResponse) GetHeader() metadata.MD + type BondsResponse struct + Header metadata.MD + func (p *BondsResponse) GetHeader() metadata.MD + type Brand struct + Header metadata.MD + func (p *Brand) GetHeader() metadata.MD + type CancelOrderResponse struct + Header metadata.MD + func (p *CancelOrderResponse) GetHeader() metadata.MD + type CancelStopOrderResponse struct + Header metadata.MD + func (p *CancelStopOrderResponse) GetHeader() metadata.MD + type Client struct + Config Config + Logger Logger + func NewClient(ctx context.Context, conf Config, l Logger) (*Client, error) + func (c *Client) NewInstrumentsServiceClient() *InstrumentsServiceClient + func (c *Client) NewMDStreamClient() *MDStreamClient + func (c *Client) NewMarketDataServiceClient() *MarketDataServiceClient + func (c *Client) NewMarketDataStreamClient() *MarketDataStreamClient + func (c *Client) NewOperationsServiceClient() *OperationsServiceClient + func (c *Client) NewOperationsStreamClient() *OperationsStreamClient + func (c *Client) NewOrdersServiceClient() *OrdersServiceClient + func (c *Client) NewOrdersStreamClient() *OrdersStreamClient + func (c *Client) NewSandboxServiceClient() *SandboxServiceClient + func (c *Client) NewStopOrdersServiceClient() *StopOrdersServiceClient + func (c *Client) NewUsersServiceClient() *UsersServiceClient + func (c *Client) Stop() error + type CloseSandboxAccountResponse struct + Header metadata.MD + func (p *CloseSandboxAccountResponse) GetHeader() metadata.MD + type Config struct + AccountId string + AppName string + DisableAllRetry bool + DisableResourceExhaustedRetry bool + EndPoint string + MaxRetries uint + Token string + func LoadConfig(filename string) (Config, error) + type CurrenciesResponse struct + Header metadata.MD + func (p *CurrenciesResponse) CurrencyResponse() metadata.MD + type CurrencyResponse struct + Header metadata.MD + type EditFavoritesResponse struct + Header metadata.MD + func (p *EditFavoritesResponse) GetHeader() metadata.MD + type EtfResponse struct + Header metadata.MD + func (p *EtfResponse) GetHeader() metadata.MD + type EtfsResponse struct + Header metadata.MD + func (p *EtfsResponse) GetHeader() metadata.MD + type Event int + const DAY + const START + const STOP + type FindInstrumentResponse struct + Header metadata.MD + func (p *FindInstrumentResponse) GetHeader() metadata.MD + type FutureResponse struct + Header metadata.MD + func (p *FutureResponse) GetHeader() metadata.MD + type FuturesResponse struct + Header metadata.MD + func (p *FuturesResponse) GetHeader() metadata.MD + type GenerateBrokerReportResponse struct + Header metadata.MD + func (p *GenerateBrokerReportResponse) GetHeader() metadata.MD + type GetAccountsResponse struct + Header metadata.MD + func (p *GetAccountsResponse) GetHeader() metadata.MD + type GetAccruedInterestsResponse struct + Header metadata.MD + func (p *GetAccruedInterestsResponse) GetHeader() metadata.MD + type GetBondCouponsResponse struct + Header metadata.MD + func (p *GetBondCouponsResponse) GetHeader() metadata.MD + type GetBrandsResponse struct + Header metadata.MD + func (p *GetBrandsResponse) GetHeader() metadata.MD + type GetBrokerReportResponse struct + Header metadata.MD + func (p *GetBrokerReportResponse) GetHeader() metadata.MD + type GetCandlesResponse struct + Header metadata.MD + func (p *GetCandlesResponse) GetHeader() metadata.MD + type GetClosePricesResponse struct + Header metadata.MD + func (p *GetClosePricesResponse) GetHeader() metadata.MD + type GetCountriesResponse struct + Header metadata.MD + func (p *GetCountriesResponse) GetHeader() metadata.MD + type GetDividendsForeignIssuerResponse struct + Header metadata.MD + func (p *GetDividendsForeignIssuerResponse) GetHeader() metadata.MD + type GetDividendsResponse struct + Header metadata.MD + func (p *GetDividendsResponse) GetHeader() metadata.MD + type GetFavoritesResponse struct + Header metadata.MD + func (p *GetFavoritesResponse) GetHeader() metadata.MD + type GetFuturesMarginResponse struct + Header metadata.MD + func (p *GetFuturesMarginResponse) GetHeader() metadata.MD + type GetHistoricCandlesRequest struct + File bool + FileName string + From time.Time + Instrument string + Interval pb.CandleInterval + To time.Time + type GetInfoResponse struct + Header metadata.MD + func (p *GetInfoResponse) GetHeader() metadata.MD + type GetLastPricesResponse struct + Header metadata.MD + func (p *GetLastPricesResponse) GetHeader() metadata.MD + type GetLastTradesResponse struct + Header metadata.MD + func (p *GetLastTradesResponse) GetHeader() metadata.MD + type GetMarginAttributesResponse struct + Header metadata.MD + func (p *GetMarginAttributesResponse) GetHeader() metadata.MD + type GetOperationsByCursorRequest struct + AccountId string + Cursor string + From time.Time + InstrumentId string + Limit int32 + OperationTypes []pb.OperationType + State pb.OperationState + To time.Time + WithoutCommissions bool + WithoutOvernights bool + WithoutTrades bool + type GetOperationsByCursorResponse struct + Header metadata.MD + func (p *GetOperationsByCursorResponse) GetHeader() metadata.MD + type GetOperationsRequest struct + AccountId string + Figi string + From time.Time + State pb.OperationState + To time.Time + type GetOrderBookResponse struct + Header metadata.MD + func (p *GetOrderBookResponse) GetHeader() metadata.MD + type GetOrderStateResponse struct + Header metadata.MD + func (p *GetOrderStateResponse) GetHeader() metadata.MD + type GetOrdersResponse struct + Header metadata.MD + func (p *GetOrdersResponse) GetHeader() metadata.MD + type GetStopOrdersResponse struct + Header metadata.MD + func (p *GetStopOrdersResponse) GetHeader() metadata.MD + type GetTradingStatusResponse struct + Header metadata.MD + func (p *GetTradingStatusResponse) GetHeader() metadata.MD + type GetTradingStatusesResponse struct + Header metadata.MD + func (p *GetTradingStatusesResponse) GetHeader() metadata.MD + type GetUserTariffResponse struct + Header metadata.MD + func (p *GetUserTariffResponse) GetHeader() metadata.MD + type InstrumentResponse struct + Header metadata.MD + func (p *InstrumentResponse) GetHeader() metadata.MD + type InstrumentsServiceClient struct + func (is *InstrumentsServiceClient) BondByFigi(id string) (*BondResponse, error) + func (is *InstrumentsServiceClient) BondByPositionUid(id string) (*BondResponse, error) + func (is *InstrumentsServiceClient) BondByTicker(id string, classCode string) (*BondResponse, error) + func (is *InstrumentsServiceClient) BondByUid(id string) (*BondResponse, error) + func (is *InstrumentsServiceClient) Bonds(status pb.InstrumentStatus) (*BondsResponse, error) + func (is *InstrumentsServiceClient) Currencies(status pb.InstrumentStatus) (*CurrenciesResponse, error) + func (is *InstrumentsServiceClient) CurrencyByFigi(id string) (*CurrencyResponse, error) + func (is *InstrumentsServiceClient) CurrencyByPositionUid(id string) (*CurrencyResponse, error) + func (is *InstrumentsServiceClient) CurrencyByTicker(id string, classCode string) (*CurrencyResponse, error) + func (is *InstrumentsServiceClient) CurrencyByUid(id string) (*CurrencyResponse, error) + func (is *InstrumentsServiceClient) EditFavorites(instruments []string, actionType pb.EditFavoritesActionType) (*EditFavoritesResponse, error) + func (is *InstrumentsServiceClient) EtfByFigi(id string) (*EtfResponse, error) + func (is *InstrumentsServiceClient) EtfByPositionUid(id string) (*EtfResponse, error) + func (is *InstrumentsServiceClient) EtfByTicker(id string, classCode string) (*EtfResponse, error) + func (is *InstrumentsServiceClient) EtfByUid(id string) (*EtfResponse, error) + func (is *InstrumentsServiceClient) Etfs(status pb.InstrumentStatus) (*EtfsResponse, error) + func (is *InstrumentsServiceClient) FindInstrument(query string) (*FindInstrumentResponse, error) + func (is *InstrumentsServiceClient) FutureByFigi(id string) (*FutureResponse, error) + func (is *InstrumentsServiceClient) FutureByPositionUid(id string) (*FutureResponse, error) + func (is *InstrumentsServiceClient) FutureByTicker(id string, classCode string) (*FutureResponse, error) + func (is *InstrumentsServiceClient) FutureByUid(id string) (*FutureResponse, error) + func (is *InstrumentsServiceClient) Futures(status pb.InstrumentStatus) (*FuturesResponse, error) + func (is *InstrumentsServiceClient) GetAccruedInterests(figi string, from, to time.Time) (*GetAccruedInterestsResponse, error) + func (is *InstrumentsServiceClient) GetAssetBy(id string) (*AssetResponse, error) + func (is *InstrumentsServiceClient) GetAssets() (*AssetsResponse, error) + func (is *InstrumentsServiceClient) GetBondCoupons(figi string, from, to time.Time) (*GetBondCouponsResponse, error) + func (is *InstrumentsServiceClient) GetBrandBy(id string) (*Brand, error) + func (is *InstrumentsServiceClient) GetBrands() (*GetBrandsResponse, error) + func (is *InstrumentsServiceClient) GetCountries() (*GetCountriesResponse, error) + func (is *InstrumentsServiceClient) GetDividents(figi string, from, to time.Time) (*GetDividendsResponse, error) + func (is *InstrumentsServiceClient) GetFavorites() (*GetFavoritesResponse, error) + func (is *InstrumentsServiceClient) GetFuturesMargin(figi string) (*GetFuturesMarginResponse, error) + func (is *InstrumentsServiceClient) InstrumentByFigi(id string) (*InstrumentResponse, error) + func (is *InstrumentsServiceClient) InstrumentByPositionUid(id string) (*InstrumentResponse, error) + func (is *InstrumentsServiceClient) InstrumentByTicker(id string, classCode string) (*InstrumentResponse, error) + func (is *InstrumentsServiceClient) InstrumentByUid(id string) (*InstrumentResponse, error) + func (is *InstrumentsServiceClient) LotByFigi(figi string) (int64, error) + func (is *InstrumentsServiceClient) LotByUid(uid string) (int64, error) + func (is *InstrumentsServiceClient) OptionByPositionUid(id string) (*OptionResponse, error) + func (is *InstrumentsServiceClient) OptionByTicker(id string, classCode string) (*OptionResponse, error) + func (is *InstrumentsServiceClient) OptionByUid(id string) (*OptionResponse, error) + func (is *InstrumentsServiceClient) Options(status pb.InstrumentStatus) (*OptionsResponse, error) + func (is *InstrumentsServiceClient) ShareByFigi(id string) (*ShareResponse, error) + func (is *InstrumentsServiceClient) ShareByPositionUid(id string) (*ShareResponse, error) + func (is *InstrumentsServiceClient) ShareByTicker(id string, classCode string) (*ShareResponse, error) + func (is *InstrumentsServiceClient) ShareByUid(id string) (*ShareResponse, error) + func (is *InstrumentsServiceClient) Shares(status pb.InstrumentStatus) (*SharesResponse, error) + func (is *InstrumentsServiceClient) TradingSchedules(exchange string, from, to time.Time) (*TradingSchedulesResponse, error) + type Logger interface + Errorf func(template string, args ...any) + Fatalf func(template string, args ...any) + Infof func(template string, args ...any) + type MDStream struct + type MDStreamClient struct + func (c *MDStreamClient) MarketDataStream() (*MDStream, error) + type MarketDataServiceClient struct + func (md *MarketDataServiceClient) GetAllHistoricCandles(req *GetHistoricCandlesRequest) ([]*pb.HistoricCandle, error) + func (md *MarketDataServiceClient) GetCandles(instrumentId string, interval pb.CandleInterval, from, to time.Time) (*GetCandlesResponse, error) + func (md *MarketDataServiceClient) GetClosePrices(instrumentIds []string) (*GetClosePricesResponse, error) + func (md *MarketDataServiceClient) GetHistoricCandles(req *GetHistoricCandlesRequest) ([]*pb.HistoricCandle, error) + func (md *MarketDataServiceClient) GetLastPrices(instrumentIds []string) (*GetLastPricesResponse, error) + func (md *MarketDataServiceClient) GetLastTrades(instrumentId string, from, to time.Time) (*GetLastTradesResponse, error) + func (md *MarketDataServiceClient) GetOrderBook(instrumentId string, depth int32) (*GetOrderBookResponse, error) + func (md *MarketDataServiceClient) GetTradingStatus(instrumentId string) (*GetTradingStatusResponse, error) + func (md *MarketDataServiceClient) GetTradingStatuses(instrumentIds []string) (*GetTradingStatusesResponse, error) + type MarketDataStream struct + func (mds *MarketDataStream) GetMySubscriptions() error + func (mds *MarketDataStream) Listen() error + func (mds *MarketDataStream) Stop() + func (mds *MarketDataStream) SubscribeCandle(ids []string, interval pb.SubscriptionInterval, waitingClose bool) (<-chan *pb.Candle, error) + func (mds *MarketDataStream) SubscribeInfo(ids []string) (<-chan *pb.TradingStatus, error) + func (mds *MarketDataStream) SubscribeLastPrice(ids []string) (<-chan *pb.LastPrice, error) + func (mds *MarketDataStream) SubscribeOrderBook(ids []string, depth int32) (<-chan *pb.OrderBook, error) + func (mds *MarketDataStream) SubscribeTrade(ids []string) (<-chan *pb.Trade, error) + func (mds *MarketDataStream) UnSubscribeAll() error + func (mds *MarketDataStream) UnSubscribeCandle(ids []string, interval pb.SubscriptionInterval, waitingClose bool) error + func (mds *MarketDataStream) UnSubscribeInfo(ids []string) error + func (mds *MarketDataStream) UnSubscribeLastPrice(ids []string) error + func (mds *MarketDataStream) UnSubscribeOrderBook(ids []string) error + func (mds *MarketDataStream) UnSubscribeTrade(ids []string) error + type MarketDataStreamClient struct + func (c *MarketDataStreamClient) MarketDataStream() (*MarketDataStream, error) + type OpenSandboxAccountResponse struct + Header metadata.MD + func (p *OpenSandboxAccountResponse) GetHeader() metadata.MD + type OperationsResponse struct + Header metadata.MD + func (p *OperationsResponse) GetHeader() metadata.MD + type OperationsServiceClient struct + func (os *OperationsServiceClient) GenerateBrokerReport(accountId string, from, to time.Time) (*GenerateBrokerReportResponse, error) + func (os *OperationsServiceClient) GenerateDividentsForeignIssuer(accountId string, from, to time.Time) (*GetDividendsForeignIssuerResponse, error) + func (os *OperationsServiceClient) GetBrokerReport(taskId string, page int32) (*GetBrokerReportResponse, error) + func (os *OperationsServiceClient) GetDividentsForeignIssuer(taskId string, page int32) (*GetDividendsForeignIssuerResponse, error) + func (os *OperationsServiceClient) GetOperations(req *GetOperationsRequest) (*OperationsResponse, error) + func (os *OperationsServiceClient) GetOperationsByCursor(req *GetOperationsByCursorRequest) (*GetOperationsByCursorResponse, error) + func (os *OperationsServiceClient) GetOperationsByCursorShort(accountId string) (*GetOperationsByCursorResponse, error) + func (os *OperationsServiceClient) GetPortfolio(accountId string, currency pb.PortfolioRequest_CurrencyRequest) (*PortfolioResponse, error) + func (os *OperationsServiceClient) GetPositions(accountId string) (*PositionsResponse, error) + func (os *OperationsServiceClient) GetWithdrawLimits(accountId string) (*WithdrawLimitsResponse, error) + type OperationsStreamClient struct + func (o *OperationsStreamClient) PortfolioStream(accounts []string) (*PortfolioStream, error) + func (o *OperationsStreamClient) PositionsStream(accounts []string) (*PositionsStream, error) + type OptionResponse struct + Header metadata.MD + func (p *OptionResponse) GetHeader() metadata.MD + type OptionsResponse struct + Header metadata.MD + func (p *OptionsResponse) GetHeader() metadata.MD + type OrdersServiceClient struct + func (os *OrdersServiceClient) Buy(req *PostOrderRequestShort) (*PostOrderResponse, error) + func (os *OrdersServiceClient) CancelOrder(accountId, orderId string) (*CancelOrderResponse, error) + func (os *OrdersServiceClient) GetOrderState(accountId, orderId string) (*GetOrderStateResponse, error) + func (os *OrdersServiceClient) GetOrders(accountId string) (*GetOrdersResponse, error) + func (os *OrdersServiceClient) PostOrder(req *PostOrderRequest) (*PostOrderResponse, error) + func (os *OrdersServiceClient) ReplaceOrder(req *ReplaceOrderRequest) (*PostOrderResponse, error) + func (os *OrdersServiceClient) Sell(req *PostOrderRequestShort) (*PostOrderResponse, error) + type OrdersStreamClient struct + func (o *OrdersStreamClient) TradesStream(accounts []string) (*TradesStream, error) + type PortfolioResponse struct + Header metadata.MD + func (p *PortfolioResponse) GetHeader() metadata.MD + type PortfolioStream struct + func (p *PortfolioStream) Listen() error + func (p *PortfolioStream) Portfolios() <-chan *pb.PortfolioResponse + func (p *PortfolioStream) Stop() + type PositionsResponse struct + Header metadata.MD + func (p *PositionsResponse) GetHeader() metadata.MD + type PositionsStream struct + func (p *PositionsStream) Listen() error + func (p *PositionsStream) Positions() <-chan *pb.PositionData + func (p *PositionsStream) Stop() + type PostOrderRequest struct + AccountId string + Direction pb.OrderDirection + InstrumentId string + OrderId string + OrderType pb.OrderType + Price *pb.Quotation + Quantity int64 + type PostOrderRequestShort struct + AccountId string + InstrumentId string + OrderId string + OrderType pb.OrderType + Price *pb.Quotation + Quantity int64 + type PostOrderResponse struct + Header metadata.MD + func (p *PostOrderResponse) CurrencyResponse() metadata.MD + func (p *PostOrderResponse) GetHeader() metadata.MD + type PostStopOrderRequest struct + AccountId string + Direction pb.StopOrderDirection + ExpirationType pb.StopOrderExpirationType + ExpireDate time.Time + InstrumentId string + Price *pb.Quotation + Quantity int64 + StopOrderType pb.StopOrderType + StopPrice *pb.Quotation + type PostStopOrderResponse struct + Header metadata.MD + func (p *PostStopOrderResponse) GetHeader() metadata.MD + type ReplaceOrderRequest struct + AccountId string + NewOrderId string + OrderId string + Price *pb.Quotation + PriceType pb.PriceType + Quantity int64 + type SandboxPayInRequest struct + AccountId string + Currency string + Nano int32 + Unit int64 + type SandboxPayInResponse struct + Header metadata.MD + func (p *SandboxPayInResponse) GetHeader() metadata.MD + type SandboxServiceClient struct + func (s *SandboxServiceClient) CancelSandboxOrder(accountId, orderId string) (*CancelOrderResponse, error) + func (s *SandboxServiceClient) CloseSandboxAccount(accountId string) (*CloseSandboxAccountResponse, error) + func (s *SandboxServiceClient) GetSandboxAccounts() (*GetAccountsResponse, error) + func (s *SandboxServiceClient) GetSandboxOperations(req *GetOperationsRequest) (*OperationsResponse, error) + func (s *SandboxServiceClient) GetSandboxOperationsByCursor(req *GetOperationsByCursorRequest) (*GetOperationsByCursorResponse, error) + func (s *SandboxServiceClient) GetSandboxOrderState(accountId, orderId string) (*GetOrderStateResponse, error) + func (s *SandboxServiceClient) GetSandboxOrders(accountId string) (*GetOrdersResponse, error) + func (s *SandboxServiceClient) GetSandboxPortfolio(accountId string, currency pb.PortfolioRequest_CurrencyRequest) (*PortfolioResponse, error) + func (s *SandboxServiceClient) GetSandboxPositions(accountId string) (*PositionsResponse, error) + func (s *SandboxServiceClient) GetSandboxWithdrawLimits(accountId string) (*WithdrawLimitsResponse, error) + func (s *SandboxServiceClient) OpenSandboxAccount() (*OpenSandboxAccountResponse, error) + func (s *SandboxServiceClient) PostSandboxOrder(req *PostOrderRequest) (*PostOrderResponse, error) + func (s *SandboxServiceClient) ReplaceSandboxOrder(req *ReplaceOrderRequest) (*PostOrderResponse, error) + func (s *SandboxServiceClient) SandboxPayIn(req *SandboxPayInRequest) (*SandboxPayInResponse, error) + type ShareResponse struct + Header metadata.MD + func (p *ShareResponse) GetHeader() metadata.MD + type SharesResponse struct + Header metadata.MD + func (p *SharesResponse) GetHeader() metadata.MD + type StopOrdersServiceClient struct + func (s *StopOrdersServiceClient) CancelStopOrder(accountId, stopOrderId string) (*CancelStopOrderResponse, error) + func (s *StopOrdersServiceClient) GetStopOrders(accountId string) (*GetStopOrdersResponse, error) + func (s *StopOrdersServiceClient) PostStopOrder(req *PostStopOrderRequest) (*PostStopOrderResponse, error) + type Timer struct + func NewTimer(c *Client, exchange string, cancelAhead time.Duration) *Timer + func (t *Timer) Events() chan Event + func (t *Timer) Start(ctx context.Context) error + func (t *Timer) Stop() + type TradesStream struct + func (t *TradesStream) Listen() error + func (t *TradesStream) Stop() + func (t *TradesStream) Trades() <-chan *pb.OrderTrades + type TradingSchedulesResponse struct + Header metadata.MD + func (p *TradingSchedulesResponse) GetHeader() metadata.MD + type UsersServiceClient struct + func (us *UsersServiceClient) GetAccounts() (*GetAccountsResponse, error) + func (us *UsersServiceClient) GetInfo() (*GetInfoResponse, error) + func (us *UsersServiceClient) GetMarginAttributes(accountId string) (*GetMarginAttributesResponse, error) + func (us *UsersServiceClient) GetUserTariff() (*GetUserTariffResponse, error) + type WithdrawLimitsResponse struct + Header metadata.MD + func (p *WithdrawLimitsResponse) GetHeader() metadata.MD