From fd5ecbcbd089771ce0b38fd5d7ef4758914a5ba3 Mon Sep 17 00:00:00 2001 From: Bojan Angjelkoski Date: Wed, 28 Aug 2024 08:05:40 +0200 Subject: [PATCH] refactor: revert actual apr --- layer/store/param.ts | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/layer/store/param.ts b/layer/store/param.ts index 3c509f2..f99b586 100644 --- a/layer/store/param.ts +++ b/layer/store/param.ts @@ -3,13 +3,13 @@ import { Pool, MinModuleParams as MintModuleParams } from '@injectivelabs/sdk-ts' -import { HttpClient, BigNumberInBase } from '@injectivelabs/utils' +import { BigNumberInBase } from '@injectivelabs/utils' import { injToken } from './../data/token' import { mintApi, bankApi, stakingApi } from './../Service' import { sharedToBalanceInToken } from './../utils/formatter' -const ACTUAL_BLCOk_TIME = 0.625194000005722 -const ACTUAL_BLOCKS_PER_YEAR = 50441942.82048672 +const ACTUAL_BLOCK_TIME = 0.75 +const ACTUAL_BLOCKS_PER_YEAR = 42_048_000 type ParamStoreState = { injSupply: string @@ -100,31 +100,10 @@ export const useSharedParamStore = defineStore('sharedParam', { async fetchChainParams() { const paramStore = useSharedParamStore() - const httpClient = new HttpClient('https://chains.cosmos.directory/') - - try { - const { data } = (await httpClient.get('injective')) as { - data: { - chain: { - params: { - actual_block_time: number - actual_blocks_per_year: number - } - } - } - } - - paramStore.$patch({ - actualBlockTime: data.chain.params.actual_block_time, - actualBlocksPerYear: data.chain.params.actual_blocks_per_year - }) - } catch (error: any) { - // silently throw - paramStore.$patch({ - actualBlockTime: ACTUAL_BLCOk_TIME, - actualBlocksPerYear: ACTUAL_BLOCKS_PER_YEAR - }) - } + paramStore.$patch({ + actualBlockTime: ACTUAL_BLOCK_TIME, + actualBlocksPerYear: ACTUAL_BLOCKS_PER_YEAR + }) } } })