|
17 | 17 | from tigeropen.common.consts import OrderStatus |
18 | 18 | from tigeropen.common.consts.params import P_SDK_VERSION, P_SDK_VERSION_PREFIX |
19 | 19 | from tigeropen.common.consts.push_destinations import QUOTE, QUOTE_DEPTH, QUOTE_FUTURE, QUOTE_OPTION, TRADE_ASSET, \ |
20 | | - TRADE_ORDER, TRADE_POSITION, TRADE_TICK, TRADE_EXECUTION |
| 20 | + TRADE_ORDER, TRADE_POSITION, TRADE_TICK, TRADE_TRANSACTION |
21 | 21 | from tigeropen.common.consts.push_subscriptions import SUBSCRIPTION_QUOTE, SUBSCRIPTION_QUOTE_DEPTH, \ |
22 | 22 | SUBSCRIPTION_QUOTE_OPTION, SUBSCRIPTION_QUOTE_FUTURE, SUBSCRIPTION_TRADE_ASSET, SUBSCRIPTION_TRADE_POSITION, \ |
23 | | - SUBSCRIPTION_TRADE_ORDER, SUBSCRIPTION_TRADE_TICK, SUBSCRIPTION_TRADE_EXECUTION |
| 23 | + SUBSCRIPTION_TRADE_ORDER, SUBSCRIPTION_TRADE_TICK, SUBSCRIPTION_TRADE_TRANSACTION |
24 | 24 | from tigeropen.common.consts.push_types import RequestType, ResponseType |
25 | 25 | from tigeropen.common.consts.quote_keys import QuoteChangeKey, QuoteKeyType |
26 | 26 | from tigeropen.common.exceptions import ApiException |
@@ -97,7 +97,7 @@ def __init__(self, host, port, use_ssl=True, connection_timeout=120, heartbeats= |
97 | 97 | self.asset_changed = None |
98 | 98 | self.position_changed = None |
99 | 99 | self.order_changed = None |
100 | | - self.execution_changed = None |
| 100 | + self.transaction_changed = None |
101 | 101 | self.connect_callback = None |
102 | 102 | self.disconnect_callback = None |
103 | 103 | self.subscribe_callback = None |
@@ -276,14 +276,14 @@ def on_message(self, frame): |
276 | 276 | self.order_changed(account, items) |
277 | 277 | elif response_type == str(ResponseType.SUBSCRIBE_TRADE_EXECUTION.value): |
278 | 278 | data = json.loads(body) |
279 | | - if self.execution_changed: |
| 279 | + if self.transaction_changed: |
280 | 280 | if 'account' in data: |
281 | 281 | account = data.pop('account', None) |
282 | 282 | items = [] |
283 | 283 | for key, value in data.items(): |
284 | 284 | items.append((camel_to_underline(key), value)) |
285 | 285 | if items: |
286 | | - self.execution_changed(account, items) |
| 286 | + self.transaction_changed(account, items) |
287 | 287 | elif response_type == str(ResponseType.GET_SUBSCRIBE_END.value): |
288 | 288 | if self.subscribe_callback: |
289 | 289 | self.subscribe_callback(headers.get('destination'), json.loads(body)) |
@@ -356,19 +356,19 @@ def unsubscribe_order(self, id=None): |
356 | 356 | """ |
357 | 357 | self._handle_trade_unsubscribe(TRADE_ORDER, SUBSCRIPTION_TRADE_ORDER, sub_id=id) |
358 | 358 |
|
359 | | - def subscribe_execution(self, account=None): |
| 359 | + def subscribe_transaction(self, account=None): |
360 | 360 | """ |
361 | 361 | 订阅订单执行明细 |
362 | 362 | :return: |
363 | 363 | """ |
364 | | - return self._handle_trade_subscribe(TRADE_EXECUTION, SUBSCRIPTION_TRADE_EXECUTION, account) |
| 364 | + return self._handle_trade_subscribe(TRADE_TRANSACTION, SUBSCRIPTION_TRADE_TRANSACTION, account) |
365 | 365 |
|
366 | | - def unsubscribe_execution(self, id=None): |
| 366 | + def unsubscribe_transaction(self, id=None): |
367 | 367 | """ |
368 | 368 | 退订订单执行明细 |
369 | 369 | :return: |
370 | 370 | """ |
371 | | - self._handle_trade_unsubscribe(TRADE_EXECUTION, SUBSCRIPTION_TRADE_EXECUTION, sub_id=id) |
| 371 | + self._handle_trade_unsubscribe(TRADE_TRANSACTION, SUBSCRIPTION_TRADE_TRANSACTION, sub_id=id) |
372 | 372 |
|
373 | 373 | def subscribe_quote(self, symbols, quote_key_type=QuoteKeyType.TRADE, focus_keys=None): |
374 | 374 | """ |
|
0 commit comments