keyvan hace 1 año
padre
commit
b75165d8f2
Se han modificado 2 ficheros con 15 adiciones y 12 borrados
  1. 4 3
      apps/staking/next.config.js
  2. 11 9
      apps/staking/src/api.ts

+ 4 - 3
apps/staking/next.config.js

@@ -56,9 +56,10 @@ export default {
   async rewrites() {
     return [
       {
-        source: '/api/publishers-ranking',
-        destination: 'https://web-api.pyth.network/publishers_ranking?cluster=pythnet',
+        source: "/api/publishers-ranking",
+        destination:
+          "https://web-api.pyth.network/publishers_ranking?cluster=pythnet",
       },
-    ]
+    ];
   },
 };

+ 11 - 9
apps/staking/src/api.ts

@@ -14,13 +14,14 @@ import {
 import { PublicKey } from "@solana/web3.js";
 import { z } from "zod";
 
-const publishersRankingSchema = z.object({
-  publisher: z.string(),
-  rank: z.number(),
-  numSymbols: z.number(),
-  timestamp: z.string(),
-}).array();
-
+const publishersRankingSchema = z
+  .object({
+    publisher: z.string(),
+    rank: z.number(),
+    numSymbols: z.number(),
+    timestamp: z.string(),
+  })
+  .array();
 
 type Data = {
   total: bigint;
@@ -186,8 +187,9 @@ export const loadData = async (
 
   const publishers = extractPublisherData(poolData);
 
-  const publisherRankings =
-    publishersRankingSchema.parse(await publisherRankingsResponse.json());
+  const publisherRankings = publishersRankingSchema.parse(
+    await publisherRankingsResponse.json(),
+  );
 
   const filterGovernancePositions = (positionState: PositionState) =>
     getAmountByTargetAndState({