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 }