From b547a4d07d29980a13068b42442b90dba02ac7f7 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 May 2021 11:04:15 -0700 Subject: [PATCH] Updated examples, dependencies and some cleanup. --- README.md | 24 +++++++++---------- build.gradle.kts | 2 +- examples/build.gradle.kts | 2 +- .../java/com/example/CryptoPriceSample.java | 8 +++---- .../kotlin/com/example/CryptoPriceExample.kt | 10 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 5af3cc0..0960cc8 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,18 @@ println(eth.amount) ``` - View [Kotlin](https://github.com/ethauvin/cryptoprice/blob/master/examples/src/main/kotlin/com/example/CryptoPriceExample.kt) or [Java](https://github.com/ethauvin/cryptoprice/blob/master/examples/src/main/java/com/example/CryptoPriceSample.java) Examples. +### Gradle, Maven, etc. + +To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/cryptoprice/blob/master/examples/build.gradle.kts) file: + +```gradle +dependencies { + implementation("net.thauvin.erik:cryptoprice:0.9.0") +} +``` + +Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/artifact/net.thauvin.erik/cryptoprice/0.9.0/jar). + ### Spot Price The `spotPrice` function defines the following parameters: @@ -109,15 +121,3 @@ will return something like: ``` See the [examples](https://github.com/ethauvin/cryptoprice/blob/master/examples/) for more details. - -### Gradle, Maven, etc. - -To use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/cryptoprice/blob/master/examples/build.gradle.kts) file: - -```gradle -dependencies { - implementation("net.thauvin.erik:cryptoprice:0.9.0") -} -``` - -Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/artifact/net.thauvin.erik/cryptoprice/0.9.0/jar). diff --git a/build.gradle.kts b/build.gradle.kts index 5f6febb..6518a33 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { - id("com.github.ben-manes.versions") version "0.38.0" + id("com.github.ben-manes.versions") version "0.39.0" id("io.gitlab.arturbosch.detekt") version "1.17.1" id("org.jetbrains.dokka") version "1.4.32" id("org.sonarqube") version "3.2.0" diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index cc01279..942d074 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") version "1.5.10" - id("com.github.ben-manes.versions") version "0.38.0" + id("com.github.ben-manes.versions") version "0.39.0" application } diff --git a/examples/src/main/java/com/example/CryptoPriceSample.java b/examples/src/main/java/com/example/CryptoPriceSample.java index 1632b27..d5c6f89 100644 --- a/examples/src/main/java/com/example/CryptoPriceSample.java +++ b/examples/src/main/java/com/example/CryptoPriceSample.java @@ -14,16 +14,16 @@ public class CryptoPriceSample { final CryptoPrice price = CryptoPrice.spotPrice("BTC"); System.out.println("The current Bitcoin price is " + price.toCurrency()); - // Get current Bitcoin spot price in Euros. - final CryptoPrice euroPrice = CryptoPrice.spotPrice("BTC", "EUR"); - System.out.println("The current Bitcoin price is " + euroPrice.toCurrency()); - System.out.println(); // Get current Ethereum spot price in Pound sterling. final CryptoPrice gbpPrice = CryptoPrice.spotPrice("ETH", "GBP"); System.out.println("The current Ethereum price is " + gbpPrice.toCurrency()); + // Get current Litecoin spot price in Euros. + final CryptoPrice euroPrice = CryptoPrice.spotPrice("LTC", "EUR"); + System.out.println("The current Litecoin price is " + euroPrice.toCurrency()); + System.out.println(); // Get current Bitcoin buy price using API. diff --git a/examples/src/main/kotlin/com/example/CryptoPriceExample.kt b/examples/src/main/kotlin/com/example/CryptoPriceExample.kt index 0fdda95..b57f7f5 100644 --- a/examples/src/main/kotlin/com/example/CryptoPriceExample.kt +++ b/examples/src/main/kotlin/com/example/CryptoPriceExample.kt @@ -9,16 +9,16 @@ fun main(@Suppress("UNUSED_PARAMETER") args: Array) { val price = spotPrice("BTC") println("The current Bitcoin price is ${price.toCurrency()}") - // Get current Bitcoin spot price in Euro. - val euroPrice = spotPrice("BTC", "EUR") - println("The current Bitcoin price is ${euroPrice.toCurrency()}") - println() - + // Get current Ethereum spot price in Pound sterling. val gbpPrice = spotPrice("ETH", "GBP") println("The current Ehtereum price is ${gbpPrice.toCurrency()}") + // Get current Litecoin spot price in Euro. + val euroPrice = spotPrice("LTC", "EUR") + println("The current Litecoin price is ${euroPrice.toCurrency()}") + println() // Get current Bitcoin buy price using API.