mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
- [Async Basic Orderbook](./examples/py/)
|
||||
|
||||
|
||||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
import ccxt.async_support as ccxt # noqa: E402
|
||||
|
||||
|
||||
async def test():
|
||||
|
||||
exchange = ccxt.okex({
|
||||
# 'proxy': 'https://cors-anywhere.herokuapp.com/',
|
||||
# 'origin': 'foobar', # when using CORS proxies, set this to some random string
|
||||
})
|
||||
|
||||
try:
|
||||
orderbook = await exchange.fetch_order_book('BTC/USDT')
|
||||
await exchange.close()
|
||||
return orderbook
|
||||
except ccxt.BaseError as e:
|
||||
print(type(e).__name__, str(e), str(e.args))
|
||||
raise e
|
||||
|
||||
|
||||
asyncio.run(test())
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user