Skip to content

Update Infinite ONRAMP for new headless transfer API#6005

Open
j0ntz wants to merge 6 commits intodevelopfrom
jon/infinite-buy-again
Open

Update Infinite ONRAMP for new headless transfer API#6005
j0ntz wants to merge 6 commits intodevelopfrom
jon/infinite-buy-again

Conversation

@j0ntz
Copy link
Copy Markdown
Contributor

@j0ntz j0ntz commented Apr 30, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

Asana task

Replaces #5976 (closed in favor of this branch).

Context

Infinite updated their headless transfer API to fix the deposit-matching problem the original PR set out to solve. Each ONRAMP create now provisions a per-customer Virtual Bank Account (VBA), so funds match a transfer record by destination instead of by memo. The new shape is:

  • POST /v1/headless/transfers with "type": "ONRAMP" returns id: null plus a stable depositAddressId (e.g. vba_…); the tfr_… is created later, when funds arrive.
  • Source is now { currency: "USD", network: "ACH" }. The user's own bank account is no longer part of the request — they push funds to the VBA we get back.
  • New GET /v1/headless/transfers/deposit-address/:depositAddressId re-fetches the same response shape for an existing VBA.
  • OFFRAMP semantics are unchanged.

Changes

  • Update infiniteApiTypes for the new response shape: nullable id, optional depositAddressId, optional bankBeneficiaryName on sourceDepositInstructions. Rebuild InfiniteOnrampTransferRequest to match the new { source, destination } payload and add getDepositAddress to the InfiniteApi surface.
  • Switch the Infinite buy quote to ACH push payment (paymentType: 'ach') and skip bankAccountWorkflow on ONRAMP since Edge no longer collects the user's bank.
  • Always reset the confirmation slider once onConfirm settles. Throw an explicit error from the ONRAMP create flow when deposit instructions are missing so the slider error path triggers instead of the slider hanging.
  • Pop the Infinite ramp stack to the top after the user dismisses the bank routing details scene (replaces the old goBack()-by-one).
  • Make the bank routing instructions and warning text wrap and stop them from shrinking under large system fonts.
  • Surface the bankBeneficiaryName from the create response as a copy-able row above the bank name on the routing details scene.

Notes

The bank-info-fields commit from the prior PR (287928f079, address lines / deposit-message / split instruction strings) is intentionally not pulled — those fields aren't in the spec Infinite shared and need product confirmation before adding.

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana task


Note

Medium Risk
Updates Infinite buy/onramp transfer creation and response parsing to a new ACH push-payment/VBA API shape, which can affect funds routing and order tracking. Also adjusts navigation and confirmation UI behavior, so regression risk is mainly in the ramp flow UX and transfer initiation.

Overview
Updates the Infinite ramp buy/onramp flow to use the new headless transfers API shape: ONRAMP createTransfer now sends { source: {currency, network:'ACH'} } (no user bank account) and expects id: null plus depositAddressId with deposit instructions, with InfiniteTransferResponse updated accordingly (nullable id, optional depositAddressId, and bankBeneficiaryName). Adds getDepositAddress support to re-fetch VBA deposit instructions.

Improves ramp UX resilience: the confirmation slider now always resets after onConfirm settles, ONRAMP throws an explicit error if deposit instructions are missing, bank routing details can display/copy a beneficiary name and better wrap text under large fonts, and dismissing routing details now popToTop() instead of stepping back through confirmation. Switches Infinite buy quotes/payment type from wire to ach, and updates analytics to use transfer.id or fallback to depositAddressId as the order id.

Reviewed by Cursor Bugbot for commit fb0aed0. Bugbot is set up for automated code reviews on this repo. Configure here.

@j0ntz j0ntz mentioned this pull request Apr 30, 2026
6 tasks
j0ntz added 6 commits May 5, 2026 10:49
The new headless API returns id: null on ONRAMP create and instead
returns a depositAddressId (vba_…) referencing the virtual bank account
Infinite provisions for the customer. The create payload also drops the
user's bank account from the source — Infinite is the deposit recipient,
not the user. Adopt the new request/response shapes:

- Tighten createTransfer to a discriminated InfiniteTransferRequest
  union; ONRAMP carries source: { currency, network } and no accountId.
- Allow id: null and surface depositAddressId + bankBeneficiaryName in
  asInfiniteTransferResponse.
- Add getDepositAddress(depositAddressId) for refetching deposit
  instructions (no callers yet).
- Update dummies to match the new shape.
- Fall back to depositAddressId for the Buy/Sell_Success analytics
  orderId since ONRAMP no longer produces a tfr_… at create time.
Switch the buy quote rail from 'wire' to 'ach' and skip the user-bank
account workflow on ONRAMP. The new headless transfer API provisions a
virtual bank account on create, so the user pushes funds via ACH to a
fixed route — Edge no longer needs the user's bank details on the buy
flow.
Move reset() from the catch block into finally so the SafeSlider returns
to its idle state on both success and error paths. Previously a
successful transfer with no deposit instructions left the slider
spinning indefinitely.

Also throw an explicit error from the Infinite ONRAMP confirmation flow
when the create-transfer response lacks bank deposit instructions, so
the slider error path triggers instead of silently swallowing the
condition.
Add popToTop() to the Infinite ramp NavigationFlow utility and use it
when the user dismisses the bank routing details scene. Previously
goBack() walked the user back through the confirmation scene before the
parent finally took over, leaving stale flow state visible. popToTop()
clears the entire ramp stack in one step.
Replace the Paragraph wrapping the instruction text with an EdgeText
that explicitly allows unlimited lines and add a small left margin so
the icon and text don't crowd each other. Apply the same numberOfLines
override and disableFontScaling to the warning text so it stays
readable when users have large system fonts.
Add an optional beneficiaryName field to BankInfo and render it as a
copy-able row above the bank name when the Infinite create-transfer
response includes a bankBeneficiaryName. Users frequently need that
exact string on their bank's transfer form, so surfacing it inline
removes a manual support touchpoint.
@j0ntz j0ntz force-pushed the jon/infinite-buy-again branch from 39bd261 to fb0aed0 Compare May 5, 2026 17:50
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fb0aed0. Configure here.

currency: cleanFiatCode.toLowerCase(),
network: 'wire', // Default to wire for bank transfers
accountId: bankAccountId
network: 'ACH'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Currency codes are lowercased

High Severity

The new ONRAMP transfer payload sends currency values through toLowerCase(), but the new Infinite API shape expects currency codes like USD. If the API validates codes case-sensitively, every buy transfer creation fails before routing details appear.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb0aed0. Configure here.

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