tek-wallet 0.0.666 → 0.0.668

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.
@@ -158,20 +158,23 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
158
158
  var _a;
159
159
  (_a = props.onOpen) === null || _a === void 0 ? void 0 : _a.call(props);
160
160
  };
161
- var handleOtpChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
161
+ var handlePasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
162
162
  var isAuth, err_2;
163
163
  var _a, _b;
164
164
  return __generator(this, function (_c) {
165
165
  switch (_c.label) {
166
166
  case 0:
167
- _c.trys.push([0, 3, , 4]);
167
+ value = value === null || value === void 0 ? void 0 : value.slice(0, passcodeLength);
168
+ _c.label = 1;
169
+ case 1:
170
+ _c.trys.push([1, 4, , 5]);
168
171
  setOtp(value);
169
- if (!(value.length === passcodeLength)) return [3 /*break*/, 2];
172
+ if (!(value.length === passcodeLength)) return [3 /*break*/, 3];
170
173
  (_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.startLoading();
171
174
  return [4 /*yield*/, handleVerifyPasscode({
172
175
  passcode: value,
173
176
  })];
174
- case 1:
177
+ case 2:
175
178
  isAuth = _c.sent();
176
179
  if (isAuth) {
177
180
  handleClose();
@@ -182,13 +185,13 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
182
185
  setOtp("");
183
186
  }
184
187
  (_b = loadingRef.current) === null || _b === void 0 ? void 0 : _b.endLoading();
185
- _c.label = 2;
186
- case 2: return [3 /*break*/, 4];
187
- case 3:
188
+ _c.label = 3;
189
+ case 3: return [3 /*break*/, 5];
190
+ case 4:
188
191
  err_2 = _c.sent();
189
192
  console.error(err_2);
190
- return [3 /*break*/, 4];
191
- case 4: return [2 /*return*/];
193
+ return [3 /*break*/, 5];
194
+ case 5: return [2 /*return*/];
192
195
  }
193
196
  });
194
197
  }); };
@@ -198,14 +201,14 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
198
201
  width: "100%",
199
202
  maxWidth: "calc(100dvw - 2rem)",
200
203
  display: "flex",
201
- }, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "confirm-passcode-keyboard", keyboardType: xhub_keyboard_1.KeyboardType.Integer, value: otp, onChange: handleOtpChange, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
204
+ }, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "confirm-passcode-keyboard", value: otp, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
202
205
  backgroundColor: "transparent",
203
206
  width: "100%",
204
207
  }, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Enter Passcode", onClose: handleClose, sx: {
205
208
  backgroundColor: theme.palette.background.tertiary,
206
209
  }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "0.75rem", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
207
210
  width: "100%",
208
- }, useBrowserInput: false, htmlFor: "confirm-passcode-keyboard", children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }) }));
211
+ }, useBrowserInput: false, htmlFor: "confirm-passcode-keyboard", children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handlePasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }) }));
209
212
  });
210
213
  ConfirmByPasscode.displayName = "ConfirmByPasscode";
211
214
  exports.default = ConfirmByPasscode;
@@ -2,5 +2,5 @@ import { GeneralProps } from "../../../types/ui";
2
2
  export interface InitPasscodeProps extends GeneralProps {
3
3
  children: React.ReactNode;
4
4
  }
5
- export declare function InitPasscode({ children, ...rest }: InitPasscodeProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function InitPasscode({ children }: InitPasscodeProps): import("react/jsx-runtime").JSX.Element;
6
6
  export default InitPasscode;
@@ -1,16 +1,5 @@
1
1
  "use strict";
2
2
  "use client";
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
4
  if (k2 === undefined) k2 = k;
16
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -44,17 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
44
33
  return result;
45
34
  };
46
35
  })();
47
- var __rest = (this && this.__rest) || function (s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- };
58
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
59
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
60
38
  };
@@ -63,11 +41,10 @@ exports.InitPasscode = InitPasscode;
63
41
  var jsx_runtime_1 = require("react/jsx-runtime");
