Merge pull request #242 from blockworks-foundation/max/birdeye-merged-charts

add new endpoint for openbook merged birdeye charts
This commit is contained in:
Maximilian Schneider 2023-08-19 00:49:13 +02:00 committed by GitHub
commit 25dc3c4343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -163,6 +163,7 @@ export const queryBirdeyeBars = async (
to: number
},
quote_token: string,
market: string,
): Promise<Bar[]> => {
const { from, to } = periodParams
@ -172,6 +173,7 @@ export const queryBirdeyeBars = async (
type: parseResolution(resolution),
time_from: from,
time_to: to,
merge_market_id: market,
}
const query = Object.keys(urlParameters)
@ -181,7 +183,7 @@ export const queryBirdeyeBars = async (
)
.join('&')
const data = await makeApiRequest(`defi/ohlcv/base_quote?${query}`)
const data = await makeApiRequest(`defi/ohlcv/base_quote_merge?${query}`)
if (!data.success || data.data.items.length === 0) {
return []
}
@ -327,6 +329,7 @@ export default {
resolution as any,
periodParams,
symbolInfo.quote_token,
symbolInfo.address,
)
}
if (!bars || bars.length === 0) {