tek-wallet 0.0.689 → 0.0.690

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.
@@ -15,6 +15,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
15
15
  var material_1 = require("@mui/material");
16
16
  var SvgPath_1 = require("../SvgPath");
17
17
  var BackArrow = function (props) {
18
- return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: __assign({}, props.sx), children: SvgPath_1.IC_BACK }));
18
+ return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: __assign(__assign({}, props.sx), { width: "0.75rem", height: "0.75rem" }), children: SvgPath_1.IC_BACK }));
19
19
  };
20
20
  exports.default = BackArrow;
@@ -56,7 +56,7 @@ Button.Primary = function (props) {
56
56
  // color: theme.palette.text.white24,
57
57
  // },
58
58
  // };
59
- return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p10, fontWeight: 600 }, sx), children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
59
+ return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p10, fontWeight: 600 }, sx), disabled: status !== BUTTON_STATUS.ENABLED, children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
60
60
  position: "absolute",
61
61
  inset: 0,
62
62
  display: "flex",
@@ -68,15 +68,15 @@ Button.Primary = function (props) {
68
68
  };
69
69
  Button.Primary.displayName = "Button.Primary";
70
70
  Button.Secondary = function (props) {
71
- var sx = props.sx, rest = __rest(props, ["sx"]);
71
+ var sx = props.sx, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, rest = __rest(props, ["sx", "status"]);
72
72
  var theme = (0, ThemeProvider_1.useTheme)();
73
- return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", sx: __assign({ color: theme.palette.text.primary, borderRadius: theme.mixins.customRadius.r12, borderColor: "currentcolor", textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p10 }, sx) })));
73
+ return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", sx: __assign({ color: theme.palette.text.primary, borderRadius: theme.mixins.customRadius.r12, borderColor: "currentcolor", textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p10 }, sx), disabled: status !== BUTTON_STATUS.ENABLED })));
74
74
  };
75
75
  Button.Secondary.displayName = "Button.Secondary";
76
76
  Button.Text = function (props) {
77
- var sx = props.sx, rest = __rest(props, ["sx"]);
77
+ var sx = props.sx, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, rest = __rest(props, ["sx", "status"]);
78
78
  var theme = (0, ThemeProvider_1.useTheme)();
79
- return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "text", color: "secondary", sx: __assign({ width: "fit-content", height: "fit-content", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p8, textTransform: "capitalize", color: theme.palette.text.primary }, sx) })));
79
+ return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "text", color: "secondary", sx: __assign({ width: "fit-content", height: "fit-content", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p8, textTransform: "capitalize", color: theme.palette.text.primary }, sx), disabled: status !== BUTTON_STATUS.ENABLED })));
80
80
  };
81
81
  Button.Text.displayName = "Button.Text";
82
82
  exports.default = Button;
@@ -53,13 +53,16 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
53
53
  if (video) {
54
54
  var stream = video.srcObject;
55
55
  var track = stream === null || stream === void 0 ? void 0 : stream.getTracks()[0];
56
+ console.warn("🚀 ~ toggleFlash ~ track:", track.getCapabilities());
56
57
  var torch = track.getCapabilities().torch;
58
+ console.warn("🚀 ~ toggleFlash ~ torch:", torch);
57
59
  if (torch) {
58
60
  track
59
61
  .applyConstraints({
60
62
  advanced: [{ torch: !flashEnabled }],
61
63
  })
62
64
  .then(function () {
65
+ console.warn("🚀 ~ toggleFlash ~ flashEnabled:", flashEnabled);
63
66
  setFlashEnabled(!flashEnabled);
64
67
  })
65
68
  .catch(function (err) { return console.error("Error toggling flash:", err); });
@@ -78,15 +81,9 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
78
81
  }, [isOpen]);
79
82
  // Thêm CSS animation vào document khi component được mount
