Skip to content

fix: search_token returns None for chainless queries due to incorrect guard placement#133

Open
bigeez wants to merge 1 commit intoOpenGradient:mainfrom
bigeez:fix/search-token-chain-none
Open

fix: search_token returns None for chainless queries due to incorrect guard placement#133
bigeez wants to merge 1 commit intoOpenGradient:mainfrom
bigeez:fix/search-token-chain-none

Conversation

@bigeez
Copy link
Copy Markdown

@bigeez bigeez commented Apr 4, 2026

Bug

search_token in onchain/tokens/metadata.py incorrectly returns None
for any token search that doesn't pass a chain argument.

The guard if chain not in SUPPORTED_CHAINS: return None was at the same
indentation level as if chain:, meaning it always ran even when chain was
None — killing chainless fallback searches silently.

Fix

Indented the SUPPORTED_CHAINS check inside the if chain: block so it
only runs when a chain is actually provided. Chainless searches now correctly
fall through to _search_token_on_dexscreener.

Testing

  • Token search with a valid chain still filters correctly
  • Token search with no chain now reaches the DexScreener fallback as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant