diff --git a/src/hooks/use-collator-power.ts b/src/hooks/use-collator-power.ts index 0dde9f7..daf51de 100644 --- a/src/hooks/use-collator-power.ts +++ b/src/hooks/use-collator-power.ts @@ -35,7 +35,11 @@ export const useCollatorPower = ( let sub$$: Subscription | undefined; if (polkadotApi) { - sub$$ = from(polkadotApi.query.darwiniaStaking.exposureCacheStates()) + sub$$ = from( + polkadotApi.query.darwiniaStaking.exposureCacheStates + ? polkadotApi.query.darwiniaStaking.exposureCacheStates() + : polkadotApi.query.darwiniaStaking.cacheStates() + ) .pipe( switchMap((cacheStates) => { const index = (cacheStates.toJSON() as ExposureCacheState[]).findIndex((cs) => cs === "Current"); diff --git a/src/providers/staking-provider.tsx b/src/providers/staking-provider.tsx index 795eb7d..bfa9d7b 100644 --- a/src/providers/staking-provider.tsx +++ b/src/providers/staking-provider.tsx @@ -125,7 +125,7 @@ export function StakingProvider({ children }: PropsWithChildren) { const calcExtraPower = useCallback((stakingRing: bigint, stakingKton: bigint) => stakingRing + stakingKton, []); useEffect(() => { - setMinimumDeposit(BigInt(polkadotApi?.consts.deposit.minLockingAmount.toString() || 0)); + setMinimumDeposit(BigInt(polkadotApi?.consts.deposit.minLockingAmount?.toString() || 0)); setMaxCommission(Number(polkadotApi?.consts.darwiniaStaking.maxCommission?.toJSON() || 1000000000) / 10000000); }, [polkadotApi]);