@oanda/labs-order-book-widget 1.0.173 → 1.0.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +1372 -0
  2. package/dist/main/OrderBookWidget/ChartWithData.js +7 -6
  3. package/dist/main/OrderBookWidget/ChartWithData.js.map +1 -1
  4. package/dist/main/OrderBookWidget/Main.js +11 -11
  5. package/dist/main/OrderBookWidget/Main.js.map +1 -1
  6. package/dist/main/OrderBookWidget/OrderBookWidget.js +9 -9
  7. package/dist/main/OrderBookWidget/OrderBookWidget.js.map +1 -1
  8. package/dist/main/OrderBookWidget/components/Chart/Chart.js +14 -14
  9. package/dist/main/OrderBookWidget/components/Chart/Chart.js.map +1 -1
  10. package/dist/main/OrderBookWidget/components/Chart/formatters.js +3 -3
  11. package/dist/main/OrderBookWidget/components/Chart/formatters.js.map +1 -1
  12. package/dist/main/OrderBookWidget/components/Chart/getOption.js +10 -9
  13. package/dist/main/OrderBookWidget/components/Chart/getOption.js.map +1 -1
  14. package/dist/main/OrderBookWidget/components/Chart/types.js.map +1 -1
  15. package/dist/main/OrderBookWidget/config.js.map +1 -1
  16. package/dist/main/OrderBookWidget/render.js +9 -9
  17. package/dist/main/OrderBookWidget/render.js.map +1 -1
  18. package/dist/main/OrderBookWidget/types.js.map +1 -1
  19. package/dist/main/gql/getOrderPositionBooks.js +3 -18
  20. package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
  21. package/dist/main/gql/types/fragment-masking.js +3 -2
  22. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  23. package/dist/main/gql/types/gql.js +3 -2
  24. package/dist/main/gql/types/gql.js.map +1 -1
  25. package/dist/main/gql/types/graphql.js +114 -114
  26. package/dist/main/gql/types/graphql.js.map +1 -1
  27. package/dist/main/gql/types/index.js.map +1 -1
  28. package/dist/main/index.js +8 -8
  29. package/dist/main/index.js.map +1 -1
  30. package/dist/main/translations/index.js +1 -1
  31. package/dist/main/translations/index.js.map +1 -1
  32. package/dist/main/translations/translations.js.map +1 -1
  33. package/dist/module/OrderBookWidget/ChartWithData.js +7 -6
  34. package/dist/module/OrderBookWidget/ChartWithData.js.map +1 -1
  35. package/dist/module/OrderBookWidget/Main.js +10 -10
  36. package/dist/module/OrderBookWidget/Main.js.map +1 -1
  37. package/dist/module/OrderBookWidget/OrderBookWidget.js +9 -9
  38. package/dist/module/OrderBookWidget/OrderBookWidget.js.map +1 -1
  39. package/dist/module/OrderBookWidget/components/Chart/Chart.js +14 -14
  40. package/dist/module/OrderBookWidget/components/Chart/Chart.js.map +1 -1
  41. package/dist/module/OrderBookWidget/components/Chart/formatters.js +3 -3
  42. package/dist/module/OrderBookWidget/components/Chart/formatters.js.map +1 -1
  43. package/dist/module/OrderBookWidget/components/Chart/getOption.js +11 -10
  44. package/dist/module/OrderBookWidget/components/Chart/getOption.js.map +1 -1
  45. package/dist/module/OrderBookWidget/components/Chart/types.js.map +1 -1
  46. package/dist/module/OrderBookWidget/config.js +1 -1
  47. package/dist/module/OrderBookWidget/config.js.map +1 -1
  48. package/dist/module/OrderBookWidget/render.js +10 -10
  49. package/dist/module/OrderBookWidget/render.js.map +1 -1
  50. package/dist/module/OrderBookWidget/types.js.map +1 -1
  51. package/dist/module/gql/getOrderPositionBooks.js +3 -18
  52. package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
  53. package/dist/module/gql/types/fragment-masking.js +3 -2
  54. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  55. package/dist/module/gql/types/gql.js +3 -2
  56. package/dist/module/gql/types/gql.js.map +1 -1
  57. package/dist/module/gql/types/graphql.js +114 -114
  58. package/dist/module/gql/types/graphql.js.map +1 -1
  59. package/dist/module/gql/types/index.js +2 -2
  60. package/dist/module/gql/types/index.js.map +1 -1
  61. package/dist/module/index.js +1 -1
  62. package/dist/module/index.js.map +1 -1
  63. package/dist/module/translations/index.js +1 -1
  64. package/dist/module/translations/index.js.map +1 -1
  65. package/dist/module/translations/translations.js.map +1 -1
  66. package/dist/types/OrderBookWidget/ChartWithData.d.ts +2 -2
  67. package/dist/types/OrderBookWidget/Main.d.ts +1 -1
  68. package/dist/types/OrderBookWidget/OrderBookWidget.d.ts +1 -1
  69. package/dist/types/OrderBookWidget/components/Chart/Chart.d.ts +1 -1
  70. package/dist/types/OrderBookWidget/components/Chart/formatters.d.ts +1 -1
  71. package/dist/types/OrderBookWidget/components/Chart/getOption.d.ts +1 -1
  72. package/dist/types/OrderBookWidget/components/Chart/types.d.ts +2 -2
  73. package/dist/types/OrderBookWidget/config.d.ts +1 -1
  74. package/dist/types/OrderBookWidget/types.d.ts +2 -2
  75. package/dist/types/gql/types/gql.d.ts +2 -2
  76. package/dist/types/gql/types/index.d.ts +2 -2
  77. package/dist/types/index.d.ts +1 -1
  78. package/dist/types/translations/index.d.ts +2 -2
  79. package/package.json +3 -3
  80. package/src/OrderBookWidget/ChartWithData.tsx +40 -39
  81. package/src/OrderBookWidget/Main.tsx +48 -30
  82. package/src/OrderBookWidget/OrderBookWidget.tsx +8 -8
  83. package/src/OrderBookWidget/components/Chart/Chart.tsx +41 -29
  84. package/src/OrderBookWidget/components/Chart/formatters.ts +11 -4
  85. package/src/OrderBookWidget/components/Chart/getOption.ts +205 -188
  86. package/src/OrderBookWidget/components/Chart/types.ts +10 -13
  87. package/src/OrderBookWidget/config.ts +76 -53
  88. package/src/OrderBookWidget/render.tsx +81 -52
  89. package/src/OrderBookWidget/types.ts +3 -2
  90. package/src/gql/getOrderPositionBooks.ts +5 -1
  91. package/src/gql/types/fragment-masking.ts +41 -21
  92. package/src/gql/types/gql.ts +7 -3
  93. package/src/gql/types/graphql.ts +165 -44
  94. package/src/gql/types/index.ts +2 -2
  95. package/src/index.ts +1 -1
  96. package/src/translations/index.ts +4 -4
  97. package/src/translations/translations.ts +1 -3
  98. package/test/Main.test.tsx +12 -9
  99. package/test/chartOptions.test.ts +18 -12
@@ -1,67 +1,87 @@
1
1
  import { BookType } from '../gql/types/graphql';
2
2
  import { InstrumentId } from './types';
3
3
 
4
- const navigationConfig = [{
5
- id: BookType.Order,
6
- label: 'order_book',
7
- }, {
8
- id: BookType.Position,
9
- label: 'position_book',
10
- }];
4
+ const navigationConfig = [
5
+ {
6
+ id: BookType.Order,
7
+ label: 'order_book',
8
+ },
9
+ {
10
+ id: BookType.Position,
11
+ label: 'position_book',
12
+ },
13
+ ];
11
14
 
12
- const instrumentSelectConfigOC = [{
13
- id: InstrumentId.EUR_AUD,
14
- label: 'EUR/AUD',
15
- }, {
16
- id: InstrumentId.EUR_GBP,
17
- label: 'EUR/GBP',
18
- }, {
19
- id: InstrumentId.EUR_JPY,
20
- label: 'EUR/JPY',
21
- }, {
22
- id: InstrumentId.EUR_USD,
23
- label: 'EUR/USD',
24
- }, {
25
- id: InstrumentId.EUR_CHF,
26
- label: 'EUR/CHF',
27
- }, {
28
- id: InstrumentId.USD_CHF,
29
- label: 'USD/CHF',
30
- }, {
31
- id: InstrumentId.USD_JPY,
32
- label: 'USD/JPY',
33
- }, {
34
- id: InstrumentId.USD_CAD,
35
- label: 'USD/CAD',
36
- }, {
37
- id: InstrumentId.GBP_USD,
38
- label: 'GBP/USD',
39
- }, {
40
- id: InstrumentId.GBP_JPY,
41
- label: 'GBP/JPY',
42
- }, {
43
- id: InstrumentId.GBP_CHF,
44
- label: 'GBP/CHF',
45
- }, {
46
- id: InstrumentId.AUD_JPY,
47
- label: 'AUD/JPY',
48
- }, {
49
- id: InstrumentId.AUD_USD,
50
- label: 'AUD/USD',
51
- }, {
52
- id: InstrumentId.NZD_USD,
53
- label: 'NZD/USD',
54
- }];
15
+ const instrumentSelectConfigOC = [
16
+ {
17
+ id: InstrumentId.EUR_AUD,
18
+ label: 'EUR/AUD',
19
+ },
20
+ {
21
+ id: InstrumentId.EUR_GBP,
22
+ label: 'EUR/GBP',
23
+ },
24
+ {
25
+ id: InstrumentId.EUR_JPY,
26
+ label: 'EUR/JPY',
27
+ },
28
+ {
29
+ id: InstrumentId.EUR_USD,
30
+ label: 'EUR/USD',
31
+ },
32
+ {
33
+ id: InstrumentId.EUR_CHF,
34
+ label: 'EUR/CHF',
35
+ },
36
+ {
37
+ id: InstrumentId.USD_CHF,
38
+ label: 'USD/CHF',
39
+ },
40
+ {
41
+ id: InstrumentId.USD_JPY,
42
+ label: 'USD/JPY',
43
+ },
44
+ {
45
+ id: InstrumentId.USD_CAD,
46
+ label: 'USD/CAD',
47
+ },
48
+ {
49
+ id: InstrumentId.GBP_USD,
50
+ label: 'GBP/USD',
51
+ },
52
+ {
53
+ id: InstrumentId.GBP_JPY,
54
+ label: 'GBP/JPY',
55
+ },
56
+ {
57
+ id: InstrumentId.GBP_CHF,
58
+ label: 'GBP/CHF',
59
+ },
60
+ {
61
+ id: InstrumentId.AUD_JPY,
62
+ label: 'AUD/JPY',
63
+ },
64
+ {
65
+ id: InstrumentId.AUD_USD,
66
+ label: 'AUD/USD',
67
+ },
68
+ {
69
+ id: InstrumentId.NZD_USD,
70
+ label: 'NZD/USD',
71
+ },
72
+ ];
55
73
 
