@oanda/labs-crowd-view-widget 1.0.28 → 1.0.30

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 +244 -0
  2. package/codegen.ts +5 -2
  3. package/dist/main/CrowdViewWidget/components/Chart/Chart.js +1 -1
  4. package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  5. package/dist/main/CrowdViewWidget/components/Chart/getOption.js +9 -1
  6. package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
  7. package/dist/main/CrowdViewWidget/components/Chart/getPriceCandlesMock.js +36 -0
  8. package/dist/main/CrowdViewWidget/components/Chart/getPriceCandlesMock.js.map +1 -0
  9. package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
  10. package/dist/main/CrowdViewWidget/components/Chart/utils.js +13 -1
  11. package/dist/main/CrowdViewWidget/components/Chart/utils.js.map +1 -1
  12. package/dist/main/gql/mock/getPriceCandles.js +33 -0
  13. package/dist/main/gql/mock/getPriceCandles.js.map +1 -0
  14. package/dist/main/gql/mock/schema.graphqls +62 -0
  15. package/dist/main/gql/types/gql.js +1 -0
  16. package/dist/main/gql/types/gql.js.map +1 -1
  17. package/dist/main/gql/types/graphql.js +238 -1
  18. package/dist/main/gql/types/graphql.js.map +1 -1
  19. package/dist/module/CrowdViewWidget/components/Chart/Chart.js +2 -2
  20. package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  21. package/dist/module/CrowdViewWidget/components/Chart/getOption.js +10 -2
  22. package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
  23. package/dist/module/CrowdViewWidget/components/Chart/getPriceCandlesMock.js +29 -0
  24. package/dist/module/CrowdViewWidget/components/Chart/getPriceCandlesMock.js.map +1 -0
  25. package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
  26. package/dist/module/CrowdViewWidget/components/Chart/utils.js +13 -1
  27. package/dist/module/CrowdViewWidget/components/Chart/utils.js.map +1 -1
  28. package/dist/module/gql/mock/getPriceCandles.js +28 -0
  29. package/dist/module/gql/mock/getPriceCandles.js.map +1 -0
  30. package/dist/module/gql/mock/schema.graphqls +62 -0
  31. package/dist/module/gql/types/gql.js +1 -0
  32. package/dist/module/gql/types/gql.js.map +1 -1
  33. package/dist/module/gql/types/graphql.js +237 -0
  34. package/dist/module/gql/types/graphql.js.map +1 -1
  35. package/dist/types/CrowdViewWidget/components/Chart/getPriceCandlesMock.d.ts +2 -0
  36. package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +1 -0
  37. package/dist/types/gql/mock/getPriceCandles.d.ts +2 -0
  38. package/dist/types/gql/types/gql.d.ts +10 -0
  39. package/dist/types/gql/types/graphql.d.ts +84 -2
  40. package/package.json +3 -3
  41. package/src/CrowdViewWidget/components/Chart/Chart.tsx +2 -1
  42. package/src/CrowdViewWidget/components/Chart/getOption.ts +14 -1
  43. package/src/CrowdViewWidget/components/Chart/getPriceCandlesMock.ts +43 -0
  44. package/src/CrowdViewWidget/components/Chart/types.ts +1 -0
  45. package/src/CrowdViewWidget/components/Chart/utils.ts +12 -0
  46. package/src/gql/mock/getPriceCandles.ts +29 -0
  47. package/src/gql/mock/schema.graphqls +62 -0
  48. package/src/gql/types/gql.ts +8 -0
  49. package/src/gql/types/graphql.ts +224 -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,22 @@ 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
