Skip to content

Commit

Permalink
feat: new stakersAmount for stakerscount-total endpoint and prod url (#…
Browse files Browse the repository at this point in the history
…136)

* new stakersAmount for stakerscount-total endpoint and prod url

* return nothing if not L1 networks
  • Loading branch information
gluneau authored Feb 5, 2024
1 parent 4797aec commit b11e50c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/services/DappsStakingEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,15 @@ export class DappsStakingEvents extends ServiceBase implements IDappsStakingEven
}
) {
stakersCount
stakersAmount
id
}
}`,
});

const stakersCount = result.data.data.stakersCountAggregatedDailies.map(
(node: { id: string; stakersCount: number }) => {
return [node.id, node.stakersCount];
(node: { id: string; stakersCount: number; stakersAmount: number }) => {
return [node.id, node.stakersCount, node.stakersAmount];
},
);

Expand Down Expand Up @@ -404,13 +405,8 @@ export class DappsStakingEvents extends ServiceBase implements IDappsStakingEven

private getApiUrl(network: NetworkType): string {
// For local development: `http://localhost:4350/graphql`;
switch (network) {
case 'astar':
return 'https://squid.subsquid.io/dapps-staking-indexer/graphql';
case 'shibuya':
return 'https://squid.subsquid.io/dapps-staking-indexer-shibuya/v/v1/graphql';
default:
return 'https://squid.subsquid.io/dapps-staking-indexer/graphql';
}
return ['astar', 'shiden', 'shibuya'].includes(network)
? `https://squid.subsquid.io/dapps-staking-indexer-${network}/graphql`
: '';
}
}

0 comments on commit b11e50c

Please sign in to comment.