Skip to content

Implement Multi-Cryptocurrency Market Data Route#11

Open
HermanKoii wants to merge 4 commits into
Merango:61533bb5-fa6e-4c8a-b1fa-ab748d46e7c1from
HermanKoii:feature-multi-coin-market-data-route-1749232477
Open

Implement Multi-Cryptocurrency Market Data Route#11
HermanKoii wants to merge 4 commits into
Merango:61533bb5-fa6e-4c8a-b1fa-ab748d46e7c1from
HermanKoii:feature-multi-coin-market-data-route-1749232477

Conversation

@HermanKoii
Copy link
Copy Markdown

@HermanKoii HermanKoii commented Jun 6, 2025

Implement Multi-Cryptocurrency Market Data Route

Description

Task

Create a new route for fetching market data for multiple cryptocurrencies

Acceptance Criteria

  • Route successfully retrieves market data for multiple cryptocurrency IDs
  • Handles missing ID parameter with 400 error
  • Returns 404 for invalid cryptocurrency IDs
  • Provides comprehensive market data for valid IDs
  • Supports comma-separated list of cryptocurrency IDs

Summary of Work

This pull request documents the implementation of a comprehensive market data route for fetching multiple cryptocurrency market details in the CoinGecko mock API.

Changes Made

  • Implemented GET /market-data route in src/routes/marketData.js
  • Added robust input validation for cryptocurrency IDs
  • Created error handling for various scenarios
  • Supported fetching market data for multiple coins

Implementation Details

  • Route accepts a comma-separated list of cryptocurrency IDs via query parameter
  • Uses cryptoPrices data source for market information
  • Validates input before processing
  • Handles scenarios:
    1. No IDs provided (400 error)
    2. Invalid coin IDs (404 error)
    3. Successful retrieval of market data

Validation Checks

  • Input validation ensures only valid cryptocurrency IDs are processed
  • Returns appropriate error responses for invalid inputs
  • Supports partial failure scenarios with clear error messages

Testing Coverage

  • Unit tests cover multiple scenarios:
    1. Successful retrieval of market data
    2. Error handling for missing IDs
    3. Handling of invalid cryptocurrency IDs
    4. Mixed valid and invalid ID scenarios

Performance Considerations

  • Uses efficient array and object manipulation
  • Minimal computational overhead
  • Quick response times for market data retrieval

Notes

  • Uses mock data from crypto-prices.json
  • Easily extensible for future enhancements

Changes Made

  • Implemented GET /market-data route in src/routes/marketData.js
  • Added input validation for cryptocurrency IDs
  • Created comprehensive error handling
  • Supported fetching market data for multiple coins
  • Ensured consistent response formatting

Tests

  • Validate successful market data retrieval for multiple coins
  • Test error handling for missing cryptocurrency IDs
  • Verify response for invalid cryptocurrency IDs
  • Check handling of mixed valid and invalid ID scenarios

Signatures

Staking Key

3JF13GJW2UeYuTTRJQBdBD9bHP6Zj1QLMyXBMoAP2r5Y: Z7WzoucZEg9YZPn5cU9BwsaeyzRqnT5eJxBoUVMWoaVQ2R9oT2KFh4wUQ6K54veVpzi3GoMSVF13MpUrXupHbnQuGtaVYagqmT4FHLw1aogwHYqCnSx7fM6BgtRVuymYEXrc7H1zXsq49s6awCu58iw3syEC9uWvG2WaQJxjxjDU9peLFRTZTuJhXHLe7HtFdy8HfzPYAybR2dQTpzWDteRuVft1ij3CDs46Lf6ygoNhoVcEqCpqGbashdQM5A4fVF6avnCg78huyNiNDzEKVi7w8LYpW5ChuoYTnhbjAk3bvhh3bEKqJEVzYZmtoGQKudkWtCbHK49EptXi96xfwdXVPzwBfCWdVav5CfwZeQfu7MqjGfjiMGiKwS8TXG7xNHXRh8ZCmHrPJ19uhshFF157GkSRQYDVyn

Public Key

H2j8Cz7zKCeuDTs73vtjDtBmtytQX1JyaQqvYwwQWE6p: 5SsG5XHcyTxuDyk3oumWuk4ZPgQrdp4pgqg2mGtAJz7WmVJD9EL8MQCK4FW7AZhNmbuePQdY7ikaAAnqqRhVDKFivZqSRYoYRHgAB6t1g5MNt7B25JVCJa84MwGb6M2Hknz1KKbTXuv7KFvMfMCnM7YVoKX2uiwRBTBm4hQQX5ZKR61C4iUS3MNQGbhumKxaLFFxi2DHg7n5jrAqXs19ouyJsgm6etoaA9Uh3oDF51wGGMHoRPfWSwWHcVa9FPTyJixVdMo9Bh54ouMHonSexVfHMm9WrzAQJtJNThP4egoEeiDmKiq7np6dmu1B3tdNqWQDtUWCCuGmoDHjbN3VJHLUwXyZvgoTtnV9fzG4NNqrvmi28Yn3Jahz8vuZm1sn3hSNhKwPBRnEPMcL2yn7wwodMQuSg2qtYU

@HermanKoii HermanKoii changed the title [WIP] Implement Multi-Coin Market Data Retrieval Endpoint Implement Multi-Cryptocurrency Market Data Route Jun 6, 2025
@HermanKoii HermanKoii marked this pull request as ready for review June 6, 2025 17:57
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