()
| 24 | |
| 25 | |
| 26 | async def main(): |
| 27 | exchange = ccxt.okx({ |
| 28 | 'apiKey': 'YOUR_API_KEY', |
| 29 | 'secret': 'YOUR_SECRET', |
| 30 | 'enableRateLimit': False, # not recommended |
| 31 | }) |
| 32 | markets = await exchange.load_markets() |
| 33 | # exchange.verbose = True # uncomment for debugging purposes |
| 34 | symbol = 'BTC/USDT' |
| 35 | loops = [ |
| 36 | exchange.fetch_balance(), |
| 37 | exchange.fetch_order_book(symbol), |
| 38 | exchange.fetch_open_orders() |
| 39 | ] |
| 40 | results = await gather(*loops) |
| 41 | print('Balance:') |
| 42 | print(results[0]) |
| 43 | print('------------------------------------------------------------------') |
| 44 | print(symbol, 'orderbook:') |
| 45 | print(results[1]) |
| 46 | print('------------------------------------------------------------------') |
| 47 | print('Open orders:') |
| 48 | print(results[2]) |
| 49 | await exchange.close() |
| 50 | |
| 51 | |
| 52 | run(main()) |
no test coverage detected
searching dependent graphs…