@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,38 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { useSuspenseQuery } from '@apollo/client';
|
|
3
|
+
import { ChartError, ThemeContext } from '@oanda/labs-widget-common';
|
|
4
|
+
import { Main } from './Main';
|
|
5
|
+
import { validateInstruments } from '../gql/validateInstruments';
|
|
6
|
+
const ValidationWrapper = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
division,
|
|
9
|
+
instruments,
|
|
10
|
+
isParamError
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
size
|
|
14
|
+
} = useContext(ThemeContext);
|
|
15
|
+
const {
|
|
16
|
+
data,
|
|
17
|
+
error
|
|
18
|
+
} = useSuspenseQuery(validateInstruments, {
|
|
19
|
+
variables: {
|
|
20
|
+
instruments,
|
|
21
|
+
division
|
|
22
|
+
},
|
|
23
|
+
fetchPolicy: 'network-only',
|
|
24
|
+
errorPolicy: 'all'
|
|
25
|
+
});
|
|
26
|
+
const instrumentsData = data?.mapInstrumentNames?.map(instrument => ({
|
|
27
|
+
name: instrument.name,
|
|
28
|
+
displayName: instrument.displayName
|
|
29
|
+
})) || [];
|
|
30
|
+
const showError = !!error || isParamError;
|
|
31
|
+
return React.createElement(React.Fragment, null, size && React.createElement(React.Fragment, null, showError ? React.createElement("div", {
|
|
32
|
+
className: "lw-flex lw-h-[300px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
33
|
+
}, React.createElement(ChartError, null)) : React.createElement(Main, {
|
|
34
|
+
instruments: instrumentsData
|
|
35
|
+
})));
|
|
36
|
+
};
|
|
37
|
+
export { ValidationWrapper };
|
|
38
|
+
//# sourceMappingURL=ValidationWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationWrapper.js","names":["React","useContext","useSuspenseQuery","ChartError","ThemeContext","Main","validateInstruments","ValidationWrapper","_ref","division","instruments","isParamError","size","data","error","variables","fetchPolicy","errorPolicy","instrumentsData","mapInstrumentNames","map","instrument","name","displayName","showError","createElement","Fragment","className"],"sources":["../../../src/SpreadCostCalculatorWidget/ValidationWrapper.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport { ChartError, ThemeContext } from '@oanda/labs-widget-common';\nimport { Main } from './Main';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { ValidationWrapperProps } from './types';\n\nconst ValidationWrapper = ({\n division,\n instruments,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useContext(ThemeContext);\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const instrumentsData = data?.mapInstrumentNames?.map((instrument) => ({\n name: instrument!.name,\n displayName: instrument!.displayName,\n })) || [];\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {size && (\n <>\n {showError ? (\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 <Main instruments={instrumentsData} />\n )}\n </>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,UAAU,EAAEC,YAAY,QAAQ,2BAA2B;AACpE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,mBAAmB,QAAQ,4BAA4B;AAIhE,MAAMC,iBAAiB,GAAGC,IAAA,IAII;EAAA,IAJH;IACzBC,QAAQ;IACRC,WAAW;IACXC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAM;IAAEI;EAAK,CAAC,GAAGX,UAAU,CAACG,YAAY,CAAC;EACzC,MAAM;IAAES,IAAI;IAAEC;EAAM,CAAC,GAAGZ,gBAAgB,CAGtCI,mBAAmB,EAAE;IACrBS,SAAS,EAAE;MACTL,WAAW;MACXD;IACF,CAAC;IACDO,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,eAAe,GAAGL,IAAI,EAAEM,kBAAkB,EAAEC,GAAG,CAAEC,UAAU,KAAM;IACrEC,IAAI,EAAED,UAAU,CAAEC,IAAI;IACtBC,WAAW,EAAEF,UAAU,CAAEE;EAC3B,CAAC,CAAC,CAAC,IAAI,EAAE;EAET,MAAMC,SAAS,GAAG,CAAC,CAACV,KAAK,IAAIH,YAAY;EAEzC,OACEX,KAAA,CAAAyB,aAAA,CAAAzB,KAAA,CAAA0B,QAAA,QACGd,IAAI,IACLZ,KAAA,CAAAyB,aAAA,CAAAzB,KAAA,CAAA0B,QAAA,QACGF,SAAS,GACRxB,KAAA,CAAAyB,aAAA;IAAKE,SAAS,EAAC;EAAmG,GAChH3B,KAAA,CAAAyB,aAAA,CAACtB,UAAU,MAAE,CACV,CAAC,GAENH,KAAA,CAAAyB,aAAA,CAACpB,IAAI;IAACK,WAAW,EAAEQ;EAAgB,CAAE,CAEvC,CAEF,CAAC;AAEP,CAAC;AAED,SAASX,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","names":["CELL_EMPTY_VALUE"],"sources":["../../../src/SpreadCostCalculatorWidget/constant.ts"],"sourcesContent":["export const CELL_EMPTY_VALUE = '\\u2014';\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/SpreadCostCalculatorWidget/index.ts"],"sourcesContent":["export * from './Main';\nexport * from './types';\n"],"mappings":"AAAA,cAAc,QAAQ;AACtB,cAAc,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
|
|
4
|
+
import { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';
|
|
5
|
+
const {
|
|
6
|
+
graphqlUrl,
|
|
7
|
+
liveRatesUrl
|
|
8
|
+
} = window.widgetsConfig || {};
|
|
9
|
+
const spreadCostCalculatorParamsElements = document.querySelectorAll('div[data-spread-cost-calculator-params]');
|
|
10
|
+
spreadCostCalculatorParamsElements.forEach(element => {
|
|
11
|
+
const root = createRoot(element);
|
|
12
|
+
const params = element.getAttribute('data-spread-cost-calculator-params');
|
|
13
|
+
const mode = element.getAttribute('data-mode');
|
|
14
|
+
const {
|
|
15
|
+
locale,
|
|
16
|
+
instruments,
|
|
17
|
+
division
|
|
18
|
+
} = JSON.parse(params);
|
|
19
|
+
const isParamError = validateToolParams({
|
|
20
|
+
locale,
|
|
21
|
+
graphqlUrl,
|
|
22
|
+
instruments,
|
|
23
|
+
division,
|
|
24
|
+
liveRatesUrl
|
|
25
|
+
}, [{
|
|
26
|
+
name: 'locale',
|
|
27
|
+
valueCheck: value => validateLocale(value)
|
|
28
|
+
}, {
|
|
29
|
+
name: 'graphqlUrl'
|
|
30
|
+
}, {
|
|
31
|
+
name: 'liveRatesUrl'
|
|
32
|
+
}, {
|
|
33
|
+
name: 'division'
|
|
34
|
+
}, {
|
|
35
|
+
name: 'instruments',
|
|
36
|
+
valueCheck: value => value.length > 0 && value.length <= 10
|
|
37
|
+
}]);
|
|
38
|
+
root.render(React.createElement(SpreadCostCalculatorWidget, {
|
|
39
|
+
division: division,
|
|
40
|
+
instruments: instruments,
|
|
41
|
+
liveRatesUrl: liveRatesUrl,
|
|
42
|
+
graphqlUrl: graphqlUrl,
|
|
43
|
+
locale: locale,
|
|
44
|
+
theme: mode,
|
|
45
|
+
isParamError: isParamError
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","SpreadCostCalculatorWidget","graphqlUrl","liveRatesUrl","window","widgetsConfig","spreadCostCalculatorParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","locale","instruments","division","JSON","parse","isParamError","name","valueCheck","value","length","render","createElement","theme"],"sources":["../../../src/SpreadCostCalculatorWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { SpreadCostCalculatorWidget } from './SpreadCostCalculatorWidget';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\nconst spreadCostCalculatorParamsElements = document.querySelectorAll(\n 'div[data-spread-cost-calculator-params]',\n);\n\nspreadCostCalculatorParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-spread-cost-calculator-params');\n const mode = element.getAttribute('data-mode');\n const { locale, instruments, division } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n locale,\n graphqlUrl,\n instruments,\n division,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n {\n name: 'division',\n },\n {\n name: 'instruments',\n valueCheck: (value) => (value as string[]).length > 0 && (value as string[]).length <= 10,\n },\n ],\n );\n\n root.render(\n <SpreadCostCalculatorWidget\n division={division}\n instruments={instruments}\n liveRatesUrl={liveRatesUrl}\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n />,\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,0BAA0B,QAAQ,8BAA8B;AAEzE,MAAM;EACJC,UAAU;EACVC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAC9B,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAClE,yCACF,CAAC;AAEDF,kCAAkC,CAACG,OAAO,CAAEC,OAAO,IAAK;EACtD,MAAMC,IAAI,GAAGb,UAAU,CAACY,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,oCAAoC,CAAC;EACzE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,MAAM;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,MAAgB,CAAC;EAEtE,MAAMQ,YAAY,GAAGpB,kBAAkB,CACrC;IACEe,MAAM;IACNb,UAAU;IACVc,WAAW;IACXC,QAAQ;IACRd;EACF,CAAC,EACD,CACE;IACEkB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAK,IAAKxB,cAAc,CAACwB,KAAK;EAC7C,CAAC,EACD;IACEF,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE,aAAa;IACnBC,UAAU,EAAGC,KAAK,IAAMA,KAAK,CAAcC,MAAM,GAAG,CAAC,IAAKD,KAAK,CAAcC,MAAM,IAAI;EACzF,CAAC,CAEL,CAAC;EAEDb,IAAI,CAACc,MAAM,CACT5B,KAAA,CAAA6B,aAAA,CAACzB,0BAA0B;IACzBgB,QAAQ,EAAEA,QAAS;IACnBD,WAAW,EAAEA,WAAY;IACzBb,YAAY,EAAEA,YAAa;IAC3BD,UAAU,EAAEA,UAAW;IACvBa,MAAM,EAAEA,MAAO;IACfY,KAAK,EAAEb,IAAc;IACrBM,YAAY,EAAEA;EAAa,CAC5B,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/SpreadCostCalculatorWidget/types.ts"],"sourcesContent":["import { WidgetWrapperProps } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport type SpreadCostCalculatorWidgetConfig = Pick<\nWidgetWrapperProps,\n'locale' | 'theme' | 'isParamError' | 'removePadding'\n> & {\n graphqlUrl: string;\n liveRatesUrl: string;\n division: Division;\n instruments: string[];\n};\n\nexport type InstrumentResponse = {\n name: string;\n displayName: string;\n};\n\nexport type MainProps = {\n instruments: InstrumentResponse[];\n};\n\nexport interface ValidationWrapperProps {\n division: Division;\n instruments: string[];\n isParamError?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useDebounceValue } from 'usehooks-ts';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
const calculateAbsoluteSpreadCost = (unitsTraded, spread, pipLocation) => unitsTraded !== undefined && spread !== undefined && pipLocation !== undefined ? Math.ceil(unitsTraded * spread * Number((10 ** pipLocation).toFixed(Math.abs(pipLocation))) / 2 * 10000) / 10000 : undefined;
|
|
4
|
+
export const useCalculateSpread = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
spread,
|
|
7
|
+
unitsTraded,
|
|
8
|
+
pipLocation,
|
|
9
|
+
delay = 350
|
|
10
|
+
} = _ref;
|
|
11
|
+
const [debouncedValue, setValue] = useDebounceValue(undefined, delay);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setValue(calculateAbsoluteSpreadCost(unitsTraded, spread, pipLocation));
|
|
14
|
+
}, [spread, unitsTraded, pipLocation, setValue]);
|
|
15
|
+
return debouncedValue;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useCalculateSpread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalculateSpread.js","names":["useDebounceValue","useEffect","calculateAbsoluteSpreadCost","unitsTraded","spread","pipLocation","undefined","Math","ceil","Number","toFixed","abs","useCalculateSpread","_ref","delay","debouncedValue","setValue"],"sources":["../../../src/SpreadCostCalculatorWidget/useCalculateSpread.ts"],"sourcesContent":["import { useDebounceValue } from 'usehooks-ts';\nimport { useEffect } from 'react';\nimport { Voidable } from '@oanda/labs-widget-common';\n\nexport type UseCalculateSpreadInput = {\n spread: Voidable<number>;\n unitsTraded: Voidable<number>;\n pipLocation: Voidable<number>;\n delay?: number;\n};\n\nconst calculateAbsoluteSpreadCost = (\n unitsTraded?: number,\n spread?: number,\n pipLocation?: number,\n): number | undefined => (unitsTraded !== undefined\n && spread !== undefined\n && pipLocation !== undefined\n ? Math.ceil(\n ((unitsTraded * spread * Number((10 ** pipLocation).toFixed(Math.abs(pipLocation)))) / 2)\n * 10000,\n ) / 10000\n : undefined);\n\nexport const useCalculateSpread = ({\n spread,\n unitsTraded,\n pipLocation,\n delay = 350,\n}: UseCalculateSpreadInput) => {\n const [debouncedValue, setValue] = useDebounceValue<undefined | number>(undefined, delay);\n\n useEffect(() => {\n setValue(calculateAbsoluteSpreadCost(unitsTraded, spread, pipLocation));\n }, [spread, unitsTraded, pipLocation, setValue]);\n\n return debouncedValue;\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,SAAS,QAAQ,OAAO;AAUjC,MAAMC,2BAA2B,GAAGA,CAClCC,WAAoB,EACpBC,MAAe,EACfC,WAAoB,KACIF,WAAW,KAAKG,SAAS,IAC9CF,MAAM,KAAKE,SAAS,IACpBD,WAAW,KAAKC,SAAS,GAC1BC,IAAI,CAACC,IAAI,CACPL,WAAW,GAAGC,MAAM,GAAGK,MAAM,CAAC,CAAC,EAAE,IAAIJ,WAAW,EAAEK,OAAO,CAACH,IAAI,CAACI,GAAG,CAACN,WAAW,CAAC,CAAC,CAAC,GAAI,CAAC,GAChF,KACV,CAAC,GAAG,KAAK,GACPC,SAAU;AAEd,OAAO,MAAMM,kBAAkB,GAAGC,IAAA,IAKH;EAAA,IALI;IACjCT,MAAM;IACND,WAAW;IACXE,WAAW;IACXS,KAAK,GAAG;EACe,CAAC,GAAAD,IAAA;EACxB,MAAM,CAACE,cAAc,EAAEC,QAAQ,CAAC,GAAGhB,gBAAgB,CAAqBM,SAAS,EAAEQ,KAAK,CAAC;EAEzFb,SAAS,CAAC,MAAM;IACde,QAAQ,CAACd,2BAA2B,CAACC,WAAW,EAAEC,MAAM,EAAEC,WAAW,CAAC,CAAC;EACzE,CAAC,EAAE,CAACD,MAAM,EAAED,WAAW,EAAEE,WAAW,EAAEW,QAAQ,CAAC,CAAC;EAEhD,OAAOD,cAAc;AACvB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useLiveRatesMessage, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
export const useInstrumentChange = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
initialInstrument
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
target,
|
|
9
|
+
setQuery,
|
|
10
|
+
closeQuery
|
|
11
|
+
} = useLiveRatesQuery();
|
|
12
|
+
const [loading, setLoading] = useState(true);
|
|
13
|
+
const [selectedInstrument, setSelectedInstrument] = useState(initialInstrument);
|
|
14
|
+
const [pipLocation, setPipLocation] = useState(undefined);
|
|
15
|
+
const [initialSpread, setSpread] = useState(undefined);
|
|
16
|
+
const {
|
|
17
|
+
update,
|
|
18
|
+
error,
|
|
19
|
+
connectionError
|
|
20
|
+
} = useLiveRatesMessage(selectedInstrument.id, target);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (selectedInstrument.id === update?.symbol) {
|
|
23
|
+
setPipLocation(update.pipLocation);
|
|
24
|
+
setSpread(update.spread);
|
|
25
|
+
setLoading(false);
|
|
26
|
+
closeQuery();
|
|
27
|
+
}
|
|
28
|
+
}, [update]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setLoading(true);
|
|
31
|
+
setQuery({
|
|
32
|
+
instruments: [selectedInstrument.id]
|
|
33
|
+
});
|
|
34
|
+
}, [selectedInstrument.id]);
|
|
35
|
+
return {
|
|
36
|
+
selectedInstrument,
|
|
37
|
+
setSelectedInstrument,
|
|
38
|
+
pipLocation,
|
|
39
|
+
initialSpread,
|
|
40
|
+
loading,
|
|
41
|
+
error: !!error || !!connectionError
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=useInstrumentChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInstrumentChange.js","names":["useLiveRatesMessage","useLiveRatesQuery","useEffect","useState","useInstrumentChange","_ref","initialInstrument","target","setQuery","closeQuery","loading","setLoading","selectedInstrument","setSelectedInstrument","pipLocation","setPipLocation","undefined","initialSpread","setSpread","update","error","connectionError","id","symbol","spread","instruments"],"sources":["../../../src/SpreadCostCalculatorWidget/useInstrumentChange.ts"],"sourcesContent":["import { SelectOption, useLiveRatesMessage, useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { useEffect, useState } from 'react';\n\nexport type UseInstrumentChangeInput = {\n initialInstrument: SelectOption;\n};\n\nexport const useInstrumentChange = ({\n initialInstrument,\n}: UseInstrumentChangeInput) => {\n const { target, setQuery, closeQuery } = useLiveRatesQuery();\n const [loading, setLoading] = useState(true);\n const [selectedInstrument, setSelectedInstrument] = useState(initialInstrument);\n const [pipLocation, setPipLocation] = useState<undefined | number>(undefined);\n const [initialSpread, setSpread] = useState<undefined | number>(undefined);\n\n const { update, error, connectionError } = useLiveRatesMessage(\n selectedInstrument.id,\n target,\n );\n\n useEffect(() => {\n if (selectedInstrument.id === update?.symbol) {\n setPipLocation(update.pipLocation);\n setSpread(update.spread);\n setLoading(false);\n closeQuery();\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [update]);\n\n useEffect(() => {\n setLoading(true);\n setQuery({ instruments: [selectedInstrument.id] });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedInstrument.id]);\n\n return {\n selectedInstrument,\n setSelectedInstrument,\n pipLocation,\n initialSpread,\n loading,\n error: !!error || !!connectionError,\n };\n};\n"],"mappings":"AAAA,SAAuBA,mBAAmB,EAAEC,iBAAiB,QAAQ,2BAA2B;AAChG,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AA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,CAACC;EACtB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const getInstrumentCurrency = instrument => {
|
|
2
|
+
if (typeof instrument === 'string') {
|
|
3
|
+
return instrument.split('_')[1] || ' ';
|
|
4
|
+
}
|
|
5
|
+
if (instrument?.name) {
|
|
6
|
+
return instrument.name.split('_')[1] || ' ';
|
|
7
|
+
}
|
|
8
|
+
return ' ';
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["getInstrumentCurrency","instrument","split","name"],"sources":["../../../src/SpreadCostCalculatorWidget/utils.ts"],"sourcesContent":["import { InstrumentResponse } from './types';\n\nexport const getInstrumentCurrency = (instrument: string | InstrumentResponse | null): string => {\n if (typeof instrument === 'string') {\n return instrument.split('_')[1] || ' ';\n }\n if (instrument?.name) {\n return instrument.name.split('_')[1] || ' ';\n }\n\n return ' ';\n};\n"],"mappings":"AAEA,OAAO,MAAMA,qBAAqB,GAAIC,UAA8C,IAAa;EAC/F,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IAClC,OAAOA,UAAU,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG;EACxC;EACA,IAAID,UAAU,EAAEE,IAAI,EAAE;IACpB,OAAOF,UAAU,CAACE,IAAI,CAACD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG;EAC7C;EAEA,OAAO,GAAG;AACZ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function useFragment(_documentNode, fragmentType) {
|
|
2
|
+
return fragmentType;
|
|
3
|
+
}
|
|
4
|
+
export function makeFragmentData(data, _fragment) {
|
|
5
|
+
return data;
|
|
6
|
+
}
|
|
7
|
+
export function isFragmentReady(queryNode, fragmentNode, data) {
|
|
8
|
+
const deferredFields = queryNode.__meta__?.deferredFields;
|
|
9
|
+
if (!deferredFields) return true;
|
|
10
|
+
const fragDef = fragmentNode.definitions[0];
|
|
11
|
+
const fragName = fragDef?.name?.value;
|
|
12
|
+
const fields = fragName && deferredFields[fragName] || [];
|
|
13
|
+
return fields.length > 0 && fields.every(field => data && field in data);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=fragment-masking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\n\nexport type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<\n infer TType,\n any\n>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__\n ?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every(field => data && field in data);\n}\n"],"mappings":"AAoCA,OAAO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAAmJ,EAClG;EACjD,OAAOA,YAAY;AACrB;AAGA,OAAO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACA,OAAO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAAiF,EACtC;EAC3C,MAAMK,cAAc,GAAIF,SAAS,CAAwEG,QAAQ,EAC7GD,cAAc;EAElB,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAAuC;EACjF,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAACC,KAAK,IAAIf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC1E","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as types from './graphql';
|
|
2
|
+
const documents = {
|
|
3
|
+
"\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n": types.ValidateInstrumentsDocument
|
|
4
|
+
};
|
|
5
|
+
export function graphql(source) {
|
|
6
|
+
return documents[source] ?? {};
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=gql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql.js","names":["types","documents","ValidateInstrumentsDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n \"\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\": types.ValidateInstrumentsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\"): (typeof documents)[\"\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,WAAW;AAalC,MAAMC,SAAS,GAAG;EACd,sMAAsM,EAAED,KAAK,CAACE;AAClN,CAAC;AAqBD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
export let AssetClassName = function (AssetClassName) {
|
|
2
|
+
AssetClassName["Commodities"] = "COMMODITIES";
|
|
3
|
+
AssetClassName["Cryptocurrency"] = "CRYPTOCURRENCY";
|
|
4
|
+
AssetClassName["Currency"] = "CURRENCY";
|
|
5
|
+
AssetClassName["EquityShares"] = "EQUITY_SHARES";
|
|
6
|
+
AssetClassName["Indices"] = "INDICES";
|
|
7
|
+
AssetClassName["Rates"] = "RATES";
|
|
8
|
+
return AssetClassName;
|
|
9
|
+
}({});
|
|
10
|
+
export let BookType = function (BookType) {
|
|
11
|
+
BookType["Order"] = "ORDER";
|
|
12
|
+
BookType["Position"] = "POSITION";
|
|
13
|
+
return BookType;
|
|
14
|
+
}({});
|
|
15
|
+
export let CorrelationTimeUnit = function (CorrelationTimeUnit) {
|
|
16
|
+
CorrelationTimeUnit["H1"] = "H1";
|
|
17
|
+
CorrelationTimeUnit["H4"] = "H4";
|
|
18
|
+
CorrelationTimeUnit["H24"] = "H24";
|
|
19
|
+
CorrelationTimeUnit["M1"] = "M1";
|
|
20
|
+
CorrelationTimeUnit["M3"] = "M3";
|
|
21
|
+
CorrelationTimeUnit["M6"] = "M6";
|
|
22
|
+
CorrelationTimeUnit["W1"] = "W1";
|
|
23
|
+
CorrelationTimeUnit["Y1"] = "Y1";
|
|
24
|
+
return CorrelationTimeUnit;
|
|
25
|
+
}({});
|
|
26
|
+
export let CurrencyName = function (CurrencyName) {
|
|
27
|
+
CurrencyName["Aud"] = "AUD";
|
|
28
|
+
CurrencyName["Cad"] = "CAD";
|
|
29
|
+
CurrencyName["Chf"] = "CHF";
|
|
30
|
+
CurrencyName["Eur"] = "EUR";
|
|
31
|
+
CurrencyName["Gbp"] = "GBP";
|
|
32
|
+
CurrencyName["Jpy"] = "JPY";
|
|
33
|
+
CurrencyName["Nzd"] = "NZD";
|
|
34
|
+
CurrencyName["Usd"] = "USD";
|
|
35
|
+
return CurrencyName;
|
|
36
|
+
}({});
|
|
37
|
+
export let CurrencyPowerBalanceTimeUnit = function (CurrencyPowerBalanceTimeUnit) {
|
|
38
|
+
CurrencyPowerBalanceTimeUnit["CurrentDay"] = "CURRENT_DAY";
|
|
39
|
+
CurrencyPowerBalanceTimeUnit["H4"] = "H4";
|
|
40
|
+
CurrencyPowerBalanceTimeUnit["H8"] = "H8";
|
|
41
|
+
CurrencyPowerBalanceTimeUnit["H24"] = "H24";
|
|
42
|
+
CurrencyPowerBalanceTimeUnit["M1"] = "M1";
|
|
43
|
+
CurrencyPowerBalanceTimeUnit["M3"] = "M3";
|
|
44
|
+
CurrencyPowerBalanceTimeUnit["PreviousDay"] = "PREVIOUS_DAY";
|
|
45
|
+
CurrencyPowerBalanceTimeUnit["W1"] = "W1";
|
|
46
|
+
return CurrencyPowerBalanceTimeUnit;
|
|
47
|
+
}({});
|
|
48
|
+
export let DataSource = function (DataSource) {
|
|
49
|
+
DataSource["Ny4"] = "NY4";
|
|
50
|
+
DataSource["Ty3"] = "TY3";
|
|
51
|
+
return DataSource;
|
|
52
|
+
}({});
|
|
53
|
+
export let Division = function (Division) {
|
|
54
|
+
Division["Oap"] = "OAP";
|
|
55
|
+
Division["Oau"] = "OAU";
|
|
56
|
+
Division["Oc"] = "OC";
|
|
57
|
+
Division["Ocan"] = "OCAN";
|
|
58
|
+
Division["Oel"] = "OEL";
|
|
59
|
+
Division["Ogm"] = "OGM";
|
|
60
|
+
Division["Oj"] = "OJ";
|
|
61
|
+
Division["Opt"] = "OPT";
|
|
62
|
+
Division["Otms"] = "OTMS";
|
|
63
|
+
return Division;
|
|
64
|
+
}({});
|
|
65
|
+
export let Region = function (Region) {
|
|
66
|
+
Region["Amer"] = "AMER";
|
|
67
|
+
Region["Apac"] = "APAC";
|
|
68
|
+
Region["Emea"] = "EMEA";
|
|
69
|
+
return Region;
|
|
70
|
+
}({});
|
|
71
|
+
export let Sort = function (Sort) {
|
|
72
|
+
Sort["Bearish"] = "BEARISH";
|
|
73
|
+
Sort["Bullish"] = "BULLISH";
|
|
74
|
+
return Sort;
|
|
75
|
+
}({});
|
|
76
|
+
export let TopicalSort = function (TopicalSort) {
|
|
77
|
+
TopicalSort["Bearish"] = "BEARISH";
|
|
78
|
+
TopicalSort["Bullish"] = "BULLISH";
|
|
79
|
+
TopicalSort["Hot"] = "HOT";
|
|
80
|
+
TopicalSort["Popular"] = "POPULAR";
|
|
81
|
+
TopicalSort["Volatile"] = "VOLATILE";
|
|
82
|
+
return TopicalSort;
|
|
83
|
+
}({});
|
|
84
|
+
export let ValueAtRiskBars = function (ValueAtRiskBars) {
|
|
85
|
+
ValueAtRiskBars["C100"] = "C100";
|
|
86
|
+
ValueAtRiskBars["C200"] = "C200";
|
|
87
|
+
ValueAtRiskBars["C300"] = "C300";
|
|
88
|
+
return ValueAtRiskBars;
|
|
89
|
+
}({});
|
|
90
|
+
export let ValueAtRiskDuration = function (ValueAtRiskDuration) {
|
|
91
|
+
ValueAtRiskDuration["C1"] = "C1";
|
|
92
|
+
ValueAtRiskDuration["C2"] = "C2";
|
|
93
|
+
ValueAtRiskDuration["C3"] = "C3";
|
|
94
|
+
ValueAtRiskDuration["C4"] = "C4";
|
|
95
|
+
ValueAtRiskDuration["C5"] = "C5";
|
|
96
|
+
ValueAtRiskDuration["C10"] = "C10";
|
|
97
|
+
return ValueAtRiskDuration;
|
|
98
|
+
}({});
|
|
99
|
+
export let VolatilityChartTimeSpan = function (VolatilityChartTimeSpan) {
|
|
100
|
+
VolatilityChartTimeSpan["D5"] = "D5";
|
|
101
|
+
VolatilityChartTimeSpan["D10"] = "D10";
|
|
102
|
+
VolatilityChartTimeSpan["M1"] = "M1";
|
|
103
|
+
VolatilityChartTimeSpan["M3"] = "M3";
|
|
104
|
+
VolatilityChartTimeSpan["W5"] = "W5";
|
|
105
|
+
VolatilityChartTimeSpan["W10"] = "W10";
|
|
106
|
+
return VolatilityChartTimeSpan;
|
|
107
|
+
}({});
|
|
108
|
+
export let VolatilityChartTimeUnit = function (VolatilityChartTimeUnit) {
|
|
109
|
+
VolatilityChartTimeUnit["D"] = "D";
|
|
110
|
+
VolatilityChartTimeUnit["H"] = "H";
|
|
111
|
+
VolatilityChartTimeUnit["W"] = "W";
|
|
112
|
+
return VolatilityChartTimeUnit;
|
|
113
|
+
}({});
|
|
114
|
+
export const ValidateInstrumentsDocument = {
|
|
115
|
+
"kind": "Document",
|
|
116
|
+
"definitions": [{
|
|
117
|
+
"kind": "OperationDefinition",
|
|
118
|
+
"operation": "query",
|
|
119
|
+
"name": {
|
|
120
|
+
"kind": "Name",
|
|
121
|
+
"value": "validateInstruments"
|
|
122
|
+
},
|
|
123
|
+
"variableDefinitions": [{
|
|
124
|
+
"kind": "VariableDefinition",
|
|
125
|
+
"variable": {
|
|
126
|
+
"kind": "Variable",
|
|
127
|
+
"name": {
|
|
128
|
+
"kind": "Name",
|
|
129
|
+
"value": "instruments"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"type": {
|
|
133
|
+
"kind": "NonNullType",
|
|
134
|
+
"type": {
|
|
135
|
+
"kind": "ListType",
|
|
136
|
+
"type": {
|
|
137
|
+
"kind": "NamedType",
|
|
138
|
+
"name": {
|
|
139
|
+
"kind": "Name",
|
|
140
|
+
"value": "String"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
"kind": "VariableDefinition",
|
|
147
|
+
"variable": {
|
|
148
|
+
"kind": "Variable",
|
|
149
|
+
"name": {
|
|
150
|
+
"kind": "Name",
|
|
151
|
+
"value": "division"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"type": {
|
|
155
|
+
"kind": "NamedType",
|
|
156
|
+
"name": {
|
|
157
|
+
"kind": "Name",
|
|
158
|
+
"value": "Division"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}],
|
|
162
|
+
"selectionSet": {
|
|
163
|
+
"kind": "SelectionSet",
|
|
164
|
+
"selections": [{
|
|
165
|
+
"kind": "Field",
|
|
166
|
+
"name": {
|
|
167
|
+
"kind": "Name",
|
|
168
|
+
"value": "mapInstrumentNames"
|
|
169
|
+
},
|
|
170
|
+
"arguments": [{
|
|
171
|
+
"kind": "Argument",
|
|
172
|
+
"name": {
|
|
173
|
+
"kind": "Name",
|
|
174
|
+
"value": "instruments"
|
|
175
|
+
},
|
|
176
|
+
"value": {
|
|
177
|
+
"kind": "Variable",
|
|
178
|
+
"name": {
|
|
179
|
+
"kind": "Name",
|
|
180
|
+
"value": "instruments"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
"kind": "Argument",
|
|
185
|
+
"name": {
|
|
186
|
+
"kind": "Name",
|
|
187
|
+
"value": "division"
|
|
188
|
+
},
|
|
189
|
+
"value": {
|
|
190
|
+
"kind": "Variable",
|
|
191
|
+
"name": {
|
|
192
|
+
"kind": "Name",
|
|
193
|
+
"value": "division"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}],
|
|
197
|
+
"selectionSet": {
|
|
198
|
+
"kind": "SelectionSet",
|
|
199
|
+
"selections": [{
|
|
200
|
+
"kind": "Field",
|
|
201
|
+
"name": {
|
|
202
|
+
"kind": "Name",
|
|
203
|
+
"value": "name"
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
"kind": "Field",
|
|
207
|
+
"name": {
|
|
208
|
+
"kind": "Name",
|
|
209
|
+
"value": "displayName"
|
|
210
|
+
}
|
|
211
|
+
}]
|
|
212
|
+
}
|
|
213
|
+
}]
|
|
214
|
+
}
|
|
215
|
+
}]
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.js","names":["AssetClassName","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\":\"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M;UAAC,CAAC,EAAC;YAAC,MAAM,EAAC,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from \"./fragment-masking\";\nexport * from \"./gql\";"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
export const validateInstruments = gql`
|
|
3
|
+
query validateInstruments($instruments: [String]!, $division: Division) {
|
|
4
|
+
mapInstrumentNames(instruments: $instruments, division: $division) {
|
|
5
|
+
name
|
|
6
|
+
displayName
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
//# sourceMappingURL=validateInstruments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateInstruments.js","names":["gql","validateInstruments"],"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,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,OAAO,MAAMC,mBAAmB,GAAGD,GAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from './SpreadCostCalculatorWidget/types';\nexport * from './SpreadCostCalculatorWidget/SpreadCostCalculatorWidget';\n"],"mappings":"AAAA,cAAc,oCAAoC;AAClD,cAAc,yDAAyD","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Locale } from '@oanda/mono-i18n';
|
|
2
|
+
import en from './sources/en.json';
|
|
3
|
+
import zhTW from './sources/zh_TW.json';
|
|
4
|
+
import es from './sources/es.json';
|
|
5
|
+
import th from './sources/th.json';
|
|
6
|
+
export const translations = {
|
|
7
|
+
[Locale.en]: {
|
|
8
|
+
translation: en
|
|
9
|
+
},
|
|
10
|
+
[Locale.zhTW]: {
|
|
11
|
+
translation: zhTW
|
|
12
|
+
},
|
|
13
|
+
[Locale.es]: {
|
|
14
|
+
translation: es
|
|
15
|
+
},
|
|
16
|
+
[Locale.th]: {
|
|
17
|
+
translation: th
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Locale","en","zhTW","es","th","translations","translation"],"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,SAASA,MAAM,QAAsB,kBAAkB;AAEvD,OAAOC,EAAE,MAAM,mBAAmB;AAClC,OAAOC,IAAI,MAAM,sBAAsB;AACvC,OAAOC,EAAE,MAAM,mBAAmB;AAClC,OAAOC,EAAE,MAAM,mBAAmB;AAMlC,OAAO,MAAMC,YAA0B,GAAG;EACxC,CAACL,MAAM,CAACC,EAAE,GAAG;IAAEK,WAAW,EAAEL;EAAG,CAAC;EAChC,CAACD,MAAM,CAACE,IAAI,GAAG;IAAEI,WAAW,EAAEJ;EAAK,CAAC;EACpC,CAACF,MAAM,CAACG,EAAE,GAAG;IAAEG,WAAW,EAAEH;EAAG,CAAC;EAChC,CAACH,MAAM,CAACI,EAAE,GAAG;IAAEE,WAAW,EAAEF;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
|
+
}
|