64
42
  var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
65
43
  var react_1 = require("react");
66
- var material_1 = require("@mui/material");
67
44
  var ChangePasscodeView_1 = __importDefault(require("../../views/ChangePasscodeView"));
68
45
  var xhub_keyboard_1 = require("xhub-keyboard");
69
46
  function InitPasscode(_a) {
70
- var children = _a.children, rest = __rest(_a, ["children"]);
47
+ var children = _a.children;
71
48
  var getSeedPhraseViewRef = (0, react_1.useRef)(null);
72
49
  var backAuthView = function () {
73
50
  var _a;
@@ -79,6 +56,6 @@ function InitPasscode(_a) {
79
56
  setResetTrigger(function (prev) { return prev + "1"; });
80
57
  }, 400);
81
58
  };
82
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { onClose: onClose, ref: getSeedPhraseViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "init-passcode-keyboard", children: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: { position: "relative" }, children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 } })] })) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { onBack: backAuthView, isInitPasscode: true }, resetTrigger) }));
59
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { onClose: onClose, ref: getSeedPhraseViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "init-passcode-keyboard", style: { width: "100%", height: "100%" }, children: children }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { onBack: backAuthView, isInitPasscode: true }, resetTrigger) }));
83
60
  }
84
61
  exports.default = InitPasscode;
@@ -33,7 +33,7 @@ var SvgPath_1 = require("../SvgPath");
33
33
  function ListItemCustom(_a) {
34
34
  var title = _a.title, description = _a.description, icon = _a.icon, rightIcon = _a.rightIcon, hideDefaultRightIcon = _a.hideDefaultRightIcon, sx = _a.sx, rest = __rest(_a, ["title", "description", "icon", "rightIcon", "hideDefaultRightIcon", "sx"]);
35
35
  var theme = (0, ThemeProvider_1.useTheme)();
36
- return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({}, rest, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, padding: theme.mixins.customPadding.p16, border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r12, backgroundColor: theme.palette.background.white }), sx), children: [icon, (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, alignItems: "start", flex: 1 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listTitle), children: title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listDescription), children: description })] }), rightIcon !== null && rightIcon !== void 0 ? rightIcon : (!hideDefaultRightIcon && (
36
+ return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({}, rest, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, padding: theme.mixins.customPadding.p16, border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, backgroundColor: theme.palette.background.white }), sx), children: [icon, (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, alignItems: "start", flex: 1 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listTitle), children: title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.listDescription), children: description })] }), rightIcon !== null && rightIcon !== void 0 ? rightIcon : (!hideDefaultRightIcon && (
37
37
  // <Icon width={10} src={getIcon("right_arrow")} sx={{ ml: "auto" }} />
38
38
  (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "12px", height: "12px" }, children: SvgPath_1.IC_CHEVRON_RIGHT })))] })));
39
39
  }
@@ -32,11 +32,11 @@ var Text_1 = __importDefault(require("../Text"));
32
32
  var parsePropsData_1 = __importDefault(require("../../../utils/parsePropsData"));
33
33
  var material_1 = require("@mui/material");
