Skip to content

Commit 5e29afd

Browse files
docs (async ws api)
1 parent 80a23f2 commit 5e29afd

File tree

14 files changed

+19
-23
lines changed

14 files changed

+19
-23
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,15 @@ ubwa.unsubscribe_from_stream(stream_id=stream_id, channels=channels)
146146
```
147147
from unicorn_binance_websocket_api import BinanceWebSocketApiManager
148148
149+
api_key = "YOUR_BINANCE_API_KEY"
150+
api_secret = "YOUR_BINANCE_API_SECRET"
149151
150152
async def process_api_responses(stream_id=None):
151153
while ubwa.is_stop_request(stream_id=stream_id) is False:
152154
data = await ubwa.get_stream_data_from_asyncio_queue(stream_id=stream_id)
153155
print(data)
154156
ubwa.asyncio_queue_task_done(stream_id=stream_id)
155157
156-
api_key = "YOUR_BINANCE_API_KEY"
157-
api_secret = "YOUR_BINANCE_API_SECRET"
158-
159158
ubwa = BinanceWebSocketApiManager(exchange="binance.com")
160159
api_stream = ubwa.create_stream(api=True,
161160
api_key=api_key,

dev/sphinx/source/readme.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,15 @@ ubwa.unsubscribe_from_stream(stream_id=stream_id, channels=channels)
146146
```
147147
from unicorn_binance_websocket_api import BinanceWebSocketApiManager
148148
149+
api_key = "YOUR_BINANCE_API_KEY"
150+
api_secret = "YOUR_BINANCE_API_SECRET"
149151
150152
async def process_api_responses(stream_id=None):
151153
while ubwa.is_stop_request(stream_id=stream_id) is False:
152154
data = await ubwa.get_stream_data_from_asyncio_queue(stream_id=stream_id)
153155
print(data)
154156
ubwa.asyncio_queue_task_done(stream_id=stream_id)
155157
156-
api_key = "YOUR_BINANCE_API_KEY"
157-
api_secret = "YOUR_BINANCE_API_SECRET"
158-
159158
ubwa = BinanceWebSocketApiManager(exchange="binance.com")
160159
api_stream = ubwa.create_stream(api=True,
161160
api_key=api_key,

docs/_modules/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ <h3>Navigation</h3>
254254
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
255255
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
256256
See <a href="/license.html">License</a> for more information.<br />
257-
Last updated on Apr 02 2024 at 10:11 (CET).
257+
Last updated on Apr 02 2024 at 10:14 (CET).
258258
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
259259
<br />
260260
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/_sources/readme.md.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,15 @@ ubwa.unsubscribe_from_stream(stream_id=stream_id, channels=channels)
146146
```
147147
from unicorn_binance_websocket_api import BinanceWebSocketApiManager
148148

149+
api_key = "YOUR_BINANCE_API_KEY"
150+
api_secret = "YOUR_BINANCE_API_SECRET"
149151

150152
async def process_api_responses(stream_id=None):
151153
while ubwa.is_stop_request(stream_id=stream_id) is False:
152154
data = await ubwa.get_stream_data_from_asyncio_queue(stream_id=stream_id)
153155
print(data)
154156
ubwa.asyncio_queue_task_done(stream_id=stream_id)
155157

156-
api_key = "YOUR_BINANCE_API_KEY"
157-
api_secret = "YOUR_BINANCE_API_SECRET"
158-
159158
ubwa = BinanceWebSocketApiManager(exchange="binance.com")
160159
api_stream = ubwa.create_stream(api=True,
161160
api_key=api_key,

docs/changelog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ <h3>Navigation</h3>
39423942
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
39433943
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
39443944
See <a href="/license.html">License</a> for more information.<br />
3945-
Last updated on Apr 02 2024 at 10:11 (CET).
3945+
Last updated on Apr 02 2024 at 10:14 (CET).
39463946
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
39473947
<br />
39483948
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/code_of_conduct.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ <h3>Navigation</h3>
399399
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
400400
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
401401
See <a href="/license.html">License</a> for more information.<br />
402-
Last updated on Apr 02 2024 at 10:11 (CET).
402+
Last updated on Apr 02 2024 at 10:14 (CET).
403403
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
404404
<br />
405405
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/contributing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ <h3>Navigation</h3>
338338
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
339339
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
340340
See <a href="/license.html">License</a> for more information.<br />
341-
Last updated on Apr 02 2024 at 10:11 (CET).
341+
Last updated on Apr 02 2024 at 10:14 (CET).
342342
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
343343
<br />
344344
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/genindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ <h3>Navigation</h3>
779779
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
780780
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
781781
See <a href="/license.html">License</a> for more information.<br />
782-
Last updated on Apr 02 2024 at 10:11 (CET).
782+
Last updated on Apr 02 2024 at 10:14 (CET).
783783
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
784784
<br />
785785
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ <h3>Navigation</h3>
10591059
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
10601060
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
10611061
See <a href="/license.html">License</a> for more information.<br />
1062-
Last updated on Apr 02 2024 at 10:11 (CET).
1062+
Last updated on Apr 02 2024 at 10:14 (CET).
10631063
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
10641064
<br />
10651065
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/license.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ <h3>Navigation</h3>
389389
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
390390
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
391391
See <a href="/license.html">License</a> for more information.<br />
392-
Last updated on Apr 02 2024 at 10:11 (CET).
392+
Last updated on Apr 02 2024 at 10:14 (CET).
393393
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
394394
<br />
395395
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/py-modindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ <h3>Navigation</h3>
302302
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
303303
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
304304
See <a href="/license.html">License</a> for more information.<br />
305-
Last updated on Apr 02 2024 at 10:11 (CET).
305+
Last updated on Apr 02 2024 at 10:14 (CET).
306306
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
307307
<br />
308308
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/readme.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,15 @@ <h2>Send Requests to Binance WebSocket API<a class="headerlink" href="#send-requ
374374
<h3><a class="reference external" href="https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.api.BinanceWebSocketApiApi.create_order">Place orders</a>, <a class="reference external" href="https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.api.BinanceWebSocketApiApi.cancel_order">cancel orders</a> or <a class="reference external" href="https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#module-unicorn_binance_websocket_api.api">send other requests</a> via WebSocket:<a class="headerlink" href="#place-orders-cancel-orders-or-send-other-requests-via-websocket" title="Link to this heading"></a></h3>
375375
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">unicorn_binance_websocket_api</span> <span class="kn">import</span> <span class="n">BinanceWebSocketApiManager</span>
376376

377+
<span class="n">api_key</span> <span class="o">=</span> <span class="s2">&quot;YOUR_BINANCE_API_KEY&quot;</span>
378+
<span class="n">api_secret</span> <span class="o">=</span> <span class="s2">&quot;YOUR_BINANCE_API_SECRET&quot;</span>
377379

378380
<span class="k">async</span> <span class="k">def</span> <span class="nf">process_api_responses</span><span class="p">(</span><span class="n">stream_id</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
379381
<span class="k">while</span> <span class="n">ubwa</span><span class="o">.</span><span class="n">is_stop_request</span><span class="p">(</span><span class="n">stream_id</span><span class="o">=</span><span class="n">stream_id</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span>
380382
<span class="n">data</span> <span class="o">=</span> <span class="k">await</span> <span class="n">ubwa</span><span class="o">.</span><span class="n">get_stream_data_from_asyncio_queue</span><span class="p">(</span><span class="n">stream_id</span><span class="o">=</span><span class="n">stream_id</span><span class="p">)</span>
381383
<span class="nb">print</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
382384
<span class="n">ubwa</span><span class="o">.</span><span class="n">asyncio_queue_task_done</span><span class="p">(</span><span class="n">stream_id</span><span class="o">=</span><span class="n">stream_id</span><span class="p">)</span>
383385

384-
<span class="n">api_key</span> <span class="o">=</span> <span class="s2">&quot;YOUR_BINANCE_API_KEY&quot;</span>
385-
<span class="n">api_secret</span> <span class="o">=</span> <span class="s2">&quot;YOUR_BINANCE_API_SECRET&quot;</span>
386-
387386
<span class="n">ubwa</span> <span class="o">=</span> <span class="n">BinanceWebSocketApiManager</span><span class="p">(</span><span class="n">exchange</span><span class="o">=</span><span class="s2">&quot;binance.com&quot;</span><span class="p">)</span>
388387
<span class="n">api_stream</span> <span class="o">=</span> <span class="n">ubwa</span><span class="o">.</span><span class="n">create_stream</span><span class="p">(</span><span class="n">api</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
389388
<span class="n">api_key</span><span class="o">=</span><span class="n">api_key</span><span class="p">,</span>
@@ -1041,7 +1040,7 @@ <h3>Navigation</h3>
10411040
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
10421041
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
10431042
See <a href="/license.html">License</a> for more information.<br />
1044-
Last updated on Apr 02 2024 at 10:11 (CET).
1043+
Last updated on Apr 02 2024 at 10:14 (CET).
10451044
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
10461045
<br />
10471046
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ <h3>Navigation</h3>
227227
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
228228
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
229229
See <a href="/license.html">License</a> for more information.<br />
230-
Last updated on Apr 02 2024 at 10:11 (CET).
230+
Last updated on Apr 02 2024 at 10:14 (CET).
231231
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
232232
<br />
233233
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/security.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ <h3>Navigation</h3>
344344
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
345345
&copy; <a href="/license.html">Copyright</a> 2023-2023, LUCIT Systems and Development. All Rights Reserved..
346346
See <a href="/license.html">License</a> for more information.<br />
347-
Last updated on Apr 02 2024 at 10:11 (CET).
347+
Last updated on Apr 02 2024 at 10:14 (CET).
348348
<a href="https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose">Found a bug</a>?
349349
<br />
350350
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

0 commit comments

Comments
 (0)