feat: sync V2 ramps orders from User Storage#44367
Open
georgeweiler wants to merge 4 commits into
Open
Conversation
Wire RampsController order syncing so orders created on mobile can be pulled into the extension on unlock, without adding ramps UI. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Contributor
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (8 files, +404 -5)
|
Contributor
Builds ready [1f54a22]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 0 warn · 🔴 0 fail)
Bundle sizes
|
This was referenced Jul 11, 2026
Match mobile by exposing a Buy & sell orders sub-toggle, and include ramps syncing in the reverse-cascade that disables the main Backup & Sync switch when every sub-feature is off. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Builds ready [5b063e4]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 0 warn · 🔴 0 fail)
Bundle sizes
|
Required after merging main so RampsController can read moneyHeadlessAllProviders for quote widening alongside order sync. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Builds ready [bd074e8]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 0 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RampsController.syncOrdersWithUserStorage()can run.syncRampsOrdersWithUserStorageon the ramps background API.useRampsOrderSyncinginMetamaskIdentityProvider(same gates as account/contact sync).selectIsRampsSyncingEnableddefaults totruewhen absent from persisted state.BACKUPANDSYNC_FEATURES.rampsSyncing), matching mobile.RampsController.orders/ existing hooks and selectors (no dedicated orders history UI in this PR).Depends on
Works with
QA / debugging (separate branch)
Orders home-tab demo for manual verification lives on
feat/ramps-orders-qa-tab(not included here). Use that branch to inspect synced orders and trigger manual sync during cross-client testing.Cross-client flow
useRampsOrderSyncingruns full sync.useRampsOrders/selectRampsOrders.Local testing (until core packages are published)
Copy built packages from core
feat/ramps-order-syncinginto extensionnode_modules:Then:
RampsController.orders(or usefeat/ramps-orders-qa-tabOrders tab)Test plan
useRampsOrderSyncing, identity provider, selectors@metamask/ramps-controller+@metamask/profile-sync-controlleronce core Allow running CircleCI locally #9474 is publishedNote
Medium Risk
Syncs ramps order data to User Storage behind the same auth and preference gates as other backup features, but depends on unpublished core work and bidirectional merge behavior in
RampsController.Overview
Adds cross-device sync for V2 ramps (buy & sell) orders through Backup and Sync User Storage, aligned with account and contact syncing.
The ramps messenger now delegates User Storage and authentication actions so
RampsController.syncOrdersWithUserStorage()can run in the background;syncRampsOrdersWithUserStorageis exposed on the ramps API and UI store actions. On unlock,useRampsOrderSyncinginMetamaskIdentityProvidertriggers a full sync when the user is signed in, Backup and Sync is on, external services are enabled, and onboarding is complete—same gating pattern as the other sync hooks.Users get a new Backup and Sync sub-toggle “Buy & sell orders” (
BACKUPANDSYNC_FEATURES.rampsSyncing); turning off all sub-features (including ramps) still cascades to disable the main Backup and Sync toggle.selectIsRampsSyncingEnableddefaults totruewhen the flag is missing from persisted state. Synced orders populate existingRampsController.orders/ hooks; this PR does not add a dedicated orders history UI.Reviewed by Cursor Bugbot for commit bd074e8. Bugbot is set up for automated code reviews on this repo. Configure here.