TinkoffInvestSDK
ordersservice.h
1 #ifndef ORDERSSERVICE_H
2 #define ORDERSSERVICE_H
3 
4 #include "customservice.h"
5 #include <grpcpp/grpcpp.h>
6 #include "orders.grpc.pb.h"
7 #include "servicereply.h"
8 
9 using grpc::Channel;
10 using namespace tinkoff::public_::invest::api::contract::v1;
11 
22 class Orders: public CustomService
23 {
24 
25 public:
26  Orders(std::shared_ptr<Channel> channel, const std::string &token);
27  ~Orders();
28 
30  ServiceReply PostOrder(const std::string &figi, int64_t quantity, int64_t units, int32_t nano, OrderDirection direction, const std::string &accountId, OrderType orderType, const std::string &orderId);
32  ServiceReply CancelOrder(const std::string &accountId, const std::string &orderId);
34  ServiceReply GetOrderState(const std::string &accountId, const std::string &orderId);
36  ServiceReply GetOrders(const std::string &accountId);
37 
38 private:
39  std::unique_ptr<OrdersService::Stub> m_ordersService;
40 
41 };
42 
43 #endif // ORDERSSERVICE_H
CustomService
Родительский класс для всех сервисов
Definition: customservice.h:14
ServiceReply
Класс-обертка над proto-ответами сервисов
Definition: servicereply.h:17
Orders
Сервис торговых поручений
Definition: ordersservice.h:22