python wrapper for Fairdesk API
Project description
pyfairdesk
python wrapper of the Fairdesk API
Fairdesk Sign up
Install
$ pip install pyfairdesk
API Usage
Load Markets
import pyfairdesk
exchange = pyfairdesk.Fairdesk()
exchange.load_markets()
fetch balances
import pprint
import pyfairdesk
with open("../fairdesk.key", "r", encoding="utf-8") as f:
lines = f.readlines()
key = lines[0].strip()
secret = lines[1].strip()
exchange = pyfairdesk.Fairdesk(key, secret)
resp = exchange.fetch_balance()
data = resp['data']
pprint.pprint(data)
response
{'accounts': [{'accountBalance': '463.56',
'availBalance': '463.56',
'bonus': '35.00',
'currency': 'USDT',
'display': 'Tether',
'icon': 'https://sgtnstatic-1306519353.cos.ap-singapore.myqcloud.com/currency/USDT.png',
'positionMargin': '0.00',
'unRealizedPnL': '0.00'}],
'marginBalanceBtc': '0.01149596',
'marginBalanceUsd': '463.56',
'totalAccountBalance': '463.56',
'totalUnRealizedPnL': '0.00'}
Margin mode and leverage
import pyfairdesk
with open("../fairdesk.key", "r", encoding="utf-8") as f:
lines = f.readlines()
key = lines[0].strip()
secret = lines[1].strip()
exchange = pyfairdesk.Fairdesk(key, secret)
resp = exchange.fetch_symbol_config()
data = resp['data']
for symbol in data:
print(symbol)
response
{'symbol': 'axsusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'thetausdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'linkusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'ftmusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'xlmusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
{'symbol': 'sushiusdt', 'crossLeverage': 20, 'isolatedLeverage': 20, 'makerFeeRate': '0.00018', 'takerFeeRate': '0.00028'}
order
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyfairdesk-0.0.3.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyfairdesk-0.0.3.tar.gz.
File metadata
- Download URL: pyfairdesk-0.0.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
397f30776b415d23519d26b6dd303c9e42a05e5ec9d0b7f2a4d82ade3c135233
|
|
| MD5 |
7dfda87fede953da8a238ac86c0648e2
|
|
| BLAKE2b-256 |
e91044c3dc42eba13c771f3eee419ed94adbb0985a306e56e76bc61268712a3a
|
File details
Details for the file pyfairdesk-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pyfairdesk-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68ddb2ec509f501d1556622470dad9ce3d4c983d95173d3eded90a81d278d038
|
|
| MD5 |
d7790b82d12424d63449b2452726405d
|
|
| BLAKE2b-256 |
6bbac8b2dc5a06a866f6f6ddbc3444a58f653b6c5281eba44e553f4cbd669d0e
|