sdk

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Package sdk represents internal proto-wrapper for Tinkoff Invest API.

Index

Constants

View Source
const Version = "0.2.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type InstrumentsInterface

type InstrumentsInterface interface {
	// The method of obtaining the trading schedule of trading platforms.
	TradingSchedules(exchange string, from, to *timestamp.Timestamp) ([]*pb.TradingSchedule, error)
	// The method of obtaining a bond by its identifier.
	BondBy(filters pb.InstrumentRequest) (*pb.Bond, error)
	// Method of obtaining a list of bonds.
	Bonds(status pb.InstrumentStatus) ([]*pb.Bond, error)
	// Method of obtaining a coupon payment schedule for a bond.
	GetBondCoupons(figi string, from, to *timestamp.Timestamp) ([]*pb.Coupon, error)
	// The method of obtaining a currency by its identifier.
	CurrencyBy(filters pb.InstrumentRequest) (*pb.Currency, error)
	// Method for getting a list of currencies.
	Currencies(status pb.InstrumentStatus) ([]*pb.Currency, error)
	// The method of obtaining an investment fund by its identifier.
	EtfBy(filters pb.InstrumentRequest) (*pb.Etf, error)
	// Method of obtaining a list of investment funds.
	Etfs(status pb.InstrumentStatus) ([]*pb.Etf, error)
	// The method of obtaining futures by its identifier.
	FutureBy(filters pb.InstrumentRequest) (*pb.Future, error)
	// Method for getting a list of futures.
	Futures(status pb.InstrumentStatus) ([]*pb.Future, error)
	// The method of obtaining a stock by its identifier.
	ShareBy(filters pb.InstrumentRequest) (*pb.Share, error)
	// Method of getting a list of shares.
	Shares(status pb.InstrumentStatus) ([]*pb.Share, error)
	// The method of obtaining the accumulated coupon income on the bond.
	GetAccruedInterests(figi string, from, to *timestamp.Timestamp) ([]*pb.AccruedInterest, error)
	// The method of obtaining the amount of the guarantee for futures.
	GetFuturesMargin(figi string) (*pb.GetFuturesMarginResponse, error)
	// The method of obtaining basic information about the tool.
	GetInstrumentBy(filters pb.InstrumentRequest) (*pb.Instrument, error)
	// A method for obtaining dividend payment events for an instrument.
	GetDividends(figi string, from, to *timestamp.Timestamp) ([]*pb.Dividend, error)
	// The method of obtaining an asset by its identifier.
	GetAssetBy(assetID string) (*pb.AssetFull, error)
	// Method for getting a list of assets.
	GetAssets() ([]*pb.Asset, error)
	// The method of getting the favourite instruments.
	GetFavorites() ([]*pb.FavoriteInstrument, error)
	// The method of editing the selected instruments.
	EditFavorites(newFavourites *pb.EditFavoritesRequest) ([]*pb.FavoriteInstrument, error)
}

type InstrumentsService

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

func NewInstrumentsService

func NewInstrumentsService() *InstrumentsService

func (InstrumentsService) BondBy

func (is InstrumentsService) BondBy(filters pb.InstrumentRequest) (*pb.Bond, error)

func (InstrumentsService) Bonds

func (is InstrumentsService) Bonds(status pb.InstrumentStatus) ([]*pb.Bond, error)

func (InstrumentsService) Currencies

func (is InstrumentsService) Currencies(status pb.InstrumentStatus) ([]*pb.Currency, error)

func (InstrumentsService) CurrencyBy

func (is InstrumentsService) CurrencyBy(filters pb.InstrumentRequest) (*pb.Currency, error)

func (InstrumentsService) EditFavorites

func (is InstrumentsService) EditFavorites(newFavourites *pb.EditFavoritesRequest) ([]*pb.FavoriteInstrument, error)

func (InstrumentsService) EtfBy

func (is InstrumentsService) EtfBy(filters pb.InstrumentRequest) (*pb.Etf, error)

func (InstrumentsService) Etfs

func (is InstrumentsService) Etfs(status pb.InstrumentStatus) ([]*pb.Etf, error)

func (InstrumentsService) FutureBy

func (is InstrumentsService) FutureBy(filters pb.InstrumentRequest) (*pb.Future, error)

func (InstrumentsService) Futures

func (is InstrumentsService) Futures(status pb.InstrumentStatus) ([]*pb.Future, error)

