-) updated CHANGELOG

-) updated example get_authenticated_data.py
-) updated string formatter margin_info.py and margin_info_base.py
This commit is contained in:
itsdeka
2021-06-25 12:20:37 +02:00
parent a28b263238
commit 6df56657d3
4 changed files with 12 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
1.1.16 1.1.16
-) Implemented Margin Info (rest) -) Implemented Margin Info (rest)
-) Implemented claim position (rest)
1.1.15 1.1.15
-) Added 'ids' parameter to get_order_history() -) Added 'ids' parameter to get_order_history()

View File

@@ -80,12 +80,13 @@ async def log_funding_credits_history():
[ print (c) for c in credit ] [ print (c) for c in credit ]
async def log_margin_info(): async def log_margin_info():
m1 = await bfx.rest.get_margin_info('tBTCUSD') margin_info = await bfx.rest.get_margin_info('tBTCUSD')
print (m1) print(margin_info)
m2 = await bfx.rest.get_margin_info('sym_all') sym_all = await bfx.rest.get_margin_info('sym_all') # list of Margin Info
print (m2) for margin_info in sym_all:
m3 = await bfx.rest.get_margin_info('base') print(margin_info)
print (m3) base = await bfx.rest.get_margin_info('base')
print(base)
async def run(): async def run():
await log_wallets() await log_wallets()

View File

@@ -43,4 +43,5 @@ class MarginInfo:
return MarginInfo(symbol, tradable_balance, gross_balance, buy, sell) return MarginInfo(symbol, tradable_balance, gross_balance, buy, sell)
def __str__(self): def __str__(self):
return "Margin Info {}".format(self.symbol) return "Margin Info {} buy={} sell={} tradable_balance={} gross_balance={}" \
"".format(self.symbol, self.buy, self.sell, self. tradable_balance, self. gross_balance)

View File

@@ -44,4 +44,5 @@ class MarginInfoBase:
return MarginInfoBase(user_pl, user_swaps, margin_balance, margin_net, margin_min) return MarginInfoBase(user_pl, user_swaps, margin_balance, margin_net, margin_min)
def __str__(self): def __str__(self):
return "Margin Info Base" return "Margin Info Base user_pl={} user_swaps={} margin_balance={} margin_net={} margin_min={}" \
"".format(self.user_pl, self.user_swaps, self.margin_balance, self.margin_net, self.margin_min)