fix: use real totalCount from Subsquid instead of capped fetch limit
Add totalCount to the GraphQL query so transactionCount reflects the true number of transfers in the period, not the 2000-item fetch cap. This also fixes the average Ğ1/tx calculation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,10 +37,9 @@ async function fetchLiveTransactions(periodDays: number): Promise<{
|
||||
totalCount: number;
|
||||
totalVolume: number;
|
||||
}> {
|
||||
const rawTransfers = await fetchTransfers(periodDays);
|
||||
const { transfers: rawTransfers, totalCount } = await fetchTransfers(periodDays);
|
||||
if (rawTransfers.length === 0) return { geolocated: [], totalCount: 0, totalVolume: 0 };
|
||||
|
||||
const totalCount = rawTransfers.length;
|
||||
const totalVolume = rawTransfers.reduce((s, t) => s + t.amount, 0);
|
||||
|
||||
// Carte SS58 courant → clé Duniter (= _id Cesium+)
|
||||
|
||||
Reference in New Issue
Block a user