diff --git a/src/components/dashboard/Dashboard.vue b/src/components/dashboard/Dashboard.vue index a85de47f8..4104b7869 100644 --- a/src/components/dashboard/Dashboard.vue +++ b/src/components/dashboard/Dashboard.vue @@ -64,6 +64,7 @@ import Collators from 'src/components/dashboard/Collators.vue'; import NetworkStatus from 'src/components/dashboard/NetworkStatus.vue'; import TokenPriceChart from 'src/components/dashboard/TokenPriceChart.vue'; // import TotalTransactionsChart from 'src/components/dashboard/TotalTransactionsChart.vue'; +import { useDataCalculations } from 'src/staking-v3/hooks'; import TvlChart from 'src/components/dashboard/TvlChart.vue'; import { useNetworkInfo, useTvlHistorical } from 'src/hooks'; import { textChart } from 'src/modules/token-api'; @@ -94,9 +95,13 @@ export default defineComponent({ handleMergedTvlFilterChanged, filteredMergedTvl, mergedTvlAmount, - lenStakers, } = useTvlHistorical(); + const { numberOfStakersAndLockers } = useDataCalculations(); + const lenStakers = computed( + () => `${numberOfStakersAndLockers.value.stakersCount.toLocaleString('en-US')} stakers` + ); + const dappStakingTvlTokensDisplay = computed( () => `${dappStakingTvlTokens.value} ${nativeTokenSymbol.value}` ); diff --git a/src/hooks/useTvlHistorical.ts b/src/hooks/useTvlHistorical.ts index d5259b139..5a37e737d 100644 --- a/src/hooks/useTvlHistorical.ts +++ b/src/hooks/useTvlHistorical.ts @@ -3,7 +3,6 @@ import { $api } from 'src/boot/api'; import { computed, ref, watch } from 'vue'; import { useNetworkInfo } from 'src/hooks'; import { - getDappStakers, getTvlData, filterTvlData, mergeTvlArray, @@ -32,11 +31,6 @@ export function useTvlHistorical() { const { currentNetworkName } = useNetworkInfo(); - const fetchDappStakers = async (api: ApiPromise) => { - const result = await getDappStakers({ api }); - lenStakers.value = `${result.toLocaleString('en-US')} stakers`; - }; - const loadData = async (network: string): Promise => { const { mergedTvlData, @@ -147,11 +141,7 @@ export function useTvlHistorical() { const api = $api; try { if (!currentNetworkName.value || !currentNetworkName.value.length || !api) return; - await Promise.all([ - loadData(currentNetworkName.value.toLowerCase()), - fetchDappStakers(api), - getTvl(), - ]); + await Promise.all([loadData(currentNetworkName.value.toLowerCase()), getTvl()]); } catch (error) { console.error(error); } @@ -168,7 +158,6 @@ export function useTvlHistorical() { ecosystemTvlAmount, ecosystemTvl, dappStakingTvl, - lenStakers, dappStakingTvlTokens, handleMergedTvlFilterChanged, handleDappStakingTvlFilterChanged, diff --git a/src/staking-v3/hooks/useDappStaking.ts b/src/staking-v3/hooks/useDappStaking.ts index dff1125d1..f9ed7938a 100644 --- a/src/staking-v3/hooks/useDappStaking.ts +++ b/src/staking-v3/hooks/useDappStaking.ts @@ -80,7 +80,7 @@ export function useDappStaking() { }); const totalStakerRewards = computed( - () => rewards.value.staker.amount + rewards.value.bonus + () => BigInt(rewards.value.staker.amount) + BigInt(rewards.value.bonus) ); const constants = computed(() => {