Skip to content

Commit 3bec0bd

Browse files
committed
Merge branch 'dev' into feat_token
2 parents f46a039 + 5eacc9e commit 3bec0bd

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
@@ -540,9 +540,9 @@ std::shared_ptr<tigeropen::push::pb::QuoteBasicData> TIGER_API::PushClientImpl::
540540
return nullptr;
541541
}
542542

543-
tigeropen::push::pb::SocketCommon_QuoteType quoteType = quote_data.type();
544-
if (quoteType != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
545-
quoteType != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC) {
543+
tigeropen::push::pb::SocketCommon_QuoteType quote_type = quote_data.type();
544+
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
545+
quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC) {
546546
return nullptr;
547547
}
548548

@@ -551,7 +551,7 @@ std::shared_ptr<tigeropen::push::pb::QuoteBasicData> TIGER_API::PushClientImpl::
551551
auto builder = std::make_shared<tigeropen::push::pb::QuoteBasicData>();
552552
// Set required fields
553553
builder->set_symbol(quote_data.symbol());
554-
builder->set_type(tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BASIC);
554+
builder->set_type(quote_type);
555555
builder->set_timestamp(quote_data.timestamp());
556556
builder->set_latestprice(quote_data.latestprice());
557557
builder->set_latesttime(quote_data.latesttime());
@@ -627,14 +627,15 @@ std::shared_ptr<tigeropen::push::pb::QuoteBBOData> TIGER_API::PushClientImpl::co
627627
}
628628

629629
tigeropen::push::pb::SocketCommon_QuoteType quote_type = quote_data.type();
630-
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO) {
630+
if (quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_ALL &&
631+
quote_type != tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO) {
631632
return nullptr;
632633
}
633634

634635
// Create and initialize builder
635636
auto builder = std::make_shared<tigeropen::push::pb::QuoteBBOData>();
636637
builder->set_symbol(quote_data.symbol());
637-
builder->set_type(tigeropen::push::pb::SocketCommon::QuoteType::SocketCommon_QuoteType_BBO);
638+
builder->set_type(quote_type);
638639
builder->set_timestamp(quote_data.timestamp());
639640
builder->set_bidprice(quote_data.bidprice());
640641
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)