CoinGecko Kotlin Save

Kotlin Multiplatform CoinGecko API client

Project README

CoinGecko Kotlin

Maven Central

Multiplatform Kotlin wrapper for the CoinGecko API using Ktor.

Usage

For a comprehensive list of available endpoints and to understand the returned data, see coingecko.com/en/api.

Kotlin

val coinGecko = CoinGeckoClient.create()

println(coinGecko.ping().geckoSays)
// Ping(geckoSays=(V3) To the Moon!)

println(coinGecko.getCoinById("ethereum"))
// CoinFullData(id=ethereum, symbol=eth, name=Ethereum, ...)

Swift

let coinGecko = CoinGeckoClientCompanion().create()
coinGecko.ping { (ping, error) in
    // ...
}

Download

Maven Central Sonatype Nexus (Snapshots)

repositories {
  mavenCentral()
  // Or snapshots
  maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
  implementation("org.drewcarlson:coingecko:$coingecko_version")
}

Note: it is required to specify a Ktor client engine implementation. (Documentation)

dependencies {
  // Jvm/Android
  implementation("io.ktor:ktor-client-okhttp:$ktor_version")
  implementation("io.ktor:ktor-client-android:$ktor_version")
  // iOS
  implementation("io.ktor:ktor-client-darwin:$ktor_version")
  // macOS/Windows/Linux
  implementation("io.ktor:ktor-client-curl:$ktor_version")
  // Javascript/NodeJS
  implementation("io.ktor:ktor-client-js:$ktor_version")
}

License

Copyright (c) 2020 Andrew Carlson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Open Source Agenda is not affiliated with "CoinGecko Kotlin" Project. README Source: DrewCarlson/CoinGecko-Kotlin
Stars
43
Open Issues
11
Last Commit
3 weeks ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating