feat(ramp): add unified order processor behind V2 feature flag#26084
feat(ramp): add unified order processor behind V2 feature flag#26084
Conversation
Add a unified order processor that calls RampsController.getOrder (V2 API endpoint) instead of separate SDK calls for aggregator and deposit orders. Feature-flagged behind the unified buy V2 flag. When V2 is enabled: - Both AGGREGATOR and DEPOSIT orders use processUnifiedOrder - Single API call to GET /v2/providers/:code/orders/:id - Includes exponential backoff and pollingSecondsMinimum support - Provider code extracted from order ID or order data When V2 is disabled: - Existing processAggregatorOrder (on-ramp-sdk) unchanged - Existing processDepositOrder (native-ramps-sdk) unchanged Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes are:
SmokeRamps is the appropriate tag as it covers "fiat on-ramp (buy crypto) and off-ramp (sell crypto) features" including order processing flows. The existing E2E tests in tests/smoke/ramps/ (onramp-unified-buy.spec.ts, offramp-token-amount.spec.ts) will validate these changes. No dependent tags are needed as per the SmokeRamps description - it only mentions integration with SmokeWalletPlatform for wallet actions entry point, but these changes don't affect the entry point, only the order processing backend. Performance Test Selection: |
|


Summary
Add a unified order processor that calls
RampsController.getOrder(V2 API endpoint) instead of separate SDK calls for aggregator and deposit order polling. Feature-flagged behind the unified buy V2 flag.Depends on: Core PR to add
getOrdertoRampsService(branch:feat/ramps-unified-getorderin MetaMask/core)Changes
New file:
unifiedOrderProcessor.ts-- Single processor that callsRampsController.getOrderfor all provider typespollingSecondsMinimumsupport (ported from aggregator processor)/providers/transak-native/orders/abc) and aggregator-style order IDsRampsOrderresponse toFiatOrderfor ReduxUpdated:
orderProcessor/index.ts-- Router checksoptions.useUnifiedProcessorbefore delegating to SDK-specific processorsUpdated:
index.tsx(FiatOrders) -- PassesuseUnifiedProcessor: isUnifiedV2Enabledinto processor options for both pending and force-update polling loopsFeature Flag Gating
When V2 is enabled (
useRampsUnifiedV2Enabled):AGGREGATORandDEPOSITorders useprocessUnifiedOrderGET /v2/providers/:code/orders/:idWhen V2 is disabled:
processAggregatorOrder(@consensys/on-ramp-sdk) unchangedprocessDepositOrder(@consensys/native-ramps-sdk) unchangedTest plan
/providers/transak-native/orders/...)Made with Cursor