├── .github └── workflows │ └── maven.yml ├── .gitignore ├── LICENSE ├── README.md ├── pom.xml └── src ├── main └── java │ └── com │ └── litesoftwares │ └── coingecko │ ├── CoinGeckoApi.java │ ├── CoinGeckoApiClient.java │ ├── CoinGeckoApiError.java │ ├── CoinGeckoApiService.java │ ├── constant │ ├── Currency.java │ └── Order.java │ ├── domain │ ├── AssetPlatforms.java │ ├── Coins │ │ ├── CoinData │ │ │ ├── CodeAdditionsDeletions4Weeks.java │ │ │ ├── CommunityData.java │ │ │ ├── DeveloperData.java │ │ │ ├── IcoData.java │ │ │ ├── Links.java │ │ │ ├── Links_.java │ │ │ ├── PublicInterestStats.java │ │ │ ├── ReposUrl.java │ │ │ ├── Roi.java │ │ │ └── SparklineIn7d.java │ │ ├── CoinFullData.java │ │ ├── CoinHistoryById.java │ │ ├── CoinList.java │ │ ├── CoinMarkets.java │ │ ├── CoinTickerById.java │ │ ├── MarketChart.java │ │ └── MarketData.java │ ├── Events │ │ ├── EventCountries.java │ │ ├── EventCountryData.java │ │ ├── EventData.java │ │ ├── EventTypes.java │ │ └── Events.java │ ├── ExchangeRates │ │ ├── ExchangeRates.java │ │ └── Rate.java │ ├── Exchanges │ │ ├── ExchangeById.java │ │ ├── Exchanges.java │ │ ├── ExchangesList.java │ │ └── ExchangesTickersById.java │ ├── Global │ │ ├── DecentralizedFinanceDefi.java │ │ ├── DecentralizedFinanceDefiData.java │ │ ├── Global.java │ │ └── GlobalData.java │ ├── Ping.java │ ├── Search │ │ ├── Search.java │ │ ├── SearchCategory.java │ │ ├── SearchCoin.java │ │ ├── SearchExchange.java │ │ ├── SearchNft.java │ │ ├── Trending.java │ │ ├── TrendingCoin.java │ │ └── TrendingCoinItem.java │ ├── Shared │ │ ├── Image.java │ │ ├── Market.java │ │ └── Ticker.java │ └── Status │ │ ├── Project.java │ │ ├── StatusUpdates.java │ │ └── Update.java │ ├── exception │ └── CoinGeckoApiException.java │ └── impl │ └── CoinGeckoApiClientImpl.java └── test └── java └── com └── litesoftwares └── coingecko └── examples ├── AssetPlatformsExample.java ├── CoinsExample.java ├── DecentralizedFinanceDefiExample.java ├── EventsExample.java ├── ExchangeRatesExample.java ├── ExchangesExample.java ├── GlobalExample.java ├── PingExample.java ├── SearchExample.java ├── SimpleExample.java ├── StatusUpdatesExample.java └── TrendingExample.java /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Java CI with Maven 10 | 11 | on: 12 | push: 13 | branches: [ "master" ] 14 | pull_request: 15 | branches: [ "master" ] 16 | 17 | jobs: 18 | build: 19 | 20 | runs-on: ubuntu-latest 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Set up JDK 17 25 | uses: actions/setup-java@v3 26 | with: 27 | java-version: '17' 28 | distribution: 'temurin' 29 | cache: maven 30 | - name: Build with Maven 31 | run: mvn -B package --file pom.xml 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 3 | 4 | #idea folder 5 | .idea/ 6 | 7 | # User-specific stuff 8 | .idea/**/workspace.xml 9 | .idea/**/tasks.xml 10 | .idea/**/usage.statistics.xml 11 | .idea/**/dictionaries 12 | .idea/**/shelf 13 | 14 | # Generated files 15 | .idea/**/contentModel.xml 16 | 17 | # Sensitive or high-churn files 18 | .idea/**/dataSources/ 19 | .idea/**/dataSources.ids 20 | .idea/**/dataSources.local.xml 21 | .idea/**/sqlDataSources.xml 22 | .idea/**/dynamic.xml 23 | .idea/**/uiDesigner.xml 24 | .idea/**/dbnavigator.xml 25 | 26 | # Gradle 27 | .idea/**/gradle.xml 28 | .idea/**/libraries 29 | 30 | # Gradle and Maven with auto-import 31 | # When using Gradle or Maven with auto-import, you should exclude module files, 32 | # since they will be recreated, and may cause churn. Uncomment if using 33 | # auto-import. 34 | # .idea/modules.xml 35 | # .idea/*.iml 36 | # .idea/modules 37 | 38 | # CMake 39 | cmake-build-*/ 40 | 41 | # Mongo Explorer plugin 42 | .idea/**/mongoSettings.xml 43 | 44 | # File-based project format 45 | *.iws 46 | 47 | # IntelliJ 48 | out/ 49 | 50 | # Eclipse 51 | .settings 52 | .classpath 53 | .project 54 | 55 | # Maven 56 | target/ 57 | 58 | # mpeltonen/sbt-idea plugin 59 | .idea_modules/ 60 | 61 | # JIRA plugin 62 | atlassian-ide-plugin.xml 63 | 64 | # Cursive Clojure plugin 65 | .idea/replstate.xml 66 | 67 | # Crashlytics plugin (for Android Studio and IntelliJ) 68 | com_crashlytics_export_strings.xml 69 | crashlytics.properties 70 | crashlytics-build.properties 71 | fabric.properties 72 | 73 | # Editor-based Rest Client 74 | .idea/httpRequests 75 | 76 | # Package Files # 77 | *.jar 78 | *.war 79 | *.ear 80 | *.zip 81 | *.tar.gz 82 | *.rar 83 | *.iml 84 | 85 | # Compiled class file 86 | *.class 87 | 88 | # Log file 89 | *.log -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Philip Okugbe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CoinGecko-Java 2 | ![CoinGecko build status](https://github.com/Philipinho/CoinGecko-Java/actions/workflows/maven.yml/badge.svg) 3 | 4 | Java wrapper for the CoinGecko API. 5 |

6 | java-gecko-200 7 |

