mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-22 13:47:58 +00:00
Initial commit: Pezkuwi Wallet Android
Complete rebrand of Nova Wallet for Pezkuwichain ecosystem. ## Features - Full Pezkuwichain support (HEZ & PEZ tokens) - Polkadot ecosystem compatibility - Staking, Governance, DeFi, NFTs - XCM cross-chain transfers - Hardware wallet support (Ledger, Polkadot Vault) - WalletConnect v2 - Push notifications ## Languages - English, Turkish, Kurmanci (Kurdish), Spanish, French, German, Russian, Japanese, Chinese, Korean, Portuguese, Vietnamese Based on Nova Wallet by Novasama Technologies GmbH © Dijital Kurdistan Tech Institute 2026
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package io.novafoundation.nova.feature_currency_api.di
|
||||
|
||||
import io.novafoundation.nova.feature_currency_api.domain.CurrencyInteractor
|
||||
import io.novafoundation.nova.feature_currency_api.domain.interfaces.CurrencyRepository
|
||||
|
||||
interface CurrencyFeatureApi {
|
||||
|
||||
fun currencyInteractor(): CurrencyInteractor
|
||||
|
||||
fun currencyRepository(): CurrencyRepository
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package io.novafoundation.nova.feature_currency_api.domain
|
||||
|
||||
enum class CurrencyCategory {
|
||||
FIAT, FIAT_POPULAR, CRYPTO
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package io.novafoundation.nova.feature_currency_api.domain
|
||||
|
||||
import io.novafoundation.nova.common.list.GroupedList
|
||||
import io.novafoundation.nova.feature_currency_api.domain.model.Currency
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface CurrencyInteractor {
|
||||
|
||||
suspend fun syncCurrencies()
|
||||
|
||||
fun observeCurrencies(): Flow<GroupedList<CurrencyCategory, Currency>>
|
||||
|
||||
fun observeSelectCurrency(): Flow<Currency>
|
||||
|
||||
suspend fun getSelectedCurrency(): Currency
|
||||
|
||||
suspend fun selectCurrency(currencyId: Int)
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package io.novafoundation.nova.feature_currency_api.domain.interfaces
|
||||
|
||||
import io.novafoundation.nova.feature_currency_api.domain.model.Currency
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface CurrencyRepository {
|
||||
|
||||
suspend fun syncCurrencies()
|
||||
|
||||
fun observeCurrencies(): Flow<List<Currency>>
|
||||
|
||||
fun observeSelectCurrency(): Flow<Currency>
|
||||
|
||||
suspend fun selectCurrency(currencyId: Int)
|
||||
|
||||
suspend fun getSelectedCurrency(): Currency
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package io.novafoundation.nova.feature_currency_api.domain.model
|
||||
|
||||
data class Currency(
|
||||
val code: String,
|
||||
val name: String,
|
||||
val symbol: String?,
|
||||
val category: Category,
|
||||
val popular: Boolean,
|
||||
val id: Int,
|
||||
val coingeckoId: String,
|
||||
val selected: Boolean,
|
||||
) {
|
||||
|
||||
enum class Category {
|
||||
FIAT, CRYPTO
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package io.novafoundation.nova.feature_currency_api.presentation
|
||||
|
||||
import io.novafoundation.nova.common.navigation.ReturnableRouter
|
||||
|
||||
interface CurrencyRouter : ReturnableRouter {
|
||||
|
||||
fun returnToWallet()
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package io.novafoundation.nova.feature_currency_api.presentation.formatters
|
||||
|
||||
import io.novafoundation.nova.common.utils.formatting.currencyFormatter
|
||||
import io.novafoundation.nova.common.utils.formatting.formatWithFullAmount
|
||||
import io.novafoundation.nova.common.utils.formatting.simpleCurrencyFormatter
|
||||
import io.novafoundation.nova.feature_currency_api.domain.model.Currency
|
||||
import java.math.BigDecimal
|
||||
import java.math.RoundingMode
|
||||
|
||||
private val currencyFormatter = currencyFormatter()
|
||||
private val simpleCurrencyFormatter = simpleCurrencyFormatter()
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
fun BigDecimal.formatAsCurrencyNoAbbreviation(currency: Currency): String {
|
||||
return formatCurrencySymbol(currency.symbol, currency.code) + this.formatWithFullAmount()
|
||||
}
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
fun BigDecimal.formatAsCurrency(currency: Currency, roundingMode: RoundingMode = RoundingMode.FLOOR): String {
|
||||
return formatAsCurrency(currency.symbol, currency.code, roundingMode)
|
||||
}
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
fun BigDecimal.simpleFormatAsCurrency(currency: Currency, roundingMode: RoundingMode = RoundingMode.FLOOR): String {
|
||||
return simpleFormatAsCurrency(currency.symbol, currency.code, roundingMode)
|
||||
}
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
fun BigDecimal.formatAsCurrency(symbol: String?, code: String, roundingMode: RoundingMode = RoundingMode.FLOOR): String {
|
||||
return formatCurrencySymbol(symbol, code) + currencyFormatter.format(this, roundingMode)
|
||||
}
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
fun BigDecimal.simpleFormatAsCurrency(symbol: String?, code: String, roundingMode: RoundingMode = RoundingMode.FLOOR): String {
|
||||
return formatCurrencySymbol(symbol, code) + simpleCurrencyFormatter.format(this, roundingMode)
|
||||
}
|
||||
|
||||
@Deprecated("Use FiatFormatter instead")
|
||||
private fun formatCurrencySymbol(symbol: String?, code: String): String {
|
||||
return symbol ?: "$code "
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package io.novafoundation.nova.feature_currency_api.presentation.mapper
|
||||
|
||||
import io.novafoundation.nova.core_db.model.CurrencyLocal
|
||||
import io.novafoundation.nova.feature_currency_api.domain.model.Currency
|
||||
import io.novafoundation.nova.feature_currency_api.presentation.model.CurrencyModel
|
||||
|
||||
fun mapCurrencyToUI(currency: Currency): CurrencyModel {
|
||||
return CurrencyModel(
|
||||
id = currency.id,
|
||||
displayCode = currency.symbol ?: currency.code,
|
||||
code = currency.code,
|
||||
name = currency.name,
|
||||
isSelected = currency.selected
|
||||
)
|
||||
}
|
||||
|
||||
fun mapCurrencyFromLocal(local: CurrencyLocal): Currency {
|
||||
return with(local) {
|
||||
Currency(
|
||||
code = code,
|
||||
name = name,
|
||||
symbol = symbol,
|
||||
category = mapCurrencyCategoryFromLocal(category),
|
||||
popular = popular,
|
||||
id = id,
|
||||
coingeckoId = coingeckoId,
|
||||
selected = selected
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun mapCurrencyCategoryFromLocal(local: CurrencyLocal.Category): Currency.Category {
|
||||
return when (local) {
|
||||
CurrencyLocal.Category.CRYPTO -> Currency.Category.CRYPTO
|
||||
CurrencyLocal.Category.FIAT -> Currency.Category.FIAT
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package io.novafoundation.nova.feature_currency_api.presentation.model
|
||||
|
||||
data class CurrencyModel(
|
||||
val id: Int,
|
||||
val displayCode: String,
|
||||
val code: String,
|
||||
val name: String,
|
||||
val isSelected: Boolean
|
||||
)
|
||||
Reference in New Issue
Block a user