mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-25 10:28:00 +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,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package io.novafoundation.nova.feature_ledger_core
|
||||
|
||||
import dagger.Component
|
||||
import io.novafoundation.nova.common.di.CommonApi
|
||||
import io.novafoundation.nova.common.di.scope.FeatureScope
|
||||
import io.novafoundation.nova.feature_ledger_core.di.LedgerCoreApi
|
||||
import io.novafoundation.nova.runtime.di.RuntimeApi
|
||||
|
||||
@Component(
|
||||
dependencies = [
|
||||
LedgerCoreDependencies::class,
|
||||
],
|
||||
modules = [
|
||||
LedgerFeatureModule::class,
|
||||
]
|
||||
)
|
||||
@FeatureScope
|
||||
interface LedgerCoreComponent : LedgerCoreApi {
|
||||
|
||||
@Component.Factory
|
||||
interface Factory {
|
||||
|
||||
fun create(
|
||||
deps: LedgerCoreDependencies,
|
||||
): LedgerCoreComponent
|
||||
}
|
||||
|
||||
@Component(
|
||||
dependencies = [
|
||||
CommonApi::class,
|
||||
RuntimeApi::class,
|
||||
]
|
||||
)
|
||||
interface LedgerCoreDependenciesComponent : LedgerCoreDependencies
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package io.novafoundation.nova.feature_ledger_core
|
||||
|
||||
import io.novafoundation.nova.runtime.extrinsic.metadata.MetadataShortenerService
|
||||
import io.novafoundation.nova.runtime.multiNetwork.ChainRegistry
|
||||
|
||||
interface LedgerCoreDependencies {
|
||||
|
||||
val chainRegistry: ChainRegistry
|
||||
|
||||
val metadataShortenerService: MetadataShortenerService
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package io.novafoundation.nova.feature_ledger_core
|
||||
|
||||
import io.novafoundation.nova.common.di.FeatureApiHolder
|
||||
import io.novafoundation.nova.common.di.FeatureContainer
|
||||
import io.novafoundation.nova.common.di.scope.ApplicationScope
|
||||
import io.novafoundation.nova.runtime.di.RuntimeApi
|
||||
import javax.inject.Inject
|
||||
|
||||
@ApplicationScope
|
||||
class LedgerCoreHolder @Inject constructor(
|
||||
featureContainer: FeatureContainer,
|
||||
) : FeatureApiHolder(featureContainer) {
|
||||
|
||||
override fun initializeDependencies(): Any {
|
||||
val accountFeatureDependencies = DaggerLedgerCoreComponent_LedgerCoreDependenciesComponent.builder()
|
||||
.commonApi(commonApi())
|
||||
.runtimeApi(getFeature(RuntimeApi::class.java))
|
||||
.build()
|
||||
|
||||
return DaggerLedgerCoreComponent.factory()
|
||||
.create(accountFeatureDependencies)
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package io.novafoundation.nova.feature_ledger_core
|
||||
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import io.novafoundation.nova.common.di.scope.FeatureScope
|
||||
import io.novafoundation.nova.feature_ledger_core.domain.LedgerMigrationTracker
|
||||
import io.novafoundation.nova.feature_ledger_core.domain.RealLedgerMigrationTracker
|
||||
import io.novafoundation.nova.runtime.extrinsic.metadata.MetadataShortenerService
|
||||
import io.novafoundation.nova.runtime.multiNetwork.ChainRegistry
|
||||
|
||||
@Module
|
||||
class LedgerFeatureModule {
|
||||
|
||||
@Provides
|
||||
@FeatureScope
|
||||
fun provideLedgerMigrationTracker(
|
||||
metadataShortenerService: MetadataShortenerService,
|
||||
chainRegistry: ChainRegistry
|
||||
): LedgerMigrationTracker {
|
||||
return RealLedgerMigrationTracker(metadataShortenerService, chainRegistry)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package io.novafoundation.nova.feature_ledger_core.di
|
||||
|
||||
import io.novafoundation.nova.feature_ledger_core.domain.LedgerMigrationTracker
|
||||
|
||||
interface LedgerCoreApi {
|
||||
|
||||
val ledgerMigrationTracker: LedgerMigrationTracker
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package io.novafoundation.nova.feature_ledger_core.domain
|
||||
|
||||
import io.novafoundation.nova.common.utils.mapNotNullToSet
|
||||
import io.novafoundation.nova.runtime.ext.isGenericLedgerAppSupported
|
||||
import io.novafoundation.nova.runtime.extrinsic.metadata.MetadataShortenerService
|
||||
import io.novafoundation.nova.runtime.multiNetwork.ChainRegistry
|
||||
import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain
|
||||
import io.novafoundation.nova.runtime.multiNetwork.chain.model.ChainId
|
||||
import io.novafoundation.nova.runtime.multiNetwork.findChainIds
|
||||
import io.novafoundation.nova.runtime.multiNetwork.findChains
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
||||
interface LedgerMigrationTracker {
|
||||
|
||||
suspend fun shouldUseMigrationApp(chainId: ChainId): Boolean
|
||||
|
||||
suspend fun supportedChainsByGenericApp(): List<Chain>
|
||||
|
||||
suspend fun anyChainSupportsMigrationApp(): Boolean
|
||||
|
||||
fun supportedChainIdsByGenericAppFlow(): Flow<Set<ChainId>>
|
||||
|
||||
suspend fun supportedChainIdsByGenericApp(): Set<ChainId>
|
||||
}
|
||||
|
||||
internal class RealLedgerMigrationTracker(
|
||||
private val metadataShortenerService: MetadataShortenerService,
|
||||
private val chainRegistry: ChainRegistry
|
||||
) : LedgerMigrationTracker {
|
||||
|
||||
override suspend fun shouldUseMigrationApp(chainId: ChainId): Boolean {
|
||||
val supportedFromRuntime = metadataShortenerService.isCheckMetadataHashAvailable(chainId)
|
||||
|
||||
// While automatically detect generic app availability from runtime, it is also usefully to be able to disable this for a specific chain
|
||||
// via a feature flag
|
||||
val supportedFromLedger = chainRegistry.getChain(chainId).additional.isGenericLedgerAppSupported()
|
||||
|
||||
return supportedFromRuntime && supportedFromLedger
|
||||
}
|
||||
|
||||
override suspend fun supportedChainsByGenericApp(): List<Chain> {
|
||||
return chainRegistry.findChains {
|
||||
it.additional.isGenericLedgerAppSupported()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun supportedChainIdsByGenericApp(): Set<ChainId> {
|
||||
return chainRegistry.findChainIds {
|
||||
it.additional.isGenericLedgerAppSupported()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun anyChainSupportsMigrationApp(): Boolean {
|
||||
return supportedChainsByGenericApp().isNotEmpty()
|
||||
}
|
||||
|
||||
override fun supportedChainIdsByGenericAppFlow(): Flow<Set<ChainId>> {
|
||||
return chainRegistry.currentChains.map { chains ->
|
||||
chains.mapNotNullToSet { chain ->
|
||||
chain.id.takeIf { chain.additional.isGenericLedgerAppSupported() }
|
||||
}
|
||||
}.distinctUntilChanged()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user