@oanda/labs-order-book-widget 1.0.227 → 1.0.229

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 (40) hide show
  1. package/CHANGELOG.md +1804 -0
  2. package/dist/main/OrderBookWidget/ChartWithData.js +5 -5
  3. package/dist/main/OrderBookWidget/ChartWithData.js.map +1 -1
  4. package/dist/main/OrderBookWidget/components/Chart/getOption.js +4 -4
  5. package/dist/main/OrderBookWidget/components/Chart/getOption.js.map +1 -1
  6. package/dist/main/OrderBookWidget/components/Chart/types.js.map +1 -1
  7. package/dist/main/gql/getOrderPositionBook.js +11 -0
  8. package/dist/main/gql/getOrderPositionBook.js.map +1 -0
  9. package/dist/main/gql/types/gql.js +1 -1
  10. package/dist/main/gql/types/gql.js.map +1 -1
  11. package/dist/main/gql/types/graphql.js +38 -6
  12. package/dist/main/gql/types/graphql.js.map +1 -1
  13. package/dist/module/OrderBookWidget/ChartWithData.js +5 -5
  14. package/dist/module/OrderBookWidget/ChartWithData.js.map +1 -1
  15. package/dist/module/OrderBookWidget/components/Chart/getOption.js +4 -4
  16. package/dist/module/OrderBookWidget/components/Chart/getOption.js.map +1 -1
  17. package/dist/module/OrderBookWidget/components/Chart/types.js.map +1 -1
  18. package/dist/module/gql/getOrderPositionBook.js +6 -0
  19. package/dist/module/gql/getOrderPositionBook.js.map +1 -0
  20. package/dist/module/gql/types/gql.js +1 -1
  21. package/dist/module/gql/types/gql.js.map +1 -1
  22. package/dist/module/gql/types/graphql.js +37 -5
  23. package/dist/module/gql/types/graphql.js.map +1 -1
  24. package/dist/types/OrderBookWidget/components/Chart/types.d.ts +3 -3
  25. package/dist/types/gql/getOrderPositionBook.d.ts +2 -0
  26. package/dist/types/gql/types/gql.d.ts +2 -2
  27. package/dist/types/gql/types/graphql.d.ts +135 -13
  28. package/package.json +3 -3
  29. package/src/OrderBookWidget/ChartWithData.tsx +12 -8
  30. package/src/OrderBookWidget/components/Chart/getOption.ts +4 -4
  31. package/src/OrderBookWidget/components/Chart/types.ts +3 -3
  32. package/src/gql/{getOrderPositionBooks.ts → getOrderPositionBook.ts} +4 -4
  33. package/src/gql/types/gql.ts +4 -4
  34. package/src/gql/types/graphql.ts +157 -17
  35. package/test/Main.test.tsx +3 -3
  36. package/dist/main/gql/getOrderPositionBooks.js +0 -11
  37. package/dist/main/gql/getOrderPositionBooks.js.map +0 -1
  38. package/dist/module/gql/getOrderPositionBooks.js +0 -6
  39. package/dist/module/gql/getOrderPositionBooks.js.map +0 -1
  40. package/dist/types/gql/getOrderPositionBooks.d.ts +0 -2
@@ -40,6 +40,7 @@ export enum AssetClassName {
40
40
  Cryptocurrency = 'CRYPTOCURRENCY',
41
41
  Currency = 'CURRENCY',
42
42
  EquityShares = 'EQUITY_SHARES',
43
+ Etfs = 'ETFS',
43
44
  Indices = 'INDICES',
44
45
  Rates = 'RATES',
45
46
  }
@@ -49,6 +50,25 @@ export enum BookType {
49
50
  Position = 'POSITION',
50
51
  }
51
52
 
