From 84a8f499fc468fdd6a745548905eb1778fd39d76 Mon Sep 17 00:00:00 2001
From: aizad-deriv <103104395+aizad-deriv@users.noreply.github.com>
Date: Thu, 5 Jan 2023 10:17:36 +0800
Subject: [PATCH 01/84] chore: updated push-woosh (#7297)
* chore: updated push woosh
* fix: commit suggestion
* fix: rearrange babel
---
packages/core/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/core/package.json b/packages/core/package.json
index 863f13609fb7..f30d1448f5dc 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -133,6 +133,6 @@
"react-tiny-popover": "^5.1.0",
"react-transition-group": "4.4.2",
"react-window": "^1.8.5",
- "web-push-notifications": "^3.24.0"
+ "web-push-notifications": "^3.33.0"
}
}
From 469a0a94dcf08f3195423c6cd87d2c4a55fc3ddb Mon Sep 17 00:00:00 2001
From: Muhammad Hamza <120543468+hamza-deriv@users.noreply.github.com>
Date: Thu, 5 Jan 2023 10:40:14 +0800
Subject: [PATCH 02/84] fix: added the missing dependency incase of first
render after signnup (#7292)
---
packages/trader/src/App/Containers/trade-header-extensions.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/trader/src/App/Containers/trade-header-extensions.jsx b/packages/trader/src/App/Containers/trade-header-extensions.jsx
index eb114e642cf9..023c69f1bd6f 100644
--- a/packages/trader/src/App/Containers/trade-header-extensions.jsx
+++ b/packages/trader/src/App/Containers/trade-header-extensions.jsx
@@ -28,7 +28,7 @@ const TradeHeaderExtensions = ({
);
populateHeaderExtensions(header_items);
- }, [populateHeaderExtensions, store, show_positions_toggle]);
+ }, [populateHeaderExtensions, store, show_positions_toggle, is_populating_account_list]);
React.useEffect(() => {
const waitForLogin = async () => {
From 1abb7debf6a5a6ad12700e48e621bffbbf3372d1 Mon Sep 17 00:00:00 2001
From: Sandeep Rajput <90243468+sandeep-deriv@users.noreply.github.com>
Date: Fri, 6 Jan 2023 14:05:43 +0800
Subject: [PATCH 03/84] =?UTF-8?q?fix:=20dbot=20performance=20issue=20--=20?=
=?UTF-8?q?unified=20websocket=20connection=20and=20moved=E2=80=A6=20(#710?=
=?UTF-8?q?3)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: dbot performance issue -- unified websocket connection and moved apis to app initialization
* fix: improved the api_base class added fallback and account change logics
* fix: removed clientid logic from dbot app
* fix: added mobx reaction to handle accountid change
* fix: moved the initialization of the websocket after app initializes
* fix: fixed pip_sizes in api_base made the names consistent
* fix: code improvisation -- worked on the suggested changes
* chore: fixed toggle button conditionals and base class name
* fix: hoist self-exclusion checks on initialization
* fix: prevent from subscribing multiple time to ticks_history with same symbol
* fix: #83948 'This market is closed' repetedly appears even after the bot is stopped
* fix: removed redundunt api subscriptions open_proposal_contract, balance, and proposal
* fix: profit/loss log is getting printed 2 times - unsubscribed when we stop the bot
* fix: added time api request to keep ws alive
---
packages/bot-skeleton/package.json | 2 +
.../bot-skeleton/src/scratch/dbot-store.js | 8 ++
packages/bot-skeleton/src/scratch/dbot.js | 6 +-
.../bot-skeleton/src/services/api/api-base.js | 117 ++++++++++++++++++
.../bot-skeleton/src/services/api/appId.js | 16 +++
.../src/services/api/ticks_service.js | 48 ++++---
.../src/services/tradeEngine/trade/Balance.js | 4 +-
.../tradeEngine/trade/OpenContract.js | 14 ++-
.../services/tradeEngine/trade/Proposal.js | 8 +-
.../services/tradeEngine/trade/Purchase.js | 3 +-
.../src/services/tradeEngine/trade/Sell.js | 7 +-
.../src/services/tradeEngine/trade/index.js | 28 +----
.../services/tradeEngine/utils/cliTools.js | 6 +-
.../src/services/tradeEngine/utils/helpers.js | 18 ++-
.../services/tradeEngine/utils/interpreter.js | 13 +-
.../trade-animation/trade-animation.jsx | 10 ++
.../bot-web-ui/src/stores/run-panel-store.js | 7 +-
17 files changed, 246 insertions(+), 69 deletions(-)
create mode 100644 packages/bot-skeleton/src/services/api/api-base.js
diff --git a/packages/bot-skeleton/package.json b/packages/bot-skeleton/package.json
index 96becac19d3c..b19bf02aea06 100644
--- a/packages/bot-skeleton/package.json
+++ b/packages/bot-skeleton/package.json
@@ -46,6 +46,8 @@
"immutable": "^3.8.2",
"localforage": "^1.9.0",
"lz-string": "^1.4.4",
+ "mobx": "^6.6.1",
+ "mobx-react": "^7.5.1",
"redux": "^4.0.1",
"redux-thunk": "^2.2.0",
"scratch-blocks": "0.1.0-prerelease.20200917235131",
diff --git a/packages/bot-skeleton/src/scratch/dbot-store.js b/packages/bot-skeleton/src/scratch/dbot-store.js
index 1d951ec9ebc2..fb7333342df2 100644
--- a/packages/bot-skeleton/src/scratch/dbot-store.js
+++ b/packages/bot-skeleton/src/scratch/dbot-store.js
@@ -1,3 +1,6 @@
+import { reaction } from 'mobx';
+import { api_base } from '../services/api/api-base';
+
class DBotStoreInterface {
// TODO here we are suppose to define an interface and implement fields of DBotStore.
handleFileChange = () => {
@@ -27,6 +30,11 @@ class DBotStore extends DBotStoreInterface {
this.handleFileChange = store.handleFileChange;
this.startLoading = store.startLoading;
this.endLoading = store.endLoading;
+
+ reaction(
+ () => this.client.loginid,
+ () => api_base.createNewInstance(this.client.loginid)
+ );
}
static setInstance(store) {
diff --git a/packages/bot-skeleton/src/scratch/dbot.js b/packages/bot-skeleton/src/scratch/dbot.js
index adee21e1bab2..434921ebf073 100644
--- a/packages/bot-skeleton/src/scratch/dbot.js
+++ b/packages/bot-skeleton/src/scratch/dbot.js
@@ -10,6 +10,7 @@ import { observer as globalObserver } from '../utils/observer';
import ApiHelpers from '../services/api/api-helpers';
import Interpreter from '../services/tradeEngine/utils/interpreter';
import { setColors } from './hooks/colours';
+import { api_base } from '../services/api/api-base';
class DBot {
constructor() {
@@ -97,7 +98,7 @@ class DBot {
window.dispatchEvent(new Event('resize'));
window.addEventListener('dragover', DBot.handleDragOver);
window.addEventListener('drop', e => DBot.handleDropOver(e, handleFileChange));
-
+ api_base.init();
// disable overflow
el_scratch_div.parentNode.style.overflow = 'hidden';
resolve();
@@ -134,7 +135,7 @@ class DBot {
}
this.interpreter = Interpreter();
-
+ api_base.setIsRunning(true);
this.interpreter.run(code).catch(error => {
globalObserver.emit('Error', error);
this.stopBot();
@@ -226,6 +227,7 @@ class DBot {
* that trade will be completed first to reflect correct contract status in UI.
*/
stopBot() {
+ api_base.setIsRunning(false);
if (this.interpreter) {
this.interpreter.stop();
}
diff --git a/packages/bot-skeleton/src/services/api/api-base.js b/packages/bot-skeleton/src/services/api/api-base.js
new file mode 100644
index 000000000000..ef12632d5a58
--- /dev/null
+++ b/packages/bot-skeleton/src/services/api/api-base.js
@@ -0,0 +1,117 @@
+import { observer as globalObserver } from '../../utils/observer';
+import { generateDerivApiInstance, getLoginId, getToken } from './appId';
+
+class APIBase {
+ api;
+ token;
+ account_id;
+ pip_sizes = {};
+ account_info = {};
+ is_running = false;
+ subscriptions = [];
+ time_interval = null;
+
+ init(force_update = false) {
+ if (getLoginId()) {
+ this.toggleRunButton(true);
+ if (force_update && this.api) this.api.disconnect();
+ this.api = generateDerivApiInstance();
+ this.initEventListeners();
+ this.authorizeAndSubscribe();
+ if (this.time_interval) clearInterval(this.time_interval);
+ this.time_interval = null;
+ this.getTime();
+ }
+ }
+
+ initEventListeners() {
+ if (window) {
+ window.addEventListener('online', this.reconnectIfNotConnected);
+ window.addEventListener('focus', this.reconnectIfNotConnected);
+ }
+ }
+
+ createNewInstance(account_id) {
+ if (this.account_id !== account_id) {
+ this.init(true);
+ }
+ }
+
+ reconnectIfNotConnected = () => {
+ // eslint-disable-next-line no-console
+ console.log('connection state: ', this.api.connection.readyState);
+ if (this.api.connection.readyState !== 1) {
+ // eslint-disable-next-line no-console
+ console.log('Info: Connection to the server was closed, trying to reconnect.');
+ this.init();
+ }
+ };
+
+ authorizeAndSubscribe() {
+ const { token, account_id } = getToken();
+ if (token) {
+ this.token = token;
+ this.account_id = account_id;
+ this.getActiveSymbols();
+ this.api
+ .authorize(this.token)
+ .then(({ authorize }) => {
+ this.subscribe();
+ this.account_info = authorize;
+ })
+ .catch(e => {
+ globalObserver.emit('Error', e);
+ });
+ }
+ }
+
+ subscribe() {
+ this.api.send({ balance: 1, subscribe: 1 }).catch(e => {
+ globalObserver.emit('Error', e);
+ });
+ this.api.send({ transaction: 1, subscribe: 1 }).catch(e => {
+ globalObserver.emit('Error', e);
+ });
+ }
+
+ getActiveSymbols = async () => {
+ const { active_symbols = [] } = await this.api.send({ active_symbols: 'brief' }).catch(e => {
+ globalObserver.emit('Error', e);
+ });
+ const pip_sizes = {};
+ active_symbols.forEach(({ symbol, pip }) => {
+ pip_sizes[symbol] = +(+pip).toExponential().substring(3);
+ });
+ this.pip_sizes = pip_sizes;
+ this.toggleRunButton(false);
+ };
+
+ toggleRunButton = toggle => {
+ const run_button = document.querySelector('#db-animation__run-button');
+ if (!run_button) return;
+ run_button.disabled = toggle;
+ };
+
+ setIsRunning(toggle = false) {
+ this.is_running = toggle;
+ }
+
+ pushSubscription(subscription) {
+ this.subscriptions.push(subscription);
+ }
+
+ clearSubscriptions() {
+ this.subscriptions.forEach(s => s.unsubscribe());
+ this.subscriptions = [];
+ }
+
+ getTime() {
+ if (!this.time_interval) {
+ this.time_interval = setInterval(() => {
+ this.api.send({ time: 1 });
+ }, 30000);
+ }
+ }
+}
+
+export const api_base = new APIBase();
diff --git a/packages/bot-skeleton/src/services/api/appId.js b/packages/bot-skeleton/src/services/api/appId.js
index ed7417a9d34d..e56a9931fbea 100644
--- a/packages/bot-skeleton/src/services/api/appId.js
+++ b/packages/bot-skeleton/src/services/api/appId.js
@@ -10,3 +10,19 @@ export const generateDerivApiInstance = () => {
});
return deriv_api;
};
+
+export const getLoginId = () => {
+ const login_id = localStorage.getItem('active_loginid');
+ if (login_id && login_id !== 'null') return login_id;
+ return null;
+};
+
+export const getToken = () => {
+ const active_loginid = getLoginId();
+ const client_accounts = JSON.parse(localStorage.getItem('client.accounts')) || undefined;
+ const active_account = (client_accounts && client_accounts[active_loginid]) || {};
+ return {
+ token: active_account?.token || undefined,
+ account_id: active_loginid || undefined,
+ };
+};
diff --git a/packages/bot-skeleton/src/services/api/ticks_service.js b/packages/bot-skeleton/src/services/api/ticks_service.js
index 2eaf3e8a50ce..3ca6c3e687bc 100644
--- a/packages/bot-skeleton/src/services/api/ticks_service.js
+++ b/packages/bot-skeleton/src/services/api/ticks_service.js
@@ -2,6 +2,7 @@ import { Map } from 'immutable';
import { historyToTicks, getLast } from 'binary-utils';
import { doUntilDone, getUUID } from '../tradeEngine/utils/helpers';
import { observer as globalObserver } from '../../utils/observer';
+import { api_base } from './api-base';
const parseTick = tick => ({
epoch: +tick.epoch,
@@ -39,8 +40,7 @@ const updateCandles = (candles, ohlc) => {
const getType = isCandle => (isCandle ? 'candles' : 'ticks');
export default class TicksService {
- constructor(api) {
- this.api = api;
+ constructor() {
this.ticks = new Map();
this.candles = new Map();
this.tickListeners = new Map();
@@ -60,23 +60,13 @@ export default class TicksService {
if (!this.active_symbols_promise) {
this.active_symbols_promise = new Promise(resolve => {
- this.getActiveSymbols().then(active_symbols => {
- this.pipSizes = active_symbols
- .reduce((s, i) => s.set(i.symbol, +(+i.pip).toExponential().substring(3)), new Map())
- .toObject();
- resolve(this.pipSizes);
- });
+ this.pipSizes = api_base.pip_sizes;
+ resolve(this.pipSizes);
});
}
return this.active_symbols_promise;
}
- getActiveSymbols = async () => {
- await this.api.expectResponse('authorize');
- const active_symbols = await this.api.send({ active_symbols: 'brief' });
- return active_symbols.active_symbols;
- };
-
request(options) {
const { symbol, granularity } = options;
@@ -89,7 +79,6 @@ export default class TicksService {
if (style === 'candles' && this.candles.hasIn([symbol, Number(granularity)])) {
return Promise.resolve(this.candles.getIn([symbol, Number(granularity)]));
}
-
return this.requestStream({ ...options, style });
}
@@ -163,7 +152,7 @@ export default class TicksService {
...(tickSubscription || []),
];
- Promise.all(subscription.map(id => doUntilDone(() => this.api.forget(id))));
+ Promise.all(subscription.map(id => doUntilDone(() => api_base.api.forget(id))));
this.subscriptions = new Map();
}
@@ -195,7 +184,7 @@ export default class TicksService {
}
observe() {
- this.api.onMessage().subscribe(({ data }) => {
+ api_base.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'tick') {
const { tick } = data;
const { symbol, id } = tick;
@@ -260,7 +249,7 @@ export default class TicksService {
style,
};
return new Promise((resolve, reject) => {
- doUntilDone(() => this.api.send(request_object))
+ doUntilDone(() => api_base.api.send(request_object), [], api_base)
.then(r => {
if (style === 'ticks') {
const ticks = historyToTicks(r.history);
@@ -278,4 +267,27 @@ export default class TicksService {
.catch(reject);
});
}
+
+ forget = subscription_id => {
+ if (subscription_id) {
+ api_base.api.forget(subscription_id);
+ }
+ };
+
+ unsubscribeFromTicksService() {
+ if (this.ticks_history_promise) {
+ const { stringified_options } = this.ticks_history_promise;
+ const { symbol = '' } = JSON.parse(stringified_options);
+ if (symbol) {
+ this.forget(this.subscriptions.getIn(['tick', symbol]));
+ }
+ }
+ if (this.candles_promise) {
+ const { stringified_options } = this.candles_promise;
+ const { symbol = '' } = JSON.parse(stringified_options);
+ if (symbol) {
+ this.forget(this.subscriptions.getIn(['candle', symbol]));
+ }
+ }
+ }
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
index 19f3aad85318..03a01578c671 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
@@ -1,13 +1,14 @@
import { getFormattedText } from '@deriv/shared';
import { info } from '../utils/broadcast';
import DBotStore from '../../../scratch/dbot-store';
+import { api_base } from '../../api/api-base';
let balance_string = '';
export default Engine =>
class Balance extends Engine {
observeBalance() {
- this.api.onMessage().subscribe(({ data }) => {
+ const subscription = api_base.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'balance') {
const {
balance: { balance: b, currency },
@@ -18,6 +19,7 @@ export default Engine =>
info({ accountID: this.accountInfo.loginid, balance: balance_string });
}
});
+ api_base.pushSubscription(subscription);
}
// eslint-disable-next-line class-methods-use-this
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
index 52c610a5f0a0..6b007c29e7f6 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
@@ -3,11 +3,12 @@ import { sell, openContractReceived } from './state/actions';
import { contractStatus, contract as broadcastContract } from '../utils/broadcast';
import { doUntilDone } from '../utils/helpers';
import DBotStore from '../../../scratch/dbot-store';
+import { api_base } from '../../api/api-base';
export default Engine =>
class OpenContract extends Engine {
observeOpenContract() {
- this.api.onMessage().subscribe(({ data }) => {
+ const subscription = api_base.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'proposal_open_contract') {
const contract = data.proposal_open_contract;
@@ -41,6 +42,7 @@ export default Engine =>
}
}
});
+ api_base.pushSubscription(subscription);
}
waitForAfter() {
@@ -51,7 +53,13 @@ export default Engine =>
subscribeToOpenContract(contract_id = this.contractId) {
this.contractId = contract_id;
- doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 }))
+ const request_object = {
+ proposal_open_contract: 1,
+ contract_id,
+ subscribe: 1,
+ };
+
+ doUntilDone(() => api_base.api.send(request_object))
.then(data => {
const { populateConfig } = DBotStore.instance;
populateConfig(data.proposal_open_contract);
@@ -59,7 +67,7 @@ export default Engine =>
})
.catch(error => {
if (error.error.code !== 'AlreadySubscribed') {
- doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 })).then(
+ doUntilDone(() => api_base.api.send(request_object)).then(
response => (this.openContractId = response.proposal_open_contract.id)
);
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
index 17e7914b298a..515d40b9421a 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
@@ -1,6 +1,7 @@
import { localize } from '@deriv/translations';
import { proposalsReady, clearProposals } from './state/actions';
import { tradeOptionToProposal, doUntilDone } from '../utils/helpers';
+import { api_base } from '../../api/api-base';
export default Engine =>
class Proposal extends Engine {
@@ -69,7 +70,7 @@ export default Engine =>
Promise.all(
this.proposal_templates.map(proposal => {
- doUntilDone(() => this.api.send(proposal)).catch(error => {
+ doUntilDone(() => api_base.api.send(proposal)).catch(error => {
// We intercept ContractBuyValidationError as user may have specified
// e.g. a DIGITUNDER 0 or DIGITOVER 9, while one proposal may be invalid
// the other is valid. We will error on Purchase rather than here.
@@ -94,7 +95,7 @@ export default Engine =>
}
observeProposals() {
- this.api.onMessage().subscribe(response => {
+ const subscription = api_base.api.onMessage().subscribe(response => {
if (response.data.msg_type === 'proposal') {
const { passthrough, proposal } = response.data;
if (
@@ -108,6 +109,7 @@ export default Engine =>
}
}
});
+ api_base.pushSubscription(subscription);
}
unsubscribeProposals() {
@@ -128,7 +130,7 @@ export default Engine =>
return Promise.resolve();
}
- return doUntilDone(() => this.api.forget(proposal.id)).then(() => {
+ return doUntilDone(() => api_base.api.forget(proposal.id)).then(() => {
removeForgetProposalById(proposal.id);
});
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
index 800c54201f93..cd3730f840eb 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
@@ -3,6 +3,7 @@ import { BEFORE_PURCHASE } from './state/constants';
import { contractStatus, info, log } from '../utils/broadcast';
import { getUUID, recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
+import { api_base } from '../../api/api-base';
let delayIndex = 0;
let purchase_reference;
@@ -41,7 +42,7 @@ export default Engine =>
buy_price: buy.buy_price,
});
};
- const action = () => this.api.send({ buy: id, price: askPrice });
+ const action = () => api_base.api.send({ buy: id, price: askPrice });
this.isSold = false;
contractStatus({
id: 'contract.purchase_sent',
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
index 203cb9d6bdee..d2dc6bb7a3dc 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
@@ -3,6 +3,7 @@ import { contractStatus, log } from '../utils/broadcast';
import { recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
+import { api_base } from '../../api/api-base';
export default Engine =>
class Sell extends Engine {
@@ -42,9 +43,9 @@ export default Engine =>
const contract_id = this.contractId;
const sellContractAndGetContractInfo = () => {
- return doUntilDone(() => this.api.send({ sell: contract_id, price: 0 }))
+ return doUntilDone(() => api_base.api.send({ sell: contract_id, price: 0 }))
.then(sell_response => {
- doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id })).then(
+ doUntilDone(() => api_base.api.send({ proposal_open_contract: 1, contract_id })).then(
() => sell_response
);
})
@@ -70,7 +71,7 @@ export default Engine =>
// For every other error, check whether the contract is not actually already sold.
return doUntilDone(() =>
- this.api.send({
+ api_base.api.send({
proposal_open_contract: 1,
contract_id,
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
index 145bfcf67219..a165ea37f8dc 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
@@ -15,6 +15,7 @@ import { doUntilDone } from '../utils/helpers';
import { expectInitArg } from '../utils/sanitize';
import { createError } from '../../../utils/error';
import { observer as globalObserver } from '../../../utils/observer';
+import { api_base } from '../../api/api-base';
const watchBefore = store =>
watchScope({
@@ -64,7 +65,6 @@ const watchScope = ({ store, stopScope, passScope, passFlag }) => {
export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Proposal(Ticks(Total(class {}))))))) {
constructor($scope) {
super();
- this.api = $scope.api;
this.observer = $scope.observer;
this.$scope = $scope;
this.observe();
@@ -106,17 +106,13 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
if (this.token === token) {
return Promise.resolve();
}
-
- doUntilDone(() => this.api.authorize(token)).catch(e => {
- this.$scope.observer.emit('Error', e);
- });
return new Promise(resolve => {
// Try to recover from a situation where API doesn't give us a correct response on
// "proposal_open_contract" which would make the bot run forever. When there's a "sell"
// event, wait a couple seconds for the API to give us the correct "proposal_open_contract"
// response, if there's none after x seconds. Send an explicit request, which _should_
// solve the issue. This is a backup!
- this.api.onMessage().subscribe(({ data }) => {
+ api_base.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'transaction' && data.transaction.action === 'sell') {
this.transaction_recovery_timeout = setTimeout(() => {
const { contract } = this.data;
@@ -124,26 +120,14 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
const is_open_contract = contract.status === 'open';
if (is_same_contract && is_open_contract) {
doUntilDone(() => {
- this.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
+ api_base.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
}, ['PriceMoved']);
}
}, 1500);
}
- if (data.msg_type === 'authorize') {
- this.accountInfo = data;
- this.token = token;
-
- // Only subscribe to balance in browser, not for tests.
- if (document) {
- doUntilDone(() => this.api.send({ balance: 1, subscribe: 1 })).then(r => {
- this.balance = Number(r.balance.balance);
- resolve();
- });
- } else {
- resolve();
- }
- doUntilDone(() => this.api.send({ transaction: 1, subscribe: 1 }));
- }
+ this.accountInfo = api_base.account_info;
+ this.token = api_base.token;
+ resolve();
});
});
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
index bac5c53d459d..63cb063a7dc2 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
@@ -1,11 +1,9 @@
import TicksService from '../../api/ticks_service';
import Observer from '../../../utils/observer';
-import { generateDerivApiInstance } from '../../api/appId';
export const createScope = () => {
const observer = new Observer();
- const api = generateDerivApiInstance();
- const ticksService = new TicksService(api);
+ const ticksService = new TicksService();
const stopped = false;
- return { observer, api, ticksService, stopped };
+ return { observer, ticksService, stopped };
};
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
index ecb02e769017..8a996f9ec836 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
@@ -130,13 +130,17 @@ export const shouldThrowError = (error, errors_to_ignore = []) => {
return !is_ignorable_error;
};
-export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index) => {
+export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index, api_base) => {
return new Promise((resolve, reject) => {
const promise = promiseFn();
if (promise) {
promise.then(resolve).catch(error => {
- if (shouldThrowError(error, errors_to_ignore)) {
+ /**
+ * if bot is not running there is no point of recovering from error
+ * `!api_base.is_running` will check the bot status if it is not running it will kick out the control from loop
+ */
+ if (shouldThrowError(error, errors_to_ignore) || (api_base && !api_base.is_running)) {
reject(error);
return;
}
@@ -172,7 +176,13 @@ export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_i
});
};
-export const doUntilDone = (promiseFn, errors_to_ignore) => {
+/**
+ * @param {*} promiseFn api call - it could be api call or subscription
+ * @param {*} errors_to_ignore list of errors to ignore
+ * @param {*} api_base instance of APIBase class to check if the bot is running or not
+ * @returns a new promise
+ */
+export const doUntilDone = (promiseFn, errors_to_ignore, api_base) => {
let delay_index = 1;
return new Promise((resolve, reject) => {
@@ -182,7 +192,7 @@ export const doUntilDone = (promiseFn, errors_to_ignore) => {
};
const repeatFn = () => {
- recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index).then(resolve).catch(reject);
+ recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index, api_base).then(resolve).catch(reject);
};
repeatFn();
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
index d43cb67f01d0..788d172dbe39 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
@@ -4,6 +4,7 @@ import { createScope } from './cliTools';
import Interface from '../Interface';
import { unrecoverable_errors } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
+import { api_base } from '../../api/api-base';
JSInterpreter.prototype.takeStateSnapshot = function () {
const newStateStack = cloneThorough(this.stateStack, undefined, undefined, undefined, true);
@@ -180,16 +181,14 @@ const Interpreter = () => {
}
function terminateSession() {
- const { connection } = $scope.api;
- if (connection.readyState === 0) {
- connection.addEventListener('open', () => connection.close());
- } else if (connection.readyState === 1) {
- connection.close();
- }
-
$scope.stopped = true;
$scope.is_error_triggered = false;
globalObserver.emit('bot.stop');
+ const { ticksService } = $scope;
+ // Unsubscribe previous ticks_history subscription
+ ticksService.unsubscribeFromTicksService();
+ // Unsubscribe the subscriptions from Proposal, Balance and OpenContract
+ api_base.clearSubscriptions();
}
function run(code) {
diff --git a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
index 738ed174987a..de40ff31ad8c 100644
--- a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
+++ b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
@@ -85,9 +85,16 @@ const TradeAnimation = ({
info_direction,
toggleAnimationInfoModal,
cashier_validation,
+ performSelfExclusionCheck,
}) => {
const [is_button_disabled, updateIsButtonDisabled] = React.useState(false);
const is_unavailable_for_payment_agent = cashier_validation?.includes('WithdrawServiceUnavailableForPA');
+
+ // perform self-exclusion checks which will be stored under the self-exclusion-store
+ React.useEffect(() => {
+ performSelfExclusionCheck();
+ }, []);
+
React.useEffect(() => {
if (is_button_disabled) {
setTimeout(() => {
@@ -95,6 +102,7 @@ const TradeAnimation = ({
}, 1000);
}
}, [is_button_disabled]);
+
const status_classes = ['', '', ''];
let progress_status =
contract_stage -
@@ -174,6 +182,7 @@ TradeAnimation.propTypes = {
is_stop_button_disabled: PropTypes.bool,
onRunButtonClick: PropTypes.func,
onStopButtonClick: PropTypes.func,
+ performSelfExclusionCheck: PropTypes.func,
profit: PropTypes.number,
should_show_overlay: PropTypes.bool,
};
@@ -187,6 +196,7 @@ export default connect(({ summary_card, run_panel, toolbar, ui, client }) => ({
is_stop_button_disabled: run_panel.is_stop_button_disabled,
onRunButtonClick: run_panel.onRunButtonClick,
onStopButtonClick: run_panel.onStopButtonClick,
+ performSelfExclusionCheck: run_panel.performSelfExclusionCheck,
profit: summary_card.profit,
should_show_overlay: run_panel.should_show_overlay,
toggleAnimationInfoModal: toolbar.toggleAnimationInfoModal,
diff --git a/packages/bot-web-ui/src/stores/run-panel-store.js b/packages/bot-web-ui/src/stores/run-panel-store.js
index c0144b8e494a..c35b2390467e 100644
--- a/packages/bot-web-ui/src/stores/run-panel-store.js
+++ b/packages/bot-web-ui/src/stores/run-panel-store.js
@@ -32,6 +32,7 @@ export default class RunPanelStore {
toggleDrawer: action.bound,
setActiveTabIndex: action.bound,
onCloseDialog: action.bound,
+ performSelfExclusionCheck: action.bound,
showStopMultiplierContractDialog: action.bound,
showLoginDialog: action.bound,
showRealAccountDialog: action.bound,
@@ -130,6 +131,11 @@ export default class RunPanelStore {
);
}
+ async performSelfExclusionCheck() {
+ const { self_exclusion } = this.root_store;
+ await self_exclusion.checkRestriction();
+ }
+
async onRunButtonClick() {
const { core, summary_card, route_prompt_dialog, self_exclusion } = this.root_store;
const { client, ui } = core;
@@ -148,7 +154,6 @@ export default class RunPanelStore {
*/
if (is_ios || isSafari()) this.preloadAudio();
- await self_exclusion.checkRestriction();
if (!self_exclusion.should_bot_run) {
self_exclusion.setIsRestricted(true);
return;
From 37266a2e0317f5d03b8d1dddd943030cf4c17e6d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Fri, 6 Jan 2023 14:29:02 +0800
Subject: [PATCH 04/84] =?UTF-8?q?translations:=20=F0=9F=93=9A=20sync=20tra?=
=?UTF-8?q?nslations=20with=20crowdin=20(#7316)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com>
---
packages/p2p/src/translations/fr.json | 4 +-
packages/p2p/src/translations/id.json | 4 +-
.../translations/src/translations/it.json | 52 +++++++++----------
.../translations/src/translations/ru.json | 16 +++---
.../translations/src/translations/th.json | 6 +--
5 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/packages/p2p/src/translations/fr.json b/packages/p2p/src/translations/fr.json
index e4022ee5e8ce..377fe2a81fef 100644
--- a/packages/p2p/src/translations/fr.json
+++ b/packages/p2p/src/translations/fr.json
@@ -2,7 +2,7 @@
"6794664": "Annonces qui correspondent à votre solde et à votre limite P2P Deriv.",
"19789721": "Personne ne t'a bloqué. Ouaii !",
"21103557": "Solde P2P dérivé = dépôts qui ne peuvent pas être annulés (virements bancaires, etc.) + une partie des dépôts qui peuvent être annulés (paiements par carte de crédit, etc.)",
- "24711354": "Total des commandes <0>30j0> | <1>à vie1>",
+ "24711354": "Total des ordres <0>30j0> | <1>tous1>",
"47573834": "Taux fixe (1 {{account_currency}})",
"50672601": "Acheté",
"51881712": "Vous avez déjà une annonce avec le même taux de change pour cette paire de devises et ce type d'ordre.
Veuillez définir un taux différent pour votre annonce.",
@@ -307,7 +307,7 @@
"-2059312414": "Détails de l'annonce",
"-1769584466": "Statistiques",
"-2090878601": "Limite journalière",
- "-130547447": "Volume des trades <0>30d0> | <1>à vie1>",
+ "-130547447": "Volume des trades <0>30d0> | <1>tous1>",
"-1792280476": "Choisissez votre mode de paiement",
"-293182503": "Annuler l'ajout de ce mode de paiement ?",
"-1850127397": "Si vous choisissez d'annuler, les données que vous avez saisies seront perdues.",
diff --git a/packages/p2p/src/translations/id.json b/packages/p2p/src/translations/id.json
index 647a3c20d4a8..fadb811baa60 100644
--- a/packages/p2p/src/translations/id.json
+++ b/packages/p2p/src/translations/id.json
@@ -2,7 +2,7 @@
"6794664": "Iklan yang sesuai dengan saldo dan batas P2P Deriv Anda.",
"19789721": "Tidak ada yang memblokir Anda. Yay!",
"21103557": "Saldo Deriv P2P = deposit yang tidak dapat dibatalkan (melalui tranfer bank, dsb) + sejumlah deposit yang mungkin dapat dibatalkan (melalui kartu kredit, dsb)",
- "24711354": "Total order <0>30hari0> | <1>seumur hidup1>",
+ "24711354": "Total order <0>30hari0> | <1>semua1>",
"47573834": "Harga tetap (1 {{account_currency}})",
"50672601": "Membeli",
"51881712": "Anda sudah membuat iklan dengan nilai tukar yang sama untuk pasangan mata uang dan jenis order.
Mohon pilih nilai tukar lain untuk iklan Anda.",
@@ -307,7 +307,7 @@
"-2059312414": "Detail iklan",
"-1769584466": "Statistik",
"-2090878601": "Batas harian",
- "-130547447": "Volume transaksi <0>30 hari0> | <1>seumur hidup1>",
+ "-130547447": "Transaksi <0>30 hari0> | <1>semua1>",
"-1792280476": "Pilih metode pembayaran Anda",
"-293182503": "Batalkan penambahan metode pembayaran ini?",
"-1850127397": "Jika Anda memilih untuk membatalkan, detail yang Anda masukkan akan hilang.",
diff --git a/packages/translations/src/translations/it.json b/packages/translations/src/translations/it.json
index b3d410f48790..4b387ac0744b 100644
--- a/packages/translations/src/translations/it.json
+++ b/packages/translations/src/translations/it.json
@@ -245,7 +245,7 @@
"327534692": "Il valore di durata non è consentito. Per avviare il bot, inserire {{min}}.",
"328539132": "Ripete le istruzioni ad esso relative per un numero specifico di volte",
"329404045": "<0>Passa al conto reale0><1> per creare un conto {{account_title}} {{platform}}.1>",
- "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida per l'utente2>.",
+ "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida utente2>.",
"333456603": "Limiti per i prelievi",
"334680754": "Passa al tuo conto reale per creare un conto Deriv MT5",
"334942497": "Tempo di acquista",
@@ -517,7 +517,7 @@
"665089217": "Invia <0>il documenti di verifica dell'identità0> per autenticare il tuo conto e accedere alla cassa.",
"665777772": "XLM/USD",
"665872465": "Nell'esempio sottostante, è stato selezionato il prezzo di apertura, che viene poi assegnato a una variabile chiamata \"op\".",
- "666724936": "Inserisci un numero di ID valido.",
+ "666724936": "Inserisci un numero ID valido.",
"668344562": "Sintetici, FX maggiori (lotti standard/micro), FX minori, panieri di indici, materie prime e criptovalute",
"672008428": "ZEC/USD",
"673915530": "Giurisdizione e scelta delle legge applicabile",
@@ -710,7 +710,7 @@
"918447723": "Reale",
"920125517": "Aggiungi conto demo",
"921901739": "- i dati del conto bancario collegato al tuo conto",
- "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o i dettagli del conto.",
+ "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o le informazioni del conto.",
"926813068": "Fisso/variabile",
"929608744": "Non puoi effettuare prelievi",
"930346117": "Le lettere maiuscole non sono di grande aiuto",
@@ -778,7 +778,7 @@
"1006664890": "Silenzioso",
"1009032439": "Sempre",
"1010198306": "Questo blocco crea una lista con stringhe e numeri.",
- "1010337648": "Non siamo stati in grado di verificare la tua prova di proprietà.",
+ "1010337648": "Non siamo stati in grado di verificare il documento a verifica della proprietà.",
"1012102263": "Non potrai accedere al tuo conto fino a questa data (massimo 6 settimane da oggi).",
"1015201500": "Stabilisci le opzioni di trading come durata e puntata.",
"1016220824": "Devi passare a un conto reale per usare questa opzione. <0/>Per farlo, seleziona un conto reale da <1>Cambia conto.1>",
@@ -855,7 +855,7 @@
"1086118495": "Hub per i trader",
"1088138125": "Tick {{current_tick}} - ",
"1089085289": "Numero di telefono",
- "1096078516": "Analizzeremo i documenti e ti aggiorneremo sullo stato entro 3 giorni.",
+ "1096078516": "Verificheremo i documenti e ti aggiorneremo sullo stato della procedura entro 3 giorni.",
"1096175323": "Occorre un conto Deriv",
"1098147569": "Acquistare materie prime o azioni di una società.",
"1098622295": "\"i\" inizia con il valore 1, e aumenta di 2 a ogni interazione. La ripetizione si ripete fino a quando \"i\" raggiunge il valore di 12, dopodiché termina.",
@@ -972,7 +972,7 @@
"1232353969": "0-5 operazioni negli ultimi 12 mesi",
"1233300532": "Payout",
"1234292259": "Fonte di ricchezza",
- "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione dei dettagli personali.",
+ "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
"1235426525": "50%",
"1237330017": "Pensionato",
"1238311538": "Amministratore",
@@ -1234,7 +1234,7 @@
"1540585098": "Rifiuta",
"1541969455": "Entrambi",
"1544642951": "Selezionando \"Solo ascendente\", ottieni il payout se tick consecutivi superano successivamente il punto di entrata. Non ottieni alcun payout se qualsiasi tick è minore o uguale a uno dei tick precedenti.",
- "1547148381": "Il file è troppo grande (sono consentiti solo fino a 8MB). Carica un altro file.",
+ "1547148381": "Le dimensioni del file sono troppo grandi (consentiti solo fino a 8MB). Carica un altro file.",
"1548765374": "La verifica del numero di documento non è andata a buon fine",
"1549098835": "Totale prelievo",
"1551172020": "Paniere AUD",
@@ -1332,7 +1332,7 @@
"1675030608": "Per creare questo conto, abbiamo bisogno prima che tu invii nuovamente la prova dell'indirizzo.",
"1677027187": "Forex",
"1677990284": "Le mie app",
- "1680666439": "Carica lo estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
+ "1680666439": "Carica l'estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
"1682409128": "Strategia senza nome",
"1682636566": "Invia di nuovo e-mail a",
"1683963454": "Il contratto verrà chiuso automaticamente al successivo prezzo disponibile dell'asset il {{date}} alle {{timestamp}}.",
@@ -1367,7 +1367,7 @@
"1723398114": "Una recente bolletta delle utenze (ad es. elettricità, acqua, gas, telefono o internet)",
"1723589564": "Rappresenta il numero massimo di contratti in essere nel tuo portafoglio. Ogni riga presente sul tuo portafoglio vale una posizione aperta. Una volta raggiunto il valore massimo, non potrai aprire nuove posizioni senza prima chiudere una posizione esistente.",
"1724696797": "È possibile avere un solo conto fiat.",
- "1725958461": "Numero di conto",
+ "1725958461": "Numero del conto",
"1726472773": "Funzione che non restituisce un valore",
"1726565314": "Chiudi il conto",
"1727681395": "Totale asset attivi nei conti demo Deriv e {{platform_name_mt5}}.",
@@ -1433,7 +1433,7 @@
"1791971912": "Recente",
"1793913365": "Per depositare denaro, passa al conto {{currency_symbol}}.",
"1794815502": "Scarica la cronologia delle tue operazioni.",
- "1796787905": "Carica il/i documento/i seguente/i.",
+ "1796787905": "Carica il/i seguente/i documento/i.",
"1798943788": "Puoi solo effettuare depositi.",
"1801093206": "Ottieni l'elenco candele",
"1801927731": "Conti {{platform_name_dxtrade}}",
@@ -1610,7 +1610,7 @@
"1988153223": "Indirizzo e-mail",
"1988302483": "Take profit:",
"1988601220": "Valore della durata",
- "1990331072": "Prova di proprietà",
+ "1990331072": "Documento a verifica della proprietà",
"1990735316": "Aumento pari a",
"1991448657": "Non conosci il tuo numero di identificazione fiscale? Clicca <0>qui0> per saperne di più.",
"1991524207": "Indice Jump 100",
@@ -1656,7 +1656,7 @@
"2037665157": "Espandi tutti i blocchi",
"2037906477": "ottieni sotto elenco da #",
"2042050260": "- Prezzo d'acquisto: il prezzo d'acquisto (puntata) del contratto",
- "2042115724": "Carica uno screenshot del tuo conto e della pagina dei dettagli personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
+ "2042115724": "Carica uno screenshot del tuo conto e della pagina delle informazioni personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
"2042778835": "La presente politica sui reclami potrebbe cambiare nel tempo, e si applica ai conti registrati con {{legal_entity_name}}.",
"2044086432": "Quello di chiusura è l'ultimo tick entro l'orario di termine. Se selezioni un orario di termine preciso, quest'ultimo sarà l'orario selezionato.",
"2046273837": "Ultimo tick",
@@ -1702,7 +1702,7 @@
"2096456845": "Data di nascita*",
"2097170986": "Tether (Omni)",
"2097381850": "Calcola la linea della Media mobile semplice da un elenco con un periodo",
- "2097932389": "Carica 2 schermate separate dalla pagina dei dettagli personali e dalla pagina del conto tramite <0>https://app.astropay.com/profile0>",
+ "2097932389": "Carica 2 schermate separate dalla pagina delle informazioni personali e dalla pagina del conto tramite la pagina <0>https://app.astropay.com/profile0>",
"2100713124": "conto",
"2101972779": "Utilizzando un elenco di tick, ripropone l'esempio precedente.",
"2102572780": "Il codice deve comprendere 6 caratteri.",
@@ -1821,7 +1821,7 @@
"-922751756": "Meno di un anno",
"-542986255": "Nessuna",
"-1337206552": "Secondo le tue conoscenze, il trading con i CFD ti consente di",
- "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nulla.",
+ "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nullo.",
"-1314683258": "Effettuare un investimento a lungo termine per un profitto garantito.",
"-1546090184": "Come influisce la leva sul trading di CFD?",
"-1636427115": "La leva finanziaria ti aiuta a mitigare il rischio.",
@@ -1939,13 +1939,13 @@
"-1030759620": "Funzionari governativi",
"-1196936955": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
"-1286823855": "Carica l'estratto conto della bolletta del cellulare con il tuo nome e numero di telefono.",
- "-1309548471": "Carica il tuo estratto conto bancario con il tuo nome e i dettagli del conto.",
- "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
- "-3805155": "Carica uno screenshot di uno dei seguenti elementi per elaborare la transazione:",
+ "-1309548471": "Carica l'estratto conto bancario con il tuo nome e le informazioni del conto.",
+ "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e le ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
+ "-3805155": "Carica uno screenshot di una delle seguenti informazioni per elaborare la transazione:",
"-1523487566": "- la sezione del profilo del tuo conto sul sito web",
"-613062596": "- la pagina delle informazioni sul conto sull'app",
"-1718304498": "ID utente",
- "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione dei dettagli personali dell'app o della sezione del profilo del tuo conto sul sito web.",
+ "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione delle informazioni personali dell'app o della sezione del profilo del tuo conto sul sito web.",
"-1954436643": "Carica uno screenshot del tuo nome utente nella pagina delle informazioni generali all'<0>indirizzo https://onlinenaira.com/members/index.htm0>",
"-79853954": "Carica uno screenshot del tuo numero di conto e del numero di telefono nella pagina del conto bancario/portafoglio mobile all'<0>indirizzo https://onlinenaira.com/members/bank.htm0>",
"-1192882870": "Carica uno screenshot del tuo nome e del tuo numero di conto dalla sezione dei dettagli personali.",
@@ -2039,10 +2039,10 @@
"-1725454783": "Non riuscito",
"-839094775": "Indietro",
"-856213726": "Dovrai inoltre consegnare un documento di verifica dell'identità.",
- "-987011273": "La tua prova di proprietà non è richiesta.",
- "-808299796": "Al momento non è necessario presentare una prova di proprietà. Ti informeremo se in futuro sarà richiesta una prova della proprietà.",
- "-179726573": "Abbiamo ricevuto la tua prova di proprietà.",
- "-813779897": "La verifica della proprietà è stata superata.",
+ "-987011273": "Il documento a verifica della proprietà non è richiesto.",
+ "-808299796": "Al momento non è necessario presentare un documento a verifica della proprietà. Ti informeremo se in futuro sarà richiesto.",
+ "-179726573": "Abbiamo ricevuto il tuo documento a verifica della proprietà.",
+ "-813779897": "La verifica della proprietà è andata a buon fine.",
"-1389323399": "Devi inserire {{min_number}}-{{max_number}} caratteri.",
"-1313806160": "Richiedi una nuova password e controlla di aver ricevuto un'e-mail con il nuovo token.",
"-329713179": "Ok",
@@ -2377,7 +2377,7 @@
"-451858550": "Facendo click su \"Continua\" verrai reindirizzato a {{ service }}, un fornitore di servizi di pagamento esterno. {{ website_name }} declina qualsiasi responsabilità per i contenuti o i servizi forniti da {{ service }}. Se riscontri problemi relativi ai servizi di {{ service }}, contatta direttamente {{ service }}.",
"-2005265642": "Fiat onramp è un servizio di cassa che permette di convertire valute fiat in criptovalute per ricaricare i conti per criptovalute di Deriv. Qui sono elencati gli scambi di criptovalute di parti terze; è necessario creare un conto apposito per utilizzare i loro servizi.",
"-1593063457": "Seleziona strumento di pagamento",
- "-953082600": "Alcuni metodi di pagamento potrebbero non essere elencati qui, ma gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per verificare ulteriormente.",
+ "-953082600": "Alcuni metodi di pagamento possono non essere elencati qui, anche se gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per ulteriori verifiche.",
"-2004264970": "L'indirizzo di portafoglio deve comprendere dai 25 ai 64 caratteri.",
"-1707299138": "L'indirizzo di portafoglio {{currency_symbol}}",
"-38063175": "Portafoglio in {{account_text}}",
@@ -2767,8 +2767,8 @@
"-1719731099": "Grazie all'autenticazione a due fattori, il conto è protetto sia dalla password che dal telefono: in questo modo solo tu puoi accedere al conto anche se qualcuno conosce la password.",
"-2087822170": "Sei offline",
"-1669693571": "Verifica la tua connessione.",
- "-1706642239": "<1>È richiesta1> <0>una prova di proprietà0>",
- "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica la prova di3> <4>proprietà per sbloccare il tuo conto.4> <5>5>",
+ "-1706642239": "<1>È richiesto1> <0>un documento a verifica della proprietà0>",
+ "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica il documento a verifica della3> <4>proprietà per sbloccarlo.4> <5>5>",
"-1834929362": "Carica il documento",
"-1043638404": "<0>Verifica della proprietà0> <1>non riuscita1>",
"-1766760306": "<0>0><1>Carica il documento1> <2>con i dati corretti.<3>3>2>",
@@ -2955,7 +2955,7 @@
"-1300381594": "Ottieni gli strumenti di trading Acuity",
"-860609405": "Password",
"-742647506": "Trasferisci fondi",
- "-1972393174": "Fai trading con CFD sui nostri sintetici, sui panieri e sugli FX derivati.",
+ "-1972393174": "Fai trading con CFD sui nostri sintetici, panieri e sugli FX derivati.",
"-1357917360": "Terminale web",
"-1454896285": "L'app per Desktop di MT5 non è supportata da Windows XP, Windows 2003 e Windows Vista.",
"-810388996": "Scarica l'app mobile Deriv X",
diff --git a/packages/translations/src/translations/ru.json b/packages/translations/src/translations/ru.json
index 49d90352585e..6d0d7f372f9c 100644
--- a/packages/translations/src/translations/ru.json
+++ b/packages/translations/src/translations/ru.json
@@ -566,7 +566,7 @@
"724203548": "Вы можете отправить жалобу на платформу <0>онлайн-урегулирования споров (ODR) Европейской Комиссии0>. Это не относится к клиентам из Великобритании.",
"728042840": "Чтобы продолжить торговать у нас, пожалуйста, подтвердите свое место жительства.",
"728824018": "Испанский индекс",
- "729651741": "Выберите фотографию",
+ "729651741": "Выберите фото",
"730473724": "Этот блок выполняет логическую операцию «И» или «ИЛИ» с заданными значениями.",
"731382582": "BNB/USD",
"734390964": "Недостаточно средств на счете",
@@ -709,7 +709,7 @@
"915735109": "Вернуться на {{platform_name}}",
"918447723": "Реальный",
"920125517": "Добавить демо-счет",
- "921901739": "- данные вашего банковского счета, привязанного к вашему счету",
+ "921901739": "- данные банковского счета, привязанного к вашему счету",
"924046954": "Загрузите документ с вашим именем и номером банковского счета или реквизитами счета.",
"926813068": "Фиксированный/переменный",
"929608744": "Вы не можете выводить средства",
@@ -855,7 +855,7 @@
"1086118495": "Центр трейдера",
"1088138125": "Тик {{current_tick}} - ",
"1089085289": "Номер мобильного телефона",
- "1096078516": "Мы рассмотрим ваши документы и уведомим вас о их статусе в течение 3 дней.",
+ "1096078516": "Мы рассмотрим ваши документы и уведомим вас об их статусе в течение 3 дней.",
"1096175323": "Вам понадобится счет Deriv",
"1098147569": "Приобретайте товары или акции компании.",
"1098622295": "«i» начинается со значения 1 и увеличивается на 2 в каждом повторении. Цикл будет повторяться до тех пор, пока «i» не достигнет значения 12, и затем цикл будет прерван.",
@@ -946,7 +946,7 @@
"1201773643": "числовой",
"1203297580": "Этот блок отправляет сообщение в Telegram-канал.",
"1204223111": "В этом примере цены открытия из списка свечей присваиваются переменной с именем \"candle_list\".",
- "1206227936": "Как замаскировать карту?",
+ "1206227936": "Как скрыть карту?",
"1206821331": "Вооруженные силы",
"1208729868": "Тики",
"1208903663": "Неверный ключ",
@@ -1192,7 +1192,7 @@
"1481977420": "Помогите нам верифицировать ваш запрос на вывод средств.",
"1484336612": "Этот блок используется для завершения или продолжения цикла и может быть размещен в любом месте блока цикла.",
"1487086154": "Ваши документы успешно отправлены",
- "1488548367": "Загрузите снова",
+ "1488548367": "Загрузить снова",
"1490583127": "DBot пока не готов к использованию на реальных счетах",
"1491392301": "<0>Продано за0>: {{sold_for}}",
"1492686447": "Ваш счет MT5 Финансовый STP будет открыт в Deriv (FX) Ltd. Все операции на этом счете регулируются правилами и руководящими принципами Управления финансовых услуг Лабуана (LFSA). Правила и принципы Управления финансовых услуг Лабуана (LFSA) не распространяются ни на один из ваших других счетов, включая счет Deriv.",
@@ -1234,7 +1234,7 @@
"1540585098": "Отклонить",
"1541969455": "Оба",
"1544642951": "Выбрав \"Только вверх\", вы получите выплату, если несколько тиков подряд будут расти по отношению к котировке на входе. Если любой тик покажет снижение или будет равен одному из предыдущих тиков, вы не получите выплату.",
- "1547148381": "Этот файл слишком велик (разрешено не более 8 МБ). Пожалуйста, загрузите еще один файл.",
+ "1547148381": "Файл слишком большой (разрешено не более 8 МБ). Попробуйте другой файл.",
"1548765374": "Не удалось верифицировать номер документа",
"1549098835": "Общая сумма вывода",
"1551172020": "Индекс AUD",
@@ -1433,7 +1433,7 @@
"1791971912": "Недавние",
"1793913365": "Чтобы внести средства, перейдите на свой счет {{currency_symbol}}.",
"1794815502": "Загрузить историю транзакций.",
- "1796787905": "Пожалуйста, загрузите следующие документы.",
+ "1796787905": "Загрузите следующие документы.",
"1798943788": "Вы можете делать только депозиты.",
"1801093206": "Получить список свечей",
"1801927731": "счета {{platform_name_dxtrade}}",
@@ -1944,7 +1944,7 @@
"-3805155": "Загрузите скриншот одного из следующих изображений для обработки транзакции:",
"-1523487566": "- раздел профиля вашей учетной записи на сайте",
"-613062596": "- страница «Информация об учетной записи» в приложении",
- "-1718304498": "Идентификатор пользователя",
+ "-1718304498": "ID пользователя",
"-609424336": "Загрузите скриншот своего имени, номера счета и адреса электронной почты из раздела личных данных приложения или раздела профиля своей учетной записи на веб-сайте.",
"-1954436643": "Загрузите скриншот своего имени пользователя на странице «Общая информация» по адресу <0>https://onlinenaira.com/members/index.htm0>",
"-79853954": "Загрузите скриншот номера своего счета и номера телефона на странице «Банковский счет/мобильный кошелек» по адресу <0>https://onlinenaira.com/members/bank.htm0>",
diff --git a/packages/translations/src/translations/th.json b/packages/translations/src/translations/th.json
index b2fb527430ee..c30b93cfd7fe 100644
--- a/packages/translations/src/translations/th.json
+++ b/packages/translations/src/translations/th.json
@@ -589,7 +589,7 @@
"759783233": "สําหรับข้อมูลเพิ่มเติมและความช่วยเหลือให้คําปรึกษาและบริการสนับสนุนต่าง โปรดไปที่ <0>begambleaware.org0>",
"760528514": "โปรดทราบว่า การเปลี่ยนค่าของ \"i\" จะไม่เปลี่ยนแปลงค่าของรายการตัวต้นฉบับในลิสต์",
"761576760": "ฝากเงินเข้าบัญชีของคุณเพื่อเริ่มทำการซื้อขาย",
- "762185380": "<0>ได้ผลตอบแทนเพิ่มทวีคูณ 0> โดย <0>เสี่ยงเพียงเฉพาะ0> สิ่งที่คุณวางเดิมพัน",
+ "762185380": "<0>เพิ่มทวีผลที่ได้รับ 0> โดย <0>มีความเสี่ยงเพียงเฉพาะ0> ทุนทรัพย์ที่คุณลงไป",
"762871622": "{{remaining_time}}วินาที",
"763019867": "บัญชีเกมของคุณมีกำหนดที่จะถูกปิด",
"764366329": "วงเงินในการซื้อขาย",
@@ -2888,7 +2888,7 @@
"-895091803": "หากคุณกำลังมองหาสัญญาการซื้อขายส่วนต่าง",
"-1447215751": "ไม่แน่ใจ? ลองนี่สิ",
"-2338797": "<0>เพิ่มผลตอบแทนสูงสุด 0> โดย <0>เสี่ยงมากกว่า0> สิ่งที่คุณวางเดิมพัน",
- "-1682067341": "รับ <0>ผลตอบแทนอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> สิ่งที่คุณวางเดิมพัน",
+ "-1682067341": "รับ <0>ผลที่ได้รับในอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> ทุนทรัพย์ที่คุณลงไป",
"-1744351732": "ไม่แน่ใจว่าจะเริ่มต้นที่ไหน?",
"-943710774": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ First Floor, Millennium House, Victoria Road, Douglas, Isle of Man, IM2 4RW บริษัทนี้ได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย (1) Gambling Supervision Commission ในเกาะไอล์ออฟแมน (ปัจจุบัน <0>ใบอนุญาต0> ออกเมื่อวันที่ 31 สิงหาคม ค. ศ. 2017) และ (2) Gambling Commission ในสหราชอาณาจักร (<1>ใบอนุญาตเลขที่ 391721>)",
"-255056078": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ Level 3, Triq Dun Karm, Birkirkara, BKR 9033 ประเทศมอลตา บริษัทได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย Malta Gaming Authority ในประเทศมอลตาสำหรับผลิตภัณฑ์การพนันเท่านั้น <0>ใบอนุญาตเลขที่ MGA/B2C/102/20000> และสำหรับลูกค้าที่อาศัยอยู่ในสหราชอาณาจักรโดย UK Gambling Commission (เลขที่บัญชี 39495)",
@@ -3216,7 +3216,7 @@
"-313112159": "บล็อกนี้จะคล้ายกับบล็อกด้านบน แต่ต่างกันที่ว่าบล๊อกนี้จะส่งคืนค่ามาอันหนึ่ง โดยค่าที่ส่งคืนนั้นสามารถถูกกำหนดให้กับตัวแปรที่คุณเลือกได้",
"-1783320173": "คืนค่าภายในฟังก์ชันก่อนกําหนด",
"-1485521724": "การส่งคืนตามเงื่อนไข",
- "-1482801393": "ผลตอบแทน",
+ "-1482801393": "ผลที่ได้รับ",
"-46453136": "ได้รับ",
"-1838027177": "อย่างแรก",
"-1182568049": "รับรายการในลิสต์",
From b134c888eecbda9424540bc05509837821d5089f Mon Sep 17 00:00:00 2001
From: Sandeep Rajput <90243468+sandeep-deriv@users.noreply.github.com>
Date: Sat, 7 Jan 2023 23:55:26 +0800
Subject: [PATCH 05/84] fix: summary panel flickering (#7321)
---
packages/bot-skeleton/src/scratch/dbot.js | 4 ++++
packages/bot-skeleton/src/services/api/api-base.js | 8 +++++++-
packages/bot-web-ui/src/stores/app-store.js | 2 +-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/packages/bot-skeleton/src/scratch/dbot.js b/packages/bot-skeleton/src/scratch/dbot.js
index 434921ebf073..4df1e4afb380 100644
--- a/packages/bot-skeleton/src/scratch/dbot.js
+++ b/packages/bot-skeleton/src/scratch/dbot.js
@@ -243,6 +243,10 @@ class DBot {
}
}
+ terminateConnection = () => {
+ api_base.terminate();
+ };
+
/**
* Unselects any selected block before running the bot.
*/
diff --git a/packages/bot-skeleton/src/services/api/api-base.js b/packages/bot-skeleton/src/services/api/api-base.js
index ef12632d5a58..5fa052992ced 100644
--- a/packages/bot-skeleton/src/services/api/api-base.js
+++ b/packages/bot-skeleton/src/services/api/api-base.js
@@ -14,7 +14,7 @@ class APIBase {
init(force_update = false) {
if (getLoginId()) {
this.toggleRunButton(true);
- if (force_update && this.api) this.api.disconnect();
+ if (force_update) this.terminate();
this.api = generateDerivApiInstance();
this.initEventListeners();
this.authorizeAndSubscribe();
@@ -24,6 +24,12 @@ class APIBase {
}
}
+ terminate() {
+ // eslint-disable-next-line no-console
+ console.log('connection terminated');
+ if (this.api) this.api.disconnect();
+ }
+
initEventListeners() {
if (window) {
window.addEventListener('online', this.reconnectIfNotConnected);
diff --git a/packages/bot-web-ui/src/stores/app-store.js b/packages/bot-web-ui/src/stores/app-store.js
index 2088fa4b7da7..862140f7d1e5 100644
--- a/packages/bot-web-ui/src/stores/app-store.js
+++ b/packages/bot-web-ui/src/stores/app-store.js
@@ -39,7 +39,7 @@ export default class AppStore {
onUnmount() {
DBot.terminateBot();
-
+ DBot.terminateConnection();
if (Blockly.derivWorkspace) {
clearInterval(Blockly.derivWorkspace.save_workspace_interval);
Blockly.derivWorkspace.dispose();
From cd56d9621c8d8b3f778a862c0c48595e03d741c5 Mon Sep 17 00:00:00 2001
From: Muhammad Hamza <120543468+hamza-deriv@users.noreply.github.com>
Date: Mon, 9 Jan 2023 09:49:01 +0800
Subject: [PATCH 06/84] fix: Spacing between lines in 2FA page (#7275)
---
.../TwoFactorAuthentication/two-factor-authentication.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/account/src/Sections/Security/TwoFactorAuthentication/two-factor-authentication.jsx b/packages/account/src/Sections/Security/TwoFactorAuthentication/two-factor-authentication.jsx
index e178b40218a9..c7f4510d7ca9 100644
--- a/packages/account/src/Sections/Security/TwoFactorAuthentication/two-factor-authentication.jsx
+++ b/packages/account/src/Sections/Security/TwoFactorAuthentication/two-factor-authentication.jsx
@@ -112,7 +112,7 @@ const TwoFactorAuthentication = ({
{localize('How to set up 2FA for your Deriv account')}
-
+ <0/>
- Download the Acuity suite and take advantage of the <1>Macroeconomic Calendar, Market Alerts, Research Terminal,1> and <1>Signal Centre Trade Ideas1> without leaving your MT5 terminal.<0/><0/>
- This suite is only available for Windows, and is most recommended for financial assets.`}
- components={[ , ]}
+ i18n_default_text="We've partnered with Acuity to give you a suite of intuitive trading tools for MT5 so you can keep track of market events and trends, free of charge!<0/><0/>"
+ components={[ ]}
/>
+ , ]}
+ />
+
-
+
+
+
+ ,
- ,
Date: Mon, 9 Jan 2023 18:09:45 +0800
Subject: [PATCH 08/84] Revert "fix: summary panel flickering (#7321)"
This reverts commit b134c888eecbda9424540bc05509837821d5089f.
---
packages/bot-skeleton/src/scratch/dbot.js | 4 ----
packages/bot-skeleton/src/services/api/api-base.js | 8 +-------
packages/bot-web-ui/src/stores/app-store.js | 2 +-
3 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/packages/bot-skeleton/src/scratch/dbot.js b/packages/bot-skeleton/src/scratch/dbot.js
index 4df1e4afb380..434921ebf073 100644
--- a/packages/bot-skeleton/src/scratch/dbot.js
+++ b/packages/bot-skeleton/src/scratch/dbot.js
@@ -243,10 +243,6 @@ class DBot {
}
}
- terminateConnection = () => {
- api_base.terminate();
- };
-
/**
* Unselects any selected block before running the bot.
*/
diff --git a/packages/bot-skeleton/src/services/api/api-base.js b/packages/bot-skeleton/src/services/api/api-base.js
index 5fa052992ced..ef12632d5a58 100644
--- a/packages/bot-skeleton/src/services/api/api-base.js
+++ b/packages/bot-skeleton/src/services/api/api-base.js
@@ -14,7 +14,7 @@ class APIBase {
init(force_update = false) {
if (getLoginId()) {
this.toggleRunButton(true);
- if (force_update) this.terminate();
+ if (force_update && this.api) this.api.disconnect();
this.api = generateDerivApiInstance();
this.initEventListeners();
this.authorizeAndSubscribe();
@@ -24,12 +24,6 @@ class APIBase {
}
}
- terminate() {
- // eslint-disable-next-line no-console
- console.log('connection terminated');
- if (this.api) this.api.disconnect();
- }
-
initEventListeners() {
if (window) {
window.addEventListener('online', this.reconnectIfNotConnected);
diff --git a/packages/bot-web-ui/src/stores/app-store.js b/packages/bot-web-ui/src/stores/app-store.js
index 862140f7d1e5..2088fa4b7da7 100644
--- a/packages/bot-web-ui/src/stores/app-store.js
+++ b/packages/bot-web-ui/src/stores/app-store.js
@@ -39,7 +39,7 @@ export default class AppStore {
onUnmount() {
DBot.terminateBot();
- DBot.terminateConnection();
+
if (Blockly.derivWorkspace) {
clearInterval(Blockly.derivWorkspace.save_workspace_interval);
Blockly.derivWorkspace.dispose();
From 289d0fe144e51c4f3cf7ebdf15d1669c2ab27ac4 Mon Sep 17 00:00:00 2001
From: Carol Sachdeva
Date: Mon, 9 Jan 2023 18:09:55 +0800
Subject: [PATCH 09/84] =?UTF-8?q?Revert=20"translations:=20=F0=9F=93=9A=20?=
=?UTF-8?q?sync=20translations=20with=20crowdin=20(#7316)"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 37266a2e0317f5d03b8d1dddd943030cf4c17e6d.
---
packages/p2p/src/translations/fr.json | 4 +-
packages/p2p/src/translations/id.json | 4 +-
.../translations/src/translations/it.json | 52 +++++++++----------
.../translations/src/translations/ru.json | 16 +++---
.../translations/src/translations/th.json | 6 +--
5 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/packages/p2p/src/translations/fr.json b/packages/p2p/src/translations/fr.json
index 377fe2a81fef..e4022ee5e8ce 100644
--- a/packages/p2p/src/translations/fr.json
+++ b/packages/p2p/src/translations/fr.json
@@ -2,7 +2,7 @@
"6794664": "Annonces qui correspondent à votre solde et à votre limite P2P Deriv.",
"19789721": "Personne ne t'a bloqué. Ouaii !",
"21103557": "Solde P2P dérivé = dépôts qui ne peuvent pas être annulés (virements bancaires, etc.) + une partie des dépôts qui peuvent être annulés (paiements par carte de crédit, etc.)",
- "24711354": "Total des ordres <0>30j0> | <1>tous1>",
+ "24711354": "Total des commandes <0>30j0> | <1>à vie1>",
"47573834": "Taux fixe (1 {{account_currency}})",
"50672601": "Acheté",
"51881712": "Vous avez déjà une annonce avec le même taux de change pour cette paire de devises et ce type d'ordre.
Veuillez définir un taux différent pour votre annonce.",
@@ -307,7 +307,7 @@
"-2059312414": "Détails de l'annonce",
"-1769584466": "Statistiques",
"-2090878601": "Limite journalière",
- "-130547447": "Volume des trades <0>30d0> | <1>tous1>",
+ "-130547447": "Volume des trades <0>30d0> | <1>à vie1>",
"-1792280476": "Choisissez votre mode de paiement",
"-293182503": "Annuler l'ajout de ce mode de paiement ?",
"-1850127397": "Si vous choisissez d'annuler, les données que vous avez saisies seront perdues.",
diff --git a/packages/p2p/src/translations/id.json b/packages/p2p/src/translations/id.json
index fadb811baa60..647a3c20d4a8 100644
--- a/packages/p2p/src/translations/id.json
+++ b/packages/p2p/src/translations/id.json
@@ -2,7 +2,7 @@
"6794664": "Iklan yang sesuai dengan saldo dan batas P2P Deriv Anda.",
"19789721": "Tidak ada yang memblokir Anda. Yay!",
"21103557": "Saldo Deriv P2P = deposit yang tidak dapat dibatalkan (melalui tranfer bank, dsb) + sejumlah deposit yang mungkin dapat dibatalkan (melalui kartu kredit, dsb)",
- "24711354": "Total order <0>30hari0> | <1>semua1>",
+ "24711354": "Total order <0>30hari0> | <1>seumur hidup1>",
"47573834": "Harga tetap (1 {{account_currency}})",
"50672601": "Membeli",
"51881712": "Anda sudah membuat iklan dengan nilai tukar yang sama untuk pasangan mata uang dan jenis order.
Mohon pilih nilai tukar lain untuk iklan Anda.",
@@ -307,7 +307,7 @@
"-2059312414": "Detail iklan",
"-1769584466": "Statistik",
"-2090878601": "Batas harian",
- "-130547447": "Transaksi <0>30 hari0> | <1>semua1>",
+ "-130547447": "Volume transaksi <0>30 hari0> | <1>seumur hidup1>",
"-1792280476": "Pilih metode pembayaran Anda",
"-293182503": "Batalkan penambahan metode pembayaran ini?",
"-1850127397": "Jika Anda memilih untuk membatalkan, detail yang Anda masukkan akan hilang.",
diff --git a/packages/translations/src/translations/it.json b/packages/translations/src/translations/it.json
index 4b387ac0744b..b3d410f48790 100644
--- a/packages/translations/src/translations/it.json
+++ b/packages/translations/src/translations/it.json
@@ -245,7 +245,7 @@
"327534692": "Il valore di durata non è consentito. Per avviare il bot, inserire {{min}}.",
"328539132": "Ripete le istruzioni ad esso relative per un numero specifico di volte",
"329404045": "<0>Passa al conto reale0><1> per creare un conto {{account_title}} {{platform}}.1>",
- "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida utente2>.",
+ "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida per l'utente2>.",
"333456603": "Limiti per i prelievi",
"334680754": "Passa al tuo conto reale per creare un conto Deriv MT5",
"334942497": "Tempo di acquista",
@@ -517,7 +517,7 @@
"665089217": "Invia <0>il documenti di verifica dell'identità0> per autenticare il tuo conto e accedere alla cassa.",
"665777772": "XLM/USD",
"665872465": "Nell'esempio sottostante, è stato selezionato il prezzo di apertura, che viene poi assegnato a una variabile chiamata \"op\".",
- "666724936": "Inserisci un numero ID valido.",
+ "666724936": "Inserisci un numero di ID valido.",
"668344562": "Sintetici, FX maggiori (lotti standard/micro), FX minori, panieri di indici, materie prime e criptovalute",
"672008428": "ZEC/USD",
"673915530": "Giurisdizione e scelta delle legge applicabile",
@@ -710,7 +710,7 @@
"918447723": "Reale",
"920125517": "Aggiungi conto demo",
"921901739": "- i dati del conto bancario collegato al tuo conto",
- "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o le informazioni del conto.",
+ "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o i dettagli del conto.",
"926813068": "Fisso/variabile",
"929608744": "Non puoi effettuare prelievi",
"930346117": "Le lettere maiuscole non sono di grande aiuto",
@@ -778,7 +778,7 @@
"1006664890": "Silenzioso",
"1009032439": "Sempre",
"1010198306": "Questo blocco crea una lista con stringhe e numeri.",
- "1010337648": "Non siamo stati in grado di verificare il documento a verifica della proprietà.",
+ "1010337648": "Non siamo stati in grado di verificare la tua prova di proprietà.",
"1012102263": "Non potrai accedere al tuo conto fino a questa data (massimo 6 settimane da oggi).",
"1015201500": "Stabilisci le opzioni di trading come durata e puntata.",
"1016220824": "Devi passare a un conto reale per usare questa opzione. <0/>Per farlo, seleziona un conto reale da <1>Cambia conto.1>",
@@ -855,7 +855,7 @@
"1086118495": "Hub per i trader",
"1088138125": "Tick {{current_tick}} - ",
"1089085289": "Numero di telefono",
- "1096078516": "Verificheremo i documenti e ti aggiorneremo sullo stato della procedura entro 3 giorni.",
+ "1096078516": "Analizzeremo i documenti e ti aggiorneremo sullo stato entro 3 giorni.",
"1096175323": "Occorre un conto Deriv",
"1098147569": "Acquistare materie prime o azioni di una società.",
"1098622295": "\"i\" inizia con il valore 1, e aumenta di 2 a ogni interazione. La ripetizione si ripete fino a quando \"i\" raggiunge il valore di 12, dopodiché termina.",
@@ -972,7 +972,7 @@
"1232353969": "0-5 operazioni negli ultimi 12 mesi",
"1233300532": "Payout",
"1234292259": "Fonte di ricchezza",
- "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
+ "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione dei dettagli personali.",
"1235426525": "50%",
"1237330017": "Pensionato",
"1238311538": "Amministratore",
@@ -1234,7 +1234,7 @@
"1540585098": "Rifiuta",
"1541969455": "Entrambi",
"1544642951": "Selezionando \"Solo ascendente\", ottieni il payout se tick consecutivi superano successivamente il punto di entrata. Non ottieni alcun payout se qualsiasi tick è minore o uguale a uno dei tick precedenti.",
- "1547148381": "Le dimensioni del file sono troppo grandi (consentiti solo fino a 8MB). Carica un altro file.",
+ "1547148381": "Il file è troppo grande (sono consentiti solo fino a 8MB). Carica un altro file.",
"1548765374": "La verifica del numero di documento non è andata a buon fine",
"1549098835": "Totale prelievo",
"1551172020": "Paniere AUD",
@@ -1332,7 +1332,7 @@
"1675030608": "Per creare questo conto, abbiamo bisogno prima che tu invii nuovamente la prova dell'indirizzo.",
"1677027187": "Forex",
"1677990284": "Le mie app",
- "1680666439": "Carica l'estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
+ "1680666439": "Carica lo estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
"1682409128": "Strategia senza nome",
"1682636566": "Invia di nuovo e-mail a",
"1683963454": "Il contratto verrà chiuso automaticamente al successivo prezzo disponibile dell'asset il {{date}} alle {{timestamp}}.",
@@ -1367,7 +1367,7 @@
"1723398114": "Una recente bolletta delle utenze (ad es. elettricità, acqua, gas, telefono o internet)",
"1723589564": "Rappresenta il numero massimo di contratti in essere nel tuo portafoglio. Ogni riga presente sul tuo portafoglio vale una posizione aperta. Una volta raggiunto il valore massimo, non potrai aprire nuove posizioni senza prima chiudere una posizione esistente.",
"1724696797": "È possibile avere un solo conto fiat.",
- "1725958461": "Numero del conto",
+ "1725958461": "Numero di conto",
"1726472773": "Funzione che non restituisce un valore",
"1726565314": "Chiudi il conto",
"1727681395": "Totale asset attivi nei conti demo Deriv e {{platform_name_mt5}}.",
@@ -1433,7 +1433,7 @@
"1791971912": "Recente",
"1793913365": "Per depositare denaro, passa al conto {{currency_symbol}}.",
"1794815502": "Scarica la cronologia delle tue operazioni.",
- "1796787905": "Carica il/i seguente/i documento/i.",
+ "1796787905": "Carica il/i documento/i seguente/i.",
"1798943788": "Puoi solo effettuare depositi.",
"1801093206": "Ottieni l'elenco candele",
"1801927731": "Conti {{platform_name_dxtrade}}",
@@ -1610,7 +1610,7 @@
"1988153223": "Indirizzo e-mail",
"1988302483": "Take profit:",
"1988601220": "Valore della durata",
- "1990331072": "Documento a verifica della proprietà",
+ "1990331072": "Prova di proprietà",
"1990735316": "Aumento pari a",
"1991448657": "Non conosci il tuo numero di identificazione fiscale? Clicca <0>qui0> per saperne di più.",
"1991524207": "Indice Jump 100",
@@ -1656,7 +1656,7 @@
"2037665157": "Espandi tutti i blocchi",
"2037906477": "ottieni sotto elenco da #",
"2042050260": "- Prezzo d'acquisto: il prezzo d'acquisto (puntata) del contratto",
- "2042115724": "Carica uno screenshot del tuo conto e della pagina delle informazioni personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
+ "2042115724": "Carica uno screenshot del tuo conto e della pagina dei dettagli personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
"2042778835": "La presente politica sui reclami potrebbe cambiare nel tempo, e si applica ai conti registrati con {{legal_entity_name}}.",
"2044086432": "Quello di chiusura è l'ultimo tick entro l'orario di termine. Se selezioni un orario di termine preciso, quest'ultimo sarà l'orario selezionato.",
"2046273837": "Ultimo tick",
@@ -1702,7 +1702,7 @@
"2096456845": "Data di nascita*",
"2097170986": "Tether (Omni)",
"2097381850": "Calcola la linea della Media mobile semplice da un elenco con un periodo",
- "2097932389": "Carica 2 schermate separate dalla pagina delle informazioni personali e dalla pagina del conto tramite la pagina <0>https://app.astropay.com/profile0>",
+ "2097932389": "Carica 2 schermate separate dalla pagina dei dettagli personali e dalla pagina del conto tramite <0>https://app.astropay.com/profile0>",
"2100713124": "conto",
"2101972779": "Utilizzando un elenco di tick, ripropone l'esempio precedente.",
"2102572780": "Il codice deve comprendere 6 caratteri.",
@@ -1821,7 +1821,7 @@
"-922751756": "Meno di un anno",
"-542986255": "Nessuna",
"-1337206552": "Secondo le tue conoscenze, il trading con i CFD ti consente di",
- "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nullo.",
+ "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nulla.",
"-1314683258": "Effettuare un investimento a lungo termine per un profitto garantito.",
"-1546090184": "Come influisce la leva sul trading di CFD?",
"-1636427115": "La leva finanziaria ti aiuta a mitigare il rischio.",
@@ -1939,13 +1939,13 @@
"-1030759620": "Funzionari governativi",
"-1196936955": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
"-1286823855": "Carica l'estratto conto della bolletta del cellulare con il tuo nome e numero di telefono.",
- "-1309548471": "Carica l'estratto conto bancario con il tuo nome e le informazioni del conto.",
- "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e le ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
- "-3805155": "Carica uno screenshot di una delle seguenti informazioni per elaborare la transazione:",
+ "-1309548471": "Carica il tuo estratto conto bancario con il tuo nome e i dettagli del conto.",
+ "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
+ "-3805155": "Carica uno screenshot di uno dei seguenti elementi per elaborare la transazione:",
"-1523487566": "- la sezione del profilo del tuo conto sul sito web",
"-613062596": "- la pagina delle informazioni sul conto sull'app",
"-1718304498": "ID utente",
- "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione delle informazioni personali dell'app o della sezione del profilo del tuo conto sul sito web.",
+ "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione dei dettagli personali dell'app o della sezione del profilo del tuo conto sul sito web.",
"-1954436643": "Carica uno screenshot del tuo nome utente nella pagina delle informazioni generali all'<0>indirizzo https://onlinenaira.com/members/index.htm0>",
"-79853954": "Carica uno screenshot del tuo numero di conto e del numero di telefono nella pagina del conto bancario/portafoglio mobile all'<0>indirizzo https://onlinenaira.com/members/bank.htm0>",
"-1192882870": "Carica uno screenshot del tuo nome e del tuo numero di conto dalla sezione dei dettagli personali.",
@@ -2039,10 +2039,10 @@
"-1725454783": "Non riuscito",
"-839094775": "Indietro",
"-856213726": "Dovrai inoltre consegnare un documento di verifica dell'identità.",
- "-987011273": "Il documento a verifica della proprietà non è richiesto.",
- "-808299796": "Al momento non è necessario presentare un documento a verifica della proprietà. Ti informeremo se in futuro sarà richiesto.",
- "-179726573": "Abbiamo ricevuto il tuo documento a verifica della proprietà.",
- "-813779897": "La verifica della proprietà è andata a buon fine.",
+ "-987011273": "La tua prova di proprietà non è richiesta.",
+ "-808299796": "Al momento non è necessario presentare una prova di proprietà. Ti informeremo se in futuro sarà richiesta una prova della proprietà.",
+ "-179726573": "Abbiamo ricevuto la tua prova di proprietà.",
+ "-813779897": "La verifica della proprietà è stata superata.",
"-1389323399": "Devi inserire {{min_number}}-{{max_number}} caratteri.",
"-1313806160": "Richiedi una nuova password e controlla di aver ricevuto un'e-mail con il nuovo token.",
"-329713179": "Ok",
@@ -2377,7 +2377,7 @@
"-451858550": "Facendo click su \"Continua\" verrai reindirizzato a {{ service }}, un fornitore di servizi di pagamento esterno. {{ website_name }} declina qualsiasi responsabilità per i contenuti o i servizi forniti da {{ service }}. Se riscontri problemi relativi ai servizi di {{ service }}, contatta direttamente {{ service }}.",
"-2005265642": "Fiat onramp è un servizio di cassa che permette di convertire valute fiat in criptovalute per ricaricare i conti per criptovalute di Deriv. Qui sono elencati gli scambi di criptovalute di parti terze; è necessario creare un conto apposito per utilizzare i loro servizi.",
"-1593063457": "Seleziona strumento di pagamento",
- "-953082600": "Alcuni metodi di pagamento possono non essere elencati qui, anche se gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per ulteriori verifiche.",
+ "-953082600": "Alcuni metodi di pagamento potrebbero non essere elencati qui, ma gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per verificare ulteriormente.",
"-2004264970": "L'indirizzo di portafoglio deve comprendere dai 25 ai 64 caratteri.",
"-1707299138": "L'indirizzo di portafoglio {{currency_symbol}}",
"-38063175": "Portafoglio in {{account_text}}",
@@ -2767,8 +2767,8 @@
"-1719731099": "Grazie all'autenticazione a due fattori, il conto è protetto sia dalla password che dal telefono: in questo modo solo tu puoi accedere al conto anche se qualcuno conosce la password.",
"-2087822170": "Sei offline",
"-1669693571": "Verifica la tua connessione.",
- "-1706642239": "<1>È richiesto1> <0>un documento a verifica della proprietà0>",
- "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica il documento a verifica della3> <4>proprietà per sbloccarlo.4> <5>5>",
+ "-1706642239": "<1>È richiesta1> <0>una prova di proprietà0>",
+ "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica la prova di3> <4>proprietà per sbloccare il tuo conto.4> <5>5>",
"-1834929362": "Carica il documento",
"-1043638404": "<0>Verifica della proprietà0> <1>non riuscita1>",
"-1766760306": "<0>0><1>Carica il documento1> <2>con i dati corretti.<3>3>2>",
@@ -2955,7 +2955,7 @@
"-1300381594": "Ottieni gli strumenti di trading Acuity",
"-860609405": "Password",
"-742647506": "Trasferisci fondi",
- "-1972393174": "Fai trading con CFD sui nostri sintetici, panieri e sugli FX derivati.",
+ "-1972393174": "Fai trading con CFD sui nostri sintetici, sui panieri e sugli FX derivati.",
"-1357917360": "Terminale web",
"-1454896285": "L'app per Desktop di MT5 non è supportata da Windows XP, Windows 2003 e Windows Vista.",
"-810388996": "Scarica l'app mobile Deriv X",
diff --git a/packages/translations/src/translations/ru.json b/packages/translations/src/translations/ru.json
index 6d0d7f372f9c..49d90352585e 100644
--- a/packages/translations/src/translations/ru.json
+++ b/packages/translations/src/translations/ru.json
@@ -566,7 +566,7 @@
"724203548": "Вы можете отправить жалобу на платформу <0>онлайн-урегулирования споров (ODR) Европейской Комиссии0>. Это не относится к клиентам из Великобритании.",
"728042840": "Чтобы продолжить торговать у нас, пожалуйста, подтвердите свое место жительства.",
"728824018": "Испанский индекс",
- "729651741": "Выберите фото",
+ "729651741": "Выберите фотографию",
"730473724": "Этот блок выполняет логическую операцию «И» или «ИЛИ» с заданными значениями.",
"731382582": "BNB/USD",
"734390964": "Недостаточно средств на счете",
@@ -709,7 +709,7 @@
"915735109": "Вернуться на {{platform_name}}",
"918447723": "Реальный",
"920125517": "Добавить демо-счет",
- "921901739": "- данные банковского счета, привязанного к вашему счету",
+ "921901739": "- данные вашего банковского счета, привязанного к вашему счету",
"924046954": "Загрузите документ с вашим именем и номером банковского счета или реквизитами счета.",
"926813068": "Фиксированный/переменный",
"929608744": "Вы не можете выводить средства",
@@ -855,7 +855,7 @@
"1086118495": "Центр трейдера",
"1088138125": "Тик {{current_tick}} - ",
"1089085289": "Номер мобильного телефона",
- "1096078516": "Мы рассмотрим ваши документы и уведомим вас об их статусе в течение 3 дней.",
+ "1096078516": "Мы рассмотрим ваши документы и уведомим вас о их статусе в течение 3 дней.",
"1096175323": "Вам понадобится счет Deriv",
"1098147569": "Приобретайте товары или акции компании.",
"1098622295": "«i» начинается со значения 1 и увеличивается на 2 в каждом повторении. Цикл будет повторяться до тех пор, пока «i» не достигнет значения 12, и затем цикл будет прерван.",
@@ -946,7 +946,7 @@
"1201773643": "числовой",
"1203297580": "Этот блок отправляет сообщение в Telegram-канал.",
"1204223111": "В этом примере цены открытия из списка свечей присваиваются переменной с именем \"candle_list\".",
- "1206227936": "Как скрыть карту?",
+ "1206227936": "Как замаскировать карту?",
"1206821331": "Вооруженные силы",
"1208729868": "Тики",
"1208903663": "Неверный ключ",
@@ -1192,7 +1192,7 @@
"1481977420": "Помогите нам верифицировать ваш запрос на вывод средств.",
"1484336612": "Этот блок используется для завершения или продолжения цикла и может быть размещен в любом месте блока цикла.",
"1487086154": "Ваши документы успешно отправлены",
- "1488548367": "Загрузить снова",
+ "1488548367": "Загрузите снова",
"1490583127": "DBot пока не готов к использованию на реальных счетах",
"1491392301": "<0>Продано за0>: {{sold_for}}",
"1492686447": "Ваш счет MT5 Финансовый STP будет открыт в Deriv (FX) Ltd. Все операции на этом счете регулируются правилами и руководящими принципами Управления финансовых услуг Лабуана (LFSA). Правила и принципы Управления финансовых услуг Лабуана (LFSA) не распространяются ни на один из ваших других счетов, включая счет Deriv.",
@@ -1234,7 +1234,7 @@
"1540585098": "Отклонить",
"1541969455": "Оба",
"1544642951": "Выбрав \"Только вверх\", вы получите выплату, если несколько тиков подряд будут расти по отношению к котировке на входе. Если любой тик покажет снижение или будет равен одному из предыдущих тиков, вы не получите выплату.",
- "1547148381": "Файл слишком большой (разрешено не более 8 МБ). Попробуйте другой файл.",
+ "1547148381": "Этот файл слишком велик (разрешено не более 8 МБ). Пожалуйста, загрузите еще один файл.",
"1548765374": "Не удалось верифицировать номер документа",
"1549098835": "Общая сумма вывода",
"1551172020": "Индекс AUD",
@@ -1433,7 +1433,7 @@
"1791971912": "Недавние",
"1793913365": "Чтобы внести средства, перейдите на свой счет {{currency_symbol}}.",
"1794815502": "Загрузить историю транзакций.",
- "1796787905": "Загрузите следующие документы.",
+ "1796787905": "Пожалуйста, загрузите следующие документы.",
"1798943788": "Вы можете делать только депозиты.",
"1801093206": "Получить список свечей",
"1801927731": "счета {{platform_name_dxtrade}}",
@@ -1944,7 +1944,7 @@
"-3805155": "Загрузите скриншот одного из следующих изображений для обработки транзакции:",
"-1523487566": "- раздел профиля вашей учетной записи на сайте",
"-613062596": "- страница «Информация об учетной записи» в приложении",
- "-1718304498": "ID пользователя",
+ "-1718304498": "Идентификатор пользователя",
"-609424336": "Загрузите скриншот своего имени, номера счета и адреса электронной почты из раздела личных данных приложения или раздела профиля своей учетной записи на веб-сайте.",
"-1954436643": "Загрузите скриншот своего имени пользователя на странице «Общая информация» по адресу <0>https://onlinenaira.com/members/index.htm0>",
"-79853954": "Загрузите скриншот номера своего счета и номера телефона на странице «Банковский счет/мобильный кошелек» по адресу <0>https://onlinenaira.com/members/bank.htm0>",
diff --git a/packages/translations/src/translations/th.json b/packages/translations/src/translations/th.json
index c30b93cfd7fe..b2fb527430ee 100644
--- a/packages/translations/src/translations/th.json
+++ b/packages/translations/src/translations/th.json
@@ -589,7 +589,7 @@
"759783233": "สําหรับข้อมูลเพิ่มเติมและความช่วยเหลือให้คําปรึกษาและบริการสนับสนุนต่าง โปรดไปที่ <0>begambleaware.org0>",
"760528514": "โปรดทราบว่า การเปลี่ยนค่าของ \"i\" จะไม่เปลี่ยนแปลงค่าของรายการตัวต้นฉบับในลิสต์",
"761576760": "ฝากเงินเข้าบัญชีของคุณเพื่อเริ่มทำการซื้อขาย",
- "762185380": "<0>เพิ่มทวีผลที่ได้รับ 0> โดย <0>มีความเสี่ยงเพียงเฉพาะ0> ทุนทรัพย์ที่คุณลงไป",
+ "762185380": "<0>ได้ผลตอบแทนเพิ่มทวีคูณ 0> โดย <0>เสี่ยงเพียงเฉพาะ0> สิ่งที่คุณวางเดิมพัน",
"762871622": "{{remaining_time}}วินาที",
"763019867": "บัญชีเกมของคุณมีกำหนดที่จะถูกปิด",
"764366329": "วงเงินในการซื้อขาย",
@@ -2888,7 +2888,7 @@
"-895091803": "หากคุณกำลังมองหาสัญญาการซื้อขายส่วนต่าง",
"-1447215751": "ไม่แน่ใจ? ลองนี่สิ",
"-2338797": "<0>เพิ่มผลตอบแทนสูงสุด 0> โดย <0>เสี่ยงมากกว่า0> สิ่งที่คุณวางเดิมพัน",
- "-1682067341": "รับ <0>ผลที่ได้รับในอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> ทุนทรัพย์ที่คุณลงไป",
+ "-1682067341": "รับ <0>ผลตอบแทนอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> สิ่งที่คุณวางเดิมพัน",
"-1744351732": "ไม่แน่ใจว่าจะเริ่มต้นที่ไหน?",
"-943710774": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ First Floor, Millennium House, Victoria Road, Douglas, Isle of Man, IM2 4RW บริษัทนี้ได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย (1) Gambling Supervision Commission ในเกาะไอล์ออฟแมน (ปัจจุบัน <0>ใบอนุญาต0> ออกเมื่อวันที่ 31 สิงหาคม ค. ศ. 2017) และ (2) Gambling Commission ในสหราชอาณาจักร (<1>ใบอนุญาตเลขที่ 391721>)",
"-255056078": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ Level 3, Triq Dun Karm, Birkirkara, BKR 9033 ประเทศมอลตา บริษัทได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย Malta Gaming Authority ในประเทศมอลตาสำหรับผลิตภัณฑ์การพนันเท่านั้น <0>ใบอนุญาตเลขที่ MGA/B2C/102/20000> และสำหรับลูกค้าที่อาศัยอยู่ในสหราชอาณาจักรโดย UK Gambling Commission (เลขที่บัญชี 39495)",
@@ -3216,7 +3216,7 @@
"-313112159": "บล็อกนี้จะคล้ายกับบล็อกด้านบน แต่ต่างกันที่ว่าบล๊อกนี้จะส่งคืนค่ามาอันหนึ่ง โดยค่าที่ส่งคืนนั้นสามารถถูกกำหนดให้กับตัวแปรที่คุณเลือกได้",
"-1783320173": "คืนค่าภายในฟังก์ชันก่อนกําหนด",
"-1485521724": "การส่งคืนตามเงื่อนไข",
- "-1482801393": "ผลที่ได้รับ",
+ "-1482801393": "ผลตอบแทน",
"-46453136": "ได้รับ",
"-1838027177": "อย่างแรก",
"-1182568049": "รับรายการในลิสต์",
From 8a647fc7936479511acf0c0ee43e350531140f05 Mon Sep 17 00:00:00 2001
From: Carol Sachdeva
Date: Mon, 9 Jan 2023 18:10:06 +0800
Subject: [PATCH 10/84] =?UTF-8?q?Revert=20"fix:=20dbot=20performance=20iss?=
=?UTF-8?q?ue=20--=20unified=20websocket=20connection=20and=20moved?=
=?UTF-8?q?=E2=80=A6=20(#7103)"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 1abb7debf6a5a6ad12700e48e621bffbbf3372d1.
---
packages/bot-skeleton/package.json | 2 -
.../bot-skeleton/src/scratch/dbot-store.js | 8 --
packages/bot-skeleton/src/scratch/dbot.js | 6 +-
.../bot-skeleton/src/services/api/api-base.js | 117 ------------------
.../bot-skeleton/src/services/api/appId.js | 16 ---
.../src/services/api/ticks_service.js | 48 +++----
.../src/services/tradeEngine/trade/Balance.js | 4 +-
.../tradeEngine/trade/OpenContract.js | 14 +--
.../services/tradeEngine/trade/Proposal.js | 8 +-
.../services/tradeEngine/trade/Purchase.js | 3 +-
.../src/services/tradeEngine/trade/Sell.js | 7 +-
.../src/services/tradeEngine/trade/index.js | 28 ++++-
.../services/tradeEngine/utils/cliTools.js | 6 +-
.../src/services/tradeEngine/utils/helpers.js | 18 +--
.../services/tradeEngine/utils/interpreter.js | 13 +-
.../trade-animation/trade-animation.jsx | 10 --
.../bot-web-ui/src/stores/run-panel-store.js | 7 +-
17 files changed, 69 insertions(+), 246 deletions(-)
delete mode 100644 packages/bot-skeleton/src/services/api/api-base.js
diff --git a/packages/bot-skeleton/package.json b/packages/bot-skeleton/package.json
index b19bf02aea06..96becac19d3c 100644
--- a/packages/bot-skeleton/package.json
+++ b/packages/bot-skeleton/package.json
@@ -46,8 +46,6 @@
"immutable": "^3.8.2",
"localforage": "^1.9.0",
"lz-string": "^1.4.4",
- "mobx": "^6.6.1",
- "mobx-react": "^7.5.1",
"redux": "^4.0.1",
"redux-thunk": "^2.2.0",
"scratch-blocks": "0.1.0-prerelease.20200917235131",
diff --git a/packages/bot-skeleton/src/scratch/dbot-store.js b/packages/bot-skeleton/src/scratch/dbot-store.js
index fb7333342df2..1d951ec9ebc2 100644
--- a/packages/bot-skeleton/src/scratch/dbot-store.js
+++ b/packages/bot-skeleton/src/scratch/dbot-store.js
@@ -1,6 +1,3 @@
-import { reaction } from 'mobx';
-import { api_base } from '../services/api/api-base';
-
class DBotStoreInterface {
// TODO here we are suppose to define an interface and implement fields of DBotStore.
handleFileChange = () => {
@@ -30,11 +27,6 @@ class DBotStore extends DBotStoreInterface {
this.handleFileChange = store.handleFileChange;
this.startLoading = store.startLoading;
this.endLoading = store.endLoading;
-
- reaction(
- () => this.client.loginid,
- () => api_base.createNewInstance(this.client.loginid)
- );
}
static setInstance(store) {
diff --git a/packages/bot-skeleton/src/scratch/dbot.js b/packages/bot-skeleton/src/scratch/dbot.js
index 434921ebf073..adee21e1bab2 100644
--- a/packages/bot-skeleton/src/scratch/dbot.js
+++ b/packages/bot-skeleton/src/scratch/dbot.js
@@ -10,7 +10,6 @@ import { observer as globalObserver } from '../utils/observer';
import ApiHelpers from '../services/api/api-helpers';
import Interpreter from '../services/tradeEngine/utils/interpreter';
import { setColors } from './hooks/colours';
-import { api_base } from '../services/api/api-base';
class DBot {
constructor() {
@@ -98,7 +97,7 @@ class DBot {
window.dispatchEvent(new Event('resize'));
window.addEventListener('dragover', DBot.handleDragOver);
window.addEventListener('drop', e => DBot.handleDropOver(e, handleFileChange));
- api_base.init();
+
// disable overflow
el_scratch_div.parentNode.style.overflow = 'hidden';
resolve();
@@ -135,7 +134,7 @@ class DBot {
}
this.interpreter = Interpreter();
- api_base.setIsRunning(true);
+
this.interpreter.run(code).catch(error => {
globalObserver.emit('Error', error);
this.stopBot();
@@ -227,7 +226,6 @@ class DBot {
* that trade will be completed first to reflect correct contract status in UI.
*/
stopBot() {
- api_base.setIsRunning(false);
if (this.interpreter) {
this.interpreter.stop();
}
diff --git a/packages/bot-skeleton/src/services/api/api-base.js b/packages/bot-skeleton/src/services/api/api-base.js
deleted file mode 100644
index ef12632d5a58..000000000000
--- a/packages/bot-skeleton/src/services/api/api-base.js
+++ /dev/null
@@ -1,117 +0,0 @@
-import { observer as globalObserver } from '../../utils/observer';
-import { generateDerivApiInstance, getLoginId, getToken } from './appId';
-
-class APIBase {
- api;
- token;
- account_id;
- pip_sizes = {};
- account_info = {};
- is_running = false;
- subscriptions = [];
- time_interval = null;
-
- init(force_update = false) {
- if (getLoginId()) {
- this.toggleRunButton(true);
- if (force_update && this.api) this.api.disconnect();
- this.api = generateDerivApiInstance();
- this.initEventListeners();
- this.authorizeAndSubscribe();
- if (this.time_interval) clearInterval(this.time_interval);
- this.time_interval = null;
- this.getTime();
- }
- }
-
- initEventListeners() {
- if (window) {
- window.addEventListener('online', this.reconnectIfNotConnected);
- window.addEventListener('focus', this.reconnectIfNotConnected);
- }
- }
-
- createNewInstance(account_id) {
- if (this.account_id !== account_id) {
- this.init(true);
- }
- }
-
- reconnectIfNotConnected = () => {
- // eslint-disable-next-line no-console
- console.log('connection state: ', this.api.connection.readyState);
- if (this.api.connection.readyState !== 1) {
- // eslint-disable-next-line no-console
- console.log('Info: Connection to the server was closed, trying to reconnect.');
- this.init();
- }
- };
-
- authorizeAndSubscribe() {
- const { token, account_id } = getToken();
- if (token) {
- this.token = token;
- this.account_id = account_id;
- this.getActiveSymbols();
- this.api
- .authorize(this.token)
- .then(({ authorize }) => {
- this.subscribe();
- this.account_info = authorize;
- })
- .catch(e => {
- globalObserver.emit('Error', e);
- });
- }
- }
-
- subscribe() {
- this.api.send({ balance: 1, subscribe: 1 }).catch(e => {
- globalObserver.emit('Error', e);
- });
- this.api.send({ transaction: 1, subscribe: 1 }).catch(e => {
- globalObserver.emit('Error', e);
- });
- }
-
- getActiveSymbols = async () => {
- const { active_symbols = [] } = await this.api.send({ active_symbols: 'brief' }).catch(e => {
- globalObserver.emit('Error', e);
- });
- const pip_sizes = {};
- active_symbols.forEach(({ symbol, pip }) => {
- pip_sizes[symbol] = +(+pip).toExponential().substring(3);
- });
- this.pip_sizes = pip_sizes;
- this.toggleRunButton(false);
- };
-
- toggleRunButton = toggle => {
- const run_button = document.querySelector('#db-animation__run-button');
- if (!run_button) return;
- run_button.disabled = toggle;
- };
-
- setIsRunning(toggle = false) {
- this.is_running = toggle;
- }
-
- pushSubscription(subscription) {
- this.subscriptions.push(subscription);
- }
-
- clearSubscriptions() {
- this.subscriptions.forEach(s => s.unsubscribe());
- this.subscriptions = [];
- }
-
- getTime() {
- if (!this.time_interval) {
- this.time_interval = setInterval(() => {
- this.api.send({ time: 1 });
- }, 30000);
- }
- }
-}
-
-export const api_base = new APIBase();
diff --git a/packages/bot-skeleton/src/services/api/appId.js b/packages/bot-skeleton/src/services/api/appId.js
index e56a9931fbea..ed7417a9d34d 100644
--- a/packages/bot-skeleton/src/services/api/appId.js
+++ b/packages/bot-skeleton/src/services/api/appId.js
@@ -10,19 +10,3 @@ export const generateDerivApiInstance = () => {
});
return deriv_api;
};
-
-export const getLoginId = () => {
- const login_id = localStorage.getItem('active_loginid');
- if (login_id && login_id !== 'null') return login_id;
- return null;
-};
-
-export const getToken = () => {
- const active_loginid = getLoginId();
- const client_accounts = JSON.parse(localStorage.getItem('client.accounts')) || undefined;
- const active_account = (client_accounts && client_accounts[active_loginid]) || {};
- return {
- token: active_account?.token || undefined,
- account_id: active_loginid || undefined,
- };
-};
diff --git a/packages/bot-skeleton/src/services/api/ticks_service.js b/packages/bot-skeleton/src/services/api/ticks_service.js
index 3ca6c3e687bc..2eaf3e8a50ce 100644
--- a/packages/bot-skeleton/src/services/api/ticks_service.js
+++ b/packages/bot-skeleton/src/services/api/ticks_service.js
@@ -2,7 +2,6 @@ import { Map } from 'immutable';
import { historyToTicks, getLast } from 'binary-utils';
import { doUntilDone, getUUID } from '../tradeEngine/utils/helpers';
import { observer as globalObserver } from '../../utils/observer';
-import { api_base } from './api-base';
const parseTick = tick => ({
epoch: +tick.epoch,
@@ -40,7 +39,8 @@ const updateCandles = (candles, ohlc) => {
const getType = isCandle => (isCandle ? 'candles' : 'ticks');
export default class TicksService {
- constructor() {
+ constructor(api) {
+ this.api = api;
this.ticks = new Map();
this.candles = new Map();
this.tickListeners = new Map();
@@ -60,13 +60,23 @@ export default class TicksService {
if (!this.active_symbols_promise) {
this.active_symbols_promise = new Promise(resolve => {
- this.pipSizes = api_base.pip_sizes;
- resolve(this.pipSizes);
+ this.getActiveSymbols().then(active_symbols => {
+ this.pipSizes = active_symbols
+ .reduce((s, i) => s.set(i.symbol, +(+i.pip).toExponential().substring(3)), new Map())
+ .toObject();
+ resolve(this.pipSizes);
+ });
});
}
return this.active_symbols_promise;
}
+ getActiveSymbols = async () => {
+ await this.api.expectResponse('authorize');
+ const active_symbols = await this.api.send({ active_symbols: 'brief' });
+ return active_symbols.active_symbols;
+ };
+
request(options) {
const { symbol, granularity } = options;
@@ -79,6 +89,7 @@ export default class TicksService {
if (style === 'candles' && this.candles.hasIn([symbol, Number(granularity)])) {
return Promise.resolve(this.candles.getIn([symbol, Number(granularity)]));
}
+
return this.requestStream({ ...options, style });
}
@@ -152,7 +163,7 @@ export default class TicksService {
...(tickSubscription || []),
];
- Promise.all(subscription.map(id => doUntilDone(() => api_base.api.forget(id))));
+ Promise.all(subscription.map(id => doUntilDone(() => this.api.forget(id))));
this.subscriptions = new Map();
}
@@ -184,7 +195,7 @@ export default class TicksService {
}
observe() {
- api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'tick') {
const { tick } = data;
const { symbol, id } = tick;
@@ -249,7 +260,7 @@ export default class TicksService {
style,
};
return new Promise((resolve, reject) => {
- doUntilDone(() => api_base.api.send(request_object), [], api_base)
+ doUntilDone(() => this.api.send(request_object))
.then(r => {
if (style === 'ticks') {
const ticks = historyToTicks(r.history);
@@ -267,27 +278,4 @@ export default class TicksService {
.catch(reject);
});
}
-
- forget = subscription_id => {
- if (subscription_id) {
- api_base.api.forget(subscription_id);
- }
- };
-
- unsubscribeFromTicksService() {
- if (this.ticks_history_promise) {
- const { stringified_options } = this.ticks_history_promise;
- const { symbol = '' } = JSON.parse(stringified_options);
- if (symbol) {
- this.forget(this.subscriptions.getIn(['tick', symbol]));
- }
- }
- if (this.candles_promise) {
- const { stringified_options } = this.candles_promise;
- const { symbol = '' } = JSON.parse(stringified_options);
- if (symbol) {
- this.forget(this.subscriptions.getIn(['candle', symbol]));
- }
- }
- }
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
index 03a01578c671..19f3aad85318 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
@@ -1,14 +1,13 @@
import { getFormattedText } from '@deriv/shared';
import { info } from '../utils/broadcast';
import DBotStore from '../../../scratch/dbot-store';
-import { api_base } from '../../api/api-base';
let balance_string = '';
export default Engine =>
class Balance extends Engine {
observeBalance() {
- const subscription = api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'balance') {
const {
balance: { balance: b, currency },
@@ -19,7 +18,6 @@ export default Engine =>
info({ accountID: this.accountInfo.loginid, balance: balance_string });
}
});
- api_base.pushSubscription(subscription);
}
// eslint-disable-next-line class-methods-use-this
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
index 6b007c29e7f6..52c610a5f0a0 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
@@ -3,12 +3,11 @@ import { sell, openContractReceived } from './state/actions';
import { contractStatus, contract as broadcastContract } from '../utils/broadcast';
import { doUntilDone } from '../utils/helpers';
import DBotStore from '../../../scratch/dbot-store';
-import { api_base } from '../../api/api-base';
export default Engine =>
class OpenContract extends Engine {
observeOpenContract() {
- const subscription = api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'proposal_open_contract') {
const contract = data.proposal_open_contract;
@@ -42,7 +41,6 @@ export default Engine =>
}
}
});
- api_base.pushSubscription(subscription);
}
waitForAfter() {
@@ -53,13 +51,7 @@ export default Engine =>
subscribeToOpenContract(contract_id = this.contractId) {
this.contractId = contract_id;
- const request_object = {
- proposal_open_contract: 1,
- contract_id,
- subscribe: 1,
- };
-
- doUntilDone(() => api_base.api.send(request_object))
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 }))
.then(data => {
const { populateConfig } = DBotStore.instance;
populateConfig(data.proposal_open_contract);
@@ -67,7 +59,7 @@ export default Engine =>
})
.catch(error => {
if (error.error.code !== 'AlreadySubscribed') {
- doUntilDone(() => api_base.api.send(request_object)).then(
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 })).then(
response => (this.openContractId = response.proposal_open_contract.id)
);
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
index 515d40b9421a..17e7914b298a 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
@@ -1,7 +1,6 @@
import { localize } from '@deriv/translations';
import { proposalsReady, clearProposals } from './state/actions';
import { tradeOptionToProposal, doUntilDone } from '../utils/helpers';
-import { api_base } from '../../api/api-base';
export default Engine =>
class Proposal extends Engine {
@@ -70,7 +69,7 @@ export default Engine =>
Promise.all(
this.proposal_templates.map(proposal => {
- doUntilDone(() => api_base.api.send(proposal)).catch(error => {
+ doUntilDone(() => this.api.send(proposal)).catch(error => {
// We intercept ContractBuyValidationError as user may have specified
// e.g. a DIGITUNDER 0 or DIGITOVER 9, while one proposal may be invalid
// the other is valid. We will error on Purchase rather than here.
@@ -95,7 +94,7 @@ export default Engine =>
}
observeProposals() {
- const subscription = api_base.api.onMessage().subscribe(response => {
+ this.api.onMessage().subscribe(response => {
if (response.data.msg_type === 'proposal') {
const { passthrough, proposal } = response.data;
if (
@@ -109,7 +108,6 @@ export default Engine =>
}
}
});
- api_base.pushSubscription(subscription);
}
unsubscribeProposals() {
@@ -130,7 +128,7 @@ export default Engine =>
return Promise.resolve();
}
- return doUntilDone(() => api_base.api.forget(proposal.id)).then(() => {
+ return doUntilDone(() => this.api.forget(proposal.id)).then(() => {
removeForgetProposalById(proposal.id);
});
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
index cd3730f840eb..800c54201f93 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
@@ -3,7 +3,6 @@ import { BEFORE_PURCHASE } from './state/constants';
import { contractStatus, info, log } from '../utils/broadcast';
import { getUUID, recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
-import { api_base } from '../../api/api-base';
let delayIndex = 0;
let purchase_reference;
@@ -42,7 +41,7 @@ export default Engine =>
buy_price: buy.buy_price,
});
};
- const action = () => api_base.api.send({ buy: id, price: askPrice });
+ const action = () => this.api.send({ buy: id, price: askPrice });
this.isSold = false;
contractStatus({
id: 'contract.purchase_sent',
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
index d2dc6bb7a3dc..203cb9d6bdee 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
@@ -3,7 +3,6 @@ import { contractStatus, log } from '../utils/broadcast';
import { recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
export default Engine =>
class Sell extends Engine {
@@ -43,9 +42,9 @@ export default Engine =>
const contract_id = this.contractId;
const sellContractAndGetContractInfo = () => {
- return doUntilDone(() => api_base.api.send({ sell: contract_id, price: 0 }))
+ return doUntilDone(() => this.api.send({ sell: contract_id, price: 0 }))
.then(sell_response => {
- doUntilDone(() => api_base.api.send({ proposal_open_contract: 1, contract_id })).then(
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id })).then(
() => sell_response
);
})
@@ -71,7 +70,7 @@ export default Engine =>
// For every other error, check whether the contract is not actually already sold.
return doUntilDone(() =>
- api_base.api.send({
+ this.api.send({
proposal_open_contract: 1,
contract_id,
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
index a165ea37f8dc..145bfcf67219 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
@@ -15,7 +15,6 @@ import { doUntilDone } from '../utils/helpers';
import { expectInitArg } from '../utils/sanitize';
import { createError } from '../../../utils/error';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
const watchBefore = store =>
watchScope({
@@ -65,6 +64,7 @@ const watchScope = ({ store, stopScope, passScope, passFlag }) => {
export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Proposal(Ticks(Total(class {}))))))) {
constructor($scope) {
super();
+ this.api = $scope.api;
this.observer = $scope.observer;
this.$scope = $scope;
this.observe();
@@ -106,13 +106,17 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
if (this.token === token) {
return Promise.resolve();
}
+
+ doUntilDone(() => this.api.authorize(token)).catch(e => {
+ this.$scope.observer.emit('Error', e);
+ });
return new Promise(resolve => {
// Try to recover from a situation where API doesn't give us a correct response on
// "proposal_open_contract" which would make the bot run forever. When there's a "sell"
// event, wait a couple seconds for the API to give us the correct "proposal_open_contract"
// response, if there's none after x seconds. Send an explicit request, which _should_
// solve the issue. This is a backup!
- api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'transaction' && data.transaction.action === 'sell') {
this.transaction_recovery_timeout = setTimeout(() => {
const { contract } = this.data;
@@ -120,14 +124,26 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
const is_open_contract = contract.status === 'open';
if (is_same_contract && is_open_contract) {
doUntilDone(() => {
- api_base.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
+ this.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
}, ['PriceMoved']);
}
}, 1500);
}
- this.accountInfo = api_base.account_info;
- this.token = api_base.token;
- resolve();
+ if (data.msg_type === 'authorize') {
+ this.accountInfo = data;
+ this.token = token;
+
+ // Only subscribe to balance in browser, not for tests.
+ if (document) {
+ doUntilDone(() => this.api.send({ balance: 1, subscribe: 1 })).then(r => {
+ this.balance = Number(r.balance.balance);
+ resolve();
+ });
+ } else {
+ resolve();
+ }
+ doUntilDone(() => this.api.send({ transaction: 1, subscribe: 1 }));
+ }
});
});
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
index 63cb063a7dc2..bac5c53d459d 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
@@ -1,9 +1,11 @@
import TicksService from '../../api/ticks_service';
import Observer from '../../../utils/observer';
+import { generateDerivApiInstance } from '../../api/appId';
export const createScope = () => {
const observer = new Observer();
- const ticksService = new TicksService();
+ const api = generateDerivApiInstance();
+ const ticksService = new TicksService(api);
const stopped = false;
- return { observer, ticksService, stopped };
+ return { observer, api, ticksService, stopped };
};
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
index 8a996f9ec836..ecb02e769017 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
@@ -130,17 +130,13 @@ export const shouldThrowError = (error, errors_to_ignore = []) => {
return !is_ignorable_error;
};
-export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index, api_base) => {
+export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index) => {
return new Promise((resolve, reject) => {
const promise = promiseFn();
if (promise) {
promise.then(resolve).catch(error => {
- /**
- * if bot is not running there is no point of recovering from error
- * `!api_base.is_running` will check the bot status if it is not running it will kick out the control from loop
- */
- if (shouldThrowError(error, errors_to_ignore) || (api_base && !api_base.is_running)) {
+ if (shouldThrowError(error, errors_to_ignore)) {
reject(error);
return;
}
@@ -176,13 +172,7 @@ export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_i
});
};
-/**
- * @param {*} promiseFn api call - it could be api call or subscription
- * @param {*} errors_to_ignore list of errors to ignore
- * @param {*} api_base instance of APIBase class to check if the bot is running or not
- * @returns a new promise
- */
-export const doUntilDone = (promiseFn, errors_to_ignore, api_base) => {
+export const doUntilDone = (promiseFn, errors_to_ignore) => {
let delay_index = 1;
return new Promise((resolve, reject) => {
@@ -192,7 +182,7 @@ export const doUntilDone = (promiseFn, errors_to_ignore, api_base) => {
};
const repeatFn = () => {
- recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index, api_base).then(resolve).catch(reject);
+ recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index).then(resolve).catch(reject);
};
repeatFn();
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
index 788d172dbe39..d43cb67f01d0 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
@@ -4,7 +4,6 @@ import { createScope } from './cliTools';
import Interface from '../Interface';
import { unrecoverable_errors } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
JSInterpreter.prototype.takeStateSnapshot = function () {
const newStateStack = cloneThorough(this.stateStack, undefined, undefined, undefined, true);
@@ -181,14 +180,16 @@ const Interpreter = () => {
}
function terminateSession() {
+ const { connection } = $scope.api;
+ if (connection.readyState === 0) {
+ connection.addEventListener('open', () => connection.close());
+ } else if (connection.readyState === 1) {
+ connection.close();
+ }
+
$scope.stopped = true;
$scope.is_error_triggered = false;
globalObserver.emit('bot.stop');
- const { ticksService } = $scope;
- // Unsubscribe previous ticks_history subscription
- ticksService.unsubscribeFromTicksService();
- // Unsubscribe the subscriptions from Proposal, Balance and OpenContract
- api_base.clearSubscriptions();
}
function run(code) {
diff --git a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
index de40ff31ad8c..738ed174987a 100644
--- a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
+++ b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
@@ -85,16 +85,9 @@ const TradeAnimation = ({
info_direction,
toggleAnimationInfoModal,
cashier_validation,
- performSelfExclusionCheck,
}) => {
const [is_button_disabled, updateIsButtonDisabled] = React.useState(false);
const is_unavailable_for_payment_agent = cashier_validation?.includes('WithdrawServiceUnavailableForPA');
-
- // perform self-exclusion checks which will be stored under the self-exclusion-store
- React.useEffect(() => {
- performSelfExclusionCheck();
- }, []);
-
React.useEffect(() => {
if (is_button_disabled) {
setTimeout(() => {
@@ -102,7 +95,6 @@ const TradeAnimation = ({
}, 1000);
}
}, [is_button_disabled]);
-
const status_classes = ['', '', ''];
let progress_status =
contract_stage -
@@ -182,7 +174,6 @@ TradeAnimation.propTypes = {
is_stop_button_disabled: PropTypes.bool,
onRunButtonClick: PropTypes.func,
onStopButtonClick: PropTypes.func,
- performSelfExclusionCheck: PropTypes.func,
profit: PropTypes.number,
should_show_overlay: PropTypes.bool,
};
@@ -196,7 +187,6 @@ export default connect(({ summary_card, run_panel, toolbar, ui, client }) => ({
is_stop_button_disabled: run_panel.is_stop_button_disabled,
onRunButtonClick: run_panel.onRunButtonClick,
onStopButtonClick: run_panel.onStopButtonClick,
- performSelfExclusionCheck: run_panel.performSelfExclusionCheck,
profit: summary_card.profit,
should_show_overlay: run_panel.should_show_overlay,
toggleAnimationInfoModal: toolbar.toggleAnimationInfoModal,
diff --git a/packages/bot-web-ui/src/stores/run-panel-store.js b/packages/bot-web-ui/src/stores/run-panel-store.js
index c35b2390467e..c0144b8e494a 100644
--- a/packages/bot-web-ui/src/stores/run-panel-store.js
+++ b/packages/bot-web-ui/src/stores/run-panel-store.js
@@ -32,7 +32,6 @@ export default class RunPanelStore {
toggleDrawer: action.bound,
setActiveTabIndex: action.bound,
onCloseDialog: action.bound,
- performSelfExclusionCheck: action.bound,
showStopMultiplierContractDialog: action.bound,
showLoginDialog: action.bound,
showRealAccountDialog: action.bound,
@@ -131,11 +130,6 @@ export default class RunPanelStore {
);
}
- async performSelfExclusionCheck() {
- const { self_exclusion } = this.root_store;
- await self_exclusion.checkRestriction();
- }
-
async onRunButtonClick() {
const { core, summary_card, route_prompt_dialog, self_exclusion } = this.root_store;
const { client, ui } = core;
@@ -154,6 +148,7 @@ export default class RunPanelStore {
*/
if (is_ios || isSafari()) this.preloadAudio();
+ await self_exclusion.checkRestriction();
if (!self_exclusion.should_bot_run) {
self_exclusion.setIsRestricted(true);
return;
From 69825d33ad1aa81c393f9eef324dc000bff62937 Mon Sep 17 00:00:00 2001
From: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
Date: Mon, 9 Jan 2023 18:28:41 +0800
Subject: [PATCH 11/84] Revert V20230106_0 (#7334)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Revert "fix: summary panel flickering (#7321)"
This reverts commit b134c888eecbda9424540bc05509837821d5089f.
* Revert "translations: 📚 sync translations with crowdin (#7316)"
This reverts commit 37266a2e0317f5d03b8d1dddd943030cf4c17e6d.
* Revert "fix: dbot performance issue -- unified websocket connection and moved… (#7103)"
This reverts commit 1abb7debf6a5a6ad12700e48e621bffbbf3372d1.
---
packages/bot-skeleton/package.json | 2 -
.../bot-skeleton/src/scratch/dbot-store.js | 8 --
packages/bot-skeleton/src/scratch/dbot.js | 10 +-
.../bot-skeleton/src/services/api/api-base.js | 123 ------------------
.../bot-skeleton/src/services/api/appId.js | 16 ---
.../src/services/api/ticks_service.js | 48 +++----
.../src/services/tradeEngine/trade/Balance.js | 4 +-
.../tradeEngine/trade/OpenContract.js | 14 +-
.../services/tradeEngine/trade/Proposal.js | 8 +-
.../services/tradeEngine/trade/Purchase.js | 3 +-
.../src/services/tradeEngine/trade/Sell.js | 7 +-
.../src/services/tradeEngine/trade/index.js | 28 +++-
.../services/tradeEngine/utils/cliTools.js | 6 +-
.../src/services/tradeEngine/utils/helpers.js | 18 +--
.../services/tradeEngine/utils/interpreter.js | 13 +-
.../trade-animation/trade-animation.jsx | 10 --
packages/bot-web-ui/src/stores/app-store.js | 2 +-
.../bot-web-ui/src/stores/run-panel-store.js | 7 +-
packages/p2p/src/translations/fr.json | 4 +-
packages/p2p/src/translations/id.json | 4 +-
.../translations/src/translations/it.json | 52 ++++----
.../translations/src/translations/ru.json | 16 +--
.../translations/src/translations/th.json | 6 +-
23 files changed, 111 insertions(+), 298 deletions(-)
delete mode 100644 packages/bot-skeleton/src/services/api/api-base.js
diff --git a/packages/bot-skeleton/package.json b/packages/bot-skeleton/package.json
index b19bf02aea06..96becac19d3c 100644
--- a/packages/bot-skeleton/package.json
+++ b/packages/bot-skeleton/package.json
@@ -46,8 +46,6 @@
"immutable": "^3.8.2",
"localforage": "^1.9.0",
"lz-string": "^1.4.4",
- "mobx": "^6.6.1",
- "mobx-react": "^7.5.1",
"redux": "^4.0.1",
"redux-thunk": "^2.2.0",
"scratch-blocks": "0.1.0-prerelease.20200917235131",
diff --git a/packages/bot-skeleton/src/scratch/dbot-store.js b/packages/bot-skeleton/src/scratch/dbot-store.js
index fb7333342df2..1d951ec9ebc2 100644
--- a/packages/bot-skeleton/src/scratch/dbot-store.js
+++ b/packages/bot-skeleton/src/scratch/dbot-store.js
@@ -1,6 +1,3 @@
-import { reaction } from 'mobx';
-import { api_base } from '../services/api/api-base';
-
class DBotStoreInterface {
// TODO here we are suppose to define an interface and implement fields of DBotStore.
handleFileChange = () => {
@@ -30,11 +27,6 @@ class DBotStore extends DBotStoreInterface {
this.handleFileChange = store.handleFileChange;
this.startLoading = store.startLoading;
this.endLoading = store.endLoading;
-
- reaction(
- () => this.client.loginid,
- () => api_base.createNewInstance(this.client.loginid)
- );
}
static setInstance(store) {
diff --git a/packages/bot-skeleton/src/scratch/dbot.js b/packages/bot-skeleton/src/scratch/dbot.js
index 4df1e4afb380..adee21e1bab2 100644
--- a/packages/bot-skeleton/src/scratch/dbot.js
+++ b/packages/bot-skeleton/src/scratch/dbot.js
@@ -10,7 +10,6 @@ import { observer as globalObserver } from '../utils/observer';
import ApiHelpers from '../services/api/api-helpers';
import Interpreter from '../services/tradeEngine/utils/interpreter';
import { setColors } from './hooks/colours';
-import { api_base } from '../services/api/api-base';
class DBot {
constructor() {
@@ -98,7 +97,7 @@ class DBot {
window.dispatchEvent(new Event('resize'));
window.addEventListener('dragover', DBot.handleDragOver);
window.addEventListener('drop', e => DBot.handleDropOver(e, handleFileChange));
- api_base.init();
+
// disable overflow
el_scratch_div.parentNode.style.overflow = 'hidden';
resolve();
@@ -135,7 +134,7 @@ class DBot {
}
this.interpreter = Interpreter();
- api_base.setIsRunning(true);
+
this.interpreter.run(code).catch(error => {
globalObserver.emit('Error', error);
this.stopBot();
@@ -227,7 +226,6 @@ class DBot {
* that trade will be completed first to reflect correct contract status in UI.
*/
stopBot() {
- api_base.setIsRunning(false);
if (this.interpreter) {
this.interpreter.stop();
}
@@ -243,10 +241,6 @@ class DBot {
}
}
- terminateConnection = () => {
- api_base.terminate();
- };
-
/**
* Unselects any selected block before running the bot.
*/
diff --git a/packages/bot-skeleton/src/services/api/api-base.js b/packages/bot-skeleton/src/services/api/api-base.js
deleted file mode 100644
index 5fa052992ced..000000000000
--- a/packages/bot-skeleton/src/services/api/api-base.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { observer as globalObserver } from '../../utils/observer';
-import { generateDerivApiInstance, getLoginId, getToken } from './appId';
-
-class APIBase {
- api;
- token;
- account_id;
- pip_sizes = {};
- account_info = {};
- is_running = false;
- subscriptions = [];
- time_interval = null;
-
- init(force_update = false) {
- if (getLoginId()) {
- this.toggleRunButton(true);
- if (force_update) this.terminate();
- this.api = generateDerivApiInstance();
- this.initEventListeners();
- this.authorizeAndSubscribe();
- if (this.time_interval) clearInterval(this.time_interval);
- this.time_interval = null;
- this.getTime();
- }
- }
-
- terminate() {
- // eslint-disable-next-line no-console
- console.log('connection terminated');
- if (this.api) this.api.disconnect();
- }
-
- initEventListeners() {
- if (window) {
- window.addEventListener('online', this.reconnectIfNotConnected);
- window.addEventListener('focus', this.reconnectIfNotConnected);
- }
- }
-
- createNewInstance(account_id) {
- if (this.account_id !== account_id) {
- this.init(true);
- }
- }
-
- reconnectIfNotConnected = () => {
- // eslint-disable-next-line no-console
- console.log('connection state: ', this.api.connection.readyState);
- if (this.api.connection.readyState !== 1) {
- // eslint-disable-next-line no-console
- console.log('Info: Connection to the server was closed, trying to reconnect.');
- this.init();
- }
- };
-
- authorizeAndSubscribe() {
- const { token, account_id } = getToken();
- if (token) {
- this.token = token;
- this.account_id = account_id;
- this.getActiveSymbols();
- this.api
- .authorize(this.token)
- .then(({ authorize }) => {
- this.subscribe();
- this.account_info = authorize;
- })
- .catch(e => {
- globalObserver.emit('Error', e);
- });
- }
- }
-
- subscribe() {
- this.api.send({ balance: 1, subscribe: 1 }).catch(e => {
- globalObserver.emit('Error', e);
- });
- this.api.send({ transaction: 1, subscribe: 1 }).catch(e => {
- globalObserver.emit('Error', e);
- });
- }
-
- getActiveSymbols = async () => {
- const { active_symbols = [] } = await this.api.send({ active_symbols: 'brief' }).catch(e => {
- globalObserver.emit('Error', e);
- });
- const pip_sizes = {};
- active_symbols.forEach(({ symbol, pip }) => {
- pip_sizes[symbol] = +(+pip).toExponential().substring(3);
- });
- this.pip_sizes = pip_sizes;
- this.toggleRunButton(false);
- };
-
- toggleRunButton = toggle => {
- const run_button = document.querySelector('#db-animation__run-button');
- if (!run_button) return;
- run_button.disabled = toggle;
- };
-
- setIsRunning(toggle = false) {
- this.is_running = toggle;
- }
-
- pushSubscription(subscription) {
- this.subscriptions.push(subscription);
- }
-
- clearSubscriptions() {
- this.subscriptions.forEach(s => s.unsubscribe());
- this.subscriptions = [];
- }
-
- getTime() {
- if (!this.time_interval) {
- this.time_interval = setInterval(() => {
- this.api.send({ time: 1 });
- }, 30000);
- }
- }
-}
-
-export const api_base = new APIBase();
diff --git a/packages/bot-skeleton/src/services/api/appId.js b/packages/bot-skeleton/src/services/api/appId.js
index e56a9931fbea..ed7417a9d34d 100644
--- a/packages/bot-skeleton/src/services/api/appId.js
+++ b/packages/bot-skeleton/src/services/api/appId.js
@@ -10,19 +10,3 @@ export const generateDerivApiInstance = () => {
});
return deriv_api;
};
-
-export const getLoginId = () => {
- const login_id = localStorage.getItem('active_loginid');
- if (login_id && login_id !== 'null') return login_id;
- return null;
-};
-
-export const getToken = () => {
- const active_loginid = getLoginId();
- const client_accounts = JSON.parse(localStorage.getItem('client.accounts')) || undefined;
- const active_account = (client_accounts && client_accounts[active_loginid]) || {};
- return {
- token: active_account?.token || undefined,
- account_id: active_loginid || undefined,
- };
-};
diff --git a/packages/bot-skeleton/src/services/api/ticks_service.js b/packages/bot-skeleton/src/services/api/ticks_service.js
index 3ca6c3e687bc..2eaf3e8a50ce 100644
--- a/packages/bot-skeleton/src/services/api/ticks_service.js
+++ b/packages/bot-skeleton/src/services/api/ticks_service.js
@@ -2,7 +2,6 @@ import { Map } from 'immutable';
import { historyToTicks, getLast } from 'binary-utils';
import { doUntilDone, getUUID } from '../tradeEngine/utils/helpers';
import { observer as globalObserver } from '../../utils/observer';
-import { api_base } from './api-base';
const parseTick = tick => ({
epoch: +tick.epoch,
@@ -40,7 +39,8 @@ const updateCandles = (candles, ohlc) => {
const getType = isCandle => (isCandle ? 'candles' : 'ticks');
export default class TicksService {
- constructor() {
+ constructor(api) {
+ this.api = api;
this.ticks = new Map();
this.candles = new Map();
this.tickListeners = new Map();
@@ -60,13 +60,23 @@ export default class TicksService {
if (!this.active_symbols_promise) {
this.active_symbols_promise = new Promise(resolve => {
- this.pipSizes = api_base.pip_sizes;
- resolve(this.pipSizes);
+ this.getActiveSymbols().then(active_symbols => {
+ this.pipSizes = active_symbols
+ .reduce((s, i) => s.set(i.symbol, +(+i.pip).toExponential().substring(3)), new Map())
+ .toObject();
+ resolve(this.pipSizes);
+ });
});
}
return this.active_symbols_promise;
}
+ getActiveSymbols = async () => {
+ await this.api.expectResponse('authorize');
+ const active_symbols = await this.api.send({ active_symbols: 'brief' });
+ return active_symbols.active_symbols;
+ };
+
request(options) {
const { symbol, granularity } = options;
@@ -79,6 +89,7 @@ export default class TicksService {
if (style === 'candles' && this.candles.hasIn([symbol, Number(granularity)])) {
return Promise.resolve(this.candles.getIn([symbol, Number(granularity)]));
}
+
return this.requestStream({ ...options, style });
}
@@ -152,7 +163,7 @@ export default class TicksService {
...(tickSubscription || []),
];
- Promise.all(subscription.map(id => doUntilDone(() => api_base.api.forget(id))));
+ Promise.all(subscription.map(id => doUntilDone(() => this.api.forget(id))));
this.subscriptions = new Map();
}
@@ -184,7 +195,7 @@ export default class TicksService {
}
observe() {
- api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'tick') {
const { tick } = data;
const { symbol, id } = tick;
@@ -249,7 +260,7 @@ export default class TicksService {
style,
};
return new Promise((resolve, reject) => {
- doUntilDone(() => api_base.api.send(request_object), [], api_base)
+ doUntilDone(() => this.api.send(request_object))
.then(r => {
if (style === 'ticks') {
const ticks = historyToTicks(r.history);
@@ -267,27 +278,4 @@ export default class TicksService {
.catch(reject);
});
}
-
- forget = subscription_id => {
- if (subscription_id) {
- api_base.api.forget(subscription_id);
- }
- };
-
- unsubscribeFromTicksService() {
- if (this.ticks_history_promise) {
- const { stringified_options } = this.ticks_history_promise;
- const { symbol = '' } = JSON.parse(stringified_options);
- if (symbol) {
- this.forget(this.subscriptions.getIn(['tick', symbol]));
- }
- }
- if (this.candles_promise) {
- const { stringified_options } = this.candles_promise;
- const { symbol = '' } = JSON.parse(stringified_options);
- if (symbol) {
- this.forget(this.subscriptions.getIn(['candle', symbol]));
- }
- }
- }
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
index 03a01578c671..19f3aad85318 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Balance.js
@@ -1,14 +1,13 @@
import { getFormattedText } from '@deriv/shared';
import { info } from '../utils/broadcast';
import DBotStore from '../../../scratch/dbot-store';
-import { api_base } from '../../api/api-base';
let balance_string = '';
export default Engine =>
class Balance extends Engine {
observeBalance() {
- const subscription = api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'balance') {
const {
balance: { balance: b, currency },
@@ -19,7 +18,6 @@ export default Engine =>
info({ accountID: this.accountInfo.loginid, balance: balance_string });
}
});
- api_base.pushSubscription(subscription);
}
// eslint-disable-next-line class-methods-use-this
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
index 6b007c29e7f6..52c610a5f0a0 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/OpenContract.js
@@ -3,12 +3,11 @@ import { sell, openContractReceived } from './state/actions';
import { contractStatus, contract as broadcastContract } from '../utils/broadcast';
import { doUntilDone } from '../utils/helpers';
import DBotStore from '../../../scratch/dbot-store';
-import { api_base } from '../../api/api-base';
export default Engine =>
class OpenContract extends Engine {
observeOpenContract() {
- const subscription = api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'proposal_open_contract') {
const contract = data.proposal_open_contract;
@@ -42,7 +41,6 @@ export default Engine =>
}
}
});
- api_base.pushSubscription(subscription);
}
waitForAfter() {
@@ -53,13 +51,7 @@ export default Engine =>
subscribeToOpenContract(contract_id = this.contractId) {
this.contractId = contract_id;
- const request_object = {
- proposal_open_contract: 1,
- contract_id,
- subscribe: 1,
- };
-
- doUntilDone(() => api_base.api.send(request_object))
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 }))
.then(data => {
const { populateConfig } = DBotStore.instance;
populateConfig(data.proposal_open_contract);
@@ -67,7 +59,7 @@ export default Engine =>
})
.catch(error => {
if (error.error.code !== 'AlreadySubscribed') {
- doUntilDone(() => api_base.api.send(request_object)).then(
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id, subscribe: 1 })).then(
response => (this.openContractId = response.proposal_open_contract.id)
);
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
index 515d40b9421a..17e7914b298a 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Proposal.js
@@ -1,7 +1,6 @@
import { localize } from '@deriv/translations';
import { proposalsReady, clearProposals } from './state/actions';
import { tradeOptionToProposal, doUntilDone } from '../utils/helpers';
-import { api_base } from '../../api/api-base';
export default Engine =>
class Proposal extends Engine {
@@ -70,7 +69,7 @@ export default Engine =>
Promise.all(
this.proposal_templates.map(proposal => {
- doUntilDone(() => api_base.api.send(proposal)).catch(error => {
+ doUntilDone(() => this.api.send(proposal)).catch(error => {
// We intercept ContractBuyValidationError as user may have specified
// e.g. a DIGITUNDER 0 or DIGITOVER 9, while one proposal may be invalid
// the other is valid. We will error on Purchase rather than here.
@@ -95,7 +94,7 @@ export default Engine =>
}
observeProposals() {
- const subscription = api_base.api.onMessage().subscribe(response => {
+ this.api.onMessage().subscribe(response => {
if (response.data.msg_type === 'proposal') {
const { passthrough, proposal } = response.data;
if (
@@ -109,7 +108,6 @@ export default Engine =>
}
}
});
- api_base.pushSubscription(subscription);
}
unsubscribeProposals() {
@@ -130,7 +128,7 @@ export default Engine =>
return Promise.resolve();
}
- return doUntilDone(() => api_base.api.forget(proposal.id)).then(() => {
+ return doUntilDone(() => this.api.forget(proposal.id)).then(() => {
removeForgetProposalById(proposal.id);
});
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
index cd3730f840eb..800c54201f93 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Purchase.js
@@ -3,7 +3,6 @@ import { BEFORE_PURCHASE } from './state/constants';
import { contractStatus, info, log } from '../utils/broadcast';
import { getUUID, recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
-import { api_base } from '../../api/api-base';
let delayIndex = 0;
let purchase_reference;
@@ -42,7 +41,7 @@ export default Engine =>
buy_price: buy.buy_price,
});
};
- const action = () => api_base.api.send({ buy: id, price: askPrice });
+ const action = () => this.api.send({ buy: id, price: askPrice });
this.isSold = false;
contractStatus({
id: 'contract.purchase_sent',
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
index d2dc6bb7a3dc..203cb9d6bdee 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/Sell.js
@@ -3,7 +3,6 @@ import { contractStatus, log } from '../utils/broadcast';
import { recoverFromError, doUntilDone } from '../utils/helpers';
import { log_types } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
export default Engine =>
class Sell extends Engine {
@@ -43,9 +42,9 @@ export default Engine =>
const contract_id = this.contractId;
const sellContractAndGetContractInfo = () => {
- return doUntilDone(() => api_base.api.send({ sell: contract_id, price: 0 }))
+ return doUntilDone(() => this.api.send({ sell: contract_id, price: 0 }))
.then(sell_response => {
- doUntilDone(() => api_base.api.send({ proposal_open_contract: 1, contract_id })).then(
+ doUntilDone(() => this.api.send({ proposal_open_contract: 1, contract_id })).then(
() => sell_response
);
})
@@ -71,7 +70,7 @@ export default Engine =>
// For every other error, check whether the contract is not actually already sold.
return doUntilDone(() =>
- api_base.api.send({
+ this.api.send({
proposal_open_contract: 1,
contract_id,
})
diff --git a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
index a165ea37f8dc..145bfcf67219 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/trade/index.js
@@ -15,7 +15,6 @@ import { doUntilDone } from '../utils/helpers';
import { expectInitArg } from '../utils/sanitize';
import { createError } from '../../../utils/error';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
const watchBefore = store =>
watchScope({
@@ -65,6 +64,7 @@ const watchScope = ({ store, stopScope, passScope, passFlag }) => {
export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Proposal(Ticks(Total(class {}))))))) {
constructor($scope) {
super();
+ this.api = $scope.api;
this.observer = $scope.observer;
this.$scope = $scope;
this.observe();
@@ -106,13 +106,17 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
if (this.token === token) {
return Promise.resolve();
}
+
+ doUntilDone(() => this.api.authorize(token)).catch(e => {
+ this.$scope.observer.emit('Error', e);
+ });
return new Promise(resolve => {
// Try to recover from a situation where API doesn't give us a correct response on
// "proposal_open_contract" which would make the bot run forever. When there's a "sell"
// event, wait a couple seconds for the API to give us the correct "proposal_open_contract"
// response, if there's none after x seconds. Send an explicit request, which _should_
// solve the issue. This is a backup!
- api_base.api.onMessage().subscribe(({ data }) => {
+ this.api.onMessage().subscribe(({ data }) => {
if (data.msg_type === 'transaction' && data.transaction.action === 'sell') {
this.transaction_recovery_timeout = setTimeout(() => {
const { contract } = this.data;
@@ -120,14 +124,26 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop
const is_open_contract = contract.status === 'open';
if (is_same_contract && is_open_contract) {
doUntilDone(() => {
- api_base.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
+ this.api.send({ proposal_open_contract: 1, contract_id: contract.contract_id });
}, ['PriceMoved']);
}
}, 1500);
}
- this.accountInfo = api_base.account_info;
- this.token = api_base.token;
- resolve();
+ if (data.msg_type === 'authorize') {
+ this.accountInfo = data;
+ this.token = token;
+
+ // Only subscribe to balance in browser, not for tests.
+ if (document) {
+ doUntilDone(() => this.api.send({ balance: 1, subscribe: 1 })).then(r => {
+ this.balance = Number(r.balance.balance);
+ resolve();
+ });
+ } else {
+ resolve();
+ }
+ doUntilDone(() => this.api.send({ transaction: 1, subscribe: 1 }));
+ }
});
});
}
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
index 63cb063a7dc2..bac5c53d459d 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/cliTools.js
@@ -1,9 +1,11 @@
import TicksService from '../../api/ticks_service';
import Observer from '../../../utils/observer';
+import { generateDerivApiInstance } from '../../api/appId';
export const createScope = () => {
const observer = new Observer();
- const ticksService = new TicksService();
+ const api = generateDerivApiInstance();
+ const ticksService = new TicksService(api);
const stopped = false;
- return { observer, ticksService, stopped };
+ return { observer, api, ticksService, stopped };
};
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
index 8a996f9ec836..ecb02e769017 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/helpers.js
@@ -130,17 +130,13 @@ export const shouldThrowError = (error, errors_to_ignore = []) => {
return !is_ignorable_error;
};
-export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index, api_base) => {
+export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_index) => {
return new Promise((resolve, reject) => {
const promise = promiseFn();
if (promise) {
promise.then(resolve).catch(error => {
- /**
- * if bot is not running there is no point of recovering from error
- * `!api_base.is_running` will check the bot status if it is not running it will kick out the control from loop
- */
- if (shouldThrowError(error, errors_to_ignore) || (api_base && !api_base.is_running)) {
+ if (shouldThrowError(error, errors_to_ignore)) {
reject(error);
return;
}
@@ -176,13 +172,7 @@ export const recoverFromError = (promiseFn, recoverFn, errors_to_ignore, delay_i
});
};
-/**
- * @param {*} promiseFn api call - it could be api call or subscription
- * @param {*} errors_to_ignore list of errors to ignore
- * @param {*} api_base instance of APIBase class to check if the bot is running or not
- * @returns a new promise
- */
-export const doUntilDone = (promiseFn, errors_to_ignore, api_base) => {
+export const doUntilDone = (promiseFn, errors_to_ignore) => {
let delay_index = 1;
return new Promise((resolve, reject) => {
@@ -192,7 +182,7 @@ export const doUntilDone = (promiseFn, errors_to_ignore, api_base) => {
};
const repeatFn = () => {
- recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index, api_base).then(resolve).catch(reject);
+ recoverFromError(promiseFn, recoverFn, errors_to_ignore, delay_index).then(resolve).catch(reject);
};
repeatFn();
diff --git a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
index 788d172dbe39..d43cb67f01d0 100644
--- a/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
+++ b/packages/bot-skeleton/src/services/tradeEngine/utils/interpreter.js
@@ -4,7 +4,6 @@ import { createScope } from './cliTools';
import Interface from '../Interface';
import { unrecoverable_errors } from '../../../constants/messages';
import { observer as globalObserver } from '../../../utils/observer';
-import { api_base } from '../../api/api-base';
JSInterpreter.prototype.takeStateSnapshot = function () {
const newStateStack = cloneThorough(this.stateStack, undefined, undefined, undefined, true);
@@ -181,14 +180,16 @@ const Interpreter = () => {
}
function terminateSession() {
+ const { connection } = $scope.api;
+ if (connection.readyState === 0) {
+ connection.addEventListener('open', () => connection.close());
+ } else if (connection.readyState === 1) {
+ connection.close();
+ }
+
$scope.stopped = true;
$scope.is_error_triggered = false;
globalObserver.emit('bot.stop');
- const { ticksService } = $scope;
- // Unsubscribe previous ticks_history subscription
- ticksService.unsubscribeFromTicksService();
- // Unsubscribe the subscriptions from Proposal, Balance and OpenContract
- api_base.clearSubscriptions();
}
function run(code) {
diff --git a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
index de40ff31ad8c..738ed174987a 100644
--- a/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
+++ b/packages/bot-web-ui/src/components/trade-animation/trade-animation.jsx
@@ -85,16 +85,9 @@ const TradeAnimation = ({
info_direction,
toggleAnimationInfoModal,
cashier_validation,
- performSelfExclusionCheck,
}) => {
const [is_button_disabled, updateIsButtonDisabled] = React.useState(false);
const is_unavailable_for_payment_agent = cashier_validation?.includes('WithdrawServiceUnavailableForPA');
-
- // perform self-exclusion checks which will be stored under the self-exclusion-store
- React.useEffect(() => {
- performSelfExclusionCheck();
- }, []);
-
React.useEffect(() => {
if (is_button_disabled) {
setTimeout(() => {
@@ -102,7 +95,6 @@ const TradeAnimation = ({
}, 1000);
}
}, [is_button_disabled]);
-
const status_classes = ['', '', ''];
let progress_status =
contract_stage -
@@ -182,7 +174,6 @@ TradeAnimation.propTypes = {
is_stop_button_disabled: PropTypes.bool,
onRunButtonClick: PropTypes.func,
onStopButtonClick: PropTypes.func,
- performSelfExclusionCheck: PropTypes.func,
profit: PropTypes.number,
should_show_overlay: PropTypes.bool,
};
@@ -196,7 +187,6 @@ export default connect(({ summary_card, run_panel, toolbar, ui, client }) => ({
is_stop_button_disabled: run_panel.is_stop_button_disabled,
onRunButtonClick: run_panel.onRunButtonClick,
onStopButtonClick: run_panel.onStopButtonClick,
- performSelfExclusionCheck: run_panel.performSelfExclusionCheck,
profit: summary_card.profit,
should_show_overlay: run_panel.should_show_overlay,
toggleAnimationInfoModal: toolbar.toggleAnimationInfoModal,
diff --git a/packages/bot-web-ui/src/stores/app-store.js b/packages/bot-web-ui/src/stores/app-store.js
index 862140f7d1e5..2088fa4b7da7 100644
--- a/packages/bot-web-ui/src/stores/app-store.js
+++ b/packages/bot-web-ui/src/stores/app-store.js
@@ -39,7 +39,7 @@ export default class AppStore {
onUnmount() {
DBot.terminateBot();
- DBot.terminateConnection();
+
if (Blockly.derivWorkspace) {
clearInterval(Blockly.derivWorkspace.save_workspace_interval);
Blockly.derivWorkspace.dispose();
diff --git a/packages/bot-web-ui/src/stores/run-panel-store.js b/packages/bot-web-ui/src/stores/run-panel-store.js
index c35b2390467e..c0144b8e494a 100644
--- a/packages/bot-web-ui/src/stores/run-panel-store.js
+++ b/packages/bot-web-ui/src/stores/run-panel-store.js
@@ -32,7 +32,6 @@ export default class RunPanelStore {
toggleDrawer: action.bound,
setActiveTabIndex: action.bound,
onCloseDialog: action.bound,
- performSelfExclusionCheck: action.bound,
showStopMultiplierContractDialog: action.bound,
showLoginDialog: action.bound,
showRealAccountDialog: action.bound,
@@ -131,11 +130,6 @@ export default class RunPanelStore {
);
}
- async performSelfExclusionCheck() {
- const { self_exclusion } = this.root_store;
- await self_exclusion.checkRestriction();
- }
-
async onRunButtonClick() {
const { core, summary_card, route_prompt_dialog, self_exclusion } = this.root_store;
const { client, ui } = core;
@@ -154,6 +148,7 @@ export default class RunPanelStore {
*/
if (is_ios || isSafari()) this.preloadAudio();
+ await self_exclusion.checkRestriction();
if (!self_exclusion.should_bot_run) {
self_exclusion.setIsRestricted(true);
return;
diff --git a/packages/p2p/src/translations/fr.json b/packages/p2p/src/translations/fr.json
index 377fe2a81fef..e4022ee5e8ce 100644
--- a/packages/p2p/src/translations/fr.json
+++ b/packages/p2p/src/translations/fr.json
@@ -2,7 +2,7 @@
"6794664": "Annonces qui correspondent à votre solde et à votre limite P2P Deriv.",
"19789721": "Personne ne t'a bloqué. Ouaii !",
"21103557": "Solde P2P dérivé = dépôts qui ne peuvent pas être annulés (virements bancaires, etc.) + une partie des dépôts qui peuvent être annulés (paiements par carte de crédit, etc.)",
- "24711354": "Total des ordres <0>30j0> | <1>tous1>",
+ "24711354": "Total des commandes <0>30j0> | <1>à vie1>",
"47573834": "Taux fixe (1 {{account_currency}})",
"50672601": "Acheté",
"51881712": "Vous avez déjà une annonce avec le même taux de change pour cette paire de devises et ce type d'ordre.
Veuillez définir un taux différent pour votre annonce.",
@@ -307,7 +307,7 @@
"-2059312414": "Détails de l'annonce",
"-1769584466": "Statistiques",
"-2090878601": "Limite journalière",
- "-130547447": "Volume des trades <0>30d0> | <1>tous1>",
+ "-130547447": "Volume des trades <0>30d0> | <1>à vie1>",
"-1792280476": "Choisissez votre mode de paiement",
"-293182503": "Annuler l'ajout de ce mode de paiement ?",
"-1850127397": "Si vous choisissez d'annuler, les données que vous avez saisies seront perdues.",
diff --git a/packages/p2p/src/translations/id.json b/packages/p2p/src/translations/id.json
index fadb811baa60..647a3c20d4a8 100644
--- a/packages/p2p/src/translations/id.json
+++ b/packages/p2p/src/translations/id.json
@@ -2,7 +2,7 @@
"6794664": "Iklan yang sesuai dengan saldo dan batas P2P Deriv Anda.",
"19789721": "Tidak ada yang memblokir Anda. Yay!",
"21103557": "Saldo Deriv P2P = deposit yang tidak dapat dibatalkan (melalui tranfer bank, dsb) + sejumlah deposit yang mungkin dapat dibatalkan (melalui kartu kredit, dsb)",
- "24711354": "Total order <0>30hari0> | <1>semua1>",
+ "24711354": "Total order <0>30hari0> | <1>seumur hidup1>",
"47573834": "Harga tetap (1 {{account_currency}})",
"50672601": "Membeli",
"51881712": "Anda sudah membuat iklan dengan nilai tukar yang sama untuk pasangan mata uang dan jenis order.
Mohon pilih nilai tukar lain untuk iklan Anda.",
@@ -307,7 +307,7 @@
"-2059312414": "Detail iklan",
"-1769584466": "Statistik",
"-2090878601": "Batas harian",
- "-130547447": "Transaksi <0>30 hari0> | <1>semua1>",
+ "-130547447": "Volume transaksi <0>30 hari0> | <1>seumur hidup1>",
"-1792280476": "Pilih metode pembayaran Anda",
"-293182503": "Batalkan penambahan metode pembayaran ini?",
"-1850127397": "Jika Anda memilih untuk membatalkan, detail yang Anda masukkan akan hilang.",
diff --git a/packages/translations/src/translations/it.json b/packages/translations/src/translations/it.json
index 4b387ac0744b..b3d410f48790 100644
--- a/packages/translations/src/translations/it.json
+++ b/packages/translations/src/translations/it.json
@@ -245,7 +245,7 @@
"327534692": "Il valore di durata non è consentito. Per avviare il bot, inserire {{min}}.",
"328539132": "Ripete le istruzioni ad esso relative per un numero specifico di volte",
"329404045": "<0>Passa al conto reale0><1> per creare un conto {{account_title}} {{platform}}.1>",
- "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida utente2>.",
+ "332886946": "<1>Hai bisogno di aiuto per usare Acuity? 1><0/>Consulta questa <2>guida per l'utente2>.",
"333456603": "Limiti per i prelievi",
"334680754": "Passa al tuo conto reale per creare un conto Deriv MT5",
"334942497": "Tempo di acquista",
@@ -517,7 +517,7 @@
"665089217": "Invia <0>il documenti di verifica dell'identità0> per autenticare il tuo conto e accedere alla cassa.",
"665777772": "XLM/USD",
"665872465": "Nell'esempio sottostante, è stato selezionato il prezzo di apertura, che viene poi assegnato a una variabile chiamata \"op\".",
- "666724936": "Inserisci un numero ID valido.",
+ "666724936": "Inserisci un numero di ID valido.",
"668344562": "Sintetici, FX maggiori (lotti standard/micro), FX minori, panieri di indici, materie prime e criptovalute",
"672008428": "ZEC/USD",
"673915530": "Giurisdizione e scelta delle legge applicabile",
@@ -710,7 +710,7 @@
"918447723": "Reale",
"920125517": "Aggiungi conto demo",
"921901739": "- i dati del conto bancario collegato al tuo conto",
- "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o le informazioni del conto.",
+ "924046954": "Carica un documento che mostri il tuo nome e il numero di conto bancario o i dettagli del conto.",
"926813068": "Fisso/variabile",
"929608744": "Non puoi effettuare prelievi",
"930346117": "Le lettere maiuscole non sono di grande aiuto",
@@ -778,7 +778,7 @@
"1006664890": "Silenzioso",
"1009032439": "Sempre",
"1010198306": "Questo blocco crea una lista con stringhe e numeri.",
- "1010337648": "Non siamo stati in grado di verificare il documento a verifica della proprietà.",
+ "1010337648": "Non siamo stati in grado di verificare la tua prova di proprietà.",
"1012102263": "Non potrai accedere al tuo conto fino a questa data (massimo 6 settimane da oggi).",
"1015201500": "Stabilisci le opzioni di trading come durata e puntata.",
"1016220824": "Devi passare a un conto reale per usare questa opzione. <0/>Per farlo, seleziona un conto reale da <1>Cambia conto.1>",
@@ -855,7 +855,7 @@
"1086118495": "Hub per i trader",
"1088138125": "Tick {{current_tick}} - ",
"1089085289": "Numero di telefono",
- "1096078516": "Verificheremo i documenti e ti aggiorneremo sullo stato della procedura entro 3 giorni.",
+ "1096078516": "Analizzeremo i documenti e ti aggiorneremo sullo stato entro 3 giorni.",
"1096175323": "Occorre un conto Deriv",
"1098147569": "Acquistare materie prime o azioni di una società.",
"1098622295": "\"i\" inizia con il valore 1, e aumenta di 2 a ogni interazione. La ripetizione si ripete fino a quando \"i\" raggiunge il valore di 12, dopodiché termina.",
@@ -972,7 +972,7 @@
"1232353969": "0-5 operazioni negli ultimi 12 mesi",
"1233300532": "Payout",
"1234292259": "Fonte di ricchezza",
- "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
+ "1234764730": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione dei dettagli personali.",
"1235426525": "50%",
"1237330017": "Pensionato",
"1238311538": "Amministratore",
@@ -1234,7 +1234,7 @@
"1540585098": "Rifiuta",
"1541969455": "Entrambi",
"1544642951": "Selezionando \"Solo ascendente\", ottieni il payout se tick consecutivi superano successivamente il punto di entrata. Non ottieni alcun payout se qualsiasi tick è minore o uguale a uno dei tick precedenti.",
- "1547148381": "Le dimensioni del file sono troppo grandi (consentiti solo fino a 8MB). Carica un altro file.",
+ "1547148381": "Il file è troppo grande (sono consentiti solo fino a 8MB). Carica un altro file.",
"1548765374": "La verifica del numero di documento non è andata a buon fine",
"1549098835": "Totale prelievo",
"1551172020": "Paniere AUD",
@@ -1332,7 +1332,7 @@
"1675030608": "Per creare questo conto, abbiamo bisogno prima che tu invii nuovamente la prova dell'indirizzo.",
"1677027187": "Forex",
"1677990284": "Le mie app",
- "1680666439": "Carica l'estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
+ "1680666439": "Carica lo estratto conto bancario con il tuo nome, il numero di conto e la cronologia delle transazioni.",
"1682409128": "Strategia senza nome",
"1682636566": "Invia di nuovo e-mail a",
"1683963454": "Il contratto verrà chiuso automaticamente al successivo prezzo disponibile dell'asset il {{date}} alle {{timestamp}}.",
@@ -1367,7 +1367,7 @@
"1723398114": "Una recente bolletta delle utenze (ad es. elettricità, acqua, gas, telefono o internet)",
"1723589564": "Rappresenta il numero massimo di contratti in essere nel tuo portafoglio. Ogni riga presente sul tuo portafoglio vale una posizione aperta. Una volta raggiunto il valore massimo, non potrai aprire nuove posizioni senza prima chiudere una posizione esistente.",
"1724696797": "È possibile avere un solo conto fiat.",
- "1725958461": "Numero del conto",
+ "1725958461": "Numero di conto",
"1726472773": "Funzione che non restituisce un valore",
"1726565314": "Chiudi il conto",
"1727681395": "Totale asset attivi nei conti demo Deriv e {{platform_name_mt5}}.",
@@ -1433,7 +1433,7 @@
"1791971912": "Recente",
"1793913365": "Per depositare denaro, passa al conto {{currency_symbol}}.",
"1794815502": "Scarica la cronologia delle tue operazioni.",
- "1796787905": "Carica il/i seguente/i documento/i.",
+ "1796787905": "Carica il/i documento/i seguente/i.",
"1798943788": "Puoi solo effettuare depositi.",
"1801093206": "Ottieni l'elenco candele",
"1801927731": "Conti {{platform_name_dxtrade}}",
@@ -1610,7 +1610,7 @@
"1988153223": "Indirizzo e-mail",
"1988302483": "Take profit:",
"1988601220": "Valore della durata",
- "1990331072": "Documento a verifica della proprietà",
+ "1990331072": "Prova di proprietà",
"1990735316": "Aumento pari a",
"1991448657": "Non conosci il tuo numero di identificazione fiscale? Clicca <0>qui0> per saperne di più.",
"1991524207": "Indice Jump 100",
@@ -1656,7 +1656,7 @@
"2037665157": "Espandi tutti i blocchi",
"2037906477": "ottieni sotto elenco da #",
"2042050260": "- Prezzo d'acquisto: il prezzo d'acquisto (puntata) del contratto",
- "2042115724": "Carica uno screenshot del tuo conto e della pagina delle informazioni personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
+ "2042115724": "Carica uno screenshot del tuo conto e della pagina dei dettagli personali con il tuo nome, numero di conto, numero di telefono e indirizzo email.",
"2042778835": "La presente politica sui reclami potrebbe cambiare nel tempo, e si applica ai conti registrati con {{legal_entity_name}}.",
"2044086432": "Quello di chiusura è l'ultimo tick entro l'orario di termine. Se selezioni un orario di termine preciso, quest'ultimo sarà l'orario selezionato.",
"2046273837": "Ultimo tick",
@@ -1702,7 +1702,7 @@
"2096456845": "Data di nascita*",
"2097170986": "Tether (Omni)",
"2097381850": "Calcola la linea della Media mobile semplice da un elenco con un periodo",
- "2097932389": "Carica 2 schermate separate dalla pagina delle informazioni personali e dalla pagina del conto tramite la pagina <0>https://app.astropay.com/profile0>",
+ "2097932389": "Carica 2 schermate separate dalla pagina dei dettagli personali e dalla pagina del conto tramite <0>https://app.astropay.com/profile0>",
"2100713124": "conto",
"2101972779": "Utilizzando un elenco di tick, ripropone l'esempio precedente.",
"2102572780": "Il codice deve comprendere 6 caratteri.",
@@ -1821,7 +1821,7 @@
"-922751756": "Meno di un anno",
"-542986255": "Nessuna",
"-1337206552": "Secondo le tue conoscenze, il trading con i CFD ti consente di",
- "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nullo.",
+ "-456863190": "Metti una posizione sul movimento del prezzo di un asset il cui risultato è un rendimento fisso o nulla.",
"-1314683258": "Effettuare un investimento a lungo termine per un profitto garantito.",
"-1546090184": "Come influisce la leva sul trading di CFD?",
"-1636427115": "La leva finanziaria ti aiuta a mitigare il rischio.",
@@ -1939,13 +1939,13 @@
"-1030759620": "Funzionari governativi",
"-1196936955": "Carica uno screenshot del tuo nome e indirizzo email dalla sezione delle informazioni personali.",
"-1286823855": "Carica l'estratto conto della bolletta del cellulare con il tuo nome e numero di telefono.",
- "-1309548471": "Carica l'estratto conto bancario con il tuo nome e le informazioni del conto.",
- "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e le ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
- "-3805155": "Carica uno screenshot di una delle seguenti informazioni per elaborare la transazione:",
+ "-1309548471": "Carica il tuo estratto conto bancario con il tuo nome e i dettagli del conto.",
+ "-1410396115": "Carica una foto che mostri il tuo nome e le prime sei e ultime quattro cifre del numero della tua carta. Se la carta non riporta il tuo nome, carica l'estratto conto bancario con il tuo nome e il numero della carta nella cronologia delle transazioni.",
+ "-3805155": "Carica uno screenshot di uno dei seguenti elementi per elaborare la transazione:",
"-1523487566": "- la sezione del profilo del tuo conto sul sito web",
"-613062596": "- la pagina delle informazioni sul conto sull'app",
"-1718304498": "ID utente",
- "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione delle informazioni personali dell'app o della sezione del profilo del tuo conto sul sito web.",
+ "-609424336": "Carica uno screenshot del tuo nome, numero di conto e indirizzo email dalla sezione dei dettagli personali dell'app o della sezione del profilo del tuo conto sul sito web.",
"-1954436643": "Carica uno screenshot del tuo nome utente nella pagina delle informazioni generali all'<0>indirizzo https://onlinenaira.com/members/index.htm0>",
"-79853954": "Carica uno screenshot del tuo numero di conto e del numero di telefono nella pagina del conto bancario/portafoglio mobile all'<0>indirizzo https://onlinenaira.com/members/bank.htm0>",
"-1192882870": "Carica uno screenshot del tuo nome e del tuo numero di conto dalla sezione dei dettagli personali.",
@@ -2039,10 +2039,10 @@
"-1725454783": "Non riuscito",
"-839094775": "Indietro",
"-856213726": "Dovrai inoltre consegnare un documento di verifica dell'identità.",
- "-987011273": "Il documento a verifica della proprietà non è richiesto.",
- "-808299796": "Al momento non è necessario presentare un documento a verifica della proprietà. Ti informeremo se in futuro sarà richiesto.",
- "-179726573": "Abbiamo ricevuto il tuo documento a verifica della proprietà.",
- "-813779897": "La verifica della proprietà è andata a buon fine.",
+ "-987011273": "La tua prova di proprietà non è richiesta.",
+ "-808299796": "Al momento non è necessario presentare una prova di proprietà. Ti informeremo se in futuro sarà richiesta una prova della proprietà.",
+ "-179726573": "Abbiamo ricevuto la tua prova di proprietà.",
+ "-813779897": "La verifica della proprietà è stata superata.",
"-1389323399": "Devi inserire {{min_number}}-{{max_number}} caratteri.",
"-1313806160": "Richiedi una nuova password e controlla di aver ricevuto un'e-mail con il nuovo token.",
"-329713179": "Ok",
@@ -2377,7 +2377,7 @@
"-451858550": "Facendo click su \"Continua\" verrai reindirizzato a {{ service }}, un fornitore di servizi di pagamento esterno. {{ website_name }} declina qualsiasi responsabilità per i contenuti o i servizi forniti da {{ service }}. Se riscontri problemi relativi ai servizi di {{ service }}, contatta direttamente {{ service }}.",
"-2005265642": "Fiat onramp è un servizio di cassa che permette di convertire valute fiat in criptovalute per ricaricare i conti per criptovalute di Deriv. Qui sono elencati gli scambi di criptovalute di parti terze; è necessario creare un conto apposito per utilizzare i loro servizi.",
"-1593063457": "Seleziona strumento di pagamento",
- "-953082600": "Alcuni metodi di pagamento possono non essere elencati qui, anche se gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per ulteriori verifiche.",
+ "-953082600": "Alcuni metodi di pagamento potrebbero non essere elencati qui, ma gli agenti di pagamento potrebbero comunque offrirli. Se non riesci a trovare il tuo metodo preferito, contatta direttamente gli agenti di pagamento per verificare ulteriormente.",
"-2004264970": "L'indirizzo di portafoglio deve comprendere dai 25 ai 64 caratteri.",
"-1707299138": "L'indirizzo di portafoglio {{currency_symbol}}",
"-38063175": "Portafoglio in {{account_text}}",
@@ -2767,8 +2767,8 @@
"-1719731099": "Grazie all'autenticazione a due fattori, il conto è protetto sia dalla password che dal telefono: in questo modo solo tu puoi accedere al conto anche se qualcuno conosce la password.",
"-2087822170": "Sei offline",
"-1669693571": "Verifica la tua connessione.",
- "-1706642239": "<1>È richiesto1> <0>un documento a verifica della proprietà0>",
- "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica il documento a verifica della3> <4>proprietà per sbloccarlo.4> <5>5>",
+ "-1706642239": "<1>È richiesta1> <0>una prova di proprietà0>",
+ "-553262593": "<0>0><1>Il tuo conto è attualmente bloccato1><2>2><3>Carica la prova di3> <4>proprietà per sbloccare il tuo conto.4> <5>5>",
"-1834929362": "Carica il documento",
"-1043638404": "<0>Verifica della proprietà0> <1>non riuscita1>",
"-1766760306": "<0>0><1>Carica il documento1> <2>con i dati corretti.<3>3>2>",
@@ -2955,7 +2955,7 @@
"-1300381594": "Ottieni gli strumenti di trading Acuity",
"-860609405": "Password",
"-742647506": "Trasferisci fondi",
- "-1972393174": "Fai trading con CFD sui nostri sintetici, panieri e sugli FX derivati.",
+ "-1972393174": "Fai trading con CFD sui nostri sintetici, sui panieri e sugli FX derivati.",
"-1357917360": "Terminale web",
"-1454896285": "L'app per Desktop di MT5 non è supportata da Windows XP, Windows 2003 e Windows Vista.",
"-810388996": "Scarica l'app mobile Deriv X",
diff --git a/packages/translations/src/translations/ru.json b/packages/translations/src/translations/ru.json
index 6d0d7f372f9c..49d90352585e 100644
--- a/packages/translations/src/translations/ru.json
+++ b/packages/translations/src/translations/ru.json
@@ -566,7 +566,7 @@
"724203548": "Вы можете отправить жалобу на платформу <0>онлайн-урегулирования споров (ODR) Европейской Комиссии0>. Это не относится к клиентам из Великобритании.",
"728042840": "Чтобы продолжить торговать у нас, пожалуйста, подтвердите свое место жительства.",
"728824018": "Испанский индекс",
- "729651741": "Выберите фото",
+ "729651741": "Выберите фотографию",
"730473724": "Этот блок выполняет логическую операцию «И» или «ИЛИ» с заданными значениями.",
"731382582": "BNB/USD",
"734390964": "Недостаточно средств на счете",
@@ -709,7 +709,7 @@
"915735109": "Вернуться на {{platform_name}}",
"918447723": "Реальный",
"920125517": "Добавить демо-счет",
- "921901739": "- данные банковского счета, привязанного к вашему счету",
+ "921901739": "- данные вашего банковского счета, привязанного к вашему счету",
"924046954": "Загрузите документ с вашим именем и номером банковского счета или реквизитами счета.",
"926813068": "Фиксированный/переменный",
"929608744": "Вы не можете выводить средства",
@@ -855,7 +855,7 @@
"1086118495": "Центр трейдера",
"1088138125": "Тик {{current_tick}} - ",
"1089085289": "Номер мобильного телефона",
- "1096078516": "Мы рассмотрим ваши документы и уведомим вас об их статусе в течение 3 дней.",
+ "1096078516": "Мы рассмотрим ваши документы и уведомим вас о их статусе в течение 3 дней.",
"1096175323": "Вам понадобится счет Deriv",
"1098147569": "Приобретайте товары или акции компании.",
"1098622295": "«i» начинается со значения 1 и увеличивается на 2 в каждом повторении. Цикл будет повторяться до тех пор, пока «i» не достигнет значения 12, и затем цикл будет прерван.",
@@ -946,7 +946,7 @@
"1201773643": "числовой",
"1203297580": "Этот блок отправляет сообщение в Telegram-канал.",
"1204223111": "В этом примере цены открытия из списка свечей присваиваются переменной с именем \"candle_list\".",
- "1206227936": "Как скрыть карту?",
+ "1206227936": "Как замаскировать карту?",
"1206821331": "Вооруженные силы",
"1208729868": "Тики",
"1208903663": "Неверный ключ",
@@ -1192,7 +1192,7 @@
"1481977420": "Помогите нам верифицировать ваш запрос на вывод средств.",
"1484336612": "Этот блок используется для завершения или продолжения цикла и может быть размещен в любом месте блока цикла.",
"1487086154": "Ваши документы успешно отправлены",
- "1488548367": "Загрузить снова",
+ "1488548367": "Загрузите снова",
"1490583127": "DBot пока не готов к использованию на реальных счетах",
"1491392301": "<0>Продано за0>: {{sold_for}}",
"1492686447": "Ваш счет MT5 Финансовый STP будет открыт в Deriv (FX) Ltd. Все операции на этом счете регулируются правилами и руководящими принципами Управления финансовых услуг Лабуана (LFSA). Правила и принципы Управления финансовых услуг Лабуана (LFSA) не распространяются ни на один из ваших других счетов, включая счет Deriv.",
@@ -1234,7 +1234,7 @@
"1540585098": "Отклонить",
"1541969455": "Оба",
"1544642951": "Выбрав \"Только вверх\", вы получите выплату, если несколько тиков подряд будут расти по отношению к котировке на входе. Если любой тик покажет снижение или будет равен одному из предыдущих тиков, вы не получите выплату.",
- "1547148381": "Файл слишком большой (разрешено не более 8 МБ). Попробуйте другой файл.",
+ "1547148381": "Этот файл слишком велик (разрешено не более 8 МБ). Пожалуйста, загрузите еще один файл.",
"1548765374": "Не удалось верифицировать номер документа",
"1549098835": "Общая сумма вывода",
"1551172020": "Индекс AUD",
@@ -1433,7 +1433,7 @@
"1791971912": "Недавние",
"1793913365": "Чтобы внести средства, перейдите на свой счет {{currency_symbol}}.",
"1794815502": "Загрузить историю транзакций.",
- "1796787905": "Загрузите следующие документы.",
+ "1796787905": "Пожалуйста, загрузите следующие документы.",
"1798943788": "Вы можете делать только депозиты.",
"1801093206": "Получить список свечей",
"1801927731": "счета {{platform_name_dxtrade}}",
@@ -1944,7 +1944,7 @@
"-3805155": "Загрузите скриншот одного из следующих изображений для обработки транзакции:",
"-1523487566": "- раздел профиля вашей учетной записи на сайте",
"-613062596": "- страница «Информация об учетной записи» в приложении",
- "-1718304498": "ID пользователя",
+ "-1718304498": "Идентификатор пользователя",
"-609424336": "Загрузите скриншот своего имени, номера счета и адреса электронной почты из раздела личных данных приложения или раздела профиля своей учетной записи на веб-сайте.",
"-1954436643": "Загрузите скриншот своего имени пользователя на странице «Общая информация» по адресу <0>https://onlinenaira.com/members/index.htm0>",
"-79853954": "Загрузите скриншот номера своего счета и номера телефона на странице «Банковский счет/мобильный кошелек» по адресу <0>https://onlinenaira.com/members/bank.htm0>",
diff --git a/packages/translations/src/translations/th.json b/packages/translations/src/translations/th.json
index c30b93cfd7fe..b2fb527430ee 100644
--- a/packages/translations/src/translations/th.json
+++ b/packages/translations/src/translations/th.json
@@ -589,7 +589,7 @@
"759783233": "สําหรับข้อมูลเพิ่มเติมและความช่วยเหลือให้คําปรึกษาและบริการสนับสนุนต่าง โปรดไปที่ <0>begambleaware.org0>",
"760528514": "โปรดทราบว่า การเปลี่ยนค่าของ \"i\" จะไม่เปลี่ยนแปลงค่าของรายการตัวต้นฉบับในลิสต์",
"761576760": "ฝากเงินเข้าบัญชีของคุณเพื่อเริ่มทำการซื้อขาย",
- "762185380": "<0>เพิ่มทวีผลที่ได้รับ 0> โดย <0>มีความเสี่ยงเพียงเฉพาะ0> ทุนทรัพย์ที่คุณลงไป",
+ "762185380": "<0>ได้ผลตอบแทนเพิ่มทวีคูณ 0> โดย <0>เสี่ยงเพียงเฉพาะ0> สิ่งที่คุณวางเดิมพัน",
"762871622": "{{remaining_time}}วินาที",
"763019867": "บัญชีเกมของคุณมีกำหนดที่จะถูกปิด",
"764366329": "วงเงินในการซื้อขาย",
@@ -2888,7 +2888,7 @@
"-895091803": "หากคุณกำลังมองหาสัญญาการซื้อขายส่วนต่าง",
"-1447215751": "ไม่แน่ใจ? ลองนี่สิ",
"-2338797": "<0>เพิ่มผลตอบแทนสูงสุด 0> โดย <0>เสี่ยงมากกว่า0> สิ่งที่คุณวางเดิมพัน",
- "-1682067341": "รับ <0>ผลที่ได้รับในอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> ทุนทรัพย์ที่คุณลงไป",
+ "-1682067341": "รับ <0>ผลตอบแทนอัตราคงที่ 0> โดย <0>เสี่ยงเพียง0> สิ่งที่คุณวางเดิมพัน",
"-1744351732": "ไม่แน่ใจว่าจะเริ่มต้นที่ไหน?",
"-943710774": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ First Floor, Millennium House, Victoria Road, Douglas, Isle of Man, IM2 4RW บริษัทนี้ได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย (1) Gambling Supervision Commission ในเกาะไอล์ออฟแมน (ปัจจุบัน <0>ใบอนุญาต0> ออกเมื่อวันที่ 31 สิงหาคม ค. ศ. 2017) และ (2) Gambling Commission ในสหราชอาณาจักร (<1>ใบอนุญาตเลขที่ 391721>)",
"-255056078": "นโยบายการร้องเรียนนี้ซึ่งอาจมีการเปลี่ยนแปลงเป็นครั้งคราว มีผลบังคับใช้กับบัญชีของคุณที่ลงทะเบียนกับ {{legal_entity_name}} ซึ่งมีที่อยู่สำนักงานที่จดทะเบียนไว้ที่ Level 3, Triq Dun Karm, Birkirkara, BKR 9033 ประเทศมอลตา บริษัทได้รับใบอนุญาตและถูกกำกับควบคุมตามกฎหมายโดย Malta Gaming Authority ในประเทศมอลตาสำหรับผลิตภัณฑ์การพนันเท่านั้น <0>ใบอนุญาตเลขที่ MGA/B2C/102/20000> และสำหรับลูกค้าที่อาศัยอยู่ในสหราชอาณาจักรโดย UK Gambling Commission (เลขที่บัญชี 39495)",
@@ -3216,7 +3216,7 @@
"-313112159": "บล็อกนี้จะคล้ายกับบล็อกด้านบน แต่ต่างกันที่ว่าบล๊อกนี้จะส่งคืนค่ามาอันหนึ่ง โดยค่าที่ส่งคืนนั้นสามารถถูกกำหนดให้กับตัวแปรที่คุณเลือกได้",
"-1783320173": "คืนค่าภายในฟังก์ชันก่อนกําหนด",
"-1485521724": "การส่งคืนตามเงื่อนไข",
- "-1482801393": "ผลที่ได้รับ",
+ "-1482801393": "ผลตอบแทน",
"-46453136": "ได้รับ",
"-1838027177": "อย่างแรก",
"-1182568049": "รับรายการในลิสต์",
From 3cd1f981a7e9237fccdd43dcb088a53c77eda7be Mon Sep 17 00:00:00 2001
From: Niloofar Sadeghi <93518187+niloofar-deriv@users.noreply.github.com>
Date: Mon, 9 Jan 2023 15:11:32 +0330
Subject: [PATCH 12/84] Niloofar Sadeghi / Refactor tests in the
route-with-sub-routes.spec.tsx file (Core) (#7215)
* test: writting test for route-with-sub-routes component
* refactor: removed extra export from the component
Co-authored-by: Niloofar Sadeghi
---
.../__tests__/route-with-sub-routes.spec.tsx | 79 +++++++++++++------
.../Routes/route-with-sub-routes.jsx | 2 -
2 files changed, 53 insertions(+), 28 deletions(-)
diff --git a/packages/core/src/App/Components/Routes/__tests__/route-with-sub-routes.spec.tsx b/packages/core/src/App/Components/Routes/__tests__/route-with-sub-routes.spec.tsx
index 3ca94f68d347..cceaaa6cd435 100644
--- a/packages/core/src/App/Components/Routes/__tests__/route-with-sub-routes.spec.tsx
+++ b/packages/core/src/App/Components/Routes/__tests__/route-with-sub-routes.spec.tsx
@@ -1,30 +1,57 @@
-// TODO refactor old tests in this component
import React from 'react';
-import { RouteWithSubRoutesRender } from '../route-with-sub-routes.jsx';
import { Redirect } from 'react-router-dom';
-import { PlatformContext } from '@deriv/shared';
-
-// configure({ adapter: new Adapter() });
-
-describe('', () => {
- it('should render one component', () => {
- // const comp = (
- //
- //
- //
- // );
- // const wrapper = shallow(comp);
- // expect(wrapper).toHaveLength(1);
+import { render, screen } from '@testing-library/react';
+import RouteWithSubRoutes from '../route-with-sub-routes';
+
+type TMockFunction = {
+ path: string;
+ exact?: boolean;
+};
+
+jest.mock('Stores/connect', () => ({
+ __esModule: true,
+ default: 'mockedDefaultExport',
+ connect:
+ () =>
+ (Component: T) =>
+ Component,
+}));
+
+jest.mock('react-router-dom', () => ({
+ ...jest.requireActual('react-router-dom'),
+ Route: jest.fn(({ path, exact }: TMockFunction) => (
+
}
className={classNames({ 'dc-popover__wrapper': relative_render })}
onClick={onClick}
diff --git a/packages/core/src/App/Components/Layout/Footer/__tests__/toggle-fullscreen.spec.tsx b/packages/core/src/App/Components/Layout/Footer/__tests__/toggle-fullscreen.spec.tsx
index 0824695cace2..76a6b94aca1a 100644
--- a/packages/core/src/App/Components/Layout/Footer/__tests__/toggle-fullscreen.spec.tsx
+++ b/packages/core/src/App/Components/Layout/Footer/__tests__/toggle-fullscreen.spec.tsx
@@ -1,21 +1,26 @@
-// TODO refactor old tests in this component
import React from 'react';
-import { ToggleFullScreen } from '../toggle-fullscreen.jsx';
-import { Icon } from '@deriv/components';
import { render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { ToggleFullScreen } from '../toggle-fullscreen.jsx';
describe('ToggleFullScreen Component', () => {
- it('should not have "ic-fullscreen--active" class when "is_full_screen" is false', () => {
+ it('should not have "ic-fullscreen--active" class when "is_full_screen" is "false"', () => {
render();
- const aElement = screen.getByTestId('dt_fullscreen_toggle');
- expect(aElement).not.toHaveClass('ic-fullscreen--active');
+ const a_element = screen.getByTestId('dt_fullscreen_toggle');
+ expect(a_element).not.toHaveClass('ic-fullscreen--active');
});
- // it('should have "Full screen" text when "is_full_screen" is false', () => {
- // render();
- // });
+ it('should have "Full screen" text when "is_full_screen" is "false"', () => {
+ render();
+ const popover_wrapper = screen.getByTestId('dt_popover_wrapper');
+ userEvent.hover(popover_wrapper);
+ const message = screen.getByText(/full screen/i);
+ expect(message).toBeInTheDocument();
+ });
- // it('should render "IcFullScreen" icon when "is_full_screen" is false', () => {
- // render();
- // });
+ it('should render "IcFullScreen" icon when "is_full_screen" is "false"', () => {
+ render();
+ const icon = screen.getByTestId('dt_icon');
+ expect(icon).toBeInTheDocument();
+ });
});
diff --git a/packages/core/src/App/Components/Layout/Footer/toggle-fullscreen.jsx b/packages/core/src/App/Components/Layout/Footer/toggle-fullscreen.jsx
index bd24d266871d..1835de531903 100644
--- a/packages/core/src/App/Components/Layout/Footer/toggle-fullscreen.jsx
+++ b/packages/core/src/App/Components/Layout/Footer/toggle-fullscreen.jsx
@@ -55,7 +55,7 @@ const ToggleFullScreen = () => {
{is_full_screen ? (
) : (
-
+
)}
diff --git a/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx b/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx
index 106d5f706b96..f0a50f2c6bf8 100644
--- a/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx
+++ b/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx
@@ -6,7 +6,7 @@ import AccountInfo from '../account-info.jsx';
describe('AccountInfo component', () => {
it('should show "disabled_message" when "is_disabled" property is "true"', () => {
render();
- const popover = screen.getByTestId('dt_popover_container');
+ const popover = screen.getByTestId('dt_popover_wrapper');
userEvent.hover(popover);
const disabled_message = screen.getByText(/test disabled message/i);
expect(disabled_message).toBeInTheDocument();
From f67451a9b3bc2b5b5bc63f408fda15d016ddb5b1 Mon Sep 17 00:00:00 2001
From: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com>
Date: Mon, 9 Jan 2023 20:31:49 +0800
Subject: [PATCH 19/84] fix: description should be called from general_store,
not my_ads (#7236)
---
packages/p2p/src/components/my-ads/create-ad-form.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/p2p/src/components/my-ads/create-ad-form.jsx b/packages/p2p/src/components/my-ads/create-ad-form.jsx
index c8bdea41b064..326327599d0f 100644
--- a/packages/p2p/src/components/my-ads/create-ad-form.jsx
+++ b/packages/p2p/src/components/my-ads/create-ad-form.jsx
@@ -95,7 +95,7 @@ const CreateAdForm = () => {
Date: Mon, 9 Jan 2023 20:33:30 +0800
Subject: [PATCH 20/84] fix: fixed the overflowed text in buy/sell order
instruction details (#7264)
---
packages/p2p/src/components/order-details/order-details.jsx | 2 +-
packages/p2p/src/components/order-details/order-details.scss | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/p2p/src/components/order-details/order-details.jsx b/packages/p2p/src/components/order-details/order-details.jsx
index 4f17b46c023b..d71fa224f678 100644
--- a/packages/p2p/src/components/order-details/order-details.jsx
+++ b/packages/p2p/src/components/order-details/order-details.jsx
@@ -19,12 +19,12 @@ import PaymentMethodAccordionHeader from './payment-method-accordion-header.jsx'
import PaymentMethodAccordionContent from './payment-method-accordion-content.jsx';
import MyProfileSeparatorContainer from '../my-profile/my-profile-separator-container';
import { setDecimalPlaces, removeTrailingZeros, roundOffDecimal } from 'Utils/format-value';
-import 'Components/order-details/order-details.scss';
import LoadingModal from '../loading-modal';
import InvalidVerificationLinkModal from '../invalid-verification-link-modal';
import EmailLinkBlockedModal from '../email-link-blocked-modal';
import EmailLinkVerifiedModal from '../email-link-verified-modal';
import { getDateAfterHours } from 'Utils/date-time';
+import './order-details.scss';
const OrderDetails = observer(() => {
const { general_store, my_profile_store, order_store, sendbird_store } = useStores();
diff --git a/packages/p2p/src/components/order-details/order-details.scss b/packages/p2p/src/components/order-details/order-details.scss
index b08887c72a2c..4e4a02c29b75 100644
--- a/packages/p2p/src/components/order-details/order-details.scss
+++ b/packages/p2p/src/components/order-details/order-details.scss
@@ -231,6 +231,7 @@ $card-width: 456px;
line-height: 1.43;
color: var(--text-general);
word-break: break-word;
+ white-space: pre-line;
}
}
From 3473fb397d4829c59b61f21a634a8eec9a9d44b6 Mon Sep 17 00:00:00 2001
From: kate-deriv <121025168+kate-deriv@users.noreply.github.com>
Date: Mon, 9 Jan 2023 15:34:55 +0300
Subject: [PATCH 21/84] kate/80180/Update_DP2P_content_on_cashier_page (#7233)
* fix: Update DP2P content on cashier page
* test: rewrite test for cashier-onboarding file because the taxt was changed
---
.../__tests__/cashier-onboarding.spec.js | 8 ++++----
.../cashier-onboarding/cashier-onboarding-providers.js | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/cashier/src/components/cashier-onboarding/__tests__/cashier-onboarding.spec.js b/packages/cashier/src/components/cashier-onboarding/__tests__/cashier-onboarding.spec.js
index d08984e42a29..f888d71f1f55 100644
--- a/packages/cashier/src/components/cashier-onboarding/__tests__/cashier-onboarding.spec.js
+++ b/packages/cashier/src/components/cashier-onboarding/__tests__/cashier-onboarding.spec.js
@@ -100,7 +100,7 @@ describe('', () => {
expect(screen.getByText('Deposit with Deriv P2P')).toBeInTheDocument();
expect(
screen.getByText(
- 'Deposit in your local currency via peer-to-peer exchange with fellow traders in your country.'
+ 'Deposit with your local currency via peer-to-peer exchange with fellow traders in your country.'
)
).toBeInTheDocument();
});
@@ -262,7 +262,7 @@ describe('', () => {
const node_list = screen.getAllByTestId('dt_cashier_onboarding_detail_div');
const deposit_with_dp2p_detail_div = Array.from(node_list).find(node =>
node.textContent.includes(
- 'Deposit in your local currency via peer-to-peer exchange with fellow traders in your country.'
+ 'Deposit with your local currency via peer-to-peer exchange with fellow traders in your country.'
)
);
fireEvent.click(deposit_with_dp2p_detail_div);
@@ -283,7 +283,7 @@ describe('', () => {
const node_list = screen.getAllByTestId('dt_cashier_onboarding_detail_div');
const deposit_with_dp2p_detail_div = Array.from(node_list).find(node =>
node.textContent.includes(
- 'Deposit in your local currency via peer-to-peer exchange with fellow traders in your country.'
+ 'Deposit with your local currency via peer-to-peer exchange with fellow traders in your country.'
)
);
fireEvent.click(deposit_with_dp2p_detail_div);
@@ -301,7 +301,7 @@ describe('', () => {
const node_list = screen.getAllByTestId('dt_cashier_onboarding_detail_div');
const deposit_with_dp2p_detail_div = Array.from(node_list).find(node =>
node.textContent.includes(
- 'Deposit in your local currency via peer-to-peer exchange with fellow traders in your country.'
+ 'Deposit with your local currency via peer-to-peer exchange with fellow traders in your country.'
)
);
fireEvent.click(deposit_with_dp2p_detail_div);
diff --git a/packages/cashier/src/components/cashier-onboarding/cashier-onboarding-providers.js b/packages/cashier/src/components/cashier-onboarding/cashier-onboarding-providers.js
index addd5049c8b0..f1bdc155f1c1 100644
--- a/packages/cashier/src/components/cashier-onboarding/cashier-onboarding-providers.js
+++ b/packages/cashier/src/components/cashier-onboarding/cashier-onboarding-providers.js
@@ -73,7 +73,7 @@ const createDp2pProvider = onClick => {
return {
detail_click: onClick,
detail_description: localize(
- 'Deposit in your local currency via peer-to-peer exchange with fellow traders in your country.'
+ 'Deposit with your local currency via peer-to-peer exchange with fellow traders in your country.'
),
detail_header: localize('Deposit with Deriv P2P'),
};
From c9dd30a2b880887628949710a91ef0c629667555 Mon Sep 17 00:00:00 2001
From: kate-deriv <121025168+kate-deriv@users.noreply.github.com>
Date: Mon, 9 Jan 2023 15:49:25 +0300
Subject: [PATCH 22/84] fix: add hook useCallback for topWidgets component to
avoid rerender (#7319)
---
.../src/Modules/Trading/Containers/trade.jsx | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/packages/trader/src/Modules/Trading/Containers/trade.jsx b/packages/trader/src/Modules/Trading/Containers/trade.jsx
index 7b01d9213eeb..b86795169f37 100644
--- a/packages/trader/src/Modules/Trading/Containers/trade.jsx
+++ b/packages/trader/src/Modules/Trading/Containers/trade.jsx
@@ -128,14 +128,17 @@ const Trade = ({
}
};
- const topWidgets = ({ ...params }) => (
-
+ const topWidgets = React.useCallback(
+ ({ ...params }) => (
+
+ ),
+ [open_market, try_synthetic_indices, try_open_markets, charts_ref, is_digits_widget_active]
);
const form_wrapper_class = isMobile() ? 'mobile-wrapper' : 'sidebar__container desktop-only';
From 81b7d844d801d68be59935d02902a1a7d1d0d5bf Mon Sep 17 00:00:00 2001
From: balakrishna-deriv <56330681+balakrishna-deriv@users.noreply.github.com>
Date: Tue, 10 Jan 2023 10:34:18 +0400
Subject: [PATCH 23/84] Tib|Bala/No 404 during cloudflare pages routing (#7280)
* Rename 404.html to custom404.html
Cloudflare pages don't need it and nginx will work like
before since the filname is defined in the nginx config.
* refactor: rename 404 file
* chore: add vercel.json
* chore: add SPA fallback
Co-authored-by: thibault-deriv <104425314+thibault-deriv@users.noreply.github.com>
Co-authored-by: Yashim Wong
---
default.conf | 2 +-
packages/cfd/build/config.js | 2 +-
packages/core/build/config.js | 2 +-
packages/core/src/root_files/{404.html => custom404.html} | 0
packages/reports/build/config.js | 2 +-
packages/trader/build/config.js | 2 +-
vercel.json | 3 +++
7 files changed, 8 insertions(+), 5 deletions(-)
rename packages/core/src/root_files/{404.html => custom404.html} (100%)
create mode 100644 vercel.json
diff --git a/default.conf b/default.conf
index dc30eaf06a1a..ecb687ff0ffd 100644
--- a/default.conf
+++ b/default.conf
@@ -10,7 +10,7 @@ server {
charset UTF-8;
- error_page 404 /404.html;
+ error_page 404 /custom404.html;
location @custom_error_503 {
return 503;
diff --git a/packages/cfd/build/config.js b/packages/cfd/build/config.js
index 518dbeb33af1..224d935f137b 100644
--- a/packages/cfd/build/config.js
+++ b/packages/cfd/build/config.js
@@ -7,7 +7,7 @@ const IS_RELEASE = process.env.NODE_ENV === 'production' || process.env.NODE_ENV
const generateSWConfig = () => ({
importWorkboxFrom: 'local',
cleanupOutdatedCaches: true,
- exclude: [/CNAME$/, /index\.html$/, /404\.html$/],
+ exclude: [/CNAME$/, /index\.html$/, /custom404\.html$/],
skipWaiting: true,
clientsClaim: true,
});
diff --git a/packages/core/build/config.js b/packages/core/build/config.js
index ce683e74a215..dec4a3e76f9f 100644
--- a/packages/core/build/config.js
+++ b/packages/core/build/config.js
@@ -87,7 +87,7 @@ const copyConfig = base => {
to: 'assetlinks.json',
toType: 'file',
},
- { from: path.resolve(__dirname, '../src/root_files/404.html'), to: '404.html', toType: 'file' },
+ { from: path.resolve(__dirname, '../src/root_files/custom404.html'), to: 'custom404.html', toType: 'file' },
{
from: path.resolve(__dirname, '../src/root_files/localstorage-sync.html'),
to: 'localstorage-sync.html',
diff --git a/packages/core/src/root_files/404.html b/packages/core/src/root_files/custom404.html
similarity index 100%
rename from packages/core/src/root_files/404.html
rename to packages/core/src/root_files/custom404.html
diff --git a/packages/reports/build/config.js b/packages/reports/build/config.js
index 86801396ab25..8c9c59a52b34 100644
--- a/packages/reports/build/config.js
+++ b/packages/reports/build/config.js
@@ -5,7 +5,7 @@ const { IS_RELEASE } = require('./constants');
const generateSWConfig = () => ({
importWorkboxFrom: 'local',
cleanupOutdatedCaches: true,
- exclude: [/CNAME$/, /index\.html$/, /404\.html$/],
+ exclude: [/CNAME$/, /index\.html$/, /custom404\.html$/],
skipWaiting: true,
clientsClaim: true,
});
diff --git a/packages/trader/build/config.js b/packages/trader/build/config.js
index bc266d6a99eb..51c26e37ee65 100644
--- a/packages/trader/build/config.js
+++ b/packages/trader/build/config.js
@@ -6,7 +6,7 @@ const { IS_RELEASE } = require('./constants');
const generateSWConfig = () => ({
importWorkboxFrom: 'local',
cleanupOutdatedCaches: true,
- exclude: [/CNAME$/, /index\.html$/, /404\.html$/, /^public\/images\/favicons\//, /^favicon\.ico$/],
+ exclude: [/CNAME$/, /index\.html$/, /custom404\.html$/, /^public\/images\/favicons\//, /^favicon\.ico$/],
skipWaiting: true,
clientsClaim: true,
});
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 000000000000..4fa234ff1b77
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,3 @@
+{
+ "routes": [{ "handle": "filesystem" }, { "src": "/(.*)", "dest": "/index.html" }]
+}
From c95beaf1259812e4f2899fcd60027f69552f632f Mon Sep 17 00:00:00 2001
From: amina-deriv <84661147+amina-deriv@users.noreply.github.com>
Date: Wed, 11 Jan 2023 10:10:43 +0400
Subject: [PATCH 24/84] Amina/feat: milestone_2_dbvi (#6935)
* fix: update master
* fix: add astericks to place of birth, tax residence and account opening reason
* fix: remove better spreads from BVI
* fix: maltainvest should verify through onfido
* fix: icons design for MT5 financial and derived accounts
* fix: notification
Co-authored-by: tay suisin
Co-authored-by: Sui Sin <103026762+suisin-deriv@users.noreply.github.com>
Co-authored-by: Matin shafiei
---
.../address-details/address-details.jsx | 11 +-
.../submitted/__tests__/submitted.spec.tsx | 8 +-
.../poa/status/submitted/submitted.tsx | 6 +-
.../poi-poa-docs-submitted.jsx | 46 +-
.../__tests__/idv-submit-complete.spec.js | 4 +-
.../idv-submit-complete.jsx | 4 +-
.../unsupported/card-details/uploader.jsx | 2 +-
.../status/unsupported/detail-component.jsx | 2 +-
.../poi/status/unsupported/unsupported.jsx | 2 +-
.../__tests__/upload-complete.spec.js | 25 +-
.../upload-complete/upload-complete.jsx | 12 +-
.../src/Configs/address-details-config.js | 3 +
.../proof-of-identity-container-for-mt5.jsx | 28 +-
.../proof-of-identity-container.jsx | 1 +
.../proof-of-identity-submission.jsx | 8 +
.../src/components/CFDs/cfd-accounts.scss | 6 +-
.../src/modules/trading-hub/index.tsx | 2 -
packages/cfd/build/webpack.config.js | 1 -
.../cfd/src/Components/cfd-account-card.tsx | 118 ++-
.../Components/cfd-personal-details-form.tsx | 38 +-
packages/cfd/src/Components/cfd-poa.tsx | 26 +-
packages/cfd/src/Components/props.types.ts | 4 +
.../src/Constants/jurisdiction-contents.ts | 3 +-
.../__tests__/cfd-dashboard.spec.tsx | 2 -
.../__tests__/cfd-password-modal.spec.js | 19 +-
packages/cfd/src/Containers/cfd-dashboard.tsx | 8 +-
.../src/Containers/cfd-dbvi-onboarding.tsx | 142 ++-
.../cfd-financial-stp-real-account-signup.tsx | 75 +-
.../cfd/src/Containers/cfd-password-modal.tsx | 194 +++--
...tsx => cfd-personal-details-container.tsx} | 94 +-
.../Containers/jurisdiction-modal-content.tsx | 814 ------------------
.../cfd/src/Containers/jurisdiction-modal.tsx | 381 --------
.../jurisdiction-card-banner.tsx | 64 +-
.../jurisdiction-modal/jurisdiction-card.tsx | 4 +-
.../jurisdiction-modal-checkbox.tsx | 44 +-
.../jurisdiction-modal-content.tsx | 3 +-
.../jurisdiction-modal-foot-note.tsx | 89 +-
.../jurisdiction-modal/jurisdiction-modal.tsx | 142 +--
.../Containers/mt5-compare-table-content.tsx | 89 +-
.../cfd/src/Containers/mt5-trade-modal.tsx | 2 +-
packages/cfd/src/Containers/props.types.ts | 46 +-
.../cfd/src/Stores/Modules/CFD/cfd-store.js | 31 +-
packages/cfd/src/sass/cfd-dashboard.scss | 17 +-
packages/cfd/src/sass/cfd.scss | 3 +
.../icon/mt5/ic-mt5-financial-platform.svg | 2 +-
.../icon/mt5/ic-mt5-synthetic-platform.svg | 2 +-
.../components/page-overlay/page-overlay.jsx | 14 +-
.../Containers/app-notification-messages.jsx | 1 +
packages/core/src/Stores/client-store.js | 11 +
.../core/src/Stores/notification-store.js | 25 +-
packages/core/src/root_files/custom404.html | 171 ++--
packages/shared/src/utils/cfd/cfd.ts | 70 +-
.../sass/app/modules/mt5/cfd-dashboard.scss | 1 -
53 files changed, 871 insertions(+), 2049 deletions(-)
rename packages/cfd/src/Containers/{cfd-personal-details-modal.tsx => cfd-personal-details-container.tsx} (61%)
delete mode 100644 packages/cfd/src/Containers/jurisdiction-modal-content.tsx
delete mode 100644 packages/cfd/src/Containers/jurisdiction-modal.tsx
diff --git a/packages/account/src/Components/address-details/address-details.jsx b/packages/account/src/Components/address-details/address-details.jsx
index 19cebd174bbe..fde781ce06ca 100644
--- a/packages/account/src/Components/address-details/address-details.jsx
+++ b/packages/account/src/Components/address-details/address-details.jsx
@@ -47,6 +47,7 @@ const AddressDetails = ({
validate,
onSubmit,
is_svg,
+ is_mf,
is_gb_residence,
onSubmitEnabledChange,
selected_step_ref,
@@ -149,9 +150,9 @@ const AddressDetails = ({
diff --git a/packages/account/src/Components/poa/status/submitted/__tests__/submitted.spec.tsx b/packages/account/src/Components/poa/status/submitted/__tests__/submitted.spec.tsx
index 4729473553c0..a2b7f9c33eee 100644
--- a/packages/account/src/Components/poa/status/submitted/__tests__/submitted.spec.tsx
+++ b/packages/account/src/Components/poa/status/submitted/__tests__/submitted.spec.tsx
@@ -14,7 +14,7 @@ describe('', () => {
it('should render the Submitted component', () => {
renderWithRouter();
- expect(screen.getByText('Your proof of address was submitted successfully')).toBeInTheDocument();
+ expect(screen.getByText('Your documents were submitted successfully')).toBeInTheDocument();
});
it('should show submit_poi message if needs_poi is true', () => {
@@ -22,9 +22,11 @@ describe('', () => {
expect(screen.getByText('You must also submit a proof of identity.')).toBeInTheDocument();
});
- it('should show review message if needs_poi is false', () => {
+ it('should show review message if needs_poi is true', () => {
renderWithRouter();
- expect(screen.getByText('Your document is being reviewed, please check back in 1-3 days.')).toBeInTheDocument();
+ expect(
+ screen.getByText('We’ll review your documents and notify you of its status within 1 to 3 days.')
+ ).toBeInTheDocument();
});
it('should show ContinueTradingButton if needs_poi is false and is_description_enabled is false', () => {
diff --git a/packages/account/src/Components/poa/status/submitted/submitted.tsx b/packages/account/src/Components/poa/status/submitted/submitted.tsx
index 10c83c99a149..b83fe43a9245 100644
--- a/packages/account/src/Components/poa/status/submitted/submitted.tsx
+++ b/packages/account/src/Components/poa/status/submitted/submitted.tsx
@@ -10,7 +10,7 @@ import IconMessageContent from 'Components/icon-message-content';
export const Submitted = ({ needs_poi, is_description_enabled = true }: TPoaStatusProps) => {
const { is_appstore }: TPlatformContext = React.useContext(PlatformContext);
- const message = localize('Your proof of address was submitted successfully');
+ const message = localize('Your documents were submitted successfully');
if (needs_poi) {
return (
- {localize('Your document is being reviewed, please check back in 1-3 days.')}
+ {localize('We’ll review your documents and notify you of its status within 1 to 3 days.')}
{localize('You must also submit a proof of identity.')}
@@ -44,7 +44,7 @@ export const Submitted = ({ needs_poi, is_description_enabled = true }: TPoaStat
>
}
full_width={is_appstore}
>
diff --git a/packages/account/src/Components/poi-poa-docs-submitted/poi-poa-docs-submitted.jsx b/packages/account/src/Components/poi-poa-docs-submitted/poi-poa-docs-submitted.jsx
index 0fd3a00f3c57..5989c2f3230d 100644
--- a/packages/account/src/Components/poi-poa-docs-submitted/poi-poa-docs-submitted.jsx
+++ b/packages/account/src/Components/poi-poa-docs-submitted/poi-poa-docs-submitted.jsx
@@ -1,39 +1,59 @@
import React from 'react';
-import { Button, Icon } from '@deriv/components';
+import { Button, Icon, Loading } from '@deriv/components';
import { localize } from '@deriv/translations';
import { getAuthenticationStatusInfo } from '@deriv/shared';
-
import IconMessageContent from 'Components/icon-message-content';
-const PoiPoaDocsSubmitted = ({ account_status, is_vanuatu_selected, onClickOK, updateAccountStatus }) => {
+const PoiPoaDocsSubmitted = ({
+ account_status,
+ jurisdiction_selected_shortcode,
+ onClickOK,
+ updateAccountStatus,
+ has_created_account_for_selected_jurisdiction,
+ openPasswordModal,
+}) => {
+ const [is_loading, setIsLoading] = React.useState(false);
React.useEffect(() => {
- updateAccountStatus();
+ setIsLoading(true);
+ updateAccountStatus()
+ .then(() => {
+ setIsLoading(false);
+ })
+ .finally(() => setIsLoading(false));
//eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
- const message = localize('Your documents were submitted successfully');
+ const onSubmit = () => {
+ onClickOK();
+ if (!has_created_account_for_selected_jurisdiction) {
+ openPasswordModal();
+ }
+ };
+
const getDescription = () => {
- const { manual_status, poi_verified_for_vanuatu, poi_verified_for_bvi_labuan_maltainvest, poa_pending } =
+ const { manual_status, poi_verified_for_vanuatu_maltainvest, poi_verified_for_bvi_labuan, poa_pending } =
getAuthenticationStatusInfo(account_status);
-
+ const is_vanuatu_or_maltainvest_selected =
+ jurisdiction_selected_shortcode === 'vanuatu' || jurisdiction_selected_shortcode === 'maltainvest';
if (
- (is_vanuatu_selected && poi_verified_for_vanuatu && poa_pending) ||
- (!is_vanuatu_selected && poi_verified_for_bvi_labuan_maltainvest && poa_pending) ||
+ (is_vanuatu_or_maltainvest_selected && poi_verified_for_vanuatu_maltainvest && poa_pending) ||
+ (!is_vanuatu_or_maltainvest_selected && poi_verified_for_bvi_labuan && poa_pending) ||
manual_status === 'pending'
) {
return localize('We’ll review your documents and notify you of its status within 1 - 3 working days.');
}
return localize('We’ll review your documents and notify you of its status within 5 minutes.');
};
-
- return (
+ return is_loading ? (
+
+ ) : (
}
className='poi-poa-submitted'
>
-
+
);
};
diff --git a/packages/account/src/Components/poi/idv-status/idv-submit-complete/__tests__/idv-submit-complete.spec.js b/packages/account/src/Components/poi/idv-status/idv-submit-complete/__tests__/idv-submit-complete.spec.js
index 653f8499e1b8..c07eae73190a 100644
--- a/packages/account/src/Components/poi/idv-status/idv-submit-complete/__tests__/idv-submit-complete.spec.js
+++ b/packages/account/src/Components/poi/idv-status/idv-submit-complete/__tests__/idv-submit-complete.spec.js
@@ -13,9 +13,9 @@ describe('', () => {
const commonRenderCheck = () => {
expect(screen.getByText('IdvDocumentPending')).toBeInTheDocument();
- expect(screen.getByText('Your ID number was submitted successfully')).toBeInTheDocument();
+ expect(screen.getByText('Your documents were submitted successfully')).toBeInTheDocument();
expect(
- screen.getByText("We'll process your details within a few minutes and notify its status via email.")
+ screen.getByText('We’ll review your documents and notify you of its status within 5 minutes.')
).toBeInTheDocument();
};
it('should render IdvSubmitComplete component not external, no needs_poa', () => {
diff --git a/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.jsx b/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.jsx
index 09446c67a69b..d98d9c363c66 100644
--- a/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.jsx
+++ b/packages/account/src/Components/poi/idv-status/idv-submit-complete/idv-submit-complete.jsx
@@ -11,10 +11,10 @@ const IdvSubmitComplete = ({ needs_poa, is_from_external }) => {
- {localize('Your ID number was submitted successfully')}
+ {localize('Your documents were submitted successfully')}
- {localize("We'll process your details within a few minutes and notify its status via email.")}
+ {localize('We’ll review your documents and notify you of its status within 5 minutes.')}
{!!needs_poa && (
diff --git a/packages/account/src/Components/poi/status/unsupported/card-details/uploader.jsx b/packages/account/src/Components/poi/status/unsupported/card-details/uploader.jsx
index a064ef1288e6..836f14738bfe 100644
--- a/packages/account/src/Components/poi/status/unsupported/card-details/uploader.jsx
+++ b/packages/account/src/Components/poi/status/unsupported/card-details/uploader.jsx
@@ -96,7 +96,7 @@ const Uploader = ({ data, value, is_full, onChange, has_frame }) => {
const ValidationErrorMessage = open => (
- {image.errors.map((error, index) => (
+ {image.errors?.map((error, index) => (
{error}
diff --git a/packages/account/src/Components/poi/status/unsupported/detail-component.jsx b/packages/account/src/Components/poi/status/unsupported/detail-component.jsx
index c063a9feb897..0ee9ce0f2ee3 100644
--- a/packages/account/src/Components/poi/status/unsupported/detail-component.jsx
+++ b/packages/account/src/Components/poi/status/unsupported/detail-component.jsx
@@ -100,7 +100,7 @@ const DetailComponent = ({
case STATUS.IS_UPLOADING:
return ;
case STATUS.IS_COMPLETED:
- return ;
+ return ;
case STATUS.IS_FAILED:
return ;
default:
diff --git a/packages/account/src/Components/poi/status/unsupported/unsupported.jsx b/packages/account/src/Components/poi/status/unsupported/unsupported.jsx
index 096935f5f0ec..8a1b2cd66152 100644
--- a/packages/account/src/Components/poi/status/unsupported/unsupported.jsx
+++ b/packages/account/src/Components/poi/status/unsupported/unsupported.jsx
@@ -28,7 +28,7 @@ const Unsupported = ({ country_code, handlePOIforMT5Complete, ...props }) => {
country_code,
});
- if (props?.manual?.status === identity_status_codes.pending) return ;
+ if (props?.manual?.status === identity_status_codes.pending) return ;
if (detail !== null) {
return (
diff --git a/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.js b/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.js
index 79108be9713a..7a81dc59db29 100644
--- a/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.js
+++ b/packages/account/src/Components/poi/status/upload-complete/__tests__/upload-complete.spec.js
@@ -16,10 +16,11 @@ jest.mock('@deriv/components', () => {
});
describe('', () => {
- const successful_upload_message = /your proof of identity was submitted successfully/i;
- const poi_under_review_message = /We’ll review your document and notify you of its status within 1-3 days./i;
+ const successful_upload_message = /your documents were submitted successfully/i;
+ const poi_under_review_message = /We’ll review your documents and notify you of its status within 5 minutes./i;
+ const poi_under_review_message_for_manual =
+ /We’ll review your documents and notify you of its status within 1 - 3 working days./i;
const redirect_button = ;
- const poa_under_review_message = /your document is being reviewed, please check back in 1-3 days./i;
const needs_poa_extra_submit_message = /you must also submit a proof of address./i;
const renderWithRouter = (component, is_appstore) =>
@@ -35,11 +36,19 @@ describe('', () => {
expect(screen.getByTestId(/dt_mocked_icon/)).toBeInTheDocument();
});
- it('should render component and is_appstore is true', () => {
- renderWithRouter(, true);
+ it('should render component for manual upload', () => {
+ renderWithRouter(, true);
expect(screen.getByText(successful_upload_message)).toBeInTheDocument();
- expect(screen.getByText(poi_under_review_message)).toBeInTheDocument();
+ expect(screen.getByText(poi_under_review_message_for_manual)).toBeInTheDocument();
+ expect(screen.getByTestId(/dt_mocked_icon/i)).toBeInTheDocument();
+ expect(screen.queryByRole('button')).not.toBeInTheDocument();
+ });
+ it('should render component for manual upload', () => {
+ renderWithRouter(, true);
+
+ expect(screen.getByText(successful_upload_message)).toBeInTheDocument();
+ expect(screen.getByText(poi_under_review_message_for_manual)).toBeInTheDocument();
expect(screen.getByTestId(/dt_mocked_icon/i)).toBeInTheDocument();
expect(screen.queryByRole('button')).not.toBeInTheDocument();
});
@@ -60,7 +69,7 @@ describe('', () => {
renderWithRouter(, true);
expect(screen.getByTestId('dt_poa_button')).toBeInTheDocument();
- expect(screen.getByText(poa_under_review_message)).toBeInTheDocument();
+ expect(screen.getByText(poi_under_review_message)).toBeInTheDocument();
expect(screen.getByText(needs_poa_extra_submit_message)).toBeInTheDocument();
expect(screen.getByRole('button')).toBeInTheDocument();
});
@@ -69,7 +78,7 @@ describe('', () => {
renderWithRouter(, true);
expect(screen.getByTestId('dt_poa_button')).toBeInTheDocument();
- expect(screen.getByText(poa_under_review_message)).toBeInTheDocument();
+ expect(screen.getByText(poi_under_review_message)).toBeInTheDocument();
expect(screen.getByText(needs_poa_extra_submit_message)).toBeInTheDocument();
expect(screen.queryByRole('button')).not.toBeInTheDocument();
});
diff --git a/packages/account/src/Components/poi/status/upload-complete/upload-complete.jsx b/packages/account/src/Components/poi/status/upload-complete/upload-complete.jsx
index e768b443bc1d..e1a896ba645f 100644
--- a/packages/account/src/Components/poi/status/upload-complete/upload-complete.jsx
+++ b/packages/account/src/Components/poi/status/upload-complete/upload-complete.jsx
@@ -7,14 +7,18 @@ import PoaButton from 'Components/poa/poa-button';
import { ContinueTradingButton } from 'Components/poa/continue-trading-button/continue-trading-button';
import IconMessageContent from 'Components/icon-message-content';
-export const UploadComplete = ({ needs_poa, redirect_button, is_from_external }) => {
+export const UploadComplete = ({ needs_poa, redirect_button, is_from_external, is_manual_upload = false }) => {
const { is_appstore } = React.useContext(PlatformContext);
- const message = localize('Your proof of identity was submitted successfully');
+ const message = localize('Your documents were submitted successfully');
+ const description = is_manual_upload
+ ? localize('We’ll review your documents and notify you of its status within 1 - 3 working days.')
+ : localize('We’ll review your documents and notify you of its status within 5 minutes.');
+
if (!needs_poa) {
return (
@@ -43,7 +47,7 @@ export const UploadComplete = ({ needs_poa, redirect_button, is_from_external })
- {localize('Your document is being reviewed, please check back in 1-3 days.')}
+ {description}
{localize('You must also submit a proof of address.')}
diff --git a/packages/account/src/Configs/address-details-config.js b/packages/account/src/Configs/address-details-config.js
index a1fd7e33b581..5a18a675017e 100644
--- a/packages/account/src/Configs/address-details-config.js
+++ b/packages/account/src/Configs/address-details-config.js
@@ -137,6 +137,8 @@ const addressDetailsConfig = (
) => {
const is_svg = upgrade_info?.can_upgrade_to === 'svg';
const config = address_details_config({ account_settings, is_svg });
+ const is_mf = real_account_signup_target === 'maltainvest';
+
return {
header: {
active_title: is_appstore ? localize('Where do you live?') : localize('Complete your address details'),
@@ -150,6 +152,7 @@ const addressDetailsConfig = (
transformConfig(transformForResidence(config, residence), real_account_signup_target)
),
is_svg,
+ is_mf,
},
passthrough: ['residence_list', 'is_fully_authenticated'],
icon: 'IcDashboardAddress',
diff --git a/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container-for-mt5.jsx b/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container-for-mt5.jsx
index 0fce1a759bde..a30760168a3c 100644
--- a/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container-for-mt5.jsx
+++ b/packages/account/src/Sections/Verification/ProofOfIdentity/proof-of-identity-container-for-mt5.jsx
@@ -1,27 +1,13 @@
import React from 'react';
-import { Icon, Loading, Text } from '@deriv/components';
-import { WS, isMobile } from '@deriv/shared';
+import { Loading } from '@deriv/components';
+import { WS } from '@deriv/shared';
import { localize } from '@deriv/translations';
import ErrorMessage from 'Components/error-component';
+import IconWithMessage from 'Components/icon-with-message';
import POISubmissionForMT5 from './proof-of-identity-submission-for-mt5.jsx';
import { service_code } from './proof-of-identity-utils';
import { populateVerificationStatus } from '../Helpers/verification';
-const ShowDemoMessage = () => (
-
-
-
- {localize('Switch to your real account to create a Deriv MT5 account')}
-
-