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.2.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for pyfairdesk-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc43bf0fe04908b04f17d8703b256826c232ad56bfbab7f49e93b1f00c20bae4 |
|
MD5 | 0fe40ef6e044f26c138102dde9fb64b0 |
|
BLAKE2b-256 | ac484e922bff2ca94fdc552413eb0c0b2021884a27d92062eab58c35a5c8f5d0 |