Skip to content

Commit

Permalink
fix: minor type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zach-mantle committed Sep 2, 2024
1 parent cb4620d commit 761d853
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/token-graph/src/app/snapshot/v2/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fetchL2SnapshotVotes = async (address: string, snapshot: string) => {
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query GetDelegates($address: String, $snapshot: Int){
query: `query GetDelegates($address: String!, $snapshot: Float!){
l2TotalVotesChangedsByAddressAndBlockNumber(address: $address, blockNumber: $snapshot, limit: 1) {
address
totalVotes
Expand All @@ -30,10 +30,10 @@ const fetchL2SnapshotVotes = async (address: string, snapshot: string) => {
let totalVotes = "0";

if (
data.l2DelegateVotesChangeds.length &&
data.l2DelegateVotesChangeds[0].totalVotes
data.l2TotalVotesChangedsByAddressAndBlockNumber.length &&
data.l2TotalVotesChangedsByAddressAndBlockNumber[0].totalVotes
) {
totalVotes = data.l2DelegateVotesChangeds[0].totalVotes;
totalVotes = data.l2TotalVotesChangedsByAddressAndBlockNumber[0].totalVotes;
}

return totalVotes;
Expand All @@ -56,6 +56,7 @@ export async function POST(request: NextRequest) {
/* eslint-disable */
for (const addr of addresses) {
const l2Votes: string = await fetchL2SnapshotVotes(addr, snapshot);
console.log(addr, l2Votes);
score.push({
address: addr,
score: l2Votes,
Expand Down

0 comments on commit 761d853

Please sign in to comment.