pyre-world-kit 1.0.19 → 1.0.20
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.
- package/dist/intel.js +6 -8
- package/package.json +1 -1
- package/src/intel.ts +6 -9
package/dist/intel.js
CHANGED
|
@@ -55,7 +55,9 @@ async function getFactionLeaderboard(connection, opts) {
|
|
|
55
55
|
razed: 'reclaimed',
|
|
56
56
|
};
|
|
57
57
|
const sdkStatus = opts?.status ? statusMap[opts.status] : 'all';
|
|
58
|
-
|
|
58
|
+
// Fetch more than requested to account for non-pyre tokens being filtered out
|
|
59
|
+
const fetchLimit = Math.min((opts?.limit ?? 20) * 3, 100);
|
|
60
|
+
const result = await (0, torchsdk_1.getTokens)(connection, { limit: fetchLimit, status: sdkStatus });
|
|
59
61
|
const pyreFactions = result.tokens.filter(t => (0, vanity_1.isPyreMint)(t.mint));
|
|
60
62
|
const powers = pyreFactions.map((t) => ({
|
|
61
63
|
mint: t.mint,
|
|
@@ -287,14 +289,10 @@ async function getWorldFeed(connection, opts) {
|
|
|
287
289
|
* Global stats: total factions, total agents, total SOL locked.
|
|
288
290
|
*/
|
|
289
291
|
async function getWorldStats(connection) {
|
|
290
|
-
const
|
|
291
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 200, status: 'all' }),
|
|
292
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 100, status: 'bonding' }),
|
|
293
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 100, status: 'migrated' }),
|
|
294
|
-
]);
|
|
292
|
+
const all = await (0, torchsdk_1.getTokens)(connection, { limit: 200, status: 'all' });
|
|
295
293
|
const pyreAll = all.tokens.filter(t => (0, vanity_1.isPyreMint)(t.mint));
|
|
296
|
-
const pyreRising =
|
|
297
|
-
const pyreAscended =
|
|
294
|
+
const pyreRising = pyreAll.filter(t => t.status === 'bonding');
|
|
295
|
+
const pyreAscended = pyreAll.filter(t => t.status === 'migrated');
|
|
298
296
|
const allFactions = [...pyreRising, ...pyreAscended];
|
|
299
297
|
const totalSolLocked = allFactions.reduce((sum, t) => sum + t.market_cap_sol, 0);
|
|
300
298
|
// Find most powerful
|
package/package.json
CHANGED
package/src/intel.ts
CHANGED
|
@@ -75,7 +75,9 @@ export async function getFactionLeaderboard(
|
|
|
75
75
|
razed: 'reclaimed',
|
|
76
76
|
};
|
|
77
77
|
const sdkStatus = opts?.status ? statusMap[opts.status] as any : 'all';
|
|
78
|
-
|
|
78
|
+
// Fetch more than requested to account for non-pyre tokens being filtered out
|
|
79
|
+
const fetchLimit = Math.min((opts?.limit ?? 20) * 3, 100);
|
|
80
|
+
const result = await getTokens(connection, { limit: fetchLimit, status: sdkStatus });
|
|
79
81
|
const pyreFactions = result.tokens.filter(t => isPyreMint(t.mint));
|
|
80
82
|
|
|
81
83
|
const powers: FactionPower[] = pyreFactions.map((t) => ({
|
|
@@ -357,15 +359,10 @@ export async function getWorldFeed(
|
|
|
357
359
|
export async function getWorldStats(
|
|
358
360
|
connection: Connection,
|
|
359
361
|
): Promise<WorldStats> {
|
|
360
|
-
const
|
|
361
|
-
getTokens(connection, { limit: 200, status: 'all' }),
|
|
362
|
-
getTokens(connection, { limit: 100, status: 'bonding' }),
|
|
363
|
-
getTokens(connection, { limit: 100, status: 'migrated' }),
|
|
364
|
-
]);
|
|
365
|
-
|
|
362
|
+
const all = await getTokens(connection, { limit: 200, status: 'all' });
|
|
366
363
|
const pyreAll = all.tokens.filter(t => isPyreMint(t.mint));
|
|
367
|
-
const pyreRising =
|
|
368
|
-
const pyreAscended =
|
|
364
|
+
const pyreRising = pyreAll.filter(t => t.status === 'bonding');
|
|
365
|
+
const pyreAscended = pyreAll.filter(t => t.status === 'migrated');
|
|
369
366
|
const allFactions = [...pyreRising, ...pyreAscended];
|
|
370
367
|
const totalSolLocked = allFactions.reduce((sum, t) => sum + t.market_cap_sol, 0);
|
|
371
368
|
|