File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,17 @@ def get_adapter_class(self):
102102 return BinanceCCXTAdapter
103103
104104 async def get_account_id (self , ** kwargs : dict ) -> str :
105- raw_balance = await self .connector .client .fetch_balance ()
106105 try :
107- return raw_balance [ccxt_constants .CCXT_INFO ]["uid" ]
108- except KeyError :
109106 if self .exchange_manager .is_future :
110- raise NotImplementedError ("get_account_id is not implemented on binance futures account" )
111- # should not happen in spot
107+ raw_binance_balance = await self .connector .client .fapiPrivateV3GetBalance ()
108+ # accountAlias = unique account code
109+ # from https://binance-docs.github.io/apidocs/futures/en/#futures-account-balance-v3-user_data
110+ return raw_binance_balance [0 ]["accountAlias" ]
111+ else :
112+ raw_balance = await self .connector .client .fetch_balance ()
113+ return raw_balance [ccxt_constants .CCXT_INFO ]["uid" ]
114+ except (KeyError , IndexError ):
115+ # should not happen
112116 raise
113117
114118 def _infer_account_types (self , exchange_manager ):
You can’t perform that action at this time.
0 commit comments