Skip to content

Conversation

@georgeweiler
Copy link
Contributor

@georgeweiler georgeweiler commented Jan 16, 2026

Explanation

Add providers state and getProviders method to RampsController

Adds providers state to RampsController and fetches providers from the V2 API endpoint.

Changes:

  • Added providers: Provider[] to RampsControllerState
  • Added getProviders() method to RampsService that calls /v2/regions/:regionCode/providers with optional filters (provider, crypto, fiat, payments)
  • Added getProviders() method to RampsController with caching and state management
  • Providers are automatically fetched on init() when a region is available
  • Providers are automatically refetched when the region changes in updateUserRegion() and setUserRegion()
  • Providers are cleared when the region is cleared or changed

Testing:

  • Added comprehensive tests for getProviders functionality
  • Updated existing tests to include providers in state snapshots
  • All 74 tests passing

References

https://consensyssoftware.atlassian.net/browse/TRAM-3153

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Adds provider fetching and state management across the ramps stack.

  • RampsService: New getProviders(regionCode, { provider, crypto, fiat, payments }) calling v2/regions/:regionCode/providers; validates responses; exposed via messenger (RampsService:getProviders).
  • RampsController: New providers in state and getProviders() with request caching and region normalization; integrates into init(), updateUserRegion(), and setUserRegion(); clears providers (and tokens) when region changes or fetch fails; persisted and included in metadata.
  • Tests: Comprehensive tests for provider API, controller integration, caching, filters, and state snapshots; selector tests updated; changelog updated.

Written by Cursor Bugbot for commit cca85b7. This will update automatically on new commits. Configure here.

@georgeweiler georgeweiler marked this pull request as ready for review January 16, 2026 19:00
@georgeweiler georgeweiler requested review from a team as code owners January 16, 2026 19:00
@georgeweiler georgeweiler changed the title feat: Add providers state and getProviders method to RampsController feat(ramps): add providers state and getProviders method to RampsController Jan 16, 2026
@georgeweiler georgeweiler added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 915a340 Jan 16, 2026
294 checks passed
@georgeweiler georgeweiler deleted the TRAM-3153-get-ramp-providers branch January 16, 2026 20:06
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