@oanda/labs-sentiment-widget 1.0.67 → 1.0.68

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 (49) hide show
  1. package/CHANGELOG.md +260 -0
  2. package/dist/main/SentimentWidget/Tool.js +11 -4
  3. package/dist/main/SentimentWidget/Tool.js.map +1 -1
  4. package/dist/main/SentimentWidget/Widget.js +15 -5
  5. package/dist/main/SentimentWidget/Widget.js.map +1 -1
  6. package/dist/main/constant.js +2 -1
  7. package/dist/main/constant.js.map +1 -1
  8. package/dist/main/gql/getInstrumentSentiment.js +1 -1
  9. package/dist/main/gql/getInstrumentSentiment.js.map +1 -1
  10. package/dist/main/gql/getSentimentList.js +1 -1
  11. package/dist/main/gql/getSentimentList.js.map +1 -1
  12. package/dist/main/gql/types/gql.js +2 -2
  13. package/dist/main/gql/types/gql.js.map +1 -1
  14. package/dist/main/gql/types/graphql.js +55 -1
  15. package/dist/main/gql/types/graphql.js.map +1 -1
  16. package/dist/main/translations/sources/en.json +3 -1
  17. package/dist/main/translations/sources/zh_TW.json +3 -1
  18. package/dist/module/SentimentWidget/Tool.js +13 -6
  19. package/dist/module/SentimentWidget/Tool.js.map +1 -1
  20. package/dist/module/SentimentWidget/Widget.js +17 -7
  21. package/dist/module/SentimentWidget/Widget.js.map +1 -1
  22. package/dist/module/constant.js +2 -1
  23. package/dist/module/constant.js.map +1 -1
  24. package/dist/module/gql/getInstrumentSentiment.js +1 -1
  25. package/dist/module/gql/getInstrumentSentiment.js.map +1 -1
  26. package/dist/module/gql/getSentimentList.js +1 -1
  27. package/dist/module/gql/getSentimentList.js.map +1 -1
  28. package/dist/module/gql/types/gql.js +2 -2
  29. package/dist/module/gql/types/gql.js.map +1 -1
  30. package/dist/module/gql/types/graphql.js +54 -0
  31. package/dist/module/gql/types/graphql.js.map +1 -1
  32. package/dist/module/translations/sources/en.json +3 -1
  33. package/dist/module/translations/sources/zh_TW.json +3 -1
  34. package/dist/types/SentimentWidget/utils.d.ts +1 -0
  35. package/dist/types/constant.d.ts +2 -1
  36. package/dist/types/gql/types/gql.d.ts +4 -4
  37. package/dist/types/gql/types/graphql.d.ts +92 -15
  38. package/package.json +3 -3
  39. package/src/SentimentWidget/Tool.tsx +21 -4
  40. package/src/SentimentWidget/Widget.tsx +35 -23
  41. package/src/constant.ts +3 -1
  42. package/src/gql/getInstrumentSentiment.ts +1 -0
  43. package/src/gql/getSentimentList.ts +1 -0
  44. package/src/gql/types/gql.ts +4 -4
  45. package/src/gql/types/graphql.ts +108 -20
  46. package/src/translations/sources/en.json +3 -1
  47. package/src/translations/sources/zh_TW.json +3 -1
  48. package/test/Widget.test.tsx +4 -4
  49. package/test/sortData.test.ts +42 -12
@@ -11,11 +11,11 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
11
11
  * Therefore it is highly recommended to use the babel or swc plugin for production.
12
12
  */
