Skip to content

Conversation

@bobo-k2
Copy link
Contributor

@bobo-k2 bobo-k2 commented May 16, 2025

Extended token stats endpoint to provide token info with prices in USD and KRW

Copy link

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 PR extends the token stats endpoint to include token prices in multiple currencies (USD and KRW), updating the interface and implementation to support handling an array of currencies.

  • Updated the IStatsService interface to accept a "currencies" parameter and return an array of ExtendedTokenStats.
  • Modified the implementation in StatsService.ts to perform price lookups for each specified currency.
  • Adjusted TokenStatsController.ts to call the updated service method with the currencies ['usd', 'krw'].

Reviewed Changes

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

File Description
src/services/StatsService.ts Modified getTokenStatsExtended to accept currencies and return an array of ExtendedTokenStats, mapping over each currency to retrieve prices.
src/controllers/TokenStatsController.ts Updated the endpoint to pass ['usd', 'krw'] ensuring token prices in both USD and KRW are fetched.

* @returns Token statistics including total supply and circulating supply.
*/
public async getTokenStatsExtended(network: NetworkType): Promise<ExtendedTokenStats> {
public async getTokenStatsExtended(network: NetworkType, currencies: string[]): Promise<ExtendedTokenStats[]> {
Copy link

Copilot AI May 16, 2025

Choose a reason for hiding this comment

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

Update the documentation comment for getTokenStatsExtended to include details about the new 'currencies' parameter and the updated return type.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented May 16, 2025

Visit the preview URL for this PR (updated for commit b7602bd):

https://astar-token-api--pr170-feat-krw-price-y5vusjdv.web.app

(expires Fri, 23 May 2025 07:33:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f99fa4f4f8f3bb450e6e842f7e1c7783d6d896a3

@bobo-k2 bobo-k2 requested a review from Copilot May 16, 2025 07:33
Copy link

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 extends the token stats endpoint to provide token information with prices in multiple currencies, including KRW.

  • Modified the IStatsService interface and implementation to accept an array of currency codes and return a corresponding array of stats.
  • Updated the TokenStatsController to pass both 'usd' and 'krw' when fetching token stats.

Reviewed Changes

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

File Description
src/services/StatsService.ts Updated getTokenStatsExtended to accept multiple currencies and return an array of ExtendedTokenStats with corresponding prices and market caps.
src/controllers/TokenStatsController.ts Revised the API call to supply both 'usd' and 'krw' as currency parameters.

* not in circulation from total token supply.
* @param network NetworkType (astar or shiden) to calculate token supply for.
* @returns Token statistics including total supply and circulating supply.
* @param currencies
Copy link

Copilot AI May 16, 2025

Choose a reason for hiding this comment

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

Enhance the JSDoc comment for the 'currencies' parameter by specifying the expected currency codes and explaining that the function returns an array of statistics, one per currency.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@gtg7784 gtg7784 left a comment

Choose a reason for hiding this comment

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

LGTM

@bobo-k2 bobo-k2 merged commit 198a35c into prod May 19, 2025
8 checks passed
@bobo-k2 bobo-k2 deleted the feat/krw-price branch May 19, 2025 06:50
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.

3 participants