-
Notifications
You must be signed in to change notification settings - Fork 9
feat(cex-market-data): add CoinPaprika API provider as a fallback option #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d592d3d
feat(cex-market-data): add coinpaprika API fallback support
takenagain fc29dc1
feat(cex-market-data): integrate coinpaprika into sparklines & strate…
takenagain eb207ed
refactor(cex-market-data): use index_generator for barrel files
takenagain ae27520
test(cex-market-data): refactor out fixtures and helpers
takenagain 03ef5b4
refactor(cex-market-data): add doc comments, update tests, explicit utc
takenagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # Used to generate Dart index file. Can be ran with `dart run index_generator` | ||
| # from this package's root directory. | ||
| # See https://pub.dev/packages/index_generator for more information. | ||
| index_generator: | ||
| page_width: 80 | ||
| exclude: | ||
| - "**.g.dart" | ||
| - "**.freezed.dart" | ||
|
|
||
| libraries: | ||
| # Binance market data provider | ||
| - directory_path: lib/src/binance | ||
| file_name: _binance_index | ||
| name: _binance | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to Binance market data provider functionality. | ||
| disclaimer: false | ||
|
|
||
| # CoinGecko market data provider | ||
| - directory_path: lib/src/coingecko | ||
| file_name: _coingecko_index | ||
| name: _coingecko | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to CoinGecko market data provider functionality. | ||
| disclaimer: false | ||
|
|
||
| # CoinPaprika market data provider | ||
| - directory_path: lib/src/coinpaprika | ||
| file_name: _coinpaprika_index | ||
| name: _coinpaprika | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| - "models/models.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to CoinPaprika market data provider functionality. | ||
| disclaimer: false | ||
|
|
||
| # Komodo-specific functionality | ||
| - directory_path: lib/src/komodo | ||
| file_name: _komodo_index | ||
| name: _komodo | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| - "komodo.dart" | ||
| - "prices/prices.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to Komodo-specific market data functionality. | ||
| disclaimer: false | ||
|
|
||
| # Common models and types | ||
| - directory_path: lib/src/models | ||
| file_name: _models_index | ||
| name: _models | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| - "models.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to common models and types for market data. | ||
| disclaimer: false | ||
|
|
||
| # Common utilities | ||
| - directory_path: lib/src/common | ||
| file_name: _common_index | ||
| name: _common | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to common utilities for market data providers. | ||
| disclaimer: false | ||
|
|
||
| # Bootstrap functionality | ||
| - directory_path: lib/src/bootstrap | ||
| file_name: _bootstrap_index | ||
| name: _bootstrap | ||
| exclude: | ||
| - "{_,**/_}*.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to market data bootstrap functionality. | ||
| disclaimer: false | ||
|
|
||
| # Main src-level exports (individual files not in subdirectories) | ||
| - directory_path: lib/src/ | ||
| file_name: _core_index | ||
| name: _core | ||
| include: | ||
| - "*.dart" | ||
| exclude: | ||
| - "**/*_index.dart" | ||
| - "{_,**/_}*.dart" | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private classes related to core market data functionality. | ||
| disclaimer: false | ||
|
|
||
| # Combined internal exports | ||
| - directory_path: lib/src/ | ||
| file_name: _internal_exports | ||
| name: _internal_exports | ||
| include: | ||
| - "**/*_index.dart" | ||
| exclude: [] | ||
| comments: | | ||
| (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
| docs: | | ||
| Internal/private exports combining all market data provider functionality. | ||
| disclaimer: false | ||
39 changes: 33 additions & 6 deletions
39
packages/komodo_cex_market_data/lib/komodo_cex_market_data.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,35 @@ | ||
| /// Komodo CEX market data library for fetching and managing cryptocurrency market data. | ||
| /// Komodo CEX market data library for fetching and managing cryptocurrency | ||
| /// market data. | ||
| /// | ||
| /// Provides support for multiple market data providers with fallback capabilities, | ||
| /// repository selection strategies, and robust error handling. | ||
| library; | ||
| /// This library provides comprehensive support for multiple cryptocurrency | ||
| /// market data providers | ||
| /// including Binance, CoinGecko, and CoinPaprika. It features: | ||
| /// | ||
| /// * Multiple market data providers with fallback capabilities | ||
| /// * Repository selection strategies and priority management | ||
| /// * Robust error handling and retry mechanisms | ||
| /// * OHLC data, price information, and market statistics | ||
| /// * Sparkline data for charts and visualizations | ||
| /// * Bootstrap functionality for initial data setup | ||
| /// * Hive-based caching and persistence | ||
| /// | ||
| /// ## Usage | ||
| /// | ||
| /// The library is designed to work with the broader Komodo DeFi SDK ecosystem | ||
| /// and provides a unified interface for accessing market data across different | ||
| /// centralized exchanges and data providers. | ||
| /// | ||
| /// ## Providers | ||
| /// | ||
| /// * **Binance**: High-priority provider for real-time market data | ||
| /// * **CoinGecko**: Primary fallback provider with comprehensive coverage | ||
| /// * **CoinPaprika**: Secondary fallback provider | ||
| /// * **Komodo**: Internal price data and calculations | ||
| /// | ||
| /// The library automatically handles provider selection, fallbacks, and | ||
| /// error recovery to ensure reliable market data access. | ||
| library komodo_cex_market_data; | ||
|
|
||
| export 'src/komodo_cex_market_data_base.dart'; | ||
| export 'src/repository_fallback_mixin.dart'; | ||
| // Export all generated indices for comprehensive API coverage | ||
| export 'src/_core_index.dart'; | ||
| export 'src/_internal_exports.dart'; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
|
|
||
| /// Internal/private classes related to core market data functionality. | ||
| library _core; | ||
|
|
||
| export 'cex_repository.dart'; | ||
| export 'hive_adapters.dart'; | ||
| export 'id_resolution_strategy.dart'; | ||
| export 'komodo_cex_market_data_base.dart'; | ||
| export 'repository_fallback_mixin.dart'; | ||
| export 'repository_priority_manager.dart'; | ||
| export 'repository_selection_strategy.dart'; | ||
| export 'sparkline_repository.dart'; |
12 changes: 12 additions & 0 deletions
12
packages/komodo_cex_market_data/lib/src/_internal_exports.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
|
|
||
| /// Internal/private exports combining all market data provider functionality. | ||
| library _internal_exports; | ||
|
|
||
| export 'binance/_binance_index.dart'; | ||
| export 'bootstrap/_bootstrap_index.dart'; | ||
| export 'coingecko/_coingecko_index.dart'; | ||
| export 'coinpaprika/_coinpaprika_index.dart'; | ||
| export 'common/_common_index.dart'; | ||
| export 'komodo/_komodo_index.dart'; | ||
| export 'models/_models_index.dart'; |
15 changes: 15 additions & 0 deletions
15
packages/komodo_cex_market_data/lib/src/binance/_binance_index.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
|
|
||
| /// Internal/private classes related to Binance market data provider functionality. | ||
| library _binance; | ||
|
|
||
| export 'data/binance_provider.dart'; | ||
| export 'data/binance_provider_interface.dart'; | ||
| export 'data/binance_repository.dart'; | ||
| export 'models/binance_24hr_ticker.dart'; | ||
| export 'models/binance_exchange_info.dart'; | ||
| export 'models/binance_exchange_info_reduced.dart'; | ||
| export 'models/filter.dart'; | ||
| export 'models/rate_limit.dart'; | ||
| export 'models/symbol.dart'; | ||
| export 'models/symbol_reduced.dart'; |
This file was deleted.
Oops, something went wrong.
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
6 changes: 6 additions & 0 deletions
6
packages/komodo_cex_market_data/lib/src/bootstrap/_bootstrap_index.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file. | ||
|
|
||
| /// Internal/private classes related to market data bootstrap functionality. | ||
| library _bootstrap; | ||
|
|
||
| export 'market_data_bootstrap.dart'; |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.