53
+ export type Candle = {
54
+ __typename?: 'Candle';
55
+ close: Scalars['Float']['output'];
56
+ high: Scalars['Float']['output'];
57
+ low: Scalars['Float']['output'];
58
+ open: Scalars['Float']['output'];
59
+ /** UTC Timestamp */
60
+ point: Scalars['String']['output'];
61
+ };
62
+
63
+ export type CandlesData = {
64
+ __typename?: 'CandlesData';
65
+ candle: Array<Maybe<Candle>>;
66
+ granularity: Granularity;
67
+ instrument: Instrument;
68
+ pipsLocation: Scalars['Int']['output'];
69
+ timeSpan: TimeSpan;
70
+ };
71
+
52
72
  export type CorrelationHeatmap = {
53
73
  __typename?: 'CorrelationHeatmap';
54
74
  baseInstrument: Instrument;
@@ -116,8 +136,9 @@ export type CurrencyStrength = {
116
136
  };
117
137
 
118
138
  export enum DataSource {
119
- Ny4 = 'NY4',
120
- Ty3 = 'TY3',
139
+ All = 'ALL',
140
+ Mt5 = 'MT5',
141
+ V20 = 'V20',
121
142
  }
122
143
 
123
144
  export enum Division {
@@ -132,6 +153,21 @@ export enum Division {
132
153
  Otms = 'OTMS',
133
154
  }
134
155
 
156
+ export type ExtendedInstrument = {
157
+ __typename?: 'ExtendedInstrument';
158
+ dataSource: DataSource;
159
+ displayName: Scalars['String']['output'];
160
+ name: Scalars['String']['output'];
161
+ tradeMode: TradeMode;
162
+ };
163
+
164
+ export enum Granularity {
165
+ H1 = 'H1',
166
+ H4 = 'H4',
167
+ M5 = 'M5',
168
+ M15 = 'M15',
169
+ }
170
+
135
171
  export type Heatmap = {
136
172
  __typename?: 'Heatmap';
137
173
  instrument: Instrument;
@@ -150,17 +186,37 @@ export type InstrumentCorrelation = {
150
186
  value?: Maybe<Scalars['Float']['output']>;
151
187
  };
152
188
 
189
+ export type InstrumentTableResult = {
190
+ __typename?: 'InstrumentTableResult';
191
+ instruments: Array<ExtendedInstrument>;
192
+ totalCount: Scalars['Int']['output'];
193
+ updatedAt: Scalars['String']['output'];
194
+ };
195
+
196
+ export type MarginRate = {
197
+ __typename?: 'MarginRate';
198
+ instrument: Instrument;
199
+ rate: Scalars['Float']['output'];
200
+ };
201
+
153
202
  export type Matrix = {
154
203
  __typename?: 'Matrix';
155
204
  instrument: Instrument;
156
205
  instrumentCorrelation: Array<InstrumentCorrelation>;
157
206
  };
158
207
 
208
+ export enum OrderBookDataSource {
209
+ Ny4 = 'NY4',
210
+ Ny4Mt5 = 'NY4_MT5',
211
+ Ty3 = 'TY3',
212
+ }
213
+
159
214
  export type OrderPositionBucket = {
160
215
  __typename?: 'OrderPositionBucket';
161
- longCountPercent: Scalars['Float']['output'];
216
+ longCountPercent?: Maybe<Scalars['Float']['output']>;
162
217
  price: Scalars['Float']['output'];
163
- shortCountPercent: Scalars['Float']['output'];
218
+ sentiment?: Maybe<Scalars['Float']['output']>;
219
+ shortCountPercent?: Maybe<Scalars['Float']['output']>;
164
220
  };
165
221
 
166
222
  export type OrderPositionData = {
@@ -182,10 +238,17 @@ export type Query = {
182
238
  correlationMatrix: CorrelationMatrix;
183
239
  currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
184
240
  currencyStrength?: Maybe<Array<CurrencyStrength>>;
241
+ isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;
185
242
  mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;
243
+ marginRates?: Maybe<Array<MarginRate>>;
244
+ orderPositionBook: Array<Maybe<OrderPositionData>>;
186
245
  orderPositionBooks: Array<Maybe<OrderPositionData>>;
246
+ priceCandles: CandlesData;
247
+ resolveInstrumentsByDivision?: Maybe<Array<Instrument>>;
248
+ resolveInstrumentsWithFilters?: Maybe<InstrumentTableResult>;
187
249
  sentiment?: Maybe<Array<SentimentInstrument>>;
188
250
  sentimentList?: Maybe<Array<SentimentInstrument>>;
251
+ sentiments: SentimentData;
189
252
  topicalInstruments?: Maybe<Array<TopicalInstrument>>;
190
253
  topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;
191
254
  topicalInstrumentsTotalCount: Scalars['Int']['output'];
@@ -214,17 +277,60 @@ export type QueryCurrencyPowerBalanceArgs = {
214
277
  timeUnit: CurrencyPowerBalanceTimeUnit;
215
278
  };
216
279
 
280
+ export type QueryIsAllowedPartnerArgs = {
281
+ url: Scalars['String']['input'];
282
+ };
283
+
217
284
  export type QueryMapInstrumentNamesArgs = {
218
285
  division?: InputMaybe<Division>;
219
286
  instruments: Array<InputMaybe<Scalars['String']['input']>>;
220
287
  };
221
288
 
222
- export type QueryOrderPositionBooksArgs = {
289
+ export type QueryMarginRatesArgs = {
290
+ dataSource: DataSource;
291
+ division: Division;
292
+ instruments?: InputMaybe<Array<Scalars['String']['input']>>;
293
+ tradingGroup: Scalars['Int']['input'];
294
+ };
295
+
296
+ export type QueryOrderPositionBookArgs = {
223
297
  bookType: BookType;
224
- dataSource?: InputMaybe<DataSource>;
298
+ dataSource?: InputMaybe<OrderBookDataSource>;
225
299
  instrument: Scalars['String']['input'];
226
300
  recentHours?: InputMaybe<Scalars['Int']['input']>;
227
- region?: InputMaybe<Region>;
301
+ };
302
+
303
+ export type QueryOrderPositionBooksArgs = {
304
+ bookType: BookType;
305
+ granularity: Granularity;
306
+ instrument: Scalars['String']['input'];
307
+ maxBookPrice?: InputMaybe<Scalars['Float']['input']>;
308
+ minBookPrice?: InputMaybe<Scalars['Float']['input']>;
309
+ timeSpan: TimeSpan;
310
+ };
311
+
312
+ export type QueryPriceCandlesArgs = {
313
+ dataSource: DataSource;
314
+ division: Division;
315
+ granularity: Granularity;
316
+ instrument: Scalars['String']['input'];
317
+ timeSpan: TimeSpan;
318
+ };
319
+
320
+ export type QueryResolveInstrumentsByDivisionArgs = {
321
+ division: Division;
322
+ instruments: Array<InputMaybe<Scalars['String']['input']>>;
323
+ };
324
+
325
+ export type QueryResolveInstrumentsWithFiltersArgs = {
326
+ assetClass?: InputMaybe<Array<InputMaybe<AssetClassName>>>;
327
+ count?: InputMaybe<Scalars['Int']['input']>;
328
+ dataSource: DataSource;
329
+ division: Division;
330
+ instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
331
+ offset?: InputMaybe<Scalars['Int']['input']>;
332
+ searchPattern?: InputMaybe<Scalars['String']['input']>;
333
+ tradeModes?: InputMaybe<Array<InputMaybe<TradeMode>>>;
228
334
  };
229
335
 
230
336
  export type QuerySentimentArgs = {
@@ -237,6 +343,12 @@ export type QuerySentimentListArgs = {
237
343
  sort?: InputMaybe<Sort>;
238
344
  };
239
345
 
346
+ export type QuerySentimentsArgs = {
347
+ granularity: Granularity;
348
+ instrument: Scalars['String']['input'];
349
+ timeSpan: TimeSpan;
350
+ };
351
+
240
352
  export type QueryTopicalInstrumentsArgs = {
241
353
  assetClass?: InputMaybe<AssetClassName>;
242
354
  count?: InputMaybe<Scalars['Int']['input']>;
@@ -290,6 +402,11 @@ export type Sentiment = {
290
402
  shortPercent: Scalars['Float']['output'];
291
403
  };
292
404
 
405
+ export type SentimentData = {
406
+ __typename?: 'SentimentData';
407
+ sentiments: Array<Maybe<SentimentWithTime>>;
408
+ };
409
+
293
410
  export type SentimentInstrument = {
294
411
  __typename?: 'SentimentInstrument';
295
412
  displayName: Scalars['String']['output'];
@@ -298,6 +415,12 @@ export type SentimentInstrument = {
298
415
  updatedAt: Scalars['String']['output'];
299
416
  };
300
417
 
418
+ export type SentimentWithTime = {
419
+ __typename?: 'SentimentWithTime';
420
+ sentiment: Sentiment;
421
+ time: Scalars['String']['output'];
422
+ };
423
+
301
424
  export enum Sort {
302
425
  Bearish = 'BEARISH',
303
426
  Bullish = 'BULLISH',
@@ -315,6 +438,14 @@ export type TimeCorrelation = {
315
438
  value?: Maybe<Scalars['Float']['output']>;
316
439
  };
317
440
 
441
+ export enum TimeSpan {
442
+ FiveDays = 'FIVE_DAYS',
443
+ NinetyDays = 'NINETY_DAYS',
444
+ TenDays = 'TEN_DAYS',
445
+ TwentyDays = 'TWENTY_DAYS',
446
+ TwoDays = 'TWO_DAYS',
447
+ }
448
+
318
449
  export type TopicalInstrument = {
319
450
  __typename?: 'TopicalInstrument';
320
451
  assetClass?: Maybe<AssetClassName>;
@@ -338,6 +469,15 @@ export enum TopicalSort {
338
469
  Volatile = 'VOLATILE',
339
470
  }
340
471
 
472
+ export enum TradeMode {
473
+ TradeCloseonly = 'TRADE_CLOSEONLY',
474
+ TradeDisabled = 'TRADE_DISABLED',
475
+ TradeFull = 'TRADE_FULL',
476
+ TradeLongonly = 'TRADE_LONGONLY',
477
+ TradeShortonly = 'TRADE_SHORTONLY',
478
+ TradeUndefined = 'TRADE_UNDEFINED',
479
+ }
480
+
341
481
  export enum ValueAtRiskBars {
342
482
  C100 = 'C100',
343
483
  C200 = 'C200',
@@ -403,15 +543,15 @@ export enum VolatilityChartTimeUnit {
403
543
  W = 'W',
404
544
  }
405
545
 
406
- export type GetOrderPositionBooksQueryVariables = Exact<{
546
+ export type GetOrderPositionBookQueryVariables = Exact<{
407
547
  instrument: Scalars['String']['input'];
408
548
  bookType: BookType;
409
549
  recentHours?: InputMaybe<Scalars['Int']['input']>;
410
550
  }>;
411
551
 
412
- export type GetOrderPositionBooksQuery = {
552
+ export type GetOrderPositionBookQuery = {
413
553
  __typename?: 'Query';
414
- orderPositionBooks: Array<{
554
+ orderPositionBook: Array<{
415
555
  __typename?: 'OrderPositionData';
416
556
  bucketWidth: number;
417
557
  price?: number | null;
@@ -419,19 +559,19 @@ export type GetOrderPositionBooksQuery = {
419
559
  buckets: Array<{
420
560
  __typename?: 'OrderPositionBucket';
421
561
  price: number;
422
- longCountPercent: number;
423
- shortCountPercent: number;
562
+ longCountPercent?: number | null;
563
+ shortCountPercent?: number | null;
424
564
  } | null>;
425
565
  } | null>;
426
566
  };
427
567
 
428
- export const GetOrderPositionBooksDocument = {
568
+ export const GetOrderPositionBookDocument = {
429
569
  kind: 'Document',
430
570
  definitions: [
431
571
  {
432
572
  kind: 'OperationDefinition',
433
573
  operation: 'query',
434
- name: { kind: 'Name', value: 'GetOrderPositionBooks' },
574
+ name: { kind: 'Name', value: 'GetOrderPositionBook' },
435
575
  variableDefinitions: [
436
576
  {
437
577
  kind: 'VariableDefinition',
@@ -475,7 +615,7 @@ export const GetOrderPositionBooksDocument = {
475
615
  selections: [
476
616
  {
477
617
  kind: 'Field',
478
- name: { kind: 'Name', value: 'orderPositionBooks' },
618
+ name: { kind: 'Name', value: 'orderPositionBook' },
479
619
  arguments: [
480
620
  {
481
621
  kind: 'Argument',
@@ -534,6 +674,6 @@ export const GetOrderPositionBooksDocument = {
534
674
  },
535
675
  ],
536
676
  } as unknown as DocumentNode<
537
- GetOrderPositionBooksQuery,
538
- GetOrderPositionBooksQueryVariables
677
+ GetOrderPositionBookQuery,
678
+ GetOrderPositionBookQueryVariables
539
679
  >;
@@ -7,14 +7,14 @@ import { render } from '@testing-library/react';
7
7
  import React from 'react';
8
8
 
9
9
  import { InstrumentId } from '../src';
10
- import { getOrderPositionBooks } from '../src/gql/getOrderPositionBooks';
10
+ import { getOrderPositionBook } from '../src/gql/getOrderPositionBook';
11
11
  import { BookType, Division } from '../src/gql/types/graphql';
12
12
  import { Main } from '../src/OrderBookWidget/Main';
13
13
 
14
14
  const mocks = [
15
15
  {
16
16
  request: {
17
- query: getOrderPositionBooks,
17
+ query: getOrderPositionBook,
18
18
  variables: {
19
19
  instrument: InstrumentId.EUR_AUD,
20
20
  bookType: BookType.Order,
@@ -23,7 +23,7 @@ const mocks = [
23
23
  },
24
24
  result: {
25
25
  data: {
26
- orderPositionBooks: [
26
+ orderPositionBook: [
27
27
  {
28
28
  bucketWidth: 0.0005,
29
29
  price: 0.8,
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getOrderPositionBooks = void 0;
7
- var _client = require("@apollo/client");
8
- var _templateObject;
9
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
- const getOrderPositionBooks = exports.getOrderPositionBooks = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $recentHours: Int\n ) {\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"])));
11
- //# sourceMappingURL=getOrderPositionBooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getOrderPositionBooks.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getOrderPositionBooks","exports","gql"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $recentHours: Int\n ) {\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`;\n\nexport { getOrderPositionBooks };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,+YAqBhC","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- var _templateObject;
2
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
- import { gql } from '@apollo/client';
4
- const getOrderPositionBooks = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $recentHours: Int\n ) {\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"])));
5
- export { getOrderPositionBooks };
6
- //# sourceMappingURL=getOrderPositionBooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getOrderPositionBooks.js","names":["gql","getOrderPositionBooks","_templateObject","_taggedTemplateLiteral"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $recentHours: Int\n ) {\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`;\n\nexport { getOrderPositionBooks };\n"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,MAAMC,qBAAqB,GAAGD,GAAG,CAAAE,eAAA,KAAAA,eAAA,GAAAC,sBAAA,+YAqBhC;AAED,SAASF,qBAAqB","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const getOrderPositionBooks: import("@apollo/client").DocumentNode;
2
- export { getOrderPositionBooks };