diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx
index ef16e8ec42..63377b45b8 100644
--- a/packages/page-staking/src/Overview/Address/index.tsx
+++ b/packages/page-staking/src/Overview/Address/index.tsx
@@ -52,7 +52,7 @@ function expandInfo ({ exposure, validatorPrefs }: ValidatorInfo): StakingState
let stakeOther: BN | undefined;
let stakeOwn: BN | undefined;
- if (exposure) {
+ if (exposure && exposure.total) {
nominators = exposure.others.map(({ value, who }) => ({ nominatorId: who.toString(), value: value.unwrap() }));
stakeTotal = exposure.total.unwrap();
stakeOwn = exposure.own.unwrap();
diff --git a/packages/page-staking/src/Overview/Summary.tsx b/packages/page-staking/src/Overview/Summary.tsx
index 9485216949..08f60fe86d 100644
--- a/packages/page-staking/src/Overview/Summary.tsx
+++ b/packages/page-staking/src/Overview/Summary.tsx
@@ -49,7 +49,7 @@ function Summary ({ className = '', isVisible, stakingOverview, targets: { infla
{nominators.length}
)}
- {(inflation > 0) && (
+ {(inflation > 0) && Number.isFinite(inflation) && (
('inflation')}
diff --git a/packages/page-staking/src/Targets/Summary.tsx b/packages/page-staking/src/Targets/Summary.tsx
index 9291f213ca..7f71b43abb 100644
--- a/packages/page-staking/src/Targets/Summary.tsx
+++ b/packages/page-staking/src/Targets/Summary.tsx
@@ -86,7 +86,7 @@ function Summary ({ avgStaked, lowStaked, numNominators, numValidators, stakedRe
/>
- {(stakedReturn > 0) && (
+ {(stakedReturn > 0) && Number.isFinite(stakedReturn) && (
('returns')}
@@ -97,7 +97,7 @@ function Summary ({ avgStaked, lowStaked, numNominators, numValidators, stakedRe
>
)}
- {avgStaked && lowStaked && (
+ {avgStaked?.gtn(0) && lowStaked?.gtn(0) && (
('lowest / avg staked')}`}
diff --git a/packages/page-staking/src/types.ts b/packages/page-staking/src/types.ts
index 45db05f35c..58e23129de 100644
--- a/packages/page-staking/src/types.ts
+++ b/packages/page-staking/src/types.ts
@@ -46,9 +46,9 @@ interface ValidatorInfoRank {
export interface ValidatorInfo extends ValidatorInfoRank {
accountId: AccountId;
bondOther: BN;
- bondOwn: Balance;
+ bondOwn: BN;
bondShare: number;
- bondTotal: Balance;
+ bondTotal: BN;
commissionPer: number;
exposure: Exposure;
isActive: boolean;
diff --git a/packages/page-staking/src/useSortedTargets.ts b/packages/page-staking/src/useSortedTargets.ts
index 81ab1b6a76..1010eabe45 100644
--- a/packages/page-staking/src/useSortedTargets.ts
+++ b/packages/page-staking/src/useSortedTargets.ts
@@ -84,9 +84,10 @@ function extractSingle (api: ApiPromise, allAccounts: string[], derive: DeriveSt
const emptyExposure = api.createType('Exposure');
const earliestEra = historyDepth && lastEra.sub(historyDepth).addn(1);
const list = derive.info.map(({ accountId, exposure = emptyExposure, stakingLedger, validatorPrefs }): ValidatorInfo => {
- // some overrides (e.g. Darwinia Crab) does not have the own field in Exposure
- let bondOwn = exposure.own?.unwrap() || BN_ZERO;
- let bondTotal = exposure.total?.unwrap() || BN_ZERO;
+ // some overrides (e.g. Darwinia Crab) does not have the own/total field in Exposure
+ let [bondOwn, bondTotal] = exposure.total
+ ? [exposure.own.unwrap(), exposure.total.unwrap()]
+ : [BN_ZERO, BN_ZERO];
const skipRewards = bondTotal.isZero();
if (bondTotal.isZero()) {
@@ -182,8 +183,6 @@ function extractInfo (api: ApiPromise, allAccounts: string[], electedDerive: Der
const waitingIds = waiting.map(({ key }) => key);
const validatorIds = arrayFlatten([electedIds, waitingIds]);
- console.log(JSON.stringify(validators.filter(({ isElected }) => !isElected), null, 2));
-
return {
avgStaked,
inflation,