This commit is contained in:
Erik C. Thauvin 2021-05-09 22:38:17 -07:00
parent 740e3a9d01
commit b4e37a5877
4 changed files with 9 additions and 4 deletions

View file

@ -32,7 +32,7 @@
package net.thauvin.erik.crypto
@Suppress("EmptySecondaryConstructor", "unused")
@Suppress("unused")
class CryptoException : Exception {
var statusCode = NO_STATUS

View file

@ -56,7 +56,7 @@ open class CryptoPrice(val base: String, val currency: String, val amount: Doubl
if (json.has("data")) {
with(json.getJSONObject("data")) {
return CryptoPrice(
getString("base"), getString("currency"), getString("amount").toDouble()
getString("base"), getString("currency"), getString("amount").toDouble()
)
}
} else {
@ -108,7 +108,7 @@ open class CryptoPrice(val base: String, val currency: String, val amount: Doubl
@JvmStatic
fun main(args: Array<String>) {
listOf("BTC", "BCH", "BSV", "ETH","ETH2","ETC").forEach {
listOf("BTC", "BCH", "BSV", "ETH", "ETH2", "ETC").forEach {
with(marketPrice(it)) {
println("$base: $amount")
}