diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-foot-note.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-foot-note.tsx
index a9f4ddec1090..96b704d67c39 100644
--- a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-foot-note.tsx
+++ b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-foot-note.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { Text } from '@deriv/components';
import { Localize } from '@deriv/translations';
-import { getAuthenticationStatusInfo, isMobile } from '@deriv/shared';
+import { getAuthenticationStatusInfo, isMobile, Jurisdiction } from '@deriv/shared';
import { TJurisdictionModalFootNoteProps } from '../props.types';
const FooterNote = ({
@@ -17,7 +17,7 @@ const FooterNote = ({
const { poa_pending } = getAuthenticationStatusInfo(account_status);
- if (jurisdiction_selected_shortcode === 'svg') {
+ if (jurisdiction_selected_shortcode === Jurisdiction.SVG) {
return (
);
} else if (
- (jurisdiction_selected_shortcode === 'bvi' && should_restrict_bvi_account_creation) ||
- (jurisdiction_selected_shortcode === 'vanuatu' && should_restrict_vanuatu_account_creation)
+ (jurisdiction_selected_shortcode === Jurisdiction.BVI && should_restrict_bvi_account_creation) ||
+ (jurisdiction_selected_shortcode === Jurisdiction.VANUATU && should_restrict_vanuatu_account_creation)
) {
return poa_pending ? (
);
- } else if (jurisdiction_selected_shortcode === 'bvi') {
+ } else if (jurisdiction_selected_shortcode === Jurisdiction.BVI) {
return (
);
- } else if (jurisdiction_selected_shortcode === 'vanuatu') {
+ } else if (jurisdiction_selected_shortcode === Jurisdiction.VANUATU) {
return (
);
- } else if (jurisdiction_selected_shortcode === 'labuan') {
+ } else if (jurisdiction_selected_shortcode === Jurisdiction.LABUAN) {
return (
);
- } else if (jurisdiction_selected_shortcode === 'maltainvest') {
+ } else if (jurisdiction_selected_shortcode === Jurisdiction.MALTA_INVEST) {
return (
);
diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx
index 60bf787fcf05..ea9b9eb08067 100644
--- a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx
+++ b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx
@@ -4,7 +4,7 @@ import { localize } from '@deriv/translations';
import { connect } from '../../Stores/connect';
import RootStore from '../../Stores/index';
import JurisdictionModalContent from './jurisdiction-modal-content';
-import { getAuthenticationStatusInfo, isMobile } from '@deriv/shared';
+import { getAuthenticationStatusInfo, isMobile, Jurisdiction } from '@deriv/shared';
import { TJurisdictionModalProps } from '../props.types';
import JurisdictionCheckBox from './jurisdiction-modal-checkbox';
import JurisdictionModalFootNote from './jurisdiction-modal-foot-note';
@@ -82,11 +82,11 @@ const JurisdictionModal = ({
account_type: account_type.type === 'synthetic' ? 'Derived' : 'Financial',
});
- const is_svg_selected = jurisdiction_selected_shortcode === 'svg';
- const is_bvi_selected = jurisdiction_selected_shortcode === 'bvi';
- const is_vanuatu_selected = jurisdiction_selected_shortcode === 'vanuatu';
- const is_labuan_selected = jurisdiction_selected_shortcode === 'labuan';
- const is_maltainvest_selected = jurisdiction_selected_shortcode === 'maltainvest';
+ const is_svg_selected = jurisdiction_selected_shortcode === Jurisdiction.SVG;
+ const is_bvi_selected = jurisdiction_selected_shortcode === Jurisdiction.BVI;
+ const is_vanuatu_selected = jurisdiction_selected_shortcode === Jurisdiction.VANUATU;
+ const is_labuan_selected = jurisdiction_selected_shortcode === Jurisdiction.LABUAN;
+ const is_maltainvest_selected = jurisdiction_selected_shortcode === Jurisdiction.MALTA_INVEST;
const isNextButtonDisabled = () => {
if (jurisdiction_selected_shortcode) {
diff --git a/packages/cfd/src/Containers/mt5-compare-table-content.tsx b/packages/cfd/src/Containers/mt5-compare-table-content.tsx
index 4521e7889b41..9703545d7b8a 100644
--- a/packages/cfd/src/Containers/mt5-compare-table-content.tsx
+++ b/packages/cfd/src/Containers/mt5-compare-table-content.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { Table, Button, Text, Popover } from '@deriv/components';
import { localize } from '@deriv/translations';
-import { isDesktop, WS, getAuthenticationStatusInfo, CFD_PLATFORMS, ContentFlag } from '@deriv/shared';
+import { isDesktop, WS, getAuthenticationStatusInfo, CFD_PLATFORMS, ContentFlag, Jurisdiction } from '@deriv/shared';
import { connect } from '../Stores/connect';
import RootStore from '../Stores/index';
import {
@@ -303,13 +303,13 @@ const DMT5CompareModalContent = ({
case 'synthetic_svg':
case 'financial_svg':
setAppstorePlatform(CFD_PLATFORMS.MT5);
- setJurisdictionSelectedShortcode('svg');
+ setJurisdictionSelectedShortcode(Jurisdiction.SVG);
openPasswordModal(type_of_account);
break;
case 'synthetic_bvi':
case 'financial_bvi':
setAppstorePlatform(CFD_PLATFORMS.MT5);
- setJurisdictionSelectedShortcode('bvi');
+ setJurisdictionSelectedShortcode(Jurisdiction.BVI);
if (
poi_acknowledged_for_bvi_labuan &&
!poi_or_poa_not_submitted &&
@@ -325,7 +325,7 @@ const DMT5CompareModalContent = ({
case 'synthetic_vanuatu':
case 'financial_vanuatu':
setAppstorePlatform(CFD_PLATFORMS.MT5);
- setJurisdictionSelectedShortcode('vanuatu');
+ setJurisdictionSelectedShortcode(Jurisdiction.VANUATU);
if (
poi_acknowledged_for_vanuatu_maltainvest &&
!poi_or_poa_not_submitted &&
@@ -340,7 +340,7 @@ const DMT5CompareModalContent = ({
break;
case 'financial_labuan':
setAppstorePlatform(CFD_PLATFORMS.MT5);
- setJurisdictionSelectedShortcode('labuan');
+ setJurisdictionSelectedShortcode(Jurisdiction.LABUAN);
if (poi_acknowledged_for_bvi_labuan && poa_acknowledged && has_submitted_personal_details) {
openPasswordModal(type_of_account);
} else {
@@ -349,7 +349,7 @@ const DMT5CompareModalContent = ({
break;
case 'financial_maltainvest':
setAppstorePlatform(CFD_PLATFORMS.MT5);
- setJurisdictionSelectedShortcode('maltainvest');
+ setJurisdictionSelectedShortcode(Jurisdiction.MALTA_INVEST);
if ((poi_acknowledged_for_vanuatu_maltainvest && poa_acknowledged) || is_demo_tab) {
openPasswordModal(type_of_account);
} else {
diff --git a/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts b/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts
index 0de741e45e0f..0785f3b59305 100644
--- a/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts
+++ b/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts
@@ -1,4 +1,5 @@
import { localize } from '@deriv/translations';
+import { Jurisdiction } from '@deriv/shared';
export type TDxCompanies = ReturnType;
export type TMtCompanies = ReturnType;
@@ -184,16 +185,16 @@ export const getFormattedJurisdictionCode = (jurisdiction_code: string) => {
let formatted_label = '';
switch (jurisdiction_code) {
- case 'svg':
+ case Jurisdiction.SVG:
formatted_label = localize('SVG');
break;
- case 'bvi':
+ case Jurisdiction.BVI:
formatted_label = localize('BVI');
break;
- case 'labuan':
+ case Jurisdiction.LABUAN:
formatted_label = localize('Labuan');
break;
- case 'vanuatu':
+ case Jurisdiction.VANUATU:
formatted_label = localize('Vanuatu');
break;
default:
diff --git a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js
index 3a7e6e007c41..8f9fea9bfd40 100644
--- a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js
+++ b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js
@@ -1,5 +1,5 @@
import { action, computed, observable, reaction, runInAction, makeObservable, override } from 'mobx';
-import { getAccountListKey, getAccountTypeFields, CFD_PLATFORMS, WS } from '@deriv/shared';
+import { getAccountListKey, getAccountTypeFields, CFD_PLATFORMS, WS, Jurisdiction } from '@deriv/shared';
import BaseStore from 'Stores/base-store';
import { getDxCompanies, getMtCompanies } from './Helpers/cfd-config';
@@ -233,8 +233,8 @@ export default class CFDStore extends BaseStore {
this.toggleJurisdictionModal();
} else {
if (this.root_store.traders_hub.show_eu_related_content) {
- this.setJurisdictionSelectedShortcode('maltainvest');
- } else this.setJurisdictionSelectedShortcode('svg');
+ this.setJurisdictionSelectedShortcode(Jurisdiction.MALTA_INVEST);
+ } else this.setJurisdictionSelectedShortcode(Jurisdiction.SVG);
this.demoCFDSignup();
}
}
@@ -280,7 +280,7 @@ export default class CFDStore extends BaseStore {
zipCode: address_postcode,
...(values.server ? { server: values.server } : {}),
...(this.jurisdiction_selected_shortcode ? { company: this.jurisdiction_selected_shortcode } : {}),
- ...(this.jurisdiction_selected_shortcode !== 'labuan'
+ ...(this.jurisdiction_selected_shortcode !== Jurisdiction.LABUAN
? type_request
: {
account_type: 'financial',
diff --git a/packages/shared/src/utils/constants/index.ts b/packages/shared/src/utils/constants/index.ts
index 5d4931b44ec6..093a7a776a48 100644
--- a/packages/shared/src/utils/constants/index.ts
+++ b/packages/shared/src/utils/constants/index.ts
@@ -1,3 +1,4 @@
export * from './barriers';
export * from './contract';
export * from './content_flags';
+export * from './jurisdictions-config';
diff --git a/packages/shared/src/utils/constants/jurisdictions-config.ts b/packages/shared/src/utils/constants/jurisdictions-config.ts
new file mode 100644
index 000000000000..3030e044221d
--- /dev/null
+++ b/packages/shared/src/utils/constants/jurisdictions-config.ts
@@ -0,0 +1,7 @@
+export const Jurisdiction = Object.freeze({
+ SVG: 'svg',
+ BVI: 'bvi',
+ VANUATU: 'vanuatu',
+ LABUAN: 'labuan',
+ MALTA_INVEST: 'maltainvest',
+});