Skip to content

Commit

Permalink
update stakedao api from js to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalsine85 committed Aug 1, 2023
1 parent 6d54790 commit 8460c65
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fetch from 'node-fetch'
import { NextApiRequest, NextApiResponse } from 'next'

export default async function handler(req, res) {
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
const response = await fetch('https://lockers.stakedao.org/api/strategies/cache/balancer')
const data = await response.json()

const entry = data.find(entry => entry.key === 'b_baousd_lusd')
const entry = data.find((entry: { key: string }) => entry.key === 'b_baousd_lusd')

if (entry) {
const name = entry.name
Expand Down

0 comments on commit 8460c65

Please sign in to comment.