Skip to content

Commit

Permalink
🚀 add hermes endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-manning committed Jan 9, 2025
1 parent 95432df commit 70af75d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import admin from "firebase-admin";

import wrapHandler from "./utils";
import { getCirculatingSupply, getMaxSupply, getTotalSupply } from "./supply";
import getVaa from "./hermes";

admin.initializeApp();

Expand Down Expand Up @@ -44,3 +45,13 @@ export const supply = onRequest(
};
})
);

export const hermes = onRequest(
wrapHandler(async (req) => {
const feedId = req.query.id;
if (!feedId) throw new Error("feedId is required");
if (typeof feedId !== "string") throw new Error("Invalid feedId");
const vaa = await getVaa(feedId);
return { status: "success", data: { vaa } };
})
);

0 comments on commit 70af75d

Please sign in to comment.