8 | 9 | ## Usage 10 | This API client covers all CoinGecko's API endpoints and i'll try to update it when new endpoints are added. 11 | 12 | For complete API documentation please refer to https://www.coingecko.com/api/docs/v3. 13 | 14 | For examples Goto: Examples. 15 | 16 | ``` 17 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 18 | client.ping(); 19 | client.shutdown(); 20 | ``` 21 | 22 | To get price of a currency in USD 23 | ``` 24 | client.getPrice("bitcoin",Currency.USD); 25 | ``` 26 | 27 | ## License 28 | MIT License 29 | 30 | Copyright (c) 2019 Philip Okugbe 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy 33 | of this software and associated documentation files (the "Software"), to deal 34 | in the Software without restriction, including without limitation the rights 35 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 36 | copies of the Software, and to permit persons to whom the Software is 37 | furnished to do so, subject to the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be included in all 40 | copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 43 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 45 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 46 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 47 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 48 | SOFTWARE. 49 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.litesoftwares 8 | coingecko-java 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 1.8 13 | 1.8 14 | UTF-8 15 | 16 | 17 | 18 | 19 | 20 | com.squareup.retrofit2 21 | retrofit 22 | 2.9.0 23 | 24 | 25 | 26 | com.squareup.retrofit2 27 | converter-jackson 28 | 2.9.0 29 | 30 | 31 | 32 | org.projectlombok 33 | lombok 34 | 1.18.28 35 | provided 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-compiler-plugin 44 | 3.11.0 45 | 46 | 1.8 47 | 1.8 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/CoinGeckoApi.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko; 2 | 3 | import com.litesoftwares.coingecko.exception.CoinGeckoApiException; 4 | import okhttp3.OkHttpClient; 5 | import retrofit2.Call; 6 | import retrofit2.Response; 7 | import retrofit2.Retrofit; 8 | import retrofit2.converter.jackson.JacksonConverterFactory; 9 | 10 | import java.io.IOException; 11 | import java.lang.annotation.Annotation; 12 | import java.util.concurrent.TimeUnit; 13 | 14 | public class CoinGeckoApi { 15 | private final String API_BASE_URL = "https://api.coingecko.com/api/v3/"; 16 | 17 | private OkHttpClient okHttpClient = null; 18 | private Retrofit retrofit = null; 19 | 20 | public S createService(Class serviceClass, Long connectionTimeoutSeconds, Long readTimeoutSeconds, Long writeTimeoutSeconds){ 21 | okHttpClient = new OkHttpClient.Builder() 22 | .connectTimeout(connectionTimeoutSeconds, TimeUnit.SECONDS) 23 | .readTimeout(readTimeoutSeconds, TimeUnit.SECONDS) 24 | .writeTimeout(writeTimeoutSeconds, TimeUnit.SECONDS) 25 | .build(); 26 | 27 | retrofit = new Retrofit.Builder() 28 | .baseUrl(API_BASE_URL) 29 | .client(okHttpClient) 30 | .addConverterFactory(JacksonConverterFactory.create()) 31 | .build(); 32 | 33 | return retrofit.create(serviceClass); 34 | } 35 | 36 | public T executeSync(Call call) { 37 | try { 38 | Response response = call.execute(); 39 | if (response.isSuccessful()) { 40 | return response.body(); 41 | } else if(response.code() == 429) { 42 | // When the client gets rate limited the response is a CloudFlare error page, 43 | // not a regular error body. 44 | CoinGeckoApiError apiError = new CoinGeckoApiError(); 45 | apiError.setCode(1015); 46 | apiError.setMessage("Rate limited"); 47 | throw new CoinGeckoApiException(apiError); 48 | } else { 49 | try { 50 | CoinGeckoApiError apiError = getCoinGeckoApiError(response); 51 | apiError.setCode(response.code()); 52 | throw new CoinGeckoApiException(apiError); 53 | } catch (IOException e) { 54 | throw new CoinGeckoApiException(response.toString(), e); 55 | } 56 | } 57 | } catch (IOException e) { 58 | throw new CoinGeckoApiException(e); 59 | } finally { 60 | shutdown(); 61 | } 62 | } 63 | 64 | public void shutdown() { 65 | if (okHttpClient != null) { 66 | okHttpClient.dispatcher().executorService().shutdown(); 67 | okHttpClient.connectionPool().evictAll(); 68 | } 69 | } 70 | 71 | private CoinGeckoApiError getCoinGeckoApiError(Response response) throws IOException{ 72 | return (CoinGeckoApiError) retrofit.responseBodyConverter(CoinGeckoApiError.class,new Annotation[0]) 73 | .convert(response.errorBody()); 74 | 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/CoinGeckoApiClient.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko; 2 | 3 | import com.litesoftwares.coingecko.domain.*; 4 | import com.litesoftwares.coingecko.domain.Coins.*; 5 | import com.litesoftwares.coingecko.domain.Events.EventCountries; 6 | import com.litesoftwares.coingecko.domain.Events.EventTypes; 7 | import com.litesoftwares.coingecko.domain.Events.Events; 8 | import com.litesoftwares.coingecko.domain.ExchangeRates.ExchangeRates; 9 | import com.litesoftwares.coingecko.domain.Exchanges.*; 10 | import com.litesoftwares.coingecko.domain.Global.DecentralizedFinanceDefi; 11 | import com.litesoftwares.coingecko.domain.Global.Global; 12 | import com.litesoftwares.coingecko.domain.Search.Search; 13 | import com.litesoftwares.coingecko.domain.Search.Trending; 14 | import com.litesoftwares.coingecko.domain.Status.StatusUpdates; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | public interface CoinGeckoApiClient { 20 | Ping ping(); 21 | 22 | Map> getPrice(String ids, String vsCurrencies); 23 | 24 | Map> getPrice(String ids, String vsCurrencies, boolean includeMarketCap, boolean include24hrVol, 25 | boolean include24hrChange, boolean includeLastUpdatedAt); 26 | 27 | Map> getTokenPrice(String id, String contractAddress, String vsCurrencies); 28 | 29 | Map> getTokenPrice(String id, String contractAddress, String vsCurrencies, boolean includeMarketCap, 30 | boolean include24hrVol, boolean include24hrChange, boolean includeLastUpdatedAt); 31 | 32 | List getSupportedVsCurrencies(); 33 | 34 | List getCoinList(); 35 | 36 | List getCoinMarkets(String vsCurrency); 37 | 38 | List getCoinMarkets(String vsCurrency, String ids, String order, Integer perPage, Integer page, boolean sparkline, String priceChangePercentage); 39 | 40 | List getCoinMarkets(String vsCurrency, String ids, String category, String order, Integer perPage, Integer page, boolean sparkline, String priceChangePercentage); 41 | 42 | CoinFullData getCoinById(String id); 43 | 44 | CoinFullData getCoinById(String id, boolean localization, boolean tickers, boolean marketData, boolean communityData, boolean developerData, boolean sparkline); 45 | 46 | CoinTickerById getCoinTickerById(String id); 47 | 48 | CoinTickerById getCoinTickerById(String id, String exchangeIds, Integer page, String order); 49 | 50 | CoinHistoryById getCoinHistoryById(String id, String date); 51 | 52 | CoinHistoryById getCoinHistoryById(String id, String data, boolean localization); 53 | 54 | MarketChart getCoinMarketChartById(String id, String vsCurrency, Integer days); 55 | 56 | MarketChart getCoinMarketChartById(String id, String vsCurrency, Integer days, String interval); 57 | 58 | MarketChart getCoinMarketChartRangeById(String id, String vsCurrency, String from, String to); 59 | 60 | List> getCoinOHLC(String id, String vsCurrency, Integer days); 61 | 62 | StatusUpdates getCoinStatusUpdateById(String id); 63 | 64 | StatusUpdates getCoinStatusUpdateById(String id, Integer perPage, Integer page); 65 | 66 | CoinFullData getCoinInfoByContractAddress(String id, String contractAddress); 67 | 68 | List getAssetPlatforms(); 69 | 70 | List getExchanges(); 71 | 72 | List getExchanges(int perPage, int page); 73 | 74 | List getExchangesList(); 75 | 76 | ExchangeById getExchangesById(String id); 77 | 78 | ExchangesTickersById getExchangesTickersById(String id); 79 | 80 | ExchangesTickersById getExchangesTickersById(String id, String coinIds, Integer page, String order); 81 | 82 | StatusUpdates getExchangesStatusUpdatesById(String id); 83 | 84 | StatusUpdates getExchangesStatusUpdatesById(String id, Integer perPage, Integer page); 85 | 86 | List> getExchangesVolumeChart(String id, Integer days); 87 | 88 | @Deprecated 89 | StatusUpdates getStatusUpdates(); 90 | 91 | @Deprecated 92 | StatusUpdates getStatusUpdates(String category, String projectType, Integer perPage, Integer page); 93 | 94 | @Deprecated 95 | Events getEvents(); 96 | 97 | @Deprecated 98 | Events getEvents(String countryCode, String type, Integer page, boolean upcomingEventsOnly, String fromDate, String toDate); 99 | 100 | @Deprecated 101 | EventCountries getEventsCountries(); 102 | 103 | @Deprecated 104 | EventTypes getEventsTypes(); 105 | 106 | ExchangeRates getExchangeRates(); 107 | 108 | Trending getTrending(); 109 | 110 | Search getSearchResult(String query); 111 | 112 | Global getGlobal(); 113 | 114 | DecentralizedFinanceDefi getDecentralizedFinanceDefi(); 115 | 116 | void shutdown(); 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/CoinGeckoApiError.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | 10 | public class CoinGeckoApiError { 11 | @JsonProperty("code") 12 | private int code; 13 | @JsonProperty("error") 14 | private String message; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/CoinGeckoApiService.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko; 2 | 3 | import com.litesoftwares.coingecko.domain.*; 4 | import com.litesoftwares.coingecko.domain.Coins.*; 5 | import com.litesoftwares.coingecko.domain.Events.EventCountries; 6 | import com.litesoftwares.coingecko.domain.Events.EventTypes; 7 | import com.litesoftwares.coingecko.domain.Events.Events; 8 | import com.litesoftwares.coingecko.domain.ExchangeRates.ExchangeRates; 9 | import com.litesoftwares.coingecko.domain.Exchanges.*; 10 | import com.litesoftwares.coingecko.domain.Global.DecentralizedFinanceDefi; 11 | import com.litesoftwares.coingecko.domain.Global.Global; 12 | import com.litesoftwares.coingecko.domain.Search.Search; 13 | import com.litesoftwares.coingecko.domain.Search.Trending; 14 | import com.litesoftwares.coingecko.domain.Status.StatusUpdates; 15 | import retrofit2.Call; 16 | import retrofit2.http.GET; 17 | import retrofit2.http.Path; 18 | import retrofit2.http.Query; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | public interface CoinGeckoApiService { 24 | @GET("ping") 25 | Call ping(); 26 | 27 | @GET("simple/price") 28 | Call>> getPrice(@Query("ids") String ids, 29 | @Query("vs_currencies") String vsCurrencies, 30 | @Query("include_market_cap") boolean includeMarketCap, 31 | @Query("include_24hr_vol") boolean include24hrVol, 32 | @Query("include_24hr_change") boolean include24hrChange, 33 | @Query("include_last_updated_at") boolean includeLastUpdatedAt); 34 | 35 | @GET("simple/token_price/{id}") 36 | Call>> getTokenPrice(@Path("id") String id, @Query("contract_addresses") String contractAddress, 37 | @Query("vs_currencies") String vsCurrencies, @Query("include_market_cap") boolean includeMarketCap, 38 | @Query("include_24hr_vol") boolean include24hrVol, @Query("include_24hr_change") boolean include24hrChange, 39 | @Query("include_last_updated_at") boolean includeLastUpdatedAt); 40 | 41 | @GET("simple/supported_vs_currencies") 42 | Call> getSupportedVsCurrencies(); 43 | 44 | @GET("coins/list") 45 | Call> getCoinList(); 46 | 47 | @GET("coins/markets") 48 | Call> getCoinMarkets(@Query("vs_currency") String vsCurrency, @Query("ids") String ids, 49 | @Query("category") String category, 50 | @Query("order") String order, @Query("per_page") Integer perPage, 51 | @Query("page") Integer page, @Query("sparkline") boolean sparkline, 52 | @Query("price_change_percentage") String priceChangePercentage); 53 | 54 | @GET("coins/{id}") 55 | Call getCoinById(@Path("id") String id, @Query("localization") boolean localization, @Query("tickers") boolean tickers, 56 | @Query("market_data") boolean marketData, @Query("community_data") boolean communityData, 57 | @Query("developer_data") boolean developerData, @Query("sparkline") boolean sparkline); 58 | 59 | @GET("coins/{id}/tickers") 60 | Call getCoinTickerById(@Path("id") String id, @Query("exchange_ids") String exchangeIds, 61 | @Query("page") Integer page,@Query("order") String order); 62 | 63 | @GET("coins/{id}/history") 64 | Call getCoinHistoryById(@Path("id") String id, @Query("date") String date, 65 | @Query("localization") boolean localization); 66 | 67 | @GET("coins/{id}/market_chart") 68 | Call getCoinMarketChartById(@Path("id") String id, @Query("vs_currency") String vsCurrency, 69 | @Query("days") Integer days); 70 | 71 | @GET("coins/{id}/market_chart") 72 | Call getCoinMarketChartById(@Path("id") String id, @Query("vs_currency") String vsCurrency, 73 | @Query("days") Integer days, @Query("interval") String interval); 74 | 75 | @GET("coins/{id}/market_chart/range") 76 | Call getCoinMarketChartRangeById(@Path("id") String id, @Query("vs_currency") String vsCurrency, 77 | @Query("from") String from, @Query("to") String to); 78 | 79 | @GET("coins/{id}/ohlc") 80 | Call>> getCoinOHLC(@Path("id") String id, @Query("vs_currency") String vsCurrency, @Query("days") Integer days); 81 | 82 | @GET("coins/{id}/status_updates") 83 | Call getCoinStatusUpdateById(@Path("id") String id, @Query("per_page") Integer perPage, @Query("page") Integer page); 84 | 85 | @GET("coins/{id}/contract/{contract_address}") 86 | Call getCoinInfoByContractAddress(@Path("id") String id, @Path("contract_address") String contractAddress); 87 | 88 | @GET("asset_platforms") 89 | Call> getAssetPlatforms(); 90 | 91 | @GET("exchanges") 92 | Call> getExchanges(@Query("per_page") int perPage, @Query("page") int page); 93 | 94 | @GET("exchanges/list") 95 | Call> getExchangesList(); 96 | 97 | @GET("exchanges/{id}") 98 | Call getExchangesById(@Path("id") String id); 99 | 100 | @GET("exchanges/{id}/tickers") 101 | Call getExchangesTickersById(@Path("id") String id, @Query("coin_ids") String coinIds, 102 | @Query("page") Integer page, @Query("order") String order); 103 | 104 | @GET("exchanges/{id}/status_updates") 105 | Call getExchangesStatusUpdatesById(@Path("id") String id, @Query("per_page")Integer perPage, 106 | @Query("page") Integer page); 107 | 108 | @GET("exchanges/{id}/volume_chart") 109 | Call>> getExchangesVolumeChart(@Path("id") String id,@Query("days") Integer days); 110 | 111 | @Deprecated 112 | @GET("status_updates") 113 | Call getStatusUpdates(); 114 | 115 | @Deprecated 116 | @GET("status_updates") 117 | Call getStatusUpdates(@Query("category") String category, @Query("project_type") String projectType, 118 | @Query("per_page") Integer perPage, @Query("page") Integer page); 119 | 120 | @Deprecated 121 | @GET("events") 122 | Call getEvents(); 123 | 124 | @Deprecated 125 | @GET("events") 126 | Call getEvents(@Query("country_code") String countryCode, @Query("type") String type, 127 | @Query("page") Integer page, @Query("upcoming_events_only") boolean upcomingEventsOnly, 128 | @Query("from_date") String fromDate, @Query("to_date") String toDate); 129 | 130 | @Deprecated 131 | @GET("events/countries") 132 | Call getEventsCountries(); 133 | 134 | @Deprecated 135 | @GET("events/types") 136 | Call getEventsTypes(); 137 | 138 | @GET("exchange_rates") 139 | Call getExchangeRates(); 140 | 141 | @GET("search/trending") 142 | Call getTrending(); 143 | 144 | @GET("search") 145 | Call getSearch(@Query("query") String query); 146 | 147 | @GET("global") 148 | Call getGlobal(); 149 | 150 | @GET("global/decentralized_finance_defi") 151 | Call getDecentralizedFinanceDefi(); 152 | } 153 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/constant/Currency.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.constant; 2 | 3 | public final class Currency { 4 | 5 | //Fiat 6 | 7 | public final static String AED = "aed"; 8 | public final static String ARS = "ars"; 9 | public final static String AUD = "aud"; 10 | public final static String BDT = "bdt"; 11 | public final static String BHD = "bhd"; 12 | public final static String BMD = "bmd"; 13 | public final static String BRL = "brl"; 14 | public final static String CAD = "cad"; 15 | public final static String CHF = "chf"; 16 | public final static String CLP = "clp"; 17 | public final static String CNY = "cny"; 18 | public final static String CZK = "czl"; 19 | public final static String DKK = "dkk"; 20 | public final static String EUR = "eur"; 21 | public final static String GBP = "gbp"; 22 | public final static String HKD = "hkd"; 23 | public final static String HUF = "huf"; 24 | public final static String IDR = "idr"; 25 | public final static String ILS = "ils"; 26 | public final static String INR = "inr"; 27 | public final static String JPY = "jpy"; 28 | public final static String KRW = "krw"; 29 | public final static String KWD = "kwd"; 30 | public final static String LKR = "lkr"; 31 | public final static String MMK = "mmk"; 32 | public final static String MXN = "mxn"; 33 | public final static String MYR = "myr"; 34 | public final static String NOK = "nok"; 35 | public final static String NZD = "nzd"; 36 | public final static String PHP = "php"; 37 | public final static String PKR = "pkr"; 38 | public final static String PLN = "pln"; 39 | public final static String RUB = "rub"; 40 | public final static String SAR = "sar"; 41 | public final static String SEK = "sek"; 42 | public final static String SGD = "sgd"; 43 | public final static String THB = "thb"; 44 | public final static String TRY = "try"; 45 | public final static String TWD = "twd"; 46 | public final static String UAH = "uah"; 47 | public final static String USD = "usd"; 48 | public final static String VEF = "vef"; 49 | public final static String VND = "vnd"; 50 | public final static String XAG = "xag"; 51 | public final static String XAU = "xau"; 52 | public final static String XDR = "xdr"; 53 | public final static String ZAR = "zar"; 54 | 55 | // crypto 56 | 57 | public final static String BNB = "bnb"; 58 | public final static String EOS = "eos"; 59 | public final static String BTC = "btc"; 60 | public final static String BCH = "bch"; 61 | public final static String ETH = "eth"; 62 | public final static String LTC = "ltc"; 63 | public final static String XLM = "xlm"; 64 | public final static String XRP = "xrp"; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/constant/Order.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.constant; 2 | 3 | public class Order { 4 | public static String GECKO_ASC = "gecko_asc"; 5 | public static String GECKO_DESC = "gecko_desc"; 6 | public static String MARKET_CAP_ASC = "market_cap_asc"; 7 | public static String MARKET_CAP_DESC = "market_cap_desc"; 8 | public static String VOLUME_ASC = "volume_asc"; 9 | public static String VOLUME_DESC = "volume_desc"; 10 | public static String COIN_NAME_ASC = "coin_name_asc"; 11 | public static String COIN_NAME_DESC = "coin_name_desc"; 12 | public static String PRICE_ASC = "price_asc"; 13 | public static String PRICE_DESC = "price_desc"; 14 | public static String HOUR_24_ASC = "h24_change_asc"; 15 | public static String HOUR_24_DESC = "h24_change_desc"; 16 | public static String TRUST_SCORE_DESC = "trust_score_desc"; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/AssetPlatforms.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class AssetPlatforms { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("chain_identifier") 13 | private long chainIdentifier; 14 | @JsonProperty("name") 15 | private String name; 16 | @JsonProperty("shortname") 17 | private String shortname; 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/CodeAdditionsDeletions4Weeks.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class CodeAdditionsDeletions4Weeks { 10 | @JsonProperty("additions") 11 | private long additions; 12 | @JsonProperty("deletions") 13 | private long deletions; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/CommunityData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.*; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class CommunityData { 11 | @JsonProperty("facebook_likes") 12 | private long facebookLikes; 13 | @JsonProperty("twitter_followers") 14 | private long twitterFollowers; 15 | @JsonProperty("reddit_average_posts_48h") 16 | private BigDecimal redditAveragePosts48h; 17 | @JsonProperty("reddit_average_comments_48h") 18 | private BigDecimal redditAverageComments48h; 19 | @JsonProperty("reddit_subscribers") 20 | private long redditSubscribers; 21 | @JsonProperty("reddit_accounts_active_48h") 22 | private BigDecimal redditAccountsActive48h; 23 | @JsonProperty("telegram_channel_user_count") 24 | private long telegramChannelUserCount; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/DeveloperData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class DeveloperData { 12 | @JsonProperty("forks") 13 | private long forks; 14 | @JsonProperty("stars") 15 | private long stars; 16 | @JsonProperty("subscribers") 17 | private long subscribers; 18 | @JsonProperty("total_issues") 19 | private long totalIssues; 20 | @JsonProperty("closed_issues") 21 | private long closedIssues; 22 | @JsonProperty("pull_requests_merged") 23 | private long pullRequestsMerged; 24 | @JsonProperty("pull_request_contributors") 25 | private long pullRequestContributors; 26 | @JsonProperty("code_additions_deletions_4_weeks") 27 | private CodeAdditionsDeletions4Weeks codeAdditionsDeletions4Weeks; 28 | @JsonProperty("commit_count_4_weeks") 29 | private long commitCount4Weeks; 30 | @JsonProperty("last_4_weeks_commit_activity_series") 31 | private List last4WeeksCommitActivitySeries; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/IcoData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class IcoData { 10 | @JsonProperty("ico_start_date") 11 | private String icoStartDate; 12 | @JsonProperty("ico_end_date") 13 | private String icoEndDate; 14 | @JsonProperty("short_desc") 15 | private String shortDesc; 16 | @JsonProperty("description") 17 | private String description; 18 | @JsonProperty("links") 19 | private Links_ links; 20 | @JsonProperty("softcap_currency") 21 | private String softcapCurrency; 22 | @JsonProperty("hardcap_currency") 23 | private String hardcapCurrency; 24 | @JsonProperty("total_raised_currency") 25 | private String totalRaisedCurrency; 26 | @JsonProperty("softcap_amount") 27 | private Object softcapAmount; 28 | @JsonProperty("hardcap_amount") 29 | private Object hardcapAmount; 30 | @JsonProperty("total_raised") 31 | private Object totalRaised; 32 | @JsonProperty("quote_pre_sale_currency") 33 | private String quotePreSaleCurrency; 34 | @JsonProperty("base_pre_sale_amount") 35 | private Object basePreSaleAmount; 36 | @JsonProperty("quote_pre_sale_amount") 37 | private Object quotePreSaleAmount; 38 | @JsonProperty("quote_public_sale_currency") 39 | private String quotePublicSaleCurrency; 40 | @JsonProperty("base_public_sale_amount") 41 | private String basePublicSaleAmount; 42 | @JsonProperty("quote_public_sale_amount") 43 | private String quotePublicSaleAmount; 44 | @JsonProperty("accepting_currencies") 45 | private String acceptingCurrencies; 46 | @JsonProperty("country_origin") 47 | private String countryOrigin; 48 | @JsonProperty("pre_sale_start_date") 49 | private Object preSaleStartDate; 50 | @JsonProperty("pre_sale_end_date") 51 | private Object preSaleEndDate; 52 | @JsonProperty("whitelist_url") 53 | private String whitelistUrl; 54 | @JsonProperty("whitelist_start_date") 55 | private Object whitelistStartDate; 56 | @JsonProperty("whitelist_end_date") 57 | private Object whitelistEndDate; 58 | @JsonProperty("bounty_detail_url") 59 | private String bountyDetailUrl; 60 | @JsonProperty("amount_for_sale") 61 | private Object amountForSale; 62 | @JsonProperty("kyc_required") 63 | private boolean kycRequired; 64 | @JsonProperty("whitelist_available") 65 | private Object whitelistAvailable; 66 | @JsonProperty("pre_sale_available") 67 | private Object preSaleAvailable; 68 | @JsonProperty("pre_sale_ended") 69 | private boolean preSaleEnded; 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/Links.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Links { 12 | @JsonProperty("homepage") 13 | private List homepage; 14 | @JsonProperty("blockchain_site") 15 | private List blockchainSite; 16 | @JsonProperty("official_forum_url") 17 | private List officialForumUrl; 18 | @JsonProperty("chat_url") 19 | private List chatUrl; 20 | @JsonProperty("announcement_url") 21 | private List announcementUrl; 22 | @JsonProperty("twitter_screen_name") 23 | private String twitterScreenName; 24 | @JsonProperty("facebook_username") 25 | private String facebookUsername; 26 | @JsonProperty("bitcointalk_thread_identifier") 27 | private Object bitcointalkThreadIdentifier; 28 | @JsonProperty("telegram_channel_identifier") 29 | private String telegramChannelIdentifier; 30 | @JsonProperty("subreddit_url") 31 | private String subredditUrl; 32 | @JsonProperty("repos_url") 33 | private ReposUrl reposUrl; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/Links_.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Links_ { 10 | @JsonProperty("web") 11 | private String web; 12 | @JsonProperty("blog") 13 | private String blog; 14 | @JsonProperty("github") 15 | private String github; 16 | @JsonProperty("twitter") 17 | private String twitter; 18 | @JsonProperty("facebook") 19 | private String facebook; 20 | @JsonProperty("telegram") 21 | private String telegram; 22 | @JsonProperty("whitepaper") 23 | private String whitepaper; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/PublicInterestStats.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class PublicInterestStats { 10 | 11 | @JsonProperty("alexa_rank") 12 | private long alexaRank; 13 | @JsonProperty("bing_matches") 14 | private long bingMatches; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/ReposUrl.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class ReposUrl { 12 | @JsonProperty("github") 13 | private List github; 14 | @JsonProperty("bitbucket") 15 | private List bitbucket; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/Roi.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Roi { 10 | @JsonProperty("times") 11 | private float times; 12 | @JsonProperty("currency") 13 | private String currency; 14 | @JsonProperty("percentage") 15 | private float percentage; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinData/SparklineIn7d.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins.CoinData; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class SparklineIn7d { 12 | @JsonProperty("price") 13 | private List price; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinFullData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Coins.CoinData.*; 6 | import com.litesoftwares.coingecko.domain.Shared.Image; 7 | import com.litesoftwares.coingecko.domain.Shared.Ticker; 8 | import java.math.BigDecimal; 9 | import lombok.*; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | @Data 15 | @JsonIgnoreProperties(ignoreUnknown = true) 16 | public class CoinFullData { 17 | @JsonProperty("id") 18 | private String id; 19 | @JsonProperty("symbol") 20 | private String symbol; 21 | @JsonProperty("name") 22 | private String name; 23 | @JsonProperty("asset_platform_id") 24 | private String assetPlatformId; 25 | @JsonProperty("platforms") 26 | private Map platforms; 27 | @JsonProperty("block_time_in_minutes") 28 | private long blockTimeInMinutes; 29 | @JsonProperty("hashing_algorithm") 30 | private String hashingAlgorithm; 31 | @JsonProperty("categories") 32 | private List categories; 33 | @JsonProperty("public_notice") 34 | private String publicNotice; 35 | @JsonProperty("additional_notices") 36 | List additionalNotices; 37 | @JsonProperty("localization") 38 | private Map localization; 39 | @JsonProperty("description") 40 | private Map description; 41 | @JsonProperty("links") 42 | private Links links; 43 | @JsonProperty("image") 44 | private Image image; 45 | @JsonProperty("country_origin") 46 | private String countryOrigin; 47 | @JsonProperty("genesis_date") 48 | private String genesisDate; 49 | @JsonProperty("sentiment_votes_up_percentage") 50 | private BigDecimal sentimentVotesUpPercentage; 51 | @JsonProperty("sentiment_votes_down_percentage") 52 | private BigDecimal sentimentVotesDownPercentage; 53 | @JsonProperty("contract_address") 54 | private String contractAddress; 55 | @JsonProperty("ico_data") 56 | private IcoData icoData; 57 | @JsonProperty("market_cap_rank") 58 | private long marketCapRank; 59 | @JsonProperty("coingecko_rank") 60 | private long coingeckoRank; 61 | @JsonProperty("coingecko_score") 62 | private BigDecimal coingeckoScore; 63 | @JsonProperty("developer_score") 64 | private BigDecimal developerScore; 65 | @JsonProperty("community_score") 66 | private BigDecimal communityScore; 67 | @JsonProperty("liquidity_score") 68 | private BigDecimal liquidityScore; 69 | @JsonProperty("public_interest_score") 70 | private BigDecimal publicInterestScore; 71 | @JsonProperty("market_data") 72 | private MarketData marketData; 73 | @JsonProperty("community_data") 74 | private CommunityData communityData; 75 | @JsonProperty("developer_data") 76 | private DeveloperData developerData; 77 | @JsonProperty("public_interest_stats") 78 | private PublicInterestStats publicInterestStats; 79 | @JsonProperty("status_updates") 80 | private List statusUpdates; 81 | @JsonProperty("last_updated") 82 | private String lastUpdated; 83 | @JsonProperty("tickers") 84 | private List tickers; 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinHistoryById.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Coins.CoinData.*; 6 | import com.litesoftwares.coingecko.domain.Shared.Image; 7 | 8 | import lombok.Data; 9 | 10 | import java.util.Map; 11 | 12 | @Data 13 | @JsonIgnoreProperties(ignoreUnknown = true) 14 | public class CoinHistoryById { 15 | @JsonProperty("id") 16 | private String id; 17 | @JsonProperty("symbol") 18 | private String symbol; 19 | @JsonProperty("name") 20 | private String name; 21 | @JsonProperty("localization") 22 | private Map localization; 23 | @JsonProperty("image") 24 | private Image image; 25 | @JsonProperty("market_data") 26 | private MarketData marketData; 27 | @JsonProperty("community_data") 28 | private CommunityData communityData; 29 | @JsonProperty("developer_data") 30 | private DeveloperData developerData; 31 | @JsonProperty("public_interest_stats") 32 | private PublicInterestStats publicInterestStats; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinList.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class CoinList { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("symbol") 13 | private String symbol; 14 | @JsonProperty("name") 15 | private String name; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinMarkets.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Coins.CoinData.Roi; 6 | import com.litesoftwares.coingecko.domain.Coins.CoinData.SparklineIn7d; 7 | import java.math.BigDecimal; 8 | import lombok.*; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class CoinMarkets { 13 | @JsonProperty("id") 14 | private String id; 15 | @JsonProperty("symbol") 16 | private String symbol; 17 | @JsonProperty("name") 18 | private String name; 19 | @JsonProperty("image") 20 | private String image; 21 | @JsonProperty("current_price") 22 | private BigDecimal currentPrice; 23 | @JsonProperty("market_cap") 24 | private BigDecimal marketCap; 25 | @JsonProperty("market_cap_rank") 26 | private long marketCapRank; 27 | @JsonProperty("fully_diluted_valuation") 28 | private BigDecimal fullyDilutedValuation; 29 | @JsonProperty("total_volume") 30 | private BigDecimal totalVolume; 31 | @JsonProperty("high_24h") 32 | private BigDecimal high24h; 33 | @JsonProperty("low_24h") 34 | private BigDecimal low24h; 35 | @JsonProperty("price_change_24h") 36 | private BigDecimal priceChange24h; 37 | @JsonProperty("price_change_percentage_24h") 38 | private BigDecimal priceChangePercentage24h; 39 | @JsonProperty("market_cap_change_24h") 40 | private BigDecimal marketCapChange24h; 41 | @JsonProperty("market_cap_change_percentage_24h") 42 | private BigDecimal marketCapChangePercentage24h; 43 | @JsonProperty("circulating_supply") 44 | private BigDecimal circulatingSupply; 45 | @JsonProperty("total_supply") 46 | private BigDecimal totalSupply; 47 | @JsonProperty("max_supply") 48 | private BigDecimal maxSupply; 49 | @JsonProperty("ath") 50 | private BigDecimal ath; 51 | @JsonProperty("ath_change_percentage") 52 | private BigDecimal athChangePercentage; 53 | @JsonProperty("ath_date") 54 | private String athDate; 55 | @JsonProperty("atl") 56 | private BigDecimal atl; 57 | @JsonProperty("atl_change_percentage") 58 | private BigDecimal atlChangePercentage; 59 | @JsonProperty("atl_date") 60 | private String atlDate; 61 | @JsonProperty("roi") 62 | private Roi roi; 63 | @JsonProperty("last_updated") 64 | private String lastUpdated; 65 | @JsonProperty("sparkline_in_7d") 66 | private SparklineIn7d sparklineIn7d; 67 | @JsonProperty("price_change_percentage_1h_in_currency") 68 | private BigDecimal priceChangePercentage1hInCurrency; 69 | @JsonProperty("price_change_percentage_24h_in_currency") 70 | private BigDecimal priceChangePercentage24hInCurrency; 71 | @JsonProperty("price_change_percentage_7d_in_currency") 72 | private BigDecimal priceChangePercentage7dInCurrency; 73 | @JsonProperty("price_change_percentage_14d_in_currency") 74 | private BigDecimal priceChangePercentage14dInCurrency; 75 | @JsonProperty("price_change_percentage_30d_in_currency") 76 | private BigDecimal priceChangePercentage30dInCurrency; 77 | @JsonProperty("price_change_percentage_200d_in_currency") 78 | private BigDecimal priceChangePercentage200dInCurrency; 79 | @JsonProperty("price_change_percentage_1y_in_currency") 80 | private BigDecimal priceChangePercentage1yInCurrency; 81 | } 82 | 83 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/CoinTickerById.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Shared.Ticker; 6 | import lombok.*; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class CoinTickerById { 13 | @JsonProperty("name") 14 | private String name; 15 | @JsonProperty("tickers") 16 | private List tickers; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/MarketChart.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class MarketChart { 12 | @JsonProperty("prices") 13 | private List> prices; 14 | @JsonProperty("market_caps") 15 | private List> marketCaps; 16 | @JsonProperty("total_volumes") 17 | private List> totalVolumes; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Coins/MarketData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Coins; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Coins.CoinData.Roi; 6 | import java.math.BigDecimal; 7 | import lombok.*; 8 | 9 | import java.util.Map; 10 | 11 | @Data 12 | @JsonIgnoreProperties(ignoreUnknown = true) 13 | public class MarketData { 14 | @JsonProperty("current_price") 15 | private Map currentPrice; 16 | @JsonProperty("roi") 17 | private Roi roi; 18 | @JsonProperty("ath") 19 | private Map ath; 20 | @JsonProperty("ath_change_percentage") 21 | private Map athChangePercentage; 22 | @JsonProperty("ath_date") 23 | private Map athDate; 24 | @JsonProperty("atl") 25 | private Map atl; 26 | @JsonProperty("atl_change_percentage") 27 | private Map atlChangePercentage; 28 | @JsonProperty("atl_date") 29 | private Map atlDate; 30 | @JsonProperty("market_cap") 31 | private Map marketCap; 32 | @JsonProperty("market_cap_rank") 33 | private long marketCapRank; 34 | @JsonProperty("total_volume") 35 | private Map totalVolume; 36 | @JsonProperty("high_24h") 37 | private Map high24h; 38 | @JsonProperty("low_24h") 39 | private Map low24h; 40 | @JsonProperty("price_change_24h") 41 | private BigDecimal priceChange24h; 42 | @JsonProperty("price_change_percentage_24h") 43 | private BigDecimal priceChangePercentage24h; 44 | @JsonProperty("price_change_percentage_7d") 45 | private BigDecimal priceChangePercentage7d; 46 | @JsonProperty("price_change_percentage_14d") 47 | private BigDecimal priceChangePercentage14d; 48 | @JsonProperty("price_change_percentage_30d") 49 | private BigDecimal priceChangePercentage30d; 50 | @JsonProperty("price_change_percentage_60d") 51 | private BigDecimal priceChangePercentage60d; 52 | @JsonProperty("price_change_percentage_200d") 53 | private BigDecimal priceChangePercentage200d; 54 | @JsonProperty("price_change_percentage_1y") 55 | private BigDecimal priceChangePercentage1y; 56 | @JsonProperty("market_cap_change_24h") 57 | private BigDecimal marketCapChange24h; 58 | @JsonProperty("market_cap_change_percentage_24h") 59 | private BigDecimal marketCapChangePercentage24h; 60 | @JsonProperty("price_change_24h_in_currency") 61 | private Map priceChange24hInCurrency; 62 | @JsonProperty("price_change_percentage_1h_in_currency") 63 | private Map priceChangePercentage1hInCurrency; 64 | @JsonProperty("price_change_percentage_24h_in_currency") 65 | private Map priceChangePercentage24hInCurrency; 66 | @JsonProperty("price_change_percentage_7d_in_currency") 67 | private Map priceChangePercentage7dInCurrency; 68 | @JsonProperty("price_change_percentage_14d_in_currency") 69 | private Map priceChangePercentage14dInCurrency; 70 | @JsonProperty("price_change_percentage_30d_in_currency") 71 | private Map priceChangePercentage30dInCurrency; 72 | @JsonProperty("price_change_percentage_60d_in_currency") 73 | private Map priceChangePercentage60dInCurrency; 74 | @JsonProperty("price_change_percentage_200d_in_currency") 75 | private Map priceChangePercentage200dInCurrency; 76 | @JsonProperty("price_change_percentage_1y_in_currency") 77 | private Map priceChangePercentage1yInCurrency; 78 | @JsonProperty("market_cap_change_24h_in_currency") 79 | private Map marketCapChange24hInCurrency; 80 | @JsonProperty("market_cap_change_percentage_24h_in_currency") 81 | private Map marketCapChangePercentage24hInCurrency; 82 | @JsonProperty("fully_diluted_valuation") 83 | private Map fullyDilutedValuation; 84 | @JsonProperty("total_value_locked") 85 | private Map totalValueLocked; 86 | @JsonProperty("mcap_to_tvl_ratio") 87 | private String mcapToTvlRatio; 88 | @JsonProperty("fdv_to_tvl_ratio") 89 | private String fdvToTvlRatio; 90 | @JsonProperty("total_supply") 91 | private BigDecimal totalSupply; 92 | @JsonProperty("max_supply") 93 | private BigDecimal maxSupply; 94 | @JsonProperty("circulating_supply") 95 | private BigDecimal circulatingSupply; 96 | @JsonProperty("last_updated") 97 | private String lastUpdated; 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Events/EventCountries.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class EventCountries { 12 | @JsonProperty("data") 13 | private List data; 14 | @JsonProperty("count") 15 | private String count; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Events/EventCountryData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class EventCountryData { 10 | @JsonProperty("country") 11 | private String country; 12 | @JsonProperty("code") 13 | private String code; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Events/EventData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class EventData{ 10 | @JsonProperty("type") 11 | private String type; 12 | @JsonProperty("title") 13 | private String title; 14 | @JsonProperty("description") 15 | private String description; 16 | @JsonProperty("organizer") 17 | private String organizer; 18 | @JsonProperty("start_date") 19 | private String startDate; 20 | @JsonProperty("end_date") 21 | private String endDate; 22 | @JsonProperty("website") 23 | private String website; 24 | @JsonProperty("email") 25 | private String email; 26 | @JsonProperty("venue") 27 | private String venue; 28 | @JsonProperty("address") 29 | private String address; 30 | @JsonProperty("city") 31 | private String city; 32 | @JsonProperty("country") 33 | private String country; 34 | @JsonProperty("screenshot") 35 | private String screenshot; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Events/EventTypes.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class EventTypes { 12 | @JsonProperty("data") 13 | private List data; 14 | @JsonProperty("count") 15 | private long count; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Events/Events.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Events { 12 | @JsonProperty("data") 13 | private List data; 14 | @JsonProperty("count") 15 | private long count; 16 | @JsonProperty("page") 17 | private long page; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/ExchangeRates/ExchangeRates.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.ExchangeRates; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | import java.util.Map; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class ExchangeRates { 12 | @JsonProperty("rates") 13 | private Map rates; 14 | 15 | } -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/ExchangeRates/Rate.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.ExchangeRates; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.*; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Rate { 11 | @JsonProperty("name") 12 | private String name; 13 | @JsonProperty("unit") 14 | private String unit; 15 | @JsonProperty("value") 16 | private BigDecimal value; 17 | @JsonProperty("type") 18 | private String type; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Exchanges/ExchangeById.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Exchanges; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Shared.Ticker; 6 | import lombok.*; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | @EqualsAndHashCode(callSuper = false) 13 | public class ExchangeById extends Exchanges{ 14 | @JsonProperty("tickers") 15 | private List tickers; 16 | @JsonProperty("status_updates") 17 | private List statusUpdates; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Exchanges/Exchanges.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Exchanges; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.*; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Exchanges { 11 | @JsonProperty("id") 12 | String id; 13 | @JsonProperty("name") 14 | String name; 15 | @JsonProperty("year_established") 16 | long yearEstablished; 17 | @JsonProperty("country") 18 | String country; 19 | @JsonProperty("description") 20 | Object description; 21 | @JsonProperty("url") 22 | String url; 23 | @JsonProperty("image") 24 | String image; 25 | @JsonProperty("has_trading_incentive") 26 | boolean hasTradingIncentive; 27 | @JsonProperty("trade_volume_24h_btc") 28 | BigDecimal tradeVolume24hBtc; 29 | @JsonProperty("trust_score") 30 | int trustScore; 31 | @JsonProperty("trust_score_rank") 32 | int trustScoreRank; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Exchanges/ExchangesList.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Exchanges; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class ExchangesList { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("name") 13 | private String name; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Exchanges/ExchangesTickersById.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Exchanges; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Shared.Ticker; 6 | import lombok.*; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class ExchangesTickersById { 13 | @JsonProperty("name") 14 | private String name; 15 | @JsonProperty("tickers") 16 | private List tickers; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Global/DecentralizedFinanceDefi.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Global; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class DecentralizedFinanceDefi { 10 | @JsonProperty("data") 11 | private DecentralizedFinanceDefiData data; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Global/DecentralizedFinanceDefiData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Global; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.Data; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class DecentralizedFinanceDefiData { 11 | 12 | @JsonProperty("defi_market_cap") 13 | private String defiMarketCap; 14 | @JsonProperty("eth_market_cap") 15 | private String ethMarketCap; 16 | @JsonProperty("defi_to_eth_ratio") 17 | private String defiToEthRatio; 18 | @JsonProperty("trading_volume_24h") 19 | private String tradingVolume24h; 20 | @JsonProperty("defi_dominance") 21 | private String defiDominance; 22 | @JsonProperty("top_coin_name") 23 | private String topCoinName; 24 | @JsonProperty("top_coin_defi_dominance") 25 | private BigDecimal topCoinDefiDominance; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Global/Global.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Global; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | 10 | public class Global { 11 | @JsonProperty("data") 12 | private GlobalData data; 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Global/GlobalData.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Global; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.*; 7 | 8 | import java.util.Map; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class GlobalData { 13 | @JsonProperty("active_cryptocurrencies") 14 | private long activeCryptocurrencies; 15 | @JsonProperty("upcoming_icos") 16 | private long upcomingIcos; 17 | @JsonProperty("ongoing_icos") 18 | private long ongoingIcos; 19 | @JsonProperty("ended_icos") 20 | private long endedIcos; 21 | @JsonProperty("markets") 22 | private long markets; 23 | @JsonProperty("total_market_cap") 24 | private Map totalMarketCap; 25 | @JsonProperty("total_volume") 26 | private Map totalVolume; 27 | @JsonProperty("market_cap_percentage") 28 | private Map marketCapPercentage; 29 | @JsonProperty("market_cap_change_percentage_24h_usd") 30 | private BigDecimal marketCapChangePercentage24hUsd; 31 | @JsonProperty("updated_at") 32 | private long updatedAt; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Ping.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Ping { 10 | @JsonProperty("gecko_says") 11 | private String geckoSays; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/Search.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Search { 12 | @JsonProperty("coins") 13 | private List coins = null; 14 | 15 | @JsonProperty("exchanges") 16 | private List exchanges = null; 17 | @JsonProperty("categories") 18 | private List categories = null; 19 | 20 | @JsonProperty("nfts") 21 | private List nfts = null; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/SearchCategory.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class SearchCategory { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("name") 13 | private String name; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/SearchCoin.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class SearchCoin { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("name") 13 | private String name; 14 | @JsonProperty("api_symbol") 15 | private String apiSymbol; 16 | @JsonProperty("symbol") 17 | private String symbol; 18 | @JsonProperty("market_cap_rank") 19 | private int marketCapRank; 20 | @JsonProperty("thumb") 21 | private String thumb; 22 | @JsonProperty("large") 23 | private String large; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/SearchExchange.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class SearchExchange { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("name") 13 | private String name; 14 | @JsonProperty("market_type") 15 | private String marketType; 16 | @JsonProperty("thumb") 17 | private String thumb; 18 | @JsonProperty("large") 19 | private String large; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/SearchNft.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class SearchNft { 10 | @JsonProperty("id") 11 | private String id; 12 | @JsonProperty("name") 13 | private String name; 14 | @JsonProperty("symbol") 15 | private String symbol; 16 | @JsonProperty("thumb") 17 | private String thumb; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/Trending.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Trending { 12 | @JsonProperty("coins") 13 | private List coins = null; 14 | @JsonProperty("exchanges") 15 | private List exchanges = null; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/TrendingCoin.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class TrendingCoin { 10 | @JsonProperty("item") 11 | private TrendingCoinItem item; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Search/TrendingCoinItem.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Search; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.Data; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class TrendingCoinItem { 11 | @JsonProperty("id") 12 | private String id; 13 | @JsonProperty("coin_id") 14 | private int coinId; 15 | @JsonProperty("name") 16 | private String name; 17 | @JsonProperty("symbol") 18 | private String symbol; 19 | @JsonProperty("market_cap_rank") 20 | private int marketCapRank; 21 | @JsonProperty("thumb") 22 | private String thumb; 23 | @JsonProperty("small") 24 | private String small; 25 | @JsonProperty("large") 26 | private String large; 27 | @JsonProperty("slug") 28 | private String slug; 29 | @JsonProperty("price_btc") 30 | private BigDecimal priceBtc; 31 | @JsonProperty("score") 32 | private int score; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Shared/Image.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Shared; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Image { 10 | @JsonProperty("thumb") 11 | private String thumb; 12 | @JsonProperty("small") 13 | private String small; 14 | @JsonProperty("large") 15 | private String large; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Shared/Market.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Shared; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Market { 10 | @JsonProperty("name") 11 | private String name; 12 | @JsonProperty("identifier") 13 | private String identifier; 14 | @JsonProperty("has_trading_incentive") 15 | private boolean hasTradingIncentive; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Shared/Ticker.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Shared; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import java.math.BigDecimal; 6 | import lombok.*; 7 | 8 | import java.util.Map; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class Ticker { 13 | @JsonProperty("base") 14 | private String base; 15 | @JsonProperty("target") 16 | private String target; 17 | @JsonProperty("market") 18 | private Market market; 19 | @JsonProperty("last") 20 | private BigDecimal last; 21 | @JsonProperty("volume") 22 | private BigDecimal volume; 23 | @JsonProperty("converted_last") 24 | private Map convertedLast; 25 | @JsonProperty("converted_volume") 26 | private Map convertedVolume; 27 | @JsonProperty("trust_score") 28 | private String trustScore; 29 | @JsonProperty("bid_ask_spread_percentage") 30 | private BigDecimal bidAskSpreadPercentage; 31 | @JsonProperty("timestamp") 32 | private String timestamp; 33 | @JsonProperty("last_traded_at") 34 | private String lastTradedAt; 35 | @JsonProperty("last_fetch_at") 36 | private String lastFetchAt; 37 | @JsonProperty("is_anomaly") 38 | private boolean isAnomaly; 39 | @JsonProperty("is_stale") 40 | private boolean isStale; 41 | @JsonProperty("trade_url") 42 | private String tradeUrl; 43 | @JsonProperty("coin_id") 44 | private String coinId; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Status/Project.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Status; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import com.litesoftwares.coingecko.domain.Shared.Image; 6 | import lombok.*; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Project { 11 | @JsonProperty("type") 12 | private String type; 13 | @JsonProperty("id") 14 | private String id; 15 | @JsonProperty("name") 16 | private String name; 17 | @JsonProperty("symbol") 18 | private String symbol; 19 | @JsonProperty("image") 20 | private Image image; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Status/StatusUpdates.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Status; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class StatusUpdates { 12 | @JsonProperty("status_updates") 13 | private List updates; 14 | 15 | } -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/domain/Status/Update.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.domain.Status; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.*; 6 | 7 | @Data 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class Update { 10 | @JsonProperty("description") 11 | private String description; 12 | @JsonProperty("category") 13 | private String category; 14 | @JsonProperty("created_at") 15 | private String createdAt; 16 | @JsonProperty("user") 17 | private String user; 18 | @JsonProperty("user_title") 19 | private String userTitle; 20 | @JsonProperty("pin") 21 | private boolean pin; 22 | @JsonProperty("project") 23 | private Project project; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/exception/CoinGeckoApiException.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.exception; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiError; 4 | 5 | public class CoinGeckoApiException extends RuntimeException { 6 | private final static long serialVersionUID = -4298738252483677889L; 7 | private CoinGeckoApiError error; 8 | 9 | public CoinGeckoApiException(CoinGeckoApiError error) { 10 | this.error = error; 11 | } 12 | 13 | public CoinGeckoApiException(Throwable cause) { 14 | super(cause); 15 | } 16 | 17 | public CoinGeckoApiException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public CoinGeckoApiError getError() { 22 | return error; 23 | } 24 | 25 | @Override 26 | public String getMessage() { 27 | if (error != null) { 28 | return error.toString(); 29 | } 30 | return super.getMessage(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/litesoftwares/coingecko/impl/CoinGeckoApiClientImpl.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.impl; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiService; 4 | import com.litesoftwares.coingecko.CoinGeckoApi; 5 | import com.litesoftwares.coingecko.domain.*; 6 | import com.litesoftwares.coingecko.domain.Coins.*; 7 | import com.litesoftwares.coingecko.domain.Events.EventCountries; 8 | import com.litesoftwares.coingecko.domain.Events.EventTypes; 9 | import com.litesoftwares.coingecko.domain.Events.Events; 10 | import com.litesoftwares.coingecko.domain.ExchangeRates.ExchangeRates; 11 | import com.litesoftwares.coingecko.domain.Exchanges.*; 12 | import com.litesoftwares.coingecko.domain.Global.DecentralizedFinanceDefi; 13 | import com.litesoftwares.coingecko.domain.Global.Global; 14 | import com.litesoftwares.coingecko.domain.Search.Search; 15 | import com.litesoftwares.coingecko.domain.Search.Trending; 16 | import com.litesoftwares.coingecko.domain.Status.StatusUpdates; 17 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 18 | 19 | import java.util.List; 20 | import java.util.Map; 21 | 22 | public class CoinGeckoApiClientImpl implements CoinGeckoApiClient { 23 | static final Long DEFAULT_CONNECTION_TIMEOUT = 10L; 24 | static final Long DEFAULT_READ_TIMEOUT = 10L; 25 | static final Long DEFAULT_WRITE_TIMEOUT = 10L; 26 | 27 | private CoinGeckoApiService coinGeckoApiService; 28 | private CoinGeckoApi coinGeckoApi; 29 | 30 | public CoinGeckoApiClientImpl() { 31 | this(DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_WRITE_TIMEOUT); 32 | } 33 | 34 | public CoinGeckoApiClientImpl(Long connectionTimeoutSeconds, Long readTimeoutSeconds, Long writeTimeoutSeconds){ 35 | this.coinGeckoApi = new CoinGeckoApi(); 36 | this.coinGeckoApiService = coinGeckoApi.createService( 37 | CoinGeckoApiService.class, 38 | connectionTimeoutSeconds, 39 | readTimeoutSeconds, 40 | writeTimeoutSeconds 41 | ); 42 | } 43 | 44 | @Override 45 | public Ping ping(){ 46 | return coinGeckoApi.executeSync(coinGeckoApiService.ping()); 47 | } 48 | 49 | @Override 50 | public Map> getPrice(String ids, String vsCurrencies){ 51 | return getPrice(ids, vsCurrencies, false, false, false, false); 52 | } 53 | 54 | @Override 55 | public Map> getPrice(String ids, String vsCurrencies, boolean includeMarketCap, boolean include24hrVol, boolean include24hrChange, boolean includeLastUpdatedAt) { 56 | return coinGeckoApi.executeSync(coinGeckoApiService.getPrice(ids, vsCurrencies,includeMarketCap, include24hrVol, include24hrChange, includeLastUpdatedAt)); 57 | } 58 | 59 | @Override 60 | public Map> getTokenPrice(String id, String contractAddress, String vsCurrencies) { 61 | return getTokenPrice(id,contractAddress,vsCurrencies,false,false,false,false); 62 | } 63 | 64 | @Override 65 | public Map> getTokenPrice(String id, String contractAddress, String vsCurrencies, boolean includeMarketCap, boolean include24hrVol, boolean include24hrChange, boolean includeLastUpdatedAt) { 66 | return coinGeckoApi.executeSync(coinGeckoApiService.getTokenPrice(id,contractAddress,vsCurrencies,includeMarketCap,include24hrVol,include24hrChange,includeLastUpdatedAt)); 67 | } 68 | 69 | @Override 70 | public List getSupportedVsCurrencies(){ 71 | return coinGeckoApi.executeSync(coinGeckoApiService.getSupportedVsCurrencies()); 72 | } 73 | 74 | @Override 75 | public List getCoinList() { 76 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinList()); 77 | } 78 | 79 | @Override 80 | public List getCoinMarkets(String vsCurrency) { 81 | return getCoinMarkets(vsCurrency,null,null,null,null,false,null); 82 | } 83 | 84 | @Override 85 | public List getCoinMarkets(String vsCurrency, String ids, String order, Integer perPage, Integer page, boolean sparkline, String priceChangePercentage) { 86 | return getCoinMarkets(vsCurrency,ids,null,order,perPage,page,sparkline,priceChangePercentage); 87 | } 88 | 89 | @Override 90 | public List getCoinMarkets(String vsCurrency, String ids, String category, String order, Integer perPage, Integer page, boolean sparkline, String priceChangePercentage) { 91 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinMarkets(vsCurrency,ids,category,order,perPage,page,sparkline,priceChangePercentage)); 92 | } 93 | 94 | @Override 95 | public CoinFullData getCoinById(String id) { 96 | return getCoinById(id,true,true,true,true,true,false); 97 | } 98 | 99 | @Override 100 | public CoinFullData getCoinById(String id, boolean localization, boolean tickers, boolean marketData, boolean communityData, boolean developerData, boolean sparkline) { 101 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinById(id,localization,tickers,marketData,communityData,developerData,sparkline)); 102 | } 103 | 104 | @Override 105 | public CoinTickerById getCoinTickerById(String id) { 106 | return getCoinTickerById(id,null,null,null); 107 | } 108 | 109 | @Override 110 | public CoinTickerById getCoinTickerById(String id, String exchangeIds, Integer page, String order) { 111 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinTickerById(id,exchangeIds,page,order)); 112 | } 113 | 114 | @Override 115 | public CoinHistoryById getCoinHistoryById(String id, String date) { 116 | return getCoinHistoryById(id,date,true); 117 | } 118 | 119 | @Override 120 | public CoinHistoryById getCoinHistoryById(String id, String date, boolean localization) { 121 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinHistoryById(id,date,localization)); 122 | } 123 | 124 | @Override 125 | public MarketChart getCoinMarketChartById(String id, String vsCurrency, Integer days) { 126 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinMarketChartById(id,vsCurrency,days)); 127 | } 128 | 129 | @Override 130 | public MarketChart getCoinMarketChartById(String id, String vsCurrency, Integer days, String interval) { 131 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinMarketChartById(id, vsCurrency, days, interval)); 132 | } 133 | 134 | @Override 135 | public MarketChart getCoinMarketChartRangeById(String id, String vsCurrency, String from, String to) { 136 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinMarketChartRangeById(id,vsCurrency,from,to)); 137 | } 138 | 139 | @Override 140 | public List> getCoinOHLC(String id, String vsCurrency, Integer days) { 141 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinOHLC(id,vsCurrency,days)); 142 | } 143 | 144 | @Override 145 | public StatusUpdates getCoinStatusUpdateById(String id) { 146 | return getCoinStatusUpdateById(id,null,null); 147 | } 148 | 149 | @Override 150 | public StatusUpdates getCoinStatusUpdateById(String id, Integer perPage, Integer page) { 151 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinStatusUpdateById(id,perPage,page)); 152 | } 153 | 154 | @Override 155 | public CoinFullData getCoinInfoByContractAddress(String id, String contractAddress) { 156 | return coinGeckoApi.executeSync(coinGeckoApiService.getCoinInfoByContractAddress(id,contractAddress)); 157 | } 158 | 159 | @Override 160 | public List getAssetPlatforms(){ 161 | return coinGeckoApi.executeSync(coinGeckoApiService.getAssetPlatforms()); 162 | } 163 | 164 | @Override 165 | public List getExchanges() { 166 | return getExchanges(100, 0); 167 | } 168 | 169 | @Override 170 | public List getExchanges(int perPage, int page) { 171 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchanges(perPage, page)); 172 | } 173 | 174 | @Override 175 | public List getExchangesList() { 176 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangesList()); 177 | } 178 | 179 | @Override 180 | public ExchangeById getExchangesById(String id) { 181 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangesById(id)); 182 | } 183 | 184 | @Override 185 | public ExchangesTickersById getExchangesTickersById(String id) { 186 | return getExchangesTickersById(id,null,null,null); 187 | } 188 | 189 | @Override 190 | public ExchangesTickersById getExchangesTickersById(String id, String coinIds, Integer page, String order) { 191 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangesTickersById(id,coinIds,page,order)); 192 | } 193 | 194 | @Override 195 | public StatusUpdates getExchangesStatusUpdatesById(String id) { 196 | return getExchangesStatusUpdatesById(id,null,null); 197 | } 198 | 199 | @Override 200 | public StatusUpdates getExchangesStatusUpdatesById(String id, Integer perPage, Integer page) { 201 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangesStatusUpdatesById(id,perPage,page)); 202 | } 203 | 204 | @Override 205 | public List> getExchangesVolumeChart(String id, Integer days) { 206 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangesVolumeChart(id,days)); 207 | } 208 | 209 | @Deprecated 210 | @Override 211 | public StatusUpdates getStatusUpdates() { 212 | return coinGeckoApi.executeSync(coinGeckoApiService.getStatusUpdates()); 213 | } 214 | 215 | @Deprecated 216 | @Override 217 | public StatusUpdates getStatusUpdates(String category, String projectType, Integer perPage, Integer page) { 218 | return coinGeckoApi.executeSync(coinGeckoApiService.getStatusUpdates(category, projectType,perPage,page)); 219 | } 220 | 221 | @Deprecated 222 | @Override 223 | public Events getEvents() { 224 | return coinGeckoApi.executeSync(coinGeckoApiService.getEvents()); 225 | } 226 | 227 | @Deprecated 228 | @Override 229 | public Events getEvents(String countryCode, String type, Integer page, boolean upcomingEventsOnly, String fromDate, String toDate) { 230 | return coinGeckoApi.executeSync(coinGeckoApiService.getEvents(countryCode,type,page,upcomingEventsOnly,fromDate,toDate)); 231 | } 232 | 233 | @Deprecated 234 | @Override 235 | public EventCountries getEventsCountries() { 236 | return coinGeckoApi.executeSync(coinGeckoApiService.getEventsCountries()); 237 | } 238 | 239 | @Deprecated 240 | @Override 241 | public EventTypes getEventsTypes() { 242 | return coinGeckoApi.executeSync(coinGeckoApiService.getEventsTypes()); 243 | } 244 | 245 | @Override 246 | public ExchangeRates getExchangeRates() { 247 | return coinGeckoApi.executeSync(coinGeckoApiService.getExchangeRates()); 248 | } 249 | 250 | @Override 251 | public Trending getTrending(){ 252 | return coinGeckoApi.executeSync(coinGeckoApiService.getTrending()); 253 | } 254 | 255 | @Override 256 | public Search getSearchResult(String query) {return coinGeckoApi.executeSync(coinGeckoApiService.getSearch(query));} 257 | 258 | @Override 259 | public Global getGlobal() { 260 | return coinGeckoApi.executeSync(coinGeckoApiService.getGlobal()); 261 | } 262 | 263 | @Override 264 | public DecentralizedFinanceDefi getDecentralizedFinanceDefi(){ 265 | return coinGeckoApi.executeSync(coinGeckoApiService.getDecentralizedFinanceDefi()); 266 | } 267 | 268 | @Override 269 | public void shutdown() { 270 | coinGeckoApi.shutdown(); 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/AssetPlatformsExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 5 | 6 | public class AssetPlatformsExample{ 7 | 8 | public static void main(String[] args) { 9 | 10 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 11 | 12 | System.out.println(client.getAssetPlatforms()); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/CoinsExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.constant.Currency; 5 | import com.litesoftwares.coingecko.domain.Coins.CoinData.DeveloperData; 6 | import com.litesoftwares.coingecko.domain.Coins.CoinData.IcoData; 7 | import com.litesoftwares.coingecko.domain.Coins.CoinFullData; 8 | import com.litesoftwares.coingecko.domain.Coins.CoinList; 9 | import com.litesoftwares.coingecko.domain.Coins.CoinMarkets; 10 | import com.litesoftwares.coingecko.domain.Coins.CoinTickerById; 11 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 12 | 13 | import java.util.List; 14 | 15 | public class CoinsExample { 16 | public static void main(String[] args) { 17 | String OMGContract = "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"; 18 | String platform = "ethereum"; 19 | 20 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 21 | 22 | List coinList = client.getCoinList(); 23 | System.out.println(coinList); 24 | 25 | long totalCoins = coinList.size(); 26 | System.out.println(totalCoins); 27 | 28 | List coinMarkets = client.getCoinMarkets(Currency.USD); 29 | System.out.println(coinMarkets); 30 | 31 | CoinFullData bitcoinInfo = client.getCoinById("bitcoin"); 32 | System.out.println(bitcoinInfo); 33 | 34 | String genesisDate = bitcoinInfo.getGenesisDate(); 35 | System.out.println(genesisDate); 36 | 37 | DeveloperData bitcoinDevData = bitcoinInfo.getDeveloperData(); 38 | System.out.println(bitcoinDevData); 39 | 40 | long bitcoinGithubStars = bitcoinDevData.getStars(); 41 | System.out.println(bitcoinGithubStars); 42 | 43 | CoinTickerById bitcoinTicker = client.getCoinTickerById("bitcoin"); 44 | System.out.println(bitcoinTicker); 45 | 46 | CoinFullData omiseGoInfo = client.getCoinInfoByContractAddress(platform, OMGContract); 47 | System.out.println(omiseGoInfo); 48 | 49 | IcoData omiseGoIcoInfo = omiseGoInfo.getIcoData(); 50 | String icoStartDate = omiseGoIcoInfo.getIcoStartDate(); 51 | System.out.println(icoStartDate); 52 | 53 | List> coinOHLC = client.getCoinOHLC("bitcoin", "usd", 1); 54 | System.out.println(coinOHLC); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/DecentralizedFinanceDefiExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Global.DecentralizedFinanceDefi; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | public class DecentralizedFinanceDefiExample { 8 | 9 | public static void main(String[] args) { 10 | 11 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 12 | 13 | DecentralizedFinanceDefi defi = client.getDecentralizedFinanceDefi(); 14 | 15 | System.out.println(defi.getData()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/EventsExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Events.EventCountries; 5 | import com.litesoftwares.coingecko.domain.Events.EventTypes; 6 | import com.litesoftwares.coingecko.domain.Events.Events; 7 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 8 | 9 | public class EventsExample { 10 | public static void main(String[] args) { 11 | 12 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 13 | Events events = client.getEvents(); 14 | System.out.println(events); 15 | 16 | long eventCount = events.getCount(); 17 | System.out.println(eventCount); 18 | 19 | EventCountries eventCountries = client.getEventsCountries(); 20 | System.out.println(eventCountries); 21 | 22 | EventTypes eventsTypes = client.getEventsTypes(); 23 | System.out.println(eventsTypes); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/ExchangeRatesExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.ExchangeRates.ExchangeRates; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | public class ExchangeRatesExample { 8 | public static void main(String[] args) { 9 | 10 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 11 | 12 | ExchangeRates exchangeRates = client.getExchangeRates(); 13 | System.out.println(exchangeRates); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/ExchangesExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Exchanges.ExchangeById; 5 | import com.litesoftwares.coingecko.domain.Exchanges.Exchanges; 6 | import com.litesoftwares.coingecko.domain.Exchanges.ExchangesList; 7 | import com.litesoftwares.coingecko.domain.Exchanges.ExchangesTickersById; 8 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 9 | 10 | import java.math.BigDecimal; 11 | import java.util.List; 12 | 13 | public class ExchangesExample { 14 | public static void main(String[] args) { 15 | 16 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 17 | 18 | ExchangeById binance = client.getExchangesById("binance"); 19 | System.out.println(binance); 20 | 21 | String country = binance.getCountry(); 22 | System.out.println(country); 23 | 24 | long startYear = binance.getYearEstablished(); 25 | System.out.println(startYear); 26 | 27 | String websiteUrl = binance.getUrl(); 28 | System.out.println(websiteUrl); 29 | 30 | String logoUrl = binance.getImage(); 31 | System.out.println(logoUrl); 32 | 33 | BigDecimal tradeVolume = binance.getTradeVolume24hBtc(); 34 | System.out.println(tradeVolume); 35 | 36 | ExchangesTickersById binanceTickers = client.getExchangesTickersById("binance"); 37 | System.out.println(binanceTickers.getTickers()); 38 | 39 | List exchanges = client.getExchanges(); 40 | System.out.println(exchanges); 41 | 42 | List exchangesList = client.getExchangesList(); 43 | System.out.println(exchangesList); 44 | 45 | long totalExchanges = exchangesList.size(); 46 | System.out.println(totalExchanges); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/GlobalExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Global.Global; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | 8 | public class GlobalExample { 9 | public static void main(String[] args) { 10 | 11 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 12 | 13 | Global global = client.getGlobal(); 14 | 15 | System.out.println(global); 16 | 17 | long markets = global.getData().getMarkets(); 18 | System.out.println(markets); 19 | 20 | long activeCryptoCurrencies = global.getData().getActiveCryptocurrencies(); 21 | System.out.println(activeCryptoCurrencies); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/PingExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 5 | 6 | public class PingExample { 7 | public static void main(String[] args) { 8 | 9 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 10 | System.out.println(client.ping()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/SearchExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Search.Search; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | public class SearchExample { 8 | 9 | public static void main(String[] args) { 10 | 11 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 12 | 13 | String query = "bitcoin"; 14 | Search search = client.getSearchResult(query); 15 | 16 | System.out.println(search); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/SimpleExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.constant.Currency; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | import java.util.Map; 8 | 9 | public class SimpleExample { 10 | public static void main(String[] args) { 11 | 12 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 13 | 14 | Map> bitcoin = client.getPrice("bitcoin",Currency.USD); 15 | 16 | System.out.println(bitcoin); 17 | 18 | double bitcoinPrice = bitcoin.get("bitcoin").get(Currency.USD); 19 | 20 | System.out.println(bitcoinPrice); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/StatusUpdatesExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Status.StatusUpdates; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | public class StatusUpdatesExample { 8 | public static void main(String[] args) { 9 | 10 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 11 | 12 | StatusUpdates statusUpdates = client.getStatusUpdates(); 13 | System.out.println(statusUpdates); 14 | 15 | long totalStatusUpdates = statusUpdates.getUpdates().size(); 16 | System.out.println(totalStatusUpdates); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/litesoftwares/coingecko/examples/TrendingExample.java: -------------------------------------------------------------------------------- 1 | package com.litesoftwares.coingecko.examples; 2 | 3 | import com.litesoftwares.coingecko.CoinGeckoApiClient; 4 | import com.litesoftwares.coingecko.domain.Search.Trending; 5 | import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl; 6 | 7 | public class TrendingExample{ 8 | 9 | public static void main(String[] args) { 10 | 11 | CoinGeckoApiClient client = new CoinGeckoApiClientImpl(); 12 | 13 | Trending trending = client.getTrending(); 14 | System.out.println(trending.getCoins()); 15 | } 16 | 17 | } 18 | --------------------------------------------------------------------------------