Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	bitcoin/src/main/res/raw/cryptowidgetcoins.json
  • Loading branch information
hwki committed Oct 4, 2021
2 parents 9ed6e80 + 3047572 commit 8b2ea85
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum class Coin(val coinName: String, vararg val themes: IconTheme) : Parcelable
}
},
BNB("Binance Coin", IconTheme(SOLID, ic_bnb)),
BEST("Bitpanda Ecosystem Token", IconTheme(SOLID, ic_best)),
BNT("Bancor Network Token", IconTheme(SOLID, ic_bnt)),
BSV("Bitcoin SV", IconTheme(SOLID, ic_bsv, ic_bsv_dark)),
BTC("Bitcoin", IconTheme(SOLID, ic_btc, ic_btc_dark)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
return getJsonArray(url).get(0).asJsonObject.get("lastPrice").asString
}
},
BITPANDA("Bitpanda") {

override fun getValue(coin: String, currency: String): String {
val url = "https://api.bitpanda.com/v1/ticker"
return getJsonObject(url).get(coin).asJsonObject.get(currency).asString
}
},
BITPAY("BitPay") {

override fun getValue(coin: String, currency: String): String? {
Expand Down Expand Up @@ -286,6 +293,7 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
"BAND" to "band-protocol",
"BAT" to "basic-attention-token",
"BCD" to "bitcoin-diamond",
"BEST" to "bitpanda-ecosystem-token",
"BCH" to "bitcoin-cash",
"BNB" to "binancecoin",
"BNT" to "bancor",
Expand Down
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_best.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.brentpanther.bitcoinwidget

import com.brentpanther.bitcoinwidget.exchange.Exchange
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.jayway.jsonpath.JsonPath
import okhttp3.OkHttpClient
import okhttp3.Request
Expand All @@ -26,7 +27,7 @@ class GenerateSupportedCoinsJson {
listOf(this::abucoins, this::ascendex, this::bibox, this::bigone, this::binance, this::binance_us, this::bit2c,
this::bitbank, this::bitbay, this::bitcambio, this::bitclude,
this::bitcoinde, this::bitfinex, this::bitflyer, this::bithumb, this::bithumbpro, this::bitmex,
this::bitpay, this::bitso, this::bitstamp, this::bittrex, this::bitvavo, this::bleutrade,
this::bitpanda, this::bitpay, this::bitso, this::bitstamp, this::bittrex, this::bitvavo, this::bleutrade,
this::btcbox, this::btcmarkets, this::btcturk, this::bybit, this::cexio,
this::chilebit, this::coinbase, this::coinbasepro, this::coinbene, this::coindesk, this::coingecko,
this::coinjar, this::coinmate, this::coinone, this::coinsbit, this::coinsph, this::cointree,
Expand Down Expand Up @@ -266,6 +267,16 @@ class GenerateSupportedCoinsJson {
return parse("https://www.bitmex.com/api/v1/instrument/active", "$.[*].symbol")
}

private fun bitpanda(): List<String> {
val pairs = mutableListOf<String>()
Gson().fromJson(get("https://api.bitpanda.com/v1/ticker"), JsonObject::class.java).entrySet().forEach { (coin, currencies) ->
currencies.asJsonObject.keySet().forEach{
pairs.add("${coin}_${it}")
}
}
return pairs
}

private fun bitpay(): List<String> {
return parse("https://bitpay.com/currencies", "$.data[*].code").map {
"BTC_$it"
Expand Down

0 comments on commit 8b2ea85

Please sign in to comment.