func (InstrumentsService) GetAccruedInterests

func (is InstrumentsService) GetAccruedInterests(figi string, from, to *timestamp.Timestamp) ([]*pb.AccruedInterest, error)

func (InstrumentsService) GetAssetBy

func (is InstrumentsService) GetAssetBy(assetID string) (*pb.AssetFull, error)

func (InstrumentsService) GetAssets

func (is InstrumentsService) GetAssets() ([]*pb.Asset, error)

func (InstrumentsService) GetBondCoupons

func (is InstrumentsService) GetBondCoupons(figi string, from, to *timestamp.Timestamp) ([]*pb.Coupon, error)

func (InstrumentsService) GetDividends

func (is InstrumentsService) GetDividends(figi string, from, to *timestamp.Timestamp) ([]*pb.Dividend, error)

func (InstrumentsService) GetFavorites

func (is InstrumentsService) GetFavorites() ([]*pb.FavoriteInstrument, error)

func (InstrumentsService) GetFuturesMargin

func (is InstrumentsService) GetFuturesMargin(figi string) (*pb.GetFuturesMarginResponse, error)

func (InstrumentsService) GetInstrumentBy

func (is InstrumentsService) GetInstrumentBy(filters pb.InstrumentRequest) (*pb.Instrument, error)

func (InstrumentsService) ShareBy

func (is InstrumentsService) ShareBy(filters pb.InstrumentRequest) (*pb.Share, error)

func (InstrumentsService) Shares

func (is InstrumentsService) Shares(status pb.InstrumentStatus) ([]*pb.Share, error)

func (InstrumentsService) TradingSchedules

func (is InstrumentsService) TradingSchedules(exchange string, from, to *timestamp.Timestamp) ([]*pb.TradingSchedule, error)

type MarketDataInterface

type MarketDataInterface interface {
	// The method of requesting historical candlesticks by instrument.
	GetCandles(figi string, from, to *timestamp.Timestamp, interval pb.CandleInterval) ([]*pb.HistoricCandle, error)
	// The method of requesting the latest prices for instruments.
	GetLastPrices(figi []string) ([]*pb.LastPrice, error)
	// The method of obtaining a glass by instrument.
	GetOrderBook(figi string, depth int) (*pb.GetOrderBookResponse, error)
	// The method of requesting the status of trading on instruments.
	GetTradingStatus(figi string) (*pb.GetTradingStatusResponse, error)
	// The method of requesting the latest depersonalized transactions on the instrument.
	GetLastTrades(figi string, from, to *timestamp.Timestamp) ([]*pb.Trade, error)
}

type MarketDataService

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

func NewMarketDataService

func NewMarketDataService() *MarketDataService

func (MarketDataService) GetCandles

func (mds MarketDataService) GetCandles(figi string, from, to *timestamp.Timestamp, interval pb.CandleInterval) ([]*pb.HistoricCandle, error)

func (MarketDataService) GetLastPrices

func (mds MarketDataService) GetLastPrices(figi []string) ([]*pb.LastPrice, error)

func (MarketDataService) GetLastTrades

func (mds MarketDataService) GetLastTrades(figi string, from, to *timestamp.Timestamp) ([]*pb.Trade, error)

func (MarketDataService) GetOrderBook

func (mds MarketDataService) GetOrderBook(figi string, depth int) (*pb.GetOrderBookResponse, error)

func (MarketDataService) GetTradingStatus

func (mds MarketDataService) GetTradingStatus(figi string) (*pb.GetTradingStatusResponse, error)

type MarketDataStream added in v0.1.1

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

func NewMarketDataStream added in v0.1.1

func NewMarketDataStream() *MarketDataStream

func (MarketDataStream) Recv added in v0.1.1

func (MarketDataStream) Send added in v0.1.1

func (mds MarketDataStream) Send(request *pb.MarketDataRequest) error

type MarketDataStreamInterface

type MarketDataStreamInterface interface {
	// Recv listens for incoming messages and block until first one is received.
	Recv() (*pb.MarketDataResponse, error)
	// Send puts pb.MarketDataRequest into a stream.
	Send(request *pb.MarketDataRequest) error
}

type OperationsInterface

