MCPcopy Create free account
hub / github.com/ccxt/ccxt / set_balance_cache

Method set_balance_cache

python/ccxt/pro/binance.py:2511–2522  ·  view source on GitHub ↗
(self, client: Client, type, isPortfolioMargin=False)

Source from the content-addressed store, hash-verified

2509 return
2510
2511 def set_balance_cache(self, client: Client, type, isPortfolioMargin=False):
2512 if (type in client.subscriptions) and (type in self.balance):
2513 return
2514 options = self.safe_value(self.options, 'watchBalance')
2515 fetchBalanceSnapshot = self.safe_bool(options, 'fetchBalanceSnapshot', False)
2516 if fetchBalanceSnapshot:
2517 messageHash = type + ':fetchBalanceSnapshot'
2518 if not (messageHash in client.futures):
2519 client.future(messageHash)
2520 self.spawn(self.load_balance_snapshot, client, messageHash, type, isPortfolioMargin)
2521 else:
2522 self.balance[type] = {}
2523
2524 async def load_balance_snapshot(self, client, messageHash, type, isPortfolioMargin):
2525 params = {

Callers 4

watch_balanceMethod · 0.95
watch_ordersMethod · 0.95
watch_positionsMethod · 0.95
watch_my_tradesMethod · 0.95

Calls 4

safe_valueMethod · 0.80
safe_boolMethod · 0.80
futureMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected