@oanda/labs-spread-cost-calculator-widget 1.0.1
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.
- package/CHANGELOG.md +8 -0
- package/codegen.ts +15 -0
- package/dist/main/SpreadCostCalculatorWidget/Main.js +115 -0
- package/dist/main/SpreadCostCalculatorWidget/Main.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js +54 -0
- package/dist/main/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/ValidationWrapper.js +46 -0
- package/dist/main/SpreadCostCalculatorWidget/ValidationWrapper.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/constant.js +8 -0
- package/dist/main/SpreadCostCalculatorWidget/constant.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/index.js +28 -0
- package/dist/main/SpreadCostCalculatorWidget/index.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/render.js +51 -0
- package/dist/main/SpreadCostCalculatorWidget/render.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/types.js +6 -0
- package/dist/main/SpreadCostCalculatorWidget/types.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/useCalculateSpread.js +24 -0
- package/dist/main/SpreadCostCalculatorWidget/useCalculateSpread.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/useInstrumentChange.js +51 -0
- package/dist/main/SpreadCostCalculatorWidget/useInstrumentChange.js.map +1 -0
- package/dist/main/SpreadCostCalculatorWidget/utils.js +17 -0
- package/dist/main/SpreadCostCalculatorWidget/utils.js.map +1 -0
- package/dist/main/gql/types/fragment-masking.js +23 -0
- package/dist/main/gql/types/fragment-masking.js.map +1 -0
- package/dist/main/gql/types/gql.js +16 -0
- package/dist/main/gql/types/gql.js.map +1 -0
- package/dist/main/gql/types/graphql.js +223 -0
- package/dist/main/gql/types/graphql.js.map +1 -0
- package/dist/main/gql/types/index.js +28 -0
- package/dist/main/gql/types/index.js.map +1 -0
- package/dist/main/gql/validateInstruments.js +16 -0
- package/dist/main/gql/validateInstruments.js.map +1 -0
- package/dist/main/index.js +28 -0
- package/dist/main/index.js.map +1 -0
- package/dist/main/translations/index.js +27 -0
- package/dist/main/translations/index.js.map +1 -0
- package/dist/main/translations/sources/en.json +11 -0
- package/dist/main/translations/sources/es.json +11 -0
- package/dist/main/translations/sources/th.json +11 -0
- package/dist/main/translations/sources/zh_TW.json +11 -0
- package/dist/main/translations/translations.js +8 -0
- package/dist/main/translations/translations.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/Main.js +107 -0
- package/dist/module/SpreadCostCalculatorWidget/Main.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js +46 -0
- package/dist/module/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/ValidationWrapper.js +38 -0
- package/dist/module/SpreadCostCalculatorWidget/ValidationWrapper.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/constant.js +2 -0
- package/dist/module/SpreadCostCalculatorWidget/constant.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/index.js +3 -0
- package/dist/module/SpreadCostCalculatorWidget/index.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/render.js +48 -0
- package/dist/module/SpreadCostCalculatorWidget/render.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/types.js +2 -0
- package/dist/module/SpreadCostCalculatorWidget/types.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/useCalculateSpread.js +17 -0
- package/dist/module/SpreadCostCalculatorWidget/useCalculateSpread.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/useInstrumentChange.js +44 -0
- package/dist/module/SpreadCostCalculatorWidget/useInstrumentChange.js.map +1 -0
- package/dist/module/SpreadCostCalculatorWidget/utils.js +10 -0
- package/dist/module/SpreadCostCalculatorWidget/utils.js.map +1 -0
- package/dist/module/gql/types/fragment-masking.js +15 -0
- package/dist/module/gql/types/fragment-masking.js.map +1 -0
- package/dist/module/gql/types/gql.js +8 -0
- package/dist/module/gql/types/gql.js.map +1 -0
- package/dist/module/gql/types/graphql.js +217 -0
- package/dist/module/gql/types/graphql.js.map +1 -0
- package/dist/module/gql/types/index.js +3 -0
- package/dist/module/gql/types/index.js.map +1 -0
- package/dist/module/gql/validateInstruments.js +10 -0
- package/dist/module/gql/validateInstruments.js.map +1 -0
- package/dist/module/index.js +3 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/translations/index.js +20 -0
- package/dist/module/translations/index.js.map +1 -0
- package/dist/module/translations/sources/en.json +11 -0
- package/dist/module/translations/sources/es.json +11 -0
- package/dist/module/translations/sources/th.json +11 -0
- package/dist/module/translations/sources/zh_TW.json +11 -0
- package/dist/module/translations/translations.js +2 -0
- package/dist/module/translations/translations.js.map +1 -0
- package/dist/types/SpreadCostCalculatorWidget/Main.d.ts +4 -0
- package/dist/types/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.d.ts +4 -0
- package/dist/types/SpreadCostCalculatorWidget/ValidationWrapper.d.ts +4 -0
- package/dist/types/SpreadCostCalculatorWidget/constant.d.ts +1 -0
- package/dist/types/SpreadCostCalculatorWidget/index.d.ts +2 -0
- package/dist/types/SpreadCostCalculatorWidget/render.d.ts +1 -0
- package/dist/types/SpreadCostCalculatorWidget/types.d.ts +20 -0
- package/dist/types/SpreadCostCalculatorWidget/useCalculateSpread.d.ts +8 -0
- package/dist/types/SpreadCostCalculatorWidget/useInstrumentChange.d.ts +12 -0
- package/dist/types/SpreadCostCalculatorWidget/utils.d.ts +2 -0
- package/dist/types/gql/types/fragment-masking.d.ts +15 -0
- package/dist/types/gql/types/gql.d.ts +37 -0
- package/dist/types/gql/types/graphql.d.ts +389 -0
- package/dist/types/gql/types/index.d.ts +2 -0
- package/dist/types/gql/validateInstruments.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/translations/index.d.ts +4 -0
- package/dist/types/translations/translations.d.ts +1 -0
- package/index.ts +1 -0
- package/lokalise.config.json +18 -0
- package/package.json +26 -0
- package/src/SpreadCostCalculatorWidget/Main.tsx +138 -0
- package/src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx +52 -0
- package/src/SpreadCostCalculatorWidget/ValidationWrapper.tsx +51 -0
- package/src/SpreadCostCalculatorWidget/constant.ts +1 -0
- package/src/SpreadCostCalculatorWidget/index.ts +2 -0
- package/src/SpreadCostCalculatorWidget/render.tsx +60 -0
- package/src/SpreadCostCalculatorWidget/types.ts +27 -0
- package/src/SpreadCostCalculatorWidget/useCalculateSpread.ts +38 -0
- package/src/SpreadCostCalculatorWidget/useInstrumentChange.ts +47 -0
- package/src/SpreadCostCalculatorWidget/utils.ts +12 -0
- package/src/gql/types/fragment-masking.ts +66 -0
- package/src/gql/types/gql.ts +42 -0
- package/src/gql/types/graphql.ts +430 -0
- package/src/gql/types/index.ts +2 -0
- package/src/gql/validateInstruments.ts +10 -0
- package/src/index.ts +2 -0
- package/src/translations/index.ts +17 -0
- package/src/translations/sources/en.json +11 -0
- package/src/translations/sources/es.json +11 -0
- package/src/translations/sources/th.json +11 -0
- package/src/translations/sources/zh_TW.json +11 -0
- package/src/translations/translations.ts +1 -0
- package/test/SpreadCostCalculator.test.tsx +31 -0
- package/test/useCalculateSpread.test.tsx +131 -0
- package/test/useInstrumentChange.test.tsx +54 -0
- package/tsconfig.types.json +12 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VolatilityChartTimeUnit = exports.VolatilityChartTimeSpan = exports.ValueAtRiskDuration = exports.ValueAtRiskBars = exports.ValidateInstrumentsDocument = exports.TopicalSort = exports.Sort = exports.Region = exports.Division = exports.DataSource = exports.CurrencyPowerBalanceTimeUnit = exports.CurrencyName = exports.CorrelationTimeUnit = exports.BookType = exports.AssetClassName = void 0;
|
|
7
|
+
let AssetClassName = exports.AssetClassName = function (AssetClassName) {
|
|
8
|
+
AssetClassName["Commodities"] = "COMMODITIES";
|
|
9
|
+
AssetClassName["Cryptocurrency"] = "CRYPTOCURRENCY";
|
|
10
|
+
AssetClassName["Currency"] = "CURRENCY";
|
|
11
|
+
AssetClassName["EquityShares"] = "EQUITY_SHARES";
|
|
12
|
+
AssetClassName["Indices"] = "INDICES";
|
|
13
|
+
AssetClassName["Rates"] = "RATES";
|
|
14
|
+
return AssetClassName;
|
|
15
|
+
}({});
|
|
16
|
+
let BookType = exports.BookType = function (BookType) {
|
|
17
|
+
BookType["Order"] = "ORDER";
|
|
18
|
+
BookType["Position"] = "POSITION";
|
|
19
|
+
return BookType;
|
|
20
|
+
}({});
|
|
21
|
+
let CorrelationTimeUnit = exports.CorrelationTimeUnit = function (CorrelationTimeUnit) {
|
|
22
|
+
CorrelationTimeUnit["H1"] = "H1";
|
|
23
|
+
CorrelationTimeUnit["H4"] = "H4";
|
|
24
|
+
CorrelationTimeUnit["H24"] = "H24";
|
|
25
|
+
CorrelationTimeUnit["M1"] = "M1";
|
|
26
|
+
CorrelationTimeUnit["M3"] = "M3";
|
|
27
|
+
CorrelationTimeUnit["M6"] = "M6";
|
|
28
|
+
CorrelationTimeUnit["W1"] = "W1";
|
|
29
|
+
CorrelationTimeUnit["Y1"] = "Y1";
|
|
30
|
+
return CorrelationTimeUnit;
|
|
31
|
+
}({});
|
|
32
|
+
let CurrencyName = exports.CurrencyName = function (CurrencyName) {
|
|
33
|
+
CurrencyName["Aud"] = "AUD";
|
|
34
|
+
CurrencyName["Cad"] = "CAD";
|
|
35
|
+
CurrencyName["Chf"] = "CHF";
|
|
36
|
+
CurrencyName["Eur"] = "EUR";
|
|
37
|
+
CurrencyName["Gbp"] = "GBP";
|
|
38
|
+
CurrencyName["Jpy"] = "JPY";
|
|
39
|
+
CurrencyName["Nzd"] = "NZD";
|
|
40
|
+
CurrencyName["Usd"] = "USD";
|
|
41
|
+
return CurrencyName;
|
|
42
|
+
}({});
|
|
43
|
+
let CurrencyPowerBalanceTimeUnit = exports.CurrencyPowerBalanceTimeUnit = function (CurrencyPowerBalanceTimeUnit) {
|
|
44
|
+
CurrencyPowerBalanceTimeUnit["CurrentDay"] = "CURRENT_DAY";
|
|
45
|
+
CurrencyPowerBalanceTimeUnit["H4"] = "H4";
|
|
46
|
+
CurrencyPowerBalanceTimeUnit["H8"] = "H8";
|
|
47
|
+
CurrencyPowerBalanceTimeUnit["H24"] = "H24";
|
|
48
|
+
CurrencyPowerBalanceTimeUnit["M1"] = "M1";
|
|
49
|
+
CurrencyPowerBalanceTimeUnit["M3"] = "M3";
|
|
50
|
+
CurrencyPowerBalanceTimeUnit["PreviousDay"] = "PREVIOUS_DAY";
|
|
51
|
+
CurrencyPowerBalanceTimeUnit["W1"] = "W1";
|
|
52
|
+
return CurrencyPowerBalanceTimeUnit;
|
|
53
|
+
}({});
|
|
54
|
+
let DataSource = exports.DataSource = function (DataSource) {
|
|
55
|
+
DataSource["Ny4"] = "NY4";
|
|
56
|
+
DataSource["Ty3"] = "TY3";
|
|
57
|
+
return DataSource;
|
|
58
|
+
}({});
|
|
59
|
+
let Division = exports.Division = function (Division) {
|
|
60
|
+
Division["Oap"] = "OAP";
|
|
61
|
+
Division["Oau"] = "OAU";
|
|
62
|
+
Division["Oc"] = "OC";
|
|
63
|
+
Division["Ocan"] = "OCAN";
|
|
64
|
+
Division["Oel"] = "OEL";
|
|
65
|
+
Division["Ogm"] = "OGM";
|
|
66
|
+
Division["Oj"] = "OJ";
|
|
67
|
+
Division["Opt"] = "OPT";
|
|
68
|
+
Division["Otms"] = "OTMS";
|
|
69
|
+
return Division;
|
|
70
|
+
}({});
|
|
71
|
+
let Region = exports.Region = function (Region) {
|
|
72
|
+
Region["Amer"] = "AMER";
|
|
73
|
+
Region["Apac"] = "APAC";
|
|
74
|
+
Region["Emea"] = "EMEA";
|
|
75
|
+
return Region;
|
|
76
|
+
}({});
|
|
77
|
+
let Sort = exports.Sort = function (Sort) {
|
|
78
|
+
Sort["Bearish"] = "BEARISH";
|
|
79
|
+
Sort["Bullish"] = "BULLISH";
|
|
80
|
+
return Sort;
|
|
81
|
+
}({});
|
|
82
|
+
let TopicalSort = exports.TopicalSort = function (TopicalSort) {
|
|
83
|
+
TopicalSort["Bearish"] = "BEARISH";
|
|
84
|
+
TopicalSort["Bullish"] = "BULLISH";
|
|
85
|
+
TopicalSort["Hot"] = "HOT";
|
|
86
|
+
TopicalSort["Popular"] = "POPULAR";
|
|
87
|
+
TopicalSort["Volatile"] = "VOLATILE";
|
|
88
|
+
return TopicalSort;
|
|
89
|
+
}({});
|
|
90
|
+
let ValueAtRiskBars = exports.ValueAtRiskBars = function (ValueAtRiskBars) {
|
|
91
|
+
ValueAtRiskBars["C100"] = "C100";
|
|
92
|
+
ValueAtRiskBars["C200"] = "C200";
|
|
93
|
+
ValueAtRiskBars["C300"] = "C300";
|
|
94
|
+
return ValueAtRiskBars;
|
|
95
|
+
}({});
|
|
96
|
+
let ValueAtRiskDuration = exports.ValueAtRiskDuration = function (ValueAtRiskDuration) {
|
|
97
|
+
ValueAtRiskDuration["C1"] = "C1";
|
|
98
|
+
ValueAtRiskDuration["C2"] = "C2";
|
|
99
|
+
ValueAtRiskDuration["C3"] = "C3";
|
|
100
|
+
ValueAtRiskDuration["C4"] = "C4";
|
|
101
|
+
ValueAtRiskDuration["C5"] = "C5";
|
|
102
|
+
ValueAtRiskDuration["C10"] = "C10";
|
|
103
|
+
return ValueAtRiskDuration;
|
|
104
|
+
}({});
|
|
105
|
+
let VolatilityChartTimeSpan = exports.VolatilityChartTimeSpan = function (VolatilityChartTimeSpan) {
|
|
106
|
+
VolatilityChartTimeSpan["D5"] = "D5";
|
|
107
|
+
VolatilityChartTimeSpan["D10"] = "D10";
|
|
108
|
+
VolatilityChartTimeSpan["M1"] = "M1";
|
|
109
|
+
VolatilityChartTimeSpan["M3"] = "M3";
|
|
110
|
+
VolatilityChartTimeSpan["W5"] = "W5";
|
|
111
|
+
VolatilityChartTimeSpan["W10"] = "W10";
|
|
112
|
+
return VolatilityChartTimeSpan;
|
|
113
|
+
}({});
|
|
114
|
+
let VolatilityChartTimeUnit = exports.VolatilityChartTimeUnit = function (VolatilityChartTimeUnit) {
|
|
115
|
+
VolatilityChartTimeUnit["D"] = "D";
|
|
116
|
+
VolatilityChartTimeUnit["H"] = "H";
|
|
117
|
+
VolatilityChartTimeUnit["W"] = "W";
|
|
118
|
+
return VolatilityChartTimeUnit;
|
|
119
|
+
}({});
|
|
120
|
+
const ValidateInstrumentsDocument = exports.ValidateInstrumentsDocument = {
|
|
121
|
+
"kind": "Document",
|
|
122
|
+
"definitions": [{
|
|
123
|
+
"kind": "OperationDefinition",
|
|
124
|
+
"operation": "query",
|
|
125
|
+
"name": {
|
|
126
|
+
"kind": "Name",
|
|
127
|
+
"value": "validateInstruments"
|
|
128
|
+
},
|
|
129
|
+
"variableDefinitions": [{
|
|
130
|
+
"kind": "VariableDefinition",
|
|
131
|
+
"variable": {
|
|
132
|
+
"kind": "Variable",
|
|
133
|
+
"name": {
|
|
134
|
+
"kind": "Name",
|
|
135
|
+
"value": "instruments"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"type": {
|
|
139
|
+
"kind": "NonNullType",
|
|
140
|
+
"type": {
|
|
141
|
+
"kind": "ListType",
|
|
142
|
+
"type": {
|
|
143
|
+
"kind": "NamedType",
|
|
144
|
+
"name": {
|
|
145
|
+
"kind": "Name",
|
|
146
|
+
"value": "String"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
"kind": "VariableDefinition",
|
|
153
|
+
"variable": {
|
|
154
|
+
"kind": "Variable",
|
|
155
|
+
"name": {
|
|
156
|
+
"kind": "Name",
|
|
157
|
+
"value": "division"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"type": {
|
|
161
|
+
"kind": "NamedType",
|
|
162
|
+
"name": {
|
|
163
|
+
"kind": "Name",
|
|
164
|
+
"value": "Division"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}],
|
|
168
|
+
"selectionSet": {
|
|
169
|
+
"kind": "SelectionSet",
|
|
170
|
+
"selections": [{
|
|
171
|
+
"kind": "Field",
|
|
172
|
+
"name": {
|
|
173
|
+
"kind": "Name",
|
|
174
|
+
"value": "mapInstrumentNames"
|
|
175
|
+
},
|
|
176
|
+
"arguments": [{
|
|
177
|
+
"kind": "Argument",
|
|
178
|
+
"name": {
|
|
179
|
+
"kind": "Name",
|
|
180
|
+
"value": "instruments"
|
|
181
|
+
},
|
|
182
|
+
"value": {
|
|
183
|
+
"kind": "Variable",
|
|
184
|
+
"name": {
|
|
185
|
+
"kind": "Name",
|
|
186
|
+
"value": "instruments"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
"kind": "Argument",
|
|
191
|
+
"name": {
|
|
192
|
+
"kind": "Name",
|
|
193
|
+
"value": "division"
|
|
194
|
+
},
|
|
195
|
+
"value": {
|
|
196
|
+
"kind": "Variable",
|
|
197
|
+
"name": {
|
|
198
|
+
"kind": "Name",
|
|
199
|
+
"value": "division"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}],
|
|
203
|
+
"selectionSet": {
|
|
204
|
+
"kind": "SelectionSet",
|
|
205
|
+
"selections": [{
|
|
206
|
+
"kind": "Field",
|
|
207
|
+
"name": {
|
|
208
|
+
"kind": "Name",
|
|
209
|
+
"value": "name"
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
"kind": "Field",
|
|
213
|
+
"name": {
|
|
214
|
+
"kind": "Name",
|
|
215
|
+
"value": "displayName"
|
|
216
|
+
}
|
|
217
|
+
}]
|
|
218
|
+
}
|
|
219
|
+
}]
|
|
220
|
+
}
|
|
221
|
+
}]
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.js","names":["AssetClassName","exports","BookType","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Region","Sort","TopicalSort","ValueAtRiskBars","ValueAtRiskDuration","VolatilityChartTimeSpan","VolatilityChartTimeUnit","ValidateInstrumentsDocument"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments: Array<Instrument>;\n name: Scalars['String']['output'];\n};\n\nexport enum AssetClassName {\n Commodities = 'COMMODITIES',\n Cryptocurrency = 'CRYPTOCURRENCY',\n Currency = 'CURRENCY',\n EquityShares = 'EQUITY_SHARES',\n Indices = 'INDICES',\n Rates = 'RATES'\n}\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION'\n}\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Instrument;\n heatmap: Array<Heatmap>;\n};\n\nexport type CorrelationMatrix = {\n __typename?: 'CorrelationMatrix';\n baseTimeUnit: CorrelationTimeUnit;\n matrix: Array<Matrix>;\n};\n\nexport enum CorrelationTimeUnit {\n H1 = 'H1',\n H4 = 'H4',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n M6 = 'M6',\n W1 = 'W1',\n Y1 = 'Y1'\n}\n\nexport enum CurrencyName {\n Aud = 'AUD',\n Cad = 'CAD',\n Chf = 'CHF',\n Eur = 'EUR',\n Gbp = 'GBP',\n Jpy = 'JPY',\n Nzd = 'NZD',\n Usd = 'USD'\n}\n\nexport type CurrencyPower = {\n __typename?: 'CurrencyPower';\n /** UTC Timestamp */\n point: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n};\n\nexport type CurrencyPowerBalance = {\n __typename?: 'CurrencyPowerBalance';\n currency: CurrencyName;\n power: Array<CurrencyPower>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum CurrencyPowerBalanceTimeUnit {\n CurrentDay = 'CURRENT_DAY',\n H4 = 'H4',\n H8 = 'H8',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n PreviousDay = 'PREVIOUS_DAY',\n W1 = 'W1'\n}\n\nexport type CurrencyStrength = {\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n strengthRelation?: Maybe<Array<StrengthRelation>>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3'\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Opt = 'OPT',\n Otms = 'OTMS'\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n instrument: Instrument;\n timeCorrelation: Array<TimeCorrelation>;\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport type InstrumentCorrelation = {\n __typename?: 'InstrumentCorrelation';\n instrument: Instrument;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type Matrix = {\n __typename?: 'Matrix';\n instrument: Instrument;\n instrumentCorrelation: Array<InstrumentCorrelation>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price?: Maybe<Scalars['Float']['output']>;\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n correlationHeatmap: CorrelationHeatmap;\n correlationMatrix: CorrelationMatrix;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;\n mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n resolveInstrumentsByDivision?: Maybe<Array<Instrument>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n valueAtRiskAssetClasses?: Maybe<Array<AssetClass>>;\n valueAtRiskChart?: Maybe<ValueAtRiskChart>;\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;\n};\n\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;\n};\n\n\nexport type QueryCorrelationMatrixArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n};\n\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\n\nexport type QueryIsAllowedPartnerArgs = {\n url: Scalars['String']['input'];\n};\n\n\nexport type QueryMapInstrumentNamesArgs = {\n division?: InputMaybe<Division>;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\n\nexport type QueryResolveInstrumentsByDivisionArgs = {\n division: Division;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\n\nexport type QueryTopicalInstrumentsArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\n\nexport type QueryValueAtRiskAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\n\nexport type QueryValueAtRiskChartArgs = {\n bars: ValueAtRiskBars;\n division?: InputMaybe<Division>;\n duration: ValueAtRiskDuration;\n instrument: Scalars['String']['input'];\n};\n\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA'\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH'\n}\n\nexport type StrengthRelation = {\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: Scalars['Float']['output'];\n};\n\nexport type TimeCorrelation = {\n __typename?: 'TimeCorrelation';\n timeUnit: CorrelationTimeUnit;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n assetClass?: Maybe<AssetClassName>;\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE'\n}\n\nexport enum ValueAtRiskBars {\n C100 = 'C100',\n C200 = 'C200',\n C300 = 'C300'\n}\n\nexport type ValueAtRiskChart = {\n __typename?: 'ValueAtRiskChart';\n down: ValueAtRiskChartData;\n up: ValueAtRiskChartData;\n};\n\nexport type ValueAtRiskChartData = {\n __typename?: 'ValueAtRiskChartData';\n average: Scalars['Float']['output'];\n max: Scalars['Float']['output'];\n median: Scalars['Float']['output'];\n points?: Maybe<Array<ValueAtRiskChartPoint>>;\n threshold: Scalars['Float']['output'];\n};\n\nexport type ValueAtRiskChartPoint = {\n __typename?: 'ValueAtRiskChartPoint';\n percent: Scalars['Float']['output'];\n pips: Scalars['Float']['output'];\n};\n\nexport enum ValueAtRiskDuration {\n C1 = 'C1',\n C2 = 'C2',\n C3 = 'C3',\n C4 = 'C4',\n C5 = 'C5',\n C10 = 'C10'\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n /** Valid for: H */\n D5 = 'D5',\n /** Valid for: H */\n D10 = 'D10',\n /** Valid for: D */\n M1 = 'M1',\n /** Valid for: D */\n M3 = 'M3',\n /** Valid for: W */\n W5 = 'W5',\n /** Valid for: W */\n W10 = 'W10'\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W'\n}\n\nexport type ValidateInstrumentsQueryVariables = Exact<{\n instruments: Array<InputMaybe<Scalars['String']['input']>> | InputMaybe<Scalars['String']['input']>;\n division?: InputMaybe<Division>;\n}>;\n\n\nexport type ValidateInstrumentsQuery = { __typename?: 'Query', mapInstrumentNames?: Array<{ __typename?: 'Instrument', name: string, displayName: string } | null> | null };\n\n\nexport const ValidateInstrumentsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"validateInstruments\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instruments\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"ListType\",\"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\":\"mapInstrumentNames\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"instruments\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instruments\"}}},{\"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\"}}]}}]}}]} as unknown as DocumentNode<ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables>;"],"mappings":";;;;;;IAwBYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IASdE,QAAQ,GAAAD,OAAA,CAAAC,QAAA,aAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAiBRC,mBAAmB,GAAAF,OAAA,CAAAE,mBAAA,aAAnBA,mBAAmB;EAAnBA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OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAa;UAAC,CAAC;QAAC;MAAC,CAAC;IAAC;EAAC,CAAC;AAAC,CAAyF","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _fragmentMasking = require("./fragment-masking");
|
|
7
|
+
Object.keys(_fragmentMasking).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _fragmentMasking[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _fragmentMasking[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _gql = require("./gql");
|
|
18
|
+
Object.keys(_gql).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _gql[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _gql[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_fragmentMasking","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_gql"],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from \"./fragment-masking\";\nexport * from \"./gql\";"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateInstruments = void 0;
|
|
7
|
+
var _client = require("@apollo/client");
|
|
8
|
+
const validateInstruments = exports.validateInstruments = (0, _client.gql)`
|
|
9
|
+
query validateInstruments($instruments: [String]!, $division: Division) {
|
|
10
|
+
mapInstrumentNames(instruments: $instruments, division: $division) {
|
|
11
|
+
name
|
|
12
|
+
displayName
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=validateInstruments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateInstruments.js","names":["_client","require","validateInstruments","exports","gql"],"sources":["../../../src/gql/validateInstruments.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const validateInstruments = gql`\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,WAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _types = require("./SpreadCostCalculatorWidget/types");
|
|
7
|
+
Object.keys(_types).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _types[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _SpreadCostCalculatorWidget = require("./SpreadCostCalculatorWidget/SpreadCostCalculatorWidget");
|
|
18
|
+
Object.keys(_SpreadCostCalculatorWidget).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _SpreadCostCalculatorWidget[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _SpreadCostCalculatorWidget[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_SpreadCostCalculatorWidget"],"sources":["../../src/index.ts"],"sourcesContent":["export * from './SpreadCostCalculatorWidget/types';\nexport * from './SpreadCostCalculatorWidget/SpreadCostCalculatorWidget';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.translations = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
|
+
var _en = _interopRequireDefault(require("./sources/en.json"));
|
|
9
|
+
var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
|
|
10
|
+
var _es = _interopRequireDefault(require("./sources/es.json"));
|
|
11
|
+
var _th = _interopRequireDefault(require("./sources/th.json"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const translations = exports.translations = {
|
|
14
|
+
[_monoI18n.Locale.en]: {
|
|
15
|
+
translation: _en.default
|
|
16
|
+
},
|
|
17
|
+
[_monoI18n.Locale.zhTW]: {
|
|
18
|
+
translation: _zh_TW.default
|
|
19
|
+
},
|
|
20
|
+
[_monoI18n.Locale.es]: {
|
|
21
|
+
translation: _es.default
|
|
22
|
+
},
|
|
23
|
+
[_monoI18n.Locale.th]: {
|
|
24
|
+
translation: _th.default
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_zh_TW","_es","_th","e","__esModule","default","translations","exports","Locale","en","translation","zhTW","es","th"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import { Locale, Translations } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\nimport es from './sources/es.json';\nimport th from './sources/th.json';\n\nimport { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n [Locale.es]: { translation: es },\n [Locale.th]: { translation: th },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,GAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAmC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM5B,MAAMG,YAA0B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACxC,CAACE,gBAAM,CAACC,EAAE,GAAG;IAAEC,WAAW,EAAED;EAAG,CAAC;EAChC,CAACD,gBAAM,CAACG,IAAI,GAAG;IAAED,WAAW,EAAEC;EAAK,CAAC;EACpC,CAACH,gBAAM,CAACI,EAAE,GAAG;IAAEF,WAAW,EAAEE;EAAG,CAAC;EAChC,CAACJ,gBAAM,CAACK,EAAE,GAAG;IAAEH,WAAW,EAAEG;EAAG;AACjC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"absolute_spread_cost": "Absolute Spread Cost",
|
|
3
|
+
"data_unavailable": "Data unavailable",
|
|
4
|
+
"instrument": "Instrument",
|
|
5
|
+
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries",
|
|
6
|
+
"pips": "Pips",
|
|
7
|
+
"search": "Search",
|
|
8
|
+
"spread": "Spread",
|
|
9
|
+
"units_traded": "Units traded",
|
|
10
|
+
"volume": "Volume"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"absolute_spread_cost": "Coste de spreads absolutos",
|
|
3
|
+
"data_unavailable": "No hay datos disponibles",
|
|
4
|
+
"instrument": "Instrumento",
|
|
5
|
+
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
|
|
6
|
+
"pips": "Pips",
|
|
7
|
+
"search": "Buscar",
|
|
8
|
+
"spread": "Spread",
|
|
9
|
+
"units_traded": "Unidades negociadas",
|
|
10
|
+
"volume": "Volumen"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"absolute_spread_cost": "ค่าสเปรดที่แท้จริง",
|
|
3
|
+
"data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
|
|
4
|
+
"instrument": "ตราสาร",
|
|
5
|
+
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
|
|
6
|
+
"pips": "Pips",
|
|
7
|
+
"search": "ค้นหา",
|
|
8
|
+
"spread": "สเปรด",
|
|
9
|
+
"units_traded": "จำนวนหน่วยที่ซื้อขาย",
|
|
10
|
+
"volume": "ปริมาณ"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"absolute_spread_cost": "絕對點差成本",
|
|
3
|
+
"data_unavailable": "沒有數據",
|
|
4
|
+
"instrument": "金融工具",
|
|
5
|
+
"pagination_entries_range": "{{itemCount}}个挂单中的{{firstItemOnPage}}-{{lastItemOnPage}}",
|
|
6
|
+
"pips": "點",
|
|
7
|
+
"search": "搜尋",
|
|
8
|
+
"spread": "點差",
|
|
9
|
+
"units_traded": "交易單位",
|
|
10
|
+
"volume": "交易量"
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.js","names":["defaultTranslations","exports"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {};\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
|
+
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
+
import { ChartError, cn, Label, NumberInput, Select, Size, ThemeContext, useNumberFormat } from '@oanda/labs-widget-common';
|
|
4
|
+
import { useCalculateSpread } from './useCalculateSpread';
|
|
5
|
+
import { getInstrumentCurrency } from './utils';
|
|
6
|
+
import { useInstrumentChange } from './useInstrumentChange';
|
|
7
|
+
import { CELL_EMPTY_VALUE } from './constant';
|
|
8
|
+
const Main = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
instruments
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
size
|
|
14
|
+
} = useContext(ThemeContext);
|
|
15
|
+
const isDesktop = size === Size.DESKTOP;
|
|
16
|
+
const selectOptions = instruments.map(instrument => ({
|
|
17
|
+
id: instrument.name,
|
|
18
|
+
label: instrument.displayName
|
|
19
|
+
}));
|
|
20
|
+
const {
|
|
21
|
+
value: unitsTraded,
|
|
22
|
+
handleValueChange: onUnitChange,
|
|
23
|
+
increment: incrementTradedUnits,
|
|
24
|
+
decrement: decrementTradedUnits
|
|
25
|
+
} = useNumberFormat({});
|
|
26
|
+
const {
|
|
27
|
+
value: spread,
|
|
28
|
+
handleValueChange: onSpreadChange,
|
|
29
|
+
increment: incrementSpread,
|
|
30
|
+
decrement: decrementSpread
|
|
31
|
+
} = useNumberFormat({
|
|
32
|
+
step: 0.1
|
|
33
|
+
});
|
|
34
|
+
const {
|
|
35
|
+
selectedInstrument,
|
|
36
|
+
setSelectedInstrument,
|
|
37
|
+
pipLocation,
|
|
38
|
+
initialSpread,
|
|
39
|
+
loading,
|
|
40
|
+
error
|
|
41
|
+
} = useInstrumentChange({
|
|
42
|
+
initialInstrument: {
|
|
43
|
+
id: instruments[0].name,
|
|
44
|
+
label: instruments[0].displayName
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
onSpreadChange({
|
|
49
|
+
floatValue: initialSpread,
|
|
50
|
+
formattedValue: initialSpread?.toString() || '',
|
|
51
|
+
value: initialSpread?.toString() || ''
|
|
52
|
+
});
|
|
53
|
+
}, [initialSpread]);
|
|
54
|
+
const {
|
|
55
|
+
lang
|
|
56
|
+
} = useLocale();
|
|
57
|
+
const spreadCost = useCalculateSpread({
|
|
58
|
+
spread,
|
|
59
|
+
unitsTraded,
|
|
60
|
+
pipLocation
|
|
61
|
+
});
|
|
62
|
+
return React.createElement(React.Fragment, null, error ? React.createElement("div", {
|
|
63
|
+
className: "lw-flex lw-h-[300px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
64
|
+
}, React.createElement(ChartError, null)) : React.createElement("div", {
|
|
65
|
+
"data-testid": "spread-cost-calculator",
|
|
66
|
+
className: "lw-mx-auto lw-flex lw-w-full lw-max-w-full lw-flex-col lw-content-center lw-justify-center lw-gap-8 lw-p-4"
|
|
67
|
+
}, React.createElement("div", {
|
|
68
|
+
className: "lw-flex lw-flex-col lw-gap-2"
|
|
69
|
+
}, React.createElement(Label, {
|
|
70
|
+
htmlFor: lang('instrument'),
|
|
71
|
+
className: "lw-text-text-primary"
|
|
72
|
+
}, lang('instrument')), React.createElement(Select, {
|
|
73
|
+
searchPlaceholder: lang('search'),
|
|
74
|
+
options: selectOptions,
|
|
75
|
+
selectedOption: selectedInstrument,
|
|
76
|
+
className: "lw-grow-0",
|
|
77
|
+
setSelectedOption: setSelectedInstrument,
|
|
78
|
+
maxHeight: isDesktop ? 190 : 220
|
|
79
|
+
})), React.createElement("div", {
|
|
80
|
+
className: "lw-flex lw-max-w-full lw-flex-col lw-content-center lw-justify-center lw-gap-3"
|
|
81
|
+
}, React.createElement("div", {
|
|
82
|
+
className: cn('lw-flex lw-max-w-full lw-flex-row lw-gap-3', !isDesktop && 'lw-flex-col lw-gap-8')
|
|
83
|
+
}, React.createElement(NumberInput, {
|
|
84
|
+
onValueChange: onUnitChange,
|
|
85
|
+
value: unitsTraded,
|
|
86
|
+
label: lang('units_traded'),
|
|
87
|
+
onIncrement: incrementTradedUnits,
|
|
88
|
+
onDecrement: decrementTradedUnits,
|
|
89
|
+
placeholder: lang('volume'),
|
|
90
|
+
disabled: loading,
|
|
91
|
+
withoutArrows: true
|
|
92
|
+
}), React.createElement(NumberInput, {
|
|
93
|
+
onValueChange: onSpreadChange,
|
|
94
|
+
value: spread,
|
|
95
|
+
label: lang('spread'),
|
|
96
|
+
onIncrement: incrementSpread,
|
|
97
|
+
onDecrement: decrementSpread,
|
|
98
|
+
placeholder: lang('pips'),
|
|
99
|
+
disabled: loading
|
|
100
|
+
})), React.createElement("div", {
|
|
101
|
+
className: "lw-pt-4 lw-text-text-primary"
|
|
102
|
+
}, React.createElement("div", null, lang('absolute_spread_cost')), React.createElement("div", {
|
|
103
|
+
className: "lw-pt-2 lw-text-3xl lw-font-bold"
|
|
104
|
+
}, spreadCost ? `${spreadCost} ${getInstrumentCurrency(selectedInstrument.id)}` : CELL_EMPTY_VALUE)))));
|
|
105
|
+
};
|
|
106
|
+
export { Main };
|
|
107
|
+
//# sourceMappingURL=Main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Main.js","names":["React","useContext","useEffect","useLocale","ChartError","cn","Label","NumberInput","Select","Size","ThemeContext","useNumberFormat","useCalculateSpread","getInstrumentCurrency","useInstrumentChange","CELL_EMPTY_VALUE","Main","_ref","instruments","size","isDesktop","DESKTOP","selectOptions","map","instrument","id","name","label","displayName","value","unitsTraded","handleValueChange","onUnitChange","increment","incrementTradedUnits","decrement","decrementTradedUnits","spread","onSpreadChange","incrementSpread","decrementSpread","step","selectedInstrument","setSelectedInstrument","pipLocation","initialSpread","loading","error","initialInstrument","floatValue","formattedValue","toString","lang","spreadCost","createElement","Fragment","className","htmlFor","searchPlaceholder","options","selectedOption","setSelectedOption","maxHeight","onValueChange","onIncrement","onDecrement","placeholder","disabled","withoutArrows"],"sources":["../../../src/SpreadCostCalculatorWidget/Main.tsx"],"sourcesContent":["import React, {\n FC, useContext, useEffect,\n} from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport {\n ChartError,\n cn,\n Label,\n NumberInput,\n Select,\n Size,\n ThemeContext,\n useNumberFormat,\n} from '@oanda/labs-widget-common';\nimport { useCalculateSpread } from './useCalculateSpread';\nimport { getInstrumentCurrency } from './utils';\nimport { useInstrumentChange } from './useInstrumentChange';\nimport { MainProps } from './types';\nimport { CELL_EMPTY_VALUE } from './constant';\n\nconst Main: FC<MainProps> = ({\n instruments,\n}) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const selectOptions = instruments.map((instrument) => ({\n id: instrument.name,\n label: instrument.displayName,\n }));\n\n const {\n value: unitsTraded,\n handleValueChange: onUnitChange,\n increment: incrementTradedUnits,\n decrement: decrementTradedUnits,\n } = useNumberFormat({});\n\n const {\n value: spread,\n handleValueChange: onSpreadChange,\n increment: incrementSpread,\n decrement: decrementSpread,\n } = useNumberFormat({\n step: 0.1,\n });\n\n const {\n selectedInstrument,\n setSelectedInstrument,\n pipLocation,\n initialSpread,\n loading,\n error,\n } = useInstrumentChange({\n initialInstrument: {\n id: instruments[0].name,\n label: instruments[0].displayName,\n },\n });\n\n useEffect(() => {\n onSpreadChange({\n floatValue: initialSpread,\n formattedValue: initialSpread?.toString() || '',\n value: initialSpread?.toString() || '',\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialSpread]);\n\n const { lang } = useLocale();\n\n const spreadCost = useCalculateSpread({\n spread,\n unitsTraded,\n pipLocation,\n });\n\n return (\n <>\n {error ? (\n <div className=\"lw-flex lw-h-[300px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n ) : (\n <div\n data-testid=\"spread-cost-calculator\"\n className=\"lw-mx-auto lw-flex lw-w-full lw-max-w-full lw-flex-col lw-content-center lw-justify-center lw-gap-8 lw-p-4\"\n >\n <div className=\"lw-flex lw-flex-col lw-gap-2\">\n <Label htmlFor={lang('instrument')} className=\"lw-text-text-primary\">\n {lang('instrument')}\n </Label>\n <Select\n searchPlaceholder={lang('search')}\n options={selectOptions}\n selectedOption={selectedInstrument}\n className=\"lw-grow-0\"\n setSelectedOption={setSelectedInstrument}\n maxHeight={isDesktop ? 190 : 220}\n />\n </div>\n <div className=\"lw-flex lw-max-w-full lw-flex-col lw-content-center lw-justify-center lw-gap-3\">\n <div className={cn('lw-flex lw-max-w-full lw-flex-row lw-gap-3', !isDesktop && 'lw-flex-col lw-gap-8')}>\n <NumberInput\n onValueChange={onUnitChange}\n value={unitsTraded}\n label={lang('units_traded')}\n onIncrement={incrementTradedUnits}\n onDecrement={decrementTradedUnits}\n placeholder={lang('volume')}\n disabled={loading}\n withoutArrows\n />\n <NumberInput\n onValueChange={onSpreadChange}\n value={spread}\n label={lang('spread')}\n onIncrement={incrementSpread}\n onDecrement={decrementSpread}\n placeholder={lang('pips')}\n disabled={loading}\n />\n </div>\n <div className=\"lw-pt-4 lw-text-text-primary\">\n <div>{lang('absolute_spread_cost')}</div>\n <div className=\"lw-pt-2 lw-text-3xl lw-font-bold\">\n {spreadCost ? `${spreadCost} ${getInstrumentCurrency(selectedInstrument.id)}` : CELL_EMPTY_VALUE }\n </div>\n </div>\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,IACNC,UAAU,EAAEC,SAAS,QACpB,OAAO;AACd,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SACEC,UAAU,EACVC,EAAE,EACFC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,YAAY,EACZC,eAAe,QACV,2BAA2B;AAClC,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,qBAAqB,QAAQ,SAAS;AAC/C,SAASC,mBAAmB,QAAQ,uBAAuB;AAE3D,SAASC,gBAAgB,QAAQ,YAAY;AAE7C,MAAMC,IAAmB,GAAGC,IAAA,IAEtB;EAAA,IAFuB;IAC3BC;EACF,CAAC,GAAAD,IAAA;EACC,MAAM;IAAEE;EAAK,CAAC,GAAGlB,UAAU,CAACS,YAAY,CAAC;EACzC,MAAMU,SAAS,GAAGD,IAAI,KAAKV,IAAI,CAACY,OAAO;EAEvC,MAAMC,aAAa,GAAGJ,WAAW,CAACK,GAAG,CAAEC,UAAU,KAAM;IACrDC,EAAE,EAAED,UAAU,CAACE,IAAI;IACnBC,KAAK,EAAEH,UAAU,CAACI;EACpB,CAAC,CAAC,CAAC;EAEH,MAAM;IACJC,KAAK,EAAEC,WAAW;IAClBC,iBAAiB,EAAEC,YAAY;IAC/BC,SAAS,EAAEC,oBAAoB;IAC/BC,SAAS,EAAEC;EACb,CAAC,GAAGzB,eAAe,CAAC,CAAC,CAAC,CAAC;EAEvB,MAAM;IACJkB,KAAK,EAAEQ,MAAM;IACbN,iBAAiB,EAAEO,cA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AA,CAAAsD,aAAA;IAAKE,SAAS,EAAC;EAAkC,GAC9CH,UAAU,GAAG,GAAGA,UAAU,IAAIxC,qBAAqB,CAAC6B,kBAAkB,CAACjB,EAAE,CAAC,EAAE,GAAGV,gBAC7E,CACF,CACF,CACF,CAEP,CAAC;AAEP,CAAC;AAED,SAASC,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';
|
|
3
|
+
import { getLocale, LiveRatesProvider, ThemeProvider } from '@oanda/labs-widget-common';
|
|
4
|
+
import { Division } from '@oanda/labs-live-rates-table-widget';
|
|
5
|
+
import { LocaleProvider } from '@oanda/mono-i18n';
|
|
6
|
+
import { translations } from '../translations';
|
|
7
|
+
import { ValidationWrapper } from './ValidationWrapper';
|
|
8
|
+
const SpreadCostCalculatorWidget = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
graphqlUrl,
|
|
11
|
+
liveRatesUrl,
|
|
12
|
+
theme,
|
|
13
|
+
locale,
|
|
14
|
+
isParamError,
|
|
15
|
+
removePadding,
|
|
16
|
+
division,
|
|
17
|
+
instruments
|
|
18
|
+
} = _ref;
|
|
19
|
+
const client = new ApolloClient({
|
|
20
|
+
uri: graphqlUrl,
|
|
21
|
+
cache: new InMemoryCache()
|
|
22
|
+
});
|
|
23
|
+
const divisionCode = division === Division.Opt ? Division.Ogm : division;
|
|
24
|
+
const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';
|
|
25
|
+
return React.createElement(LocaleProvider, {
|
|
26
|
+
locale: getLocale(locale),
|
|
27
|
+
translations: translations
|
|
28
|
+
}, React.createElement(LiveRatesProvider, {
|
|
29
|
+
url: liveRatesUrl,
|
|
30
|
+
options: {
|
|
31
|
+
divisionCode,
|
|
32
|
+
dataSource
|
|
33
|
+
}
|
|
34
|
+
}, React.createElement(ApolloProvider, {
|
|
35
|
+
client: client
|
|
36
|
+
}, React.createElement(Suspense, null, React.createElement(ThemeProvider, {
|
|
37
|
+
theme: theme,
|
|
38
|
+
removePadding: removePadding
|
|
39
|
+
}, React.createElement(ValidationWrapper, {
|
|
40
|
+
instruments: instruments,
|
|
41
|
+
division: division,
|
|
42
|
+
isParamError: isParamError
|
|
43
|
+
}))))));
|
|
44
|
+
};
|
|
45
|
+
export { SpreadCostCalculatorWidget };
|
|
46
|
+
//# sourceMappingURL=SpreadCostCalculatorWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpreadCostCalculatorWidget.js","names":["React","Suspense","ApolloClient","ApolloProvider","InMemoryCache","getLocale","LiveRatesProvider","ThemeProvider","Division","LocaleProvider","translations","ValidationWrapper","SpreadCostCalculatorWidget","_ref","graphqlUrl","liveRatesUrl","theme","locale","isParamError","removePadding","division","instruments","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options"],"sources":["../../../src/SpreadCostCalculatorWidget/SpreadCostCalculatorWidget.tsx"],"sourcesContent":["import React, { FC, Suspense } from 'react';\nimport { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport {\n getLocale, LiveRatesProvider, ThemeProvider,\n} from '@oanda/labs-widget-common';\nimport { Division } from '@oanda/labs-live-rates-table-widget';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { SpreadCostCalculatorWidgetConfig } from './types';\nimport { translations } from '../translations';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst SpreadCostCalculatorWidget: FC<SpreadCostCalculatorWidgetConfig> = ({\n graphqlUrl,\n liveRatesUrl,\n theme,\n locale,\n isParamError,\n removePadding,\n division,\n instruments,\n}) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider theme={theme} removePadding={removePadding}>\n <ValidationWrapper\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { SpreadCostCalculatorWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,YAAY,EAAEC,cAAc,EAAEC,aAAa,QAAQ,gBAAgB;AAC5E,SACEC,SAAS,EAAEC,iBAAiB,EAAEC,aAAa,QACtC,2BAA2B;AAClC,SAASC,QAAQ,QAAQ,qCAAqC;AAC9D,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,0BAAgE,GAAGC,IAAA,IASnE;EAAA,IAToE;IACxEC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,YAAY;IACZC,aAAa;IACbC,QAAQ;IACRC;EACF,CAAC,GAAAR,IAAA;EACC,MAAMS,MAAM,GAAG,IAAIpB,YAAY,CAAC;IAC9BqB,GAAG,EAAET,UAAU;IACfU,KAAK,EAAE,IAAIpB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMqB,YAAY,GAAGL,QAAQ,KAAKZ,QAAQ,CAACkB,GAAG,GAAGlB,QAAQ,CAACmB,GAAG,GAAGP,QAAQ;EACxE,MAAMQ,UAAU,GAAGH,YAAY,KAAKjB,QAAQ,CAACmB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE3B,KAAA,CAAA6B,aAAA,CAACpB,cAAc;IAACQ,MAAM,EAAEZ,SAAS,CAACY,MAAM,CAAE;IAACP,YAAY,EAAEA;EAAa,GACpEV,KAAA,CAAA6B,aAAA,CAACvB,iBAAiB;I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