webull-openapi-python-sdk 2.0.17__py3-none-any.whl → 2.0.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- webull/__init__.py +1 -1
- webull/core/http/initializer/token/bean/access_token.py +3 -2
- webull/data/data_streaming_client.py +3 -1
- webull/data/internal/quotes_client.py +2 -2
- webull/data/quotes/subscribe/notice_decoder.py +34 -0
- webull/data/quotes/subscribe/payload_type.py +2 -1
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/METADATA +1 -1
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/RECORD +12 -11
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/WHEEL +1 -1
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/licenses/LICENSE +0 -0
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/licenses/NOTICE +0 -0
- {webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/top_level.txt +0 -0
webull/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.0.
|
|
1
|
+
__version__ = '2.0.19'
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
# coding=utf-8
|
|
35
35
|
|
|
36
36
|
class AccessToken:
|
|
37
|
-
def __init__(self, token, expires, status):
|
|
37
|
+
def __init__(self, token, expires, status, expires_at=None):
|
|
38
38
|
self.token = token
|
|
39
39
|
self.expires = expires
|
|
40
|
-
self.status = status
|
|
40
|
+
self.status = status
|
|
41
|
+
self.expires_at = expires_at
|
|
@@ -20,10 +20,11 @@ from webull.data.quotes.subscribe.event_depth_decoder import EventDepthDecoder
|
|
|
20
20
|
from webull.data.quotes.subscribe.event_snapshot_decoder import EventSnapshotDecoder
|
|
21
21
|
from webull.data.quotes.subscribe.event_tick_decoder import EventTickDecoder
|
|
22
22
|
from webull.data.quotes.subscribe.payload_type import PAYLOAD_TYPE_QUOTE, PAYLOAD_TYPE_SHAPSHOT, PAYLOAD_TYPE_TICK, \
|
|
23
|
-
PAYLOAD_TYPE_EVENT_SHAPSHOT, PAYLOAD_TYPE_EVENT_DEPTH, PAYLOAD_TYPE_EVENT_TICK
|
|
23
|
+
PAYLOAD_TYPE_EVENT_SHAPSHOT, PAYLOAD_TYPE_EVENT_DEPTH, PAYLOAD_TYPE_EVENT_TICK, PAYLOAD_TYPE_NOTICE
|
|
24
24
|
from webull.data.quotes.subscribe.quote_decoder import QuoteDecoder
|
|
25
25
|
from webull.data.quotes.subscribe.snapshot_decoder import SnapshotDecoder
|
|
26
26
|
from webull.data.quotes.subscribe.tick_decoder import TickDecoder
|
|
27
|
+
from webull.data.quotes.subscribe.notice_decoder import NoticeDecoder
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class DataStreamingClient(QuotesClient):
|
|
@@ -46,6 +47,7 @@ class DataStreamingClient(QuotesClient):
|
|
|
46
47
|
self.register_payload_decoder(PAYLOAD_TYPE_EVENT_DEPTH, EventDepthDecoder())
|
|
47
48
|
self.register_payload_decoder(PAYLOAD_TYPE_EVENT_SHAPSHOT, EventSnapshotDecoder())
|
|
48
49
|
self.register_payload_decoder(PAYLOAD_TYPE_EVENT_TICK, EventTickDecoder())
|
|
50
|
+
self.register_payload_decoder(PAYLOAD_TYPE_NOTICE, NoticeDecoder())
|
|
49
51
|
|
|
50
52
|
@property
|
|
51
53
|
def on_connect_success(self):
|
|
@@ -83,7 +83,7 @@ class QuotesClient(mqttc.Client):
|
|
|
83
83
|
client._easy_log(
|
|
84
84
|
LOG_DEBUG, 'decoded message topic: %s, payload: %s', decoded[0], decoded[1])
|
|
85
85
|
_on_quotes_message = client._on_quotes_message
|
|
86
|
-
no_callback_topic = ['echo'
|
|
86
|
+
no_callback_topic = ['echo']
|
|
87
87
|
if _on_quotes_message and decoded[0] not in no_callback_topic:
|
|
88
88
|
_on_quotes_message(client, decoded[0], decoded[1])
|
|
89
89
|
else:
|
|
@@ -115,7 +115,7 @@ class QuotesClient(mqttc.Client):
|
|
|
115
115
|
|
|
116
116
|
self._quotes_message = _quotes_message
|
|
117
117
|
self._quotes_on_connect = _quotes_on_connect
|
|
118
|
-
mqttc.Client.__init__(self, self._client_id, transport=transport, reconnect_on_failure=False)
|
|
118
|
+
mqttc.Client.__init__(self, client_id=self._client_id, transport=transport, reconnect_on_failure=False)
|
|
119
119
|
self.username_pw_set(self._app_key, uuid.uuid4().hex)
|
|
120
120
|
if tls_enable:
|
|
121
121
|
self.tls_set()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2022 Webull
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# coding=utf-8
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from webull.data.internal.quotes_payload_decoder import BaseQuotesPayloadDecoder
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class NoticeDecoder(BaseQuotesPayloadDecoder):
|
|
23
|
+
"""Decoder for notice messages from the server.
|
|
24
|
+
|
|
25
|
+
Notice messages are JSON-encoded and include:
|
|
26
|
+
- type '1001': status message with rtt, drop, sent fields
|
|
27
|
+
- type '1002': permission preemption with content field
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self):
|
|
31
|
+
super().__init__()
|
|
32
|
+
|
|
33
|
+
def parse(self, payload):
|
|
34
|
+
return json.loads(payload.decode("utf-8"))
|
|
@@ -19,4 +19,5 @@ PAYLOAD_TYPE_SHAPSHOT = 'snapshot'
|
|
|
19
19
|
PAYLOAD_TYPE_TICK = 'tick'
|
|
20
20
|
PAYLOAD_TYPE_EVENT_DEPTH = 'event-quote'
|
|
21
21
|
PAYLOAD_TYPE_EVENT_SHAPSHOT = 'event-snapshot'
|
|
22
|
-
PAYLOAD_TYPE_EVENT_TICK = 'event-tick'
|
|
22
|
+
PAYLOAD_TYPE_EVENT_TICK = 'event-tick'
|
|
23
|
+
PAYLOAD_TYPE_NOTICE = 'notice'
|
{webull_openapi_python_sdk-2.0.17.dist-info → webull_openapi_python_sdk-2.0.19.dist-info}/RECORD
RENAMED
|
@@ -22,7 +22,7 @@ samples/trade/trade_client_v3_event.py,sha256=91HlT04KlK8Q5gUnsB8F5ErCFdJRnpDABK
|
|
|
22
22
|
samples/trade/trade_event_client.py,sha256=ni7OEc4nnz2Hpbh0Kzl6DXB-FuDPc2UGBaLFnCrdFZ4,2824
|
|
23
23
|
samples/watchlist/__init__.py,sha256=rtV5s4_CJgDAT4DGEJa_pNLJU71Wdr5OLz_IQ1EajFQ,567
|
|
24
24
|
samples/watchlist/watchlist_client.py,sha256=lpzJs7SXuSka2KKkJ0u9s83A9iHta5qrjvIdkbfNcwg,3246
|
|
25
|
-
webull/__init__.py,sha256=
|
|
25
|
+
webull/__init__.py,sha256=m4hQJTI0cBGoZ9N0l_2TAmM6g_bIF0yXwGh8jrQgUkM,23
|
|
26
26
|
webull/core/__init__.py,sha256=9qaA_6qVSv_R3odJYbwh6_6GRuTp5D-gdebEmaROsiU,226
|
|
27
27
|
webull/core/client.py,sha256=zxSBiII9KDxc5tHpTerJfV_PKPt8E9e3oTOpiakAtJw,16758
|
|
28
28
|
webull/core/compat.py,sha256=_r6Y_f3vTo_DoxOaCvLjnvOo1KRkD2Z9kXSh8OijEIA,3088
|
|
@@ -75,7 +75,7 @@ webull/core/http/initializer/token/token_manager.py,sha256=_5AFmiAtBBVgDf0VUaplZ
|
|
|
75
75
|
webull/core/http/initializer/token/token_operation.py,sha256=iI2H1cKfAe3gpVptHCniZso77kuPnf3jyg5b4QYQD5E,2577
|
|
76
76
|
webull/core/http/initializer/token/token_storage.py,sha256=ncGOBxR-Mtt-DFk29DTCv9T92PRRC6Ud1bVMTa46NE8,5834
|
|
77
77
|
webull/core/http/initializer/token/bean/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
-
webull/core/http/initializer/token/bean/access_token.py,sha256=
|
|
78
|
+
webull/core/http/initializer/token/bean/access_token.py,sha256=HR8b1QSTT67Zzwu2APeVmZxufpsepFnoRBPf6Q36_uk,1583
|
|
79
79
|
webull/core/http/initializer/token/bean/check_token_request.py,sha256=mYuwJPiwlnNGHxlgBMqkzGji9ZOOJ9c-o_hRwfFx0vA,1658
|
|
80
80
|
webull/core/http/initializer/token/bean/create_token_request.py,sha256=BkhC9KhrfbK9UgVqG04lZzhjvBUthZBrks4DuqxZszQ,1682
|
|
81
81
|
webull/core/http/initializer/token/bean/refresh_token_request.py,sha256=A8qPyLrEU5KuqsLuF2cDRol3XAGZnHsestLFX2XphyE,1662
|
|
@@ -91,7 +91,7 @@ webull/core/utils/desensitize.py,sha256=186BKVDomhhKnIi_4-1bWJ7P5s01rStjeIwJkTEG
|
|
|
91
91
|
webull/core/utils/validation.py,sha256=gJcIrHYtgo48yVJ0q6O-f5buTYWOcr6ShhDIBhTp-Yg,1957
|
|
92
92
|
webull/data/__init__.py,sha256=qmDV2vidxHIwq-Csqr48E9azdDe5IhO9SdLMrNlBBHw,39
|
|
93
93
|
webull/data/data_client.py,sha256=FzatKHXgu5xv-FKFaX-mFYdhLTdz7zpRUox9AGWrReQ,2429
|
|
94
|
-
webull/data/data_streaming_client.py,sha256=
|
|
94
|
+
webull/data/data_streaming_client.py,sha256=kLKjFH4INREkPIjw6efPwnHGHWIDJn42IEsQam0njb8,4623
|
|
95
95
|
webull/data/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
96
|
webull/data/common/category.py,sha256=8mtq9J9aiNan1CkwgfqRnggdH0tENyhJBJ2HI3EkUHE,978
|
|
97
97
|
webull/data/common/connect_ack.py,sha256=PGhtTzb1hAciHRvMSqMUasyEMC6vdV52taP8RbTB8t8,1209
|
|
@@ -107,7 +107,7 @@ webull/data/common/timespan.py,sha256=Yjr35Zjhj6qyW1k_pnXkDjm6fWWZ-vs44F_gMWCYCK
|
|
|
107
107
|
webull/data/internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
webull/data/internal/default_retry_policy.py,sha256=g94o5LKtbB5XoDiZWHp7yKGOWTTTOT89bz1ZSlT79mI,3307
|
|
109
109
|
webull/data/internal/exceptions.py,sha256=qtInXjns6ce6KQTtJOxz8M4bywuOJe2sNSAwGJqTWDs,1800
|
|
110
|
-
webull/data/internal/quotes_client.py,sha256=
|
|
110
|
+
webull/data/internal/quotes_client.py,sha256=OA6Dkr2TKpH31MKfm2QDN4rrUm07rdcMFU7gpSmM0k8,13010
|
|
111
111
|
webull/data/internal/quotes_decoder.py,sha256=Y849H41h-cnKPjFe9xDsvG3bWD3l7FnMcCM16yu5RuM,1420
|
|
112
112
|
webull/data/internal/quotes_payload_decoder.py,sha256=xyG2bEeicF_mZLgdMZUTC7CYpZ441o6xswWP8MKqys0,977
|
|
113
113
|
webull/data/internal/quotes_topic.py,sha256=kG4RZTjj01U0e54qoOrJHlLrPeBzXekySasm2uoyXVo,1138
|
|
@@ -133,8 +133,9 @@ webull/data/quotes/subscribe/event_snapshot_result.py,sha256=npGS47XNpxP8-u6-3K2
|
|
|
133
133
|
webull/data/quotes/subscribe/event_tick_decoder.py,sha256=-zwRK6E82ZZcl9bh8EizoI6P9u43vTmXJil1Rpd9CVI,1055
|
|
134
134
|
webull/data/quotes/subscribe/event_tick_result.py,sha256=t2N8l6YoXCZA5IntPAQTd4fMFIf_X0uSicmfeCMWJt8,1801
|
|
135
135
|
webull/data/quotes/subscribe/message_pb2.py,sha256=A0Efl43sUsebfaGxKc1J-2MZgykMgxuCBQimT5cbelI,4836
|
|
136
|
+
webull/data/quotes/subscribe/notice_decoder.py,sha256=qgikn2oF5q3TlkRe5jpq6aoJ1wX_LhlPwzQVD8Xki4Y,1094
|
|
136
137
|
webull/data/quotes/subscribe/order_result.py,sha256=bqLjRzCDK0jpQBMm00QxfgV-SPg04lOLYxc8SgpkFDw,912
|
|
137
|
-
webull/data/quotes/subscribe/payload_type.py,sha256=
|
|
138
|
+
webull/data/quotes/subscribe/payload_type.py,sha256=9wrBzV8d5SVvMDdi6tkB9T6We98SRAxRUWTNCwikWsI,832
|
|
138
139
|
webull/data/quotes/subscribe/quote_decoder.py,sha256=vTDKi3TaQ79ODTydVcEEiJR2g0fQLPf5hUOqo7Mi1gw,1016
|
|
139
140
|
webull/data/quotes/subscribe/quote_result.py,sha256=2SoRzSGANphAut1jleNnfZtUhpqqbELRcs1biu440p8,1442
|
|
140
141
|
webull/data/quotes/subscribe/snapshot_decoder.py,sha256=dukBHXa971LHp9oPkgQ4mqL_8yIAU5XSlUIUjpMz2NY,1045
|
|
@@ -303,9 +304,9 @@ webull/trade/trade/v2/account_info_v2.py,sha256=fs2-XaxklItuhaspzPkthXA5SgbnIffL
|
|
|
303
304
|
webull/trade/trade/v2/order_operation_v2.py,sha256=ZWH-6dp5rvokb5YX5HO2Op-KPLjGR4gpJ06Kc_IUilQ,12816
|
|
304
305
|
webull/trade/trade/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
305
306
|
webull/trade/trade/v3/order_opration_v3.py,sha256=Rb21Ldcve_opzFtqLKPmP0cD70DW1O0YOLgnrfD5Nnk,10886
|
|
306
|
-
webull_openapi_python_sdk-2.0.
|
|
307
|
-
webull_openapi_python_sdk-2.0.
|
|
308
|
-
webull_openapi_python_sdk-2.0.
|
|
309
|
-
webull_openapi_python_sdk-2.0.
|
|
310
|
-
webull_openapi_python_sdk-2.0.
|
|
311
|
-
webull_openapi_python_sdk-2.0.
|
|
307
|
+
webull_openapi_python_sdk-2.0.19.dist-info/licenses/LICENSE,sha256=ALOnsLtb1aHxmDJg3-oMi0BO-i-cjfyZaOBfnnavKMc,11359
|
|
308
|
+
webull_openapi_python_sdk-2.0.19.dist-info/licenses/NOTICE,sha256=X5TApte6CPV10b96Cb70IRLusXmiRmK_R-dB-1tQM_I,2018
|
|
309
|
+
webull_openapi_python_sdk-2.0.19.dist-info/METADATA,sha256=YsD7VoglDTE2tGtzpA1QG1nOQ6BQZHKJkXRO6vG1rck,1212
|
|
310
|
+
webull_openapi_python_sdk-2.0.19.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
311
|
+
webull_openapi_python_sdk-2.0.19.dist-info/top_level.txt,sha256=h8pEjNDGWS2ZUZ2vYFpUShoMQT0ZRIQaD57QJWD8_aI,15
|
|
312
|
+
webull_openapi_python_sdk-2.0.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|