bulltrackers-module 1.0.59 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -388,11 +388,17 @@ async function getSpeculatorsToUpdate(dependencies, config) {
388
388
 
389
389
  snapshot.forEach(doc => {
390
390
  const blockData = doc.data();
391
- const users = blockData.users || {};
391
+ // const users = blockData.users || {}; // <<< REMOVED
392
+
393
+ // Iterate over the document's top-level keys
394
+ for (const key in blockData) {
395
+ // Filter for keys that match the 'users.CID' format
396
+ if (!key.startsWith('users.')) continue;
392
397
 
393
- for (const key in users) {
394
398
  const userId = key.split('.')[1];
395
- const userData = users[key];
399
+ if (!userId) continue; // Safety check
400
+
401
+ const userData = blockData[key]; // Get the user's map
396
402
 
397
403
  const lastVerified = userData.lastVerified?.toDate ? userData.lastVerified.toDate() : new Date(0);
398
404
  const lastHeld = userData.lastHeldSpeculatorAsset?.toDate ? userData.lastHeldSpeculatorAsset.toDate() : new Date(0);
@@ -78,8 +78,8 @@ exports.runUserActivitySampler = async (config, dependencies) => {
78
78
  try {
79
79
  selectedHeader = await headerManager.selectHeader();
80
80
  if (!selectedHeader) throw new Error("Could not select header.");
81
-
82
- const response = await proxyManager.fetch(config.rankingsApiUrl, {
81
+ const urlWithParam = `${config.rankingsApiUrl}?Period=LastTwoYears`;
82
+ const response = await proxyManager.fetch(urlWithParam, {
83
83
  method: 'POST',
84
84
  headers: { ...selectedHeader.header, 'Content-Type': 'application/json' },
85
85
  body: JSON.stringify(cidsToSample),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [