From 2a6555e1d3edbdb450d259ba1693d4f38e3edb21 Mon Sep 17 00:00:00 2001 From: Matin shafiei Date: Thu, 25 May 2023 14:05:30 +0800 Subject: [PATCH] Swap free (#8198) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * matin/chore: update branch (#8026) * thisyahlen/chore: new account verification modal for purchase authentication (#7936) * chore: new account verification modal for purchase authentication * fix: height and width * fix: modal footer css * fix: css mobile title * thisyahlen/fix: remove financial mt5 for norway and japan (#7846) * fix: remove financial mt5 for norway and japan * fix: resolved comments * fix: rename restricetd countries * fix: compare accounts table * fix: fix compare accounts table for norway/japan * fix: remove synthetic bvi for norway and japan * Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926) * chore: remove duplicate get_settings api request * chore: set account_settings in client-store if undefined * chore: remove unnecessary else block * refactor: convert if expression to ternary * chore: set account_settings in client store instead of creating a local variable * fix: :sparkles: allows users to enter accented name characters (#7832) * fix: :sparkles: allows users to enter accented name characters * chore: :wastebasket: removes unused 'letter_symbol' variable * fix: :bug: allows accented characters in name for existing users * docs: :pencil2: comment on the regex used for name validation * resused regex function Co-authored-by: Yashim Wong * fix: :memo: imported reused regex function * fix: :memo: comment on regex function used --------- Co-authored-by: Yashim Wong * Evgeniy / 89431 / no error message for idv duplicated document numbers (#7743) * fix: no error message for idv duplicated document numbers * feat: idv testing document whitelist * refactor: function rename, code and test fix * refactor: code style change, review fixes --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Hamid/90702/account switchers to wrong deriv account when performing deposit via bank wire (#7933) * chore: icon changes after build * fix: redirect user to non-eu account instead eu after cashier deposit switch account * Ameerul /Task 89855 Add a checkbox to select/deselect a payment method when creating or updating a sell ad and making a sell order (#7824) * chore: added checkbox to payment method card * fix: added logic to disable checkbox and show checkbox in certain tabs only * Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218) * fix: instantiating useVerifyEmail object once for each email verification case to avoid settimeout leak in useCountdown * chore: store verify_email_sent_count in store instead of locally * test: fix test for email-verification-empty-state.tsx * fix: avoid counter reset by storing and using the time an email was last sent * chore: a workaround for VerifyEmailRequest type declared with an extra required field in api-types * chore: remove api-types workaround * build: update @deriv/api-types to 1.0.85 * revert: api-types version upgrade * revert: package-lock * revert: modal-manager.jsx * revert: modal-manager.jsx * thisyahlen/fix: error when switch to mf (#7778) * fix: error when switch to mf * fix: addressed comments * fix: addressed comments v2 * chore: fix tooltip language not updating on change language (#7871) * chore: fix tooltip language not updating on change language * fix: added checks for currency in trade store * fix: added delete amount validation rules in reaction * fix: remove delete rule in reaction * fix: remove mistake * fix: typo * Aizad/89113/sidebar platform fix (#7697) * chore: fix mobile sidebar platform for eu * fix: codecov error * fix: codecov error * chore: update packages * Nada/88951/change chat url (#7798) * fix: get chat url from p2p_order_create instead of p2p_chat_create * fix: fixed issue with order details page * fix: chat channel url empty issue fixed for p2p_order_create response * fix: function added to store * fix: added timeout for setting chat_channel in order details * fix: pr comments fixed * fix: increased time out * fix: removed delay for going to details page from list * thisyahlen/fix: top up mt5 demo (#7665) * fix: top up demo * fix: deriv x as well * redeploy: a * chore: update pdf in acuity download modal (#7567) * fix: filter currencies by name (#7493) * fix: changed pop up message for no recommendations (#7693) * Aizad/89700/onboarding btn fix (#7813) * chore: disable cursor on account switcher button onboarding * fix: Add the same behavior for Options and Multipliers section Trade Button * fix: added default class and refactor scss * Nada/89550/remove validation ad amount (#7753) * fix: removed error validation for amount greater than user's balance * fix: added popup for creating ad greater than balance * fix: pr comments fixed * fix: reuse common modal for visibility errors * Aizad/88786/mt5 redirection modal fix (#7663) * chore: fix mt5 redirection modal closing on trade * fix: modal and dialog close seperately after clicking outside * fix: re-add dialog_status condition back to redirect-notice-modal * fix: reverted the previous changes * fix: remove useclickoutside for page overlay * fix: update deriv/api package to latest version * fix: updated package version to match with master * Merge branch 'develop' of github.com:binary-com/deriv-app into aizad/88786/mt5-redirection-modal-fix * fix: codecov and circleci * fix: upgrade package * fix: theme switch in poroduction (#7781) * translations: 📚 sync translations with crowdin (#7989) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * yashim/chore: remove indonesia from production (#7999) * chore: remove trading experience incomplete (#8005) * chore: remove trading experience incomplete * fix: remove is cfd score available * thisyahlen/hotfix: wrong restriction message for austria (#8006) * hotfix: wrong restriction message for austria * fix: Empty-Commit * Revert "thisyahlen/hotfix: wrong restriction message for austria (#8006)" (#8013) This reverts commit 56baec7d879efd25f05249323911641ce069ab63. * Revert "Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926)" (#8016) This reverts commit 8bb13518f4cebd42bc3d2a602807d7c1b6aa5b6a. * fix: :bug: fetches latest personal details every time intead of cached value (#8002) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter a… (#8020) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218)" This reverts commit cc0065d02761a33502405d35a47a45696292858d. * revert: reverted setIsCFDScoreAvailable from client.store * Revert "fix: :bug: fetches latest personal details every time intead of cached value (#8002)" (#8022) This reverts commit ff497c14ec9fe0b831031b0d9bae1532f9c47456. --------- Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> Co-authored-by: Shaheer <122449658+shaheer-deriv@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Hamid Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Co-authored-by: nada-deriv <122768621+nada-deriv@users.noreply.github.com> Co-authored-by: Farrah Mae Ochoa <82315152+farrah-deriv@users.noreply.github.com> Co-authored-by: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: vinu-deriv <100689171+vinu-deriv@users.noreply.github.com> * hamza/90127/91316/sub-feat: swapfree onboarding screen addition v1.0 (#7961) * feat: swapfree onboarding screen addition v1.0 * fix: name changes and Title updated as per design * Syncing Master with the Feature Brnach of Swapfree (#8056) * thisyahlen/chore: new account verification modal for purchase authentication (#7936) * chore: new account verification modal for purchase authentication * fix: height and width * fix: modal footer css * fix: css mobile title * thisyahlen/fix: remove financial mt5 for norway and japan (#7846) * fix: remove financial mt5 for norway and japan * fix: resolved comments * fix: rename restricetd countries * fix: compare accounts table * fix: fix compare accounts table for norway/japan * fix: remove synthetic bvi for norway and japan * Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926) * chore: remove duplicate get_settings api request * chore: set account_settings in client-store if undefined * chore: remove unnecessary else block * refactor: convert if expression to ternary * chore: set account_settings in client store instead of creating a local variable * fix: :sparkles: allows users to enter accented name characters (#7832) * fix: :sparkles: allows users to enter accented name characters * chore: :wastebasket: removes unused 'letter_symbol' variable * fix: :bug: allows accented characters in name for existing users * docs: :pencil2: comment on the regex used for name validation * resused regex function Co-authored-by: Yashim Wong * fix: :memo: imported reused regex function * fix: :memo: comment on regex function used --------- Co-authored-by: Yashim Wong * Evgeniy / 89431 / no error message for idv duplicated document numbers (#7743) * fix: no error message for idv duplicated document numbers * feat: idv testing document whitelist * refactor: function rename, code and test fix * refactor: code style change, review fixes --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Hamid/90702/account switchers to wrong deriv account when performing deposit via bank wire (#7933) * chore: icon changes after build * fix: redirect user to non-eu account instead eu after cashier deposit switch account * Ameerul /Task 89855 Add a checkbox to select/deselect a payment method when creating or updating a sell ad and making a sell order (#7824) * chore: added checkbox to payment method card * fix: added logic to disable checkbox and show checkbox in certain tabs only * Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218) * fix: instantiating useVerifyEmail object once for each email verification case to avoid settimeout leak in useCountdown * chore: store verify_email_sent_count in store instead of locally * test: fix test for email-verification-empty-state.tsx * fix: avoid counter reset by storing and using the time an email was last sent * chore: a workaround for VerifyEmailRequest type declared with an extra required field in api-types * chore: remove api-types workaround * build: update @deriv/api-types to 1.0.85 * revert: api-types version upgrade * revert: package-lock * revert: modal-manager.jsx * revert: modal-manager.jsx * thisyahlen/fix: error when switch to mf (#7778) * fix: error when switch to mf * fix: addressed comments * fix: addressed comments v2 * chore: fix tooltip language not updating on change language (#7871) * chore: fix tooltip language not updating on change language * fix: added checks for currency in trade store * fix: added delete amount validation rules in reaction * fix: remove delete rule in reaction * fix: remove mistake * fix: typo * Aizad/89113/sidebar platform fix (#7697) * chore: fix mobile sidebar platform for eu * fix: codecov error * fix: codecov error * chore: update packages * Nada/88951/change chat url (#7798) * fix: get chat url from p2p_order_create instead of p2p_chat_create * fix: fixed issue with order details page * fix: chat channel url empty issue fixed for p2p_order_create response * fix: function added to store * fix: added timeout for setting chat_channel in order details * fix: pr comments fixed * fix: increased time out * fix: removed delay for going to details page from list * thisyahlen/fix: top up mt5 demo (#7665) * fix: top up demo * fix: deriv x as well * redeploy: a * chore: update pdf in acuity download modal (#7567) * fix: filter currencies by name (#7493) * fix: changed pop up message for no recommendations (#7693) * Aizad/89700/onboarding btn fix (#7813) * chore: disable cursor on account switcher button onboarding * fix: Add the same behavior for Options and Multipliers section Trade Button * fix: added default class and refactor scss * Nada/89550/remove validation ad amount (#7753) * fix: removed error validation for amount greater than user's balance * fix: added popup for creating ad greater than balance * fix: pr comments fixed * fix: reuse common modal for visibility errors * Aizad/88786/mt5 redirection modal fix (#7663) * chore: fix mt5 redirection modal closing on trade * fix: modal and dialog close seperately after clicking outside * fix: re-add dialog_status condition back to redirect-notice-modal * fix: reverted the previous changes * fix: remove useclickoutside for page overlay * fix: update deriv/api package to latest version * fix: updated package version to match with master * Merge branch 'develop' of github.com:binary-com/deriv-app into aizad/88786/mt5-redirection-modal-fix * fix: codecov and circleci * fix: upgrade package * fix: theme switch in poroduction (#7781) * translations: 📚 sync translations with crowdin (#7989) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * yashim/chore: remove indonesia from production (#7999) * chore: remove trading experience incomplete (#8005) * chore: remove trading experience incomplete * fix: remove is cfd score available * thisyahlen/hotfix: wrong restriction message for austria (#8006) * hotfix: wrong restriction message for austria * fix: Empty-Commit * Revert "thisyahlen/hotfix: wrong restriction message for austria (#8006)" (#8013) This reverts commit 56baec7d879efd25f05249323911641ce069ab63. * Revert "Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926)" (#8016) This reverts commit 8bb13518f4cebd42bc3d2a602807d7c1b6aa5b6a. * fix: :bug: fetches latest personal details every time intead of cached value (#8002) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter a… (#8020) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218)" This reverts commit cc0065d02761a33502405d35a47a45696292858d. * revert: reverted setIsCFDScoreAvailable from client.store * Revert "fix: :bug: fetches latest personal details every time intead of cached value (#8002)" (#8022) This reverts commit ff497c14ec9fe0b831031b0d9bae1532f9c47456. * Adrienne / Prefetched email verification modal (#8027) * chore: prefetched email verification modal * chore: added settimoeut * chore: used eager mode * chore: import model directly * chore: reverted direct imports * chore: added settimeout * translations: 📚 sync translations with crowdin (#8031) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8040) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: yashim-deriv * Maryia/67492/task_add_accumulators (#6406) * Merge '67492_accumulators_purchase' into 'maryia/67492/task_add_accumulators' * Maryia/75617/add_accu_to_trade_params (#3) * initialized ACCU trade params for responsive * added LabeledQuantityInputMobile & improved AccumulatorsAmountMobile * feat: added Accumulator radio group for growth_rate * feat: finalized Accumulator growth_rates radio group for mobile * feat: responsive- added Take profit to trade params & aligned purchase button icon * feat: improved mobile trade params for ACCU * feat: finalized trade params for ACCU * maryia/72761/task_add_recent_positions_drawer (#4) * feat: initialized ACCU contract card in recent positions * feat: initialized ProgressSliderSolidLine for ACCU * feat: updated recent positions card for ACCU for open/lost/won states * chore: improvements for ACCU card in responsive recent positions * chore: added TickCounterProgressBar component * feat: added TickCounterBar and reverted ProgressSlider & ProgressSliderMobile * chore: reverted original Recent positions drawer width * chore: improved TickCounterBar styling * maryia/76528/task_implement_contract_details_drawer (#5) * chore: updated Details in contract card for ACCU + styling * feat: implemented ACCU contract card in contract details + improved recent positions * chore: updated icons for ACCU trade type & contract category * maryia/72769/add_ticks_history_stats_widget (#6) * feat: init version of TicksHistoryStatsWidget for ACCU * chore: TicksHistoryStats * chore: improved tick history styling * chore: added more styles & animated progress dots under latest counter * feat: finalized desktop ticks history stats for dtrader page * feat: added ticks history to contract details page * improved ticks history stats for desktop & initialized it for responsive * made responsive stats non-expandable * maryia/77261/task_manual_for_history_widget (#8) * chore: discarded getUpdatedTicksHistoryStats as BE will send 15 exact values instead of 100+latest * feat: added AccumulatorsStatsManualModal * feat: finalized AccumulatorsStatsManualModal for desktop & responsive * chore: added getUpdatedTicksHistoryStats to process arrays of counters with epochs expected from BE * feat: added expanded AccumulatorsStats dialog for responsive * chore: contract card styling improvements + using ACCU tick_count as max_ticks_number * chore: improved AccumulatorsStats to load after tick counters have loaded * maryia/75621/task_add_tests_and_restyle_contract_card (#9) * chore: improved ACCU contract type icon & label styling in contract card * chore: added tests for accumulator.js helper function * chore: added tests for Accumulator.jsx * maryia/75621/part_2_task_accu_barriers (#10) * chore: updated dummy data * chore: fixed history stats styles & added tests for AccumulatorsStats * chore: improved AccumulatorsStats and its tests * chore: updated contract card & open positions * maryia/75621/add barriers for stay in contract on trader page (#12) * chore: test out passing trade data to all-markers for drawing barriers without contract + improvements * feat: added barriers for accumulators without open contract * feat: added markers and barriers for stay in contract on trader page * chore: adjusted open contract profit label (#13) * yauheni/77994/trader add break out contract type (#14) * yauheni/77994/trader add break out contract type * regexp fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/78429/update styles of tick history widget (#15) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * chore: prepared data for connecting API (#16) * Maryia/78473/part 2 prepare for api + improvements (#18) * chore: improved barriers without contract and open contract label * chore: prepared data for api connection * chore: added price tags for barriers in contract details (#19) * feat: initialized AccumulatorsProfitLossTooltip (#20) * yauheni/78477/update params with buttons for responsive (#17) * yauheni/78477/update params with buttons for responsive * fix styles accordingly to design * buttons gap fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/resolve build errors (#21) * yauheni/resolve build errors * optional property for is_checkbox_hidden Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Yauheni/78633/update styles for tick history widget (#22) * yauheni/resolve build errors * yauheni/78633/update styles for tick history widget * yauheni/78633/update styles for tick history widget responsive Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/78839/complete_sold_labels (#23) * chore: added tolltips for all sold positions & won/lost coloring * feat: finalized AccumulatorsProfitLossTooltip * maryia/improvements for stats and tooltip (#24) * chore: accumulators stats improvements * improvements * maryia/improvements for sold contract label * maryia/78574/add_barriers_to_contract_details * maryia/79085/remove_break_out_history_from_stats_widget (#26) * maryia/79085/remove_break_out_history_from_stats * chore: made purchaseButtonsOverlay flexible * chore: added tests for PurchaseButtonsOverlay * Yauheni/77995/update trade params for stayin breakout (#25) * yauheni/77995/update trade params for stayin breakout * take profit alimngment * buttons styles, take profit alingment * maryia/78574/add_barriers_to_contract_details * stake font and icon fix, go_tp_reports button styles * update contract store from parent Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: maryia-binary * maryia/fix: styles & fonts for responsive trade types * Maryia/79549/part 1: update tick markers for ACCU in contract details + improvements (#27) * maryia/79549/add_tick_markers_contract_details * chore: improvements for styles in responsive trade types desc * yauheni/79530/remove breakout contract (#28) * yauheni/79530/remove breakout contract * proposal data fields fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/styling improvements * maryia/fix: forcing Div100vh to re-render when height_offset for responsive has changed * maryia/fix: observables + markers * maryia/chore: prevented barriers, labels and markers from going outside axes (#30) * maryia/79969/set_default_chart_type_and_interval_to_Area_and_1_tick * maryia/chore: changed trade type name to Accumulators * maryia/80163/set growth rate based on default value from BE contracts_for response * yauheni/80091/hide chart mode icon for accumulators (#33) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/80166/connect_to_available_API (#34) * chore: connected api without contracts_for for now * chore: updated proposal * chore: updated tests for new proposal * maryia/80163/add-growth-rate-to-purchase-button * maryia/refactored purchase button growth_rate text * maryia/chore: removed unused code for outside barriers * maryia/fix: barrier shade color for ongoing contract * feat: restore chart mode set for non accumulators contract after switching (#37) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/80158/update ui according to latest design (design flow 1-2) (#36) * icon accumulator change * purchase btn, stats fix * fix styles, flow 1 * accumulator design flow 2 Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/80686/feat: profit text animation for ongoing contract (#39) * fix: showing profit text next to current spot for open contract * chore: animated profit text * feat: added animated profit text for ongoing contract * test: fixed a test * chore: removed unused variable * fix: maryia/80686/profit text color * fix: maryia/using default growth rate only if no stored growth rate * feat: allow accumulators only for demo account (#40) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Yauheni/80158/update UI according to latest design part 2 (#38) * accu design chart position fix * accu page for reports rendering * reports card design fix * reports card design fix2 * updated design fix * pseudoelement colon fix * emphasizing value fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/80687/ticks_contract_details (#41) * fix: tick markers in contract details & take profit logics * feat: showing only 10 last ticks for accumulators ongoing contract * chore: display all trade types when list is not empty * style: typo * chore: maryia/added opacity to profit text + connected contracts_for + refactoring * chore: improved tick stream for ACCU in contract details + stats alignment * chore: maryia/handled undefined profit & updated opacity animation timing * chore: temporary dummy api connection * fix: maryia/hide profit if undefined, display if number * revert: dummi api * feat: implement last design part 1 (#43) * feat: implement last design part 1 * fix: test text fix * refactor: stats style for mobile fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/82425/task highlight crossing tick (#42) * feat: hightlighting crossing tick * feat: sync highlighting of crossing tick based on ticks_history_stats * Maryia/83069/task: replace image with video manual (#44) * feat: replaced manual image with video + responsive stats improvement * test: fixed a test * fix: entry tick marker in dtrader * style: removed extra margin-bottom * feat: implement last design part 2 (#45) * feat: implement last design part 2 * fix: initial growth_rate added * refactor: growth_rate from contract_for delete Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * refactor: accu sold contract tooltip animation change (#49) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/82257/Contract Details tick markers + AccumulatorsProfitLossText refactoring (#48) * chore: saving canvas context before accu barriers are drawn and restoring when finished drawing * fix: endtime, avoid fetching history in replay, avoid 0 profit animation * chore: forcing chart reload when start_epoch changes to earlier epoch + refactored profit-text * refactor: accumulators-profit-loss-text * refactor: tooltip style and tests (#51) * refactor: tooltip style and tests * refactor: accumulator info text * refactor: profit tooltip text test add * refactor: radiogroupwithinfomobile test added * refactor: tickhistorycounter tests added * refactor: tickcounterbar test added Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/83311/Refactoring, tests, TS migration (#50) * refactor: purchase-buttons-overlay.spec.js from enzyme to jest * style: removed extra variable * refactor: from accumulator.js with chai to accumulator.spec.js with jest * refactor: removed unused dummy data * test: added tests for accumulators-stats-manual-modal.jsx * chore: improved accumulators-stats-manual-modal * refactor: incapsulated AccumulatorsChartElements in trade.jsx * fix: maryia/circleci eslint error * feat: maryia/added dark theme video manual for stats + fix for circleci * test: maryia/added tests for AccumulatorsInfoDisplay & LabeledQuantityInputMobile * chore: maryia/ address review comments + updated videos * fix: maryia/open positions: auto-select Accumulators if has open ACCU contracts * refactor: accumulatorschartelements test added (#52) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * style: maryia/apply review suggestions * style: maryia/apply review suggestions * refactor: maryia/refactoring + small improvements & adjustments * chore: add built icons file * fix: circleci tests + improvements * chore: refactoring + added loader before video manual first loads * refactor: improvements + addressed review comments * yauheni/qa checks refactoring 1 (#53) * refactor: open recent position after buying contract for mobile * fix: accu card curent stake name field * fix: popover accumulator radio group text and alignment * fix: open position accumulate column name Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: last truncated counter in responsive (#54) * Maryia/83807/stake validation (part 1) (#55) * fix: set growth_rate based on accumulator_range_list (growth_rate_range) received in contracts_for * fix: app crash caused by proposal error * chore: removed unused classname * fix: growth rate title alignment (#56) * fix: growht rate title alignment * refactor: category wrapper odd style Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/83807/fix: stake validation for ACCU broken because of barriers being set (#57) * fix: stake validation for ACCU broken because of barriers being set * fix: prevent app crash in profit table for unknown contracts * fix: check if selected growth_rate is available on symbol change (#58) * fix: able to buy multiply contract / growth rate fix BO change (#59) * fix: able to buy multiply contract / growth rate fix BO change * refactor: last contract check delete Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * revert: maryia/revert change of last_contract computed * fix: accumulator is shown for real account (#60) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * feat: make cursor not allowd for overlay (#61) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * chore: built icons.js * revert: maryia/ unnecessary bot file change * refactor: contract categories in contract-type-widget.jsx * refactor: according to pr review comments * refactor: open positions + add keys to fix console warning * fix: disable accu for real account, disable button having bought one contract (#62) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * refactor: purchase.jsx * refactor: according to pr reviews * refactor: able to buy contract per every available underlying (#63) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Trigger Build * yauheni/85032/ fix chart issue with dots and circles Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: exit spot styles * refactor: make barrier values string as on BE * fix: unable accumulators for real * maryia/refactor_accu_branch (#66) * refactor: remove unused file * refactor: refactor createTickMarkers * refactor: introduce a local variable * fix: 86705/ticks are not displayed correctly on chart in contract details * maryia/86953/build: bump up deriv-charts version to 1.1.0 + improvement (#68) * build: bump up deriv-charts version * chore: show profit only when barriers are received * test: updated mocked props * build: maryia/removed extra package-lock.jsons * evgeniy /87215/87226/ info description / glitch while switching account (#70) * fix: description * fix: disable trade params while switching account --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * henry/87329/fix: FE not showing error message when accu trading is suspended (#72) * fix: FE not showing error message when accu trading is suspended * test: empty commit --------- Co-authored-by: HENRY * refactor: glitching fix and deleted odd css (#73) * refactor: glitching fix and deleted odd css * fix: code refactor --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/86616/feat: calculating accu barriers based on ticks from ticks_history (#71) * feat: calculating accu barriers based on ticks from ticks_history * chore: rounded & refactored accu barriers * refactor: added getAccumulatorBarriers for barrier calculation + fixed a test * chore: improved barriers calculations * refactor: getAccumulatorBarriers docs * refactor: getAccumulatorBarriers * fix: showing barriers only when having have barriers & always showing barrier lines in C.Details * build: updated package-lock & icons + fixed conflicts + linting * fix: max stake validation is missing (#81) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: maryia/87948/chart empty issue + profit text effects clean-up * henry/87958/feat: Add Dropdown for rates in Accumulator (#86) * feat: Add Dropdown for rates in Accumulator * chore: code cleanup * Update packages/reports/src/Containers/open-positions.jsx Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> --------- Co-authored-by: HENRY Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * Maryia/86616/make 2 last ticks bold + refactoring (#84) * chore: make prelast & last tick bold * chore: adjust styles for previous and last markers in c.details * refactor: getSupportedContracts & getContractTypeDisplay in configs * refactor: open-positions * refactor: chart-markers slyles * style: updated All rates casing * build: update package-lock * Henry/87958/feat add all rates dropdown accumulator (#89) * feat: Add Dropdown for rates in Accumulator * chore: code cleanup * Update packages/reports/src/Containers/open-positions.jsx Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * chore: remove console log * fix: Change Open positions total for multiplier and accumulator to flex --------- Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * refactor: open-positions * fix: remove unused eslint disable * revert: package-lock * fix: sell button disappearing in mobile accumulators (#92) * Henry/89489/fix sell button missing accumulator (#95) * fix: sell button disappearing in mobile accumulators * fix: fix cut off buy button issue * fix: remove commented out code * maryia/89432/fix: show barriers for current symbol correctly (#94) * fix: show barriers for current symbol * refactor: show barriers for current symbol only * Maryia/test: added tests for getAccumulatorBarriers function (#99) * test: added tests for getAccumulatorBarriers function * test: added tests for getAccumulatorBarriers function * test: renamed test cases for getAccumulatorBarriers function * Maryia/89927_2/fix: ticks_history not forgotten because of chart mode & granularity change (#101) * fix: logics for changing chart mode & granularity caused ticks_history streaming for previous symbol * fix: update chart mode just once when switching contract type * fix: maryia/fixed logics for chart mode switching * refactor: maryia/address review comments * Merge branch master of github.com:binary-com/deriv-app into maryia/67492/task_add_accumulators * Update vanilla-options-card-body.jsx * fix: vanillas + accumulators adjustments * fix: maryia/restore overriden accu change * fix: maryia/vanillas+accumulators adjustment * fix: maryia/ improvements + refactoring to address review comments * fix: maryia/ update c.details chart when end_epoch is defined * fix: reset accu barriers data on every contract type change * fix: revert ui-store to master * fix: chart mode change when switching to symbol without accu * fix: purchase button styling for accumulators (#109) Co-authored-by: Henry Hein --------- Co-authored-by: Maryia <103177211+maryia-binary@users.noreply.github.com> Co-authored-by: yauheni-kryzhyk-deriv <103182683+yauheni-kryzhyk-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: HENRY Co-authored-by: Matin shafiei Co-authored-by: Henry Hein Co-authored-by: hirad-deriv * Amina /77701_make signup form fields immutable if they are immutable from BE (#7544) * adding validation * changeablle fields from client store * mutate address fields * fix: test case * fix: test case * fix: spec_file * fix: making employment status immutable * fix: trading assessment * fix: trading assessment * fix: trading assessment * fix: test case after merge conflict * fix: hide idv section when client is age verified * fix: remove idv_disallowed check * chore: merge master * fix: add new status --------- Co-authored-by: hirad-deriv * translations: 📚 sync translations with crowdin (#8048) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8049) Co-authored-by: yashim-deriv Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8050) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> --------- Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> Co-authored-by: Shaheer <122449658+shaheer-deriv@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Hamid Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Co-authored-by: nada-deriv <122768621+nada-deriv@users.noreply.github.com> Co-authored-by: Farrah Mae Ochoa <82315152+farrah-deriv@users.noreply.github.com> Co-authored-by: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: vinu-deriv <100689171+vinu-deriv@users.noreply.github.com> Co-authored-by: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-binary@users.noreply.github.com> Co-authored-by: yauheni-kryzhyk-deriv <103182683+yauheni-kryzhyk-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: HENRY Co-authored-by: Matin shafiei Co-authored-by: Henry Hein Co-authored-by: hirad-deriv Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com> * feat: demo account creation and payload updated v1.0 (#8058) * feat: demo account creation and payload updated v1.0 * feat: demo fix Trade Popup * feat: demo and real popup fixed with deriv api-types type missing v1.2 * fix: real Get more content modal updated * fix: modal title for demo and svg account * fix: modal title for demo and svg account v1.3 * fix: get more button fix real v1.4 * fix: juridisction modal * fix: transfer icon cashier updated * fix: transfer icon cashier updated v1.2 * fix: modal unmount selected account type on close * chore: Demo text added v1.0 * fix: test coverage * fix: title for demo top up * fix: Demo added in the title for demo * fix: cfd account card * fix: juridisction content change * fix: juridisction content change + leverage fix * refactor: type checks and reviewed suggestions * refactor: hook with test cases added as per review comment * refactor: function added and switch case changed to localize to support different language scenario * Feat sub 90127 syncing the master with swapfree development (#8196) * thisyahlen/chore: new account verification modal for purchase authentication (#7936) * chore: new account verification modal for purchase authentication * fix: height and width * fix: modal footer css * fix: css mobile title * thisyahlen/fix: remove financial mt5 for norway and japan (#7846) * fix: remove financial mt5 for norway and japan * fix: resolved comments * fix: rename restricetd countries * fix: compare accounts table * fix: fix compare accounts table for norway/japan * fix: remove synthetic bvi for norway and japan * Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926) * chore: remove duplicate get_settings api request * chore: set account_settings in client-store if undefined * chore: remove unnecessary else block * refactor: convert if expression to ternary * chore: set account_settings in client store instead of creating a local variable * fix: :sparkles: allows users to enter accented name characters (#7832) * fix: :sparkles: allows users to enter accented name characters * chore: :wastebasket: removes unused 'letter_symbol' variable * fix: :bug: allows accented characters in name for existing users * docs: :pencil2: comment on the regex used for name validation * resused regex function Co-authored-by: Yashim Wong * fix: :memo: imported reused regex function * fix: :memo: comment on regex function used --------- Co-authored-by: Yashim Wong * Evgeniy / 89431 / no error message for idv duplicated document numbers (#7743) * fix: no error message for idv duplicated document numbers * feat: idv testing document whitelist * refactor: function rename, code and test fix * refactor: code style change, review fixes --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Hamid/90702/account switchers to wrong deriv account when performing deposit via bank wire (#7933) * chore: icon changes after build * fix: redirect user to non-eu account instead eu after cashier deposit switch account * Ameerul /Task 89855 Add a checkbox to select/deselect a payment method when creating or updating a sell ad and making a sell order (#7824) * chore: added checkbox to payment method card * fix: added logic to disable checkbox and show checkbox in certain tabs only * Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218) * fix: instantiating useVerifyEmail object once for each email verification case to avoid settimeout leak in useCountdown * chore: store verify_email_sent_count in store instead of locally * test: fix test for email-verification-empty-state.tsx * fix: avoid counter reset by storing and using the time an email was last sent * chore: a workaround for VerifyEmailRequest type declared with an extra required field in api-types * chore: remove api-types workaround * build: update @deriv/api-types to 1.0.85 * revert: api-types version upgrade * revert: package-lock * revert: modal-manager.jsx * revert: modal-manager.jsx * thisyahlen/fix: error when switch to mf (#7778) * fix: error when switch to mf * fix: addressed comments * fix: addressed comments v2 * chore: fix tooltip language not updating on change language (#7871) * chore: fix tooltip language not updating on change language * fix: added checks for currency in trade store * fix: added delete amount validation rules in reaction * fix: remove delete rule in reaction * fix: remove mistake * fix: typo * Aizad/89113/sidebar platform fix (#7697) * chore: fix mobile sidebar platform for eu * fix: codecov error * fix: codecov error * chore: update packages * Nada/88951/change chat url (#7798) * fix: get chat url from p2p_order_create instead of p2p_chat_create * fix: fixed issue with order details page * fix: chat channel url empty issue fixed for p2p_order_create response * fix: function added to store * fix: added timeout for setting chat_channel in order details * fix: pr comments fixed * fix: increased time out * fix: removed delay for going to details page from list * thisyahlen/fix: top up mt5 demo (#7665) * fix: top up demo * fix: deriv x as well * redeploy: a * chore: update pdf in acuity download modal (#7567) * fix: filter currencies by name (#7493) * fix: changed pop up message for no recommendations (#7693) * Aizad/89700/onboarding btn fix (#7813) * chore: disable cursor on account switcher button onboarding * fix: Add the same behavior for Options and Multipliers section Trade Button * fix: added default class and refactor scss * Nada/89550/remove validation ad amount (#7753) * fix: removed error validation for amount greater than user's balance * fix: added popup for creating ad greater than balance * fix: pr comments fixed * fix: reuse common modal for visibility errors * Aizad/88786/mt5 redirection modal fix (#7663) * chore: fix mt5 redirection modal closing on trade * fix: modal and dialog close seperately after clicking outside * fix: re-add dialog_status condition back to redirect-notice-modal * fix: reverted the previous changes * fix: remove useclickoutside for page overlay * fix: update deriv/api package to latest version * fix: updated package version to match with master * Merge branch 'develop' of github.com:binary-com/deriv-app into aizad/88786/mt5-redirection-modal-fix * fix: codecov and circleci * fix: upgrade package * fix: theme switch in poroduction (#7781) * translations: 📚 sync translations with crowdin (#7989) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * yashim/chore: remove indonesia from production (#7999) * chore: remove trading experience incomplete (#8005) * chore: remove trading experience incomplete * fix: remove is cfd score available * thisyahlen/hotfix: wrong restriction message for austria (#8006) * hotfix: wrong restriction message for austria * fix: Empty-Commit * Revert "thisyahlen/hotfix: wrong restriction message for austria (#8006)" (#8013) This reverts commit 56baec7d879efd25f05249323911641ce069ab63. * Revert "Jim/88166/delay in real account creation flow after clicking add account button in the account creation popup (#7926)" (#8016) This reverts commit 8bb13518f4cebd42bc3d2a602807d7c1b6aa5b6a. * fix: :bug: fetches latest personal details every time intead of cached value (#8002) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter a… (#8020) * Revert "Maryia/80948/fix: avoid rate limit error by storing counter after sending verification email in Withdrawal (#7218)" This reverts commit cc0065d02761a33502405d35a47a45696292858d. * revert: reverted setIsCFDScoreAvailable from client.store * Revert "fix: :bug: fetches latest personal details every time intead of cached value (#8002)" (#8022) This reverts commit ff497c14ec9fe0b831031b0d9bae1532f9c47456. * Adrienne / Prefetched email verification modal (#8027) * chore: prefetched email verification modal * chore: added settimoeut * chore: used eager mode * chore: import model directly * chore: reverted direct imports * chore: added settimeout * translations: 📚 sync translations with crowdin (#8031) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8040) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: yashim-deriv * Maryia/67492/task_add_accumulators (#6406) * Merge '67492_accumulators_purchase' into 'maryia/67492/task_add_accumulators' * Maryia/75617/add_accu_to_trade_params (#3) * initialized ACCU trade params for responsive * added LabeledQuantityInputMobile & improved AccumulatorsAmountMobile * feat: added Accumulator radio group for growth_rate * feat: finalized Accumulator growth_rates radio group for mobile * feat: responsive- added Take profit to trade params & aligned purchase button icon * feat: improved mobile trade params for ACCU * feat: finalized trade params for ACCU * maryia/72761/task_add_recent_positions_drawer (#4) * feat: initialized ACCU contract card in recent positions * feat: initialized ProgressSliderSolidLine for ACCU * feat: updated recent positions card for ACCU for open/lost/won states * chore: improvements for ACCU card in responsive recent positions * chore: added TickCounterProgressBar component * feat: added TickCounterBar and reverted ProgressSlider & ProgressSliderMobile * chore: reverted original Recent positions drawer width * chore: improved TickCounterBar styling * maryia/76528/task_implement_contract_details_drawer (#5) * chore: updated Details in contract card for ACCU + styling * feat: implemented ACCU contract card in contract details + improved recent positions * chore: updated icons for ACCU trade type & contract category * maryia/72769/add_ticks_history_stats_widget (#6) * feat: init version of TicksHistoryStatsWidget for ACCU * chore: TicksHistoryStats * chore: improved tick history styling * chore: added more styles & animated progress dots under latest counter * feat: finalized desktop ticks history stats for dtrader page * feat: added ticks history to contract details page * improved ticks history stats for desktop & initialized it for responsive * made responsive stats non-expandable * maryia/77261/task_manual_for_history_widget (#8) * chore: discarded getUpdatedTicksHistoryStats as BE will send 15 exact values instead of 100+latest * feat: added AccumulatorsStatsManualModal * feat: finalized AccumulatorsStatsManualModal for desktop & responsive * chore: added getUpdatedTicksHistoryStats to process arrays of counters with epochs expected from BE * feat: added expanded AccumulatorsStats dialog for responsive * chore: contract card styling improvements + using ACCU tick_count as max_ticks_number * chore: improved AccumulatorsStats to load after tick counters have loaded * maryia/75621/task_add_tests_and_restyle_contract_card (#9) * chore: improved ACCU contract type icon & label styling in contract card * chore: added tests for accumulator.js helper function * chore: added tests for Accumulator.jsx * maryia/75621/part_2_task_accu_barriers (#10) * chore: updated dummy data * chore: fixed history stats styles & added tests for AccumulatorsStats * chore: improved AccumulatorsStats and its tests * chore: updated contract card & open positions * maryia/75621/add barriers for stay in contract on trader page (#12) * chore: test out passing trade data to all-markers for drawing barriers without contract + improvements * feat: added barriers for accumulators without open contract * feat: added markers and barriers for stay in contract on trader page * chore: adjusted open contract profit label (#13) * yauheni/77994/trader add break out contract type (#14) * yauheni/77994/trader add break out contract type * regexp fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/78429/update styles of tick history widget (#15) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * chore: prepared data for connecting API (#16) * Maryia/78473/part 2 prepare for api + improvements (#18) * chore: improved barriers without contract and open contract label * chore: prepared data for api connection * chore: added price tags for barriers in contract details (#19) * feat: initialized AccumulatorsProfitLossTooltip (#20) * yauheni/78477/update params with buttons for responsive (#17) * yauheni/78477/update params with buttons for responsive * fix styles accordingly to design * buttons gap fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/resolve build errors (#21) * yauheni/resolve build errors * optional property for is_checkbox_hidden Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Yauheni/78633/update styles for tick history widget (#22) * yauheni/resolve build errors * yauheni/78633/update styles for tick history widget * yauheni/78633/update styles for tick history widget responsive Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/78839/complete_sold_labels (#23) * chore: added tolltips for all sold positions & won/lost coloring * feat: finalized AccumulatorsProfitLossTooltip * maryia/improvements for stats and tooltip (#24) * chore: accumulators stats improvements * improvements * maryia/improvements for sold contract label * maryia/78574/add_barriers_to_contract_details * maryia/79085/remove_break_out_history_from_stats_widget (#26) * maryia/79085/remove_break_out_history_from_stats * chore: made purchaseButtonsOverlay flexible * chore: added tests for PurchaseButtonsOverlay * Yauheni/77995/update trade params for stayin breakout (#25) * yauheni/77995/update trade params for stayin breakout * take profit alimngment * buttons styles, take profit alingment * maryia/78574/add_barriers_to_contract_details * stake font and icon fix, go_tp_reports button styles * update contract store from parent Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: maryia-binary * maryia/fix: styles & fonts for responsive trade types * Maryia/79549/part 1: update tick markers for ACCU in contract details + improvements (#27) * maryia/79549/add_tick_markers_contract_details * chore: improvements for styles in responsive trade types desc * yauheni/79530/remove breakout contract (#28) * yauheni/79530/remove breakout contract * proposal data fields fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/styling improvements * maryia/fix: forcing Div100vh to re-render when height_offset for responsive has changed * maryia/fix: observables + markers * maryia/chore: prevented barriers, labels and markers from going outside axes (#30) * maryia/79969/set_default_chart_type_and_interval_to_Area_and_1_tick * maryia/chore: changed trade type name to Accumulators * maryia/80163/set growth rate based on default value from BE contracts_for response * yauheni/80091/hide chart mode icon for accumulators (#33) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/80166/connect_to_available_API (#34) * chore: connected api without contracts_for for now * chore: updated proposal * chore: updated tests for new proposal * maryia/80163/add-growth-rate-to-purchase-button * maryia/refactored purchase button growth_rate text * maryia/chore: removed unused code for outside barriers * maryia/fix: barrier shade color for ongoing contract * feat: restore chart mode set for non accumulators contract after switching (#37) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * yauheni/80158/update ui according to latest design (design flow 1-2) (#36) * icon accumulator change * purchase btn, stats fix * fix styles, flow 1 * accumulator design flow 2 Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/80686/feat: profit text animation for ongoing contract (#39) * fix: showing profit text next to current spot for open contract * chore: animated profit text * feat: added animated profit text for ongoing contract * test: fixed a test * chore: removed unused variable * fix: maryia/80686/profit text color * fix: maryia/using default growth rate only if no stored growth rate * feat: allow accumulators only for demo account (#40) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Yauheni/80158/update UI according to latest design part 2 (#38) * accu design chart position fix * accu page for reports rendering * reports card design fix * reports card design fix2 * updated design fix * pseudoelement colon fix * emphasizing value fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/80687/ticks_contract_details (#41) * fix: tick markers in contract details & take profit logics * feat: showing only 10 last ticks for accumulators ongoing contract * chore: display all trade types when list is not empty * style: typo * chore: maryia/added opacity to profit text + connected contracts_for + refactoring * chore: improved tick stream for ACCU in contract details + stats alignment * chore: maryia/handled undefined profit & updated opacity animation timing * chore: temporary dummy api connection * fix: maryia/hide profit if undefined, display if number * revert: dummi api * feat: implement last design part 1 (#43) * feat: implement last design part 1 * fix: test text fix * refactor: stats style for mobile fix Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/82425/task highlight crossing tick (#42) * feat: hightlighting crossing tick * feat: sync highlighting of crossing tick based on ticks_history_stats * Maryia/83069/task: replace image with video manual (#44) * feat: replaced manual image with video + responsive stats improvement * test: fixed a test * fix: entry tick marker in dtrader * style: removed extra margin-bottom * feat: implement last design part 2 (#45) * feat: implement last design part 2 * fix: initial growth_rate added * refactor: growth_rate from contract_for delete Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * refactor: accu sold contract tooltip animation change (#49) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/82257/Contract Details tick markers + AccumulatorsProfitLossText refactoring (#48) * chore: saving canvas context before accu barriers are drawn and restoring when finished drawing * fix: endtime, avoid fetching history in replay, avoid 0 profit animation * chore: forcing chart reload when start_epoch changes to earlier epoch + refactored profit-text * refactor: accumulators-profit-loss-text * refactor: tooltip style and tests (#51) * refactor: tooltip style and tests * refactor: accumulator info text * refactor: profit tooltip text test add * refactor: radiogroupwithinfomobile test added * refactor: tickhistorycounter tests added * refactor: tickcounterbar test added Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/83311/Refactoring, tests, TS migration (#50) * refactor: purchase-buttons-overlay.spec.js from enzyme to jest * style: removed extra variable * refactor: from accumulator.js with chai to accumulator.spec.js with jest * refactor: removed unused dummy data * test: added tests for accumulators-stats-manual-modal.jsx * chore: improved accumulators-stats-manual-modal * refactor: incapsulated AccumulatorsChartElements in trade.jsx * fix: maryia/circleci eslint error * feat: maryia/added dark theme video manual for stats + fix for circleci * test: maryia/added tests for AccumulatorsInfoDisplay & LabeledQuantityInputMobile * chore: maryia/ address review comments + updated videos * fix: maryia/open positions: auto-select Accumulators if has open ACCU contracts * refactor: accumulatorschartelements test added (#52) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * style: maryia/apply review suggestions * style: maryia/apply review suggestions * refactor: maryia/refactoring + small improvements & adjustments * chore: add built icons file * fix: circleci tests + improvements * chore: refactoring + added loader before video manual first loads * refactor: improvements + addressed review comments * yauheni/qa checks refactoring 1 (#53) * refactor: open recent position after buying contract for mobile * fix: accu card curent stake name field * fix: popover accumulator radio group text and alignment * fix: open position accumulate column name Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: last truncated counter in responsive (#54) * Maryia/83807/stake validation (part 1) (#55) * fix: set growth_rate based on accumulator_range_list (growth_rate_range) received in contracts_for * fix: app crash caused by proposal error * chore: removed unused classname * fix: growth rate title alignment (#56) * fix: growht rate title alignment * refactor: category wrapper odd style Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * maryia/83807/fix: stake validation for ACCU broken because of barriers being set (#57) * fix: stake validation for ACCU broken because of barriers being set * fix: prevent app crash in profit table for unknown contracts * fix: check if selected growth_rate is available on symbol change (#58) * fix: able to buy multiply contract / growth rate fix BO change (#59) * fix: able to buy multiply contract / growth rate fix BO change * refactor: last contract check delete Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * revert: maryia/revert change of last_contract computed * fix: accumulator is shown for real account (#60) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * feat: make cursor not allowd for overlay (#61) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * chore: built icons.js * revert: maryia/ unnecessary bot file change * refactor: contract categories in contract-type-widget.jsx * refactor: according to pr review comments * refactor: open positions + add keys to fix console warning * fix: disable accu for real account, disable button having bought one contract (#62) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * refactor: purchase.jsx * refactor: according to pr reviews * refactor: able to buy contract per every available underlying (#63) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Trigger Build * yauheni/85032/ fix chart issue with dots and circles Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: exit spot styles * refactor: make barrier values string as on BE * fix: unable accumulators for real * maryia/refactor_accu_branch (#66) * refactor: remove unused file * refactor: refactor createTickMarkers * refactor: introduce a local variable * fix: 86705/ticks are not displayed correctly on chart in contract details * maryia/86953/build: bump up deriv-charts version to 1.1.0 + improvement (#68) * build: bump up deriv-charts version * chore: show profit only when barriers are received * test: updated mocked props * build: maryia/removed extra package-lock.jsons * evgeniy /87215/87226/ info description / glitch while switching account (#70) * fix: description * fix: disable trade params while switching account --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * henry/87329/fix: FE not showing error message when accu trading is suspended (#72) * fix: FE not showing error message when accu trading is suspended * test: empty commit --------- Co-authored-by: HENRY * refactor: glitching fix and deleted odd css (#73) * refactor: glitching fix and deleted odd css * fix: code refactor --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Maryia/86616/feat: calculating accu barriers based on ticks from ticks_history (#71) * feat: calculating accu barriers based on ticks from ticks_history * chore: rounded & refactored accu barriers * refactor: added getAccumulatorBarriers for barrier calculation + fixed a test * chore: improved barriers calculations * refactor: getAccumulatorBarriers docs * refactor: getAccumulatorBarriers * fix: showing barriers only when having have barriers & always showing barrier lines in C.Details * build: updated package-lock & icons + fixed conflicts + linting * fix: max stake validation is missing (#81) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * fix: maryia/87948/chart empty issue + profit text effects clean-up * henry/87958/feat: Add Dropdown for rates in Accumulator (#86) * feat: Add Dropdown for rates in Accumulator * chore: code cleanup * Update packages/reports/src/Containers/open-positions.jsx Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> --------- Co-authored-by: HENRY Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * Maryia/86616/make 2 last ticks bold + refactoring (#84) * chore: make prelast & last tick bold * chore: adjust styles for previous and last markers in c.details * refactor: getSupportedContracts & getContractTypeDisplay in configs * refactor: open-positions * refactor: chart-markers slyles * style: updated All rates casing * build: update package-lock * Henry/87958/feat add all rates dropdown accumulator (#89) * feat: Add Dropdown for rates in Accumulator * chore: code cleanup * Update packages/reports/src/Containers/open-positions.jsx Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * chore: remove console log * fix: Change Open positions total for multiplier and accumulator to flex --------- Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> * refactor: open-positions * fix: remove unused eslint disable * revert: package-lock * fix: sell button disappearing in mobile accumulators (#92) * Henry/89489/fix sell button missing accumulator (#95) * fix: sell button disappearing in mobile accumulators * fix: fix cut off buy button issue * fix: remove commented out code * maryia/89432/fix: show barriers for current symbol correctly (#94) * fix: show barriers for current symbol * refactor: show barriers for current symbol only * Maryia/test: added tests for getAccumulatorBarriers function (#99) * test: added tests for getAccumulatorBarriers function * test: added tests for getAccumulatorBarriers function * test: renamed test cases for getAccumulatorBarriers function * Maryia/89927_2/fix: ticks_history not forgotten because of chart mode & granularity change (#101) * fix: logics for changing chart mode & granularity caused ticks_history streaming for previous symbol * fix: update chart mode just once when switching contract type * fix: maryia/fixed logics for chart mode switching * refactor: maryia/address review comments * Merge branch master of github.com:binary-com/deriv-app into maryia/67492/task_add_accumulators * Update vanilla-options-card-body.jsx * fix: vanillas + accumulators adjustments * fix: maryia/restore overriden accu change * fix: maryia/vanillas+accumulators adjustment * fix: maryia/ improvements + refactoring to address review comments * fix: maryia/ update c.details chart when end_epoch is defined * fix: reset accu barriers data on every contract type change * fix: revert ui-store to master * fix: chart mode change when switching to symbol without accu * fix: purchase button styling for accumulators (#109) Co-authored-by: Henry Hein --------- Co-authored-by: Maryia <103177211+maryia-binary@users.noreply.github.com> Co-authored-by: yauheni-kryzhyk-deriv <103182683+yauheni-kryzhyk-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: HENRY Co-authored-by: Matin shafiei Co-authored-by: Henry Hein Co-authored-by: hirad-deriv * Amina /77701_make signup form fields immutable if they are immutable from BE (#7544) * adding validation * changeablle fields from client store * mutate address fields * fix: test case * fix: test case * fix: spec_file * fix: making employment status immutable * fix: trading assessment * fix: trading assessment * fix: trading assessment * fix: test case after merge conflict * fix: hide idv section when client is age verified * fix: remove idv_disallowed check * chore: merge master * fix: add new status --------- Co-authored-by: hirad-deriv * translations: 📚 sync translations with crowdin (#8048) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8049) Co-authored-by: yashim-deriv Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8050) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * fix: console error in existing mf user (#8057) * translations: 📚 sync translations with crowdin (#8059) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * chore: update smartcharts version (#8063) * translations: 📚 sync translations with crowdin (#8067) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: yashim-deriv * feat: :sparkles: incorporated FA to MF real account creation (#8025) * feat: :sparkles: incorporated FA to MF real account creation * feat: fixed failing test case * feat: fixed failing testcase * feat: incorporated change * feat: reverted sorted imports * fix: fixed failing testcase * feat: :recycle: code cleanup * feat: formatted imports * feat: :recycle: formatted imports * feat: :recycle: incorporated review comments * feat: removed employment status field * feat: :recycle: incorporated comments * feat: :recycle: reverted changes to income source * fix: :art: incorporated review comments * feat: removed unused CSS * feat: :bug: added toast-box key * fix: :bug: added a toast notification refresh * feat: incorporated check in clear all button * feat: :bug: prevent misfiring of open toas banner * fix: :bug: filter empty values --------- Co-authored-by: Matin shafiei Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * chore: implement new changes to the singup modal (#7955) * chore: implement new changes to the singup modal * fix: updated changes based on comments and updated stylings aswell * fix: made changes based on comments * fix: remove react.fragment * fix: updated changes based on the comments and suggestions * fix: remove gap between fields based on comments * fix: made code improvements based on suggestions * fix: make changes based on recommendations * fix: make changes based on comments * chore: updated captions for the fields and shorten code * fix: update the caption for residence * fix: updated copywrite and fix password modal * fix: updated description for citizenship --------- Co-authored-by: Yashim Wong * chore: remove toast and push notification for poi and poa after first submittion (#7959) Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * chore: update message when screen size is not supported (#8052) * chore: update message when screen size is not supported * fix: change px to rems --------- Co-authored-by: hirad-deriv * Ameerul /Task 86076 Use `disabled` from website_status instead of calling `p2p_advertiser_info` on load of deriv-app. (#7875) * chore: cherry picked changes * chore: fixed tests * chore: left comment in test * chore: fixed typing issues * chore: fixed tests * chore: check if p2p is disabled using get_account_status * chore: removed commented code * chore: added p2p is disabled cookie * chore: fixed tests * chore: implemented suggestions * chore: added suggestions * chore: added farzins changes to types.ts for @deriv/api-types, checked p2p supported currencies * chore: fixed test issue and website_status call after authorize on initial login * chore: fixed tests * chore: fixed tests * chore: empty commit * chore: changed localstorage-sync * chore: fixed website_status issues * chore: removed setIsLoggingIn(false) * chore: added TODO * chore: empty commit * chore: fixed window not loading for new user --------- Co-authored-by: Carol Sachdeva Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * evgeniy/90217/ change language option is not easely visible in desktop (#7879) * feat: desktop refactor, adding responsive menu * refactor: type adding * refactor: review fixes * refactor: add type * refactor: code refactoring, ts and test implementation * fix: test failing * refactor: review changes, usestore added * fix: tests failing * refactor: test usemockstore * refactor: test code * refactor: change language function replace, trade card translation fix * refactor: i18 call add * refactor: lang variable is taken from store * refactor: usecallback added * refactor: functions converted to components, dependencies added --------- Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> * Sergei / 90484 / Update Livechat when widget crashes (#7949) * feat: update livechat when widget crashes * feat: add check for isReady * feat: delete setIsReady(false) because livechat icon hides when crashes --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * fix: dbot dark_mode production (#7885) * fix: dbot dark_mode production * fix: removed unused hook * fix: review comments --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * george / rm89648 / add breadcrumb in cashier deposit page (#7899) * feat: add breadcrumbs in cashier deposit page * test: add tests * refactor: refactor items array, add css * test: fix tests * refactor: incorporate comments - extarct is_eu into trader hub - create separate CashierBreadcrumb component - remove duplicated css - hide ThemeProvider into CashierProviders - rename AppThemeContent into AppContent * test: refactor tests * fix: add css file * fix: fix import breadcrumb for proper appstore build * refactor: resolve comments * fix: applied comments * fix: breadcrumb visibility in safari in mobile view * fix: codecav * perf: add dependency * fix: update deriv-components version to 0.6.0 --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * feat: deriv-go-redirection issue (#7889) * feat: deriv-go-redirection issue * feat: added bderivgo redirection * feat: :sparkles: mavigate back to DerivGO * feat: removed debug console * feat: :art: code refactor * feat: added missing button * feat: :sparkles: added redirect button for POA * feat: :bug: resolved failing testcases * feat: :recycle: incorporated review comments * feat: :bug: added redirection button to missing scenarios --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * thisyahlen/chore: make traders hub default ui (#7836) * chore: remove classic ui from account switcher and header * chore: redirect existing users to traders hub upon logging in * fix: comments * fix: notifications in traders hub * fix: redirect users to traders hub if they go to mt5 page * fix: refactor and remove mt5 and deriv x from platform switcher * fix: remove setisPreAppstore and exit traders hub modal * fix: remove is_pre_appstore flag v1 * fix: remove is_pre_appstore_flag from cashier * fix: remove is_pre_appstore from client * fix: refactor cashier * fix: comments * fix: comments v2 * chore: remove cfd-dashbord test * fix: tests * fix: toggle menu drawer remove exit traders hub * fix: clear tests * fix: readd back deleted code * fix: comments v4 * fix: rename is_from_outside_cashier * fix: fix circleci * fix: remove mt5 and derivx from platform config * fix: readd back languages * fix: redirect mt5 to deriv x to 404 * fix: conflicts * fix: remove exit traders hub modal from ui store * fix: refactor account switcher and fix mf add button * fix: removed unused * fix: notification * fix: conflicts and remove is_pre_appstore flag * fix: tests * fix: console error * fix: re-add back logged out status * fix: re-add back condition from vanuatu flow * fix: Trigger Build * translations: 📚 sync translations with crowdin (#8081) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * Kate/92181/Content change for unavailable contract details error message from Deriv SmartTrader on Deriv's Report. (#8065) * chore: change phrase for unsupported contracts * fix: change key for profit table and statment * refactor: reuse const * refactor: change constants name --------- Co-authored-by: Matin shafiei Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * fix: language switcher css (#8084) Co-authored-by: yashim-deriv * fix: placeholder signup modal typo (#8095) * thisyahlen/fix: disable language button till language is fully loaded (#8089) * fix: disable language button till language is fully loaded * fix: add mockstore * fix: responsive * fix: remove unused css * fix: css * fix: :bug: button not disabled for account signup (#8103) * Amina/fix: set citizen on account (#8102) * fix: set citizen on account * chore: trigger circleci * fix: set citizen on account * translations: 📚 sync translations with crowdin (#8107) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8109) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * fix: checkbox to set correct checked value (#8116) * translations: 📚 sync translations with crowdin (#8120) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * chore: fixed text alignment issue in personal detail page (#8087) * fix: RadioGroupOptionsModal for multipliers options in all languages (#8106) * fix: z-index for dark theme popover (#8051) * henry/92021/fix: make trade types clickable in responsive for digits contracts (#8046) * fix: make trade types clickable in responsive for digits contracts * fix: keep trade params collapsed initially * fix: merge issues * fix: merge issue solved * fix: Empty-Commit --------- Co-authored-by: Henry Hein * thisyahlen/chore: real account needed for cashier popup (#8029) * chore: real account needed for cashier popup * fix: add new mobx to mockstore * fix: move dem all to stores * fix: switch region * fix: add in mockstore * fix: add tests and resolve comments * fix: use mockstore in tests * fix: add for responsive * Jim/91761/delay in real account creation flow after clicking add account in the account creation popup (#8064) * refactor: conditionally fetch account_settings * chore: fix failing tests * henry/91320/Fix: Pass should show eu content flag to smartchart (#7960) * fix: isEuropeCountry returns true if you have european residence or if ip address is in europe * fix: remote console log * fix: pass eu resident and eu by location flags * fix: reduce amount of flags sent to smartchart * fix: Empty-Commit * fix: Empty-Commit * fix: codecov issue * fix: codecov issue 2 --------- Co-authored-by: Henry Hein * fix: Add redirect action that opens multipliers account modal for ext… (#7938) * fix: Add redirect action that opens multipliers account modal for external platforms * fix: removed manage, uses other action for manage. This action is strictly for add only --------- Co-authored-by: Henry Hein Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * thisyahlen/fix: login change language error (#7963) * fix: login change language error * fix: console error and loading --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> Co-authored-by: yashim-deriv * fix: remove validation for sequental and repetitive digits idv (#8021) Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * Hamza/90545/responsive user awareness (#7922) * feat: responsive user awareness v1.0 * feat: responsive user awareness v1.1 * feat: responsive user awareness v1.2 * feat: responsive user awareness v1.3 * feat: responsive user awareness v1.3 * feat: responsive user awareness v1.4 * feat: responsive user awareness v1.5 * feat: responsive user awareness v1.6 * refactor: review code + tsmigration * refactor: removed the unused props * refactor: removed the unused props v1.2 * refactor: alias added v1.3 * fix: successfully added in the text * fix: successfully added in the text + Standardization V1.2 * fix: successfully added in the text + Standardization V1.3 * fix: successfully added in the text + Standardization V1.3.1 * fix: language switcher css (#8084) Co-authored-by: yashim-deriv * fix: placeholder signup modal typo (#8095) * thisyahlen/fix: disable language button till language is fully loaded (#8089) * fix: disable language button till language is fully loaded * fix: add mockstore * fix: responsive * fix: remove unused css * fix: css * fix: :bug: button not disabled for account signup (#8103) * Amina/fix: set citizen on account (#8102) * fix: set citizen on account * chore: trigger circleci * fix: set citizen on account --------- Co-authored-by: Matin shafiei Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Co-authored-by: yashim-deriv Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Co-authored-by: Likhith Kolayari <98398322+likhith-deriv@users.noreply.github.com> Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com> * Rostislav / 90547 / Improve the "Transfer page" when there is only 1 Deriv Account with no siblings and CFDs account (#7894) * refactor: init pr * refactor: edited transfer page content * refactor: changed button behavior * refactor: removed unused variables/consts * refactor: removed unused function param and type * refactor: tests fixed * refactor: fixed a test with navigating to traders hub * refactor: renamed a test with navigation + more changes * refactor: removed openAccountSwitcherModal * refactor: removed backticks * refactor: typo fixed * refactor: fixed cringe mistake on my part * refactor: tests improved * refactor: periods added for messages * refactor: a few more changes to tests * refactor: mockRootStore type changed to TStores * refactor: a change to spec + merge conflicts fixes * Farzin/90439/R&D/Make use of `react-query` in `@deriv/api` package (#7845) * feat: :arrow_up: update `@deriv/api-types` to `1.0.85` * feat(api): :sparkles: update api types with all the requests from `@deriv/api-types` * feat(api): :sparkles: add `useAPI` hook * feat(api): ✨ add `useAPISubscription` hook * feat(api): ✨ add `useAPISubscription` hook * feat(api): ✨ improve types * feat(api): ✨ rename hooks * feat(api): ✨ rename hooks * refactor(api): :fire: remove `QueryClient` config * refactor(api): :fire: remove unnecessary utils file * refactor(api): :fire: remove unnecessary export types * test(api): :white_check_mark: add test for `useFetch` hook * refactor(api): :fire: improve `useSubscription` hook * feat(api): ✨ use `useMutation` hook inside `useRequest` hook * test(cashier): :white_check_mark: fix the failing test * refactor(api): :recycle: move request props to `payload` object * refactor(api): :memo: resolve PR comments * feat(api): :arrow_up: migrating to React Query 4 * fix(cashier): :bug: fix type errors * feat(api): :sparkles: add `useInvalidateQuery` hook * refactor(api): :memo: resolve PR comments * ci: :green_heart: trigger build * ci: :green_heart: trigger build --------- Co-authored-by: Farzin Mirzaie * translations: 📚 sync translations with crowdin (#8138) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * fix: sets the contract language whenever there is a change (#7996) * fix: sets the contract language whenever there is a change * fix: issue with popup disappearing * fix: translate amount tooltip --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> * bahar/87663/fix: add_removed_deposit_test (#8007) * fix: add_removed_deposit_test * fix: review comments * fix: Rename error component * fix_showing_crypto_deposit_condition * translations: 📚 sync translations with crowdin (#8142) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * translations: 📚 sync translations with crowdin (#8144) Co-authored-by: yashim-deriv Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * chore: change reaction and call validateAllProperties (#8165) * Henry/92021/trade types cant change in responsive (#8160) * fix: make trade types clickable in responsive for digits contracts * fix: keep trade params collapsed initially * fix: merge issues * fix: merge issue solved * fix: Empty-Commit * Revert "henry/92021/fix: make trade types clickable in responsive for digits contracts (#8046)" This reverts commit c1453e40b124bdc0e5c80fb692d3db719cd0e50f. * fix: trade types not switchable for digits contracts in responsive --------- Co-authored-by: Henry Hein * translations: 📚 sync translations with crowdin (#8181) Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> * Revert "chore: change reaction and call validateAllProperties (#8165)" (#8182) This reverts commit 2f889dd5d95d0106c7a97cc088a8795793ae1729. * thisyahlen/fix: firefox staging fix (#8185) * fix: firefox staging fix * fix: remove lodash * Update qa_server url (#8190) * Merge branch 'master' of github.com:binary-com/deriv-app into feat-90127-hamza/swapfree-development * fix: circle ci issue --------- Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> Co-authored-by: Shaheer <122449658+shaheer-deriv@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Hamid Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Co-authored-by: nada-deriv <122768621+nada-deriv@users.noreply.github.com> Co-authored-by: Farrah Mae Ochoa <82315152+farrah-deriv@users.noreply.github.com> Co-authored-by: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: vinu-deriv <100689171+vinu-deriv@users.noreply.github.com> Co-authored-by: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-binary@users.noreply.github.com> Co-authored-by: yauheni-kryzhyk-deriv <103182683+yauheni-kryzhyk-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: HENRY Co-authored-by: Matin shafiei Co-authored-by: Henry Hein Co-authored-by: hirad-deriv Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com> Co-authored-by: balakrishna-deriv <56330681+balakrishna-deriv@users.noreply.github.com> Co-authored-by: Likhith Kolayari <98398322+likhith-deriv@users.noreply.github.com> Co-authored-by: Sui Sin <103026762+suisin-deriv@users.noreply.github.com> Co-authored-by: Carol Sachdeva Co-authored-by: Sergei Baranovski <120570511+sergei-deriv@users.noreply.github.com> Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> Co-authored-by: kate-deriv <121025168+kate-deriv@users.noreply.github.com> Co-authored-by: Rostik Kayko <119863957+rostislav-deriv@users.noreply.github.com> Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> Co-authored-by: Farzin Mirzaie Co-authored-by: Bahar Co-authored-by: Hamid * refactor: code changes * chore: Description of hook added * chore: Description of hook added v1.2 * chore: Description of hook added v1.3 * refactor: refactored changes v1.0 * refactor: sub_account_type error * refactor: remove localize * refactor: removed the commented line * fix: remove line error + code smells * fix: type error for primitive type * fix: conflict and eslint error * refactor: change back the types to default one DetailsOfEachMT5Loginid * fix: circle ci store import error * fix: get more button screen getting expanded * refactor: suggestions resolved * fix: commodities removed from jurisdiction modal * fix: traders hub restricted countries not shown * fix: traders hub restricted countries not shown autralia labuan malta * fix: traders hub restricted countries not shown autralia labuan malta revert * fix: Merge conflict resolve * fix: translation and demo label removed * fix: merge conflicts demo text in tradig-app-card * fix: Deriv X modal crashed * fix: synthetics added and forex addition and deletion * chore: 20696747/WALL-586 swap-free description change --------- Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com> Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com> Co-authored-by: Shaheer <122449658+shaheer-deriv@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: yauheni-deriv <103182683+yauheni-deriv@users.noreply.github.com> Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Hamid Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Co-authored-by: nada-deriv <122768621+nada-deriv@users.noreply.github.com> Co-authored-by: Farrah Mae Ochoa <82315152+farrah-deriv@users.noreply.github.com> Co-authored-by: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: Yashim Wong Co-authored-by: vinu-deriv <100689171+vinu-deriv@users.noreply.github.com> Co-authored-by: Muhammad Hamza <120543468+hamza-deriv@users.noreply.github.com> Co-authored-by: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com> Co-authored-by: Maryia <103177211+maryia-binary@users.noreply.github.com> Co-authored-by: yauheni-kryzhyk-deriv <103182683+yauheni-kryzhyk-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: HENRY Co-authored-by: Henry Hein Co-authored-by: hirad-deriv Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com> Co-authored-by: balakrishna-deriv <56330681+balakrishna-deriv@users.noreply.github.com> Co-authored-by: Likhith Kolayari <98398322+likhith-deriv@users.noreply.github.com> Co-authored-by: Sui Sin <103026762+suisin-deriv@users.noreply.github.com> Co-authored-by: Carol Sachdeva Co-authored-by: Sergei Baranovski <120570511+sergei-deriv@users.noreply.github.com> Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com> Co-authored-by: kate-deriv <121025168+kate-deriv@users.noreply.github.com> Co-authored-by: Rostik Kayko <119863957+rostislav-deriv@users.noreply.github.com> Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> Co-authored-by: Farzin Mirzaie Co-authored-by: Bahar Co-authored-by: Hamid Co-authored-by: hamza-deriv --- packages/appstore/package.json | 1 + .../ic-appstore-swap-free.svg | 1 + .../assets/svgs/trading-platform/index.tsx | 2 + .../components/cfds-listing/cfds-listing.scss | 3 +- .../account-type-modal/account-type-modal.tsx | 55 ++++++++++++------ .../modals/account-type-modal/types.ts | 3 +- .../src/components/modals/modal-manager.tsx | 5 +- .../static-cfd-account-manager.tsx | 2 +- .../onboarding-new/static-dashboard.scss | 4 +- .../onboarding-new/static-dashboard.tsx | 58 +++++++++++++------ .../appstore/src/helpers/account-helper.ts | 22 +++++++ packages/appstore/src/types/common.types.ts | 2 +- .../ic-appstore-swap-free.svg | 1 + .../assets/svgs/trading-platform/index.tsx | 2 + .../ic-appstore-swap-free.svg | 1 + .../Assets/svgs/trading-platform/index.tsx | 2 + .../cfd/src/Components/cfd-account-card.tsx | 8 ++- .../cfd-dxtrade-demo-account-display.tsx | 2 +- .../cfd-mt5-demo-account-display.tsx | 42 +++++++++++++- packages/cfd/src/Components/props.types.ts | 12 ++-- .../cfd/src/Constants/cfd-specifications.ts | 6 ++ .../src/Constants/jurisdiction-contents.ts | 8 +++ packages/cfd/src/Containers/cfd-dashboard.tsx | 37 ++++++++---- .../cfd/src/Containers/cfd-password-modal.tsx | 46 ++++++++++++--- .../cfd/src/Containers/derivx-trade-modal.tsx | 7 ++- .../cfd/src/Containers/dmt5-trade-modal.tsx | 7 ++- .../jurisdiction-card-banner.tsx | 22 +++++-- .../jurisdiction-modal/jurisdiction-card.tsx | 13 ++++- .../jurisdiction-modal-content.tsx | 35 ++++++++--- .../jurisdiction-modal-foot-note.tsx | 4 +- .../jurisdiction-modal/jurisdiction-modal.tsx | 41 +++++++++---- .../cfd/src/Containers/mt5-trade-modal.tsx | 5 +- packages/cfd/src/Containers/props.types.ts | 5 ++ .../Stores/Modules/CFD/Helpers/cfd-config.ts | 43 ++++++++++++-- .../cfd/src/Stores/Modules/CFD/cfd-store.js | 28 ++++++--- packages/cfd/src/sass/cfd-dashboard.scss | 3 +- packages/cfd/types.ts | 3 + .../components/src/components/icon/icons.js | 1 + .../icon/mt5/ic-mt5-swap-free-platform.svg | 1 + packages/components/stories/icon/icons.js | 1 + packages/core/src/Constants/cfd-text.js | 5 ++ packages/core/src/Stores/Helpers/client.js | 7 +++ packages/core/src/Stores/client-store.js | 43 +++++++++----- packages/core/src/Stores/traders-hub-store.js | 35 +++++++++-- .../__tests__/useHasSwapFreeAccount.spec.tsx | 50 ++++++++++++++++ packages/hooks/src/index.ts | 1 + packages/hooks/src/useHasSwapFreeAccount.ts | 17 ++++++ packages/shared/src/utils/cfd/cfd.ts | 43 ++++++++++++-- packages/stores/src/mockStore.ts | 1 + packages/stores/types.ts | 18 ++++++ 50 files changed, 622 insertions(+), 142 deletions(-) create mode 100644 packages/appstore/src/assets/svgs/trading-platform/ic-appstore-swap-free.svg create mode 100644 packages/cashier/src/assets/svgs/trading-platform/ic-appstore-swap-free.svg create mode 100644 packages/cfd/src/Assets/svgs/trading-platform/ic-appstore-swap-free.svg create mode 100644 packages/cfd/types.ts create mode 100644 packages/components/src/components/icon/mt5/ic-mt5-swap-free-platform.svg create mode 100644 packages/hooks/src/__tests__/useHasSwapFreeAccount.spec.tsx create mode 100644 packages/hooks/src/useHasSwapFreeAccount.ts diff --git a/packages/appstore/package.json b/packages/appstore/package.json index 04fe6dee5fd3..77cd8a233135 100644 --- a/packages/appstore/package.json +++ b/packages/appstore/package.json @@ -29,6 +29,7 @@ "@deriv/cashier": "^1.0.0", "@deriv/components": "^1.0.0", "@deriv/cfd": "^1.0.0", + "@deriv/hooks": "^1.0.0", "@deriv/shared": "^1.0.0", "@deriv/stores": "^1.0.0", "@deriv/trader": "^3.8.0", diff --git a/packages/appstore/src/assets/svgs/trading-platform/ic-appstore-swap-free.svg b/packages/appstore/src/assets/svgs/trading-platform/ic-appstore-swap-free.svg new file mode 100644 index 000000000000..7b464b0951e6 --- /dev/null +++ b/packages/appstore/src/assets/svgs/trading-platform/ic-appstore-swap-free.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/appstore/src/assets/svgs/trading-platform/index.tsx b/packages/appstore/src/assets/svgs/trading-platform/index.tsx index 10ab73c97b71..560dfa830f9d 100644 --- a/packages/appstore/src/assets/svgs/trading-platform/index.tsx +++ b/packages/appstore/src/assets/svgs/trading-platform/index.tsx @@ -16,6 +16,7 @@ import Financial from 'Assets/svgs/trading-platform/branding/ic-branding-mt5-fin import Options from 'Assets/svgs/trading-platform/ic-appstore-options.svg'; import SmartTrader from 'Assets/svgs/trading-platform/branding/ic-branding-smarttrader-dashboard.svg'; import SmartTraderBlue from 'Assets/svgs/trading-platform/ic-appstore-smarttrader-blue.svg'; +import SwapFree from 'Assets/svgs/trading-platform/ic-appstore-swap-free.svg'; import { IconProps } from '../icon-types'; export const PlatformIcons = { @@ -33,6 +34,7 @@ export const PlatformIcons = { DropDown, DTrader, Financial, + SwapFree, Options, SmartTrader, SmartTraderBlue, diff --git a/packages/appstore/src/components/cfds-listing/cfds-listing.scss b/packages/appstore/src/components/cfds-listing/cfds-listing.scss index 44d35d7421ed..654d41675cab 100644 --- a/packages/appstore/src/components/cfds-listing/cfds-listing.scss +++ b/packages/appstore/src/components/cfds-listing/cfds-listing.scss @@ -1,5 +1,6 @@ .cfd-jurisdiction-card--synthetic, -.cfd-jurisdiction-card--financial { +.cfd-jurisdiction-card--financial, +.cfd-jurisdiction-card--all { border: solid 1px var(--border-normal); border-radius: 0.8rem; display: flex; diff --git a/packages/appstore/src/components/modals/account-type-modal/account-type-modal.tsx b/packages/appstore/src/components/modals/account-type-modal/account-type-modal.tsx index 54afec4e0cef..cf3a99bfc425 100644 --- a/packages/appstore/src/components/modals/account-type-modal/account-type-modal.tsx +++ b/packages/appstore/src/components/modals/account-type-modal/account-type-modal.tsx @@ -5,21 +5,11 @@ import { observer } from 'mobx-react-lite'; import classNames from 'classnames'; import { useStores } from 'Stores/index'; import TradigPlatformIconProps from 'Assets/svgs/trading-platform'; -import { TModalContent, TAccountType, TAccountCard, TTradingPlatformAvailableAccount } from './types'; +import { TModalContent, TAccountCard, TTradingPlatformAvailableAccount } from './types'; import { TIconTypes } from 'Types'; import { CFD_PLATFORMS } from '@deriv/shared'; - -const getDerivedAccount = (): TAccountType => ({ - title_and_type: localize('Derived'), - icon: 'Derived', - description: localize('Trade CFDs on MT5 with Derived indices that simulate real-world market movements.'), -}); - -const getFinancialAccount = (): TAccountType => ({ - title_and_type: localize('Financial'), - icon: 'Financial', - description: localize('Trade CFDs on MT5 with forex, stock indices, commodities, and cryptocurrencies.'), -}); +import { getDerivedAccount, getFinancialAccount, getSwapFreeAccount } from '../../../helpers/account-helper'; +import { useHasSwapFreeAccount } from '@deriv/hooks'; const AccountCard = ({ selectAccountTypeCard, account_type_card, title_and_type, description, icon }: TAccountCard) => { const cardSelection = (cardType: string) => { @@ -54,6 +44,7 @@ const ModalContent = ({ selectAccountTypeCard, is_financial_available, is_synthetic_available, + is_swapfree_available, }: TModalContent) => { return (
@@ -75,6 +66,15 @@ const ModalContent = ({ icon={getFinancialAccount().icon} /> )} + {is_swapfree_available && ( + selectAccountTypeCard(`${getSwapFreeAccount().title_and_type}`)} + description={getSwapFreeAccount().description} + title_and_type={getSwapFreeAccount().title_and_type} + icon={getSwapFreeAccount().icon} + /> + )}
); }; @@ -92,6 +92,13 @@ const MT5AccountTypeModal = () => { const { trading_platform_available_accounts } = client; const { enableApp, disableApp } = ui; const { setAppstorePlatform } = common; + + React.useEffect(() => { + if (!is_account_type_modal_visible) { + selectAccountTypeCard(''); + } + }, [is_account_type_modal_visible, selectAccountTypeCard]); + const is_financial_available = trading_platform_available_accounts.some( (available_account: TTradingPlatformAvailableAccount) => available_account.market_type === 'financial' ); @@ -99,12 +106,22 @@ const MT5AccountTypeModal = () => { const is_synthetic_available = trading_platform_available_accounts.some( (available_account: TTradingPlatformAvailableAccount) => available_account.market_type === 'gaming' ); + const is_swapfree_available = useHasSwapFreeAccount(); - const set_account_type = () => - account_type_card === localize('Derived') - ? setAccountType({ category: 'real', type: 'synthetic' }) - : setAccountType({ category: 'real', type: 'financial' }); - + const set_account_type = () => { + switch (account_type_card) { + case 'Derived': + setAccountType({ category: 'real', type: 'synthetic' }); + break; + case 'Swap-Free': + setAccountType({ category: 'real', type: 'all' }); + break; + case 'Financial': + default: + setAccountType({ category: 'real', type: 'financial' }); + break; + } + }; return (
}> @@ -126,6 +143,7 @@ const MT5AccountTypeModal = () => { selectAccountTypeCard={selectAccountTypeCard} is_financial_available={is_financial_available} is_synthetic_available={is_synthetic_available} + is_swapfree_available={is_swapfree_available} />
)} diff --git a/packages/cfd/src/Components/props.types.ts b/packages/cfd/src/Components/props.types.ts index 3dae634df84c..03d0147dbb6f 100644 --- a/packages/cfd/src/Components/props.types.ts +++ b/packages/cfd/src/Components/props.types.ts @@ -52,7 +52,7 @@ export type TCFDAccountCardActionProps = { }; export type TTradingPlatformAvailableAccount = { - market_type: 'financial' | 'gaming'; + market_type: 'financial' | 'gaming' | 'all'; name: string; requirements: { after_first_deposit: { @@ -79,8 +79,10 @@ export type TCFDAccountCard = { real: string; }; is_hovered?: boolean; - isEligibleForMoreDemoMt5Svg: (market_type: 'synthetic' | 'financial') => boolean; - isEligibleForMoreRealMt5: (market_type: 'synthetic' | 'financial') => boolean; + isEligibleForMoreDemoMt5Svg: ( + market_type: TTradingPlatformAvailableAccount['market_type'] | 'synthetic' + ) => boolean; + isEligibleForMoreRealMt5: (market_type: TTradingPlatformAvailableAccount['market_type'] | 'synthetic') => boolean; existing_accounts_data?: TExistingData; trading_platform_available_accounts: TTradingPlatformAvailableAccount[]; has_banner?: boolean; @@ -158,9 +160,9 @@ export type TTradingPlatformAccounts = { /** * Market type */ - market_type?: 'financial' | 'synthetic'; + market_type?: 'financial' | 'synthetic' | 'all'; /** * Name of trading platform. */ - platform?: 'dxtrade'; + platform?: 'dxtrade' | string; }; diff --git a/packages/cfd/src/Constants/cfd-specifications.ts b/packages/cfd/src/Constants/cfd-specifications.ts index edc80044e78a..5b38704f14dd 100644 --- a/packages/cfd/src/Constants/cfd-specifications.ts +++ b/packages/cfd/src/Constants/cfd-specifications.ts @@ -38,6 +38,12 @@ const mt5 = { 'stop-out-level': { key: () => localize('Stop out level'), value: () => localize('50%') }, 'number-of-assets': { key: () => localize('Number of assets'), value: () => localize('150+') }, }, + real_all_specs: { + leverage: { key: () => localize('Leverage'), value: () => localize('Up to 1:1000') }, + 'margin-call': { key: () => localize('Margin call'), value: () => localize('100%') }, + 'stop-out-level': { key: () => localize('Stop out level'), value: () => localize('50%') }, + 'number-of-assets': { key: () => localize('Number of assets'), value: () => localize('40+') }, + }, eu_real_financial_specs: { leverage: { key: () => localize('Leverage'), value: () => localize('Up to 1:30') }, 'margin-call': { key: () => localize('Margin call'), value: () => localize('100%') }, diff --git a/packages/cfd/src/Constants/jurisdiction-contents.ts b/packages/cfd/src/Constants/jurisdiction-contents.ts index e47a5e95d456..b83e28e125ea 100644 --- a/packages/cfd/src/Constants/jurisdiction-contents.ts +++ b/packages/cfd/src/Constants/jurisdiction-contents.ts @@ -5,6 +5,7 @@ type TJurisdictionCardItems = { over_header?: string; synthetic_contents: Array; financial_contents: Array; + swapfree_contents?: Array; is_over_header_available: boolean; }; type TJurisdictionContent = { @@ -32,6 +33,13 @@ export const getJurisdictionContents = (): TJurisdictionContent => ({ )}`, `${localize('Leverage up to 1:1000')}`, ], + swapfree_contents: [ + `${localize('Selecting this will onboard you through Deriv (SVG) LLC (company no. 273 LLC 2020)')}`, + `${localize( + '40+ assets: forex, synthetics, stocks, stock indices, cryptocurrencies, and ETFs swap-free.' + )}`, + `${localize('Leverage up to 1:1000')}`, + ], }, vanuatu: { is_over_header_available: false, diff --git a/packages/cfd/src/Containers/cfd-dashboard.tsx b/packages/cfd/src/Containers/cfd-dashboard.tsx index f61777085162..bc2e24421588 100644 --- a/packages/cfd/src/Containers/cfd-dashboard.tsx +++ b/packages/cfd/src/Containers/cfd-dashboard.tsx @@ -30,11 +30,12 @@ import { general_messages } from '../Constants/cfd-shared-strings'; import SwitchToRealAccountModal from './switch-to-real-account'; import 'Sass/cfd-dashboard.scss'; import RootStore from '../Stores/index'; -import { DetailsOfEachMT5Loginid, LandingCompany, ResidenceList } from '@deriv/api-types'; +import { LandingCompany, ResidenceList, DetailsOfEachMT5Loginid } from '@deriv/api-types'; // TODO: Change these imports after real released import CFDDxtradeDemoAccountDisplay from '../Components/cfd-dxtrade-demo-account-display'; import CFDMT5DemoAccountDisplay from '../Components/cfd-mt5-demo-account-display'; import { CFDRealAccountDisplay } from '../Components/cfd-real-account-display'; +import { TTradingPlatformAccounts } from 'Components/props.types'; declare module 'react' { interface HTMLAttributes extends React.AriaAttributes, React.DOMAttributes { @@ -310,18 +311,20 @@ const CFDDashboard = (props: TCFDDashboardProps) => { }; const openAccountTransfer = ( - data: DetailsOfEachMT5Loginid & { account_id?: string; platform?: string }, - meta: { category: string; type?: string } + data: DetailsOfEachMT5Loginid | TTradingPlatformAccounts, + meta: TOpenAccountTransferMeta ) => { if (meta.category === 'real') { - if (data.platform === CFD_PLATFORMS.DXTRADE) - sessionStorage.setItem('cfd_transfer_to_login_id', data.account_id as string); - else sessionStorage.setItem('cfd_transfer_to_login_id', data.login as string); - - props.disableCFDPasswordModal(); - props.history.push(routes.cashier_acc_transfer); + if (data) { + if ('platform' in data && data.platform === CFD_PLATFORMS.DXTRADE) + sessionStorage.setItem('cfd_transfer_to_login_id', data.account_id || ''); + else sessionStorage.setItem('cfd_transfer_to_login_id', data.login || ''); + + props.disableCFDPasswordModal(); + props.history.push(routes.cashier_acc_transfer); + } } else { - props.setCurrentAccount(data, meta); + if ('sub_account_type' in data) props.setCurrentAccount(data, meta); props.openTopUpModal(); } }; @@ -402,6 +405,19 @@ const CFDDashboard = (props: TCFDDashboardProps) => { ); }; + const isSwapFreeCardVisible = () => { + const { platform, landing_companies, is_logged_in } = props; + + return ( + !is_logged_in || + isLandingCompanyEnabled({ + landing_companies, + platform, + type: 'all', + }) + ); + }; + const { account_status, beginRealSignupForMt5, @@ -646,6 +662,7 @@ const CFDDashboard = (props: TCFDDashboardProps) => { is_loading={is_loading} isSyntheticCardVisible={isSyntheticCardVisible} isFinancialCardVisible={isFinancialCardVisible} + isSwapFreeCardVisible={isSwapFreeCardVisible} current_list={current_list} onSelectAccount={createCFDAccount} landing_companies={landing_companies} diff --git a/packages/cfd/src/Containers/cfd-password-modal.tsx b/packages/cfd/src/Containers/cfd-password-modal.tsx index f019569dd3e4..6cf7acd3416e 100644 --- a/packages/cfd/src/Containers/cfd-password-modal.tsx +++ b/packages/cfd/src/Containers/cfd-password-modal.tsx @@ -4,7 +4,13 @@ import { RouteComponentProps, withRouter } from 'react-router'; import { SentEmailModal } from '@deriv/account'; import { DetailsOfEachMT5Loginid, GetAccountStatus, LandingCompany, Mt5NewAccount } from '@deriv/api-types'; import RootStore from '../Stores/index'; -import { getMtCompanies, getFormattedJurisdictionCode, TMtCompanies } from '../Stores/Modules/CFD/Helpers/cfd-config'; +import { + getDxCompanies, + getMtCompanies, + getFormattedJurisdictionCode, + TMtCompanies, + TDxCompanies, +} from '../Stores/Modules/CFD/Helpers/cfd-config'; import { FormSubmitButton, Icon, @@ -38,7 +44,7 @@ import TradingPlatformIcon from '../Assets/svgs/trading-platform'; export type TCFDPasswordFormValues = { password: string }; type TExtendedDetailsOfEachMT5Loginid = Omit & { - market_type?: 'synthetic' | 'financial' | 'gaming'; + market_type?: 'synthetic' | 'financial' | 'gaming' | 'all'; }; type TOnSubmitPassword = (values: TCFDPasswordFormValues, actions: FormikHelpers) => void; @@ -147,6 +153,23 @@ type TCFDPasswordModalProps = RouteComponentProps & { updateAccountStatus: () => void; }; +const getAccountTitle = ( + platform: string, + account_type: { + category?: string; + type?: string; + }, + account_title: string +) => { + if (platform === CFD_PLATFORMS.DXTRADE) { + return getDxCompanies()[account_type.category as keyof TDxCompanies][ + account_type.type as keyof TDxCompanies['demo' | 'real'] + ].short_title; + } + + return account_title; +}; + const PasswordModalHeader = ({ should_set_trading_password, is_password_reset_error, @@ -203,6 +226,8 @@ const IconType = React.memo(({ platform, type, show_eu_related_content }: TIconT switch (type) { case 'synthetic': return ; + case 'all': + return ; case 'financial': if (show_eu_related_content) { return ; @@ -215,6 +240,8 @@ const IconType = React.memo(({ platform, type, show_eu_related_content }: TIconT switch (type) { case 'synthetic': return ; + case 'all': + return ; case 'financial': if (show_eu_related_content) { return ; @@ -529,7 +556,9 @@ const CFDPasswordForm = ({ values={{ platform: getCFDPlatformLabel(platform), platform_name: platform === CFD_PLATFORMS.MT5 ? 'MT5' : 'Deriv X', - account: !show_eu_related_content ? account_title : '', + account: !show_eu_related_content + ? getAccountTitle(platform, account_type, account_title) + : '', jurisdiction_shortcode: showJuristiction(), }} /> @@ -540,7 +569,7 @@ const CFDPasswordForm = ({ values={{ platform: getCFDPlatformLabel(platform), platform_name: platform === CFD_PLATFORMS.MT5 ? 'MT5' : 'Deriv X', - account: account_title, + account: getAccountTitle(platform, account_type, account_title), }} /> )} @@ -800,6 +829,8 @@ const CFDPasswordModal = ({ getMtCompanies(show_eu_related_content)[category as keyof TMtCompanies][ type as keyof TMtCompanies['demo' | 'real'] ].short_title; + const deriv_x_type_label = + getDxCompanies()[category as keyof TDxCompanies][type as keyof TDxCompanies['demo' | 'real']].short_title; const jurisdiction_label = jurisdiction_selected_shortcode && getFormattedJurisdictionCode(jurisdiction_selected_shortcode); const mt5_platform_label = jurisdiction_selected_shortcode !== 'maltainvest' ? 'MT5' : ''; @@ -811,7 +842,7 @@ const CFDPasswordModal = ({ i18n_default_text='Congratulations, you have successfully created your {{category}} <0>{{platform}} <1>{{type}} {{jurisdiction_selected_shortcode}} account. ' values={{ // TODO: remove below condition once deriv x changes are completed - type: platform === 'dxtrade' && type_label === 'Derived' ? 'Synthetic' : type_label, + type: platform === CFD_PLATFORMS.DXTRADE ? deriv_x_type_label : type_label, platform: platform === CFD_PLATFORMS.MT5 ? mt5_platform_label : 'Deriv X', category: category_label, jurisdiction_selected_shortcode: @@ -834,9 +865,10 @@ const CFDPasswordModal = ({ return (
- {getHeadingTitle()} + {trade_modal_title} {(mt5_trade_account as TTradingPlatformAccounts)?.display_login && ( diff --git a/packages/cfd/src/Containers/dmt5-trade-modal.tsx b/packages/cfd/src/Containers/dmt5-trade-modal.tsx index 7f5c47e83920..6dc38fa4985d 100644 --- a/packages/cfd/src/Containers/dmt5-trade-modal.tsx +++ b/packages/cfd/src/Containers/dmt5-trade-modal.tsx @@ -17,7 +17,7 @@ import { getPlatformMt5DownloadLink, getMT5WebTerminalLink } from '../Helpers/co import TradingPlatformIcon from '../Assets/svgs/trading-platform'; type TMT5TradeModalProps = { - mt5_trade_account: Required; + mt5_trade_account: DetailsOfEachMT5Loginid; show_eu_related_content: boolean; onPasswordManager: ( arg1: string | undefined, @@ -119,6 +119,7 @@ const DMT5TradeModal = ({ const getAccountTitle = () => { if (show_eu_related_content) return 'CFDs'; else if (mt5_trade_account.market_type === 'synthetic') return 'Derived'; + else if (mt5_trade_account.market_type === 'all') return 'SwapFree'; return 'Financial'; }; return ( @@ -173,8 +174,8 @@ const DMT5TradeModal = ({ }); onPasswordManager( mt5_trade_account?.login, - getTitle(mt5_trade_account.market_type, show_eu_related_content), - mt5_trade_account.account_type, + getTitle(mt5_trade_account.market_type || '', show_eu_related_content), + mt5_trade_account.account_type || '', account_type, (mt5_trade_account as DetailsOfEachMT5Loginid)?.server ); diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card-banner.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card-banner.tsx index 0ddd4b06fc90..d604d63fe7eb 100644 --- a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card-banner.tsx +++ b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card-banner.tsx @@ -18,6 +18,7 @@ const VerificationStatusBanner = ({ should_restrict_vanuatu_account_creation, real_synthetic_accounts_existing_data, real_financial_accounts_existing_data, + real_swapfree_accounts_existing_data, }: TVerificationStatusBannerProps) => { const { poi_not_submitted_for_vanuatu_maltainvest, @@ -62,10 +63,22 @@ const VerificationStatusBanner = ({ } }; - const isAccountCreated = () => - account_type === 'synthetic' - ? real_synthetic_accounts_existing_data?.some(account => account.landing_company_short === type_of_card) - : real_financial_accounts_existing_data?.some(account => account.landing_company_short === type_of_card); + const isAccountCreated = () => { + switch (account_type) { + case 'synthetic': + return real_synthetic_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + case 'all': + return real_swapfree_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + default: + return real_financial_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + } + }; if (disabled && isAccountCreated()) { // account added @@ -195,4 +208,5 @@ export default connect(({ modules: { cfd }, client }: RootStore) => ({ should_restrict_vanuatu_account_creation: client.should_restrict_vanuatu_account_creation, real_financial_accounts_existing_data: cfd.real_financial_accounts_existing_data, real_synthetic_accounts_existing_data: cfd.real_synthetic_accounts_existing_data, + real_swapfree_accounts_existing_data: cfd.real_swapfree_accounts_existing_data, }))(JurisdictionCardBanner); diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card.tsx index bee3284893ce..955c0aaa1936 100644 --- a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card.tsx +++ b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-card.tsx @@ -14,20 +14,27 @@ const JurisdictionCard = ({ financial_available_accounts, setJurisdictionSelectedShortcode, synthetic_available_accounts, + swapfree_available_accounts, type_of_card, }: TJurisdictionCardProps) => { const card_classname = `cfd-jurisdiction-card--${account_type}`; const number_of_synthetic_accounts_to_be_shown = synthetic_available_accounts?.length; const number_of_financial_accounts_to_be_shown = financial_available_accounts?.length; + const number_of_swapfree_accounts_to_be_shown = swapfree_available_accounts?.length; const is_synthetic = account_type === 'synthetic'; + const is_swapfree = account_type === 'all'; + const non_synthetic_accounts = is_swapfree + ? number_of_swapfree_accounts_to_be_shown + : number_of_financial_accounts_to_be_shown; const [number_of_cards] = React.useState( - is_synthetic ? number_of_synthetic_accounts_to_be_shown : number_of_financial_accounts_to_be_shown + is_synthetic ? number_of_synthetic_accounts_to_be_shown : non_synthetic_accounts ); const card_values = getJurisdictionContents()[type_of_card as TJurisdictionCardType]; - const card_data = is_synthetic ? card_values.synthetic_contents : card_values.financial_contents; + const non_synthetic_card_data = is_swapfree ? card_values.swapfree_contents : card_values.financial_contents; + const card_data = is_synthetic ? card_values.synthetic_contents : non_synthetic_card_data; const cardSelection = (cardType: string) => { setJurisdictionSelectedShortcode(jurisdiction_selected_shortcode === cardType ? '' : cardType); @@ -57,7 +64,7 @@ const JurisdictionCard = ({ - {card_data.map((item, index) => ( + {card_data?.map((item, index) => (
diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-content.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-content.tsx index 800cfc63a5e9..d5b65a585d25 100644 --- a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-content.tsx +++ b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal-content.tsx @@ -9,24 +9,42 @@ const JurisdictionModalContent = ({ setJurisdictionSelectedShortcode, synthetic_available_accounts, financial_available_accounts, + swapfree_available_accounts, context, real_synthetic_accounts_existing_data, real_financial_accounts_existing_data, + real_swapfree_accounts_existing_data, }: TJurisdictionModalContentProps) => { const card_classname = `cfd-jurisdiction-card--${account_type}`; - const cardsToBeShown = (type_of_card: string) => - account_type === 'synthetic' - ? synthetic_available_accounts?.some(account => account.shortcode === type_of_card) - : financial_available_accounts?.some(account => account.shortcode === type_of_card); - + const cardsToBeShown = (type_of_card: string) => { + switch (account_type) { + case 'synthetic': + return synthetic_available_accounts?.some(account => account.shortcode === type_of_card); + case 'all': + return swapfree_available_accounts?.some(account => account.shortcode === type_of_card); + default: + return financial_available_accounts?.some(account => account.shortcode === type_of_card); + } + }; const disableCard = (type_of_card: string) => { if (is_virtual && type_of_card !== 'svg') { return true; } - return account_type === 'synthetic' - ? real_synthetic_accounts_existing_data?.some(account => account.landing_company_short === type_of_card) - : real_financial_accounts_existing_data?.some(account => account.landing_company_short === type_of_card); + switch (account_type) { + case 'synthetic': + return real_synthetic_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + case 'all': + return real_swapfree_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + default: + return real_financial_accounts_existing_data?.some( + account => account.landing_company_short === type_of_card + ); + } }; const jurisdiction_cards_array = ['svg', 'bvi', 'vanuatu', 'labuan', 'maltainvest']; return ( @@ -43,6 +61,7 @@ const JurisdictionModalContent = ({ jurisdiction_selected_shortcode={jurisdiction_selected_shortcode} synthetic_available_accounts={synthetic_available_accounts} financial_available_accounts={financial_available_accounts} + swapfree_available_accounts={swapfree_available_accounts} account_type={account_type} setJurisdictionSelectedShortcode={setJurisdictionSelectedShortcode} /> 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..ed67f6ba1f5e 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, getMT5Title } from '@deriv/shared'; import { TJurisdictionModalFootNoteProps } from '../props.types'; const FooterNote = ({ @@ -13,7 +13,7 @@ const FooterNote = ({ should_restrict_bvi_account_creation, should_restrict_vanuatu_account_creation, }: TJurisdictionModalFootNoteProps) => { - const account_type_name = account_type === 'synthetic' ? 'Derived' : 'Financial'; + const account_type_name = getMT5Title(account_type); const { poa_pending } = getAuthenticationStatusInfo(account_status); diff --git a/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx b/packages/cfd/src/Containers/jurisdiction-modal/jurisdiction-modal.tsx index 60bf787fcf05..d290dfc2c4a9 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, getMT5Title } from '@deriv/shared'; import { TJurisdictionModalProps } from '../props.types'; import JurisdictionCheckBox from './jurisdiction-modal-checkbox'; import JurisdictionModalFootNote from './jurisdiction-modal-foot-note'; @@ -21,6 +21,7 @@ const JurisdictionModal = ({ openPasswordModal, real_synthetic_accounts_existing_data, real_financial_accounts_existing_data, + real_swapfree_accounts_existing_data, trading_platform_available_accounts, toggleJurisdictionModal, setJurisdictionSelectedShortcode, @@ -76,10 +77,18 @@ const JurisdictionModal = ({ : available_account.shortcode !== 'maltainvest') ); + const swapfree_available_accounts = trading_platform_available_accounts.filter( + available_account => + available_account.market_type === 'all' && + (show_eu_related_content + ? available_account.shortcode === 'maltainvest' + : available_account.shortcode !== 'maltainvest') + ); + const modal_title = show_eu_related_content ? localize('Jurisdiction for your Deriv MT5 CFDs account') - : localize('Choose a jurisdiction for your MT5 {{account_type}} account', { - account_type: account_type.type === 'synthetic' ? 'Derived' : 'Financial', + : localize('Choose a jurisdiction for your Deriv MT5 {{account_type}} account', { + account_type: getMT5Title(account_type.type), }); const is_svg_selected = jurisdiction_selected_shortcode === 'svg'; @@ -90,14 +99,21 @@ const JurisdictionModal = ({ const isNextButtonDisabled = () => { if (jurisdiction_selected_shortcode) { - const is_account_created = - account_type.type === 'synthetic' - ? real_synthetic_accounts_existing_data?.some( - account => account.landing_company_short === jurisdiction_selected_shortcode - ) - : real_financial_accounts_existing_data?.some( - account => account.landing_company_short === jurisdiction_selected_shortcode - ); + let is_account_created; + + if (account_type.type === 'synthetic') { + is_account_created = real_synthetic_accounts_existing_data?.some( + account => account.landing_company_short === jurisdiction_selected_shortcode + ); + } else if (account_type.type === 'all') { + is_account_created = real_swapfree_accounts_existing_data?.some( + account => account.landing_company_short === jurisdiction_selected_shortcode + ); + } else { + is_account_created = real_financial_accounts_existing_data?.some( + account => account.landing_company_short === jurisdiction_selected_shortcode + ); + } if (!is_account_created) { if ( @@ -168,10 +184,12 @@ const JurisdictionModal = ({ is_virtual={is_virtual} real_financial_accounts_existing_data={real_financial_accounts_existing_data} real_synthetic_accounts_existing_data={real_synthetic_accounts_existing_data} + real_swapfree_accounts_existing_data={real_swapfree_accounts_existing_data} jurisdiction_selected_shortcode={jurisdiction_selected_shortcode} context={context} setJurisdictionSelectedShortcode={setJurisdictionSelectedShortcode} synthetic_available_accounts={synthetic_available_accounts} + swapfree_available_accounts={swapfree_available_accounts} />
; + mt5_trade_account: Required< + DetailsOfEachMT5Loginid & { market_type?: TTradingPlatformAvailableAccount['market_type'] | 'synthetic' } + >; is_eu_user: boolean; is_open: boolean; onPasswordManager: ( diff --git a/packages/cfd/src/Containers/props.types.ts b/packages/cfd/src/Containers/props.types.ts index 37856780cca8..fc9de6cdb716 100644 --- a/packages/cfd/src/Containers/props.types.ts +++ b/packages/cfd/src/Containers/props.types.ts @@ -166,6 +166,7 @@ export type TJurisdictionCardProps = { context: RootStore; synthetic_available_accounts: TTradingPlatformAvailableAccount[]; financial_available_accounts: TTradingPlatformAvailableAccount[]; + swapfree_available_accounts: TTradingPlatformAvailableAccount[]; setJurisdictionSelectedShortcode: (card_type: string) => void; account_type: string; type_of_card: string; @@ -184,6 +185,7 @@ export type TVerificationStatusBannerProps = { type_of_card: string; real_synthetic_accounts_existing_data: TExistingData; real_financial_accounts_existing_data: TExistingData; + real_swapfree_accounts_existing_data: TExistingData; should_restrict_bvi_account_creation: boolean; should_restrict_vanuatu_account_creation: boolean; }; @@ -225,6 +227,7 @@ export type TJurisdictionModalProps = { toggleCFDVerificationModal: () => void; real_synthetic_accounts_existing_data: TExistingData; real_financial_accounts_existing_data: TExistingData; + real_swapfree_accounts_existing_data: TExistingData; updateMT5Status: () => void; has_submitted_cfd_personal_details: boolean; }; @@ -236,8 +239,10 @@ export type TJurisdictionModalContentProps = { setJurisdictionSelectedShortcode: (card_type: string) => void; synthetic_available_accounts: TTradingPlatformAvailableAccount[]; financial_available_accounts: TTradingPlatformAvailableAccount[]; + swapfree_available_accounts: TTradingPlatformAvailableAccount[]; real_synthetic_accounts_existing_data: TExistingData; real_financial_accounts_existing_data: TExistingData; + real_swapfree_accounts_existing_data: TExistingData; is_virtual: boolean; }; 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..6498e216b23a 100644 --- a/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts +++ b/packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts @@ -4,6 +4,11 @@ export type TDxCompanies = ReturnType; export type TMtCompanies = ReturnType; export const getDxCompanies = () => { + const all_config = { + account_type: '', + leverage: 500, + short_title: localize('CFDs'), + }; const synthetic_config = { account_type: '', leverage: 500, @@ -16,6 +21,12 @@ export const getDxCompanies = () => { }; return { demo: { + all: { + dxtrade_account_type: all_config.account_type, + leverage: all_config.leverage, + title: localize('Demo'), + short_title: all_config.short_title, + }, synthetic: { dxtrade_account_type: synthetic_config.account_type, leverage: synthetic_config.leverage, @@ -30,6 +41,18 @@ export const getDxCompanies = () => { }, }, real: { + all: { + dxtrade_account_type: all_config.account_type, + leverage: all_config.leverage, + title: localize('Real'), + short_title: all_config.short_title, + }, + dxtrade: { + mt5_account_type: all_config.account_type, + leverage: all_config.leverage, + title: localize('Real'), + short_title: all_config.short_title, + }, synthetic: { dxtrade_account_type: synthetic_config.account_type, leverage: synthetic_config.leverage, @@ -50,8 +73,8 @@ export const getMtCompanies = (is_eu: boolean) => { // TODO: Move this to the getDxCompanies for real release and when separating MT5 and DerivX components. const all_config = { account_type: '', - leverage: 500, - short_title: localize('CFDs'), + leverage: 100, + short_title: localize('Swap-Free'), }; const synthetic_config = { account_type: '', @@ -74,7 +97,13 @@ export const getMtCompanies = (is_eu: boolean) => { all: { mt5_account_type: all_config.account_type, leverage: all_config.leverage, - title: localize('Demo'), + title: localize('Demo Swap-Free'), + short_title: all_config.short_title, + }, + all_svg: { + mt5_account_type: all_config.account_type, + leverage: all_config.leverage, + title: localize('Demo Swap-Free SVG'), short_title: all_config.short_title, }, synthetic: { @@ -113,7 +142,13 @@ export const getMtCompanies = (is_eu: boolean) => { all: { mt5_account_type: all_config.account_type, leverage: all_config.leverage, - title: localize('Real'), + title: localize('Swap-Free'), + short_title: all_config.short_title, + }, + all_svg: { + mt5_account_type: all_config.account_type, + leverage: all_config.leverage, + title: localize('Swap-Free SVG'), short_title: all_config.short_title, }, dxtrade: { diff --git a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js index 3a7e6e007c41..305500419575 100644 --- a/packages/cfd/src/Stores/Modules/CFD/cfd-store.js +++ b/packages/cfd/src/Stores/Modules/CFD/cfd-store.js @@ -37,6 +37,7 @@ export default class CFDStore extends BaseStore { real_synthetic_accounts_existing_data = []; real_financial_accounts_existing_data = []; + real_swapfree_accounts_existing_data = []; constructor({ root_store }) { super({ root_store }); @@ -94,6 +95,7 @@ export default class CFDStore extends BaseStore { toggleCompareAccountsModal: action.bound, getRealSyntheticAccountsExistingData: action.bound, getRealFinancialAccountsExistingData: action.bound, + getRealSwapfreeAccountsExistingData: action.bound, toggleJurisdictionModal: action.bound, toggleMT5TradeModal: action.bound, disableMt5FinancialStpModal: action.bound, @@ -165,13 +167,20 @@ export default class CFDStore extends BaseStore { return getDxCompanies(); } get has_created_account_for_selected_jurisdiction() { - return this.account_type.type === 'synthetic' - ? this.real_synthetic_accounts_existing_data?.some( - account => account.landing_company_short === this.jurisdiction_selected_shortcode - ) - : this.real_financial_accounts_existing_data?.some( - account => account.landing_company_short === this.jurisdiction_selected_shortcode - ); + switch (this.account_type.type) { + case 'synthetic': + return this.real_synthetic_accounts_existing_data?.some( + account => account.landing_company_short === this.jurisdiction_selected_shortcode + ); + case 'all': + return this.real_swapfree_accounts_existing_data?.some( + account => account.landing_company_short === this.jurisdiction_selected_shortcode + ); + default: + return this.real_financial_accounts_existing_data?.some( + account => account.landing_company_short === this.jurisdiction_selected_shortcode + ); + } } onMount() { @@ -278,6 +287,7 @@ export default class CFDStore extends BaseStore { phone, state: address_state, zipCode: address_postcode, + ...(this.account_type.type === 'all' ? { sub_account_category: 'swap_free' } : {}), ...(values.server ? { server: values.server } : {}), ...(this.jurisdiction_selected_shortcode ? { company: this.jurisdiction_selected_shortcode } : {}), ...(this.jurisdiction_selected_shortcode !== 'labuan' @@ -504,6 +514,10 @@ export default class CFDStore extends BaseStore { this.real_financial_accounts_existing_data = real_financial_accounts_existing_data; } + getRealSwapfreeAccountsExistingData(real_swapfree_accounts_existing_data) { + this.real_swapfree_accounts_existing_data = real_swapfree_accounts_existing_data; + } + toggleJurisdictionModal() { this.is_jurisdiction_modal_visible = !this.is_jurisdiction_modal_visible; } diff --git a/packages/cfd/src/sass/cfd-dashboard.scss b/packages/cfd/src/sass/cfd-dashboard.scss index 937250771fd5..e4f84d45e409 100644 --- a/packages/cfd/src/sass/cfd-dashboard.scss +++ b/packages/cfd/src/sass/cfd-dashboard.scss @@ -488,7 +488,8 @@ } .cfd-jurisdiction-card--synthetic, -.cfd-jurisdiction-card--financial { +.cfd-jurisdiction-card--financial, +.cfd-jurisdiction-card--all { border: solid 1px var(--border-normal); border-radius: 0.8rem; display: flex; diff --git a/packages/cfd/types.ts b/packages/cfd/types.ts new file mode 100644 index 000000000000..6389dd6f436a --- /dev/null +++ b/packages/cfd/types.ts @@ -0,0 +1,3 @@ +import type { TCoreStores } from '@deriv/stores/types'; + +export type TTradingPlatformAvailableAccount = TCoreStores['client']['trading_platform_available_accounts'][number]; diff --git a/packages/components/src/components/icon/icons.js b/packages/components/src/components/icon/icons.js index c51f50ca4e17..1869d85d25bd 100644 --- a/packages/components/src/components/icon/icons.js +++ b/packages/components/src/components/icon/icons.js @@ -645,6 +645,7 @@ import './mt5/ic-mt5-open-markets.svg'; import './mt5/ic-mt5-password-updated.svg'; import './mt5/ic-mt5-responsive.svg'; import './mt5/ic-mt5-support.svg'; +import './mt5/ic-mt5-swap-free-platform.svg'; import './mt5/ic-mt5-synthetic-dashboard.svg'; import './mt5/ic-mt5-synthetic-indices.svg'; import './mt5/ic-mt5-synthetic-platform.svg'; diff --git a/packages/components/src/components/icon/mt5/ic-mt5-swap-free-platform.svg b/packages/components/src/components/icon/mt5/ic-mt5-swap-free-platform.svg new file mode 100644 index 000000000000..7b464b0951e6 --- /dev/null +++ b/packages/components/src/components/icon/mt5/ic-mt5-swap-free-platform.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 0424319c40e1..a809e59bc3a9 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -665,6 +665,7 @@ export const icons = 'IcMt5PasswordUpdated', 'IcMt5Responsive', 'IcMt5Support', + 'IcMt5SwapFreePlatform', 'IcMt5SyntheticDashboard', 'IcMt5SyntheticIndices', 'IcMt5SyntheticPlatform', diff --git a/packages/core/src/Constants/cfd-text.js b/packages/core/src/Constants/cfd-text.js index 361ae8c8d724..264d84db7f70 100644 --- a/packages/core/src/Constants/cfd-text.js +++ b/packages/core/src/Constants/cfd-text.js @@ -6,13 +6,18 @@ export const CFD_TEXT = { mt5_cfds: () => localize('MT5 CFDs'), cfd: () => localize('CFDs'), synthetic: () => localize('Derived'), + synthetic_demo: () => localize('Derived Demo'), synthetic_bvi: () => localize('Derived BVI'), synthetic_svg: () => localize('Derived SVG'), synthetic_v: () => localize('Derived Vanuatu'), financial: () => localize('Financial'), + financial_demo: () => localize('Financial Demo'), financial_bvi: () => localize('Financial BVI'), financial_fx: () => localize('Financial Labuan'), financial_v: () => localize('Financial Vanuatu'), financial_svg: () => localize('Financial SVG'), derivez: () => localize('Deriv EZ'), + all: () => localize('Swap-Free'), + all_demo: () => localize('Swap-Free Demo'), + all_svg: () => localize('Swap-Free SVG'), }; diff --git a/packages/core/src/Stores/Helpers/client.js b/packages/core/src/Stores/Helpers/client.js index 6bf8bfd76ab2..534d7a76c75c 100644 --- a/packages/core/src/Stores/Helpers/client.js +++ b/packages/core/src/Stores/Helpers/client.js @@ -34,6 +34,13 @@ export const getAccountTitle = loginid => { return types_map[getClientAccountType(loginid)] || types_map.default; }; +export const getAvailableAccount = market_type => { + if (market_type === 'all') { + return 'all'; + } + return 'financial'; +}; + export const getLandingCompanyValue = ({ loginid, landing_company, isAccountOfType }) => { const key = 'changeable_fields'; let landing_company_object; diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index 8d5c69e4dd4b..79a8e18fb7fd 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -26,7 +26,7 @@ import { } from '@deriv/shared'; import { WS, requestLogout } from 'Services'; import { action, computed, makeObservable, observable, reaction, runInAction, toJS, when } from 'mobx'; -import { getAccountTitle, getClientAccountType } from './Helpers/client'; +import { getAccountTitle, getClientAccountType, getAvailableAccount } from './Helpers/client'; import { getLanguage, localize } from '@deriv/translations'; import { getRegion, isEuCountry, isMultipliersOnly, isOptionsBlocked } from '_common/utility'; @@ -989,39 +989,50 @@ export default class ClientStore extends BaseStore { } }; - getIsMarketTypeMatching = (account, market_type) => - market_type === 'synthetic' - ? account.market_type === market_type || account.market_type === 'gaming' - : account.market_type === 'financial'; + getIsMarketTypeMatching = (account, market_type) => { + if (market_type === 'synthetic') { + return account.market_type === market_type || account.market_type === 'gaming'; + } else if (market_type === 'all') { + return account.market_type === 'all'; + } + return account.market_type === 'financial'; + }; isEligibleForMoreDemoMt5Svg(market_type) { + const is_synthetic = market_type === 'synthetic'; + const available_account = getAvailableAccount(market_type); const existing_demo_accounts = this.mt5_login_list.filter( account => account.account_type === 'demo' && this.getIsMarketTypeMatching(account, market_type) ); - return ( - this.trading_platform_available_accounts.some( - account => - (market_type === 'synthetic' ? 'gaming' : 'financial') === account.market_type && - account.shortcode === 'svg' - ) && existing_demo_accounts.every(account => !(account.landing_company_short === 'svg')) - ); + const has_matching_account = this.trading_platform_available_accounts.some(account => { + return (is_synthetic ? 'gaming' : available_account) === account.market_type && account.shortcode === 'svg'; + }); + const has_no_svg_account = existing_demo_accounts.every(account => { + return !(account.landing_company_short === 'svg'); + }); + + return has_matching_account && has_no_svg_account; } isEligibleForMoreRealMt5(market_type) { + const is_synthetic = market_type === 'synthetic'; + const available_account = getAvailableAccount(market_type); const existing_real_accounts = this.mt5_login_list.filter( account => account.account_type === 'real' && this.getIsMarketTypeMatching(account, market_type) ); const available_real_accounts_shortcodes = this.trading_platform_available_accounts .filter( account => - (market_type === 'synthetic' ? 'gaming' : 'financial') === account.market_type && + (is_synthetic ? 'gaming' : available_account) === account.market_type && account.shortcode !== 'maltainvest' ) .map(account => account.shortcode); - return !!available_real_accounts_shortcodes.filter(shortcode => - existing_real_accounts.every(account => account.landing_company_short !== shortcode) - ).length; + const has_no_matching_accounts = available_real_accounts_shortcodes.every(shortcode => + existing_real_accounts.some(account => account.landing_company_short !== shortcode) + ); + + return !has_no_matching_accounts; } isMT5Allowed = landing_companies => { diff --git a/packages/core/src/Stores/traders-hub-store.js b/packages/core/src/Stores/traders-hub-store.js index 463498940f38..e3afa1aad9c0 100644 --- a/packages/core/src/Stores/traders-hub-store.js +++ b/packages/core/src/Stores/traders-hub-store.js @@ -341,23 +341,37 @@ export default class TradersHubStore extends BaseStore { } getAvailableCFDAccounts() { - const account_desc = - !this.is_eu_user || this.is_demo_low_risk + const getAccountDesc = () => { + return !this.is_eu_user || this.is_demo_low_risk ? localize('Trade CFDs on MT5 with forex, stock indices, commodities, and cryptocurrencies.') : localize( 'Trade CFDs on MT5 with forex, stocks, stock indices, synthetics, cryptocurrencies, and commodities.' ); + }; + const getSwapFreeAccountDesc = () => { + return localize( + 'Trade swap-free CFDs on MT5 with synthetics, forex, stocks, stock indices, cryptocurrencies and ETFs.' + ); + }; const all_available_accounts = [ ...getCFDAvailableAccount(), { name: !this.is_eu_user || this.is_demo_low_risk ? localize('Financial') : localize('CFDs'), - description: account_desc, + description: getAccountDesc(), platform: CFD_PLATFORMS.MT5, market_type: 'financial', icon: !this.is_eu_user || this.is_demo_low_risk ? 'Financial' : 'CFDs', availability: 'All', }, + { + name: !this.is_eu_user ? localize('Swap-Free') : '', + description: getSwapFreeAccountDesc(), + platform: CFD_PLATFORMS.MT5, + market_type: 'all', + icon: 'SwapFree', + availability: 'Non-EU', + }, ]; this.available_cfd_accounts = all_available_accounts.map(account => { return { @@ -399,7 +413,10 @@ export default class TradersHubStore extends BaseStore { if (this.CFDs_restricted_countries) { this.available_mt5_accounts = this.available_cfd_accounts.filter( - account => account.market_type !== 'financial' && account.platform === CFD_PLATFORMS.MT5 + account => + account.market_type !== 'financial' && + account.market_type !== 'all' && + account.platform === CFD_PLATFORMS.MT5 ); return; } @@ -445,6 +462,9 @@ export default class TradersHubStore extends BaseStore { if (platform === CFD_PLATFORMS.MT5 && !this.is_eu_user && !maltainvest_account) { return key.startsWith(`${platform}.${selected_account_type}.${market_type}`); } + if (platform === CFD_PLATFORMS.MT5 && market_type === 'all') { + return key.startsWith(`${platform}.${selected_account_type}.${platform}@${market_type}`); + } if (platform === CFD_PLATFORMS.DXTRADE && market_type === 'all') { return key.startsWith(`${platform}.${selected_account_type}.${platform}@${market_type}`); } @@ -572,8 +592,11 @@ export default class TradersHubStore extends BaseStore { this.is_real && !this.is_eu_user && (this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'synthetic') || - this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'financial')) && - (isEligibleForMoreRealMt5('synthetic') || isEligibleForMoreRealMt5('financial')) && + this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'financial') || + this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'all')) && + (isEligibleForMoreRealMt5('synthetic') || + isEligibleForMoreRealMt5('financial') || + isEligibleForMoreRealMt5('all')) && !is_high_risk_client_for_mt5 ); } diff --git a/packages/hooks/src/__tests__/useHasSwapFreeAccount.spec.tsx b/packages/hooks/src/__tests__/useHasSwapFreeAccount.spec.tsx new file mode 100644 index 000000000000..f071c8f9d6b5 --- /dev/null +++ b/packages/hooks/src/__tests__/useHasSwapFreeAccount.spec.tsx @@ -0,0 +1,50 @@ +import * as React from 'react'; +import { StoreProvider, mockStore } from '@deriv/stores'; +import { renderHook } from '@testing-library/react-hooks'; +import useHasSwapFreeAccount from '../useHasSwapFreeAccount'; + +describe('useHasSwapFreeAccount', () => { + test('should be true if it has a market type of all', async () => { + const mock = mockStore({ + client: { + trading_platform_available_accounts: [{ market_type: 'all' }], + }, + }); + + const wrapper = ({ children }: { children: JSX.Element }) => ( + {children} + ); + const { result } = renderHook(() => useHasSwapFreeAccount(), { wrapper }); + + expect(result.current).toBe(true); + }); + + test('should be false if it has a market type of financial', async () => { + const mock = mockStore({ + client: { + trading_platform_available_accounts: [{ market_type: 'financial' }], + }, + }); + + const wrapper = ({ children }: { children: JSX.Element }) => ( + {children} + ); + const { result } = renderHook(() => useHasSwapFreeAccount(), { wrapper }); + + expect(result.current).toBe(false); + }); + test('should be false if has a market type of gaming ', async () => { + const mock = mockStore({ + client: { + trading_platform_available_accounts: [{ market_type: 'gaming' }], + }, + }); + + const wrapper = ({ children }: { children: JSX.Element }) => ( + {children} + ); + const { result } = renderHook(() => useHasSwapFreeAccount(), { wrapper }); + + expect(result.current).toBe(false); + }); +}); diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index 1a88d45c814a..ca9e6182e64d 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -12,6 +12,7 @@ export { default as useHasActiveRealAccount } from './useHasActiveRealAccount'; export { default as useHasFiatCurrency } from './useHasFiatCurrency'; export { default as useHasMaltaInvestAccount } from './useHasMaltaInvestAccount'; export { default as useHasSetCurrency } from './useHasSetCurrency'; +export { default as useHasSwapFreeAccount } from './useHasSwapFreeAccount'; export { default as useHasSvgAccount } from './useHasSvgAccount'; export { default as useHasUSDCurrency } from './useHasUSDCurrency'; export { default as useIsP2PEnabled } from './useIsP2PEnabled'; diff --git a/packages/hooks/src/useHasSwapFreeAccount.ts b/packages/hooks/src/useHasSwapFreeAccount.ts new file mode 100644 index 000000000000..642bdd30e24d --- /dev/null +++ b/packages/hooks/src/useHasSwapFreeAccount.ts @@ -0,0 +1,17 @@ +import { useStore } from '@deriv/stores'; + +/** + * This hook is used to check if the client has a Swap-Free account. + * It checks for availability of market_type 'all' in trading_platform_available_accounts API response + */ +const useHasSwapFreeAccount = () => { + const { client } = useStore(); + const { trading_platform_available_accounts } = client; + const has_swap_free_account = trading_platform_available_accounts.some( + available_account => available_account.market_type === 'all' + ); + + return has_swap_free_account; +}; + +export default useHasSwapFreeAccount; diff --git a/packages/shared/src/utils/cfd/cfd.ts b/packages/shared/src/utils/cfd/cfd.ts index 212943728176..f18ac1be205d 100644 --- a/packages/shared/src/utils/cfd/cfd.ts +++ b/packages/shared/src/utils/cfd/cfd.ts @@ -4,23 +4,37 @@ import { localize } from '@deriv/translations'; let CFD_text_translated: { [key: string]: () => void }; -// TODO: add swap_free to this file when ready -const CFD_text: { [key: string]: string } = { +export const CFD_text: { [key: string]: string } = { dxtrade: 'Deriv X', mt5: 'MT5', mt5_cfds: 'MT5 CFDs', cfd: 'CFDs', synthetic: 'Derived', + synthetic_demo: 'Derived Demo', synthetic_bvi: 'Derived BVI', synthetic_svg: 'Derived SVG', synthetic_v: 'Derived Vanuatu', financial: 'Financial', + financial_demo: 'Financial Demo', financial_bvi: 'Financial BVI', financial_fx: 'Financial Labuan', financial_v: 'Financial Vanuatu', financial_svg: 'Financial SVG', + all: 'Swap-Free', + all_demo: 'Swap-Free Demo', + all_svg: 'Swap-Free SVG', } as const; +export const getMT5Title = (account_type: string) => { + if (account_type === 'synthetic') { + return CFD_text.synthetic; + } + if (account_type === 'all') { + return CFD_text.all; + } + return CFD_text.financial; +}; + type TPlatform = 'dxtrade' | 'mt5' | 'derivez'; type TMarketType = 'financial' | 'synthetic' | 'gaming' | 'all' | undefined; type TShortcode = 'svg' | 'bvi' | 'labuan' | 'vanuatu'; @@ -38,9 +52,20 @@ type TGetCFDAccountKey = TGetAccount & { // sub_account_type: "financial" | "financial_stp" | "swap_free" // * // sub_account_type financial_stp only happens in "financial" market_type +// dxrade and swap_free both have market_type "all" so check for platform is neccessary export const getCFDAccountKey = ({ market_type, sub_account_type, platform, shortcode }: TGetCFDAccountKey) => { if (market_type === 'all') { - return platform === CFD_PLATFORMS.DERIVEZ ? 'derivez' : 'dxtrade'; + if (platform === CFD_PLATFORMS.MT5) { + // currently we are only supporting SVG for SwapFree + switch (shortcode) { + case 'svg': + return 'all_svg'; + default: + return 'all_demo'; + } + } else { + return platform === CFD_PLATFORMS.DERIVEZ ? 'derivez' : 'dxtrade'; + } } if (market_type === 'gaming' || market_type === 'synthetic') { @@ -53,7 +78,7 @@ export const getCFDAccountKey = ({ market_type, sub_account_type, platform, shor case 'vanuatu': return 'synthetic_v'; default: - return 'synthetic'; + return 'synthetic_demo'; } } } @@ -73,7 +98,7 @@ export const getCFDAccountKey = ({ market_type, sub_account_type, platform, shor case 'vanuatu': return 'financial_v'; default: - return 'financial'; + return 'financial_demo'; } } } @@ -90,7 +115,7 @@ export const getCFDAccountKey = ({ market_type, sub_account_type, platform, shor type TGetAccountTypeFields = { category: 'real' | 'demo'; - type: 'financial' | 'synthetic'; + type: 'financial' | 'synthetic' | 'all'; }; type TAccountType = { @@ -112,6 +137,9 @@ export const getAccountTypeFields = ({ category, type }: TGetAccountTypeFields) account_type: 'financial', mt5_account_type: 'financial', }, + all: { + account_type: 'all', + }, }, demo: { synthetic: { @@ -121,6 +149,9 @@ export const getAccountTypeFields = ({ category, type }: TGetAccountTypeFields) account_type: 'demo', mt5_account_type: 'financial', }, + all: { + account_type: 'demo', + }, }, }; diff --git a/packages/stores/src/mockStore.ts b/packages/stores/src/mockStore.ts index 51bbf865470c..4e6d494e11a8 100644 --- a/packages/stores/src/mockStore.ts +++ b/packages/stores/src/mockStore.ts @@ -8,6 +8,7 @@ const mock = (): TStores & { is_mock: boolean } => { account_settings: {}, accounts: {}, active_account_landing_company: '', + trading_platform_available_accounts: [], account_limits: { daily_transfers: { dxtrade: { diff --git a/packages/stores/types.ts b/packages/stores/types.ts index 8a6536f136a3..be904a96ea23 100644 --- a/packages/stores/types.ts +++ b/packages/stores/types.ts @@ -51,6 +51,23 @@ type TActiveAccount = TAccount & { is_virtual: number; }; +type TTradingPlatformAvailableAccount = { + market_type: 'financial' | 'gaming' | 'all'; + name: string; + requirements: { + after_first_deposit: { + financial_assessment: string[]; + }; + compliance: { + mt5: string[]; + tax_information: string[]; + }; + signup: string[]; + }; + shortcode: 'bvi' | 'labuan' | 'svg' | 'vanuatu'; + sub_account_type: string; +}; + type TAuthenticationStatus = { document_status: string; identity_status: string }; type TMenuItem = { @@ -108,6 +125,7 @@ type TClientStore = { accounts: { [k: string]: TActiveAccount }; active_accounts: TActiveAccount[]; active_account_landing_company: string; + trading_platform_available_accounts: TTradingPlatformAvailableAccount[]; account_limits: Partial & { is_loading?: boolean; api_initial_load_error?: string;