Skip to content

Commit

Permalink
final update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshan Senes authored and Dilshan Senes committed Oct 22, 2024
1 parent 47ad732 commit a116444
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 406 deletions.
14 changes: 4 additions & 10 deletions app/api/farscore/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,11 @@ const cachedFetchAllData = unstable_cache(

const firstCastCache = unstable_cache(
async (userId: string) => {
const firstCastResponse = await axios.get(`https://hub-api.neynar.com/v1/castsByFid?pageSize=1&fid=${userId}`, {
headers: {
'accept': 'application/json',
'x-api-key': NEYNAR_API_KEY
}
});
const firstCastResponse = await axios.get(`https://fnames.farcaster.xyz/transfers?fid=${userId}`);
const firstCastData = firstCastResponse.data;
const firstCastTimestamp = firstCastData.transfers[0]?.timestamp;

if (firstCastResponse.data && firstCastResponse.data.messages && firstCastResponse.data.messages.length > 0) {
return firstCastResponse.data.messages[0].data.timestamp;
}
return null;
return firstCastTimestamp || null;
},
['first-cast'],
{ revalidate: 86400 } // Cache for 24 hours
Expand Down
169 changes: 0 additions & 169 deletions app/api/moxie-earnings/route.ts

This file was deleted.

38 changes: 0 additions & 38 deletions app/api/moxie-price/route.ts

This file was deleted.

Loading

0 comments on commit a116444

Please sign in to comment.