tek-wallet 0.0.736 → 0.0.738
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/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +13 -12
- package/dist/components/TekWallet/components/ui/Button/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +23 -31
- package/dist/components/TekWallet/components/ui/EmptyData/index.js +1 -2
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +149 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +21 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.d.ts +9 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +125 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +254 -0
- package/dist/components/TekWallet/components/ui/Formatter/index.js +9 -8
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +2 -3
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +9 -2
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +3 -3
- package/dist/components/TekWallet/components/ui/OTP/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/OTP/index.js +3 -1
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +4 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.js +53 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.js +80 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.js +64 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortTool.d.ts +11 -0
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/{sortByBalance.js → SortTool.js} +20 -19
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.d.ts +9 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +198 -86
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +3 -4
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +7 -3
- package/dist/components/TekWallet/components/ui/TimeText/index.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/TimeText/index.js +22 -0
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +24 -10
- package/dist/components/TekWallet/hooks/useConvertTime.d.ts +3 -0
- package/dist/components/TekWallet/hooks/useConvertTime.js +25 -0
- package/dist/components/TekWallet/hooks/useEventHandler.js +7 -10
- package/dist/components/TekWallet/hooks/useFormatter.d.ts +2 -0
- package/dist/components/TekWallet/hooks/useFormatter.js +2 -0
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.d.ts +14 -0
- package/dist/components/TekWallet/hooks/useWarningWrongPasscode.js +153 -0
- package/dist/components/TekWallet/providers/WalletDataProviderNoImport/index.js +5 -2
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.d.ts +1 -1
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.js +9 -19
- package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/type.d.ts +14 -0
- package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.d.ts +13 -0
- package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.js +55 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +3 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +158 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +55 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +45 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +2 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +13 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +39 -0
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +65 -0
- package/dist/components/TekWallet/theme/mui/theme.js +6 -6
- package/dist/components/TekWallet/types/expose-type.d.ts +49 -0
- package/dist/components/TekWallet/utils/cn.d.ts +2 -0
- package/dist/components/TekWallet/utils/cn.js +12 -0
- package/dist/components/TekWallet/utils/formatDate.d.ts +9 -6
- package/dist/components/TekWallet/utils/formatDate.js +410 -91
- package/package.json +5 -2
- package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.d.ts +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IC_DEPOSIT = exports.IC_WITHDRAW = exports.IC_INFORMATION = exports.IC_EXPANDER_ARROW = exports.IC_NO_SEE = exports.IC_TOOLTIP = exports.IC_BACK = exports.IC_UNCHECK = exports.IC_CHECK = exports.IC_ARROW_DROP_DOWN = exports.IC_ARROW_DROP_UP = exports.IC_RECEIVE_EXTERNAL = exports.IC_RECEIVE_INTERNAL = exports.IC_ERROR = exports.IC_SUCCESS = exports.IC_CHEVRON_RIGHT = exports.IC_CHEVRON_LEFT = exports.IC_TRASH = exports.IC_ARROW_BLACK_DROP = exports.IC_SWAP = exports.IC_HELP = exports.IC_PASSCODE = exports.IC_FACE_ID = exports.IC_COPY = exports.IC_TIMELINE_DOT = exports.IC_CLOSE = exports.IC_SEARCH = exports.IC_DOCUMENTS = exports.IC_SCAN = exports.IC_TUTORIAL = exports.IC_HISTORY = exports.ARROW_DROP_DOWN = exports.ARROW_DROP_UP = void 0;
|
|
3
|
+
exports.IC_DEPOSIT = exports.IC_WITHDRAW = exports.IC_INFORMATION = exports.IC_EXPANDER_ARROW = exports.IC_NO_SEE = exports.IC_SET = exports.IC_EDIT = exports.IC_RECEIVE_TAG_RECOMMENDED = exports.IC_RECEIVE_TAG = exports.IC_TOOLTIP = exports.IC_BACK = exports.IC_UNCHECK = exports.IC_CHECK = exports.IC_ARROW_DROP_DOWN = exports.IC_ARROW_DROP_UP = exports.IC_RECEIVE_EXTERNAL = exports.IC_RECEIVE_INTERNAL = exports.IC_ERROR = exports.IC_SUCCESS = exports.IC_CHEVRON_RIGHT = exports.IC_CHEVRON_LEFT = exports.IC_TRASH = exports.IC_ARROW_BLACK_DROP = exports.IC_SWAP = exports.IC_HELP = exports.IC_PASSCODE = exports.IC_FACE_ID = exports.IC_COPY = exports.IC_TIMELINE_DOT = exports.IC_CLOSE = exports.IC_SEARCH = exports.IC_DOCUMENTS = exports.IC_SCAN = exports.IC_TUTORIAL = exports.IC_HISTORY = exports.ARROW_DROP_DOWN = exports.ARROW_DROP_UP = void 0;
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
exports.ARROW_DROP_UP = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 4.5L4 0.5L8 4.5H0Z", fill: "#000" }) }));
|
|
6
6
|
exports.ARROW_DROP_DOWN = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5L4 4.5L0 0.5L8 0.5Z", fill: "#000" }) }));
|
|
@@ -8,10 +8,10 @@ exports.IC_HISTORY = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20",
|
|
|
8
8
|
exports.IC_TUTORIAL = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M10 5.03501C8.62634 3.80281 6.84533 3.12246 5 3.12501C4.12333 3.12501 3.28167 3.27501 2.5 3.55167V15.4267C3.30302 15.1434 4.14847 14.9991 5 15C6.92083 15 8.67333 15.7225 10 16.91M10 5.03501C11.3736 3.80274 13.1547 3.12238 15 3.12501C15.8767 3.12501 16.7183 3.27501 17.5 3.55167V15.4267C16.697 15.1434 15.8515 14.9991 15 15C13.1547 14.9975 11.3737 15.6778 10 16.91M10 5.03501V16.91", stroke: "#121212", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
9
9
|
exports.IC_SCAN = ((0, jsx_runtime_1.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M5.625 2.8125H4.5C4.05245 2.8125 3.62323 2.99029 3.30676 3.30676C2.99029 3.62323 2.8125 4.05245 2.8125 4.5V5.625M12.375 2.8125H13.5C13.9476 2.8125 14.3768 2.99029 14.6932 3.30676C15.0097 3.62323 15.1875 4.05245 15.1875 4.5V5.625M15.1875 12.375V13.5C15.1875 13.9476 15.0097 14.3768 14.6932 14.6932C14.3768 15.0097 13.9476 15.1875 13.5 15.1875H12.375M5.625 15.1875H4.5C4.05245 15.1875 3.62323 15.0097 3.30676 14.6932C2.99029 14.3768 2.8125 13.9476 2.8125 13.5V12.375M11.25 9C11.25 9.59674 11.0129 10.169 10.591 10.591C10.169 11.0129 9.59674 11.25 9 11.25C8.40326 11.25 7.83097 11.0129 7.40901 10.591C6.98705 10.169 6.75 9.59674 6.75 9C6.75 8.40326 6.98705 7.83097 7.40901 7.40901C7.83097 6.98705 8.40326 6.75 9 6.75C9.59674 6.75 10.169 6.98705 10.591 7.40901C11.0129 7.83097 11.25 8.40326 11.25 9Z", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
10
10
|
exports.IC_DOCUMENTS = ((0, jsx_runtime_1.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M14.625 10.6875V8.71875C14.625 8.04742 14.3583 7.40359 13.8836 6.92889C13.4089 6.45418 12.7651 6.1875 12.0938 6.1875H10.9688C10.745 6.1875 10.5304 6.09861 10.3721 5.94037C10.2139 5.78214 10.125 5.56753 10.125 5.34375V4.21875C10.125 3.54742 9.85832 2.90359 9.38361 2.42889C8.90891 1.95418 8.26508 1.6875 7.59375 1.6875H6.1875M6.1875 11.25H11.8125M6.1875 13.5H9M7.875 1.6875H4.21875C3.753 1.6875 3.375 2.0655 3.375 2.53125V15.4688C3.375 15.9345 3.753 16.3125 4.21875 16.3125H13.7812C14.247 16.3125 14.625 15.9345 14.625 15.4688V8.4375C14.625 6.64729 13.9138 4.9304 12.648 3.66453C11.3821 2.39866 9.66521 1.6875 7.875 1.6875Z", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
11
|
-
exports.IC_SEARCH = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", {
|
|
11
|
+
exports.IC_SEARCH = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.75 3.12409C8.01131 3.12409 7.27986 3.26959 6.59741 3.55227C5.91495 3.83495 5.29485 4.24929 4.77252 4.77162C4.25019 5.29395 3.83586 5.91404 3.55318 6.5965C3.27049 7.27896 3.125 8.01041 3.125 8.74909C3.125 9.48778 3.27049 10.2192 3.55318 10.9017C3.83586 11.5841 4.25019 12.2042 4.77252 12.7266C5.29485 13.2489 5.91495 13.6632 6.59741 13.9459C7.27986 14.2286 8.01131 14.3741 8.75 14.3741C10.2418 14.3741 11.6726 13.7815 12.7275 12.7266C13.7824 11.6717 14.375 10.2409 14.375 8.74909C14.375 7.25725 13.7824 5.82651 12.7275 4.77162C11.6726 3.71673 10.2418 3.12409 8.75 3.12409ZM1.875 8.74909C1.87515 7.64501 2.1412 6.5572 2.65066 5.57768C3.16012 4.59816 3.89799 3.75574 4.80186 3.12169C5.70574 2.48765 6.74902 2.08061 7.84347 1.93503C8.93791 1.78945 10.0513 1.90959 11.0895 2.28531C12.1277 2.66102 13.0601 3.28125 13.808 4.09353C14.5558 4.90581 15.0969 5.88624 15.3857 6.95189C15.6745 8.01755 15.7023 9.13708 15.4669 10.2158C15.2315 11.2945 14.7398 12.3006 14.0333 13.1491L17.9417 17.0574C18.0031 17.1146 18.0523 17.1836 18.0865 17.2603C18.1206 17.337 18.139 17.4197 18.1405 17.5037C18.142 17.5876 18.1265 17.6709 18.0951 17.7488C18.0637 17.8266 18.0169 17.8973 17.9575 17.9566C17.8982 18.016 17.8275 18.0628 17.7497 18.0942C17.6718 18.1256 17.5885 18.1411 17.5046 18.1396C17.4206 18.1381 17.3379 18.1197 17.2612 18.0856C17.1846 18.0514 17.1156 18.0022 17.0583 17.9408L13.15 14.0324C12.146 14.8687 10.9245 15.4015 9.6286 15.5685C8.33268 15.7355 7.01602 15.5297 5.83284 14.9753C4.64967 14.4208 3.64899 13.5407 2.94803 12.438C2.24707 11.3353 1.87486 10.0557 1.875 8.74909Z", fill: "#121212" }) }));
|
|
12
12
|
exports.IC_CLOSE = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 13L13 1M1 1L13 13", stroke: "#121212", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
13
13
|
exports.IC_TIMELINE_DOT = ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("rect", { width: "14", height: "14", rx: "7", fill: "#C5E99F" }), (0, jsx_runtime_1.jsx)("circle", { cx: "7", cy: "7", r: "3", fill: "#121212" })] }));
|
|
14
|
-
exports.IC_COPY = ((0, jsx_runtime_1.
|
|
14
|
+
exports.IC_COPY = ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M10.5 11.5V13.75C10.5 14.164 10.164 14.5 9.75 14.5H3.25C3.05109 14.5 2.86032 14.421 2.71967 14.2803C2.57902 14.1397 2.5 13.9489 2.5 13.75V5.25C2.5 4.836 2.836 4.5 3.25 4.5H4.5C4.83505 4.49977 5.16954 4.52742 5.5 4.58267M10.5 11.5H12.75C13.164 11.5 13.5 11.164 13.5 10.75V7.5C13.5 4.52667 11.338 2.05933 8.5 1.58267C8.16954 1.52742 7.83505 1.49977 7.5 1.5H6.25C5.836 1.5 5.5 1.836 5.5 2.25V4.58267M10.5 11.5H6.25C6.05109 11.5 5.86032 11.421 5.71967 11.2803C5.57902 11.1397 5.5 10.9489 5.5 10.75V4.58267M13.5 9V7.75C13.5 7.15326 13.2629 6.58097 12.841 6.15901C12.419 5.73705 11.8467 5.5 11.25 5.5H10.25C10.0511 5.5 9.86032 5.42098 9.71967 5.28033C9.57902 5.13968 9.5 4.94891 9.5 4.75V3.75C9.5 3.45453 9.4418 3.16195 9.32873 2.88896C9.21566 2.61598 9.04992 2.36794 8.84099 2.15901C8.63206 1.95008 8.38402 1.78435 8.11104 1.67127C7.83806 1.5582 7.54547 1.5 7.25 1.5H6.5", stroke: "#1C461D", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
15
15
|
exports.IC_FACE_ID = ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.125 7.5V5.83333C3.125 5.115 3.41 4.42583 3.91833 3.91833C4.42583 3.41 5.115 3.125 5.83333 3.125H7.5C7.845 3.125 8.125 2.845 8.125 2.5C8.125 2.155 7.845 1.875 7.5 1.875H5.83333C4.78333 1.875 3.77667 2.29167 3.03417 3.03417C2.29167 3.77667 1.875 4.78333 1.875 5.83333V7.5C1.875 7.845 2.155 8.125 2.5 8.125C2.845 8.125 3.125 7.845 3.125 7.5Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5 3.125H14.1667C14.885 3.125 15.5742 3.41 16.0817 3.91833C16.59 4.42583 16.875 5.115 16.875 5.83333V7.5C16.875 7.845 17.155 8.125 17.5 8.125C17.845 8.125 18.125 7.845 18.125 7.5V5.83333C18.125 4.78333 17.7083 3.77667 16.9658 3.03417C16.2233 2.29167 15.2167 1.875 14.1667 1.875C13.2483 1.875 12.5 1.875 12.5 1.875C12.155 1.875 11.875 2.155 11.875 2.5C11.875 2.845 12.155 3.125 12.5 3.125Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.875 12.5V14.1667C1.875 15.2167 2.29167 16.2233 3.03417 16.9658C3.77667 17.7083 4.78333 18.125 5.83333 18.125H7.5C7.845 18.125 8.125 17.845 8.125 17.5C8.125 17.155 7.845 16.875 7.5 16.875H5.83333C5.115 16.875 4.42583 16.59 3.91833 16.0817C3.41 15.5742 3.125 14.885 3.125 14.1667C3.125 13.2483 3.125 12.5 3.125 12.5C3.125 12.155 2.845 11.875 2.5 11.875C2.155 11.875 1.875 12.155 1.875 12.5Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5 18.125H14.1667C15.2167 18.125 16.2233 17.7083 16.9658 16.9658C17.7083 16.2233 18.125 15.2167 18.125 14.1667C18.125 13.2483 18.125 12.5 18.125 12.5C18.125 12.155 17.845 11.875 17.5 11.875C17.155 11.875 16.875 12.155 16.875 12.5V14.1667C16.875 14.885 16.59 15.5742 16.0817 16.0817C15.5742 16.59 14.885 16.875 14.1667 16.875C13.2483 16.875 12.5 16.875 12.5 16.875C12.155 16.875 11.875 17.155 11.875 17.5C11.875 17.845 12.155 18.125 12.5 18.125Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.2915 7.08398V7.91732C12.2915 8.26232 12.5715 8.54232 12.9165 8.54232C13.2615 8.54232 13.5415 8.26232 13.5415 7.91732V7.08398C13.5415 6.73898 13.2615 6.45898 12.9165 6.45898C12.5715 6.45898 12.2915 6.73898 12.2915 7.08398Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.4585 7.08398V7.91732C6.4585 8.26232 6.7385 8.54232 7.0835 8.54232C7.4285 8.54232 7.7085 8.26232 7.7085 7.91732V7.08398C7.7085 6.73898 7.4285 6.45898 7.0835 6.45898C6.7385 6.45898 6.4585 6.73898 6.4585 7.08398Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.79152 10.4473V8.33398C9.79152 7.98898 10.0715 7.70898 10.4165 7.70898C10.7615 7.70898 11.0415 7.98898 11.0415 8.33398V10.834C11.0415 11.0707 10.9073 11.2873 10.6957 11.3932L9.86235 11.8098C9.55402 11.964 9.17818 11.839 9.02402 11.5298C8.86985 11.2215 8.99485 10.8457 9.30402 10.6915L9.79152 10.4473Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.4752 12.4743C12.5885 12.361 12.7443 12.291 12.9168 12.291C13.2618 12.291 13.5418 12.571 13.5418 12.916C13.5418 13.0885 13.4718 13.2443 13.3585 13.3577C13.2452 13.471 13.3585 13.3585 13.3577 13.3593C11.5035 15.2135 8.49683 15.2135 6.64266 13.3593C6.64183 13.3585 6.64183 13.3577 6.64183 13.3577C6.5285 13.2443 6.4585 13.0885 6.4585 12.916C6.4585 12.571 6.7385 12.291 7.0835 12.291C7.256 12.291 7.41183 12.361 7.52516 12.4743C7.6385 12.5877 7.526 12.4743 7.52683 12.4752C8.89266 13.841 11.1077 13.841 12.4735 12.4752C12.4743 12.4743 12.4752 12.4743 12.4752 12.4743Z", fill: "#121212" })] }));
|
|
16
16
|
exports.IC_PASSCODE = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "10", viewBox: "0 0 20 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1.87497 9.62518V8.37518H18.125V9.62518H1.87497ZM2.57684 4.6156L1.71788 4.11872L2.47434 2.78872H0.961426V1.79497H2.47434L1.71788 0.50664L2.57684 0.00976562L3.3333 1.29831L4.08976 0.00976562L4.94872 0.50664L4.19226 1.79497H5.70518V2.78872H4.19226L4.94872 4.11872L4.08976 4.6156L3.3333 3.28539L2.57684 4.6156ZM9.24351 4.6156L8.38455 4.11872L9.14101 2.78872H7.62809V1.79497H9.14101L8.38455 0.50664L9.24351 0.00976562L9.99997 1.29831L10.7564 0.00976562L11.6154 0.50664L10.8589 1.79497H12.3718V2.78872H10.8589L11.6154 4.11872L10.7564 4.6156L9.99997 3.28539L9.24351 4.6156ZM15.9102 4.6156L15.0512 4.11872L15.8077 2.78872H14.2948V1.79497H15.8077L15.0512 0.50664L15.9102 0.00976562L16.6666 1.29831L17.4231 0.00976562L18.2821 0.50664L17.5256 1.79497H19.0385V2.78872H17.5256L18.2821 4.11872L17.4231 4.6156L16.6666 3.28539L15.9102 4.6156Z", fill: "#a3a3a3" }) }));
|
|
17
17
|
exports.IC_HELP = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M10 5.03501C8.62634 3.80281 6.84533 3.12246 5 3.12501C4.12333 3.12501 3.28167 3.27501 2.5 3.55167V15.4267C3.30302 15.1434 4.14847 14.9991 5 15C6.92083 15 8.67333 15.7225 10 16.91M10 5.03501C11.3736 3.80274 13.1547 3.12238 15 3.12501C15.8767 3.12501 16.7183 3.27501 17.5 3.55167V15.4267C16.697 15.1434 15.8515 14.9991 15 15C13.1547 14.9975 11.3737 15.6778 10 16.91M10 5.03501V16.91", stroke: "#121212", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -30,6 +30,10 @@ exports.IC_CHECK = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", v
|
|
|
30
30
|
exports.IC_UNCHECK = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M19 10C19 11.1819 18.7672 12.3522 18.3149 13.4442C17.8626 14.5361 17.1997 15.5282 16.364 16.364C15.5282 17.1997 14.5361 17.8626 13.4442 18.3149C12.3522 18.7672 11.1819 19 10 19C8.8181 19 7.64778 18.7672 6.55585 18.3149C5.46392 17.8626 4.47177 17.1997 3.63604 16.364C2.80031 15.5282 2.13738 14.5361 1.68508 13.4442C1.23279 12.3522 1 11.1819 1 10C1 7.61305 1.94821 5.32387 3.63604 3.63604C5.32387 1.94821 7.61305 1 10 1C12.3869 1 14.6761 1.94821 16.364 3.63604C18.0518 5.32387 19 7.61305 19 10Z", stroke: "#E5E6E6", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
31
31
|
exports.IC_BACK = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "12", viewBox: "0 0 8 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M6.00002 11.6534L0.346191 5.99953L6.00002 0.345703L7.05384 1.39953L2.45384 5.99953L7.05384 10.5995L6.00002 11.6534Z", fill: "#121212" }) }));
|
|
32
32
|
exports.IC_TOOLTIP = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
33
|
+
exports.IC_RECEIVE_TAG = ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "95", height: "34", viewBox: "0 0 95 34", fill: "none", children: [(0, jsx_runtime_1.jsx)("path", { d: "M0 22C0 13.7157 6.71573 7 15 7H88V19C88 23.4183 84.4183 27 80 27H0V22Z", fill: "#FF434E" }), (0, jsx_runtime_1.jsx)("path", { d: "M0 27H7C2.61253 28.3759 1.16529 29.9732 0 34V27Z", fill: "#FF434E" }), (0, jsx_runtime_1.jsx)("path", { opacity: "0.01", d: "M68 0H75C70.6125 1.37594 69.1653 2.97319 68 7V0Z", fill: "#FF434E" }), (0, jsx_runtime_1.jsx)("path", { d: "M88 7H95C90.6125 8.37594 89.1653 9.97319 88 14V7Z", fill: "#FF434E" })] }));
|
|
34
|
+
exports.IC_RECEIVE_TAG_RECOMMENDED = ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "95", height: "34", viewBox: "0 0 95 34", fill: "none", children: [(0, jsx_runtime_1.jsx)("path", { d: "M0 22C0 13.7157 6.71573 7 15 7H88V19C88 23.4183 84.4183 27 80 27H0V22Z", fill: "#1EA031" }), (0, jsx_runtime_1.jsx)("path", { d: "M0 27H7C2.61253 28.3759 1.16529 29.9732 0 34V27Z", fill: "#1EA031" }), (0, jsx_runtime_1.jsx)("path", { opacity: "0.01", d: "M68 0H75C70.6125 1.37594 69.1653 2.97319 68 7V0Z", fill: "#1EA031" }), (0, jsx_runtime_1.jsx)("path", { d: "M88 7H95C90.6125 8.37594 89.1653 9.97319 88 14V7Z", fill: "#1EA031" })] }));
|
|
35
|
+
exports.IC_EDIT = ((0, jsx_runtime_1.jsxs)("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_4608_8535", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "17", height: "16", children: (0, jsx_runtime_1.jsx)("rect", { x: "0.5", width: "16", height: "16", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_4608_8535)", children: (0, jsx_runtime_1.jsx)("path", { d: "M4.10039 13.6008C3.77039 13.6008 3.48789 13.4833 3.25289 13.2483C3.01789 13.0133 2.90039 12.7308 2.90039 12.4008V3.60078C2.90039 3.26623 3.01706 2.97978 3.25039 2.74145C3.48372 2.50323 3.76706 2.38967 4.10039 2.40078H9.86706L8.66706 3.60078H4.10039V12.4008H12.9004V7.83412L14.1004 6.63411V12.4008C14.1004 12.7308 13.9829 13.0133 13.7479 13.2483C13.5129 13.4833 13.2304 13.6008 12.9004 13.6008H4.10039ZM6.90039 9.60078V7.05078L12.8004 1.15078C12.9226 1.02856 13.0559 0.93967 13.2004 0.884115C13.3448 0.828559 13.4921 0.800781 13.6421 0.800781C13.8021 0.800781 13.9546 0.828559 14.0996 0.884115C14.2446 0.93967 14.3778 1.02734 14.4994 1.14712L15.3504 2.00078C15.4726 2.123 15.5615 2.25734 15.6171 2.40378C15.6726 2.55023 15.7004 2.69923 15.7004 2.85078C15.7004 3.00256 15.6725 3.15184 15.6167 3.29861C15.5609 3.44528 15.4722 3.57934 15.3504 3.70078L9.45039 9.60078H6.90039ZM8.10039 8.40078H8.95039L12.8004 4.55078L12.3837 4.11745L11.9504 3.70078L8.10039 7.55078V8.40078Z", fill: "#1E4841" }) })] }));
|
|
36
|
+
exports.IC_SET = ((0, jsx_runtime_1.jsxs)("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_4608_8545", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "17", height: "16", children: (0, jsx_runtime_1.jsx)("rect", { x: "0.5", width: "16", height: "16", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_4608_8545)", children: (0, jsx_runtime_1.jsx)("path", { d: "M7.70039 11.2004H9.30039V8.80039H11.7004V7.20039H9.30039V4.80039H7.70039V7.20039H5.30039V8.80039H7.70039V11.2004ZM4.10039 13.6004C3.77039 13.6004 3.48789 13.4829 3.25289 13.2479C3.01789 13.0129 2.90039 12.7304 2.90039 12.4004V3.60039C2.90039 3.27039 3.01789 2.98789 3.25289 2.75289C3.48789 2.51789 3.77039 2.40039 4.10039 2.40039H12.9004C13.2304 2.40039 13.5129 2.51789 13.7479 2.75289C13.9829 2.98789 14.1004 3.27039 14.1004 3.60039V12.4004C14.1004 12.7304 13.9829 13.0129 13.7479 13.2479C13.5129 13.4829 13.2304 13.6004 12.9004 13.6004H4.10039ZM4.10039 12.4004H12.9004V3.60039H4.10039V12.4004Z", fill: "#1E4841" }) })] }));
|
|
33
37
|
exports.IC_NO_SEE = ((0, jsx_runtime_1.jsx)("svg", { width: "15", height: "14", viewBox: "0 0 15 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M2.32125 4.482C1.7171 5.21812 1.26723 6.07547 1 7C1.83434 9.892 4.42904 12 7.50032 12C8.14157 12 8.76151 11.908 9.34916 11.7367M3.77294 3.152C4.87891 2.39857 6.17526 1.99792 7.50032 2C10.5716 2 13.1657 4.108 14 6.99867C13.5428 8.57823 12.5612 9.94107 11.2277 10.848M3.77294 3.152L1.68839 1M3.77294 3.152L6.13 5.58533M11.2277 10.848L13.3123 13M11.2277 10.848L8.87065 8.41467C9.05056 8.22893 9.19327 8.00844 9.29064 7.76577C9.38801 7.52309 9.43812 7.263 9.43812 7.00033C9.43812 6.73767 9.38801 6.47757 9.29064 6.2349C9.19327 5.99223 9.05056 5.77173 8.87065 5.586C8.69074 5.40027 8.47715 5.25294 8.24208 5.15242C8.00702 5.0519 7.75508 5.00016 7.50065 5.00016C7.24621 5.00016 6.99427 5.0519 6.75921 5.15242C6.52414 5.25294 6.31056 5.40027 6.13064 5.586M8.87 8.414L6.13129 5.58667", stroke: "#6B7271", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
34
38
|
exports.IC_EXPANDER_ARROW = ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("rect", { x: "0.5", y: "0.5", width: "15", height: "15", rx: "7.5", fill: "#ECF4E9" }), (0, jsx_runtime_1.jsx)("rect", { x: "0.5", y: "0.5", width: "15", height: "15", rx: "7.5", stroke: "#1E4841" }), (0, jsx_runtime_1.jsx)("path", { d: "M4 4V6.18182M4 4H6.18182M4 4L6.54545 6.54545M4 12V9.81818M4 12H6.18182M4 12L6.54545 9.45455M12 4H9.81818M12 4V6.18182M12 4L9.45455 6.54545M12 12H9.81818M12 12V9.81818M12 12L9.45455 9.45455", stroke: "#1E4841", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
35
39
|
exports.IC_INFORMATION = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = TimeText;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var material_1 = require("@mui/material");
|
|
6
|
+
function TimeText(_a) {
|
|
7
|
+
var seconds = _a.seconds, _b = _a.format, format = _b === void 0 ? "mm:ss" : _b;
|
|
8
|
+
var formatTime = function (totalSeconds, timeFormat) {
|
|
9
|
+
var hours = Math.floor(totalSeconds / 3600);
|
|
10
|
+
var minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
11
|
+
var secs = totalSeconds % 60;
|
|
12
|
+
var pad = function (num) { return num.toString().padStart(2, "0"); };
|
|
13
|
+
if (timeFormat === "hh:mm:ss") {
|
|
14
|
+
return "".concat(pad(hours), ":").concat(pad(minutes), ":").concat(pad(secs));
|
|
15
|
+
}
|
|
16
|
+
else if (timeFormat === "mm:ss") {
|
|
17
|
+
return "".concat(pad(minutes), ":").concat(pad(secs));
|
|
18
|
+
}
|
|
19
|
+
return "".concat(pad(minutes), ":").concat(pad(secs));
|
|
20
|
+
};
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title03", color: seconds ? "success" : "error", children: formatTime(seconds, format) }));
|
|
22
|
+
}
|
|
@@ -95,7 +95,6 @@ var react_2 = require("react");
|
|
|
95
95
|
var Text_1 = __importDefault(require("../../ui/Text"));
|
|
96
96
|
var material_1 = require("@mui/material");
|
|
97
97
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
98
|
-
var authentication_by_passcode_service_1 = __importDefault(require("../../../services/axios/authentication-by-passcode-service"));
|
|
99
98
|
var update_passcode_service_1 = __importDefault(require("../../../services/axios/update-passcode-service"));
|
|
100
99
|
var const_1 = require("./const");
|
|
101
100
|
var const_2 = require("./const");
|
|
@@ -103,6 +102,8 @@ var type_1 = require("./type");
|
|
|
103
102
|
var init_passcode_service_1 = __importDefault(require("../../../services/axios/init-passcode-service"));
|
|
104
103
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
105
104
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
105
|
+
var useWarningWrongPasscode_1 = require("../../../hooks/useWarningWrongPasscode");
|
|
106
|
+
var clsx_1 = __importDefault(require("clsx"));
|
|
106
107
|
var passcodeLength = 6;
|
|
107
108
|
var ChangePasscodeView = function (props) {
|
|
108
109
|
var _a = props.isInitPasscode, isInitPasscode = _a === void 0 ? false : _a, _b = props.idPrefix, idPrefix = _b === void 0 ? "" : _b;
|
|
@@ -121,8 +122,10 @@ var ChangePasscodeView = function (props) {
|
|
|
121
122
|
var childPageLayoutRef = (0, react_2.useRef)(null);
|
|
122
123
|
var _f = (0, react_2.useState)(initStep.current), currentStep = _f[0], setCurrentStep = _f[1];
|
|
123
124
|
var _g = (0, react_2.useState)(null), error = _g[0], setError = _g[1];
|
|
125
|
+
var _h = (0, useWarningWrongPasscode_1.useValidatePasscode)(), handleVerifyPasscode = _h.handleVerifyPasscode, warningContent = _h.warningContent, isLocked = _h.isLocked, handleClearUnknownError = _h.handleClearUnknownError, unknownError = _h.unknownError;
|
|
124
126
|
var resetValue = function () {
|
|
125
127
|
var _a;
|
|
128
|
+
handleClearUnknownError();
|
|
126
129
|
setError(null);
|
|
127
130
|
setOldPasscode("");
|
|
128
131
|
setNewPasscode("");
|
|
@@ -160,10 +163,14 @@ var ChangePasscodeView = function (props) {
|
|
|
160
163
|
};
|
|
161
164
|
var handleChangePasscodeError = function () {
|
|
162
165
|
gotoStep(initStep.current);
|
|
163
|
-
setError(
|
|
166
|
+
// setError(ChangePasscodeError.OLD_PASSCODE_INCORRECT);
|
|
167
|
+
};
|
|
168
|
+
var handleInitPasscodeError = function () {
|
|
169
|
+
gotoStep(initStep.current);
|
|
170
|
+
// setError(ChangePasscodeError.OLD_PASSCODE_INCORRECT);
|
|
164
171
|
};
|
|
165
172
|
var handleOldPasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
166
|
-
var
|
|
173
|
+
var result;
|
|
167
174
|
var _a, _b;
|
|
168
175
|
return __generator(this, function (_c) {
|
|
169
176
|
switch (_c.label) {
|
|
@@ -173,18 +180,21 @@ var ChangePasscodeView = function (props) {
|
|
|
173
180
|
setError(null);
|
|
174
181
|
if (!(value.length === passcodeLength)) return [3 /*break*/, 2];
|
|
175
182
|
(_a = childPageLayoutRef.current) === null || _a === void 0 ? void 0 : _a.showLoading();
|
|
176
|
-
return [4 /*yield*/, (
|
|
183
|
+
return [4 /*yield*/, handleVerifyPasscode({
|
|
177
184
|
passcode: value,
|
|
178
185
|
})];
|
|
179
186
|
case 1:
|
|
180
|
-
|
|
181
|
-
(
|
|
182
|
-
if (res.success) {
|
|
187
|
+
result = _c.sent();
|
|
188
|
+
if (result === useWarningWrongPasscode_1.ValidatePasscodeResult.SUCCESS) {
|
|
183
189
|
gotoStep(type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE);
|
|
184
190
|
}
|
|
191
|
+
else if (result === useWarningWrongPasscode_1.ValidatePasscodeResult.WRONG_PASSCODE) {
|
|
192
|
+
handleInitPasscodeError();
|
|
193
|
+
}
|
|
185
194
|
else {
|
|
186
195
|
handleChangePasscodeError();
|
|
187
196
|
}
|
|
197
|
+
(_b = childPageLayoutRef.current) === null || _b === void 0 ? void 0 : _b.showNormal();
|
|
188
198
|
_c.label = 2;
|
|
189
199
|
case 2: return [2 /*return*/];
|
|
190
200
|
}
|
|
@@ -301,9 +311,13 @@ var ChangePasscodeView = function (props) {
|
|
|
301
311
|
return { value: confirmPasscode, onChange: handleConfirmPasscodeChange };
|
|
302
312
|
}
|
|
303
313
|
};
|
|
304
|
-
var
|
|
314
|
+
var _j = getValueAndHandlerByStep(currentStep), value = _j.value, onChange = _j.onChange;
|
|
305
315
|
var keyboardId = (0, react_2.useMemo)(function () { return "".concat(idPrefix, "-").concat(isInitPasscode ? "init" : "change", "-passcode-keyboard"); }, [isInitPasscode, idPrefix]);
|
|
306
|
-
return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, value: value, onChange: onChange, viewFullHeight: true,
|
|
316
|
+
return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, value: value, onChange: onChange, viewFullHeight: true, classNames: {
|
|
317
|
+
keyboardContainer: (0, clsx_1.default)({
|
|
318
|
+
"!hidden": isLocked,
|
|
319
|
+
}),
|
|
320
|
+
}, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: pageTitle, renderBack: function (Back) { return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: Back })); } }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, initialActiveTab: currentStep, sx: { height: "100%" }, swiperStyle: {
|
|
307
321
|
flex: 1,
|
|
308
322
|
}, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
309
323
|
display: "flex",
|
|
@@ -312,7 +326,7 @@ var ChangePasscodeView = function (props) {
|
|
|
312
326
|
alignItems: "center",
|
|
313
327
|
gap: "1rem",
|
|
314
328
|
height: "100%",
|
|
315
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: error })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
329
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), unknownError, warningContent, error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: error })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
316
330
|
display: "flex",
|
|
317
331
|
flexDirection: "column",
|
|
318
332
|
justifyContent: "center",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useConvertTime = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var useConvertTime = function () {
|
|
7
|
+
var formatTime = (0, react_1.useCallback)(function (seconds) {
|
|
8
|
+
var days = Math.floor(seconds / (60 * 60 * 24));
|
|
9
|
+
var hours = Math.floor((seconds % (60 * 60 * 24)) / (60 * 60));
|
|
10
|
+
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
|
11
|
+
var remainingSeconds = seconds % 60;
|
|
12
|
+
var timeParts = [];
|
|
13
|
+
if (days > 0)
|
|
14
|
+
timeParts.push("".concat(days, " day").concat(days > 1 ? "s" : ""));
|
|
15
|
+
if (hours > 0)
|
|
16
|
+
timeParts.push("".concat(hours, " hour").concat(hours > 1 ? "s" : ""));
|
|
17
|
+
if (minutes > 0)
|
|
18
|
+
timeParts.push("".concat(minutes, " minute").concat(minutes > 1 ? "s" : ""));
|
|
19
|
+
if (remainingSeconds > 0)
|
|
20
|
+
timeParts.push("".concat(remainingSeconds, " second").concat(remainingSeconds > 1 ? "s" : ""));
|
|
21
|
+
return (0, jsx_runtime_1.jsx)("span", { children: timeParts.join(", ") });
|
|
22
|
+
}, []);
|
|
23
|
+
return { formatTime: formatTime };
|
|
24
|
+
};
|
|
25
|
+
exports.useConvertTime = useConvertTime;
|
|
@@ -11,9 +11,11 @@ var useWalletData_1 = __importDefault(require("./useWalletData"));
|
|
|
11
11
|
var useWithdrawData_1 = __importDefault(require("./useWithdrawData"));
|
|
12
12
|
var Formatter_1 = __importDefault(require("../components/ui/Formatter"));
|
|
13
13
|
var Text_1 = __importDefault(require("../components/ui/Text"));
|
|
14
|
+
var useReceiveData_1 = __importDefault(require("./useReceiveData"));
|
|
14
15
|
var useEventHandler = function () {
|
|
15
16
|
var updateWalletDetail = (0, useWalletData_1.default)().updateWalletDetail;
|
|
16
17
|
var _a = (0, useWithdrawData_1.default)(), updateWithdrawToken = _a.updateWithdrawToken, updateSendInternalToken = _a.updateSendInternalToken;
|
|
18
|
+
var updateReceiveExternalToken = (0, useReceiveData_1.default)().updateReceiveExternalToken;
|
|
17
19
|
var updateData = (0, react_1.useCallback)(function (transactionType, showActivities) {
|
|
18
20
|
var typeSlug = transactionType.slug;
|
|
19
21
|
switch (typeSlug) {
|
|
@@ -24,25 +26,20 @@ var useEventHandler = function () {
|
|
|
24
26
|
// take: 10,
|
|
25
27
|
// // transaction_types: typeSlug,
|
|
26
28
|
// });
|
|
27
|
-
updateWalletDetail();
|
|
28
29
|
updateWithdrawToken();
|
|
29
30
|
showActivities === null || showActivities === void 0 ? void 0 : showActivities();
|
|
30
31
|
break;
|
|
31
32
|
case type_1.TransactionSlug.TransferInternal:
|
|
32
|
-
// updateActivities({
|
|
33
|
-
// page: 1,
|
|
34
|
-
// take: 10,
|
|
35
|
-
// // transaction_types: typeSlug,
|
|
36
|
-
// });
|
|
37
|
-
updateWalletDetail();
|
|
38
33
|
updateSendInternalToken();
|
|
39
34
|
showActivities === null || showActivities === void 0 ? void 0 : showActivities();
|
|
40
35
|
break;
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
case type_1.TransactionSlug.Deposit:
|
|
37
|
+
updateReceiveExternalToken();
|
|
38
|
+
showActivities === null || showActivities === void 0 ? void 0 : showActivities();
|
|
43
39
|
break;
|
|
44
40
|
}
|
|
45
|
-
|
|
41
|
+
updateWalletDetail();
|
|
42
|
+
}, [updateWalletDetail, updateWithdrawToken, updateSendInternalToken, updateReceiveExternalToken]);
|
|
46
43
|
var transactionHandler = function (messageEvent, showActivities) {
|
|
47
44
|
var _a, _b, _c;
|
|
48
45
|
if (!messageEvent)
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var formatDate_1 = __importDefault(require("../utils/formatDate"));
|
|
6
7
|
var formatter_1 = __importDefault(require("../utils/formatter"));
|
|
7
8
|
var roundToTwoSignificantDecimals_1 = __importDefault(require("../utils/roundToTwoSignificantDecimals"));
|
|
8
9
|
function useFormatter() {
|
|
@@ -20,6 +21,7 @@ function useFormatter() {
|
|
|
20
21
|
};
|
|
21
22
|
return {
|
|
22
23
|
formatValue: formatValue,
|
|
24
|
+
formatDate: formatDate_1.default,
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
exports.default = useFormatter;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { AuthenticationByPasscodeBody } from "../services/axios/authentication-by-passcode-service/type";
|
|
3
|
+
export declare enum ValidatePasscodeResult {
|
|
4
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
5
|
+
WRONG_PASSCODE = "WRONG_PASSCODE",
|
|
6
|
+
SUCCESS = "SUCCESS"
|
|
7
|
+
}
|
|
8
|
+
export declare function useValidatePasscode(): {
|
|
9
|
+
warningContent: ReactNode;
|
|
10
|
+
handleVerifyPasscode: (data: AuthenticationByPasscodeBody) => Promise<ValidatePasscodeResult>;
|
|
11
|
+
isLocked: boolean;
|
|
12
|
+
unknownError: ReactNode;
|
|
13
|
+
handleClearUnknownError: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.ValidatePasscodeResult = void 0;
|
|
54
|
+
exports.useValidatePasscode = useValidatePasscode;
|
|
55
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
56
|
+
var react_1 = require("react");
|
|
57
|
+
var useWalletData_1 = __importDefault(require("./useWalletData"));
|
|
58
|
+
var authentication_by_passcode_service_1 = __importDefault(require("../services/axios/authentication-by-passcode-service"));
|
|
59
|
+
var providers_1 = require("../providers");
|
|
60
|
+
var useConvertTime_1 = require("./useConvertTime");
|
|
61
|
+
var useFormatter_1 = __importDefault(require("./useFormatter"));
|
|
62
|
+
var Text_1 = __importDefault(require("../components/ui/Text"));
|
|
63
|
+
var ValidatePasscodeResult;
|
|
64
|
+
(function (ValidatePasscodeResult) {
|
|
65
|
+
ValidatePasscodeResult["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
66
|
+
ValidatePasscodeResult["WRONG_PASSCODE"] = "WRONG_PASSCODE";
|
|
67
|
+
ValidatePasscodeResult["SUCCESS"] = "SUCCESS";
|
|
68
|
+
})(ValidatePasscodeResult || (exports.ValidatePasscodeResult = ValidatePasscodeResult = {}));
|
|
69
|
+
function useValidatePasscode() {
|
|
70
|
+
var _this = this;
|
|
71
|
+
var _a = (0, react_1.useState)(null), warningContent = _a[0], setWarningContent = _a[1];
|
|
72
|
+
var _b = (0, react_1.useState)(false), isLocked = _b[0], setIsLocked = _b[1];
|
|
73
|
+
var _c = (0, react_1.useState)(null), unknownError = _c[0], setUnknownError = _c[1];
|
|
74
|
+
var _d = (0, useWalletData_1.default)(), policyInfo = _d.policyInfo, isTokensLoading = _d.isTokensLoading, isInitPasscode = _d.isInitPasscode;
|
|
75
|
+
var theme = (0, providers_1.useTheme)();
|
|
76
|
+
var formatTime = (0, useConvertTime_1.useConvertTime)().formatTime;
|
|
77
|
+
var initialized = (0, react_1.useRef)(false);
|
|
78
|
+
var timer = (0, react_1.useRef)(null);
|
|
79
|
+
var formatDate = (0, useFormatter_1.default)().formatDate;
|
|
80
|
+
var handleSetIsLocked = (0, react_1.useCallback)(function (isLocked, lockDuration) {
|
|
81
|
+
setIsLocked(isLocked);
|
|
82
|
+
if (timer.current) {
|
|
83
|
+
clearTimeout(timer.current);
|
|
84
|
+
}
|
|
85
|
+
// auto unlock after lock duration
|
|
86
|
+
if (isLocked) {
|
|
87
|
+
timer.current = setTimeout(function () {
|
|
88
|
+
handleCheckPolicyInfo(null);
|
|
89
|
+
}, lockDuration || 0);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
92
|
+
(0, react_1.useEffect)(function () {
|
|
93
|
+
return function () {
|
|
94
|
+
if (timer.current) {
|
|
95
|
+
clearTimeout(timer.current);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}, []);
|
|
99
|
+
var handleCheckPolicyInfo = (0, react_1.useCallback)(function (policyInfo) {
|
|
100
|
+
if (!policyInfo || policyInfo.expired < Date.now()) {
|
|
101
|
+
setWarningContent(null);
|
|
102
|
+
handleSetIsLocked(false);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
var timesLeft = ((policyInfo === null || policyInfo === void 0 ? void 0 : policyInfo.failed_attempts) || 0) - ((policyInfo === null || policyInfo === void 0 ? void 0 : policyInfo.value) || 0);
|
|
106
|
+
var lockDuration = (policyInfo === null || policyInfo === void 0 ? void 0 : policyInfo.lock_duration) || 0;
|
|
107
|
+
if (timesLeft <= 0) {
|
|
108
|
+
var unLockAt = policyInfo === null || policyInfo === void 0 ? void 0 : policyInfo.expired;
|
|
109
|
+
handleSetIsLocked(true, lockDuration * 1000);
|
|
110
|
+
setWarningContent((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: ["Your account is locked because of too many wrong tries. Please try again after ", (0, jsx_runtime_1.jsx)("strong", { children: formatDate(unLockAt, true) }), "."] }));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
var lockDurationString = formatTime(lockDuration);
|
|
114
|
+
handleSetIsLocked(false);
|
|
115
|
+
setWarningContent((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: ["Invalid passcode. You have ".concat(timesLeft, " attempts left. Too many wrong tries will lock your account for "), lockDurationString, "."] }));
|
|
116
|
+
}, []);
|
|
117
|
+
var handleVerifyPasscode = (0, react_1.useCallback)(function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
118
|
+
var response, policyInfo_1, err_1;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0:
|
|
122
|
+
_a.trys.push([0, 2, , 3]);
|
|
123
|
+
return [4 /*yield*/, (0, authentication_by_passcode_service_1.default)(data)];
|
|
124
|
+
case 1:
|
|
125
|
+
response = _a.sent();
|
|
126
|
+
setUnknownError(null);
|
|
127
|
+
if (response === null || response === void 0 ? void 0 : response.success) {
|
|
128
|
+
handleCheckPolicyInfo(null);
|
|
129
|
+
return [2 /*return*/, ValidatePasscodeResult.SUCCESS];
|
|
130
|
+
}
|
|
131
|
+
policyInfo_1 = response === null || response === void 0 ? void 0 : response.data;
|
|
132
|
+
handleCheckPolicyInfo(policyInfo_1 || null);
|
|
133
|
+
return [2 /*return*/, ValidatePasscodeResult.WRONG_PASSCODE];
|
|
134
|
+
case 2:
|
|
135
|
+
err_1 = _a.sent();
|
|
136
|
+
console.error("handleVerifyPasscode", err_1);
|
|
137
|
+
setUnknownError((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: "Something went wrong, please try again later." }));
|
|
138
|
+
return [2 /*return*/, ValidatePasscodeResult.UNKNOWN_ERROR];
|
|
139
|
+
case 3: return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}); }, []);
|
|
143
|
+
var handleClearUnknownError = (0, react_1.useCallback)(function () {
|
|
144
|
+
setUnknownError(null);
|
|
145
|
+
}, []);
|
|
146
|
+
(0, react_1.useEffect)(function () {
|
|
147
|
+
if (isTokensLoading || initialized.current || !isInitPasscode)
|
|
148
|
+
return;
|
|
149
|
+
initialized.current = true;
|
|
150
|
+
handleCheckPolicyInfo(policyInfo || null);
|
|
151
|
+
}, [policyInfo, isTokensLoading, handleCheckPolicyInfo, isInitPasscode]);
|
|
152
|
+
return { warningContent: warningContent, handleVerifyPasscode: handleVerifyPasscode, isLocked: isLocked, unknownError: unknownError, handleClearUnknownError: handleClearUnknownError };
|
|
153
|
+
}
|
|
@@ -100,6 +100,7 @@ exports.initialWalletDataNoImport = {
|
|
|
100
100
|
isTokensLoading: false,
|
|
101
101
|
masterWallet: undefined,
|
|
102
102
|
blockchainWallets: undefined,
|
|
103
|
+
policyInfo: undefined,
|
|
103
104
|
updateLogin: function () { },
|
|
104
105
|
updateWalletDetail: function () { },
|
|
105
106
|
disconnect: function () { },
|
|
@@ -117,7 +118,8 @@ function WalletDataProviderNoImport(_a) {
|
|
|
117
118
|
var _d = react_1.default.useState(exports.initialWalletDataNoImport.isTokensLoading), isTokensLoading = _d[0], setIsTokensLoading = _d[1];
|
|
118
119
|
var _e = react_1.default.useState(exports.initialWalletDataNoImport.tokens), tokens = _e[0], setTokens = _e[1];
|
|
119
120
|
var _f = react_1.default.useState(exports.initialWalletDataNoImport.masterWallet), masterWallet = _f[0], setMasterWallet = _f[1];
|
|
120
|
-
var _g = react_1.default.useState(exports.initialWalletDataNoImport.
|
|
121
|
+
var _g = react_1.default.useState(exports.initialWalletDataNoImport.policyInfo), policyInfo = _g[0], setPolicyInfo = _g[1];
|
|
122
|
+
var _h = react_1.default.useState(exports.initialWalletDataNoImport.blockchainWallets), blockchainWallets = _h[0], setBlockchainWallets = _h[1];
|
|
121
123
|
var updateWalletDetail = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
122
124
|
var response, error_1;
|
|
123
125
|
return __generator(this, function (_a) {
|
|
@@ -137,6 +139,7 @@ function WalletDataProviderNoImport(_a) {
|
|
|
137
139
|
blockchainAddress: item.blockchain_address,
|
|
138
140
|
networkSlug: item.network_slug,
|
|
139
141
|
}); }));
|
|
142
|
+
setPolicyInfo(response === null || response === void 0 ? void 0 : response.policy_info);
|
|
140
143
|
setIsTokensLoading(false);
|
|
141
144
|
return [3 /*break*/, 3];
|
|
142
145
|
case 2:
|
|
@@ -162,6 +165,6 @@ function WalletDataProviderNoImport(_a) {
|
|
|
162
165
|
setTokens(undefined);
|
|
163
166
|
}
|
|
164
167
|
}, [isAuthenticated]);
|
|
165
|
-
return ((0, jsx_runtime_1.jsx)(exports.WalletDataNoImportContext.Provider, { value: __assign(__assign({}, exports.initialWalletDataNoImport), { isAuthenticated: isAuthenticated, isInitPasscode: isInitPasscode, tokens: tokens, isTokensLoading: isTokensLoading, masterWallet: masterWallet, blockchainWallets: blockchainWallets, updateWalletDetail: updateWalletDetail }), children: children }));
|
|
168
|
+
return ((0, jsx_runtime_1.jsx)(exports.WalletDataNoImportContext.Provider, { value: __assign(__assign({}, exports.initialWalletDataNoImport), { isAuthenticated: isAuthenticated, isInitPasscode: isInitPasscode, tokens: tokens, isTokensLoading: isTokensLoading, masterWallet: masterWallet, blockchainWallets: blockchainWallets, policyInfo: policyInfo, updateWalletDetail: updateWalletDetail }), children: children }));
|
|
166
169
|
}
|
|
167
170
|
exports.default = WalletDataProviderNoImport;
|
package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AuthenticationByPasscodeBody, AuthenticationByPasscodeResponse } from "./type";
|
|
2
|
-
export default function authenticationByPasscode(body: AuthenticationByPasscodeBody): Promise<AuthenticationByPasscodeResponse>;
|
|
2
|
+
export default function authenticationByPasscode(body: AuthenticationByPasscodeBody): Promise<AuthenticationByPasscodeResponse | null>;
|
package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.js
CHANGED
|
@@ -43,27 +43,17 @@ exports.default = authenticationByPasscode;
|
|
|
43
43
|
var userClientRequest_1 = __importDefault(require("../clients/userClientRequest"));
|
|
44
44
|
function authenticationByPasscode(body) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
-
var response
|
|
47
|
-
return __generator(this, function (
|
|
48
|
-
switch (
|
|
49
|
-
case 0:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
})];
|
|
46
|
+
var response;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, userClientRequest_1.default.post("/wallets/verify-passcode", body, {
|
|
50
|
+
headers: {
|
|
51
|
+
"c-payload-signature": "text",
|
|
52
|
+
},
|
|
53
|
+
})];
|
|
56
54
|
case 1:
|
|
57
|
-
response =
|
|
55
|
+
response = _a.sent();
|
|
58
56
|
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.data];
|
|
59
|
-
case 2:
|
|
60
|
-
_a = _b.sent();
|
|
61
|
-
return [2 /*return*/, {
|
|
62
|
-
success: false,
|
|
63
|
-
message: "Failed to authenticate by passcode",
|
|
64
|
-
timestamp: new Date().toISOString(),
|
|
65
|
-
}];
|
|
66
|
-
case 3: return [2 /*return*/];
|
|
67
57
|
}
|
|
68
58
|
});
|
|
69
59
|
});
|
package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/type.d.ts
CHANGED
|
@@ -2,7 +2,21 @@ export interface AuthenticationByPasscodeBody {
|
|
|
2
2
|
passcode: string;
|
|
3
3
|
}
|
|
4
4
|
export interface AuthenticationByPasscodeResponse {
|
|
5
|
+
statusCode: number;
|
|
5
6
|
success: boolean;
|
|
6
7
|
message: string;
|
|
8
|
+
data: PolicyInfoType;
|
|
7
9
|
timestamp: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PolicyInfoType {
|
|
13
|
+
nextPolicy: NextPolicy;
|
|
14
|
+
value: number;
|
|
15
|
+
failed_attempts: number;
|
|
16
|
+
lock_duration: number;
|
|
17
|
+
expired: number;
|
|
18
|
+
}
|
|
19
|
+
export interface NextPolicy {
|
|
20
|
+
failed_attempts: number;
|
|
21
|
+
lock_duration: number;
|
|
8
22
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FiatDepositData } from "../../../types/expose-type";
|
|
2
|
+
export interface GetDepositFiatInfoServicePayLoad {
|
|
3
|
+
amount: number;
|
|
4
|
+
to_address: string;
|
|
5
|
+
currency_slug: string;
|
|
6
|
+
network: string;
|
|
7
|
+
network_address: string;
|
|
8
|
+
await_completion: boolean;
|
|
9
|
+
orderInfo: string;
|
|
10
|
+
email: string;
|
|
11
|
+
}
|
|
12
|
+
declare const getDepositFiatInfoService: (payload: GetDepositFiatInfoServicePayLoad) => Promise<FiatDepositData>;
|
|
13
|
+
export default getDepositFiatInfoService;
|