-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1951 from idexio/master
feat: add idex v4
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { SimpleAdapter } from "../../adapters/types"; | ||
import { httpGet } from "../../utils/fetchURL"; | ||
|
||
const URL = "https://api.idex.io/v4/exchange"; | ||
|
||
const fetch = async () => { | ||
const response = await httpGet(URL); | ||
const { totalVolume, volume24h } = response; | ||
|
||
return { | ||
totalVolume: totalVolume?.toString(), | ||
dailyVolume: volume24h?.toString(), | ||
}; | ||
}; | ||
|
||
const adapter: SimpleAdapter = { | ||
adapter: { | ||
idex: { | ||
fetch, | ||
start: 1721312070, | ||
runAtCurrTime: true, | ||
}, | ||
}, | ||
}; | ||
|
||
export default adapter; |