Last active
January 9, 2019 21:33
-
-
Save zzuummaa/1026a2584e6d755757d26889bbece917 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun trades(currency: String, timestamp: Long = -1L, limit_trades: Int = 0) : FundingBook { | |
val param1 = if (timestamp != -1L) "timestamp=$timestamp" else null | |
val param2 = if (limit_trades != 0) "limit_trades=$limit_trades" else null | |
val params : String | |
if (param1 == null) | |
if (param2 == null) | |
params = "" | |
else | |
params = "?$param2" | |
else | |
if (param2 == null) | |
params = "?$param1" | |
else | |
params = "?$param1&$param2" | |
val response = get("$url/v1/trades/$currency$params") | |
return objMapper.readValue(response.text, FundingBook::class.java) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment