Skip to content

Implement Coins List Endpoint with Pagination and Sorting#2

Open
HermanKoii wants to merge 7 commits into
Merango:81af2262-181a-4f3a-ba8e-5d3e94999901from
HermanKoii:feature-coins-list-route-1749229177
Open

Implement Coins List Endpoint with Pagination and Sorting#2
HermanKoii wants to merge 7 commits into
Merango:81af2262-181a-4f3a-ba8e-5d3e94999901from
HermanKoii:feature-coins-list-route-1749229177

Conversation

@HermanKoii
Copy link
Copy Markdown

@HermanKoii HermanKoii commented Jun 6, 2025

Implement Coins List Endpoint with Pagination and Sorting

Description

Task

Create a new route for coins list endpoint that returns a list of available cryptocurrencies from the existing crypto-prices.json data

Acceptance Criteria

  • Endpoint returns list of cryptocurrencies
  • Supports market cap-based sorting
  • Implements pagination
  • Handles edge cases and invalid inputs
  • Provides clear error responses

Summary of Work

This pull request adds a comprehensive coins list endpoint that retrieves cryptocurrency data with advanced filtering and pagination capabilities.

Changes Made:

  • Implemented getCoinsList function in src/routes/coins.ts
  • Added support for pagination and sorting in the coins list endpoint
  • Integrated with existing crypto-prices.json data source
  • Updated route configuration in src/routes/index.ts

Implementation Details:

  • Endpoint: /coins/markets
  • Supports query parameters:
    • order: Sorting order (default: 'market_cap_desc')
    • per_page: Number of results per page (min: 1, max: 250, default: 100)
    • page: Page number for pagination (default: 1)
  • Implemented robust error handling
  • Sorts coins by market capitalization
  • Provides paginated results

Potential Improvements:

  • Add more advanced filtering options
  • Implement caching for improved performance
  • Add support for additional sorting criteria

Changes Made

  • Added getCoinsList function in src/routes/coins.ts
  • Implemented pagination and sorting logic
  • Updated route configuration in src/routes/index.ts
  • Added error handling for coins list endpoint

Tests

  • Verify coins list endpoint returns correct number of results
  • Test pagination functionality with different page and per_page values
  • Validate sorting by market cap in ascending and descending order
  • Check error handling for invalid input parameters

Signatures

Staking Key

3JF13GJW2UeYuTTRJQBdBD9bHP6Zj1QLMyXBMoAP2r5Y: HgySJASzxerYsEHKV3RQduDUfXLXRNxtB67xfTbBeEkL8ty8USRaivm2ECDG2qZqGjSbQtRXVAmLadnWcBGwU6pmdTov1DHDaQrT6m8UyCuyx2YXCvXvYN9pU11WvB4659zFZJVgjHLh3EKsbY5SFazQCE9xE5AsnZZPVsUYq3VBpDUUrj4KBSsNDLEC7Kt9C6TTq2P6Ks6cGruLYdyiy7i6b3pDEva97PhRi3BS5c65uCg5CNB4cuvFbcCNQcSbXdQ9PeKamFFCz3yVTsfLGZgEDveLA2weFuWhqEXpsJZzXaWa3Ga5MGFvw3R8rNwN7VQjT9w1E4i8Smd5gkuNvuDpCUxRhpxxafE6fdZW3XfTdMGKjLZm5H39t5q612zKPCkoUG6jsCBqx7G37jN1ce37H5KMtqHUQU

Public Key

H2j8Cz7zKCeuDTs73vtjDtBmtytQX1JyaQqvYwwQWE6p: 37DYv55LKtp9gtuJCaY6tqci6ZYzoFKbLrfTRzRDypDEjhwzuHpXY54g6xjRGYZ6A2bw5ZSHLxuzac34XeR8afLZAu6Qktcnbg3i1ri1wcqArrn7RVioawuJsygkhMK8VMJ8R8X5WdKCS64odWGYSb5BaAKEKCCt9X59GmpMAeKj1NYXCmUhBw3jz5x5AwXWcwCLKXujPU9W9k6ET5KFFzWfJMTffxjJgrWkhHtmuS34ybnEJNje8SHZG749zCvSywaoY6zfiuN7jxCstSD83HMeUcGhWyvCGBT1cE1PpsHK4MrpX4XLDZLcSwZapAGiCJhYfys4x9WSzTvvVix5JqUdQAn2HNjERHunpjZvUcdpXm8dvfiX2LL22D3K1GbU53MmmG5KXFZU6Aj7GzKPMbo398fry2Uycg

@HermanKoii HermanKoii changed the title [WIP] Implement CoinGecko Mock API: Coins List Endpoint Implement Coins List Endpoint with Pagination and Sorting Jun 6, 2025
@HermanKoii HermanKoii marked this pull request as ready for review June 6, 2025 17:02
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