From 06aa139bf5ee50a5a534b820d6b0ea7ba164a563 Mon Sep 17 00:00:00 2001 From: Bobo Date: Fri, 19 Jul 2024 08:21:29 +0200 Subject: [PATCH] User burn events in inflation charts (#1357) * Initial logic with dummy data * Load burn events from Token API --- src/components/dashboard/Inflation.vue | 12 +- .../dashboard/InflationRateChart.vue | 17 ++- src/hooks/useInflation.ts | 118 ++++++++++++------ src/v2/repositories/ITokenApiRepository.ts | 13 ++ .../implementations/SubscanRepository.ts | 2 +- .../implementations/TokenApiRepository.ts | 19 ++- 6 files changed, 132 insertions(+), 49 deletions(-) diff --git a/src/components/dashboard/Inflation.vue b/src/components/dashboard/Inflation.vue index 1e1a134fe..963724f21 100644 --- a/src/components/dashboard/Inflation.vue +++ b/src/components/dashboard/Inflation.vue @@ -88,12 +88,12 @@ export default defineComponent({ const numberFromPercentage = (value?: number): number | string => value !== undefined ? value * 100 : '--'; - const adjustableStakersPercentage = computed(() => - Number( - ( - realizedAdjustableStakersPart.value / inflationParameters.value.adjustableStakersPart - ).toFixed(3) - ) + const adjustableStakersPercentage = computed( + () => + Math.round( + (realizedAdjustableStakersPart.value / inflationParameters.value.adjustableStakersPart) * + 100 + ) / 100 ); watch( diff --git a/src/components/dashboard/InflationRateChart.vue b/src/components/dashboard/InflationRateChart.vue index 79c855e0f..64c411dda 100644 --- a/src/components/dashboard/InflationRateChart.vue +++ b/src/components/dashboard/InflationRateChart.vue @@ -22,7 +22,7 @@