Commit 96748a37 authored by Guy Thouret's avatar Guy Thouret

(feat) Return reward factors as objects in v1/blockchain/contributions API endpoint - #810

1 merge request!285Reward Factors for User Activity
Pipeline #82551087 failed with stages
in 4 minutes
......@@ -35,6 +35,14 @@ class overview implements Interfaces\Api
return $value * $rewardFactor;
}, Contributions\ContributionValues::$multipliers);
$rewardFactors = [];
foreach (RewardFactor::$values as $userState => $value) {
$rewardFactors[] = [
'userState' => $userState,
'rewardFactor' => $value
];
}
$response = [
'nextPayout' => $overview->getNextPayout(),
'currentReward' => $overview->getCurrentReward(),
......@@ -43,7 +51,7 @@ class overview implements Interfaces\Api
'yourShare' => $overview->getYourShare(),
'yourRewardFactor' => $overview->getYourRewardFactor(),
'contributionValues' => $contributionValues,
'rewardFactors' => RewardFactor::$values
'rewardFactors' => $rewardFactors
];
return Factory::response($response);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment