From cfb75fcf8f5508fd66ce4e00ebdc11b21a1b7be2 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Thu, 26 Jan 2023 14:36:29 -0500 Subject: [PATCH] fix: volume charts position dp (#2756) --- libs/candles-chart/src/lib/Chart.graphql | 1 + libs/candles-chart/src/lib/__generated__/Chart.ts | 3 ++- libs/candles-chart/src/lib/chart.mock.ts | 1 + libs/candles-chart/src/lib/data-source.ts | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/candles-chart/src/lib/Chart.graphql b/libs/candles-chart/src/lib/Chart.graphql index 217f05ba6..ca92a03a6 100644 --- a/libs/candles-chart/src/lib/Chart.graphql +++ b/libs/candles-chart/src/lib/Chart.graphql @@ -1,6 +1,7 @@ query Chart($marketId: ID!) { market(id: $marketId) { decimalPlaces + positionDecimalPlaces data { priceMonitoringBounds { minValidPrice diff --git a/libs/candles-chart/src/lib/__generated__/Chart.ts b/libs/candles-chart/src/lib/__generated__/Chart.ts index c7fa9a1cd..68e8afaf1 100644 --- a/libs/candles-chart/src/lib/__generated__/Chart.ts +++ b/libs/candles-chart/src/lib/__generated__/Chart.ts @@ -8,13 +8,14 @@ export type ChartQueryVariables = Types.Exact<{ }>; -export type ChartQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, data?: { __typename?: 'MarketData', priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string }> | null } | null } | null }; +export type ChartQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, positionDecimalPlaces: number, data?: { __typename?: 'MarketData', priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string }> | null } | null } | null }; export const ChartDocument = gql` query Chart($marketId: ID!) { market(id: $marketId) { decimalPlaces + positionDecimalPlaces data { priceMonitoringBounds { minValidPrice diff --git a/libs/candles-chart/src/lib/chart.mock.ts b/libs/candles-chart/src/lib/chart.mock.ts index 6fccf9770..ca5e81b48 100644 --- a/libs/candles-chart/src/lib/chart.mock.ts +++ b/libs/candles-chart/src/lib/chart.mock.ts @@ -20,6 +20,7 @@ export const chartQuery = (override?: PartialDeep): ChartQuery => { const defaultResult: ChartQuery = { market: { decimalPlaces: 5, + positionDecimalPlaces: 0, data: { priceMonitoringBounds: [priceMonitoringBound], __typename: 'MarketData', diff --git a/libs/candles-chart/src/lib/data-source.ts b/libs/candles-chart/src/lib/data-source.ts index 121de546b..571114f62 100644 --- a/libs/candles-chart/src/lib/data-source.ts +++ b/libs/candles-chart/src/lib/data-source.ts @@ -102,9 +102,11 @@ export class VegaDataSource implements DataSource { if (data && data.market && data.market.data) { this._decimalPlaces = data.market.decimalPlaces; + this._positionDecimalPlaces = data.market.positionDecimalPlaces; return { decimalPlaces: this._decimalPlaces, + positionDecimalPlaces: this._positionDecimalPlaces, supportedIntervals: [ PennantInterval.I1D, PennantInterval.I6H,