Skip to content

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

Merged
cruzdanilo merged 1 commit intomainfrom
evm
Apr 28, 2026
Merged

✨ server: add evm network support for bridge onramp#951
cruzdanilo merged 1 commit intomainfrom
evm

Conversation

@mainqueg
Copy link
Copy Markdown
Member

@mainqueg mainqueg commented Apr 13, 2026

closes #962

Summary by CodeRabbit

  • New Features
    • Added EVM network support to the bridge onramp, enabling USDC deposits on BASE with network-specific deposit details (network, display name, address, fee, estimated processing time).
  • Bug Fixes
    • Quote endpoint returns deposit-only details for BASE when a monetary quote is unavailable; provider currency listings now include EVM networks consistently.
  • 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: 7093014

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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds EVM (BASE) support to the bridge onramp: introduces an EVM network enum and evm payment rail, expands /quote request/response schemas to accept EVM networks and include EVM deposit addresses, threads evmNetwork through deposit lookup/creation and liquidation handling, updates tests, and adds 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 per-network DepositDetails variants with displayName and typed address; updates ProviderInfo.onramp.currencies to use the unified network picklist.
Bridge Implementation
server/utils/ramps/bridge.ts
Introduces EVMNetwork (BASE) and adds it to Network; adds "evm" to CryptoPaymentRail, maps BASE → evm; computes cryptoCurrencies (USDC per EVM network plus SOLANA/STELLAR/TRON); threads evmNetwork into deposit-detail/liquidation logic; implements evm branch for liquidation-address handling and new error code for missing network; refactors fiat aggregation to use flatMap.
Manteca Ramp Typing
server/utils/ramps/manteca.ts
Narrowed network discriminator typing by using as const on computed ${currency}-${exchange} to improve TypeScript literal narrowing (no runtime change).
Tests
server/test/api/ramp.test.ts, server/test/utils/bridge.test.ts
Adds USDC/BASE test coverage: new bridge quote test for network=BASE, mocks bridge customer lookup and deposit details, standardizes EVM address padding via padHex, adds tests for deposit retrieval/creation and unsupported-rail error cases.

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 'add evm network support for bridge onramp' accurately summarizes the main change across the PR—adding EVM network (specifically BASE) support to the bridge onramp feature, which is reflected in 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 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 94.64286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.95%. Comparing base (7e59d69) to head (7093014).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/utils/ramps/bridge.ts 94.23% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
+ Coverage   72.73%   72.95%   +0.21%     
==========================================
  Files         229      229              
  Lines        8572     8671      +99     
  Branches     2781     2836      +55     
==========================================
+ Hits         6235     6326      +91     
  Misses       2103     2103              
- Partials      234      242       +8     
Flag Coverage Δ
e2e 71.32% <85.71%> (+0.61%) ⬆️

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.

@mainqueg mainqueg force-pushed the evm branch 2 times, most recently from a52283e to 2f52e56 Compare April 27, 2026 16:56
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)

446-466: ⚠️ Potential issue | 🟠 Major

Make EVM liquidation-address reuse network-aware.

Lines 446-466 reuse an existing address by chain === "evm" and currency only, then relabel it with whatever network the caller requested. That is fine for BASE-only today, but it will silently return the wrong address as soon as EVMNetwork has more than one entry. Please key reuse on the actual EVM network as well, or guard this path so a generic "evm" address cannot be presented as multiple networks.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8acf8f86-5cb2-4a06-b936-eb056da1b805

📥 Commits

Reviewing files that changed from the base of the PR and between a52283e and 2f52e56.

📒 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

@cruzdanilo cruzdanilo merged commit 7093014 into main Apr 28, 2026
12 of 13 checks passed
@cruzdanilo cruzdanilo deleted the evm branch April 28, 2026 20:41
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.

server: support bridge evm chain

2 participants