Skip to content

fix: preserve falsy values (0, false) in getTokens, getChains, getTools#368

Merged
chybisov merged 2 commits intomainfrom
claude/slack-add-pepe-token-list-ZIzty
Mar 20, 2026
Merged

fix: preserve falsy values (0, false) in getTokens, getChains, getTools#368
chybisov merged 2 commits intomainfrom
claude/slack-add-pepe-token-list-ZIzty

Conversation

@effie-ms
Copy link
Copy Markdown
Contributor

Which Linear task is linked to this PR?

https://linear.app/lifi-linear/issue/EMB-315/sdk-strips-minpriceusd-0-from-gettokens-requests

Why was it implemented this way?

The cleanup loop was deleting params where !params[key] was truthy. Since 0 and false are falsy in JS, passing minPriceUSD: 0 or extended: false resulted in those params being stripped before the API call.

This caused the API to apply server-side defaults (e.g., minPriceUSD: 0.0001), returning fewer tokens than expected. For example, PEPE on Arbitrum was missing from getTokens() results despite being tradeable on Jumper Exchange.

Fix: Replace !params[key] with params[key] === undefined || params[key] === null

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.

…ls params

The cleanup loop was deleting params where !params[key] was truthy.
Since 0 and false are falsy in JS, passing minPriceUSD: 0 or extended: false
resulted in those params being stripped before the API call.

This caused the API to apply server-side defaults (e.g., minPriceUSD: 0.0001),
returning fewer tokens than expected. For example, PEPE on Arbitrum was missing
from getTokens() results despite being tradeable on Jumper Exchange.

Fix: Replace !params[key] with params[key] === undefined || params[key] === null

https://claude.ai/code/session_018MDKDF3K5YHTdcVDnD5iqS
@chybisov chybisov merged commit 64a7115 into main Mar 20, 2026
2 checks passed
@chybisov chybisov deleted the claude/slack-add-pepe-token-list-ZIzty branch March 20, 2026 11:56
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.

3 participants