Skip to content

Commit

Permalink
update http request
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Dec 24, 2024
1 parent 5fca8fb commit bf1da71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fees/hyperliquid.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -34,4 +35,4 @@ const adapter: Adapter = {
},
},
}
export default adapter
export default adapter

0 comments on commit bf1da71

Please sign in to comment.