type OperationsInterface interface {
	// Method for getting a list of account transactions.
	GetOperations(accountID string, from, to *timestamp.Timestamp, state pb.OperationState, figi string) ([]*pb.Operation, error)
	// The method of obtaining a portfolio by account.
	GetPortfolio(accountID string) (*pb.PortfolioResponse, error)
	// Method for getting a list of account positions.
	GetPositions(accountID string) (*pb.PositionsResponse, error)
	// The method of obtaining the available balance for withdrawal of funds.
	GetWithdrawLimits(accountID string) (*pb.WithdrawLimitsResponse, error)
}

type OperationsService

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

func NewOperationsService

func NewOperationsService() *OperationsService

func (OperationsService) GetOperations

func (os OperationsService) GetOperations(accountID string, from, to *timestamp.Timestamp, state pb.OperationState, figi string) ([]*pb.Operation, error)

func (OperationsService) GetPortfolio

func (os OperationsService) GetPortfolio(accountID string) (*pb.PortfolioResponse, error)

func (OperationsService) GetPositions

func (os OperationsService) GetPositions(accountID string) (*pb.PositionsResponse, error)

func (OperationsService) GetWithdrawLimits

func (os OperationsService) GetWithdrawLimits(accountID string) (*pb.WithdrawLimitsResponse, error)

type OrdersInterface

type OrdersInterface interface {
	// The method of submitting the order.
	PostOrder(order *pb.PostOrderRequest) (*pb.PostOrderResponse, error)
	// The method of cancellation of the trade order.
	CancelOrder(accountID string, orderID string) (*timestamp.Timestamp, error)
	// The method of obtaining the status of a trade order.
	GetOrderState(accountID string, orderID string) (*pb.OrderState, error)
	// The method of getting a list of active orders for the account.
	GetOrders(accountID string) ([]*pb.OrderState, error)
}

type OrdersService

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

func NewOrdersService

func NewOrdersService() *OrdersService

func (OrdersService) CancelOrder

func (os OrdersService) CancelOrder(accountID string, orderID string) (*timestamp.Timestamp, error)

func (OrdersService) GetOrderState

func (os OrdersService) GetOrderState(accountID string, orderID string) (*pb.OrderState, error)

func (OrdersService) GetOrders

func (os OrdersService) GetOrders(accountID string) ([]*pb.OrderState, error)

func (OrdersService) PostOrder

func (os OrdersService) PostOrder(order *pb.PostOrderRequest) (*pb.PostOrderResponse, error)

type OrdersStream added in v0.1.1

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

func NewOrdersStream added in v0.1.1

func NewOrdersStream(request *pb.TradesStreamRequest) *OrdersStream

func (OrdersStream) Recv added in v0.1.1

func (os OrdersStream) Recv() (*pb.TradesStreamResponse, error)

type OrdersStreamInterface

type OrdersStreamInterface interface {
	// Recv listens for incoming messages and block until first one is received.
	Recv() (*pb.TradesStreamResponse, error)
}

type SandboxInterface

type SandboxInterface interface {
	// The method of registering an account in the sandbox.
	OpenSandboxAccount() (string, error)
	// The method of getting accounts in the sandbox.
	GetSandboxAccounts() ([]*pb.Account, error)
	// The method of closing an account in the sandbox.
	CloseSandboxAccount(accountID string) error
	// The method of placing a trade order in the sandbox.
	PostSandboxOrder(order *pb.PostOrderRequest) (*pb.PostOrderResponse, error)
	// Method for getting a list of active applications for an account in the sandbox.
	GetSandboxOrders(accountID string) ([]*pb.OrderState, error)
	// Method for getting a list of active orders for an account in the sandbox.
	CancelSandboxOrder(accountID string, orderID string) (*timestamp.Timestamp, error)
	// The method of obtaining the order status in the sandbox.
	GetSandboxOrderState(accountID string, orderID string) (*pb.OrderState, error)
	// The method of obtaining positions on the virtual sandbox account.
	GetSandboxPositions(accountID string) (*pb.PositionsResponse, error)
	// The method of receiving operations in the sandbox by account number.
	GetSandboxOperations(filter *pb.OperationsRequest) ([]*pb.Operation, error)
	// The method of getting a portfolio in the sandbox.
	GetSandboxPortfolio(accountID string) (*pb.PortfolioResponse, error)
	// The method of depositing funds in the sandbox.
	SandboxPayIn(accountID string, amount *pb.MoneyValue) (*pb.MoneyValue, error)
}

