```class CurrentPriceApi @Inject constructor(priva...
# android
j
Copy code
class CurrentPriceApi @Inject constructor(private val cryptoCompareService: CryptoCompareService) {

    fun getCurrentPrices(currency: CurrencyType, others: List<CurrencyType>): Single<CryptoCompareCurrentPrices> {
        return cryptoCompareService.getCurrentPrices()
    }

}

class CryptoCompareCurrentPrices(val json: Map<CurrencyType, Double>)

class CCAdapter {
    @FromJson
    fun fromJson(json: Map<String, Double>): CryptoCompareCurrentPrices {
        return CryptoCompareCurrentPrices(json.mapKeys { CurrencyType.valueOf(it.key) })
    }
}