From 72f4c48c59a68bd6fe4f8a2e3467e248e70d80b9 Mon Sep 17 00:00:00 2001 From: Piotr Gesicki Date: Wed, 20 Dec 2023 22:06:28 +0100 Subject: [PATCH 1/2] feat: display paired token rewards under pool details --- .../business/services/DataService/DataService.ts | 8 ++++++++ app/src/views/PoolPage/PoolItem.tsx | 15 +++++++++++++++ app/src/views/PoolPage/usePoolPageData.tsx | 8 +++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/src/business/services/DataService/DataService.ts b/app/src/business/services/DataService/DataService.ts index 325d5f8be..9c5dc0401 100644 --- a/app/src/business/services/DataService/DataService.ts +++ b/app/src/business/services/DataService/DataService.ts @@ -63,6 +63,7 @@ export type UserRewards = { export type LPUserReward = { poolLPDistributionReceivedInRowan: number; poolRewardsReceivedInRowan: number; + poolRewardsReceivedInPairedToken: number; }; export type LPUserRewards = { @@ -72,6 +73,7 @@ export type LPUserRewards = { totalRewardsReceivedInRowan: string; poolLPDistributionReceivedInRowan: string; poolRewardsReceivedInRowan: string; + poolRewardsReceivedInPairedToken: number; }; export type LPUserRewardsResponse = { @@ -298,14 +300,17 @@ export default class DataService { poolLPDistributionReceivedInRowan: Math.random() * 10000, poolRewardsReceivedInRowan: Math.random() * 10000, + poolRewardsReceivedInPairedToken: Math.random() * 10000, }, ujuno: { poolLPDistributionReceivedInRowan: Math.random() * 10000, poolRewardsReceivedInRowan: Math.random() * 10000, + poolRewardsReceivedInPairedToken: Math.random() * 10000, }, uatom: { poolLPDistributionReceivedInRowan: Math.random() * 10000, poolRewardsReceivedInRowan: Math.random() * 10000, + poolRewardsReceivedInPairedToken: Math.random() * 10000, }, }, }, @@ -332,6 +337,9 @@ export default class DataService { poolRewardsReceivedInRowan: Number( entry.poolRewardsReceivedInRowan, ), + poolRewardsReceivedInPairedToken: Number( + entry.poolRewardsReceivedInPairedToken, + ), }, }), {}, diff --git a/app/src/views/PoolPage/PoolItem.tsx b/app/src/views/PoolPage/PoolItem.tsx index 74964f89a..33fd935d4 100644 --- a/app/src/views/PoolPage/PoolItem.tsx +++ b/app/src/views/PoolPage/PoolItem.tsx @@ -226,6 +226,21 @@ export default defineComponent({ ], ...(this.lppdRewards ? [ + Boolean(this.lppdRewards.poolRewardsReceivedInPairedToken) && [ + + Your total rewards paid in the pool in the paired token + , + + {prettyNumber( + this.lppdRewards.poolRewardsReceivedInPairedToken, + )} + + , + ], Boolean( this.isLPDActive && this.lppdRewards.poolLPDistributionReceivedInRowan, diff --git a/app/src/views/PoolPage/usePoolPageData.tsx b/app/src/views/PoolPage/usePoolPageData.tsx index 3ab29bb6a..57c974ec5 100644 --- a/app/src/views/PoolPage/usePoolPageData.tsx +++ b/app/src/views/PoolPage/usePoolPageData.tsx @@ -180,9 +180,11 @@ export const usePoolPageData = () => { ); const pool = useCore().store.pools[poolKey]; - - const denomOrSymbol = - pool.externalAmount.ibcDenom ?? pool.externalAmount.symbol; + const ibcDenom = + tokenRegistryEntriesQuery.data.value?.registry?.entries.find( + (y) => y.baseDenom === pool.externalAmount.symbol, + )?.denom; + const denomOrSymbol = ibcDenom ?? pool.externalAmount.symbol; const lppdPoolRewards = lppdRewards?.value?.hasRewards ? lppdRewards.value.rewards.byPool[denomOrSymbol] From 16d9038ecb0ab4cc3863f580d3a9ba59e299b7b2 Mon Sep 17 00:00:00 2001 From: Piotr Gesicki Date: Wed, 20 Dec 2023 22:06:54 +0100 Subject: [PATCH 2/2] testnet release 2.14.29 --- app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/package.json b/app/package.json index d2630e172..a7682e8d4 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.14.28", + "version": "2.14.29", "private": true, "scripts": { "bump": "bump patch --tag --commit 'testnet release '",