Closed AydinyanNarek closed 8 months ago
Notice the three dots in the print, there are more that were not printed. You can do event.getMessageList()[0].getElementList() , loop through that and do element.toString() to see all of them.
Thanks, it works. One more question Why are we getting the first Message only and getting ElementList from it? Shouldn't we iterate on MessageList, call getElementList() for each message, and iterate on elements?
class MyEventHandler : public EventHandler
{
public:
bool processEvent(const Event &event, Session *session) override
{
response = true;
auto messageList = event.getMessageList();
for(const auto& message : messageList) {
auto elemList = message.getElementList();
for(const auto& elem : elemList) {
std::cout << "Received an event:\n" + elem.toStringPretty(2, 2) << std::endl;
}
}
return true;
}
};
Thanks, it works. One more question Why are we getting the first Message only and getting ElementList from it? Shouldn't we iterate on MessageList, call getElementList() for each message, and iterate on elements?
class MyEventHandler : public EventHandler { public: bool processEvent(const Event &event, Session *session) override { response = true; auto messageList = event.getMessageList(); for(const auto& message : messageList) { auto elemList = message.getElementList(); for(const auto& elem : elemList) { std::cout << "Received an event:\n" + elem.toStringPretty(2, 2) << std::endl; } } return true; } };
Yes, you are right.
Thanks for your help. Closing the issue
First of all thanks for this powerful API. I am getting familiar with this API and there are some questions. I have created this kind of request
Request request(Request::Operation::GET_ACCOUNT_BALANCES, "binance");
The output looks like thisI have bought coins
SOL
,AVAX
,USDT
etc... but those coins haven't been listed in the output above.The questions are
Thanks in advance.
PS. Would be great if you will create one more channel in
Issues
section for questions and/or discussions.