Force-refresh header balances after transfers and balance SSE events.
Invalidate balance caches on mutation, push SSE balance tick, and bypass 60s cache when refreshing funds. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -26,6 +26,11 @@ _OKX_OPTION_ERR_ZH: dict[str, str] = {
|
||||
_OPTIONS_BALANCE_CACHE: dict[str, Any] = {"updated_at": 0.0, "data": None}
|
||||
|
||||
|
||||
def invalidate_options_balance_cache() -> None:
|
||||
_OPTIONS_BALANCE_CACHE["updated_at"] = 0.0
|
||||
_OPTIONS_BALANCE_CACHE["data"] = None
|
||||
|
||||
|
||||
def _okx_trade_error_message(exc: BaseException | None = None, resp: Any = None) -> str:
|
||||
row: dict[str, Any] | None = None
|
||||
if isinstance(resp, dict):
|
||||
|
||||
Reference in New Issue
Block a user