13
13
  declare const documents: {
14
- "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n": DocumentNode<types.GetInstrumentSentimentQuery, types.Exact<{
14
+ "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n": DocumentNode<types.GetInstrumentSentimentQuery, types.Exact<{
15
15
  name: string;
16
16
  division?: types.InputMaybe<types.Division> | undefined;
17
17
  }>>;
18
- "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n": DocumentNode<types.GetSentimentListQuery, types.Exact<{
18
+ "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n": DocumentNode<types.GetSentimentListQuery, types.Exact<{
19
19
  division?: types.InputMaybe<types.Division> | undefined;
20
20
  }>>;
21
21
  };
@@ -35,10 +35,10 @@ export declare function graphql(source: string): unknown;
35
35
  /**
36
36
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
37
37
  */
38
- export declare function graphql(source: "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"): (typeof documents)["\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"];
38
+ export declare function graphql(source: "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"): (typeof documents)["\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"];
39
39
  /**
40
40
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
41
41
  */
42
- export declare function graphql(source: "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"): (typeof documents)["\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"];
42
+ export declare function graphql(source: "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"): (typeof documents)["\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"];
43
43
  export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
44
44
  export {};
@@ -48,6 +48,41 @@ export type AssetClass = {
48
48
  instruments?: Maybe<Array<Maybe<Instrument>>>;
49
49
  name?: Maybe<Scalars['String']['output']>;
50
50
  };
51
+ export declare enum BookType {
52
+ Order = "ORDER",
53
+ Position = "POSITION"
54
+ }
55
+ export declare enum CurrencyName {
56
+ Aud = "AUD",
57
+ Cad = "CAD",
58
+ Chf = "CHF",
59
+ Eur = "EUR",
60
+ Gbp = "GBP",
61
+ Jpy = "JPY",
62
+ Nzd = "NZD",
63
+ Usd = "USD"
64
+ }
65
+ export type CurrencyPower = {
66
+ __typename?: 'CurrencyPower';
67
+ /** UTC Timestamp */
68
+ point: Scalars['String']['output'];
69
+ price: Scalars['Float']['output'];
70
+ };
71
+ export type CurrencyPowerBalance = {
72
+ __typename?: 'CurrencyPowerBalance';
73
+ currency: CurrencyName;
74
+ power: Array<CurrencyPower>;
75
+ };
76
+ export declare enum CurrencyPowerBalanceTimeUnit {
77
+ CurrentDay = "CURRENT_DAY",
78
+ H4 = "H4",
79
+ H8 = "H8",
80
+ H24 = "H24",
81
+ M1 = "M1",
82
+ M3 = "M3",
83
+ PreviousDay = "PREVIOUS_DAY",
84
+ W1 = "W1"
85
+ }
51
86
  export declare enum DataSource {
52
87
  Ny4 = "NY4",
53
88
  Ty3 = "TY3"
@@ -79,7 +114,7 @@ export type OrderPositionData = {
79
114
  buckets: Array<Maybe<OrderPositionBucket>>;
80
115
  dataSource?: Maybe<Scalars['String']['output']>;
81
116
  instrument: Scalars['String']['output'];
82
- price: Scalars['Float']['output'];
117
+ price?: Maybe<Scalars['Float']['output']>;
83
118
  region?: Maybe<Scalars['String']['output']>;
84
119
  time: Scalars['String']['output'];
85
120
  unixTime: Scalars['Int']['output'];
@@ -87,24 +122,24 @@ export type OrderPositionData = {
87
122
  export type Query = {
88
123
  __typename?: 'Query';
89
124
  assetClasses?: Maybe<Array<Maybe<AssetClass>>>;
90
- orderBooks: Array<Maybe<OrderPositionData>>;
91
- positionBooks: Array<Maybe<OrderPositionData>>;
125
+ currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
126
+ orderPositionBooks: Array<Maybe<OrderPositionData>>;
92
127
  sentiment?: Maybe<Array<SentimentInstrument>>;
93
128
  sentimentList?: Maybe<Array<SentimentInstrument>>;
94
129
  topicalInstruments?: Maybe<Array<TopicalInstrument>>;
95
130
  topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;
96
131
  topicalInstrumentsTotalCount: Scalars['Int']['output'];
132
+ volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;
133
+ volatilityChartAssetClasses?: Maybe<Array<VolatilityChartAssetClass>>;
97
134
  };
98
135
  export type QueryAssetClassesArgs = {
99
136
  division: Division;
100
137
  };
101
- export type QueryOrderBooksArgs = {
102
- dataSource?: InputMaybe<DataSource>;
103
- instrument: Scalars['String']['input'];
104
- recentHours?: InputMaybe<Scalars['Int']['input']>;
105
- region?: InputMaybe<Region>;
138
+ export type QueryCurrencyPowerBalanceArgs = {
139
+ timeUnit: CurrencyPowerBalanceTimeUnit;
106
140
  };
107
- export type QueryPositionBooksArgs = {
141
+ export type QueryOrderPositionBooksArgs = {
142
+ bookType: BookType;
108
143
  dataSource?: InputMaybe<DataSource>;
109
144
  instrument: Scalars['String']['input'];
110
145
  recentHours?: InputMaybe<Scalars['Int']['input']>;
@@ -132,6 +167,15 @@ export type QueryTopicalInstrumentsTotalCountArgs = {
132
167
  division?: InputMaybe<Division>;
133
168
  sort: TopicalSort;
134
169
  };
170
+ export type QueryVolatilityChartArgs = {
171
+ division?: InputMaybe<Division>;
172
+ instrument: Scalars['String']['input'];
173
+ timeSpan: VolatilityChartTimeSpan;
174
+ timeUnit: VolatilityChartTimeUnit;
175
+ };
176
+ export type QueryVolatilityChartAssetClassesArgs = {
177
+ division?: InputMaybe<Division>;
178
+ };
135
179
  export declare enum Region {
136
180
  Amer = "AMER",
137
181
  Apac = "APAC",
@@ -147,6 +191,7 @@ export type SentimentInstrument = {
147
191
  displayName: Scalars['String']['output'];
148
192
  name: Scalars['String']['output'];
149
193
  sentiment: Sentiment;
194
+ updatedAt: Scalars['String']['output'];
150
195
  };
151
196
  export declare enum Sort {
152
197
  Bearish = "BEARISH",
@@ -156,7 +201,7 @@ export type TopicalInstrument = {
156
201
  __typename?: 'TopicalInstrument';
157
202
  displayName: Scalars['String']['output'];
158
203
  name: Scalars['String']['output'];
159
- sentiment: TopicalInstrumentSentiment;
204
+ sentiment: Sentiment;
160
205
  updatedAt: Scalars['String']['output'];
161
206
  };
162
207
  export type TopicalInstrumentChart = {
@@ -164,11 +209,6 @@ export type TopicalInstrumentChart = {
164
209
  chart?: Maybe<Array<Scalars['Float']['output']>>;
165
210
  name: Scalars['String']['output'];
166
211
  };
167
- export type TopicalInstrumentSentiment = {
168
- __typename?: 'TopicalInstrumentSentiment';
169
- longPercent: Scalars['Float']['output'];
170
- shortPercent: Scalars['Float']['output'];
171
- };
172
212
  export declare enum TopicalSort {
173
213
  Bearish = "BEARISH",
174
214
  Bullish = "BULLISH",
@@ -176,6 +216,41 @@ export declare enum TopicalSort {
176
216
  Popular = "POPULAR",
177
217
  Volatile = "VOLATILE"
178
218
  }
219
+ export type VolatilityChart = {
220
+ __typename?: 'VolatilityChart';
221
+ pips: Scalars['Float']['output'];
222
+ /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */
223
+ point: Scalars['String']['output'];
224
+ };
225
+ export type VolatilityChartAssetClass = {
226
+ __typename?: 'VolatilityChartAssetClass';
227
+ instruments: Array<VolatilityChartInstrument>;
228
+ name: Scalars['String']['output'];
229
+ };
230
+ export type VolatilityChartInstrument = {
231
+ __typename?: 'VolatilityChartInstrument';
232
+ displayName: Scalars['String']['output'];
233
+ name: Scalars['String']['output'];
234
+ };
235
+ export declare enum VolatilityChartTimeSpan {
236
+ /** Valid for: H */
237
+ D5 = "D5",
238
+ /** Valid for: H */
239
+ D10 = "D10",
240
+ /** Valid for: D */
241
+ M1 = "M1",
242
+ /** Valid for: D */
243
+ M3 = "M3",
244
+ /** Valid for: W */
245
+ W5 = "W5",
246
+ /** Valid for: W */
247
+ W10 = "W10"
248
+ }
249
+ export declare enum VolatilityChartTimeUnit {
250
+ D = "D",
251
+ H = "H",
252
+ W = "W"
253
+ }
179
254
  export type GetInstrumentSentimentQueryVariables = Exact<{
180
255
  name: Scalars['String']['input'];
181
256
  division?: InputMaybe<Division>;
@@ -186,6 +261,7 @@ export type GetInstrumentSentimentQuery = {
186
261
  __typename?: 'SentimentInstrument';
187
262
  name: string;
188
263
  displayName: string;
264
+ updatedAt: string;
189
265
  sentiment: {
190
266
  __typename?: 'Sentiment';
191
267
  shortPercent: number;
@@ -202,6 +278,7 @@ export type GetSentimentListQuery = {
202
278
  __typename?: 'SentimentInstrument';
203
279
  name: string;
204
280
  displayName: string;
281
+ updatedAt: string;
205
282
  sentiment: {
206
283
  __typename?: 'Sentiment';
207
284
  shortPercent: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oanda/labs-sentiment-widget",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "Labs Sentiment Widget",
5
5
  "main": "dist/main/index.js",
6
6
  "module": "dist/module/index.js",
@@ -13,7 +13,7 @@
13
13
  "license": "UNLICENSED",
14
14
  "dependencies": {
15
15
  "@apollo/client": "3.7.17",
16
- "@oanda/labs-widget-common": "^1.0.67",
16
+ "@oanda/labs-widget-common": "^1.0.68",
17
17
  "@oanda/mono-i18n": "9.0.0",
18
18
  "classnames": "2.3.2",
19
19
  "graphql": "16.7.1"
@@ -22,5 +22,5 @@
22
22
  "@graphql-codegen/cli": "5.0.0",
23
23
  "@graphql-codegen/client-preset": "4.1.0"
24
24
  },
25
- "gitHead": "53982e6ca1af39793b46ca4cf7ae044074ec8f19"
25
+ "gitHead": "1d3abf0c6696cd37440982eed491249299ec4eb3"
26
26
  }
@@ -1,6 +1,14 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import {
3
- Sentiment, SentimentHeight, Loader, LoaderSize, ChartError, Truncate, Tooltip,
3
+ Sentiment,
4
+ SentimentHeight,
5
+ Loader,
6
+ LoaderSize,
7
+ ChartError,
8
+ Truncate,
9
+ Tooltip,
10
+ InfoBox,
11
+ formatUpdatedTimestamp,
4
12
  } from '@oanda/labs-widget-common';
5
13
  import { useQuery } from '@apollo/client';
6
14
  import { useLocale } from '@oanda/mono-i18n';
@@ -11,7 +19,7 @@ import { SelectedArrow, SortSwitch } from './components/SortSwitch';
11
19
  import {
12
20
  GetSentimentListQuery, GetSentimentListQueryVariables, SentimentInstrument, Sort,
13
21
  } from '../gql/types/graphql';
14
- import { INSTRUMENT_TOOLTIP_ID } from '../constant';
22
+ import { EMPTY_VALUE, INSTRUMENT_TOOLTIP_ID } from '../constant';
15
23
 
16
24
  const Tool = ({ division }: SentimentToolConfig) => {
17
25
  const [sort, setSort] = useState(Sort.Bullish);
@@ -26,14 +34,17 @@ const Tool = ({ division }: SentimentToolConfig) => {
26
34
  fetchPolicy: 'cache-and-network',
27
35
  });
28
36
 
37
+ const { lang } = useLocale();
38
+ const [updatedTimestamp, setUpdatedTimestamp] = useState(EMPTY_VALUE);
39
+
29
40
  useEffect(() => {
30
41
  if (data) {
31
42
  setSortedData(sortData(data, sort));
43
+ setUpdatedTimestamp(formatUpdatedTimestamp(data.sentimentList![0]?.updatedAt, lang('today')));
32
44
  }
45
+ // eslint-disable-next-line react-hooks/exhaustive-deps
33
46
  }, [data, sort]);
34
47
 
35
- const { lang } = useLocale();
36
-
37
48
  return (
38
49
  <div data-testid="sentiment-tool" className="lw-relative lw-bg-bg-primary lw-text-sm lw-tracking-normal lw-text-text-primary">
39
50
  {error || sortedData.length === 0 ? (
@@ -80,6 +91,12 @@ const Tool = ({ division }: SentimentToolConfig) => {
80
91
  </>
81
92
  )}
82
93
  <Tooltip id={INSTRUMENT_TOOLTIP_ID} />
94
+ {!error
95
+ && (
96
+ <div className="lw-mt-2 lw-h-8">
97
+ <InfoBox text={`${lang('last_updated')}: ${updatedTimestamp}`} />
98
+ </div>
99
+ )}
83
100
  </div>
84
101
  );
85
102
  };
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import {
3
- Sentiment, SentimentHeight, Error, Loader, LoaderSize, Truncate,
3
+ Sentiment, SentimentHeight, Error, Loader, LoaderSize, Truncate, InfoBox, formatUpdatedTimestamp,
4
4
  } from '@oanda/labs-widget-common';
5
+ import { useLocale } from '@oanda/mono-i18n';
5
6
  import { useQuery } from '@apollo/client';
6
7
  import { getInstrumentSentiment } from '../gql/getInstrumentSentiment';
7
8
  import { SentimentWidgetConfig } from './types';
8
9
  import { GetInstrumentSentimentQuery, GetInstrumentSentimentQueryVariables } from '../gql/types/graphql';
9
- import { INSTRUMENT_TOOLTIP_ID } from '../constant';
10
+ import { EMPTY_VALUE, INSTRUMENT_TOOLTIP_ID } from '../constant';
10
11
 
11
12
  const Widget = ({ instrument, division }: SentimentWidgetConfig) => {
12
13
  const { loading, data, error } = useQuery<
@@ -20,35 +21,46 @@ const Widget = ({ instrument, division }: SentimentWidgetConfig) => {
20
21
  fetchPolicy: 'cache-and-network',
21
22
  });
22
23
 
23
- const { sentiment } = data?.sentiment?.[0] || {};
24
+ const { lang } = useLocale();
25
+
26
+ const { displayName, sentiment, updatedAt } = data?.sentiment?.[0] || {};
27
+
24
28
  const isError = error
25
29
  || (sentiment?.shortPercent === 0 && sentiment?.longPercent === 0)
26
30
  || sentiment?.shortPercent === undefined
27
31
  || sentiment?.longPercent === undefined;
28
32
 
29
33
  return (
30
- <div data-testid="sentiment-widget" className="lw-border lw-border-solid lw-border-border-primary lw-bg-bg-primary lw-p-4 lw-text-sm lw-tracking-normal lw-text-text-primary">
31
- <div className="lw-flex lw-items-center lw-justify-between">
32
- <div className="lw-w-[120px] lw-shrink-0">
33
- {loading && <Loader size={LoaderSize.md} />}
34
- {!loading && !isError && (
35
- <Truncate
36
- maxWidth={120}
37
- tooltipId={INSTRUMENT_TOOLTIP_ID}
38
- className="lw-pr-2 lw-font-sans lw-text-sm lw-font-bold"
39
- text={data?.sentiment?.[0]?.displayName || '\u2014'}
40
- />
41
- )}
34
+ <>
35
+ <div data-testid="sentiment-widget" className="lw-border lw-border-solid lw-border-border-primary lw-bg-bg-primary lw-p-4 lw-text-sm lw-tracking-normal lw-text-text-primary">
36
+ <div className="lw-flex lw-items-center lw-justify-between">
37
+ <div className="lw-w-[120px] lw-shrink-0">
38
+ {loading && <Loader size={LoaderSize.md} />}
39
+ {!loading && !isError && (
40
+ <Truncate
41
+ maxWidth={120}
42
+ tooltipId={INSTRUMENT_TOOLTIP_ID}
43
+ className="lw-pr-2 lw-font-sans lw-text-sm lw-font-bold"
44
+ text={displayName || '\u2014'}
45
+ />
46
+ )}
47
+ </div>
48
+ <Sentiment
49
+ withError={false}
50
+ isLoading={loading}
51
+ height={SentimentHeight.md}
52
+ sentiment={sentiment}
53
+ />
42
54
  </div>
43
- <Sentiment
44
- withError={false}
45
- isLoading={loading}
46
- height={SentimentHeight.md}
47
- sentiment={sentiment}
48
- />
55
+
56
+ {!loading && isError && <Error />}
49
57
  </div>
50
- {!loading && isError && <Error />}
51
- </div>
58
+ {!isError && updatedAt && (
59
+ <div className="lw-mt-2 lw-h-8">
60
+ <InfoBox text={`${lang('last_updated')}: ${formatUpdatedTimestamp(updatedAt, lang('today')) || EMPTY_VALUE}`} />
61
+ </div>
62
+ )}
63
+ </>
52
64
  );
53
65
  };
54
66
 
package/src/constant.ts CHANGED
@@ -1,3 +1,5 @@
1
+ const EMPTY_VALUE = '\u2014';
2
+
1
3
  const INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';
2
4
 
3
- export { INSTRUMENT_TOOLTIP_ID };
5
+ export { EMPTY_VALUE, INSTRUMENT_TOOLTIP_ID };
@@ -15,6 +15,7 @@ const getInstrumentSentiment = gql`
15
15
  shortPercent
16
16
  longPercent
17
17
  }
18
+ updatedAt
18
19
  }
19
20
  }
20
21
  `;
@@ -13,6 +13,7 @@ const getSentimentList = gql`
13
13
  shortPercent
14
14
  longPercent
15
15
  }
16
+ updatedAt
16
17
  }
17
18
  }
18
19
  `;
@@ -13,8 +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 GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n": types.GetInstrumentSentimentDocument,
17
- "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n": types.GetSentimentListDocument,
16
+ "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n": types.GetInstrumentSentimentDocument,
17
+ "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n": types.GetSentimentListDocument,
18
18
  };
19
19
 
20
20
  /**
@@ -34,11 +34,11 @@ export function graphql(source: string): unknown;
34
34
  /**
35
35
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
36
36
  */
37
- export function graphql(source: "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"): (typeof documents)["\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"];
37
+ export function graphql(source: "\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"): (typeof documents)["\n query GetInstrumentSentiment(\n $name: String!\n $division: Division\n ) {\n sentiment(\n name: $name\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"];
38
38
  /**
39
39
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
40
40
  */
41
- export function graphql(source: "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"): (typeof documents)["\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n }\n }\n"];
41
+ export function graphql(source: "\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"): (typeof documents)["\n query GetSentimentList (\n $division: Division\n ) {\n sentimentList (\n division: $division\n ) {\n name\n displayName\n sentiment {\n shortPercent\n longPercent\n }\n updatedAt\n }\n }\n"];
42
42
 
43
43
  export function graphql(source: string) {
44
44
  return (documents as any)[source] ?? {};
@@ -22,6 +22,46 @@ export type AssetClass = {
22
22
  name?: Maybe<Scalars['String']['output']>;
23
23
  };
24
24
 
25
+ export enum BookType {
26
+ Order = 'ORDER',
27
+ Position = 'POSITION'
28
+ }
29
+
30
+ export enum CurrencyName {
31
+ Aud = 'AUD',
32
+ Cad = 'CAD',
33
+ Chf = 'CHF',
34
+ Eur = 'EUR',
35
+ Gbp = 'GBP',
36
+ Jpy = 'JPY',
37
+ Nzd = 'NZD',
38
+ Usd = 'USD'
39
+ }
40
+
41
+ export type CurrencyPower = {
42
+ __typename?: 'CurrencyPower';
43
+ /** UTC Timestamp */
44
+ point: Scalars['String']['output'];
45
+ price: Scalars['Float']['output'];
46
+ };
47
+
48
+ export type CurrencyPowerBalance = {
49
+ __typename?: 'CurrencyPowerBalance';
50
+ currency: CurrencyName;
51
+ power: Array<CurrencyPower>;
52
+ };
53
+
54
+ export enum CurrencyPowerBalanceTimeUnit {
55
+ CurrentDay = 'CURRENT_DAY',
56
+ H4 = 'H4',
57
+ H8 = 'H8',
58
+ H24 = 'H24',
59
+ M1 = 'M1',
60
+ M3 = 'M3',
61
+ PreviousDay = 'PREVIOUS_DAY',
62
+ W1 = 'W1'
63
+ }
64
+
25
65
  export enum DataSource {
26
66
  Ny4 = 'NY4',
27
67
  Ty3 = 'TY3'
@@ -57,7 +97,7 @@ export type OrderPositionData = {
57
97
  buckets: Array<Maybe<OrderPositionBucket>>;
58
98
  dataSource?: Maybe<Scalars['String']['output']>;
59
99
  instrument: Scalars['String']['output'];
60
- price: Scalars['Float']['output'];
100
+ price?: Maybe<Scalars['Float']['output']>;
61
101
  region?: Maybe<Scalars['String']['output']>;
62
102
  time: Scalars['String']['output'];
63
103
  unixTime: Scalars['Int']['output'];
@@ -66,13 +106,15 @@ export type OrderPositionData = {
66
106
  export type Query = {
67
107
  __typename?: 'Query';
68
108
  assetClasses?: Maybe<Array<Maybe<AssetClass>>>;
69
- orderBooks: Array<Maybe<OrderPositionData>>;
70
- positionBooks: Array<Maybe<OrderPositionData>>;
109
+ currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
110
+ orderPositionBooks: Array<Maybe<OrderPositionData>>;
71
111
  sentiment?: Maybe<Array<SentimentInstrument>>;
72
112
  sentimentList?: Maybe<Array<SentimentInstrument>>;
73
113
  topicalInstruments?: Maybe<Array<TopicalInstrument>>;
74
114
  topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;
75
115
  topicalInstrumentsTotalCount: Scalars['Int']['output'];
116
+ volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;
117
+ volatilityChartAssetClasses?: Maybe<Array<VolatilityChartAssetClass>>;
76
118
  };
77
119
 
78
120
 
@@ -81,15 +123,13 @@ export type QueryAssetClassesArgs = {
81
123
  };
82
124
 
83
125
 
84
- export type QueryOrderBooksArgs = {
85
- dataSource?: InputMaybe<DataSource>;
86
- instrument: Scalars['String']['input'];
87
- recentHours?: InputMaybe<Scalars['Int']['input']>;
88
- region?: InputMaybe<Region>;
126
+ export type QueryCurrencyPowerBalanceArgs = {
127
+ timeUnit: CurrencyPowerBalanceTimeUnit;
89
128
  };
90
129
 
91
130
 
92
- export type QueryPositionBooksArgs = {
131
+ export type QueryOrderPositionBooksArgs = {
132
+ bookType: BookType;
93
133
  dataSource?: InputMaybe<DataSource>;
94
134
  instrument: Scalars['String']['input'];
95
135
  recentHours?: InputMaybe<Scalars['Int']['input']>;
@@ -128,6 +168,19 @@ export type QueryTopicalInstrumentsTotalCountArgs = {
128
168
  sort: TopicalSort;
129
169
  };
130
170
 
171
+
172
+ export type QueryVolatilityChartArgs = {
173
+ division?: InputMaybe<Division>;
174
+ instrument: Scalars['String']['input'];
175
+ timeSpan: VolatilityChartTimeSpan;
176
+ timeUnit: VolatilityChartTimeUnit;
177
+ };
178
+
179
+
180
+ export type QueryVolatilityChartAssetClassesArgs = {
181
+ division?: InputMaybe<Division>;
182
+ };
183
+
131
184
  export enum Region {
132
185
  Amer = 'AMER',
133
186
  Apac = 'APAC',
@@ -145,6 +198,7 @@ export type SentimentInstrument = {
145
198
  displayName: Scalars['String']['output'];
146
199
  name: Scalars['String']['output'];
147
200
  sentiment: Sentiment;
201
+ updatedAt: Scalars['String']['output'];
148
202
  };
149
203
 
150
204
  export enum Sort {
@@ -156,7 +210,7 @@ export type TopicalInstrument = {
156
210
  __typename?: 'TopicalInstrument';
157
211
  displayName: Scalars['String']['output'];
158
212
  name: Scalars['String']['output'];
159
- sentiment: TopicalInstrumentSentiment;
213
+ sentiment: Sentiment;
160
214
  updatedAt: Scalars['String']['output'];
161
215
  };
162
216
 
@@ -166,12 +220,6 @@ export type TopicalInstrumentChart = {
166
220
  name: Scalars['String']['output'];
167
221
  };
168
222
 
169
- export type TopicalInstrumentSentiment = {
170
- __typename?: 'TopicalInstrumentSentiment';
171
- longPercent: Scalars['Float']['output'];
172
- shortPercent: Scalars['Float']['output'];
173
- };
174
-
175
223
  export enum TopicalSort {
176
224
  Bearish = 'BEARISH',
177
225
  Bullish = 'BULLISH',
@@ -180,21 +228,61 @@ export enum TopicalSort {
180
228
  Volatile = 'VOLATILE'
181
229
  }
182
230
 
231
+ export type VolatilityChart = {
232
+ __typename?: 'VolatilityChart';
233
+ pips: Scalars['Float']['output'];
234
+ /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */
235
+ point: Scalars['String']['output'];
236
+ };
237
+
238
+ export type VolatilityChartAssetClass = {
239
+ __typename?: 'VolatilityChartAssetClass';
240
+ instruments: Array<VolatilityChartInstrument>;
241
+ name: Scalars['String']['output'];
242
+ };
243
+
244
+ export type VolatilityChartInstrument = {
245
+ __typename?: 'VolatilityChartInstrument';
246
+ displayName: Scalars['String']['output'];
247
+ name: Scalars['String']['output'];
248
+ };
249
+
250
+ export enum VolatilityChartTimeSpan {
251
+ /** Valid for: H */
252
+ D5 = 'D5',
253
+ /** Valid for: H */
254
+ D10 = 'D10',
255
+ /** Valid for: D */
256
+ M1 = 'M1',
257
+ /** Valid for: D */
258
+ M3 = 'M3',
259
+ /** Valid for: W */
260
+ W5 = 'W5',
261
+ /** Valid for: W */
262
+ W10 = 'W10'
263
+ }
264
+
265
+ export enum VolatilityChartTimeUnit {
266
+ D = 'D',
267
+ H = 'H',
268
+ W = 'W'
269
+ }
270
+
183
271
  export type GetInstrumentSentimentQueryVariables = Exact<{
184
272
  name: Scalars['String']['input'];
185
273
  division?: InputMaybe<Division>;
186
274
  }>;
187
275
 
188
276
 
189
- export type GetInstrumentSentimentQuery = { __typename?: 'Query', sentiment?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
277
+ export type GetInstrumentSentimentQuery = { __typename?: 'Query', sentiment?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, updatedAt: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
190
278
 
191
279
  export type GetSentimentListQueryVariables = Exact<{
192
280
  division?: InputMaybe<Division>;
193
281
  }>;
194
282
 
195
283
 
196
- export type GetSentimentListQuery = { __typename?: 'Query', sentimentList?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
284
+ export type GetSentimentListQuery = { __typename?: 'Query', sentimentList?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, updatedAt: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
197
285
 
198
286
 
199
- export const GetInstrumentSentimentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInstrumentSentiment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}}]}}]}}]} as unknown as DocumentNode<GetInstrumentSentimentQuery, GetInstrumentSentimentQueryVariables>;
200
- export const GetSentimentListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSentimentList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentimentList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}}]}}]}}]} as unknown as DocumentNode<GetSentimentListQuery, GetSentimentListQueryVariables>;
287
+ export const GetInstrumentSentimentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInstrumentSentiment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetInstrumentSentimentQuery, GetInstrumentSentimentQueryVariables>;
288
+ export const GetSentimentListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSentimentList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentimentList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetSentimentListQuery, GetSentimentListQueryVariables>;