type SandboxService

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

func NewSandboxService

func NewSandboxService() *SandboxService

func (SandboxService) CancelSandboxOrder

func (ss SandboxService) CancelSandboxOrder(accountID string, orderID string) (*timestamp.Timestamp, error)

func (SandboxService) CloseSandboxAccount

func (ss SandboxService) CloseSandboxAccount(accountID string) error

func (SandboxService) GetSandboxAccounts

func (ss SandboxService) GetSandboxAccounts() ([]*pb.Account, error)

func (SandboxService) GetSandboxOperations

func (ss SandboxService) GetSandboxOperations(filter *pb.OperationsRequest) ([]*pb.Operation, error)

func (SandboxService) GetSandboxOrderState

func (ss SandboxService) GetSandboxOrderState(accountID string, orderID string) (*pb.OrderState, error)

func (SandboxService) GetSandboxOrders

func (ss SandboxService) GetSandboxOrders(accountID string) ([]*pb.OrderState, error)

func (SandboxService) GetSandboxPortfolio

func (ss SandboxService) GetSandboxPortfolio(accountID string) (*pb.PortfolioResponse, error)

func (SandboxService) GetSandboxPositions

func (ss SandboxService) GetSandboxPositions(accountID string) (*pb.PositionsResponse, error)

func (SandboxService) OpenSandboxAccount

func (ss SandboxService) OpenSandboxAccount() (string, error)

func (SandboxService) PostSandboxOrder

func (ss SandboxService) PostSandboxOrder(order *pb.PostOrderRequest) (*pb.PostOrderResponse, error)

func (SandboxService) SandboxPayIn

func (ss SandboxService) SandboxPayIn(accountID string, amount *pb.MoneyValue) (*pb.MoneyValue, error)

type ServicePool

type ServicePool struct {
	InstrumentsService InstrumentsService
	MarketDataService  MarketDataService
	OperationsService  OperationsService
	OrdersService      OrdersService
	SandboxService     SandboxService
	StopOrdersService  StopOrdersService
	UsersService       UsersService
}

ServicePool is a ready-to-use scope for all available non-stream services.

func NewServicePool

func NewServicePool() *ServicePool

type StopOrdersInterface

type StopOrdersInterface interface {
	// The method of placing a stop order.
	PostStopOrder(stopOrder *pb.PostStopOrderRequest) (string, error)
	// Method for getting a list of active stop orders on the account.
	GetStopOrders(accountID string) ([]*pb.StopOrder, error)
	// The method of canceling the stop order.
	CancelStopOrder(accountID string, stopOrderID string) (*timestamp.Timestamp, error)
}

type StopOrdersService

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

func NewStopOrdersService

func NewStopOrdersService() *StopOrdersService

func (StopOrdersService) CancelStopOrder

func (sos StopOrdersService) CancelStopOrder(accountID string, stopOrderID string) (*timestamp.Timestamp, error)

func (StopOrdersService) GetStopOrders

func (sos StopOrdersService) GetStopOrders(accountID string) ([]*pb.StopOrder, error)

func (StopOrdersService) PostStopOrder

func (sos StopOrdersService) PostStopOrder(stopOrder *pb.PostStopOrderRequest) (string, error)

type UsersService

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

func NewUsersService

func NewUsersService() *UsersService

func (UsersService) GetAccounts

func (us UsersService) GetAccounts() ([]*pb.Account, error)

func (UsersService) GetInfo

func (us UsersService) GetInfo() (*pb.GetInfoResponse, error)

func (UsersService) GetMarginAttributes

func (us UsersService) GetMarginAttributes(accountID string) (*pb.GetMarginAttributesResponse, error)

func (UsersService) GetUserTariff

func (us UsersService) GetUserTariff() (*pb.GetUserTariffResponse, error)

type UsersServiceClient

type UsersServiceClient interface {
	// The method of receiving user accounts.
	GetAccounts() ([]*pb.Account, error)
	// Calculation of margin indicators on the account.
	GetMarginAttributes(accountID string) (*pb.GetMarginAttributesResponse, error)
	// Request for the user's tariff.
	GetUserTariff() (*pb.GetUserTariffResponse, error)
	// The method of obtaining information about the user.
	GetInfo() (*pb.GetInfoResponse, error)
}

Jump to

Keyboard shortcuts

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