diff --git a/public/images/dapp_promotions/age_of_chronos.png b/public/images/dapp_promotions/age_of_chronos.png deleted file mode 100644 index db705d7b9..000000000 Binary files a/public/images/dapp_promotions/age_of_chronos.png and /dev/null differ diff --git a/src/App.vue b/src/App.vue index 6236da13e..b4f84af73 100644 --- a/src/App.vue +++ b/src/App.vue @@ -59,7 +59,7 @@ import { import { setCurrentWallet } from 'src/v2/app.container'; import { container } from 'src/v2/common'; import { Symbols } from 'src/v2/symbols'; -import { useAccount, useAppRouter } from 'src/hooks'; +import { useAccount, useAppRouter, useBlockTime } from 'src/hooks'; import { ETHEREUM_EXTENSION } from 'src/modules/account'; import { LOCAL_STORAGE } from 'src/config/localStorage'; import { @@ -98,6 +98,7 @@ export default defineComponent({ } = useDappStaking(); const { fetchStakeAmountsToStore, fetchDappsToStore } = useDapps(); const { fetchActiveConfigurationToStore, fetchInflationParamsToStore } = useInflation(); + const { fetchBlockTimeToStore } = useBlockTime(); const isLoading = computed(() => store.getters['general/isLoading']); const showAlert = computed(() => store.getters['general/showAlert']); const isEthWallet = computed(() => store.getters['general/isEthWallet']); @@ -150,6 +151,8 @@ export default defineComponent({ .get(Symbols.DappStakingRepositoryV3) .startProtocolStateSubscription(); } + + fetchBlockTimeToStore(); }); eventAggregator.subscribe(ProtocolStateChangedMessage.name, async (m) => { diff --git a/src/constants.ts b/src/constants.ts index 6f92e9ac3..458997485 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -2,6 +2,8 @@ export enum HttpCodes { NotFound = 404, } +export const ORIGINAL_BLOCK_TIME = 12; + export const PERIOD1_START_BLOCKS = new Map([ ['astar', 5514935], ['shiden', 5876079], diff --git a/src/data/dapp_promotions.json b/src/data/dapp_promotions.json index 393625af0..c41014755 100644 --- a/src/data/dapp_promotions.json +++ b/src/data/dapp_promotions.json @@ -47,12 +47,6 @@ "link": "https://www.apexchimpz.com/dapp-on-astar", "img": "images/dapp_promotions/apeXchimpz.jpg" }, - { - "name": "Age Of Chronos", - "shortDescription": "Stake and earn FREE $Astr and nfts! Play and craft NFTs 2.0!", - "link": "https://twitter.com/SFY_Labs", - "img": "images/dapp_promotions/age_of_chronos.png" - }, { "name": "Algem - Liquid Staking", "shortDescription": "Receive one liquid nASTR token for every ASTR token you stake. Then use nASTR to yield farm on the ecosystem to maximize your earnings.", diff --git a/src/hooks/index.ts b/src/hooks/index.ts index d84a4986c..d79c94875 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -38,3 +38,4 @@ export * from './bridge/useLayerZeroBridge'; export * from './useTokenDistribution'; export * from './useTokenCirculation'; export * from './useInflation'; +export * from './useBlockTime'; diff --git a/src/hooks/useBlockTime.ts b/src/hooks/useBlockTime.ts new file mode 100644 index 000000000..d0570535f --- /dev/null +++ b/src/hooks/useBlockTime.ts @@ -0,0 +1,20 @@ +import { computed } from 'vue'; +import { useStore } from 'src/store'; +import { container } from 'src/v2/common'; +import { ISystemRepository } from 'src/v2/repositories'; +import { Symbols } from 'src/v2/symbols'; + +export function useBlockTime() { + const store = useStore(); + const blockTimeInSeconds = computed( + () => store.getters['general/getBlockTimeInSeconds'] + ); + + const fetchBlockTimeToStore = async () => { + const systemRepository = container.get(Symbols.SystemRepository); + const blockTime = await systemRepository.getBlockTimeInSeconds(); + store.commit('general/setBlockTime', blockTime); + }; + + return { blockTimeInSeconds, fetchBlockTimeToStore }; +} diff --git a/src/staking-v3/components/vote/VotingWizard.vue b/src/staking-v3/components/vote/VotingWizard.vue index c5d1bb749..348c02afe 100644 --- a/src/staking-v3/components/vote/VotingWizard.vue +++ b/src/staking-v3/components/vote/VotingWizard.vue @@ -74,10 +74,10 @@