diff --git a/package.json b/package.json index 64c10fd68..b4763b1e6 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@metamask/detect-provider": "^2.0.0", - "@soramitsu/soraneo-wallet-web": "1.32.4", + "@soramitsu/soraneo-wallet-web": "1.32.5", "@walletconnect/ethereum-provider": "^2.11.2", "@walletconnect/modal": "^2.6.2", "core-js": "^3.36.0", diff --git a/src/lang/cs.json b/src/lang/cs.json index a6bf6f1cd..c8eda100f 100644 --- a/src/lang/cs.json +++ b/src/lang/cs.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "K vyřízení této objednávky není k dispozici dostatek objednávek", - "reading": "Omezení tržního příkazu: Pro splnění tohoto tržního limitního příkazu není k dispozici dostatek příkazů. Upravte prosím velikost objednávky nebo počkejte na odeslání dalších objednávek" + "reading": "Omezení tržního příkazu: Pro splnění tohoto tržního příkazu není k dispozici dostatek příkazů. Upravte prosím velikost objednávky nebo počkejte na odeslání dalších objednávek" }, "exceedsSpread": { "reason": "Cena přesáhla spread", @@ -1554,6 +1554,8 @@ "canceled": "Zrušeno", "expired": "Prošlý", "filled": "Naplněné" - } - } + }, + "pricePerToken": "Cena za 1 {token}" + }, + "calculatingText": "Vypočítávání" } \ No newline at end of file diff --git a/src/lang/de.json b/src/lang/de.json index 2f52b79fa..221c93337 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Es sind nicht genügend Bestellungen verfügbar, um diese Bestellung auszuführen", - "reading": "Limitierung der Market-Order: Es sind nicht genügend Orders verfügbar, um diese Market-Limit-Order auszuführen. Bitte passen Sie Ihre Bestellgröße an oder warten Sie, bis weitere Bestellungen aufgegeben werden" + "reading": "Limitierung der Market-Order: Es sind nicht genügend Orders verfügbar, um diese Market-Order auszuführen. Bitte passen Sie Ihre Bestellgröße an oder warten Sie, bis weitere Bestellungen aufgegeben werden" }, "exceedsSpread": { "reason": "Der Preis überstieg die Spanne", @@ -1554,6 +1554,8 @@ "canceled": "Abgesagt", "expired": "Abgelaufen", "filled": "Gefüllt" - } - } + }, + "pricePerToken": "Preis pro 1 {token}" + }, + "calculatingText": "Berechnung" } \ No newline at end of file diff --git a/src/lang/en.json b/src/lang/en.json index 0109aa82a..ac69b1c95 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Not enough orders available to fullfill this order", - "reading": "Market order limitation: There are not enough orders available to fulfill this market limit order. Please adjust your order size or wait for more orders to be placed" + "reading": "Market order limitation: There are not enough orders available to fulfill this market order. Please adjust your order size or wait for more orders to be placed" }, "exceedsSpread": { "reason": "Price exceeded spread", @@ -1554,6 +1554,8 @@ "canceled": "Canceled", "expired": "Expired", "filled": "Filled" - } - } + }, + "pricePerToken": "Price per 1 {token}" + }, + "calculatingText": "Calculating" } \ No newline at end of file diff --git a/src/lang/es.json b/src/lang/es.json index 78cdb36d9..1a4f24d11 100644 --- a/src/lang/es.json +++ b/src/lang/es.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "No hay suficientes pedidos disponibles para completar este pedido", - "reading": "Limitación de orden de mercado: no hay suficientes órdenes disponibles para cumplir con esta orden de límite de mercado. Ajuste el tamaño de su pedido o espere a que se realicen más pedidos." + "reading": "Limitación de la orden de mercado: no hay suficientes órdenes disponibles para cumplir con esta orden de mercado. Ajuste el tamaño de su pedido o espere a que se realicen más pedidos." }, "exceedsSpread": { "reason": "El precio superó el diferencial", @@ -1554,6 +1554,8 @@ "canceled": "Cancelado", "expired": "Venció", "filled": "Completado" - } - } + }, + "pricePerToken": "Precio por 1 {token}" + }, + "calculatingText": "Calculando" } \ No newline at end of file diff --git a/src/lang/fr.json b/src/lang/fr.json index 35e3643d8..eb193bdd8 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Pas assez de commandes disponibles pour exécuter cette commande", - "reading": "Limitation des ordres au marché : il n’y a pas suffisamment d’ordres disponibles pour exécuter cet ordre au marché limité. Veuillez ajuster la taille de votre commande ou attendre que d'autres commandes soient passées" + "reading": "Limitation des ordres au marché : il n’y a pas suffisamment d’ordres disponibles pour exécuter cet ordre au marché. Veuillez ajuster la taille de votre commande ou attendre que d'autres commandes soient passées" }, "exceedsSpread": { "reason": "Prix dépassé le spread", @@ -1554,6 +1554,8 @@ "canceled": "Annulé", "expired": "Expiré", "filled": "Rempli" - } - } + }, + "pricePerToken": "Prix par 1 {token}" + }, + "calculatingText": "Calculant" } \ No newline at end of file diff --git a/src/lang/hr.json b/src/lang/hr.json index 8359ac3a6..de0eaf9dd 100644 --- a/src/lang/hr.json +++ b/src/lang/hr.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Nema dovoljno dostupnih narudžbi za ispunjavanje ove narudžbe", - "reading": "Ograničenje tržišnog naloga: nema dovoljno dostupnih naloga za ispunjavanje ovog ograničenog tržišnog naloga. Prilagodite veličinu svoje narudžbe ili pričekajte da se pošalje više narudžbi" + "reading": "Ograničenje tržišnog naloga: nema dovoljno dostupnih naloga za ispunjavanje ovog tržišnog naloga. Prilagodite veličinu svoje narudžbe ili pričekajte da se pošalje više narudžbi" }, "exceedsSpread": { "reason": "Cijena premašila raspon", @@ -1554,6 +1554,8 @@ "canceled": "Otkazano", "expired": "Istekao", "filled": "Ispunjeno" - } - } + }, + "pricePerToken": "Cijena za 1 {token}" + }, + "calculatingText": "Izračunavanje" } \ No newline at end of file diff --git a/src/lang/hu.json b/src/lang/hu.json index 0bce64788..165528fec 100644 --- a/src/lang/hu.json +++ b/src/lang/hu.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Nincs elég rendelés a rendelés teljesítéséhez", - "reading": "Piaci megbízás korlátozása: Nincs elég megbízás a piaci limites megbízás teljesítéséhez. Kérjük, módosítsa rendelési méretét, vagy várja meg a további rendelések leadását" + "reading": "Piaci megbízás korlátozása: Nincs elég megbízás a piaci megbízás teljesítéséhez. Kérjük, módosítsa rendelési méretét, vagy várja meg a további rendelések leadását" }, "exceedsSpread": { "reason": "Az ár meghaladja a spreadet", @@ -1554,6 +1554,8 @@ "canceled": "Törölve", "expired": "Lejárt", "filled": "Megtöltött" - } - } + }, + "pricePerToken": "1 {token} ár" + }, + "calculatingText": "Számítás" } \ No newline at end of file diff --git a/src/lang/hy.json b/src/lang/hy.json index b738332a3..5761d827f 100644 --- a/src/lang/hy.json +++ b/src/lang/hy.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Այս պատվերը կատարելու համար բավարար պատվերներ չկան", - "reading": "Շուկայական պատվերի սահմանափակում. այս շուկայական սահմանաչափի պատվերը կատարելու համար բավարար պատվերներ չկան: Խնդրում ենք հարմարեցնել ձեր պատվերի չափը կամ սպասել լրացուցիչ պատվերների տեղադրմանը" + "reading": "Շուկայական պատվերի սահմանափակում. այս շուկայական պատվերը կատարելու համար բավարար պատվերներ չկան: Խնդրում ենք հարմարեցնել ձեր պատվերի չափը կամ սպասել լրացուցիչ պատվերների տեղադրմանը" }, "exceedsSpread": { "reason": "Գինը գերազանցել է սպրեդը", @@ -1554,6 +1554,8 @@ "canceled": "Չեղարկված է", "expired": "Ժամկետանց", "filled": "Լրացված" - } - } + }, + "pricePerToken": "Գինը 1 {token} ի համար" + }, + "calculatingText": "Հաշվարկում" } \ No newline at end of file diff --git a/src/lang/id.json b/src/lang/id.json index e92e59a6b..a94dd4257 100644 --- a/src/lang/id.json +++ b/src/lang/id.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Pesanan yang tersedia tidak cukup untuk memenuhi pesanan ini", - "reading": "Batasan pesanan pasar: Tidak ada cukup pesanan yang tersedia untuk memenuhi pesanan batas pasar ini. Silakan sesuaikan ukuran pesanan Anda atau tunggu pesanan lainnya dilakukan" + "reading": "Batasan pesanan pasar: Tidak tersedia cukup pesanan untuk memenuhi pesanan pasar ini. Silakan sesuaikan ukuran pesanan Anda atau tunggu pesanan lainnya dilakukan" }, "exceedsSpread": { "reason": "Harga melebihi spread", @@ -1554,6 +1554,8 @@ "canceled": "Dibatalkan", "expired": "Kedaluwarsa", "filled": "Dipenuhi" - } - } + }, + "pricePerToken": "Harga per 1 {token}" + }, + "calculatingText": "Menghitung" } \ No newline at end of file diff --git a/src/lang/it.json b/src/lang/it.json index 8bcba96dd..e75f3ca46 100644 --- a/src/lang/it.json +++ b/src/lang/it.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Non ci sono abbastanza ordini disponibili per evadere questo ordine", - "reading": "Limitazione dell'ordine di mercato: non ci sono abbastanza ordini disponibili per soddisfare questo ordine limite di mercato. Modifica la dimensione dell'ordine o attendi che vengano effettuati altri ordini" + "reading": "Limitazione dell'ordine di mercato: non ci sono abbastanza ordini disponibili per soddisfare questo ordine di mercato. Modifica la dimensione dell'ordine o attendi che vengano effettuati altri ordini" }, "exceedsSpread": { "reason": "Il prezzo ha superato lo spread", @@ -1554,6 +1554,8 @@ "canceled": "Annullato", "expired": "Scaduto", "filled": "Riempito" - } - } + }, + "pricePerToken": "Prezzo per 1 {token}" + }, + "calculatingText": "Calcolando" } \ No newline at end of file diff --git a/src/lang/nl.json b/src/lang/nl.json index ada040022..ac6c46558 100644 --- a/src/lang/nl.json +++ b/src/lang/nl.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Er zijn niet genoeg bestellingen beschikbaar om deze bestelling uit te voeren", - "reading": "Marktorderbeperking: Er zijn niet genoeg orders beschikbaar om aan deze marktlimietorder te voldoen. Pas uw bestelgrootte aan of wacht tot er meer bestellingen worden geplaatst" + "reading": "Beperking van marktorders: Er zijn niet genoeg orders beschikbaar om aan deze marktorder te voldoen. Pas uw bestelgrootte aan of wacht tot er meer bestellingen worden geplaatst" }, "exceedsSpread": { "reason": "Prijs overtrof de spread", @@ -1554,6 +1554,8 @@ "canceled": "Geannuleerd", "expired": "Verlopen", "filled": "Gevuld" - } - } + }, + "pricePerToken": "Prijs per 1 {token}" + }, + "calculatingText": "Berekenen" } \ No newline at end of file diff --git a/src/lang/no.json b/src/lang/no.json index c017e7708..c1ce9d2de 100644 --- a/src/lang/no.json +++ b/src/lang/no.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Ikke nok tilgjengelige bestillinger til å fullføre denne bestillingen", - "reading": "Markedsordrebegrensning: Det er ikke nok bestillinger tilgjengelig til å oppfylle denne markedsgrenseordren. Vennligst juster bestillingsstørrelsen eller vent på at flere bestillinger legges inn" + "reading": "Markedsordrebegrensning: Det er ikke nok bestillinger tilgjengelig til å oppfylle denne markedsordren. Vennligst juster bestillingsstørrelsen eller vent på at flere bestillinger legges inn" }, "exceedsSpread": { "reason": "Pris overskredet spredning", @@ -1554,6 +1554,8 @@ "canceled": "Kansellert", "expired": "Utløpt", "filled": "Fylt" - } - } + }, + "pricePerToken": "Pris per 1 {token}" + }, + "calculatingText": "Beregner" } \ No newline at end of file diff --git a/src/lang/pl.json b/src/lang/pl.json index abf1d383d..79b61720d 100644 --- a/src/lang/pl.json +++ b/src/lang/pl.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Nie ma wystarczającej liczby dostępnych zamówień, aby zrealizować to zamówienie", - "reading": "Ograniczenie zleceń rynkowych: Nie ma wystarczającej liczby dostępnych zleceń, aby zrealizować to zlecenie z limitem rynkowym. Dostosuj wielkość zamówienia lub poczekaj na złożenie większej liczby zamówień" + "reading": "Ograniczenie zlecenia rynkowego: Nie ma wystarczającej liczby dostępnych zleceń, aby zrealizować to zlecenie rynkowe. Dostosuj wielkość zamówienia lub poczekaj na złożenie większej liczby zamówień" }, "exceedsSpread": { "reason": "Cena przekroczyła spread", @@ -1554,6 +1554,8 @@ "canceled": "Odwołany", "expired": "Wygasły", "filled": "Wypełniony" - } - } + }, + "pricePerToken": "Cena za 1 {token}" + }, + "calculatingText": "Obliczanie" } \ No newline at end of file diff --git a/src/lang/ru.json b/src/lang/ru.json index 1509b40db..35b61318c 100644 --- a/src/lang/ru.json +++ b/src/lang/ru.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Недостаточно ордеров для выполнения этого ордера.", - "reading": "Ограничение рыночного ордера: недостаточно доступных ордеров для выполнения этого рыночного лимитного ордера. Пожалуйста, измените размер ордера или подождите, пока будут размещены новые ордера." + "reading": "Ограничение рыночного ордера: для выполнения этого рыночного ордера недостаточно ордеров. Пожалуйста, измените размер заказа или подождите, пока будут размещены новые заказы." }, "exceedsSpread": { "reason": "Цена превысила спред", @@ -1554,6 +1554,8 @@ "canceled": "Отменен", "expired": "Истек", "filled": "Заполнен" - } - } + }, + "pricePerToken": "Цена за 1 {token}" + }, + "calculatingText": "Вычисление" } \ No newline at end of file diff --git a/src/lang/sk.json b/src/lang/sk.json index 315e1eefb..8a731e343 100644 --- a/src/lang/sk.json +++ b/src/lang/sk.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Nie je k dispozícii dostatok objednávok na splnenie tejto objednávky", - "reading": "Obmedzenie trhového príkazu: Nie je k dispozícii dostatok príkazov na splnenie tohto trhového limitného príkazu. Upravte veľkosť objednávky alebo počkajte na odoslanie ďalších objednávok" + "reading": "Obmedzenie trhovej objednávky: Na splnenie tejto trhovej objednávky nie je k dispozícii dostatok objednávok. Upravte veľkosť objednávky alebo počkajte na odoslanie ďalších objednávok" }, "exceedsSpread": { "reason": "Cena prekročila spread", @@ -1554,6 +1554,8 @@ "canceled": "Zrušené", "expired": "Platnosť vypršala", "filled": "Naplnené" - } - } + }, + "pricePerToken": "Cena za 1 {token}" + }, + "calculatingText": "Výpočet" } \ No newline at end of file diff --git a/src/lang/sr.json b/src/lang/sr.json index a5d2b0c66..2f67e3091 100644 --- a/src/lang/sr.json +++ b/src/lang/sr.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Нема довољно поруџбина за испуњавање ове поруџбине", - "reading": "Ограничење тржишног налога: Нема довољно доступних налога за испуњавање овог тржишног лимитираног налога. Подесите величину поруџбине или сачекајте да буде послато више поруџбина" + "reading": "Ограничење тржишног налога: Нема довољно доступних налога за испуњавање овог тржишног налога. Подесите величину поруџбине или сачекајте да буде послато више поруџбина" }, "exceedsSpread": { "reason": "Цена је премашила распон", @@ -1554,6 +1554,8 @@ "canceled": "Отказано", "expired": "Истекао", "filled": "Попуњено" - } - } + }, + "pricePerToken": "Цена по 1 {token}" + }, + "calculatingText": "Računanje" } \ No newline at end of file diff --git a/src/lang/sv.json b/src/lang/sv.json index 4777a3df2..1bd58e746 100644 --- a/src/lang/sv.json +++ b/src/lang/sv.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Det finns inte tillräckligt med beställningar för att fullfölja denna beställning", - "reading": "Marknadsorderbegränsning: Det finns inte tillräckligt med order tillgängliga för att uppfylla denna marknadsbegränsningsorder. Vänligen justera din beställningsstorlek eller vänta på att fler beställningar ska läggas" + "reading": "Marknadsorderbegränsning: Det finns inte tillräckligt med order tillgängliga för att uppfylla denna marknadsorder. Vänligen justera din beställningsstorlek eller vänta på att fler beställningar ska läggas" }, "exceedsSpread": { "reason": "Priset översteg spridningen", @@ -1554,6 +1554,8 @@ "canceled": "Inställt", "expired": "Utgånget", "filled": "Fylld" - } - } + }, + "pricePerToken": "Pris per 1 {token}" + }, + "calculatingText": "Beräknar" } \ No newline at end of file diff --git a/src/lang/vi.json b/src/lang/vi.json index 055350245..5869c37f8 100644 --- a/src/lang/vi.json +++ b/src/lang/vi.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Không có đủ đơn đặt hàng để thực hiện đầy đủ đơn đặt hàng này", - "reading": "Giới hạn lệnh thị trường: Không có đủ đơn đặt hàng để thực hiện lệnh giới hạn thị trường này. Vui lòng điều chỉnh kích thước đơn hàng của bạn hoặc chờ đặt thêm đơn hàng" + "reading": "Giới hạn lệnh thị trường: Không có đủ lệnh để thực hiện lệnh thị trường này. Vui lòng điều chỉnh kích thước đơn hàng của bạn hoặc chờ đặt thêm đơn hàng" }, "exceedsSpread": { "reason": "Giá vượt quá mức chênh lệch", @@ -1554,6 +1554,8 @@ "canceled": "Đã hủy", "expired": "Hết hạn", "filled": "Điền" - } - } + }, + "pricePerToken": "Giá mỗi 1 {token}" + }, + "calculatingText": "Đang tính toán" } \ No newline at end of file diff --git a/src/lang/yo.json b/src/lang/yo.json index a41ba0f5d..9429f1085 100644 --- a/src/lang/yo.json +++ b/src/lang/yo.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "Ko si awọn aṣẹ to wa lati kun aṣẹ yii", - "reading": "Idiwọn aṣẹ ọja: Ko si awọn aṣẹ to wa lati mu aṣẹ opin ọja yii ṣẹ. Jọwọ ṣatunṣe iwọn ibere rẹ tabi duro fun awọn aṣẹ diẹ sii lati gbe" + "reading": "Idiwọn aṣẹ ọja: Ko si awọn aṣẹ to wa lati mu aṣẹ ọja yii ṣẹ. Jọwọ ṣatunṣe iwọn ibere rẹ tabi duro fun awọn aṣẹ diẹ sii lati gbe" }, "exceedsSpread": { "reason": "Iye owo ti kọja itankale", @@ -1554,6 +1554,8 @@ "canceled": "fagilee", "expired": "Ti pari", "filled": "Ti kun" - } - } + }, + "pricePerToken": "Iye fun 1 {token}" + }, + "calculatingText": "Ọnàkọnà" } \ No newline at end of file diff --git a/src/lang/zh_CN.json b/src/lang/zh_CN.json index 176981a88..5fb8a3678 100644 --- a/src/lang/zh_CN.json +++ b/src/lang/zh_CN.json @@ -1522,7 +1522,7 @@ }, "marketNotAvailable": { "reason": "没有足够的订单来完成此订单", - "reading": "市价订单限制:没有足够的订单来履行此市价限价订单。请调整您的订单大小或等待下更多订单" + "reading": "市价订单限制:没有足够的订单来履行该市价订单。请调整您的订单大小或等待下更多订单" }, "exceedsSpread": { "reason": "价格超出点差", @@ -1554,6 +1554,8 @@ "canceled": "取消", "expired": "已到期", "filled": "填充" - } - } + }, + "pricePerToken": "每 1 个{token}价格" + }, + "calculatingText": "正在计算" } \ No newline at end of file diff --git a/src/modules/staking/demeter/mixins/AprMixin.ts b/src/modules/staking/demeter/mixins/AprMixin.ts index ff50e70b0..7d450f2a2 100644 --- a/src/modules/staking/demeter/mixins/AprMixin.ts +++ b/src/modules/staking/demeter/mixins/AprMixin.ts @@ -2,13 +2,16 @@ import { FPNumber } from '@sora-substrate/util'; import { mixins } from '@soramitsu/soraneo-wallet-web'; import { Component, Mixins } from 'vue-property-decorator'; +import TranslationMixin from '@/components/mixins/TranslationMixin'; +import { formatDecimalPlaces } from '@/utils'; + import type { DemeterPool, DemeterRewardToken } from '@sora-substrate/util/build/demeterFarming/types'; import type { AccountLiquidity } from '@sora-substrate/util/build/poolXyk/types'; const BLOCKS_PER_YEAR = new FPNumber(5_256_000); @Component -export default class AprMixin extends Mixins(mixins.FormattedAmountMixin) { +export default class AprMixin extends Mixins(mixins.FormattedAmountMixin, TranslationMixin) { // allocation * token_per_block * multiplier getEmission(pool: DemeterPool, tokenInfo: Nullable): FPNumber { const isFarm = !!pool?.isFarm; @@ -46,4 +49,8 @@ export default class AprMixin extends Mixins(mixins.FormattedAmountMixin) { return pool.totalTokensInPool.mul(poolAssetPrice); } } + + formatApr(apr: FPNumber): string { + return apr.isZero() ? this.t('calculatingText') : formatDecimalPlaces(apr, true); + } } diff --git a/src/modules/staking/demeter/mixins/BasePageMixin.ts b/src/modules/staking/demeter/mixins/BasePageMixin.ts index 82a5a4061..d56ea8cd0 100644 --- a/src/modules/staking/demeter/mixins/BasePageMixin.ts +++ b/src/modules/staking/demeter/mixins/BasePageMixin.ts @@ -80,9 +80,13 @@ export default class BasePageMixin extends Mixins(AprMixin) { } get selectedPool(): Nullable { - if (!this.baseAsset || !this.poolAsset || !this.pools[this.baseAsset][this.poolAsset]) return null; + if (!(this.baseAsset && this.poolAsset && this.rewardAsset)) return null; - return this.pools[this.baseAsset][this.poolAsset].find((pool) => pool.rewardAsset === this.rewardAsset); + const pools = this.pools[this.baseAsset]?.[this.poolAsset]; + + if (!pools) return null; + + return pools.find((pool) => pool.rewardAsset === this.rewardAsset); } get selectedAccountPool(): Nullable { @@ -124,7 +128,7 @@ export default class BasePageMixin extends Mixins(AprMixin) { const emission = this.getEmission(pool, tokenInfo); const tvl = this.getTvl(pool, poolAsset.price, liquidity); const apr = this.getApr(emission, tvl, rewardAsset.price); - const aprFormatted = formatDecimalPlaces(apr, true); + const aprFormatted = this.formatApr(apr); const tvlFormatted = `$${formatDecimalPlaces(tvl)}`; return { diff --git a/src/modules/staking/sora/components/StatusBadge.vue b/src/modules/staking/sora/components/StatusBadge.vue index 57dabadff..72f3d55a2 100644 --- a/src/modules/staking/sora/components/StatusBadge.vue +++ b/src/modules/staking/sora/components/StatusBadge.vue @@ -12,7 +12,7 @@ import { Component, Mixins } from 'vue-property-decorator'; import { Components } from '@/consts'; import { lazyComponent } from '@/router'; -import { formatDecimalPlaces } from '@/utils'; +import { formatDecimalPlaces, asZeroValue } from '@/utils'; import StakingMixin from '../mixins/StakingMixin'; @@ -23,7 +23,7 @@ import StakingMixin from '../mixins/StakingMixin'; }) export default class StatusBadge extends Mixins(StakingMixin) { get soraStakingAPYFormatted(): string { - return formatDecimalPlaces(this.maxApy, true); + return asZeroValue(this.maxApy) ? this.t('calculatingText') : formatDecimalPlaces(this.maxApy, true); } } diff --git a/yarn.lock b/yarn.lock index 1b68947cb..a83157b94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2349,68 +2349,68 @@ resolved "https://registry.yarnpkg.com/@soda/get-current-script/-/get-current-script-1.0.2.tgz#a53515db25d8038374381b73af20bb4f2e508d87" integrity sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w== -"@sora-substrate/api@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.32.7.tgz#5cb0b80642bb0cfae3319fec282d6e7f1d07fb39" - integrity sha512-vqmI91D3EVkc6fJEvWbgqoBxpWHfUhnIW/Hl4YlQbLZFJk5SvhB1hgmGYQAF7vH25Q0VeKKn4Fdzn2AC5N7yzA== +"@sora-substrate/api@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.32.9.tgz#73bec73462d285b8d877b67de09989a63f045c4e" + integrity sha512-QQaUxyPrzh6GyZ/GdAgeOBC+ie/GtalnadrGNc136wYJAFK5ncZLsKNPOePrHCe4f/od7noLnzO0P5mMHRWHMQ== dependencies: "@open-web3/orml-api-derive" "1.1.4" "@polkadot/api" "9.14.2" - "@sora-substrate/types" "1.32.7" + "@sora-substrate/types" "1.32.9" -"@sora-substrate/connection@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/connection/-/connection-1.32.7.tgz#b617d1f9b7575f178d4fb8ad3c87035d939f83e5" - integrity sha512-xWndmli4H/162yRWi57XCVOOkGvnkox9lq4bY86QsUmYD+LEX+goi0eIA/NAUo5Edtmn7/jgRfvjWTK4+XCuxA== +"@sora-substrate/connection@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/connection/-/connection-1.32.9.tgz#53d816fad802ab566c4969174f1a3386ad1fd447" + integrity sha512-E4UahadF0UpARxLSalErp17MrwVAKD+XMkQDURzZxTw68rIwmcgsWo6LOFIXJEvLCSHswOujfuzJ/hevhIoaSg== dependencies: - "@sora-substrate/api" "1.32.7" + "@sora-substrate/api" "1.32.9" -"@sora-substrate/liquidity-proxy@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.32.7.tgz#605c08ad03977317116384005c445d886b9a5e67" - integrity sha512-CTZdtF8B4GvN56uElJZXZCrYPXOIRs96WRaZUofh37pFrz8ylWY3r75EzNg/DHPxgQzV3Vd4Iw1VqBZSO9MREg== +"@sora-substrate/liquidity-proxy@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.32.9.tgz#c9e1643fea7a86520bc597aed28fff7db9f760be" + integrity sha512-QoLWveu8F9zk6I9GrgPUTwIosoiVuspktV8o9jOgXqR0ERsufv9B4mCgEbxOR6LaVWDtrnma/8x3m141+nMWug== dependencies: - "@sora-substrate/math" "1.32.7" + "@sora-substrate/math" "1.32.9" -"@sora-substrate/math@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.32.7.tgz#6beeb5e7dcd51a9031d6a5731427df9c2a022585" - integrity sha512-2ps8s5ZAgj6DIMJtYXxxtFs1I72xlJYI7MbAEDFAYonONjqcfO+OYYWIk5EwkkKHKrer49LsDB36qlIyqxqDWg== +"@sora-substrate/math@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.32.9.tgz#bd4a37d91206b7c13477a2735fd5ab64a1b8c26d" + integrity sha512-OCpiiYzU0EkQl0tLNPWT5VCTOwzIAJU5p3B+Xpyo9vKueaW0OfCRRHqfqwoLN9MGcZT502ygn9XqbP5171i3LQ== dependencies: "@polkadot/types" "9.14.2" bignumber.js "^9.1.2" lodash "^4.17.21" -"@sora-substrate/type-definitions@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.32.7.tgz#91757e50c89ce32bb12fd70efee94ac5f43bb278" - integrity sha512-zFUXj9QA7XAiEp60PCkOp0Hgo3U1R+7lTscgLoylsftQW8TAz5vj8rtVQjtbhOxIAd4jEcFlBtuvpgCp7SywpQ== +"@sora-substrate/type-definitions@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.32.9.tgz#2edcdafe37dd7b68de656d8177ca2a379a2ec5ec" + integrity sha512-o/MY1ooQULwyp80x9eIsZOxL8rH+zYOcgrhnslsAb5CCW0wgZxnzMnC7GrtXuphyFFfxKB3E13EyqbOfXN1SUA== dependencies: "@open-web3/orml-type-definitions" "1.1.4" -"@sora-substrate/types@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.32.7.tgz#9dc98442d333aa07d4eaf8b770bfe0cd1a5a4e8a" - integrity sha512-7BoPvbfEBFndJz6YxS0NnBaasfd2ObaBoNKDbiFDnp4JUFOCmwJoND3x78WuSo7jp6qL4HtgUK4kihbQxUpRFA== +"@sora-substrate/types@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.32.9.tgz#93554462861a7fd337156d40bba38400fd79a2a1" + integrity sha512-lYlLAwlurlQRknyu1xGuW5vZX/QjxLEI1Pc7MorZHB3KHFXNldmP+RuN0saTz568wYTY3BpYTmUcsXBJagtcbQ== dependencies: "@open-web3/api-mobx" "0.9.4-26" "@open-web3/orml-types" "1.1.4" "@polkadot/api" "9.14.2" "@polkadot/typegen" "9.14.2" "@polkadot/types" "9.14.2" - "@sora-substrate/type-definitions" "1.32.7" + "@sora-substrate/type-definitions" "1.32.9" -"@sora-substrate/util@1.32.7": - version "1.32.7" - resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.32.7.tgz#a556730afe954613328cb50bf2403ea5266f6aaa" - integrity sha512-THjeHA04Kj6Yd4HjEaNZT1pwAxrW7bXwe2vSB+MySlPP9yLFsuFAPoJV4irXcz8vltAuFe1nlfxZnjHoPXTksA== +"@sora-substrate/util@1.32.9": + version "1.32.9" + resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.32.9.tgz#ac9e1afbbf4fb2c87cbd63a49668dbaa989d0f09" + integrity sha512-hffi7Hl0UT0vB3xNyGqkEG6Z9/Ws9OWjNyvhbOW9PzoNrtDR98sa2NTwjUhtA/pm6T9jQmaDQBB78xms2PdiRw== dependencies: "@polkadot/ui-keyring" "2.12.1" - "@sora-substrate/api" "1.32.7" - "@sora-substrate/connection" "1.32.7" - "@sora-substrate/liquidity-proxy" "1.32.7" - "@sora-substrate/math" "1.32.7" - "@sora-substrate/types" "1.32.7" + "@sora-substrate/api" "1.32.9" + "@sora-substrate/connection" "1.32.9" + "@sora-substrate/liquidity-proxy" "1.32.9" + "@sora-substrate/math" "1.32.9" + "@sora-substrate/types" "1.32.9" axios "^1.6.7" crypto-js "^4.2.0" lodash "^4.17.21" @@ -2443,13 +2443,13 @@ vue-property-decorator "^9.1.2" vuex "^3.6.2" -"@soramitsu/soraneo-wallet-web@1.32.4": - version "1.32.4" - resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.32.4.tgz#0a82fbf24d748ed9645fd0a01d8df891c1b41ea7" - integrity sha512-JGHDOkse0LQL0s1RXUNZ84s3C8+OowEdMeItwkKm/6eLgv+e9hntPIjz2JcQ2h6VgXO+mUuyhvYtMrNChM/ilg== +"@soramitsu/soraneo-wallet-web@1.32.5": + version "1.32.5" + resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.32.5.tgz#335267c02cca234b0d6b35a23024612c5bb24b33" + integrity sha512-YJLHlap1ceA+RAqEoIOM6jYISkH4/FFefzVjyGvPiy12hnfzRH7PVQ0UVrVow2213JsGIER2I3hROOEDKip+sQ== dependencies: "@polkadot/vue-identicon" "2.12.1" - "@sora-substrate/util" "1.32.7" + "@sora-substrate/util" "1.32.9" "@sora-test/wallet-connect" "^0.0.9" "@soramitsu-ui/ui-vue2" "^1.1.1" "@urql/core" "^4.1.2"