-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fxied frontend bug and upgraded the matcher engine
- Loading branch information
alexey
committed
Feb 19, 2024
1 parent
e7903a3
commit 2b9e7d7
Showing
7 changed files
with
66 additions
and
28 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
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
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
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
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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import { INDEXER_URL } from "../config"; | ||
import axios from "axios"; | ||
|
||
export default async function fetchIndexer<T>(query: string) { | ||
const config = { | ||
method: "POST", | ||
url: INDEXER_URL, | ||
headers: { "Content-Type": "application/json", Accept: "application/json" }, | ||
data: { query }, | ||
}; | ||
const result: T = await axios | ||
.request(config) | ||
.then((result) => result.data.data[0]) | ||
.catch((e) => console.error(`❌ Indexer call: ${e.toString()}\nQuery: ${config.data.query}`)); | ||
return result; | ||
} | ||
export const INDEXER_URLS = [ | ||
"https://api.studio.thegraph.com/query/63182/arbitrum-sepolia-spot-market/version/latest", | ||
"https://api.studio.thegraph.com/query/63182/spark-arbitrum-spor-market/version/latest", | ||
]; | ||
|
||
export const fetchIndexer = async (query: string) => { | ||
for (const i in INDEXER_URLS) { | ||
const indexer = INDEXER_URLS[i]; | ||
try { | ||
return await axios.post(indexer, { query }); | ||
} catch (error: any) { | ||
console.error(`❌ Indexer call: ${error.toString()}\n Indexer: ${indexer}\n`); | ||
/*eslint-disable-next-line */ | ||
} | ||
} | ||
return await axios.post(INDEXER_URLS[0], { query }); | ||
}; |
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
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