mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
- [Phemex Perpetual Balance](./examples/py/)
|
||||
|
||||
|
||||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from asyncio import run
|
||||
import os
|
||||
import sys
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
import ccxt.async_support as ccxt # noqa: E402
|
||||
|
||||
print('CCXT Version:', ccxt.__version__)
|
||||
|
||||
async def main():
|
||||
exchange = ccxt.phemex({
|
||||
"apiKey": "YOUR_API_KEY",
|
||||
"secret": "YOUR_SECRET",
|
||||
'options': { 'defaultType': 'swap' }
|
||||
})
|
||||
markets = await exchange.load_markets()
|
||||
# exchange.verbose = True # uncomment for debugging purposes if necessary
|
||||
usd_balance = await exchange.fetch_balance({'code': 'USD'})
|
||||
btc_balance = await exchange.fetch_balance({'code': 'BTC'})
|
||||
balance = exchange.deep_extend(usd_balance, btc_balance)
|
||||
pprint(balance)
|
||||
await exchange.close()
|
||||
|
||||
|
||||
run(main())
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user