80
83
  (0, react_1.useEffect)(function () {
81
- // Tạo thẻ style
82
- var styleTag = document.createElement("style");
83
- styleTag.innerHTML = "\n @keyframes move-up-down {\n 0% {\n top: 0%;\n } \n 50% {\n top: 100%;\n }\n 100% {\n top: 0%;\n }\n }\n ";
84
- // Thêm thẻ style vào head của tài liệu
85
- document.head.appendChild(styleTag);
86
- // Cleanup khi component unmount
87
- return function () {
88
- document.head.removeChild(styleTag);
89
- };
84
+ var animationStyle = "\n @keyframes move-up-down {\n 0% {\n top: 0%;\n } \n 50% {\n top: 100%;\n }\n 100% {\n top: 0%;\n }\n }\n ";
85
+ // Thêm animation vào stylesheet đầu tiên của trang
86
+ document.styleSheets[0].insertRule(animationStyle, 0);
90
87
  }, []); // Chỉ chạy một lần khi component mount
91
88
  return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: props.children, ref: drawerRef, onClose: onClose, onOpen: onOpen, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
92
89
  position: "absolute",
@@ -131,7 +128,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
131
128
  width: "100%",
132
129
  height: "2px",
133
130
  backgroundImage: "linear-gradient(to right, transparent, currentColor, transparent)",
134
- animation: "move-up-down 4s infinite linear",
131
+ // animation: "move-up-down 4s infinite linear",
135
132
  } }), (0, jsx_runtime_1.jsx)("div", { style: {
136
133
  position: "absolute",
137
134
  borderTopLeftRadius: STYLES.borderRadius,
@@ -13,7 +13,7 @@ exports.IC_CLOSE = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", v
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
14
  exports.IC_COPY = ((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)("mask", { id: "mask0_860_5627", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "20", height: "20", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_860_5627)", children: (0, jsx_runtime_1.jsx)("path", { d: "M7.54804 14.5826C7.17293 14.5826 6.85587 14.4531 6.59685 14.1941C6.33783 13.9351 6.20831 13.618 6.20831 13.2429V3.75577C6.20831 3.38066 6.33783 3.06359 6.59685 2.80456C6.85587 2.54553 7.17293 2.41602 7.54804 2.41602H15.0352C15.4103 2.41602 15.7273 2.54553 15.9864 2.80456C16.2454 3.06359 16.3749 3.38066 16.3749 3.75577V13.2429C16.3749 13.618 16.2454 13.9351 15.9864 14.1941C15.7273 14.4531 15.4103 14.5826 15.0352 14.5826H7.54804ZM7.54804 13.4993H15.0352C15.0993 13.4993 15.158 13.4726 15.2115 13.4192C15.2649 13.3658 15.2916 13.307 15.2916 13.2429V3.75577C15.2916 3.69166 15.2649 3.63288 15.2115 3.57945C15.158 3.52604 15.0993 3.49933 15.0352 3.49933H7.54804C7.48393 3.49933 7.42517 3.52604 7.37175 3.57945C7.31832 3.63288 7.2916 3.69166 7.2916 3.75577V13.2429C7.2916 13.307 7.31832 13.3658 7.37175 13.4192C7.42517 13.4726 7.48393 13.4993 7.54804 13.4993ZM4.96473 17.1659C4.58963 17.1659 4.27257 17.0364 4.01354 16.7774C3.75451 16.5184 3.625 16.2013 3.625 15.8262V5.25577H4.70831V15.8262C4.70831 15.8903 4.73502 15.9491 4.78844 16.0025C4.84187 16.0559 4.90063 16.0826 4.96473 16.0826H13.5352V17.1659H4.96473Z", fill: "#1E4841" }) })] }));
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
- exports.IC_PASSCODE = ((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.jsxs)("g", { opacity: "0.16", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_899_12669", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "20", height: "20", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_899_12669)", children: (0, jsx_runtime_1.jsx)("path", { d: "M1.87497 15.6252V14.3752H18.125V15.6252H1.87497ZM2.57684 10.6156L1.71788 10.1187L2.47434 8.78872H0.961426V7.79497H2.47434L1.71788 6.50664L2.57684 6.00977L3.3333 7.29831L4.08976 6.00977L4.94872 6.50664L4.19226 7.79497H5.70518V8.78872H4.19226L4.94872 10.1187L4.08976 10.6156L3.3333 9.28539L2.57684 10.6156ZM9.24351 10.6156L8.38455 10.1187L9.14101 8.78872H7.62809V7.79497H9.14101L8.38455 6.50664L9.24351 6.00977L9.99997 7.29831L10.7564 6.00977L11.6154 6.50664L10.8589 7.79497H12.3718V8.78872H10.8589L11.6154 10.1187L10.7564 10.6156L9.99997 9.28539L9.24351 10.6156ZM15.9102 10.6156L15.0512 10.1187L15.8077 8.78872H14.2948V7.79497H15.8077L15.0512 6.50664L15.9102 6.00977L16.6666 7.29831L17.4231 6.00977L18.2821 6.50664L17.5256 7.79497H19.0385V8.78872H17.5256L18.2821 10.1187L17.4231 10.6156L16.6666 9.28539L15.9102 10.6156Z", fill: "#121212" }) })] }) }));
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" }) }));
18
18
  exports.IC_SWAP = ((0, jsx_runtime_1.jsx)("svg", { width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 4.75L4.75 1M4.75 1L8.5 4.75M4.75 1V12.25M16 12.25L12.25 16M12.25 16L8.5 12.25M12.25 16V4.75", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
19
19
  exports.IC_ARROW_BLACK_DROP = ((0, jsx_runtime_1.jsx)("svg", { width: "9", height: "6", viewBox: "0 0 9 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M4.40375 5.2016L0 0.797852H8.8075L4.40375 5.2016Z", fill: "#121212" }) }));
@@ -28,5 +28,5 @@ exports.IC_ARROW_DROP_UP = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height:
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
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", { fillRule: "evenodd", clipRule: "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
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
- exports.IC_BACK = ((0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_452_16413", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_452_16413)", children: (0, jsx_runtime_1.jsx)("path", { d: "M14 17.6534L8.34619 11.9995L14 6.3457L15.0538 7.39953L10.4538 11.9995L15.0538 16.5995L14 17.6534Z", fill: "#121212" }) })] }));
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", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
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
+ 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" }) }));
@@ -1,22 +1,27 @@
1
1
  import { ConfirmLayoutProps } from "../ConfirmLayout";
