File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
import hashlib
3
3
import hmac
4
+ import math
4
5
from json import dumps , loads
5
6
from time import time
6
7
@@ -78,7 +79,7 @@ async def get_target_coin_balance(self,
78
79
for current_balance in loads (response_text )['result' ]['list' ]:
79
80
if current_balance ['accountType' ] == 'SPOT' :
80
81
if current_balance ['coin' ]:
81
- return float (current_balance ['coin' ][0 ]['free ' ])
82
+ return float (current_balance ['coin' ][0 ]['walletBalance ' ])
82
83
83
84
return None
84
85
@@ -178,7 +179,10 @@ async def main_work(self) -> None:
178
179
logger .error (f'Error When Getting Base Precision: { self .token_from .upper ()} , Using 0.1' )
179
180
token_base_precision : float = 0.1
180
181
181
- token_from_balance : float = round (token_from_balance , len (str (token_base_precision ).split ('.' )[- 1 ]))
182
+ token_from_balance : float = math .floor (
183
+ token_from_balance * 10 ** len (str (token_base_precision ).split ('.' )[1 ])) / 10 ** len (
184
+ str (token_base_precision ).split ('.' )[1 ])
185
+
182
186
logger .info (f'{ self .token_from .upper ()} - { token_from_balance } ' )
183
187
184
188
await self .run_tasks (session = session ,
You can’t perform that action at this time.
0 commit comments