Skip to content

Commit 383fcb3

Browse files
committed
Build 1.1.7
1 parent 5380390 commit 383fcb3

29 files changed

+1737
-1717
lines changed

dist/api/Api.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Api extends _DataCollector.DataCollector {
8686
}
8787
}
8888
getStats() {
89-
return this.formatData(this.stats);
89+
return this.stats;
9090
}
9191
getCirculatingSupply() {
9292
return this.formatData(this.circulatingSupply);
@@ -151,11 +151,11 @@ class Api extends _DataCollector.DataCollector {
151151
if (!stats) return;
152152

153153
/* const ExtendedStats = this.getModule('ExtendedStats')
154-
if (ExtendedStats) {
155-
const blockNumber = parseInt(stats.blockNumber)
156-
const extendedStats = await ExtendedStats.getExtendedStats(blockNumber)
157-
Object.assign(stats, extendedStats)
158-
} */
154+
if (ExtendedStats) {
155+
const blockNumber = parseInt(stats.blockNumber)
156+
const extendedStats = await ExtendedStats.getExtendedStats(blockNumber)
157+
Object.assign(stats, extendedStats)
158+
} */
159159
let circulatingSupply = stats.circulatingSupply || (await this.getCirculatingSupplyFromDb());
160160
this.circulatingSupply = circulatingSupply;
161161
this.stats = Object.assign({}, stats);

dist/api/lib/DataCollector/DataCollectorItem.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class DataCollectorItem {
6262
async getLatest(query, project) {
6363
query = query || {};
6464
const result = await (0, _pagination.find)(this.db, query, this.sort, 1, project);
65-
return result.length ? result[0] : null;
65+
const data = result.length ? result[0] : null;
66+
return { data };
6667
}
6768

6869
async setFieldsTypes() {
@@ -127,10 +128,10 @@ class DataCollectorItem {
127128
}
128129
}
129130
/**
130-
* Resolves item query parsing params
131-
* @param {*} query
132-
* @param {*} params
133-
*/
131+
* Resolves item query parsing params
132+
* @param {*} query
133+
* @param {*} params
134+
*/
134135
async getItem(query, { fields, getPrevNext }) {
135136
try {
136137
let data = await this.getOne(query, fields);

dist/api/lib/difficultyCalculator.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
class DifficultyCalculator {
44
/**
5-
* Given an array of blocks, a period of time and a bucket size. Returns an array with the average
6-
* block difficulty for each bucket.
7-
*
8-
* @param {*} blocks An array of blocks with timestamp and difficulty
9-
* @param {*} tstart Period start time
10-
* @param {*} tend Period end time
11-
* @param {*} bucketSize Bucket time size to divide the period in
12-
*/
5+
* Given an array of blocks, a period of time and a bucket size. Returns an array with the average
6+
* block difficulty for each bucket.
7+
*
8+
* @param {*} blocks An array of blocks with timestamp and difficulty
9+
* @param {*} tstart Period start time
10+
* @param {*} tend Period end time
11+
* @param {*} bucketSize Bucket time size to divide the period in
12+
*/
1313
difficulties(blocks, tstart, tend, bucketSize) {
1414
if (!Array.isArray(blocks) || tend < tstart) {
1515
return [];

0 commit comments

Comments
 (0)