feat(services): replace hardcoded prices with CoinGecko API#487
Open
menawar wants to merge 1 commit into
Open
Conversation
Adds priceService.ts which fetches real token USD prices from the CoinGecko free-tier simple/price endpoint. Implements a 5-minute in-memory cache (with optional AsyncStorage persistence) to reduce API calls and provide stale-data fallback when the API is unavailable. Adds useTokenPrices hook with 60-second periodic refresh, pull-to- refresh support, and graceful error handling for network failures, timeouts, and rate limiting. Removes all hardcoded mock price values from components and screens. Closes Smartdevs17#70
|
@menawar 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds CoinGecko-backed token price fetching with caching, 60s periodic refresh, pull-to-refresh, and stale-data fallback.
Key changes:
Validation:
src/store/subscriptionStore.ts(274,12): error TS1005: ';' expected.
src/store/subscriptionStore.ts(276,22): error TS1005: ';' expected.
src/store/subscriptionStore.ts(318,25): error TS1005: ';' expected.
src/store/subscriptionStore.ts(347,25): error TS1005: ';' expected.
src/store/subscriptionStore.ts(370,31): error TS1005: ';' expected.
src/store/subscriptionStore.ts(398,27): error TS1005: ';' expected.
src/store/subscriptionStore.ts(480,25): error TS1005: ';' expected.
src/store/subscriptionStore.ts(499,21): error TS1005: ';' expected.
src/store/subscriptionStore.ts(573,5): error TS1109: Expression expected.
src/store/subscriptionStore.ts(573,6): error TS1128: Declaration or statement expected.
src/store/subscriptionStore.ts(573,7): error TS1128: Declaration or statement expected.
src/store/subscriptionStore.ts(576,14): error TS1005: ';' expected.
src/store/subscriptionStore.ts(577,14): error TS1005: ';' expected.
src/store/subscriptionStore.ts(578,17): error TS1005: ';' expected.
src/store/subscriptionStore.ts(579,14): error TS1005: ';' expected.
src/store/subscriptionStore.ts(580,12): error TS1005: ';' expected.
src/store/subscriptionStore.ts(584,25): error TS1005: ';' expected.
src/store/subscriptionStore.ts(614,5): error TS1109: Expression expected.
src/store/subscriptionStore.ts(615,3): error TS1128: Declaration or statement expected.
src/store/subscriptionStore.ts(616,1): error TS1128: Declaration or statement expected. is currently blocked by an unrelated pre-existing parse error in
Closes #70