-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added all the requests available on coinLore
- Loading branch information
Showing
23 changed files
with
358 additions
and
81 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
app/coinLoreAPI/src/main/java/com/example/coinloreapi/api/CoinLoreAPI.kt
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
app/coinLoreAPI/src/main/java/com/example/coinloreapi/api/CoinLoreAPIRequests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.example.coinloreapi.api | ||
|
||
import com.example.coinloreapi.models.* | ||
import retrofit2.Response | ||
import retrofit2.http.GET | ||
import retrofit2.http.Query | ||
|
||
|
||
interface CoinLoreAPIRequests { | ||
|
||
@GET("api/global/") | ||
suspend fun getGlobalCoinData(): Response<GlobalCoinResponse> | ||
|
||
@GET("api/tickers/") | ||
suspend fun getCoinsTickers( | ||
@Query("start") start: Long? = null, | ||
@Query("limit") limit: Long? = null, | ||
): Response<CoinsTickersResponse> | ||
|
||
@GET("api/ticker/") | ||
suspend fun getCoinTicker( | ||
@Query("id") id: Int | ||
): Response<CoinTickerResponse> | ||
|
||
@GET("api/coin/markets") | ||
suspend fun getCoinMarkets( | ||
@Query("id") id: Int | ||
): Response<CoinMarketsResponse> | ||
|
||
@GET("api/exchanges/") | ||
suspend fun getAllExchanges():Response<HashMap<String, ExchangesItems>> | ||
|
||
@GET("api/exchange/") | ||
suspend fun getExchange( | ||
@Query("id") id:Int | ||
):Response<ExchangeItemResponse> | ||
|
||
@GET("api/coin/social_stats/") | ||
suspend fun getCoinSocialMedia( | ||
@Query("id") id:Int | ||
):Response<CoinSocialMediaResponse> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
app/coinLoreAPI/src/main/java/com/example/coinloreapi/di/RepositoryModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package com.example.coinloreapi.di | ||
|
||
import com.example.coinloreapi.repository.GlobalCoinRepository | ||
import com.example.coinloreapi.repository.CoinLoreApi | ||
import org.koin.dsl.module | ||
|
||
val repositoryModule = module { | ||
single { provideGlobalCoinRepository() } | ||
} | ||
|
||
fun provideGlobalCoinRepository():GlobalCoinRepository{ | ||
return GlobalCoinRepository() | ||
fun provideGlobalCoinRepository():CoinLoreApi{ | ||
return CoinLoreApi() | ||
} |
6 changes: 6 additions & 0 deletions
6
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinMarketsResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
class CoinMarketsResponse : ArrayList<CoinMarketsResponseItem>() |
23 changes: 23 additions & 0 deletions
23
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinMarketsResponseItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class CoinMarketsResponseItem( | ||
@SerializedName("base") | ||
val base: String, | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("price") | ||
val price: Double, | ||
@SerializedName("price_usd") | ||
val priceUsd: Double, | ||
@SerializedName("quote") | ||
val quote: String, | ||
@SerializedName("time") | ||
val time: Int, | ||
@SerializedName("volume") | ||
val volume: Double, | ||
@SerializedName("volume_usd") | ||
val volumeUsd: Double | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinSocialMediaResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class CoinSocialMediaResponse( | ||
@SerializedName("reddit") | ||
var reddit: Reddit? = null, | ||
@SerializedName("twitter") | ||
var twitter: Twitter? = null | ||
) |
4 changes: 4 additions & 0 deletions
4
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinTickerResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
class CoinTickerResponse : ArrayList<CoinTickerResponseItem>() |
39 changes: 39 additions & 0 deletions
39
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinTickerResponseItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class CoinTickerResponseItem( | ||
@SerializedName("csupply") | ||
val csupply: String, | ||
@SerializedName("id") | ||
val id: String, | ||
@SerializedName("market_cap_usd") | ||
val marketCapUsd: String, | ||
@SerializedName("msupply") | ||
val msupply: String, | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("nameid") | ||
val nameid: String, | ||
@SerializedName("percent_change_1h") | ||
val percentChange1h: String, | ||
@SerializedName("percent_change_24h") | ||
val percentChange24h: String, | ||
@SerializedName("percent_change_7d") | ||
val percentChange7d: String, | ||
@SerializedName("price_btc") | ||
val priceBtc: String, | ||
@SerializedName("price_usd") | ||
val priceUsd: String, | ||
@SerializedName("rank") | ||
val rank: Int, | ||
@SerializedName("symbol") | ||
val symbol: String, | ||
@SerializedName("tsupply") | ||
val tsupply: String, | ||
@SerializedName("volume24") | ||
val volume24: String, | ||
@SerializedName("volume24_native") | ||
val volume24Native: String | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/CoinsTickersResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class CoinsTickersResponse( | ||
@SerializedName("data") | ||
val data: List<Data>, | ||
@SerializedName("info") | ||
val info: Info | ||
) |
39 changes: 39 additions & 0 deletions
39
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/Data.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Data( | ||
@SerializedName("csupply") | ||
val csupply: String, | ||
@SerializedName("id") | ||
val id: String, | ||
@SerializedName("market_cap_usd") | ||
val marketCapUsd: String, | ||
@SerializedName("msupply") | ||
val msupply: String, | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("nameid") | ||
val nameid: String, | ||
@SerializedName("percent_change_1h") | ||
val percentChange1h: String, | ||
@SerializedName("percent_change_24h") | ||
val percentChange24h: String, | ||
@SerializedName("percent_change_7d") | ||
val percentChange7d: String, | ||
@SerializedName("price_btc") | ||
val priceBtc: String, | ||
@SerializedName("price_usd") | ||
val priceUsd: String, | ||
@SerializedName("rank") | ||
val rank: Int, | ||
@SerializedName("symbol") | ||
val symbol: String, | ||
@SerializedName("tsupply") | ||
val tsupply: String, | ||
@SerializedName("volume24") | ||
val volume24: Double, | ||
@SerializedName("volume24a") | ||
val volume24a: Double | ||
) |
13 changes: 13 additions & 0 deletions
13
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/ExchangeItemDetail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ExchangeItemDetail( | ||
@SerializedName("date_live") | ||
var dateLive: String? = null, | ||
@SerializedName("name") | ||
var name: String? = null, | ||
@SerializedName("url") | ||
var url: String? = null | ||
) |
7 changes: 7 additions & 0 deletions
7
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/ExchangeItemDetails.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.coinloreapi.models | ||
|
||
data class ExchangeItemDetails( | ||
var date_live: String? = null, | ||
var name: String? = null, | ||
var url: String? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/ExchangeItemResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ExchangeItemResponse( | ||
@SerializedName("pairs") | ||
var pairs: List<Pairs>? = null, | ||
@SerializedName("0") | ||
var exchangeItemDetail: ExchangeItemDetail? = null | ||
) |
39 changes: 39 additions & 0 deletions
39
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/ExchangesItems.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.coinloreapi.models | ||
|
||
data class ExchangesItems( | ||
var `0`: String? = null, | ||
var `1`: String? = null, | ||
var `10`: Any? = null, | ||
var `11`: Any? = null, | ||
var `12`: Any? = null, | ||
var `13`: String? = null, | ||
var `14`: Any? = null, | ||
var `2`: String? = null, | ||
var `3`: String? = null, | ||
var `4`: String? = null, | ||
var `5`: String? = null, | ||
var `6`: String? = null, | ||
var `7`: String? = null, | ||
var `8`: String? = null, | ||
var `9`: String? = null, | ||
var alexa: Any? = null, | ||
var auto: String? = null, | ||
var centralized: Any? = null, | ||
var country: String? = null, | ||
var date_added: String? = null, | ||
var date_live: String? = null, | ||
var dex: Any? = null, | ||
var f: String? = null, | ||
var fiat: String? = null, | ||
var id: String? = null, | ||
var mining: Any? = null, | ||
var name: String? = null, | ||
var name_id: String? = null, | ||
var pairs: Int? = null, | ||
var tr: Int? = null, | ||
var udate: String? = null, | ||
var url: String? = null, | ||
var usdt: String? = null, | ||
var volume_usd: Double? = null, | ||
var volume_usd_adj: Double? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/Info.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Info( | ||
@SerializedName("coins_num") | ||
val coinsNum: Double, | ||
@SerializedName("time") | ||
val time: Double | ||
) |
19 changes: 19 additions & 0 deletions
19
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/Pairs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Pairs( | ||
@SerializedName("base") | ||
var base: String? = null, | ||
@SerializedName("price") | ||
var price: Double? = null, | ||
@SerializedName("price_usd") | ||
var priceUsd: Double? = null, | ||
@SerializedName("quote") | ||
var quote: Any? = null, | ||
@SerializedName("time") | ||
var time: Int? = null, | ||
@SerializedName("volume") | ||
var volume: Double? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/Reddit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Reddit( | ||
@SerializedName("avg_active_users") | ||
var avgActiveUsers: Double? = null, | ||
@SerializedName("subscribers") | ||
var subscribers: Int? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
app/coinLoreAPI/src/main/java/com/example/coinloreapi/models/Twitter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.coinloreapi.models | ||
|
||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Twitter( | ||
@SerializedName("followers_count") | ||
var followersCount: Int? = null, | ||
@SerializedName("status_count") | ||
var statusCount: Int? = null | ||
) |
Oops, something went wrong.