Pyth price fetching (#723)

* env: remove testing library

* fix: use pyth over oracle

* fix: fix the endpoints

* fix: fix build

* tidy: refactor

* fix: fixed account fetching

* fix: made all queries chain agnostic

* fix: fixed the chart position
This commit is contained in:
Linkie Link
2024-01-11 12:16:47 +01:00
committed by GitHub
parent f1f934d4c1
commit 0960f84b58
24 changed files with 94 additions and 144 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { defaultSymbolInfo } from 'components/Trade/TradeChart/constants'
import { MILLISECONDS_PER_MINUTE } from 'constants/math'
import { pythEndpoints } from 'constants/pyth'
import { byDenom } from 'utils/array'
import {
Bar,
@@ -74,7 +75,7 @@ export class DataFeed implements IDatafeedChartApi {
chainConfig: ChainConfig,
) {
if (debug) console.log('Start charting library datafeed')
this.candlesEndpoint = chainConfig.endpoints.pythCandles
this.candlesEndpoint = pythEndpoints.candles
this.candlesEndpointTheGraph = chainConfig.endpoints.graphCandles ?? ''
this.assets = assets
this.debug = debug
@@ -160,7 +160,7 @@ export const TVChartContainer = (props: Props) => {
)}
</div>
}
contentClassName='px-0.5 pb-0.5 h-full bg-chart'
contentClassName='px-0.5 pb-0.5 h-full bg-chart w-[calc(100%-2px)] ml-[1px]'
className='h-[70dvh] max-h-[980px] min-h-[560px]'
>
<div ref={chartContainerRef} className='h-[calc(100%-32px)] overflow-hidden' />
+1 -1
View File
@@ -45,7 +45,7 @@ export default function TradeChart(props: Props) {
<Loading className='h-4 mr-4 w-60' />
</div>
}
contentClassName='px-0.5 pb-0.5 h-full'
contentClassName='px-0.5 pb-0.5 h-full bg-chart w-[calc(100%-2px)] ml-[1px]'
className='h-[70dvh] max-h-[980px] min-h-[560px]'
>
<div className='flex items-center justify-center w-full h-[calc(100%-32px)] rounded-b-base bg-chart'>