+ };
60
+
61
+ export type CandlesData = {
62
+ __typename?: 'CandlesData';
63
+ candle: Candle;
64
+ time: Scalars['String']['output'];
65
+ timeSpan: TimeSpan;
66
+ unixTime: Scalars['Int']['output'];
67
+ };
68
+
52
69
  export type CorrelationHeatmap = {
53
70
  __typename?: 'CorrelationHeatmap';
54
71
  baseInstrument: Instrument;
@@ -132,6 +149,22 @@ export enum Division {
132
149
  Otms = 'OTMS',
133
150
  }
134
151
 
152
+ export type ExtendedInstrument = {
153
+ __typename?: 'ExtendedInstrument';
154
+ displayName: Scalars['String']['output'];
155
+ name: Scalars['String']['output'];
156
+ tradeMode: TradeMode;
157
+ };
158
+
159
+ export enum Granularity {
160
+ Day_1 = 'DAY_1',
161
+ Hour_1 = 'HOUR_1',
162
+ Hour_4 = 'HOUR_4',
163
+ Minute_5 = 'MINUTE_5',
164
+ Minute_15 = 'MINUTE_15',
165
+ Minute_30 = 'MINUTE_30',
166
+ }
167
+
135
168
  export type Heatmap = {
136
169
  __typename?: 'Heatmap';
137
170
  instrument: Instrument;
@@ -157,8 +190,9 @@ export enum InstrumentDataSource {
157
190
 
158
191
  export type InstrumentTableResult = {
159
192
  __typename?: 'InstrumentTableResult';
160
- instruments: Array<Instrument>;
193
+ instruments: Array<ExtendedInstrument>;
161
194
  totalCount: Scalars['Int']['output'];
195
+ updatedAt: Scalars['String']['output'];
162
196
  };
163
197
 
164
198
  export type Matrix = {
@@ -193,6 +227,7 @@ export type Query = {
193
227
  correlationMatrix: CorrelationMatrix;
194
228
  currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
195
229
  currencyStrength?: Maybe<Array<CurrencyStrength>>;
230
+ getPriceCandles: Array<CandlesData>;
196
231
  isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;
197
232
  mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;
198
233
  orderPositionBooks: Array<Maybe<OrderPositionData>>;
@@ -228,6 +263,13 @@ export type QueryCurrencyPowerBalanceArgs = {
228
263
  timeUnit: CurrencyPowerBalanceTimeUnit;
229
264
  };
230
265
 
266
+ export type QueryGetPriceCandlesArgs = {
267
+ division?: InputMaybe<Division>;
268
+ granularity: Granularity;
269
+ instrument: Scalars['String']['input'];
270
+ timeSpan: TimeSpan;
271
+ };
272
+
231
273
  export type QueryIsAllowedPartnerArgs = {
232
274
  url: Scalars['String']['input'];
233
275
  };
@@ -251,13 +293,14 @@ export type QueryResolveInstrumentsByDivisionArgs = {
251
293
  };
252
294
 
253
295
  export type QueryResolveInstrumentsWithFiltersArgs = {
254
- assetClass?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
296
+ assetClass?: InputMaybe<Array<InputMaybe<AssetClassName>>>;
255
297
  count?: InputMaybe<Scalars['Int']['input']>;
256
298
  dataSource?: InputMaybe<InstrumentDataSource>;
257
299
  division: Division;
258
300
  instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
259
301
  offset?: InputMaybe<Scalars['Int']['input']>;
260
302
  searchPattern?: InputMaybe<Scalars['String']['input']>;
303
+ tradeModes?: InputMaybe<Array<InputMaybe<TradeMode>>>;
261
304
  };
262
305
 
263
306
  export type QuerySentimentArgs = {
@@ -348,6 +391,20 @@ export type TimeCorrelation = {
348
391
  value?: Maybe<Scalars['Float']['output']>;
349
392
  };
350
393
 
394
+ export enum TimeSpan {
395
+ Day_1 = 'DAY_1',
396
+ Day_2 = 'DAY_2',
397
+ Hour_1 = 'HOUR_1',
398
+ Hour_12 = 'HOUR_12',
399
+ Month_1 = 'MONTH_1',
400
+ Month_3 = 'MONTH_3',
401
+ Month_6 = 'MONTH_6',
402
+ Week_1 = 'WEEK_1',
403
+ Week_2 = 'WEEK_2',
404
+ Week_3 = 'WEEK_3',
405
+ Year_1 = 'YEAR_1',
406
+ }
407
+
351
408
  export type TopicalInstrument = {
352
409
  __typename?: 'TopicalInstrument';
353
410
  assetClass?: Maybe<AssetClassName>;
@@ -371,6 +428,15 @@ export enum TopicalSort {
371
428
  Volatile = 'VOLATILE',
372
429
  }
373
430
 
431
+ export enum TradeMode {
432
+ TradeCloseonly = 'TRADE_CLOSEONLY',
433
+ TradeDisabled = 'TRADE_DISABLED',
434
+ TradeFull = 'TRADE_FULL',
435
+ TradeLongonly = 'TRADE_LONGONLY',
436
+ TradeShortonly = 'TRADE_SHORTONLY',
437
+ TradeUndefined = 'TRADE_UNDEFINED',
438
+ }
439
+
374
440
  export enum ValueAtRiskBars {
375
441
  C100 = 'C100',
376
442
  C200 = 'C200',
@@ -458,6 +524,30 @@ export type GetOrderPositionBooksQuery = {
458
524
  } | null>;
459
525
  };
460
526
 
527
+ export type GetPriceCandlesQueryVariables = Exact<{
528
+ division?: InputMaybe<Division>;
529
+ instrument: Scalars['String']['input'];
530
+ granularity: Granularity;
531
+ timeSpan: TimeSpan;
532
+ }>;
533
+
534
+ export type GetPriceCandlesQuery = {
535
+ __typename?: 'Query';
536
+ getPriceCandles: Array<{
537
+ __typename?: 'CandlesData';
538
+ time: string;
539
+ unixTime: number;
540
+ timeSpan: TimeSpan;
541
+ candle: {
542
+ __typename?: 'Candle';
543
+ high: number;
544
+ low: number;
545
+ open: number;
546
+ close: number;
547
+ };
548
+ }>;
549
+ };
550
+
461
551
  export type ValidateInstrumentsQueryVariables = Exact<{
462
552
  instruments:
463
553
  | Array<InputMaybe<Scalars['String']['input']>>
@@ -586,6 +676,138 @@ export const GetOrderPositionBooksDocument = {
586
676
  GetOrderPositionBooksQuery,
587
677
  GetOrderPositionBooksQueryVariables
588
678
  >;
679
+ export const GetPriceCandlesDocument = {
680
+ kind: 'Document',
681
+ definitions: [
682
+ {
683
+ kind: 'OperationDefinition',
684
+ operation: 'query',
685
+ name: { kind: 'Name', value: 'GetPriceCandles' },
686
+ variableDefinitions: [
687
+ {
688
+ kind: 'VariableDefinition',
689
+ variable: {
690
+ kind: 'Variable',
691
+ name: { kind: 'Name', value: 'division' },
692
+ },
693
+ type: {
694
+ kind: 'NamedType',
695
+ name: { kind: 'Name', value: 'Division' },
696
+ },
697
+ },
698
+ {
699
+ kind: 'VariableDefinition',
700
+ variable: {
701
+ kind: 'Variable',
702
+ name: { kind: 'Name', value: 'instrument' },
703
+ },
704
+ type: {
705
+ kind: 'NonNullType',
706
+ type: {
707
+ kind: 'NamedType',
708
+ name: { kind: 'Name', value: 'String' },
709
+ },
710
+ },
711
+ },
712
+ {
713
+ kind: 'VariableDefinition',
714
+ variable: {
715
+ kind: 'Variable',
716
+ name: { kind: 'Name', value: 'granularity' },
717
+ },
718
+ type: {
719
+ kind: 'NonNullType',
720
+ type: {
721
+ kind: 'NamedType',
722
+ name: { kind: 'Name', value: 'Granularity' },
723
+ },
724
+ },
725
+ },
726
+ {
727
+ kind: 'VariableDefinition',
728
+ variable: {
729
+ kind: 'Variable',
730
+ name: { kind: 'Name', value: 'timeSpan' },
731
+ },
732
+ type: {
733
+ kind: 'NonNullType',
734
+ type: {
735
+ kind: 'NamedType',
736
+ name: { kind: 'Name', value: 'TimeSpan' },
737
+ },
738
+ },
739
+ },
740
+ ],
741
+ selectionSet: {
742
+ kind: 'SelectionSet',
743
+ selections: [
744
+ {
745
+ kind: 'Field',
746
+ name: { kind: 'Name', value: 'getPriceCandles' },
747
+ arguments: [
748
+ {
749
+ kind: 'Argument',
750
+ name: { kind: 'Name', value: 'division' },
751
+ value: {
752
+ kind: 'Variable',
753
+ name: { kind: 'Name', value: 'division' },
754
+ },
755
+ },
756
+ {
757
+ kind: 'Argument',
758
+ name: { kind: 'Name', value: 'instrument' },
759
+ value: {
760
+ kind: 'Variable',
761
+ name: { kind: 'Name', value: 'instrument' },
762
+ },
763
+ },
764
+ {
765
+ kind: 'Argument',
766
+ name: { kind: 'Name', value: 'granularity' },
767
+ value: {
768
+ kind: 'Variable',
769
+ name: { kind: 'Name', value: 'granularity' },
770
+ },
771
+ },
772
+ {
773
+ kind: 'Argument',
774
+ name: { kind: 'Name', value: 'timeSpan' },
775
+ value: {
776
+ kind: 'Variable',
777
+ name: { kind: 'Name', value: 'timeSpan' },
778
+ },
779
+ },
780
+ ],
781
+ selectionSet: {
782
+ kind: 'SelectionSet',
783
+ selections: [
784
+ { kind: 'Field', name: { kind: 'Name', value: 'time' } },
785
+ { kind: 'Field', name: { kind: 'Name', value: 'unixTime' } },
786
+ {
787
+ kind: 'Field',
788
+ name: { kind: 'Name', value: 'candle' },
789
+ selectionSet: {
790
+ kind: 'SelectionSet',
791
+ selections: [
792
+ { kind: 'Field', name: { kind: 'Name', value: 'high' } },
793
+ { kind: 'Field', name: { kind: 'Name', value: 'low' } },
794
+ { kind: 'Field', name: { kind: 'Name', value: 'open' } },
795
+ { kind: 'Field', name: { kind: 'Name', value: 'close' } },
796
+ ],
797
+ },
798
+ },
799
+ { kind: 'Field', name: { kind: 'Name', value: 'timeSpan' } },
800
+ ],
801
+ },
802
+ },
803
+ ],
804
+ },
805
+ },
806
+ ],
807
+ } as unknown as DocumentNode<
808
+ GetPriceCandlesQuery,
809
+ GetPriceCandlesQueryVariables
810
+ >;
589
811
  export const ValidateInstrumentsDocument = {
590
812
  kind: 'Document',
591
813
  definitions: [