From bf1da718aa8f9ab067ed26a9e32db83b9ac4e143 Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Tue, 24 Dec 2024 12:53:33 +0000 Subject: [PATCH] update http request --- fees/hyperliquid.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fees/hyperliquid.ts b/fees/hyperliquid.ts index 6a7451f1ff..47a1ca19a1 100644 --- a/fees/hyperliquid.ts +++ b/fees/hyperliquid.ts @@ -1,10 +1,11 @@ import { CHAIN } from "../helpers/chains" import { Adapter, FetchOptions, } from '../adapters/types'; import { findClosest } from "../helpers/utils/findClosest"; +import { httpGet } from "../utils/fetchURL"; const fetchFees = async (options: FetchOptions) => { const dailyFees = options.createBalances(); - const data:any[] = (await fetch(`https://api.hypurrscan.io/fees`).then(r => r.json())).map((t:any)=>({...t, time:t.time*1e3})) + const data: any[] = (await httpGet(`https://api.hypurrscan.io/fees`)).map((t: any) => ({ ...t, time: t.time * 1e3 })) const startCumFees: any = findClosest(options.startTimestamp, data, 3600) const endCumFees: any = findClosest(options.endTimestamp, data, 3600) @@ -34,4 +35,4 @@ const adapter: Adapter = { }, }, } -export default adapter \ No newline at end of file +export default adapter