Skip to content

✨ server: add evm network support for bridge onramp#951

Open
mainqueg wants to merge 1 commit intomainfrom
evm
Open

✨ server: add evm network support for bridge onramp#951
mainqueg wants to merge 1 commit intomainfrom
evm

Conversation

@mainqueg
Copy link
Copy Markdown
Member

@mainqueg mainqueg commented Apr 13, 2026

Summary by CodeRabbit

  • New Features
    • Added EVM network support to the bridge onramp, enabling USDC deposits on BASE with deposit details (network, display name, address, fee, estimated processing time).
  • Bug Fixes
    • Quote endpoint now returns deposit-only details for BASE when a monetary quote is unavailable.
  • Tests
    • Added and extended tests covering USDC on BASE flows, deposit details, address creation, and negative cases.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 13, 2026

🦋 Changeset detected

Latest commit: a52283e

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5223176c-dc6f-41e5-811e-5a129f379581

📥 Commits

Reviewing files that changed from the base of the PR and between 4915d3b and a52283e.

📒 Files selected for processing (6)
  • .changeset/bright-evm-arrive.md
  • server/api/ramp.ts
  • server/test/api/ramp.test.ts
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts
  • server/utils/ramps/manteca.ts

Walkthrough

Adds EVM (BASE) support to the bridge onramp: introduces an EVM network enum and evm payment rail, extends /quote request/response schemas to accept EVM networks and include EVM deposit addresses, threads evmNetwork through deposit lookup/creation, updates liquidation handling, adds tests, and a changeset.

Changes

Cohort / File(s) Summary
Changeset
\.changeset/bright-evm-arrive.md
Adds patch release metadata for @exactly/server announcing EVM network support.
API Schema & Endpoint
server/api/ramp.ts
Expands USDC network picklist to include EVM networks; adds DepositDetails variants per EVM network (with displayName and typed address); updates ProviderInfo/onramp currency shape to include network.
Bridge Implementation
server/utils/ramps/bridge.ts
Introduces EVMNetwork (BASE) and adds it to Network; adds "evm" to CryptoPaymentRail, maps BASEevm, threads evmNetwork into deposit-detail/liquidation logic, implements evm branch for liquidation address handling and new error code for missing network.
Manteca Ramp
server/utils/ramps/manteca.ts
Adjusts network typing in getDepositDetails to use as const for narrower type comparisons (type-narrowing only).
Tests
server/test/api/ramp.test.ts, server/test/utils/bridge.test.ts
Adds USDC/BASE coverage: quote behavior when unavailable, EVM deposit detail mapping and creation flows, EVM address formatting standardization, and negative case for unsupported rails.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant API as API (/quote)
  participant Bridge as Bridge utils
  participant DB as DB / Liquidation store

  Client->>API: GET /quote?provider=bridge&currency=USDC&network=BASE
  API->>Bridge: resolve provider & request deposit details (evmNetwork=BASE)
  Bridge->>DB: lookup liquidation address (chain="evm", network=BASE)
  alt liquidation exists
    DB-->>Bridge: return liquidation address (Address)
    Bridge-->>API: return depositInfo { displayName, address, fee, estimatedProcessingTime }
    API-->>Client: 200 { depositInfo }
  else none found
    Bridge->>DB: create liquidation address for evm (network=BASE)
    DB-->>Bridge: new liquidation address
    Bridge-->>API: return depositInfo (with new address)
    API-->>Client: 200 { depositInfo }
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • nfmelendez
  • cruzdanilo
  • dieguezguille
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 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 EVM network support for the bridge onramp provider, which is reflected across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch evm

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 introduces support for EVM networks, specifically the BASE network, for the Bridge onramp provider. Key changes include updating API validators and schemas to support the new network, extending bridge utilities to handle EVM liquidation addresses, and adding relevant test cases. I have no feedback to provide.

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.38%. Comparing base (30986c8) to head (a52283e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/utils/ramps/bridge.ts 93.10% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
+ Coverage   72.02%   72.38%   +0.35%     
==========================================
  Files         229      229              
  Lines        8358     8488     +130     
  Branches     2692     2750      +58     
==========================================
+ Hits         6020     6144     +124     
  Misses       2106     2106              
- Partials      232      238       +6     
Flag Coverage Δ
e2e 72.37% <93.54%> (+20.13%) ⬆️

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
server/utils/ramps/bridge.ts (1)

855-869: 🧹 Nitpick | 🔵 Trivial

Redundant "evm" in picklist.

CryptoPaymentRail (line 510) already includes "evm", so spreading it and appending "evm" again creates a duplicate. The schemas work correctly, but the duplication is misleading.

🔧 Proposed fix
 const CreateLiquidationAddress = object({
   currency: picklist(["usdc", "usdt"]),
-  chain: picklist([...CryptoPaymentRail, "evm"]),
+  chain: picklist(CryptoPaymentRail),
   destination_payment_rail: picklist(BridgeChain),
   destination_currency: picklist(["usdc"]),
   destination_address: Address,
 });

 const LiquidationAddress = object({
   id: string(),
   currency: picklist(["usdc", "usdt", "any"]),
-  chain: picklist([...CryptoPaymentRail, "evm"]),
+  chain: picklist(CryptoPaymentRail),
   address: string(),
   destination_address: string(),
 });

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 941559ec-be2b-4d00-b1d6-ae3ef62fbebe

📥 Commits

Reviewing files that changed from the base of the PR and between a967f8e and 54185de.

📒 Files selected for processing (5)
  • .changeset/bright-evm-arrive.md
  • server/api/ramp.ts
  • server/test/api/ramp.test.ts
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts

@mainqueg mainqueg marked this pull request as ready for review April 13, 2026 20:12
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 1 additional finding.

Open in Devin Review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

sentry[bot]

This comment was marked as resolved.

@mainqueg mainqueg force-pushed the evm branch 2 times, most recently from 1b06371 to c4899b8 Compare April 23, 2026 19:22
coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

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