34
34
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
35
- var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
35
+ var SvgPath_1 = require("../SvgPath");
36
36
  var NetworkSelection = function (props) {
37
37
  var networkDataString = props.networkData, onClick = props.onClick, active = props.active, rest = __rest(props, ["networkData", "onClick", "active"]);
38
38
  var theme = (0, ThemeProvider_1.useTheme)();
39
39
  var networkData = (0, react_1.useMemo)(function () { return (0, parsePropsData_1.default)(networkDataString); }, [networkDataString]);
40
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), padding: theme.mixins.customPadding.p16, borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), gap: theme.mixins.gaps.g8, justifyContent: "space-between" }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.link, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "text.white", whiteSpace: "nowrap", textTransform: "capitalize" }), children: networkData === null || networkData === void 0 ? void 0 : networkData.name }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13, fontWeight: theme.typography.fontWeight400 }), children: ["Minimum Deposit: 0.0003 ", networkData === null || networkData === void 0 ? void 0 : networkData.name] })] })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, height: 20, src: (0, getIcon_1.default)(active ? "circle_checked" : "circle_unchecked") }) })] })));
40
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), padding: theme.mixins.customPadding.p16, borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), gap: theme.mixins.gaps.g8, justifyContent: "space-between" }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.link, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "text.white", whiteSpace: "nowrap", textTransform: "capitalize" }), children: networkData === null || networkData === void 0 ? void 0 : networkData.name }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13, fontWeight: theme.typography.fontWeight400 }), children: ["Minimum Deposit: 0.0003 ", networkData === null || networkData === void 0 ? void 0 : networkData.name] })] })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: active ? SvgPath_1.IC_CHECK : SvgPath_1.IC_UNCHECK })] })));
41
41
  };
42
42
  exports.default = NetworkSelection;
@@ -318,15 +318,11 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
318
318
  }, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); } }), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); } })] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
319
319
  position: "relative",
320
320
  sx: "100dvh",
321
- }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, rightAdornment: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, marginLeft: "auto" }), children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 18, height: 18 }, children: SvgPath_1.IC_HELP }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", sx: {
321
+ }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, rightAdornment: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, marginLeft: "auto" }), children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_HELP }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", sx: {
322
322
  height: "1rem",
323
323
  width: "1px",
324
324
  backgroundColor: theme.palette.border.accent3,
325
- marginLeft: theme.mixins.customMargin.m4,
326
- marginRight: theme.mixins.customMargin.m4,
327
- } }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: historyRef, trigger: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
328
- marginBottom: theme.mixins.customMargin.m4,
329
- }, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 18, height: 18 }, children: SvgPath_1.IC_HISTORY }) }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: closeHistory }) })] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
325
+ } }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: historyRef, trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, children: SvgPath_1.IC_HISTORY }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: closeHistory }) })] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
330
326
  maxHeight: currentStep === ReceiveStep.SHOW_QR_CODE ? "120px" : 0,
331
327
  overflow: "hidden",
332
328
  transition: currentStep === ReceiveStep.SHOW_QR_CODE ? "max-height 0.3s linear 0.3s" : "max-height 0s linear",
@@ -361,7 +357,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
361
357
  if (!item)
362
358
  return null;
363
359
  return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) === item.id }, "token_".concat(item.id, "_").concat(index)));
364
- })] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [networks && networks.length > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { borderRadius: theme.mixins.customRadius.r16, background: theme.palette.background.accent3, gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.fieldTitle), { fontWeight: theme.typography.fontWeight700, color: theme.palette.text.darkContrast }), children: "Choosing a network? Let us help!" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight500 }), children: "Select the network used by your sending platform." }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: 0.5, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
360
+ })] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, display: selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL ? "flex" : "none" }), children: [networks && networks.length > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { borderRadius: theme.mixins.customRadius.r16, background: theme.palette.background.accent3, gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.fieldTitle), { fontWeight: theme.typography.fontWeight700, color: theme.palette.text.darkContrast }), children: "Choosing a network? Let us help!" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight500 }), children: "Select the network used by your sending platform." }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: 0.5, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
365
361
  color: theme.palette.primary.main,
366
362
  fontWeight: theme.typography.fontWeight600,
367
363
  fontSize: theme.typography.fontSize10,
@@ -56,11 +56,12 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
56
56
  var react_1 = require("react");
57
57
  var material_1 = require("@mui/material");
58
58
  var AuthViewSignIn_1 = __importDefault(require("../../views/AuthViewSignIn"));
