fix(ramps): Case sensitive mismatch between token assetIds and provider keys#28399
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ff1e4c5. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Token assetIds from the controller use checksummed (mixed-case) addresses (e.g.
eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), but the on-ramp API and providersupportedCryptoCurrencieskeys use lowercase. This case mismatch caused two bugs:"Token Not Available" modal shown incorrectly —
BuildQuotecheckedsupportedCryptoCurrencies[assetId]with a checksummed key against lowercase map keys. The lookup returnedundefined, so every ERC-20 token appeared unsupported.Payment methods endpoint returned empty —
useRampsPaymentMethodspassed the checksummed assetId to the API as thecryptoquery param. The API is case-sensitive and returned no results for the uppercase variant.Changes:
providerSupportsAsset.ts(new utility) — Case-insensitive lookup againstsupportedCryptoCurrencies. Tries the original key first, falls back totoLowerCase().BuildQuote.tsx— 3 locations replacedsupportedCryptoCurrencies?.[assetId]withproviderSupportsAsset(): theisTokenUnavailablecheck, first-time provider selection, and auto-switch on soft selection.ProviderSelectionModal.tsx—displayProvidersfilter usesproviderSupportsAsset()instead of direct bracket lookup.ProviderSelection.tsx— Supported/unsupported provider separation usesproviderSupportsAsset().useRampsPaymentMethods.ts— LowercasesassetIdbefore passing to the payment methods API call.Changelog
CHANGELOG entry: Fixed case-sensitive assetId mismatch that caused false "Token Not Available" modal and empty payment methods for ERC-20 tokens
Related issues
Manual testing steps
Screenshots/Recordings
Before
ScreenRecording_04-04-2026.08-18-44_1.MP4
After
Screen.Recording.2026-04-04.145248.mp4
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: small, localized changes that normalize
assetIdcasing and centralize the provider support check; behavior changes are limited to provider filtering/selection and payment-methods fetch parameters.Overview
Fixes a case-sensitivity mismatch between checksummed token
assetIds and lowercase provider/API identifiers.Adds
providerSupportsAsset()for case-insensitivesupportedCryptoCurrencieslookups and switches Build Quote + provider selection modals to use it for token availability checks and provider filtering/auto-selection. Also lowercasesassetIdbefore calling the payment methods endpoint, with new unit tests covering both behaviors.Reviewed by Cursor Bugbot for commit 086e404. Bugbot is set up for automated code reviews on this repo. Configure here.