TinkoffInvestSDK
sandboxservice.h
1 #ifndef SANDBOXSERVICE_H
2 #define SANDBOXSERVICE_H
3 
4 #include "customservice.h"
5 #include <grpcpp/grpcpp.h>
6 #include "sandbox.grpc.pb.h"
7 #include "servicereply.h"
8 
9 using grpc::Channel;
10 using namespace tinkoff::public_::invest::api::contract::v1;
11 
17 class Sandbox: public CustomService
18 {
19 
20 public:
21  Sandbox(std::shared_ptr<Channel> channel, const std::string &token);
22  ~Sandbox();
23 
25  ServiceReply OpenSandboxAccount();
27  ServiceReply GetSandboxAccounts();
29  ServiceReply CloseSandboxAccount(const std::string &accountId);
31  ServiceReply PostSandboxOrder(const std::string &figi, int64_t quantity, int64_t units, int32_t nano);
33  ServiceReply GetSandboxOrders(const std::string &accountId);
35  ServiceReply CancelSandboxOrder(const std::string &accountId, const std::string &orderId);
37  ServiceReply GetSandboxOrderState(const std::string &accountId, const std::string &orderId);
39  ServiceReply GetSandboxPositions(const std::string &accountId);
41  ServiceReply GetSandboxOperations(const std::string &accountId, int64_t fromseconds, int32_t fromnanos, int64_t toseconds, int32_t tonanos);
43  ServiceReply GetSandboxPortfolio(const std::string &accountId);
45  ServiceReply SandboxPayIn(const std::string &accountId, const std::string &currency, int64_t units, int32_t nano);
46 
47 private:
48  std::unique_ptr<SandboxService::Stub> m_sandboxService;
49 
50 };
51 
52 #endif // SANDBOXSERVICE_H
CustomService
Родительский класс для всех сервисов
Definition: customservice.h:14
ServiceReply
Класс-обертка над proto-ответами сервисов
Definition: servicereply.h:17
Sandbox
Сервис для работы с песочницей
Definition: sandboxservice.h:17