From f34d53a9364d9650239f2141c8cc454c027fdeaa Mon Sep 17 00:00:00 2001 From: Uncle Fatso Date: Wed, 20 Aug 2025 20:52:58 +0300 Subject: [PATCH] addressed tsc build errors to restore successful build process Signed-off-by: Uncle Fatso --- package.json | 2 +- src/containers/Nominations.tsx | 9 +++++---- src/hooks/useLedger.tsx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 83592cd..98d20ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghost-lite", - "version": "0.1.2", + "version": "0.1.3", "description": "Web application for Ghost and Casper chain.", "author": "Uncle f4ts0 ", "maintainers": [ diff --git a/src/containers/Nominations.tsx b/src/containers/Nominations.tsx index eb8428d..d60ffc7 100644 --- a/src/containers/Nominations.tsx +++ b/src/containers/Nominations.tsx @@ -34,6 +34,7 @@ import { useUnbondCalldata, useUnstableProvider, RewardPoints, + Unlocking, } from "../hooks" import { @@ -208,7 +209,7 @@ export const Nominations = () => { const eraRewardPoints = useEraRewardPoints({ eraIndex: eraIndex?.index }) const currentValidators = useCurrentValidators({ address: interestingValidator }) const validatorOverview = useValidatorsOverview({ eraIndex: eraIndex?.index, address: interestingValidator }) -console.log(ledger) + const tokenDecimals: number = chainSpecV1?.properties?.tokenDecimals ?? 0 const tokenSymbol: string = chainSpecV1?.properties?.tokenSymbol ?? "" @@ -256,7 +257,7 @@ console.log(ledger) }, [payee]) const readyToWithdraw = useMemo(() => { - return ledger?.unlocking.reduce((acc, item) => { + return ledger?.unlocking.reduce((acc: bigint, item: Unlocking) => { if ((eraIndex?.index ?? 0) >= item.era) { return item.value } @@ -265,7 +266,7 @@ console.log(ledger) }, [ledger, eraIndex]) const waitingForWithdraw = useMemo(() => { - return ledger?.unlocking.reduce((acc, item) => { + return ledger?.unlocking.reduce((acc: bigint, item: Unlocking) => { if ((eraIndex?.index ?? 0) < item.era) { return item.value } @@ -274,7 +275,7 @@ console.log(ledger) }, [ledger, eraIndex]) const latestWithdrawEra = useMemo(() => { - return Math.max(ledger?.unlocking.map(el => el.era - (eraIndex?.index ?? 0)) ?? []) + return Math.max(ledger?.unlocking.map((el: Unlocking) => el.era - (eraIndex?.index ?? 0)) ?? []) }, [eraIndex, ledger]) useEffect(() => { diff --git a/src/hooks/useLedger.tsx b/src/hooks/useLedger.tsx index 06e151b..b40f50b 100644 --- a/src/hooks/useLedger.tsx +++ b/src/hooks/useLedger.tsx @@ -6,7 +6,7 @@ import { distinct, filter, map, mergeMap } from "rxjs" import { useUnstableProvider } from "./useUnstableProvider" import { useMetadata } from "./useMetadata" -type Unlocking = { +export type Unlocking = { value: bigint era: number }