TinkoffInvestSDK
instrumentsservice.h
1 #ifndef INSTRUMENTSSERVICE_H
2 #define INSTRUMENTSSERVICE_H
3 
4 #include "customservice.h"
5 #include <grpcpp/grpcpp.h>
6 #include "instruments.grpc.pb.h"
7 #include "servicereply.h"
8 
9 using grpc::Channel;
10 using namespace tinkoff::public_::invest::api::contract::v1;
11 
23 {
24 
25 public:
26  Instruments(std::shared_ptr<Channel> channel, const std::string &token);
27  ~Instruments();
28 
30  ServiceReply TradingSchedules(const std::string &exchange, int64_t fromseconds, int32_t fromnanos, int64_t toseconds, int32_t tonanos);
32  ServiceReply BondBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
34  ServiceReply Bonds(InstrumentStatus instrumentStatus);
36  ServiceReply GetBondCoupons(const std::string &figi, int64_t fromseconds, int32_t fromnanos, int64_t toseconds, int32_t tonanos);
38  ServiceReply CurrencyBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
40  ServiceReply Currencies(InstrumentStatus instrumentStatus);
42  ServiceReply EtfBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
44  ServiceReply Etfs(InstrumentStatus instrumentStatus);
46  ServiceReply FutureBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
48  ServiceReply Futures(InstrumentStatus instrumentStatus);
50  ServiceReply ShareBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
52  ServiceReply Shares(InstrumentStatus instrumentStatus);
54  ServiceReply GetAccruedInterests(const std::string &figi, int64_t fromseconds, int32_t fromnanos, int64_t toseconds, int32_t tonanos);
56  ServiceReply GetFuturesMargin(const std::string &figi);
58  ServiceReply GetInstrumentBy(InstrumentIdType idType, const std::string &classCode, const std::string &id);
60  ServiceReply GetDividends(const std::string &figi, int64_t fromseconds, int32_t fromnanos, int64_t toseconds, int32_t tonanos);
62  ServiceReply GetAssetBy(const std::string &id);
64  ServiceReply GetAssets();
66  ServiceReply GetFavorites();
68  ServiceReply EditFavorites(const std::vector<EditFavoritesRequestInstrument> &instruments, EditFavoritesActionType actionType);
69 
70 private:
71  std::unique_ptr<InstrumentsService::Stub> m_instrumentsService;
72 
73 };
74 
75 #endif // INSTRUMENTSSERVICE_H
CustomService
Родительский класс для всех сервисов
Definition: customservice.h:14
ServiceReply
Класс-обертка над proto-ответами сервисов
Definition: servicereply.h:17
Instruments
Сервис для работы с различными инструментами
Definition: instrumentsservice.h:22