mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 16:58:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
- [Async Bybit Transfer](./examples/py/)
|
||||
|
||||
|
||||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
import ccxt.async_support as ccxt # noqa: E402
|
||||
|
||||
|
||||
async def main():
|
||||
exchange = ccxt.bybit({
|
||||
'apiKey': 'YOUR_API_KEY',
|
||||
'secret': 'YOUR_SECRET',
|
||||
# 'verbose': True, # for debug output
|
||||
})
|
||||
await exchange.load_markets()
|
||||
try:
|
||||
pprint(await exchange.fetch_transfers()) # Fetch your transfer history
|
||||
# pprint(await exchange.transfer('USDT', 1.0, 'swap', 'spot')) # Transfer to the spot wallet
|
||||
# pprint(await exchange.transfer('USDT', 1.0, 'spot', 'future')) # Transfer to the Derivatives wallet
|
||||
# pprint(await exchange.transfer('USDT', 1.0, 'spot', 'swap')) # Transfer to the Derivatives wallet
|
||||
# pprint(await exchange.transfer('USDC', 1.0, 'spot', 'option')) # Transfer to the USDC Derivatives wallet
|
||||
except Exception as e:
|
||||
print(e)
|
||||
await exchange.close()
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user