59
- // import ChangePasscodeView from "../../views/ChangePasscodeView";
60
- var InitPasscode_1 = __importDefault(require("../InitPasscode"));
59
+ var ChangePasscodeView_1 = __importDefault(require("../../views/ChangePasscodeView"));
60
+ var xhub_keyboard_1 = require("xhub-keyboard");
61
61
  function RequireConnect(_a) {
62
62
  var children = _a.children, signIn = _a.signIn, component = _a.component, sx = _a.sx;
63
63
  var authViewRef = (0, react_1.useRef)(null);
64
+ var initPasscodeRef = (0, react_1.useRef)(null);
64
65
  var _b = (0, useWalletData_1.default)(), isInitPasscode = _b.isInitPasscode, isSSO = _b.isSSO, isAuthenticated = _b.isAuthenticated;
65
66
  var backAuthView = function () {
66
67
  var _a;
@@ -74,11 +75,15 @@ function RequireConnect(_a) {
74
75
  e.stopPropagation();
75
76
  (_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.open();
76
77
  };
78
+ var handleBackInitPasscodeView = function () {
79
+ var _a;
80
+ (_a = initPasscodeRef.current) === null || _a === void 0 ? void 0 : _a.close();
81
+ };
77
82
  if (!isAuthenticated) {
78
83
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView, children: (0, jsx_runtime_1.jsxs)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClick: stopPropagation, children: [isSSO && (0, jsx_runtime_1.jsx)(AuthViewSignIn_1.default, { onBack: backAuthView, onSignIn: signIn }), !isSSO && (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView })] }) })] }) }));
79
84
  }
80
85
  if (!isInitPasscode) {
81
- return (0, jsx_runtime_1.jsx)(InitPasscode_1.default, { children: children });
86
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: initPasscodeRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "init-passcode-keyboard", style: { width: "100%", height: "100%", position: "absolute", inset: 0 }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", height: "100%", position: "absolute", inset: 0 }, children: children }) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { isInitPasscode: true, onBack: handleBackInitPasscodeView }) }) }));
82
87
  }
83
88
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
84
89
  }
@@ -22,3 +22,5 @@ export declare const IC_RECEIVE_INTERNAL: import("react/jsx-runtime").JSX.Elemen
22
22
  export declare const IC_RECEIVE_EXTERNAL: import("react/jsx-runtime").JSX.Element;
23
23
  export declare const IC_ARROW_DROP_UP: import("react/jsx-runtime").JSX.Element;
24
24
  export declare const IC_ARROW_DROP_DOWN: import("react/jsx-runtime").JSX.Element;
25
+ export declare const IC_CHECK: import("react/jsx-runtime").JSX.Element;
26
+ export declare const IC_UNCHECK: import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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_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" }) }));
@@ -26,3 +26,5 @@ exports.IC_RECEIVE_INTERNAL = ((0, jsx_runtime_1.jsx)("svg", { width: "20", heig
26
26
  exports.IC_RECEIVE_EXTERNAL = ((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 5V15M7.5 12.6517L8.2325 13.2008C9.20833 13.9333 10.7908 13.9333 11.7675 13.2008C12.7442 12.4683 12.7442 11.2817 11.7675 10.5492C11.28 10.1825 10.64 10 10 10C9.39583 10 8.79167 9.81667 8.33083 9.45083C7.40917 8.71833 7.40917 7.53167 8.33083 6.79917C9.2525 6.06667 10.7475 6.06667 11.6692 6.79917L12.015 7.07417M17.5 10C17.5 10.9849 17.306 11.9602 16.9291 12.8701C16.5522 13.7801 15.9997 14.6069 15.3033 15.3033C14.6069 15.9997 13.7801 16.5522 12.8701 16.9291C11.9602 17.306 10.9849 17.5 10 17.5C9.01509 17.5 8.03982 17.306 7.12987 16.9291C6.21993 16.5522 5.39314 15.9997 4.6967 15.3033C4.00026 14.6069 3.44781 13.7801 3.0709 12.8701C2.69399 11.9602 2.5 10.9849 2.5 10C2.5 8.01088 3.29018 6.10322 4.6967 4.6967C6.10322 3.29018 8.01088 2.5 10 2.5C11.9891 2.5 13.8968 3.29018 15.3033 4.6967C16.7098 6.10322 17.5 8.01088 17.5 10Z", stroke: "#1E4841", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
27
27
  exports.IC_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: "#121212" }) }));