2
2
  import { SendInternalResponse } from "../../../services/axios/send-internal-service/type";
3
3
  import { InstructionBody } from "../../../services/axios/instructions-service/type";
4
+ export type TransferConfirmationData = InstructionBody & {
5
+ amount: number;
6
+ currency_slug: string;
7
+ to_address: string;
8
+ };
4
9
  interface TransferConfirmationProps extends Omit<ConfirmLayoutProps, "action"> {
5
- transferData: InstructionBody;
10
+ transferData: TransferConfirmationData;
6
11
  transferContent: React.ReactNode;
7
12
  titleHeader: string;
8
13
  onTransferSuccess?: (data: SendInternalResponse) => any;
9
14
  }
10
- export interface TransferTokenRef {
15
+ export interface TransferConfirmationTokenRef {
11
16
  open: () => void;
12
17
  close: () => void;
13
18
  }
14
- export declare enum TransferError {
19
+ export declare enum TransferConfirmationError {
15
20
  TOKEN_NOT_FOUND = "Token not found",
16
21
  NOT_ENOUGH_BALANCE = "Not enough balance",
17
22
  MAX_AMOUNT = "Max amount",
18
23
  MIN_AMOUNT = "Min amount",
19
24
  FAILED = "Failed"
20
25
  }
21
- export declare const TransferConfirmation: import("react").ForwardRefExoticComponent<Omit<TransferConfirmationProps, "ref"> & import("react").RefAttributes<TransferTokenRef>>;
26
+ export declare const TransferConfirmation: import("react").ForwardRefExoticComponent<Omit<TransferConfirmationProps, "ref"> & import("react").RefAttributes<TransferConfirmationTokenRef>>;
22
27
  export default TransferConfirmation;
@@ -85,7 +85,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
85
85
  return (mod && mod.__esModule) ? mod : { "default": mod };
86
86
  };
87
87
  Object.defineProperty(exports, "__esModule", { value: true });
88
- exports.TransferConfirmation = exports.TransferError = void 0;
88
+ exports.TransferConfirmation = exports.TransferConfirmationError = void 0;
89
89
  var jsx_runtime_1 = require("react/jsx-runtime");
90
90
  var Button_1 = __importStar(require("../Button"));
91
91
  var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
@@ -101,14 +101,14 @@ var validate_wallet_address_service_1 = __importDefault(require("../../../servic
101
101
  var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
102
102
  var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
103
103
  var instructions_service_1 = __importDefault(require("../../../services/axios/instructions-service"));
104
- var TransferError;
105
- (function (TransferError) {
106
- TransferError["TOKEN_NOT_FOUND"] = "Token not found";
107
- TransferError["NOT_ENOUGH_BALANCE"] = "Not enough balance";
108
- TransferError["MAX_AMOUNT"] = "Max amount";
109
- TransferError["MIN_AMOUNT"] = "Min amount";
110
- TransferError["FAILED"] = "Failed";
111
- })(TransferError || (exports.TransferError = TransferError = {}));
104
+ var TransferConfirmationError;
105
+ (function (TransferConfirmationError) {
106
+ TransferConfirmationError["TOKEN_NOT_FOUND"] = "Token not found";
107
+ TransferConfirmationError["NOT_ENOUGH_BALANCE"] = "Not enough balance";
108
+ TransferConfirmationError["MAX_AMOUNT"] = "Max amount";
109
+ TransferConfirmationError["MIN_AMOUNT"] = "Min amount";
110
+ TransferConfirmationError["FAILED"] = "Failed";
111
+ })(TransferConfirmationError || (exports.TransferConfirmationError = TransferConfirmationError = {}));
112
112
  exports.TransferConfirmation = (0, react_1.forwardRef)(function (props, ref) {
113
113
  var _a;
114
114
  var theme = (0, material_1.useTheme)();
@@ -121,34 +121,29 @@ exports.TransferConfirmation = (0, react_1.forwardRef)(function (props, ref) {
121
121
  var _e = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _e[0], setButtonStatus = _e[1];
122
122
  var _f = (0, react_1.useState)(false), isValidatingAddress = _f[0], setIsValidatingAddress = _f[1];
123
123
  var _g = (0, react_1.useState)(undefined), errorAddress = _g[0], setErrorAddress = _g[1];
124
- var _h = (0, react_1.useMemo)(function () {
125
- return {
126
- transferDetails: transferData.instructions[0],
127
- amount: transferData.instructions[0].currency_update_info[0].amount,
128
- currencySlug: transferData.instructions[0].currency_update_info[0].currency_slug,
129
- };
130
- }, [transferData]), transferDetails = _h.transferDetails, amount = _h.amount, currencySlug = _h.currencySlug;
131
- var toAddress = transferDetails.master_wallet_address;
124
+ var toAddress = transferData.to_address;
125
+ var amount = transferData.amount;
126
+ var currencySlug = transferData.currency_slug;
132
127
  var token = (0, react_1.useMemo)(function () {
133
128
  return sendInternalTokens === null || sendInternalTokens === void 0 ? void 0 : sendInternalTokens.find(function (token) { return token.slug === currencySlug; });
134
129
  }, [currencySlug, sendInternalTokens]);
135
130
  var validateAmount = (0, react_1.useCallback)(function () {
136
131
  if (!token) {
137
- setError(TransferError.TOKEN_NOT_FOUND);
132
+ setError(TransferConfirmationError.TOKEN_NOT_FOUND);
138
133
  return false;
139
134
  }
140
135
  if (amount > token.max_value) {
141
- setError(TransferError.MAX_AMOUNT);
136
+ setError(TransferConfirmationError.MAX_AMOUNT);
142
137
  setErrorAmount(token.max_value);
143
138
  return false;
144
139
  }
145
140
  if (amount < token.min_value) {
146
- setError(TransferError.MIN_AMOUNT);
141
+ setError(TransferConfirmationError.MIN_AMOUNT);
147
142
  setErrorAmount(token.min_value);
148
143
  return false;
149
144
  }
150
145
  if (amount > +token.balance) {
151
- setError(TransferError.NOT_ENOUGH_BALANCE);
146
+ setError(TransferConfirmationError.NOT_ENOUGH_BALANCE);
152
147
  setErrorAmount(token.balance);
153
148
  return false;
154
149
  }
@@ -20,3 +20,4 @@ export * from "./components/index";
20
20
  export * from "./providers/TekWalletProvider";
21
21
  export * from "./components/ui/UpdateLockToken";
22
22
  export * from "./components/ui/SendExternalTokenWithdrawn";
23
+ export * from "./components/ui/TransferConfirmation";
@@ -35,3 +35,4 @@ __exportStar(require("./components/index"), exports);
35
35
  __exportStar(require("./providers/TekWalletProvider"), exports);
36
36
  __exportStar(require("./components/ui/UpdateLockToken"), exports);
37
37
  __exportStar(require("./components/ui/SendExternalTokenWithdrawn"), exports);
38
+ __exportStar(require("./components/ui/TransferConfirmation"), exports);
@@ -1,3 +1,4 @@
1
- import { InstructionBody, InstructionResponse } from "./type";
1
+ import { InstructionResponse } from "./response.type";
2
+ import { InstructionBody } from "./type";
2
3
  declare const instructionsService: (body: InstructionBody) => Promise<InstructionResponse>;
3
4
  export default instructionsService;
@@ -0,0 +1,59 @@
1
+ export type SendInternalMetadata = string;
2
+ export interface InstructionResponse {
3
+ success: boolean;
4
+ message: string;
5
+ timestamp: string;
6
+ data?: DataSendInternal;
7
+ }
8
+ interface DataSendInternal {
9
+ id?: number;
10
+ transaction_type?: string;
11
+ from_address?: string;
12
+ to_address?: string;
13
+ network?: string;
14
+ currency_slug?: string;
15
+ fee?: string;
16
+ amount?: string;
17
+ transaction_status?: string;
18
+ user_created?: string;
19
+ user_updated?: string;
20
+ date_created?: string;
21
+ date_updated?: null;
22
+ description?: null;
23
+ currency_usd_rate?: null;
24
+ from_app_slug?: string;
25
+ fee_info?: FeeInfo;
26
+ order_id?: null;
27
+ currency_data?: Currency;
28
+ metadata?: SendInternalMetadata;
29
+ }
30
+ interface FeeInfo {
31
+ fee_detail?: FeeDetail[];
32
+ fee_in_currency?: number;
33
+ fee_in_usd?: number;
34
+ original_amount_in_currency?: number;
35
+ original_amount_in_usd?: number;
36
+ original_currency?: string;
37
+ }
38
+ interface FeeDetail {
39
+ currency?: Currency;
40
+ fee_fixed?: number;
41
+ fee_in_currency?: number;
42
+ fee_in_usd?: number;
43
+ fee_percent?: number;
44
+ fee_type?: FeeType;
45
+ }
46
+ interface FeeType {
47
+ name?: string;
48
+ slug?: string;
49
+ }
50
+ interface Currency {
51
+ full_name?: string;
52
+ icon?: string;
53
+ id?: number;
54
+ link?: string;
55
+ name?: string;
56
+ slug?: string;
57
+ usd_rate?: number;
58
+ }
59
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,8 +13,3 @@ export interface CurrencyUpdateInfo {
13
13
  amount: number;
14
14
  currency_slug: string;
15
15
  }
16
- export interface InstructionResponse {
17
- success: boolean;
18
- message: string;
19
- timestamp: string;
20
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.689",
3
+ "version": "0.0.690",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",