Skip to content

✨ server: add limits to ramp provider response#723

Merged
cruzdanilo merged 1 commit intomainfrom
limits
Feb 5, 2026
Merged

✨ server: add limits to ramp provider response#723
cruzdanilo merged 1 commit intomainfrom
limits

Conversation

@mainqueg
Copy link
Copy Markdown
Member

@mainqueg mainqueg commented Feb 5, 2026

Summary by CodeRabbit

  • New Features

    • Ramp provider responses may now include optional monthly and yearly exchange limits (available amounts, caps, currency).
  • Bug Fixes

    • API responses now explicitly return success status codes for ramp-related endpoints to ensure consistent client handling.
  • Tests

    • Added and expanded tests covering onramp limits scenarios, edge cases, and failure handling.

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: da675ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @mainqueg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the server's ramp provider API by ensuring all successful JSON responses explicitly return an HTTP 200 status code. Additionally, it introduces the capability to fetch and display monthly and yearly transaction limits for active Manteca users, providing more comprehensive information within the provider's response.

Highlights

  • API Response Consistency: Explicitly set HTTP 200 status code for successful JSON responses across various endpoints in the ramp API, ensuring consistent and clear communication of success.
  • Manteca Provider Limits Integration: Integrated the fetching and display of monthly and yearly transaction limits for active Manteca ramp provider users, enhancing the information provided in the getProvider response.
  • Schema Update for Limits: Updated the ProviderInfo schema to include an optional limits object within the onramp structure, accommodating the new monthly and yearly limit details.
  • Comprehensive Limit Testing: Added extensive unit tests for the Manteca provider to validate the correct fetching, parsing, and handling of limits under various conditions, including success, empty responses, and fetch failures.
  • Changelog Entry: A new changeset file was added to document the feature of adding limits to the ramp provider response.
Changelog
  • .changeset/thin-boxes-carry.md
    • Added a new changeset file to document the feature of adding limits to the ramp provider response.
  • server/api/ramp.ts
    • Modified c.json calls to explicitly include 200 as the HTTP status code for successful responses across multiple endpoints.
  • server/test/utils/manteca.test.ts
    • Introduced new test cases to verify the correct handling of Manteca provider limits, including scenarios for active users with limits, empty limit responses, no EXCHANGE type limits, and failed limit fetches.
    • Added mockLimitsResponse for testing purposes.
  • server/utils/ramps/manteca.ts
    • Implemented logic within getProvider to fetch and parse monthly and yearly EXCHANGE type limits for active Manteca users, adding them to the onramp object.
    • Included error handling for limit fetching to capture exceptions.
  • server/utils/ramps/shared.ts
    • Extended the ProviderInfo schema to include an optional limits object within onramp, defining the structure for monthly and yearly limits with available, limit, and symbol properties.
Activity
  • No specific activity was provided in the pull request context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 5, 2026

Walkthrough

Adds optional exchange-specific onramp limits to provider responses (ProviderInfo.onramp.limits), fetches limits in manteca.getProvider for ACTIVE users, updates tests for multiple limits scenarios, and sets explicit HTTP 200 status codes on ramp API JSON responses. Includes a changeset for versioning.

Changes

Cohort / File(s) Summary
Versioning & Changelog
.changeset/thin-boxes-carry.md
Adds changeset noting patch-level update to @exactly/server and that ramp provider responses now include limits.
Schema & Type Definitions
server/utils/ramps/shared.ts
Adds optional limits to ProviderInfo.onramp with optional monthly and yearly objects (fields: available?, limit?, symbol).
Implementation Logic
server/utils/ramps/manteca.ts
For ACTIVE users, calls getLimits() and merges exchange-specific EXCHANGE-type limits into onramp.limits; on fetch errors continues without limits.
API Response Handling
server/api/ramp.ts
Sets explicit HTTP 200 status on JSON responses across providers and quote endpoints (manta/bridge/composite/default branches).
Test Suite
server/test/utils/manteca.test.ts
Adds tests covering limits present, empty limits, non-EXCHANGE limits, and limits-fetch failure; adds mockLimitsResponse test fixture.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API as API Endpoint
    participant Manteca as Manteca Utility
    participant LimitsAPI as Limits Service

    Client->>API: GET /providers or /quote
    API->>Manteca: getProvider(countryCode)
    Manteca->>LimitsAPI: getLimits(user, exchange)
    alt Limits Available
        LimitsAPI-->>Manteca: EXCHANGE-type limits
        Manteca->>Manteca: Build onramp.limits (monthly, yearly)
    else Limits Missing or Error
        LimitsAPI-->>Manteca: [] or Error
        Manteca->>Manteca: Continue without limits
    end
    Manteca-->>API: ProviderInfo (onramp[, limits])
    API-->>Client: 200 JSON response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cruzdanilo
  • nfmelendez
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding limits to ramp provider responses across the server implementation, API endpoints, tests, and type definitions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch limits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds user limits to the ramp provider response, which is a great enhancement. The implementation looks solid, with corresponding schema updates and new logic to fetch and include the limits. The new tests cover this functionality well. My main feedback is a suggestion to refactor some of the new tests to reduce duplication and improve maintainability. Overall, good work!

Comment thread server/test/utils/manteca.test.ts Outdated
@cruzdanilo cruzdanilo marked this pull request as ready for review February 5, 2026 18:32
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@cruzdanilo
Copy link
Copy Markdown
Member

@cursor review

@sentry
Copy link
Copy Markdown

sentry Bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.12%. Comparing base (9ac36f0) to head (da675ee).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/api/ramp.ts 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #723      +/-   ##
==========================================
+ Coverage   68.09%   68.12%   +0.03%     
==========================================
  Files         206      206              
  Lines        6776     6780       +4     
  Branches     2113     2114       +1     
==========================================
+ Hits         4614     4619       +5     
+ Misses       1981     1980       -1     
  Partials      181      181              
Flag Coverage Δ
e2e 68.11% <90.00%> (+15.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cruzdanilo cruzdanilo merged commit da675ee into main Feb 5, 2026
15 checks passed
@cruzdanilo cruzdanilo deleted the limits branch February 5, 2026 19:48
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.

2 participants