This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Repository navigation
Switch to pure Rabby API: fix auth headers and key rotation, drop DeBank - #5
Merged
Merged
Conversation
…ank branch Root cause of mass ERRORs (228/245): anti-bot returns fake empty-body 429 on any deviation in identity headers, throttling /v1/user/token_list even with a valid signature. - Headers now byte-faithful to the Rabby extension HAR: lowercase x-api-key/x-api-time, x-api-time = API key issuance time (not request time), x-api-ver restored, x-version bumped to 0.94.2, browser headers (accept-language, dnt, priority, sec-fetch-*) added - Key rotation: x-set-api-key is read before raise_for_status (was lost on 429/403) and stored in a process-wide key store, so per-attempt clients continue with the latest rotated key - Tokens now fetched via /v1/user/cache_token_list (all chains in one request, ~44x fewer calls) with per-chain token_list fallback; empty chain_list short-circuits token requests entirely - DeBank branch removed: api/client.py deleted, BALANCE_SOURCE dispatch and API_KEY_INIT dropped, README updated - Tests extended to 19 (fallback + single-request paths) Validation: full run 245/245 OK in ~10s (was 17/245), no phantom balances, empty and large wallets verified live. Note: CI workflow update (import check without api.client + pytest step) follows separately - the stored OAuth token lacks workflow scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
Причина массовых ERROR (228/245): анти-бот Rabby отвечает фейковым 429 с пустым телом на любое отклонение в заголовках идентификации — душил
/v1/user/token_listдаже при корректной подписи.Заголовки — байт-в-байт как клиент Rabby (по HAR расширения)
x-api-key/x-api-timex-api-time= время выдачи ключа, а не время запросаx-api-ver: v2возвращён,x-version→0.94.2accept-language,dnt,priority,sec-fetch-*Ключ
x-set-api-keyчитается доraise_for_status()(раньше терялся на 429/403)Оптимизация запросов
/v1/user/cache_token_list(~44× меньше вызовов), фолбэк на по-сетевойtoken_listchain_list→ запросы токенов пропускаются (как делает расширение)DeBank выпилен
api/client.py, диспетчерBALANCE_SOURCE,API_KEY_INITВалидация