Skip to content

[READY] Add Ramp History#658

Merged
Sharqiewicz merged 16 commits into
stagingfrom
619-create-a-transaction-history-view
May 21, 2025
Merged

[READY] Add Ramp History#658
Sharqiewicz merged 16 commits into
stagingfrom
619-create-a-transaction-history-view

Conversation

@Sharqiewicz
Copy link
Copy Markdown
Member

@Sharqiewicz Sharqiewicz commented May 20, 2025

The implementation adds a new API endpoint to fetch transaction history for a specific wallet address stored in the ramp_states table.

Backend Changes:

  • Added endpoint types in shared/src/endpoints/ramp.endpoints.ts
  • Implemented getTransactionHistory method in ramp.service.ts to query transactions by walletAddress
  • Added controller method in ramp.controller.ts with proper validation
  • Created a new route at /v1/ramp/history/:walletAddress

Frontend Changes:

  • Added API service method in frontend's ramp.service.ts
  • Created a React Query hook (useTransactionHistory) for efficient data fetching with caching
  • Refactored RampHistory component to use React Query instead of local state
  • Removed mock data from transactionService.ts

@Sharqiewicz Sharqiewicz linked an issue May 20, 2025 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 93761a3
🔍 Latest deploy log https://app.netlify.com/projects/pendulum-pay/deploys/682dc0d2bcf27100081fd30b
😎 Deploy Preview https://deploy-preview-658--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Sharqiewicz Sharqiewicz changed the title [draft] add working tx history UI mocked [READY] Add Ramp History May 20, 2025
@Sharqiewicz Sharqiewicz requested review from a team and Copilot May 20, 2025 14:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds new functionality to support viewing ramp transaction history, including backend API endpoints and frontend UI components.

  • Introduces Ramp History API endpoints and response types in the shared endpoints.
  • Adds a new service method and controller endpoint to fetch transaction history from the backend.
  • Implements frontend components, a Zustand store, and hooks to display and manage the ramp history panel.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
shared/src/endpoints/ramp.endpoints.ts Added new interfaces for GetRampHistoryRequest/Response and cleaned up PresignedTx definition.
frontend/src/stores/rampHistoryStore.ts Introduced a new Zustand store to handle the ramp history panel's state.
frontend/src/services/api/ramp.service.ts Added a new API method to fetch ramp history data.
frontend/src/pages/ramp-form/index.tsx Integrated the ramp history panel and toggle button into the ramp form.
frontend/src/hooks/useRampHistory.ts Created a hook for fetching and processing ramp history data.
frontend/src/components/StatusBadge/index.tsx Added a badge component to display the status of transactions.
frontend/src/components/RampHistory/types.ts Defined transaction types and groupings for ramp history.
frontend/src/components/RampHistory/index.tsx Developed the UI panel for displaying grouped transaction history.
frontend/src/components/RampHistory/helpers.ts Added a helper to group transactions by month.
frontend/src/components/RampHistory/TransactionItem/index.tsx Implemented UI components for individual transaction items.
frontend/src/components/RampHistory/RampHistoryButton/index.tsx Created a button component to toggle the ramp history panel.
frontend/App.css Added styling for custom scrollbar utilities and button styles.
api/src/api/services/ramp/ramp.service.ts Implemented the getTransactionHistory method to retrieve history from the database.
api/src/api/routes/v1/ramp.route.ts Configured a new route to expose the ramp history endpoint.
api/src/api/controllers/ramp.controller.ts Added a controller function to handle ramp history requests.

/**
* Get transaction history for a wallet address
*/
public async getTransactionHistory(walletAddress: string): Promise<RampEndpoints.GetTransactionHistoryResponse> {
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

The method name 'getTransactionHistory' does not match the naming used in endpoints (which is GetRampHistoryResponse). Consider renaming the method to 'getRampHistory' for consistency with the API definitions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Tested locally and it works. I love it, great job @Sharqiewicz 🚀 ready for merge IMO

@Sharqiewicz Sharqiewicz merged commit e91a867 into staging May 21, 2025
5 checks passed
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.

Create a transaction history view

3 participants