Skip to content

Commit

Permalink
Added Core, Flare, Space ID, Near, OKB, Quant, Sologenic, Microvision…
Browse files Browse the repository at this point in the history
…Chain, Stargate Finance, and Sui coins.

Removed Bitglobal exchange.
Updated some coin logos.
Updated dependencies.
  • Loading branch information
hwki committed Nov 29, 2023
1 parent dafa655 commit 59f40a5
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 24 deletions.
8 changes: 4 additions & 4 deletions bitcoin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.brentpanther.bitcoinwidget"
minSdk 23
targetSdk 34
versionCode 322
versionName "8.4.3"
versionCode 323
versionName "8.4.4"

}

Expand Down Expand Up @@ -68,7 +68,7 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.work:work-runtime-ktx:2.8.1'
implementation 'androidx.work:work-runtime:2.9.0'
implementation 'androidx.activity:activity-ktx:1.8.1'
implementation 'androidx.activity:activity-compose:1.8.1'
implementation "androidx.compose.ui:ui"
Expand All @@ -83,7 +83,7 @@ dependencies {
testImplementation 'com.jayway.jsonpath:json-path:2.8.0'
debugImplementation "androidx.compose.ui:ui-tooling"

def room_version = '2.6.0'
def room_version = '2.6.1'

ksp "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-runtime:$room_version"
Expand Down
16 changes: 12 additions & 4 deletions bitcoin/src/main/java/com/brentpanther/bitcoinwidget/Coin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,23 @@ enum class Coin(val coinName: String, val coinGeckoId: String, private vararg va
CEL("Celsius", "celsius-degree-token", IconTheme(SOLID, ic_cel)),
CHZ("Chiliz", "chiliz",IconTheme(SOLID, ic_chz)),
COMP("Compound", "compound-coin", IconTheme(SOLID, ic_comp_black, ic_comp_white)),
CORE("Core", "coredaoorg", IconTheme(SOLID, ic_core)),
CRO("Crypto.com Coin", "crypto-com-chain", IconTheme(SOLID, ic_cro, ic_cro_white)),
CRV("Curve DAO Token", "curve-dao-token", IconTheme(SOLID, ic_crv)),
CUBE("Somnium Space CUBEs", "somnium-space-cubes", IconTheme(SOLID, ic_cube_black, ic_cube_white)),
DAI("Dai", "dai", IconTheme(SOLID, ic_dai_color)),
DASH("Dash", "dash", IconTheme(SOLID, ic_dash, ic_dash_dark)),
DCR("Decred", "decred", IconTheme(SOLID, ic_dcr)),
DOGE("Dogecoin", "dogecoin", IconTheme(SOLID, ic_doge)),
DOT("Polkadot", "polkadot", IconTheme(SOLID, ic_dot_black, ic_dot_white)),
DOT("Polkadot", "polkadot", IconTheme(SOLID, ic_dot)),
EGLD("Elrond", "elrond-erd-2", IconTheme(SOLID, ic_egld_dark, ic_egld_white)),
ENJ("Enjin Coin", "enjincoin", IconTheme(SOLID, ic_enj)),
EOS("EOS", "eos", IconTheme(SOLID, ic_eos_black, ic_eos_white), IconTheme(TRANSPARENT, ic_eos_white)),
ETC("Ethereum Classic", "ethereum-classic", IconTheme(SOLID, ic_etc)),
ETH("Ethereum", "ethereum", IconTheme(SOLID, ic_eth)),
FIL("Filecoin", "filecoin", IconTheme(SOLID, ic_fil)),
FIRO("Firo", "zcoin", IconTheme(SOLID, ic_firo, ic_firo_dark)),
FLR("Flare", "flare-networks", IconTheme(SOLID, ic_flr)),
FTM("Fantom", "fantom", IconTheme(SOLID, ic_ftm)),
FTT("FTX Token", "ftx-token", IconTheme(SOLID, ic_ftt)),
GALA("Gala", "gala", IconTheme(SOLID, ic_gala, ic_gala_white)),
Expand All @@ -69,9 +71,10 @@ enum class Coin(val coinName: String, val coinGeckoId: String, private vararg va
HNS("Handshake", "handshake", IconTheme(SOLID, ic_hns, ic_hns_dark)),
HT("Huobi Token", "huobi-token", IconTheme(SOLID, ic_ht)),
ICX("Icon", "icon", IconTheme(SOLID, ic_icx)),
ID("Space ID", "space-id", IconTheme(SOLID, ic_id)),
IMX("Immutable", "immutable-x", IconTheme(SOLID, ic_imx)),
IOTA("Iota", "iota", IconTheme(SOLID, ic_iota, ic_iota_white)),
KASPA("Kaspa", "kaspa", IconTheme(SOLID, ic_kas_color)),
KAS("Kaspa", "kaspa", IconTheme(SOLID, ic_kas_color)),
KAVA("Kava", "kava", IconTheme(SOLID, ic_kava)),
KMD("Komodo", "komodo", IconTheme(SOLID, ic_kmd)),
KNC("Kyber Network", "kyber-network", IconTheme(SOLID, ic_knc_color)),
Expand All @@ -94,18 +97,19 @@ enum class Coin(val coinName: String, val coinGeckoId: String, private vararg va
MKR("Maker", "maker", IconTheme(SOLID, ic_mkr)),
MLN("Melon", "melon", IconTheme(SOLID, ic_mln)),
NANO("Nano", "nano", IconTheme(SOLID, ic_nano)),
NEAR("Near", "near", IconTheme(SOLID, ic_near_black, ic_near_white)),
NEAR("Near", "near", IconTheme(SOLID, ic_near)),
NEO("NEO", "neo", IconTheme(SOLID, ic_neo)),
NEXO("NEXO", "nexo", IconTheme(SOLID, ic_nexo)),
NRG("Energi", "energi", IconTheme(SOLID, ic_nrg)),
OKB("OKB", "okb", IconTheme(SOLID, ic_okb)),
OKB("OKB", "okb", IconTheme(SOLID, ic_okb_black, ic_okb_white)),
OMG("OMG", "omisego", IconTheme(SOLID, ic_omg)),
ONT("Ontology", "ontology", IconTheme(SOLID, ic_ont)),
OP("Optimism", "optimism", IconTheme(SOLID, ic_op)),
PAX("Paxos Standard", "paxos-standard", IconTheme(SOLID, ic_pax)),
PAXG("PAX Gold", "pax-gold", IconTheme(SOLID, ic_paxg_color)),
POWR("Power Ledger", "power-ledger", IconTheme(SOLID, ic_powr_color)),
PPC("Peercoin", "peercoin", IconTheme(SOLID, ic_ppc)),
QNT("Quant", "quant-network", IconTheme(SOLID, ic_qnt)),
QTUM("Qtum", "qtum", IconTheme(SOLID, ic_qtum)),
RDD("Reddcoin", "reddcoin", IconTheme(SOLID, ic_rdd)),
REN("REN", "republic-protocol", IconTheme(SOLID, ic_ren)),
Expand All @@ -117,7 +121,11 @@ enum class Coin(val coinName: String, val coinGeckoId: String, private vararg va
SHIB("Shiba Inu", "shiba-inu", IconTheme(SOLID, ic_shib)),
SNX("Synthetix Network Token", "havven", IconTheme(SOLID, ic_snx)),
SOL("Solana", "solana", IconTheme(SOLID, ic_sol)),
SOLO("Sologenic", "solo-coin", IconTheme(SOLID, ic_solo)),
SPACE("MicrovisionChain", "microvisionchain", IconTheme(SOLID, ic_space)),
STG("Stargate Finance", "stargate-finance", IconTheme(SOLID, ic_stg)),
STORJ("Storj", "storj", IconTheme(SOLID, ic_storj)),
SUI("Sui", "sui", IconTheme(SOLID, ic_sui)),
SUSHI("Sushi", "sushi", IconTheme(SOLID, ic_sushi)),
THETA("Theta Network", "theta-token", IconTheme(SOLID, ic_theta)),
TRX("Tron", "tron", IconTheme(SOLID, ic_trx)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ object DataMigration {
migrateBitBayToZonda(db)
migrateOkexToOkx(db)
migrateBithumbProToBitGlobal(db)
migrateKaspaToKas(db)
fixRemovedExchanges(db)
}

private fun migrateKaspaToKas(db: SupportSQLiteDatabase) {
db.execSQL("UPDATE Widget SET coin = 'KAS' WHERE coin = 'KASPA'")
}

private fun migrateBithumbProToBitGlobal(db: SupportSQLiteDatabase) {
db.execSQL("UPDATE Widget SET exchange = 'BITGLOBAL' WHERE exchange = 'BITHUMB_PRO'")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
return getJsonObject(url)["ltp"].asString
}
},
BITGLOBAL("BitGlobal") {

override fun getValue(coin: String, currency: String): String? {
val url = "https://global-openapi.bithumb.pro/openapi/v1/spot/ticker?symbol=$coin-$currency"
return getJsonObject(url)["data"]?.jsonArray?.get(0)?.jsonObject?.get("c")?.asString
}
},
BITHUMB("Bithumb") {

override fun getValue(coin: String, currency: String): String? {
Expand Down
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_core.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed bitcoin/src/main/res/drawable-nodpi/ic_dot_black.png
Binary file not shown.
Binary file removed bitcoin/src/main/res/drawable-nodpi/ic_dot_white.png
Binary file not shown.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_flr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_near.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file removed bitcoin/src/main/res/drawable-nodpi/ic_okb.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_okb_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_qnt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_solo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_stg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_sui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bitcoin/src/main/res/raw/cryptowidgetcoins_v2.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 @@ -94,7 +94,7 @@
<item>ISO</item>
<item>NONE</item>
</string-array>
<string name="json_last_modified" translatable="false">Sat, 18 Nov 2023 17:12:07 GMT</string>
<string name="json_last_modified" translatable="false">Wed, 29 Nov 2023 23:27:06 GMT</string>
<string name="json_url" translatable="false">https://www.brentpanther.com/cryptowidgetcoins_v2.json</string>

<string name="error_restricted_battery_saver">Unable to refresh, Battery Saver is on</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ExchangeTest {
return ClassLoader.getSystemResourceAsStream("raw/cryptowidgetcoins_v2.json")
}

private val nonUSExchanges = setOf(Exchange.BYBIT, Exchange.BITGLOBAL, Exchange.BINANCE)
private val nonUSExchanges = setOf(Exchange.BYBIT, Exchange.BINANCE)

private fun exchangeCanLoadValues(excluded: Collection<Exchange>) {
val coins = EnumSet.allOf(Coin::class.java).sorted()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GenerateSupportedCoinsJson {
private val allExchanges =
listOf(this::ascendex, this::bibox, this::bigone, this::binance, this::binance_us, this::bingx, this::bit2c,
this::bitbank, this::bitclude, this::bitcoinde, this::bitfinex, this::bitflyer,
this::bitglobal, this::bithumb, this::bitmart, this::bitpanda, this::bitpay, this::bitso, this::bitstamp,
this::bithumb, this::bitmart, this::bitpanda, this::bitpay, this::bitso, this::bitstamp,
this::bittrex, this::bitrue, this::bitvavo, this::btcbox, this::btcmarkets, this::btcturk,
this::bybit, this::cexio, this::chilebit, this::coinbase, this::coinbasepro, this::coindesk, this::coingecko,
this::coinjar, this::coinmate, this::coinone, this::coinsbit, this::coinsph, this::cointree,
Expand All @@ -54,7 +54,7 @@ class GenerateSupportedCoinsJson {
}

// these exchanges do not allow API requests from the united states
private val nonUSExchanges = listOf(Exchange.BYBIT, Exchange.BITGLOBAL, Exchange.BINANCE)
private val nonUSExchanges = listOf(Exchange.BYBIT, Exchange.BINANCE)

@Test
fun generateAll() = generate(allExchanges)
Expand Down Expand Up @@ -326,10 +326,6 @@ class GenerateSupportedCoinsJson {
return parseKeys("https://api.bithumb.com/public/ticker/ALL", "$.data").map { "${it}_KRW" }
}

private fun bitglobal() : List<String> {
return parse("https://global-openapi.bithumb.pro/openapi/v1/spot/ticker?symbol=ALL", "$.data[*].s")
}

private fun bitmart(): List<String> {
return parse("https://api-cloud.bitmart.com/spot/v1/symbols", "$.data.symbols.[*]")
}
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/323.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added Core, Flare, Space ID, Near, OKB, Quant, Sologenic, MicrovisionChain, Stargate Finance, and Sui coins.
Removed Bitglobal exchange.
Updated some coin logos.

0 comments on commit 59f40a5

Please sign in to comment.