@eaera-com/client-sdk-v1 0.2.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +86 -0
- package/dist/channels/accounts.d.ts +11 -0
- package/dist/channels/metrics.d.ts +8 -0
- package/dist/channels/position.d.ts +13 -0
- package/dist/channels/users.d.ts +38 -0
- package/dist/common/constants/category.constant.d.ts +30 -0
- package/dist/common/constants/category.constant.js +31 -0
- package/dist/common/constants/communication.constant.d.ts +52 -0
- package/dist/common/constants/communication.constant.js +85 -0
- package/dist/common/constants/email.constant.d.ts +4 -0
- package/dist/common/constants/email.constant.js +7 -0
- package/dist/common/constants/filter.constants.d.ts +1 -0
- package/dist/common/constants/filter.constants.js +6 -0
- package/dist/common/constants/index.d.ts +15 -0
- package/dist/common/constants/index.js +79 -0
- package/dist/common/constants/kyc.constant.d.ts +42 -0
- package/dist/common/constants/kyc.constant.js +43 -0
- package/dist/common/constants/listStatus.constants.d.ts +2 -0
- package/dist/common/constants/listStatus.constants.js +19 -0
- package/dist/common/constants/methods.constant.d.ts +43 -0
- package/dist/common/constants/methods.constant.js +84 -0
- package/dist/common/constants/passwordRule.constants.d.ts +4 -0
- package/dist/common/constants/passwordRule.constants.js +7 -0
- package/dist/common/constants/program.constants.d.ts +2 -0
- package/dist/common/constants/program.constants.js +31 -0
- package/dist/common/constants/propAccount.constant.d.ts +8 -0
- package/dist/common/constants/propAccount.constant.js +11 -0
- package/dist/common/constants/site-settings.constants.d.ts +40 -0
- package/dist/common/constants/site-settings.constants.js +10 -0
- package/dist/common/constants/store.constants.d.ts +1 -0
- package/dist/common/constants/store.constants.js +7 -0
- package/dist/common/constants/supportTicket.constant.d.ts +11 -0
- package/dist/common/constants/supportTicket.constant.js +14 -0
- package/dist/common/constants/tradingPlatform.constants.d.ts +4 -0
- package/dist/common/constants/tradingPlatform.constants.js +7 -0
- package/dist/common/constants/transaction.constant.d.ts +16 -0
- package/dist/common/constants/transaction.constant.js +19 -0
- package/dist/common/constants/type.constants.d.ts +5 -0
- package/dist/common/constants/type.constants.js +28 -0
- package/dist/common/constants/withdraw.constant.d.ts +1 -0
- package/dist/common/constants/withdraw.constant.js +7 -0
- package/dist/common/types/addon.type.d.ts +30 -0
- package/dist/common/types/category.type.d.ts +8 -0
- package/dist/common/types/common.type.d.ts +3 -0
- package/dist/common/types/communication.type.d.ts +51 -0
- package/dist/common/types/coupon.type.d.ts +27 -0
- package/dist/common/types/email.type.d.ts +8 -0
- package/dist/common/types/fundingSource.type.d.ts +80 -0
- package/dist/common/types/ibs.type.d.ts +15 -0
- package/dist/common/types/index.d.ts +16 -0
- package/dist/common/types/kyc.type.d.ts +52 -0
- package/dist/common/types/liveNotification.type.d.ts +10 -0
- package/dist/common/types/news.type.d.ts +17 -0
- package/dist/common/types/notification.types.d.ts +30 -0
- package/dist/common/types/passwordRule.type.d.ts +16 -0
- package/dist/common/types/paymentMethod/blockbee.type.d.ts +27 -0
- package/dist/common/types/paymentMethod/index.d.ts +2 -0
- package/dist/common/types/paymentMethod/match2pay.type.d.ts +27 -0
- package/dist/common/types/product.type.d.ts +63 -0
- package/dist/common/types/siteSetting.type.d.ts +77 -0
- package/dist/common/types/wallet.type.d.ts +36 -0
- package/dist/common/use-utils/data/countriesWithCurrencies.d.ts +7 -0
- package/dist/common/use-utils/data/dragonpayBank.d.ts +6 -0
- package/dist/common/use-utils/data/help2pay_banks.d.ts +7 -0
- package/dist/common/use-utils/data/listCryptoCurrencies.d.ts +5 -0
- package/dist/common/use-utils/data/regions.d.ts +16 -0
- package/dist/common/use-utils/data/widgets.d.ts +4 -0
- package/dist/common/use-utils/error-handlers/index.d.ts +1 -0
- package/dist/common/use-utils/helpers/color.helpers.d.ts +2 -0
- package/dist/common/use-utils/helpers/color.helpers.js +19 -0
- package/dist/common/use-utils/helpers/currency.helpers.d.ts +25 -0
- package/dist/common/use-utils/helpers/currency.helpers.js +762 -0
- package/dist/common/use-utils/helpers/date.helpers.d.ts +8 -0
- package/dist/common/use-utils/helpers/date.helpers.js +64 -0
- package/dist/common/use-utils/helpers/kyc.helpers.d.ts +22 -0
- package/dist/common/use-utils/helpers/kyc.helpers.js +165 -0
- package/dist/common/use-utils/helpers/misc.helpers.d.ts +45 -0
- package/dist/common/use-utils/helpers/misc.helpers.js +141 -0
- package/dist/common/use-utils/helpers/number.helpers.d.ts +11 -0
- package/dist/common/use-utils/helpers/number.helpers.js +76 -0
- package/dist/common/use-utils/helpers/passwordRule.helpers.d.ts +5 -0
- package/dist/common/use-utils/helpers/passwordRule.helpers.js +31 -0
- package/dist/common/use-utils/helpers/schema.helpers.d.ts +2 -0
- package/dist/common/use-utils/helpers/schema.helpers.js +2036 -0
- package/dist/common/use-utils/helpers/string.helpers.d.ts +7 -0
- package/dist/common/use-utils/helpers/string.helpers.js +38 -0
- package/dist/common/use-utils/helpers/transaction.helpers.d.ts +8 -0
- package/dist/common/use-utils/helpers/transaction.helpers.js +44 -0
- package/dist/common/use-utils/schemas/fundingMethod.schema.d.ts +1313 -0
- package/dist/common/use-utils/validators/index.d.ts +4 -0
- package/dist/common/use-utils/validators/index.js +8 -0
- package/dist/index-6dV6pxDN.js +334 -0
- package/dist/index-BTVWGSPO.js +2897 -0
- package/dist/index.d.ts +1763 -0
- package/dist/index.js +10326 -0
- package/dist/regions-Dsypl2zG.js +18768 -0
- package/dist/services/ClientSDK/account/index.d.ts +57 -0
- package/dist/services/ClientSDK/activityLog/index.d.ts +6 -0
- package/dist/services/ClientSDK/auth/index.d.ts +21 -0
- package/dist/services/ClientSDK/auth/types.d.ts +11 -0
- package/dist/services/ClientSDK/captcha/index.d.ts +5 -0
- package/dist/services/ClientSDK/category/index.d.ts +9 -0
- package/dist/services/ClientSDK/client/index.d.ts +15 -0
- package/dist/services/ClientSDK/commissionProfile/index.d.ts +10 -0
- package/dist/services/ClientSDK/contact/index.d.ts +9 -0
- package/dist/services/ClientSDK/content/index.d.ts +18 -0
- package/dist/services/ClientSDK/contentType/index.d.ts +6 -0
- package/dist/services/ClientSDK/conversionRate/index.d.ts +7 -0
- package/dist/services/ClientSDK/coupon/index.d.ts +15 -0
- package/dist/services/ClientSDK/coupon/type.d.ts +35 -0
- package/dist/services/ClientSDK/department/index.d.ts +10 -0
- package/dist/services/ClientSDK/devices/index.d.ts +6 -0
- package/dist/services/ClientSDK/emailLayout/index.d.ts +10 -0
- package/dist/services/ClientSDK/emailTemplate/index.d.ts +15 -0
- package/dist/services/ClientSDK/employee/index.d.ts +15 -0
- package/dist/services/ClientSDK/folder/index.d.ts +12 -0
- package/dist/services/ClientSDK/fundingSource/index.d.ts +17 -0
- package/dist/services/ClientSDK/gamificationCampaign/index.d.ts +9 -0
- package/dist/services/ClientSDK/ib/index.d.ts +26 -0
- package/dist/services/ClientSDK/index.d.ts +60 -0
- package/dist/services/ClientSDK/kycs/index.d.ts +18 -0
- package/dist/services/ClientSDK/lead/index.d.ts +13 -0
- package/dist/services/ClientSDK/metric/index.d.ts +11 -0
- package/dist/services/ClientSDK/metric/type.d.ts +171 -0
- package/dist/services/ClientSDK/news/index.d.ts +14 -0
- package/dist/services/ClientSDK/note/index.d.ts +8 -0
- package/dist/services/ClientSDK/notificationCenter/NotificationCenter.types.d.ts +24 -0
- package/dist/services/ClientSDK/notificationCenter/index.d.ts +20 -0
- package/dist/services/ClientSDK/payment/index.d.ts +27 -0
- package/dist/services/ClientSDK/persona/index.d.ts +12 -0
- package/dist/services/ClientSDK/product/index.d.ts +12 -0
- package/dist/services/ClientSDK/productAttribute/index.d.ts +9 -0
- package/dist/services/ClientSDK/propAccount/index.d.ts +59 -0
- package/dist/services/ClientSDK/purchase/index.d.ts +13 -0
- package/dist/services/ClientSDK/purchase/type.d.ts +66 -0
- package/dist/services/ClientSDK/reportFilters/index.d.ts +9 -0
- package/dist/services/ClientSDK/request/index.d.ts +38 -0
- package/dist/services/ClientSDK/roleSet/index.d.ts +8 -0
- package/dist/services/ClientSDK/silt/index.d.ts +5 -0
- package/dist/services/ClientSDK/siteSetting/index.d.ts +16 -0
- package/dist/services/ClientSDK/sumsub/index.d.ts +6 -0
- package/dist/services/ClientSDK/support/index.d.ts +16 -0
- package/dist/services/ClientSDK/tradeBattle/index.d.ts +30 -0
- package/dist/services/ClientSDK/tradeBattle/tradeBattle.type.d.ts +119 -0
- package/dist/services/ClientSDK/tradeServer/index.d.ts +12 -0
- package/dist/services/ClientSDK/transaction/index.d.ts +9 -0
- package/dist/services/ClientSDK/user/index.d.ts +40 -0
- package/dist/services/ClientSDK/veriff/index.d.ts +7 -0
- package/dist/services/ClientSDK/voip/index.d.ts +5 -0
- package/dist/services/ClientSDK/wallet/index.d.ts +18 -0
- package/dist/services/EmailServiceTestSDK/index.d.ts +7 -0
- package/dist/services/EmailServiceTestSDK/message/index.d.ts +6 -0
- package/dist/services/PoolTradingSDK/index.d.ts +11 -0
- package/dist/services/PoolTradingSDK/investWallet/index.d.ts +16 -0
- package/dist/services/PoolTradingSDK/poolProfile/index.d.ts +46 -0
- package/dist/services/ReportSDK/index.d.ts +28 -0
- package/dist/services/base.d.ts +29 -0
- package/dist/stores/account.d.ts +191 -0
- package/dist/stores/activityLog.d.ts +7 -0
- package/dist/stores/addon.d.ts +11 -0
- package/dist/stores/advertising.d.ts +155 -0
- package/dist/stores/auth.d.ts +39 -0
- package/dist/stores/battleNotification.d.ts +6 -0
- package/dist/stores/captcha.d.ts +3 -0
- package/dist/stores/category.d.ts +15 -0
- package/dist/stores/client.d.ts +16 -0
- package/dist/stores/commissionProfile.d.ts +12 -0
- package/dist/stores/contact.d.ts +9 -0
- package/dist/stores/content.d.ts +222 -0
- package/dist/stores/contentType.d.ts +10 -0
- package/dist/stores/contentV2.d.ts +160 -0
- package/dist/stores/conversionRate.d.ts +9 -0
- package/dist/stores/coupon.d.ts +30 -0
- package/dist/stores/department.d.ts +7 -0
- package/dist/stores/devices.d.ts +8 -0
- package/dist/stores/employee.d.ts +12 -0
- package/dist/stores/folder.d.ts +15 -0
- package/dist/stores/fundingSource.d.ts +46 -0
- package/dist/stores/gamificationCampaign.d.ts +10 -0
- package/dist/stores/ib.d.ts +22 -0
- package/dist/stores/index.d.ts +1761 -0
- package/dist/stores/investWallet.d.ts +92 -0
- package/dist/stores/kycs.d.ts +16 -0
- package/dist/stores/lead.d.ts +13 -0
- package/dist/stores/liveNotification.d.ts +6 -0
- package/dist/stores/metric.d.ts +24 -0
- package/dist/stores/metricsV2.d.ts +28 -0
- package/dist/stores/news.d.ts +15 -0
- package/dist/stores/notes.d.ts +16 -0
- package/dist/stores/notification.d.ts +6 -0
- package/dist/stores/notificationCenter.d.ts +20 -0
- package/dist/stores/payment.d.ts +25 -0
- package/dist/stores/poolProfile.d.ts +117 -0
- package/dist/stores/poolTrading.d.ts +7 -0
- package/dist/stores/product.d.ts +31 -0
- package/dist/stores/productAttribute.d.ts +10 -0
- package/dist/stores/propAccount.d.ts +48 -0
- package/dist/stores/purchases.d.ts +23 -0
- package/dist/stores/report.d.ts +19 -0
- package/dist/stores/reportFilter.d.ts +9 -0
- package/dist/stores/request.d.ts +39 -0
- package/dist/stores/roleSet.d.ts +7 -0
- package/dist/stores/siteSetting.d.ts +103 -0
- package/dist/stores/support.d.ts +33 -0
- package/dist/stores/tradeBattle.d.ts +51 -0
- package/dist/stores/tradeServer.d.ts +12 -0
- package/dist/stores/transaction.d.ts +8 -0
- package/dist/stores/user.d.ts +30 -0
- package/dist/stores/wallet.d.ts +53 -0
- package/dist/utils/axiosTiming.d.ts +12 -0
- package/dist/utils/cookies.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/routeCompression.d.ts +19 -0
- package/dist/utils/store.d.ts +12 -0
- package/package.json +74 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const formatTimeOfDay: (date: Date) => string;
|
|
2
|
+
export declare const formatDateWithClientTimezone: (date: string, format?: string) => string;
|
|
3
|
+
export declare const formatTimeWithTz: (timezone: string, dateTime: any, formatType?: "date" | "time" | "date-time" | "time-ampm" | "time-hour" | "date-time-ampm" | "date-long" | "date-time-no-seconds" | "weekday-day-month-year" | "month-day-year" | "full") => string;
|
|
4
|
+
export declare const getOffsetTimeZone: (tz: string) => string;
|
|
5
|
+
export declare const getTimeZoneOptions: () => {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { m as a } from "../../../index-BTVWGSPO.js";
|
|
2
|
+
const l = (e) => {
|
|
3
|
+
let t = e.getHours(), o = e.getMinutes(), r = e.getSeconds(), m = t >= 12 ? "pm" : "am";
|
|
4
|
+
return t = t % 12, t = t || 12, t = t < 10 ? 0 + t : t, o = o < 10 ? 0 + o : o, r = r < 10 ? 0 + r : r, t + ":" + o + ":" + r + " " + m;
|
|
5
|
+
}, M = (e, t = "") => {
|
|
6
|
+
const o = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
7
|
+
return !e || e === "" || e === null || e === void 0 ? "" : a.tz(e, "UTC").tz(o).format(t);
|
|
8
|
+
}, i = (e, t, o = "full") => {
|
|
9
|
+
const r = a(new Date(t)).tz(e);
|
|
10
|
+
switch (o) {
|
|
11
|
+
case "date":
|
|
12
|
+
return r.format("YYYY-MM-DD");
|
|
13
|
+
case "time":
|
|
14
|
+
return r.format("HH:mm:ss");
|
|
15
|
+
case "date-time":
|
|
16
|
+
return r.format("YYYY-MM-DD HH:mm:ss");
|
|
17
|
+
case "date-long":
|
|
18
|
+
return r.format("DD MMM, YYYY");
|
|
19
|
+
case "time-ampm":
|
|
20
|
+
return r.format("hh:mm:ss A");
|
|
21
|
+
case "time-hour":
|
|
22
|
+
return r.format("hh:mm A");
|
|
23
|
+
case "date-time-ampm":
|
|
24
|
+
return r.format("YYYY-MM-DD hh:mm:ss A");
|
|
25
|
+
case "date-time-no-seconds":
|
|
26
|
+
return r.format("YYYY-MM-DD HH:mm");
|
|
27
|
+
case "weekday-day-month-year":
|
|
28
|
+
return r.format("ddd, DD MMMM YYYY");
|
|
29
|
+
case "month-day-year": {
|
|
30
|
+
const m = t ? new Date(t) : /* @__PURE__ */ new Date(), s = new Date(m.getFullYear(), m.getMonth() + 1, m.getDate()), f = [
|
|
31
|
+
"January",
|
|
32
|
+
"February",
|
|
33
|
+
"March",
|
|
34
|
+
"April",
|
|
35
|
+
"May",
|
|
36
|
+
"June",
|
|
37
|
+
"July",
|
|
38
|
+
"August",
|
|
39
|
+
"September",
|
|
40
|
+
"October",
|
|
41
|
+
"November",
|
|
42
|
+
"December"
|
|
43
|
+
], n = s.getDate(), u = n < 10 ? "0" + n : n;
|
|
44
|
+
return `${f[s.getMonth()]} ${u}, ${s.getFullYear()}`;
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
return r.format("dddd, MMMM DD YYYY HH:mm:ss Z");
|
|
48
|
+
}
|
|
49
|
+
}, c = (e) => {
|
|
50
|
+
if (!e) return "";
|
|
51
|
+
const t = Math.floor(a().tz(e).utcOffset() / 60);
|
|
52
|
+
return t >= 0 ? `GMT+${t}` : `GMT${t}`;
|
|
53
|
+
}, D = () => a.tz.names().map((e) => ({
|
|
54
|
+
value: e,
|
|
55
|
+
label: `(${c(e)}) ${e}`,
|
|
56
|
+
offset: a().tz(e).utcOffset()
|
|
57
|
+
})).sort((e, t) => e.offset - t.offset || e.value.localeCompare(t.value)).map(({ offset: e, ...t }) => t);
|
|
58
|
+
export {
|
|
59
|
+
M as formatDateWithClientTimezone,
|
|
60
|
+
l as formatTimeOfDay,
|
|
61
|
+
i as formatTimeWithTz,
|
|
62
|
+
c as getOffsetTimeZone,
|
|
63
|
+
D as getTimeZoneOptions
|
|
64
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ICurrentKyc, IDocumentStepInfoParams, IKycFormSchema, IKycSchemasConfig } from 'src/common/types/kyc.type';
|
|
2
|
+
|
|
3
|
+
export declare const getDocumentStatus: (shortName: string, currentKyc: ICurrentKyc) => string;
|
|
4
|
+
export declare const getKycStepInfo: (currentKyc: ICurrentKyc, t: (key: string) => string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
className: string;
|
|
7
|
+
status: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const getDocumentStepInfo: (params: IDocumentStepInfoParams) => {
|
|
10
|
+
description: string;
|
|
11
|
+
className: string;
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const getAllKycStepInfos: (currentKyc: ICurrentKyc, t: (key: string) => string) => {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
className: string;
|
|
18
|
+
status: string;
|
|
19
|
+
totalProgress: number;
|
|
20
|
+
shortName: any;
|
|
21
|
+
}[];
|
|
22
|
+
export declare const getKycFormSchema: (schemasConfig: IKycSchemasConfig, currentKyc: ICurrentKyc, t: (key: string) => string, currentProgress?: number) => IKycFormSchema;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { KYC_STEP_STATUS as i, TOTAL_PROGRESS_KYC_DOCUMENTS as I, KYC_DOCUMENT_SCHEMA_SHORT_NAMES as n, KYC_DOCUMENT_STATUSES as d, KYC_STATE as p, DEFAULT_KYC_FORM_SCHEMA as N, KYC_VERIFICATION_TYPE as T } from "../../constants/kyc.constant.js";
|
|
2
|
+
const f = (e, t) => {
|
|
3
|
+
const { document_front_status: o, portrait_status: a, address_verification_status: s } = t;
|
|
4
|
+
return {
|
|
5
|
+
[n.ID]: o,
|
|
6
|
+
[n.PORTRAIT]: a,
|
|
7
|
+
[n.ADDRESS]: s
|
|
8
|
+
}[e];
|
|
9
|
+
}, D = (e, t) => {
|
|
10
|
+
const { state: o } = e, a = o === p.MISSING_KYC, s = a ? i.IN_PROGRESS : i.COMPLETED;
|
|
11
|
+
return {
|
|
12
|
+
description: t(a ? "verify.step-status.in-progress" : "verify.step-status.completed"),
|
|
13
|
+
className: `kyc-${s.replace(/_/g, "-")}`,
|
|
14
|
+
status: s
|
|
15
|
+
};
|
|
16
|
+
}, y = (e) => {
|
|
17
|
+
const { documentStatus: t, shortName: o, currentKyc: a, t: s } = e, { state: r, schema: c } = a, m = c?.documents || [], S = {
|
|
18
|
+
[d.PENDING]: s("common.status.waiting-for-approval"),
|
|
19
|
+
[d.REJECTED]: s("verify.step-status.document-rejected"),
|
|
20
|
+
[d.APPROVED]: s("verify.status.verified")
|
|
21
|
+
}, _ = m.findIndex((u) => u.short_name === o), h = _ === 0;
|
|
22
|
+
if (r === p.MISSING_KYC)
|
|
23
|
+
return {
|
|
24
|
+
description: s("verify.step-status.locked"),
|
|
25
|
+
className: "kyc-locked",
|
|
26
|
+
status: i.LOCKED
|
|
27
|
+
};
|
|
28
|
+
if (!h) {
|
|
29
|
+
const u = m[_ - 1]?.short_name;
|
|
30
|
+
if (!(u ? f(u, a) : null))
|
|
31
|
+
return {
|
|
32
|
+
description: s("verify.step-status.locked"),
|
|
33
|
+
className: "kyc-locked",
|
|
34
|
+
status: i.LOCKED
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const l = S[t];
|
|
38
|
+
if (!t)
|
|
39
|
+
return {
|
|
40
|
+
description: s("verify.step-status.in-progress"),
|
|
41
|
+
className: "kyc-inprogress",
|
|
42
|
+
status: i.IN_PROGRESS
|
|
43
|
+
};
|
|
44
|
+
if (l) {
|
|
45
|
+
const u = t.toLowerCase();
|
|
46
|
+
return {
|
|
47
|
+
description: l,
|
|
48
|
+
className: `kyc-${u}`,
|
|
49
|
+
status: u
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
description: s("verify.step-status.completed"),
|
|
54
|
+
className: "kyc-completed",
|
|
55
|
+
status: i.COMPLETED
|
|
56
|
+
};
|
|
57
|
+
}, v = (e, t) => {
|
|
58
|
+
const { schema: o } = e, a = [
|
|
59
|
+
{
|
|
60
|
+
title: t("verify.steps.register-account"),
|
|
61
|
+
description: t("verify.step-status.completed"),
|
|
62
|
+
className: "kyc-completed verification-step",
|
|
63
|
+
status: i.COMPLETED,
|
|
64
|
+
totalProgress: 1,
|
|
65
|
+
shortName: ""
|
|
66
|
+
}
|
|
67
|
+
], s = o?.kyc_steps || [], r = (o?.documents || []).map((c) => {
|
|
68
|
+
const m = f(c.short_name, e), { className: S, description: _, status: h } = y({
|
|
69
|
+
documentStatus: m,
|
|
70
|
+
shortName: c.short_name,
|
|
71
|
+
currentKyc: e,
|
|
72
|
+
t
|
|
73
|
+
});
|
|
74
|
+
return {
|
|
75
|
+
title: t(`verify.steps.${c.short_name.replace(/_/g, "-")}`),
|
|
76
|
+
description: _,
|
|
77
|
+
className: `${S} verification-step`,
|
|
78
|
+
status: h,
|
|
79
|
+
totalProgress: I[c.short_name] || 1,
|
|
80
|
+
shortName: c.short_name
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
return [
|
|
84
|
+
...a,
|
|
85
|
+
...s.length > 0 ? [
|
|
86
|
+
{
|
|
87
|
+
title: t("verify.steps.fill-your-data"),
|
|
88
|
+
...D(e, t),
|
|
89
|
+
className: `${D(e, t).className} verification-step`,
|
|
90
|
+
totalProgress: s.length,
|
|
91
|
+
shortName: ""
|
|
92
|
+
}
|
|
93
|
+
] : [],
|
|
94
|
+
...r
|
|
95
|
+
];
|
|
96
|
+
}, E = (e, t, o) => o !== 0 ? {
|
|
97
|
+
...e.idSecondStep,
|
|
98
|
+
...t.data?.verification_type === T.ID_CARD && {
|
|
99
|
+
document_back_img: {}
|
|
100
|
+
}
|
|
101
|
+
} : e.idFirstStep, R = (e) => {
|
|
102
|
+
const { data: t, schema: o } = e, a = t?.step ?? 0, s = o?.kyc_steps?.[a];
|
|
103
|
+
return s ? {
|
|
104
|
+
shortName: s.short_name || "",
|
|
105
|
+
schema: s.schema ?? {}
|
|
106
|
+
} : N;
|
|
107
|
+
}, g = (e, t, o, a) => {
|
|
108
|
+
const s = o.find(
|
|
109
|
+
(c) => c.status === i.IN_PROGRESS
|
|
110
|
+
);
|
|
111
|
+
if (!s?.shortName) return N;
|
|
112
|
+
if (s.shortName === n.ID)
|
|
113
|
+
return {
|
|
114
|
+
shortName: n.ID,
|
|
115
|
+
schema: E(e, t, a)
|
|
116
|
+
};
|
|
117
|
+
const r = {
|
|
118
|
+
[n.PORTRAIT]: e.portrait,
|
|
119
|
+
[n.ADDRESS]: e.address
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
shortName: s.shortName,
|
|
123
|
+
schema: r[s.shortName] || {}
|
|
124
|
+
};
|
|
125
|
+
}, M = (e, t, o) => {
|
|
126
|
+
const { document_front_status: a, portrait_status: s, address_verification_status: r } = t, m = [
|
|
127
|
+
{
|
|
128
|
+
status: a,
|
|
129
|
+
shortName: n.ID,
|
|
130
|
+
getSchema: () => E(e, t, o)
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
status: s,
|
|
134
|
+
shortName: n.PORTRAIT,
|
|
135
|
+
getSchema: () => e.portrait
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
status: r,
|
|
139
|
+
shortName: n.ADDRESS,
|
|
140
|
+
getSchema: () => e.address
|
|
141
|
+
}
|
|
142
|
+
].find(
|
|
143
|
+
(S) => S.status === d.REJECTED
|
|
144
|
+
);
|
|
145
|
+
return m ? {
|
|
146
|
+
shortName: m.shortName,
|
|
147
|
+
schema: m.getSchema()
|
|
148
|
+
} : N;
|
|
149
|
+
}, P = (e, t, o, a) => {
|
|
150
|
+
const { state: s } = t;
|
|
151
|
+
if (s === p.MISSING_KYC)
|
|
152
|
+
return R(t);
|
|
153
|
+
if (s === p.MISSING_DOCUMENTS) {
|
|
154
|
+
const r = v(t, o);
|
|
155
|
+
return g(e, t, r, a);
|
|
156
|
+
}
|
|
157
|
+
return s === p.DOCUMENT_PENDING ? M(e, t, a) : N;
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
v as getAllKycStepInfos,
|
|
161
|
+
f as getDocumentStatus,
|
|
162
|
+
y as getDocumentStepInfo,
|
|
163
|
+
P as getKycFormSchema,
|
|
164
|
+
D as getKycStepInfo
|
|
165
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as moment } from 'moment-timezone';
|
|
2
|
+
import { COMPETITION_STATE } from '../../constants/category.constant';
|
|
3
|
+
|
|
4
|
+
import * as validators from '../validators/index';
|
|
5
|
+
import * as errorHandlers from '../error-handlers/index';
|
|
6
|
+
export declare const getRegions: () => {
|
|
7
|
+
countryName: string;
|
|
8
|
+
countryShortCode: string;
|
|
9
|
+
value: string;
|
|
10
|
+
regions: ({
|
|
11
|
+
name: string;
|
|
12
|
+
shortCode?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
name: string;
|
|
15
|
+
shortCode: string;
|
|
16
|
+
})[];
|
|
17
|
+
label: string;
|
|
18
|
+
languages: string;
|
|
19
|
+
dialling_code: string;
|
|
20
|
+
}[];
|
|
21
|
+
export declare const getListWidgetsRuleMetrics: () => {
|
|
22
|
+
component: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}[];
|
|
25
|
+
export declare const getComponentWidgetRuleMetrics: (name: string) => string;
|
|
26
|
+
export declare const getCompetitionStatus: (startDate: string, endDate: string, now: moment.Moment) => COMPETITION_STATE | null;
|
|
27
|
+
export declare const getValidators: () => typeof validators;
|
|
28
|
+
export declare const getErrorHandlers: () => typeof errorHandlers;
|
|
29
|
+
export declare const isEmpty: (value: any) => boolean;
|
|
30
|
+
export declare const isEmptyArray: (arr: any[]) => boolean;
|
|
31
|
+
export declare const isEmptyObject: (obj: Record<string, any>) => boolean;
|
|
32
|
+
export declare const debounce: <T extends (...args: any[]) => void>(fn: T, delay: number) => (...args: Parameters<T>) => void;
|
|
33
|
+
type MapOptions<T> = {
|
|
34
|
+
unique?: boolean;
|
|
35
|
+
filter?: (item: T) => boolean;
|
|
36
|
+
transform?: (value: any, item: T) => any;
|
|
37
|
+
};
|
|
38
|
+
export declare function mapByField<T, K extends keyof T>(list: T[], field: K, options?: MapOptions<T>): T[K][];
|
|
39
|
+
export declare const generateFieldPairs: <T extends Record<string, any>>(data: T[], fieldKey: keyof T) => string[][];
|
|
40
|
+
export declare const mergePullTradingData: (accounts: any[], tradingData: any) => any[];
|
|
41
|
+
export declare const extractResponseMessage: (response: Record<string, any>) => {
|
|
42
|
+
message: string;
|
|
43
|
+
vars: Record<string, any>;
|
|
44
|
+
} | null;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { r as f } from "../../../regions-Dsypl2zG.js";
|
|
2
|
+
import { m as d } from "../../../index-BTVWGSPO.js";
|
|
3
|
+
import { COMPETITION_STATE as c } from "../../constants/category.constant.js";
|
|
4
|
+
import { v as u } from "../../../index-6dV6pxDN.js";
|
|
5
|
+
const l = [
|
|
6
|
+
{
|
|
7
|
+
component: "time-line-table",
|
|
8
|
+
name: "max-min-time-limit-time-line-table"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
component: "time-line-bar",
|
|
12
|
+
name: "max-min-time-limit-time-line-bar"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
component: "time-line-bar",
|
|
16
|
+
name: "minimum-active-trading-days-time-line-bar"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
component: "time-line-bar",
|
|
20
|
+
name: "minimum-profitable-days-time-line-bar"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
component: "metrics-static-info-card",
|
|
24
|
+
name: "highest-account-balance-static-info-card"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
component: "metrics-static-info-card",
|
|
28
|
+
name: "current-rdd-max-rdd-static-info-card"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
component: "metrics-static-info-card",
|
|
32
|
+
name: "stop-out-level-rdd-static-info-card"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
component: "metrics-static-info-card",
|
|
36
|
+
name: "the-profit-target-static-info-card"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
component: "metrics-static-info-card",
|
|
40
|
+
name: "max-daily-drawdown-static-info-card"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
component: "metrics-static-info-card",
|
|
44
|
+
name: "max-daily-stop-out-static-info-card"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
component: "metrics-static-info-card",
|
|
48
|
+
name: "max-stop-out-static-info-card"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
component: "metrics-static-info-card",
|
|
52
|
+
name: "current-add-max-add-static-info-card"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
component: "metrics-static-info-card",
|
|
56
|
+
name: "stop-out-level-add-static-info-card"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
component: "profit-loss-card",
|
|
60
|
+
name: "the-profit-target-profit-loss-card"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
component: "profit-loss-card",
|
|
64
|
+
name: "stop-loss-violations-profit-loss-card"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
component: "score-chart",
|
|
68
|
+
name: "consistency-score-target-chart"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
component: "score-chart",
|
|
72
|
+
name: "peak-daily-profit-percentage-static-info-chart"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
component: "metrics-static-info-card",
|
|
76
|
+
name: "monthly-reset-profitable-days"
|
|
77
|
+
}
|
|
78
|
+
], p = (t, r = "Something went wrong. Please try again.") => {
|
|
79
|
+
const e = t?.response?.data?.error || t?.response?.data?.message;
|
|
80
|
+
return e || (Array.isArray(t?.response?.data?.errors) && t.response.data.errors.length > 0 ? t.response.data.errors[0] : r);
|
|
81
|
+
}, g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
|
+
__proto__: null,
|
|
83
|
+
handleError: p
|
|
84
|
+
}, Symbol.toStringTag, { value: "Module" })), M = () => f, T = () => l, x = (t) => l.find((e) => e.name === t)?.component || "", S = (t, r, e) => {
|
|
85
|
+
const o = d(t, "DD-MM-YYYY").startOf("day"), n = d(r, "DD-MM-YYYY").endOf("day");
|
|
86
|
+
return e.isBefore(o) ? c.UPCOMING : e.isSameOrAfter(o) && e.isSameOrBefore(n) ? c.ONGOING : e.isAfter(n) ? c.FINISHED : null;
|
|
87
|
+
}, E = () => u, Y = () => g, j = (t) => t == null ? !0 : typeof t == "string" || Array.isArray(t) ? t.length === 0 : typeof t == "object" ? Object.keys(t).length === 0 : !1, D = (t) => !t || !Array.isArray(t) || t.length === 0, I = (t) => !t || Object.keys(t).length === 0, P = (t, r) => {
|
|
88
|
+
let e;
|
|
89
|
+
return (...o) => {
|
|
90
|
+
clearTimeout(e), e = setTimeout(() => {
|
|
91
|
+
t(...o);
|
|
92
|
+
}, r);
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
function y(t, r, e = {}) {
|
|
96
|
+
const { unique: o = !1, filter: n, transform: a } = e;
|
|
97
|
+
let m = (n ? t.filter(n) : t).map((i) => a ? a(i[r], i) : i[r]);
|
|
98
|
+
return o ? Array.from(new Set(m)) : m;
|
|
99
|
+
}
|
|
100
|
+
const _ = (t, r) => {
|
|
101
|
+
const e = y(t, r, { unique: !0 }), o = [];
|
|
102
|
+
for (const n of e)
|
|
103
|
+
for (const a of e)
|
|
104
|
+
o.push([n, a]);
|
|
105
|
+
return o;
|
|
106
|
+
}, N = (t, r) => {
|
|
107
|
+
const e = Object.keys(r).reduce((n, a) => {
|
|
108
|
+
const s = r[a];
|
|
109
|
+
return Array.isArray(s) ? n.concat(s) : n;
|
|
110
|
+
}, []);
|
|
111
|
+
return t.map((n) => {
|
|
112
|
+
const a = e.find(
|
|
113
|
+
(s) => s.login === (n?.account_id || n?.login)
|
|
114
|
+
);
|
|
115
|
+
return a ? { ...n, ...a } : n;
|
|
116
|
+
});
|
|
117
|
+
}, k = (t) => {
|
|
118
|
+
const r = t?.data ?? t;
|
|
119
|
+
if (!r?.message) return null;
|
|
120
|
+
const { message: e, success: o, ...n } = r;
|
|
121
|
+
return {
|
|
122
|
+
message: e,
|
|
123
|
+
vars: n
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
P as debounce,
|
|
128
|
+
k as extractResponseMessage,
|
|
129
|
+
_ as generateFieldPairs,
|
|
130
|
+
S as getCompetitionStatus,
|
|
131
|
+
x as getComponentWidgetRuleMetrics,
|
|
132
|
+
Y as getErrorHandlers,
|
|
133
|
+
T as getListWidgetsRuleMetrics,
|
|
134
|
+
M as getRegions,
|
|
135
|
+
E as getValidators,
|
|
136
|
+
j as isEmpty,
|
|
137
|
+
D as isEmptyArray,
|
|
138
|
+
I as isEmptyObject,
|
|
139
|
+
y as mapByField,
|
|
140
|
+
N as mergePullTradingData
|
|
141
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const roundByDecimalCount: (num: number, decimalCount?: number) => number;
|
|
2
|
+
export declare const roundOff: (num: number, decimalCount: number) => number;
|
|
3
|
+
export declare const roundUp: (num: number, decimalCount: number) => number;
|
|
4
|
+
export declare const numberWithSeparator: (amount: string | number) => string;
|
|
5
|
+
export declare const formattedNumberToRealNumber: (numberString: string | number) => number;
|
|
6
|
+
export declare const formatNumberWithSuffix: (num: number) => string;
|
|
7
|
+
export declare const getRank: (num: number) => string;
|
|
8
|
+
export declare const formatInputAmount: (input: string, formatJapaneseNumber?: boolean) => string;
|
|
9
|
+
export declare const formatCardNumber: (val: string) => string;
|
|
10
|
+
export declare const parseCardNumber: (val: string) => string;
|
|
11
|
+
export declare const formatExpiration: (val: string) => string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const n = (t, r = 0) => {
|
|
2
|
+
if (isNaN(t)) return 0;
|
|
3
|
+
const e = 10 ** r;
|
|
4
|
+
return Math.round(t * e) / e;
|
|
5
|
+
}, i = (t, r) => isNaN(t) ? 0 : Math.floor(t * 10 ** r) / 10 ** r, l = (t, r) => {
|
|
6
|
+
if (isNaN(t)) return 0;
|
|
7
|
+
const e = 10 ** r;
|
|
8
|
+
return Math.round(t * e) / e;
|
|
9
|
+
}, f = (t) => {
|
|
10
|
+
if (t == null || t === "" || t === void 0) return "";
|
|
11
|
+
const r = Number(t);
|
|
12
|
+
!isNaN(r) && t.toString().includes("e") && (t = r.toFixed(20).replace(/\.?0+$/, ""));
|
|
13
|
+
let e = t.toString().replace(/,/g, "").split(".");
|
|
14
|
+
return e[0] = e[0].replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","), e.join(".");
|
|
15
|
+
}, u = (t) => {
|
|
16
|
+
if (t = t?.toString(), !t || t?.length > 0 && t[0] === "-") return 0;
|
|
17
|
+
if (t.includes("e")) {
|
|
18
|
+
const e = Number(t);
|
|
19
|
+
return isNaN(e) ? 0 : e;
|
|
20
|
+
}
|
|
21
|
+
let r = t.split?.(".");
|
|
22
|
+
return r[0] = r[0].replace?.(/\D/g, ""), parseFloat(r.join?.("."));
|
|
23
|
+
}, p = (t) => {
|
|
24
|
+
const r = ["", "k", "M", "G", "T", "P", "E"], e = Math.log10(Math.abs(t)) / 3 | 0;
|
|
25
|
+
if (e === 0) return t.toString();
|
|
26
|
+
const s = r[e], o = Math.pow(10, e * 3), c = t / o;
|
|
27
|
+
return parseFloat(c.toFixed(2)).toString() + s;
|
|
28
|
+
}, d = (t) => {
|
|
29
|
+
if (t <= 0) return t.toString();
|
|
30
|
+
const r = t % 10, e = t % 100;
|
|
31
|
+
if (e >= 11 && e <= 13)
|
|
32
|
+
return `${t}th`;
|
|
33
|
+
switch (r) {
|
|
34
|
+
case 1:
|
|
35
|
+
return `${t}st`;
|
|
36
|
+
case 2:
|
|
37
|
+
return `${t}nd`;
|
|
38
|
+
case 3:
|
|
39
|
+
return `${t}rd`;
|
|
40
|
+
default:
|
|
41
|
+
return `${t}th`;
|
|
42
|
+
}
|
|
43
|
+
}, N = (t, r = !1) => {
|
|
44
|
+
let e = t;
|
|
45
|
+
return r && (e = t.replace(/[0-9.、]/g, (s) => ({
|
|
46
|
+
"0": "0",
|
|
47
|
+
"1": "1",
|
|
48
|
+
"2": "2",
|
|
49
|
+
"3": "3",
|
|
50
|
+
"4": "4",
|
|
51
|
+
"5": "5",
|
|
52
|
+
"6": "6",
|
|
53
|
+
"7": "7",
|
|
54
|
+
"8": "8",
|
|
55
|
+
"9": "9",
|
|
56
|
+
".": ".",
|
|
57
|
+
"、": "."
|
|
58
|
+
})[s] || s)), e.replace(/[^0-9.]/g, "");
|
|
59
|
+
}, g = (t) => t ? t.replace(/\D/g, "").slice(0, 16).replace(/(.{4})/g, "$1 ").trim() : "", h = (t) => t.replace(/\D/g, "").slice(0, 16), M = (t) => {
|
|
60
|
+
if (!t) return "";
|
|
61
|
+
const r = t.replace(/\D/g, "").slice(0, 4);
|
|
62
|
+
return r.length <= 2 ? r : r.slice(0, 2) + "/" + r.slice(2);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
g as formatCardNumber,
|
|
66
|
+
M as formatExpiration,
|
|
67
|
+
N as formatInputAmount,
|
|
68
|
+
p as formatNumberWithSuffix,
|
|
69
|
+
u as formattedNumberToRealNumber,
|
|
70
|
+
d as getRank,
|
|
71
|
+
f as numberWithSeparator,
|
|
72
|
+
h as parseCardNumber,
|
|
73
|
+
n as roundByDecimalCount,
|
|
74
|
+
i as roundOff,
|
|
75
|
+
l as roundUp
|
|
76
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PasswordRule } from '../../types/passwordRule.type';
|
|
2
|
+
|
|
3
|
+
export declare const getFallbackPasswordRules: () => PasswordRule[];
|
|
4
|
+
export declare const validatePassword: (password: string, rules?: PasswordRule[]) => boolean;
|
|
5
|
+
export declare const getPasswordStrength: (password: string, rules?: PasswordRule[]) => 0 | 1 | 2 | 3;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "../../constants/communication.constant.js";
|
|
2
|
+
import "../../constants/methods.constant.js";
|
|
3
|
+
import "../../constants/kyc.constant.js";
|
|
4
|
+
import { PASSWORD_RULE_CONDITION_NAME as o } from "../../constants/passwordRule.constants.js";
|
|
5
|
+
const s = 8, a = () => [
|
|
6
|
+
{
|
|
7
|
+
name: "Characters Long",
|
|
8
|
+
rules: [{ name: o.MIN_CHARS, value: s }],
|
|
9
|
+
state: !0,
|
|
10
|
+
is_optional: !1
|
|
11
|
+
}
|
|
12
|
+
], u = (l, t) => (t && t.length > 0 ? t : a()).every((n) => {
|
|
13
|
+
let r, i = s;
|
|
14
|
+
for (const e of n.rules)
|
|
15
|
+
e.name === o.REGEX ? r = e.value : e.name === o.MIN_CHARS && (i = Math.max(Number(e.value) || 1, 1));
|
|
16
|
+
return r ? (l.match(new RegExp(r, "g"))?.length ?? 0) >= i : l.length >= i;
|
|
17
|
+
}), R = (l, t) => {
|
|
18
|
+
let n = (t && t.length > 0 ? t : a()).filter((e) => !e.is_optional);
|
|
19
|
+
if (n.length === 0 && (n = a()), !l)
|
|
20
|
+
return 0;
|
|
21
|
+
const r = n.filter((e) => u(l, [e])).length;
|
|
22
|
+
if (r === n.length)
|
|
23
|
+
return 3;
|
|
24
|
+
const i = r / n.length;
|
|
25
|
+
return i <= 1 / 3 ? 1 : i < 1 ? 2 : 3;
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
a as getFallbackPasswordRules,
|
|
29
|
+
R as getPasswordStrength,
|
|
30
|
+
u as validatePassword
|
|
31
|
+
};
|