mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-23 04:57:57 +00:00
feat: add Pezkuwi Dashboard card with live People Chain data
- Dashboard card on Assets page showing roles, trust score, referral, staking, and perwerde points from People Chain pallets - Repository queries: Tiki, Trust, Referral, StakingScore, Perwerde - CachedStakingDetails double map query (RelayChain + AssetHub sources) - Full i18n support across all 15 locales including new Turkish locale - "Apply & Actions" button opens Telegram bot - Staking improvements for split ecosystem multi-endpoint stats
This commit is contained in:
+16
-7
@@ -6,6 +6,7 @@ import io.novafoundation.nova.common.utils.flowOfAll
|
||||
import io.novafoundation.nova.common.utils.inBackground
|
||||
import io.novafoundation.nova.common.utils.invokeOnCompletion
|
||||
import io.novafoundation.nova.common.utils.singleReplaySharedFlow
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
@@ -13,6 +14,7 @@ import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
@@ -72,18 +74,25 @@ internal class RealComputationalCache : ComputationalCache, CoroutineScope by Co
|
||||
cachedAction: AwaitableConstructor<T>
|
||||
): T {
|
||||
val awaitable = mutex.withLock {
|
||||
if (key in memory) {
|
||||
val existing = memory[key]
|
||||
if (existing != null && existing.aggregateScope.isActive) {
|
||||
Log.d(LOG_TAG, "Key $key requested - already present")
|
||||
|
||||
val entry = memory.getValue(key)
|
||||
existing.dependents += scope
|
||||
|
||||
entry.dependents += scope
|
||||
|
||||
entry.awaitable
|
||||
existing.awaitable
|
||||
} else {
|
||||
Log.d(LOG_TAG, "Key $key requested - creating new operation")
|
||||
if (existing != null) {
|
||||
Log.d(LOG_TAG, "Key $key requested - stale (aggregateScope cancelled), recreating")
|
||||
memory.remove(key)
|
||||
} else {
|
||||
Log.d(LOG_TAG, "Key $key requested - creating new operation")
|
||||
}
|
||||
|
||||
val aggregateScope = CoroutineScope(Dispatchers.Default)
|
||||
val exceptionHandler = CoroutineExceptionHandler { _, throwable ->
|
||||
Log.e(LOG_TAG, "Key $key - upstream error in aggregateScope", throwable)
|
||||
}
|
||||
val aggregateScope = CoroutineScope(Dispatchers.Default + exceptionHandler)
|
||||
val awaitable = cachedAction(aggregateScope)
|
||||
|
||||
memory[key] = Entry(dependents = mutableSetOf(scope), aggregateScope, awaitable)
|
||||
|
||||
@@ -2044,4 +2044,11 @@
|
||||
<string name="bridge_enter_amount">Ingresa la cantidad</string>
|
||||
<string name="bridge_hez_to_dot_warning">Los intercambios HEZ→DOT pueden tener disponibilidad limitada según la liquidez.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Los intercambios HEZ→DOT no están disponibles temporalmente. Inténtalo de nuevo cuando haya suficiente liquidez de DOT.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Puntuación de confianza</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referido</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Solicitar y Acciones</string>
|
||||
</resources>
|
||||
|
||||
@@ -2044,4 +2044,11 @@
|
||||
<string name="bridge_enter_amount">Entrez le montant</string>
|
||||
<string name="bridge_hez_to_dot_warning">Les échanges HEZ→DOT peuvent avoir une disponibilité limitée selon la liquidité.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Les échanges HEZ→DOT sont temporairement indisponibles. Réessayez lorsque la liquidité DOT sera suffisante.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Score de confiance</string>
|
||||
<string name="pezkuwi_dashboard_referral">Parrainage</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Demande et Actions</string>
|
||||
</resources>
|
||||
|
||||
@@ -2044,4 +2044,11 @@
|
||||
<string name="bridge_enter_amount">Írd be az összeget</string>
|
||||
<string name="bridge_hez_to_dot_warning">A HEZ→DOT cserék korlátozott elérhetőségűek lehetnek a likviditástól függően.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">A HEZ→DOT cserék ideiglenesen nem elérhetők. Próbáld újra, amikor elegendő DOT likviditás áll rendelkezésre.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Bizalmi pontszám</string>
|
||||
<string name="pezkuwi_dashboard_referral">Ajánlás</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Jelentkezés és Műveletek</string>
|
||||
</resources>
|
||||
|
||||
@@ -2030,4 +2030,11 @@
|
||||
<string name="bridge_enter_amount">Masukkan jumlah</string>
|
||||
<string name="bridge_hez_to_dot_warning">Penukaran HEZ→DOT mungkin terbatas tergantung pada likuiditas.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Penukaran HEZ→DOT sementara tidak tersedia. Coba lagi saat likuiditas DOT mencukupi.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Skor Kepercayaan</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referral</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Ajukan & Tindakan</string>
|
||||
</resources>
|
||||
|
||||
@@ -2044,4 +2044,11 @@
|
||||
<string name="bridge_enter_amount">Inserisci importo</string>
|
||||
<string name="bridge_hez_to_dot_warning">Gli scambi HEZ→DOT potrebbero avere disponibilità limitata in base alla liquidità.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Gli scambi HEZ→DOT sono temporaneamente non disponibili. Riprova quando la liquidità DOT sarà sufficiente.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Punteggio di fiducia</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referral</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Richiesta e Azioni</string>
|
||||
</resources>
|
||||
|
||||
@@ -2030,4 +2030,11 @@
|
||||
<string name="bridge_enter_amount">金額を入力</string>
|
||||
<string name="bridge_hez_to_dot_warning">HEZ→DOT交換は流動性により制限される場合があります。</string>
|
||||
<string name="bridge_hez_to_dot_blocked">HEZ→DOT交換は一時的に利用できません。DOTの流動性が十分になったら再試行してください。</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">信頼スコア</string>
|
||||
<string name="pezkuwi_dashboard_referral">紹介</string>
|
||||
<string name="pezkuwi_dashboard_staking">ステーキング</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">申請とアクション</string>
|
||||
</resources>
|
||||
|
||||
@@ -2030,4 +2030,11 @@
|
||||
<string name="bridge_enter_amount">금액 입력</string>
|
||||
<string name="bridge_hez_to_dot_warning">HEZ→DOT 교환은 유동성에 따라 제한될 수 있습니다.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">HEZ→DOT 교환은 일시적으로 사용할 수 없습니다. DOT 유동성이 충분해지면 다시 시도하세요.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">신뢰 점수</string>
|
||||
<string name="pezkuwi_dashboard_referral">추천</string>
|
||||
<string name="pezkuwi_dashboard_staking">스테이킹</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">신청 및 작업</string>
|
||||
</resources>
|
||||
|
||||
@@ -2757,4 +2757,11 @@
|
||||
<string name="bridge_enter_amount">Mîqdar binivîse</string>
|
||||
<string name="bridge_hez_to_dot_warning">Guherandina HEZ→DOT li gorî rewşa DOT sînordar dibe.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Guherandina HEZ→DOT niha tune. Dema DOT têr bibe dîsa biceribîne.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Pûana Pêbaweriyê</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referral</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Serlêdan û Karên</string>
|
||||
</resources>
|
||||
|
||||
@@ -2072,4 +2072,11 @@
|
||||
<string name="bridge_enter_amount">Wprowadź kwotę</string>
|
||||
<string name="bridge_hez_to_dot_warning">Wymiany HEZ→DOT mogą mieć ograniczoną dostępność w zależności od płynności.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Wymiany HEZ→DOT są tymczasowo niedostępne. Spróbuj ponownie, gdy płynność DOT będzie wystarczająca.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Wynik zaufania</string>
|
||||
<string name="pezkuwi_dashboard_referral">Polecenie</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Wniosek i Akcje</string>
|
||||
</resources>
|
||||
|
||||
@@ -2044,4 +2044,11 @@
|
||||
<string name="bridge_enter_amount">Digite o valor</string>
|
||||
<string name="bridge_hez_to_dot_warning">As trocas HEZ→DOT podem ter disponibilidade limitada dependendo da liquidez.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">As trocas HEZ→DOT estão temporariamente indisponíveis. Tente novamente quando houver liquidez suficiente de DOT.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Pontuação de confiança</string>
|
||||
<string name="pezkuwi_dashboard_referral">Indicação</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Candidatura e Ações</string>
|
||||
</resources>
|
||||
|
||||
@@ -2072,4 +2072,11 @@
|
||||
<string name="bridge_enter_amount">Введите сумму</string>
|
||||
<string name="bridge_hez_to_dot_warning">Обмен HEZ→DOT может быть ограничен в зависимости от ликвидности.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Обмен HEZ→DOT временно недоступен. Повторите попытку при достаточной ликвидности DOT.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Рейтинг доверия</string>
|
||||
<string name="pezkuwi_dashboard_referral">Реферал</string>
|
||||
<string name="pezkuwi_dashboard_staking">Стейкинг</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Заявка и Действия</string>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Güven Puanı</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referans</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Başvuru ve İşlemler</string>
|
||||
</resources>
|
||||
@@ -2030,4 +2030,11 @@
|
||||
<string name="bridge_enter_amount">Nhập số tiền</string>
|
||||
<string name="bridge_hez_to_dot_warning">Giao dịch HEZ→DOT có thể bị hạn chế tùy thuộc vào thanh khoản.</string>
|
||||
<string name="bridge_hez_to_dot_blocked">Giao dịch HEZ→DOT tạm thời không khả dụng. Vui lòng thử lại khi thanh khoản DOT đủ.</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Điểm tin cậy</string>
|
||||
<string name="pezkuwi_dashboard_referral">Giới thiệu</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Đăng ký & Hành động</string>
|
||||
</resources>
|
||||
|
||||
@@ -2030,4 +2030,11 @@
|
||||
<string name="bridge_enter_amount">输入金额</string>
|
||||
<string name="bridge_hez_to_dot_warning">HEZ→DOT兑换可能因流动性而受限。</string>
|
||||
<string name="bridge_hez_to_dot_blocked">HEZ→DOT兑换暂时不可用。请在DOT流动性充足时重试。</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">信任评分</string>
|
||||
<string name="pezkuwi_dashboard_referral">推荐</string>
|
||||
<string name="pezkuwi_dashboard_staking">质押</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">申请与操作</string>
|
||||
</resources>
|
||||
|
||||
@@ -2759,4 +2759,11 @@
|
||||
<string name="yesterday">Yesterday</string>
|
||||
<string name="branch_io_link_host" translatable="false">pezkuwi-wallet.app.link</string>
|
||||
<string name="branch_io_link_host_alternate" translatable="false">pezkuwi-wallet-alternate.app.link</string>
|
||||
|
||||
<string name="pezkuwi_dashboard_title">Pezkuwi</string>
|
||||
<string name="pezkuwi_dashboard_trust_score">Trust Score</string>
|
||||
<string name="pezkuwi_dashboard_referral">Referral</string>
|
||||
<string name="pezkuwi_dashboard_staking">Staking</string>
|
||||
<string name="pezkuwi_dashboard_perwerde">Perwerde</string>
|
||||
<string name="pezkuwi_dashboard_basvuru">Apply & Actions</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user