56
74
  const instrumentSelectConfig = [
57
75
  ...instrumentSelectConfigOC,
58
76
  {
59
77
  id: InstrumentId.XAU_USD,
60
78
  label: 'XAU/USD',
61
- }, {
79
+ },
80
+ {
62
81
  id: InstrumentId.XAG_USD,
63
82
  label: 'XAG/USD',
64
- }];
83
+ },
84
+ ];
65
85
 
66
86
  const instrumentPrecisionConfig: Record<InstrumentId, number> = {
67
87
  [InstrumentId.EUR_AUD]: 5,
@@ -82,5 +102,8 @@ const instrumentPrecisionConfig: Record<InstrumentId, number> = {
82
102
  [InstrumentId.XAG_USD]: 5,
83
103
  };
84
104
  export {
85
- navigationConfig, instrumentSelectConfig, instrumentPrecisionConfig, instrumentSelectConfigOC,
105
+ instrumentPrecisionConfig,
106
+ instrumentSelectConfig,
107
+ instrumentSelectConfigOC,
108
+ navigationConfig,
86
109
  };
@@ -1,9 +1,12 @@
1
+ import type { Theme } from '@oanda/labs-widget-common';
2
+ import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
1
3
  import React from 'react';
2
4
  import { createRoot } from 'react-dom/client';
3
- import { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';
4
- import { OrderBookWidget } from './OrderBookWidget';
5
+
5
6
  import { Division } from '../gql/types/graphql';
6
- import { instrumentSelectConfigOC, instrumentSelectConfig } from './config';
7
+ import { instrumentSelectConfig, instrumentSelectConfigOC } from './config';
8
+ import { OrderBookWidget } from './OrderBookWidget';
9
+ import type { InstrumentId } from './types';
7
10
 
8
11
  const {
9
12
  graphqlUrl: configGraphQl,
@@ -13,79 +16,105 @@ const {
13
16
  division: configDivision,
14
17
  } = window.volatilityChartWidgetConfig || {};
15
18
 
16
- const {
17
- graphqlUrl,
18
- } = window.widgetsConfig || {};
19
+ const { graphqlUrl } = window.widgetsConfig || {};
19
20
 
20
- const orderBookElements = document.querySelectorAll('div[data-order-book-params]');
21
+ const orderBookElements = document.querySelectorAll(
22
+ 'div[data-order-book-params]'
23
+ );
21
24
 
22
25
  if (orderBookElements.length > 0) {
23
26
  orderBookElements.forEach((element) => {
24
27
  const root = createRoot(element);
25
28
  const params = element.getAttribute('data-order-book-params');
26
29
  const mode = element.getAttribute('data-mode');
27
- const {
28
- instrument, locale, division, logoLink,
29
- } = JSON.parse(params as string);
30
+ const { instrument, locale, division, logoLink } = JSON.parse(
31
+ params as string
32
+ );
30
33
 
31
- const isParamError = instrument ? validateToolParams({
32
- locale, graphqlUrl, division, instrument,
33
- }, [
34
- {
35
- name: 'locale',
36
- valueCheck: (value) => validateLocale(value),
37
- }, {
38
- name: 'graphqlUrl',
39
- }, {
40
- name: 'division',
41
- valueCheck: (value) => Object.values(Division).includes(value),
42
- }, {
43
- name: 'instrument',
44
- valueCheck: (value) => {
45
- const acceptableInstruments = division === Division.Oc
46
- ? instrumentSelectConfigOC
47
- : instrumentSelectConfig;
34
+ const isParamError = instrument
35
+ ? validateToolParams(
36
+ {
37
+ locale,
38
+ graphqlUrl,
39
+ division,
40
+ instrument,
41
+ },
42
+ [
43
+ {
44
+ name: 'locale',
45
+ valueCheck: (value: string | undefined) => validateLocale(value),
46
+ },
47
+ {
48
+ name: 'graphqlUrl',
49
+ },
50
+ {
51
+ name: 'division',
52
+ valueCheck: (value: Division) =>
53
+ Object.values(Division).includes(value),
54
+ },
55
+ {
56
+ name: 'instrument',
57
+ valueCheck: (value) => {
58
+ const acceptableInstruments =
59
+ division === Division.Oc
60
+ ? instrumentSelectConfigOC
61
+ : instrumentSelectConfig;
48
62
 
49
- return Object.values(
50
- acceptableInstruments.map((x) => x.id),
51
- ).includes(value.replace(/\/|_/g, ''));
52
- },
53
- },
54
- ]) : validateToolParams({
55
- locale, graphqlUrl, division, logoLink,
56
- }, [
57
- {
58
- name: 'locale',
59
- valueCheck: (value) => validateLocale(value),
60
- }, {
61
- name: 'graphqlUrl',
62
- }, {
63
- name: 'division',
64
- valueCheck: (value) => Object.values(Division).includes(value),
65
- }]);
63
+ return Object.values(
64
+ acceptableInstruments.map((x) => x.id)
65
+ ).includes(value.replace(/\/|_/g, '') as InstrumentId);
66
+ },
67
+ },
68
+ ]
69
+ )
70
+ : validateToolParams(
71
+ {
72
+ locale,
73
+ graphqlUrl,
74
+ division,
75
+ logoLink,
76
+ },
77
+ [
78
+ {
79
+ name: 'locale',
80
+ valueCheck: (value: string | undefined) => validateLocale(value),
81
+ },
82
+ {
83
+ name: 'graphqlUrl',
84
+ },
85
+ {
86
+ name: 'division',
87
+ valueCheck: (value: Division) =>
88
+ Object.values(Division).includes(value),
89
+ },
90
+ ]
91
+ );
66
92
 
67
93
  root.render(
68
94
  <OrderBookWidget
69
- locale={locale}
95
+ division={division}
70
96
  graphqlUrl={graphqlUrl}
71
97
  instrument={instrument}
72
- theme={mode as Theme}
73
98
  isParamError={isParamError}
74
- division={division}
99
+ locale={locale}
75
100
  logoLink={logoLink}
76
- />,
101
+ theme={mode as Theme}
102
+ />
77
103
  );
78
104
  });
79
105
  } else {
80
- const container = document.getElementById(configRenderElementId);
106
+ const container: HTMLElement | null = document.querySelector(
107
+ configRenderElementId
108
+ );
109
+
81
110
  const root = createRoot(container!);
82
111
 
83
112
  root.render(
84
113
  <OrderBookWidget
85
- locale={configLocale}
114
+ division={configDivision}
86
115
  graphqlUrl={configGraphQl}
87
116
  instrument={configInstrument}
88
- division={configDivision}
89
- />,
117
+ locale={configLocale}
118
+ />
90
119
  );
91
120
  }
@@ -1,5 +1,6 @@
1
- import { WidgetConfig } from '@oanda/labs-widget-common';
2
- import { BookType, Division } from '../gql/types/graphql';
1
+ import type { WidgetConfig } from '@oanda/labs-widget-common';
2
+
3
+ import type { BookType, Division } from '../gql/types/graphql';
3
4
 
4
5
  export interface OrderBookWidgetConfig extends WidgetConfig {
5
6
  instrument: InstrumentId;
@@ -1,7 +1,11 @@
1
1
  import { gql } from '@apollo/client';
2
2
 
3
3
  const getOrderPositionBooks = gql`
4
- query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {
4
+ query GetOrderPositionBooks(
5
+ $instrument: String!
6
+ $bookType: BookType!
7
+ $recentHours: Int
8
+ ) {
5
9
  orderPositionBooks(
6
10
  instrument: $instrument
7
11
  bookType: $bookType
@@ -1,18 +1,21 @@
1
- import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
1
+ import {
2
+ ResultOf,
3
+ DocumentTypeDecoration,
4
+ TypedDocumentNode,
5
+ } from '@graphql-typed-document-node/core';
2
6
  import { FragmentDefinitionNode } from 'graphql';
3
7
  import { Incremental } from './graphql';
4
8
 
5
-
6
- export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
7
- infer TType,
8
- any
9
- >
10
- ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
11
- ? TKey extends string
12
- ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
9
+ export type FragmentType<
10
+ TDocumentType extends DocumentTypeDecoration<any, any>,
11
+ > =
12
+ TDocumentType extends DocumentTypeDecoration<infer TType, any>
13
+ ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
14
+ ? TKey extends string
15
+ ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
16
+ : never
13
17
  : never
14
- : never
15
- : never;
18
+ : never;
16
19
 
17
20
  // return non-nullable if `fragmentType` is non-nullable
18
21
  export function useFragment<TType>(
@@ -22,7 +25,10 @@ export function useFragment<TType>(
22
25
  // return nullable if `fragmentType` is nullable
23
26
  export function useFragment<TType>(
24
27
  _documentNode: DocumentTypeDecoration<TType, any>,
25
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
28
+ fragmentType:
29
+ | FragmentType<DocumentTypeDecoration<TType, any>>
30
+ | null
31
+ | undefined
26
32
  ): TType | null | undefined;
27
33
  // return array of non-nullable if `fragmentType` is array of non-nullable
28
34
  export function useFragment<TType>(
@@ -32,35 +38,49 @@ export function useFragment<TType>(
32
38
  // return array of nullable if `fragmentType` is array of nullable
33
39
  export function useFragment<TType>(
34
40
  _documentNode: DocumentTypeDecoration<TType, any>,
35
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
41
+ fragmentType:
42
+ | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
43
+ | null
44
+ | undefined
36
45
  ): ReadonlyArray<TType> | null | undefined;
37
46
  export function useFragment<TType>(
38
47
  _documentNode: DocumentTypeDecoration<TType, any>,
39
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
48
+ fragmentType:
49
+ | FragmentType<DocumentTypeDecoration<TType, any>>
50
+ | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
51
+ | null
52
+ | undefined
40
53
  ): TType | ReadonlyArray<TType> | null | undefined {
41
54
  return fragmentType as any;
42
55
  }
43
56
 
44
-
45
57
  export function makeFragmentData<
46
58
  F extends DocumentTypeDecoration<any, any>,
47
- FT extends ResultOf<F>
59
+ FT extends ResultOf<F>,
48
60
  >(data: FT, _fragment: F): FragmentType<F> {
49
61
  return data as FragmentType<F>;
50
62
  }
51
63
  export function isFragmentReady<TQuery, TFrag>(
52
64
  queryNode: DocumentTypeDecoration<TQuery, any>,
53
65
  fragmentNode: TypedDocumentNode<TFrag>,
54
- data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
66
+ data:
67
+ | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>
68
+ | null
69
+ | undefined
55
70
  ): data is FragmentType<typeof fragmentNode> {
56
- const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57
- ?.deferredFields;
71
+ const deferredFields = (
72
+ queryNode as {
73
+ __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };
74
+ }
75
+ ).__meta__?.deferredFields;
58
76
 
59
77
  if (!deferredFields) return true;
60
78
 
61
- const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
79
+ const fragDef = fragmentNode.definitions[0] as
80
+ | FragmentDefinitionNode
81
+ | undefined;
62
82
  const fragName = fragDef?.name?.value;
63
83
 
64
84
  const fields = (fragName && deferredFields[fragName]) || [];
65
- return fields.length > 0 && fields.every(field => data && field in data);
85
+ return fields.length > 0 && fields.every((field) => data && field in data);
66
86
  }
@@ -13,7 +13,8 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
13
13
  * Therefore it is highly recommended to use the babel or swc plugin for production.
14
14
  */
15
15
  const documents = {
16
- "\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n": types.GetOrderPositionBooksDocument,
16
+ '\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n':
17
+ types.GetOrderPositionBooksDocument,
17
18
  };
18
19
 
19
20
  /**
@@ -33,10 +34,13 @@ export function graphql(source: string): unknown;
33
34
  /**
34
35
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
35
36
  */
36
- export function graphql(source: "\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n"): (typeof documents)["\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n"];
37
+ export function graphql(
38
+ source: '\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n'
39
+ ): (typeof documents)['\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n'];
37
40
 
38
41
  export function graphql(source: string) {
39
42
  return (documents as any)[source] ?? {};
40
43
  }
41
44
 
42
- export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;
45
+ export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
46
+ TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;