Skip to content

Commit 86c2009

Browse files
committed
Merge branch 'fix_push_future_bbo' into 'dev'
【FIX】fix future bbo callback; fix get_transaction order_id type See merge request server/openapi/openapi-cpp-sdk!54
2 parents 77d1d2c + 9e04b92 commit 86c2009

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

include/tigerapi/trade_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ namespace TIGER_API {
135135
SegmentType seg_type = SegmentType::SEC);
136136

137137
Order get_order(unsigned long long id, bool is_brief=false);
138-
value get_transactions(utility::string_t account, long order_id);
138+
value get_transactions(utility::string_t account, long long order_id);
139139
value get_transactions(utility::string_t account, utility::string_t symbol, utility::string_t sec_type = U(""),
140140
long start_time = -1, time_t end_time = -1,
141141
int limit = 100, utility::string_t expiry = U(""), utility::string_t strike = U(""), utility::string_t right = U(""),
142-
long order_id = 0);
142+
long long order_id = 0);
143143

144144
value cancel_order(unsigned long long id);
145145
value place_order(value &order);

src/push_socket/push_client_impl.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ std::shared_ptr<tigeropen::push::pb::QuoteBasicData> TIGER_API::PushClientImpl::
525525
return nullptr;
526526
}
527527

528-
tigeropen::push::pb::SocketCommon_QuoteType quoteType = quote_data.type();
529-
if (quoteType != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
530-
quoteType != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC) {
528+
tigeropen::push::pb::SocketCommon_QuoteType quote_type = quote_data.type();
529+
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
530+
quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC) {
531531
return nullptr;
532532
}
533533

@@ -536,7 +536,7 @@ std::shared_ptr<tigeropen::push::pb::QuoteBasicData> TIGER_API::PushClientImpl::
536536
auto builder = std::make_shared<tigeropen::push::pb::QuoteBasicData>();
537537
// Set required fields
538538
builder->set_symbol(quote_data.symbol());
539-
builder->set_type(tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC);
539+
builder->set_type(quote_type);
540540
builder->set_timestamp(quote_data.timestamp());
541541
builder->set_latestprice(quote_data.latestprice());
542542
builder->set_latesttime(quote_data.latesttime());
@@ -612,14 +612,15 @@ std::shared_ptr<tigeropen::push::pb::QuoteBBOData> TIGER_API::PushClientImpl::co
612612
}
613613

614614
tigeropen::push::pb::SocketCommon_QuoteType quote_type = quote_data.type();
615-
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO) {
615+
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
616+
quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO) {
616617
return nullptr;
617618
}
618619

619620
// Create and initialize builder
620621
auto builder = std::make_shared<tigeropen::push::pb::QuoteBBOData>();
621622
builder->set_symbol(quote_data.symbol());
622-
builder->set_type(tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO);
623+
builder->set_type(quote_type);
623624
builder->set_timestamp(quote_data.timestamp());
624625
builder->set_bidprice(quote_data.bidprice());
625626
builder->set_bidsize(quote_data.bidsize());

src/trade_client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,18 +292,18 @@ namespace TIGER_API {
292292
parent_id, enum_to_str(sort_by), enum_to_str(seg_type));
293293
}
294294

295-
value TradeClient::get_transactions(utility::string_t account, long order_id) {
295+
value TradeClient::get_transactions(utility::string_t account, long long order_id) {
296296
value obj = value::object(true);
297297
obj[P_ACCOUNT] = get_account_param(account);
298298
set_secret_key(obj);
299-
obj[U("order_id")] = (long long) order_id;
299+
obj[U("order_id")] = order_id;
300300
return post(ORDER_TRANSACTIONS, obj)[P_ITEMS];
301301
}
302302

303303
value TradeClient::get_transactions(utility::string_t account, utility::string_t symbol, utility::string_t sec_type,
304304
long start_time, time_t end_time,
305305
int limit, utility::string_t expiry, utility::string_t strike, utility::string_t right,
306-
long order_id) {
306+
long long order_id) {
307307
value obj = value::object(true);
308308
obj[P_ACCOUNT] = get_account_param(account);
309309
set_secret_key(obj);

0 commit comments

Comments
 (0)