Skip to content

feat(ramps-controller): add unified getOrder to RampsService#7934

Draft
amitabh94 wants to merge 1 commit intomainfrom
feat/ramps-unified-getorder
Draft

feat(ramps-controller): add unified getOrder to RampsService#7934
amitabh94 wants to merge 1 commit intomainfrom
feat/ramps-unified-getorder

Conversation

@amitabh94
Copy link
Contributor

Explanation

Add a getOrder method to RampsService that calls the V2 unified order endpoint (GET /v2/providers/:providerCode/orders/:orderCode). This endpoint returns a normalized RampsOrder (DepositOrder shape) for all provider types, enabling mobile to use a single order processor instead of separate aggregator and deposit processors.

This is the core-side prerequisite for unifying order processing in metamask-mobile and eventually removing both @consensys/on-ramp-sdk and @consensys/native-ramps-sdk for order polling.

Changes

  • RampsService.ts: Add RampsOrder type and related types (RampsOrderStatus, RampsOrderNetwork, RampsOrderCryptoCurrency, RampsOrderPaymentMethod). Add getOrder(providerCode, orderCode, wallet) method.
  • RampsService-method-action-types.ts: Add RampsServiceGetOrderAction type.
  • RampsController.ts: Add getOrder wrapper method. Wire RampsService:getOrder into allowed actions.
  • index.ts: Export all new types.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared a draft changelog entry if needed

Made with Cursor

Add a getOrder method to RampsService that calls the V2 unified order
endpoint (GET /v2/providers/:providerCode/orders/:orderCode). This
endpoint returns a normalized RampsOrder (DepositOrder shape) for all
provider types, enabling mobile to use a single order processor instead
of separate aggregator and deposit processors.

Changes:
- Add RampsOrder type and related types (RampsOrderStatus, etc.)
- Add getOrder method to RampsService
- Add RampsServiceGetOrderAction type
- Wire getOrder into RampsController as a passthrough method
- Export new types from index.ts

Co-authored-by: Cursor <cursoragent@cursor.com>
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