Skip to content

feat: implement backend integration for onramp and offramp forms#209

Open
greatKhalifa-code wants to merge 2 commits into
kellymusk:mainfrom
greatKhalifa-code:feat/backend-integration
Open

feat: implement backend integration for onramp and offramp forms#209
greatKhalifa-code wants to merge 2 commits into
kellymusk:mainfrom
greatKhalifa-code:feat/backend-integration

Conversation

@greatKhalifa-code
Copy link
Copy Markdown
Contributor

This PR introduces the necessary backend infrastructure and frontend modifications to support real-time order creation and tracking. It replaces static mock data with live API calls for exchange rates and persists transaction states through a newly
implemented API layer.

Key Changes:

  • API Endpoints:
    • POST /api/onramp/create-order: Handles onramp order initialization and data persistence.
    • POST /api/offramp/create-order: Manages offramp order creation.
    • GET /api/onramp/order/[orderId]: Provides a backend source of truth for order tracking.
    • PATCH /api/onramp/order/[orderId]/status: Enables real-time status updates (e.g., payment received, minting, completed) to be synchronized with the backend.
  • Live Rate Integration:
    • Updated useOfframpRate to fetch real-time prices for USDC and XLM via the /api/exchange-rate endpoint, ensuring users see accurate conversion values based on current market data.
  • User Experience:
    • Implemented isSubmitting states across OnrampCalculator and OfframpCalculator to handle asynchronous API delays gracefully.
    • Enhanced the "Continue" buttons with loading spinners and contextual labels (e.g., "Creating Order...") to prevent duplicate submissions and improve feedback.
  • Data Consistency:
    • Modified useOrderTracking and useOrderStatusUpdates hooks to bridge the gap between local state (localStorage) and the backend API, providing a more robust and scalable tracking mechanism.

Verification:

  • Tested end-to-end onramp flow: Form Input → Backend Order Creation → Status Polling.
  • Tested offramp rate refreshing against live API data.

closes #126

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@ComputerOracle is attempting to deploy a commit to the kelly musk's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@greatKhalifa-code Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

7. Backend API integration for ramps

2 participants