From 032ea901275636e3c9c4393ac1e69430f4d5a26a Mon Sep 17 00:00:00 2001 From: "yevhen.burkovskyi" Date: Wed, 19 Jun 2024 16:47:36 +0300 Subject: [PATCH] fix: fixed eror with claimable reward, add mul 100 for bounded tokens --- src/modules/staking/services/staking.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/staking/services/staking.service.ts b/src/modules/staking/services/staking.service.ts index d13b306..7fd65d8 100644 --- a/src/modules/staking/services/staking.service.ts +++ b/src/modules/staking/services/staking.service.ts @@ -120,7 +120,9 @@ export class StakingService implements OnModuleInit { validatorAddress?: string ) { return rewards - .filter((val) => val.validator_address === validatorAddress) + .filter((val) => + validatorAddress ? val.validator_address === validatorAddress : true + ) .reduce( (acc, val) => acc + @@ -164,7 +166,10 @@ export class StakingService implements OnModuleInit { totalValidators: rez[0].pagination.total, apr: rez[1], totalStaked, - bondedTokens: Big(rez[3].pool.bonded_tokens).div(rez[2]!.amount).toString(), + bondedTokens: Big(rez[3].pool.bonded_tokens) + .div(rez[2]!.amount) + .mul(100) + .toString(), }; await this.cache.setGlobalStakedOverview(dto);