Skip to content

Commit

Permalink
Added Bitrue exchange.
Browse files Browse the repository at this point in the history
Updated Bithumb Pro to Bitglobal.
Refreshed coin list.
  • Loading branch information
hwki committed Nov 6, 2021
1 parent 73b9e5d commit 763238c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
14 changes: 7 additions & 7 deletions bitcoin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.brentpanther.bitcoinwidget"
minSdk 23
targetSdk 31
versionCode 284
versionName "8.1.4"
versionCode 285
versionName "8.1.5"

javaCompileOptions {
annotationProcessorOptions {
Expand Down Expand Up @@ -65,20 +65,20 @@ android {
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.core:core-ktx:1.6.0"
implementation "androidx.core:core-ktx:1.7.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-rc01'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.fragment:fragment-ktx:1.3.6'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.work:work-runtime-ktx:2.7.0-rc01'
implementation 'androidx.work:work-runtime-ktx:2.7.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.jayway.jsonpath:json-path:2.6.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
return ((buy + sell) / 2).toString()
}
},
BITHUMB_PRO("Bithumb Pro") {
BITHUMB_PRO("Bitglobal") {

override fun getValue(coin: String, currency: String): String? {
val url = "https://global-openapi.bithumb.pro/openapi/v1/spot/ticker?symbol=$coin-$currency"
Expand Down Expand Up @@ -185,6 +185,12 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
return getJsonObject(url).get("lastTradeRate").asString
}
},
BITRUE("Bitrue") {
override fun getValue(coin: String, currency: String): String? {
val url = "https://openapi.bitrue.com/api/v1/ticker/price?symbol=$coin$currency"
return getJsonObject(url).get("price").asString
}
},
BITVAVO ("Bitvavo") {

override fun getValue(coin: String, currency: String): String? {
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/main/res/raw/cryptowidgetcoins.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bitcoin/src/main/res/raw/othercoins.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bitcoin/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<item>ISO</item>
<item>NONE</item>
</string-array>
<string name="json_last_modified" translatable="false">Sat, 16 Oct 2021 02:02:08 GMT</string>
<string name="json_last_modified" translatable="false">Sat, 06 Nov 2021 15:27:56 GMT</string>
<string name="json_url" translatable="false">https://www.brentpanther.com/cryptowidgetcoins.json</string>

<string name="settings_updating_data">Updating coin data…</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,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::bitpanda, this::bitpay, this::bitso, this::bitstamp, this::bittrex, this::bitvavo, this::bleutrade,
this::bitpanda, this::bitpay, this::bitso, this::bitstamp, this::bittrex, this::bitrue, 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 @@ -295,6 +295,10 @@ class GenerateSupportedCoinsJson {
return parse("https://api.bittrex.com/v3/markets", "$[*].symbol")
}

private fun bitrue(): List<String> {
return parse("https://openapi.bitrue.com/api/v1/exchangeInfo", "$.symbols[*].symbol")
}

private fun bitvavo(): List<String> {
return parse("https://api.bitvavo.com/v2/markets", "$[*].market")
}
Expand Down

0 comments on commit 763238c

Please sign in to comment.