Conversation
🦋 Changeset detectedLatest commit: 06db66b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe Bridge offramp flow validates rail-specific references, creates transfers during external-account creation, reuses matching static templates, reports missing transfers, and exposes transfer references in deposit details. Tests and patch changesets cover the updated behavior. ChangesBridge offramp flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant RampAPI
participant Bridge
participant BridgeTransfers
Client->>RampAPI: POST external-account with rail and reference
RampAPI->>Bridge: createExternalAccount(payload)
Bridge-->>RampAPI: external account
RampAPI->>Bridge: createOfframpTransfer(account, rail, reference)
Bridge->>BridgeTransfers: POST /transfers with rail-specific reference
BridgeTransfers-->>Bridge: created transfer
Bridge-->>RampAPI: transfer result
RampAPI-->>Client: external account response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces support for offramp transfer references and updates the external account creation flow to automatically create an offramp transfer. The review feedback highlights a potential failure state where a failed transfer creation leaves an orphaned external account, recommending a nested try-catch block to clean up the account and a corresponding test update. Additionally, it suggests narrowing the currency parameter type in createOfframpTransfer to (typeof FiatCurrency)[number] to improve type safety.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb8ce3926e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1165 +/- ##
==========================================
+ Coverage 70.69% 71.12% +0.42%
==========================================
Files 263 263
Lines 11446 11626 +180
Branches 3833 3909 +76
==========================================
+ Hits 8092 8269 +177
+ Misses 3059 3057 -2
- Partials 295 300 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 291c6cc2-afde-432d-b96f-147e7a88f30d
📒 Files selected for processing (6)
.changeset/quick-lions-attack.md.changeset/swift-badgers-cheer.mdserver/api/ramp.tsserver/test/api/ramp.test.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67003a7fbf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
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)
974-1002: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftBackfill static offramp templates before requiring them.
getOfframpDepositDetailsnow throwsOFFRAMP_TRANSFER_NOT_FOUNDfor any external account without an active static template, and/ramp/quotesurfaces that as a 400TRANSFER_NOT_FOUND. Existing external accounts that relied on the previous create-on-fetch path will stop getting deposit info unless pre-existing templates are backfilled or a compatibility fallback is kept.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5a80c1af-d615-4276-8c0c-d94a3191e36d
📒 Files selected for processing (6)
.changeset/quick-lions-attack.md.changeset/swift-badgers-cheer.mdserver/api/ramp.tsserver/test/api/ramp.test.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
There was a problem hiding this comment.
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)
974-1002: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winConsider fetching the external account and static templates in parallel.
getExternalAccountandgetStaticTemplatesare awaited sequentially here, adding avoidable latency.removeExternalAccount(same file) already fetches both concurrently viaPromise.alland validates afterward — the same pattern would work here since template lookup only needscustomer.id/externalAccountId, not the resolvedexternalAccount.♻️ Suggested refactor
- const externalAccount = await getExternalAccount(customer.id, externalAccountId); + const [externalAccount, templates] = await Promise.all([ + getExternalAccount(customer.id, externalAccountId), + getStaticTemplates(customer.id), + ]); if (!externalAccount) throw new Error(ErrorCodes.EXTERNAL_ACCOUNT_NOT_FOUND); if (externalAccount.currency !== CurrencyToBridge[currency]) { throw new Error(ErrorCodes.EXTERNAL_ACCOUNT_CURRENCY_MISMATCH); } const paymentRail = PaymentRailByBridgeCurrency[externalAccount.currency]; if (!paymentRail) throw new Error(ErrorCodes.NOT_AVAILABLE_CURRENCY); - const templates = await getStaticTemplates(customer.id); const transfer = templates.find(
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 32ee92fb-00c0-461f-90b4-676d7fc45e4e
📒 Files selected for processing (6)
.changeset/quick-lions-attack.md.changeset/swift-badgers-cheer.mdserver/api/ramp.tsserver/test/api/ramp.test.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
Summary by CodeRabbit