File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { FetchOptions , SimpleAdapter } from "../../adapters/types" ;
2+ import { CHAIN } from "../../helpers/chains" ;
3+ import { httpGet } from "../../utils/fetchURL" ;
4+
5+ const v2VolumeAPI = "https://adm.rolldex.io/api/trade/query/dailyTradeVol" ;
6+
7+ const chainConfig = {
8+ [ CHAIN . BITLAYER ] : {
9+ start : '2024-06-22' ,
10+ } ,
11+ [ CHAIN . BASE ] : {
12+ start : '2024-06-22' ,
13+ } ,
14+ }
15+
16+ const fetch = async ( _a : any , _b : any , options : FetchOptions ) => {
17+ const res = (
18+ await httpGet ( v2VolumeAPI , { params : { chain : options . chain , timestamp : options . startOfDay } } )
19+ ) as { data : { dailyVolume : number } , success : boolean }
20+
21+ return {
22+ dailyVolume : res . data . dailyVolume
23+ }
24+ } ;
25+
26+
27+ const adapter : SimpleAdapter = {
28+ fetch,
29+ adapter : chainConfig
30+ } ;
31+
32+ export default adapter ;
You can’t perform that action at this time.
0 commit comments