28
28
  exports.IC_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: "#A3A3A3" }) }));
29
+ exports.IC_CHECK = ((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", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0.5 10C0.5 4.615 4.865 0.25 10.25 0.25C15.635 0.25 20 4.615 20 10C20 15.385 15.635 19.75 10.25 19.75C4.865 19.75 0.5 15.385 0.5 10ZM13.86 8.186C13.92 8.10605 13.9634 8.01492 13.9877 7.91795C14.012 7.82098 14.0166 7.72014 14.0014 7.62135C13.9861 7.52257 13.9512 7.42782 13.8989 7.3427C13.8465 7.25757 13.7776 7.18378 13.6963 7.12565C13.6149 7.06753 13.5228 7.02624 13.4253 7.00423C13.3278 6.98221 13.2269 6.97991 13.1285 6.99746C13.0301 7.01501 12.9362 7.05205 12.8523 7.10641C12.7684 7.16077 12.6962 7.23135 12.64 7.314L9.404 11.844L7.78 10.22C7.63783 10.0875 7.44978 10.0154 7.25548 10.0188C7.06118 10.0223 6.87579 10.101 6.73838 10.2384C6.60097 10.3758 6.52225 10.5612 6.51882 10.7555C6.5154 10.9498 6.58752 11.1378 6.72 11.28L8.97 13.53C9.04699 13.6069 9.1398 13.6662 9.24199 13.7036C9.34418 13.7411 9.45329 13.7559 9.56176 13.7469C9.67023 13.738 9.77546 13.7055 9.87013 13.6519C9.9648 13.5982 10.0467 13.5245 10.11 13.436L13.86 8.186Z", fill: "#1E4841" }) }));
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", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
@@ -166,6 +166,7 @@ var ChangePasscodeView = function (props) {
166
166
  return __generator(this, function (_c) {
167
167
  switch (_c.label) {
168
168
  case 0:
169
+ value = value === null || value === void 0 ? void 0 : value.slice(0, passcodeLength);
169
170
  setOldPasscode(value);
170
171
  setError(null);
171
172
  if (!(value.length === passcodeLength)) return [3 /*break*/, 2];
@@ -189,6 +190,7 @@ var ChangePasscodeView = function (props) {
189
190
  }); };
190
191
  var handleNewPasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
191
192
  return __generator(this, function (_a) {
193
+ value = value === null || value === void 0 ? void 0 : value.slice(0, passcodeLength);
192
194
  setNewPasscode(value);
193
195
  setError(null);
194
196
  /**
@@ -269,6 +271,7 @@ var ChangePasscodeView = function (props) {
269
271
  var updatePasscode = isInitPasscode ? handleInitPasscode : handleChangePasscode;
270
272
  var handleConfirmPasscodeChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
271
273
  return __generator(this, function (_a) {
274
+ value = value === null || value === void 0 ? void 0 : value.slice(0, passcodeLength);
272
275
  setConfirmPasscode(value);
273
276
  setError(null);
274
277
  /**
@@ -315,7 +318,7 @@ var ChangePasscodeView = function (props) {
315
318
  alignItems: "center",
316
319
  height: "100%",
317
320
  gap: "1rem",
318
- }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_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: newPasscode, onChange: handleNewPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
321
+ }, children: [oldPasscode, (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_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: newPasscode, onChange: handleNewPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
319
322
  display: "flex",
320
323
  flexDirection: "column",
321
324
  alignItems: "center",
@@ -30,6 +30,6 @@ function EventHandlerProvider(props) {
30
30
  pushNotification(theMessage);
31
31
  }
32
32
  }, [transaction]);
33
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.children, !hideDefaultActivities && (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }));
33
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.children, !hideDefaultActivities && false && (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }));
34
34
  }
35
35
  exports.default = EventHandlerProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.666",
3
+ "version": "0.0.668",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",