-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed staking data and country names
- Loading branch information
Showing
6 changed files
with
59 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @file getApiStakingSubnetSum | ||
* @copyright Copyright (c) 2018-2023 Dylan Miller and icpexplorer contributors | ||
* @license MIT License | ||
*/ | ||
|
||
/** | ||
* Return the sum of values from an array of subset objects in the ic-api.internetcomputer.org/api | ||
* response of a staking-related endpoint. | ||
* @param {Array} subsets An array of subset objects in the API response of a staking-related | ||
* endpoint. | ||
* @returns {number} The sum of values from all subsets. | ||
*/ | ||
export default function getApiStakingSubnetSum(subsets) { | ||
return subsets.reduce((acc, subset) => acc + Number(subset.value[1]), 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters