tek-wallet 0.0.456 → 0.0.458

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.
Files changed (33) hide show
  1. package/dist/components/SafeSvgRenderer.js +1 -1
  2. package/dist/components/ui/ActivitiesTypeSlice/index.js +1 -4
  3. package/dist/components/ui/ActivityItem/index.js +1 -1
  4. package/dist/components/ui/AmountGroupAndChart/index.js +7 -12
  5. package/dist/components/ui/CloseModal/index.js +1 -1
  6. package/dist/components/ui/ConfirmByPasscode/index.js +1 -1
  7. package/dist/components/ui/CopyTextComponent/index.d.ts +1 -1
  8. package/dist/components/ui/EmptyData/index.js +1 -1
  9. package/dist/components/ui/Fees/index.js +4 -9
  10. package/dist/components/ui/Formatter/index.js +1 -6
  11. package/dist/components/ui/Icon/index.js +1 -5
  12. package/dist/components/ui/ListItemCustom/index.js +1 -1
  13. package/dist/components/ui/LockToken/index.js +1 -1
  14. package/dist/components/ui/NeonLineChart/index.d.ts +1 -1
  15. package/dist/components/ui/NetworkSelection/index.js +1 -3
  16. package/dist/components/ui/OTP/index.js +1 -1
  17. package/dist/components/ui/ReceiveFunction/index.js +10 -29
  18. package/dist/components/ui/TimeFilter/index.d.ts +1 -1
  19. package/dist/components/ui/TokenSelection/index.js +1 -3
  20. package/dist/components/ui/WaitingData/index.js +1 -1
  21. package/dist/components/ui/WithdrawFunction/index.js +13 -25
  22. package/dist/handlers/auth/login/index.js +1 -2
  23. package/dist/hooks/useFormatter.js +2 -5
  24. package/dist/providers/ActivitiesProvider/index.js +1 -3
  25. package/dist/providers/RealtimeProvider/index.js +38 -9
  26. package/dist/providers/RealtimeProvider/type.d.ts +2 -1
  27. package/dist/providers/ReceiveProvider/index.js +4 -4
  28. package/dist/providers/WithdrawProvider/index.js +4 -4
  29. package/dist/utils/compactWalletAddress.js +1 -3
  30. package/dist/utils/formatter.js +1 -5
  31. package/dist/utils/getStandardNumber.js +1 -3
  32. package/dist/utils/lengthFromDotToFirstNonZero.js +1 -2
  33. package/package.json +2 -2
@@ -13,6 +13,6 @@ var SafeSvgRenderer = function (_a) {
13
13
  ADD_TAGS: ["use"],
14
14
  ADD_ATTR: ["xlink:href"],
15
15
  });
16
- return ((0, jsx_runtime_1.jsx)("div", { className: className, style: { width: width, height: height }, dangerouslySetInnerHTML: { __html: sanitizedSvg } }));
16
+ return (0, jsx_runtime_1.jsx)("div", { className: className, style: { width: width, height: height }, dangerouslySetInnerHTML: { __html: sanitizedSvg } });
17
17
  };
18
18
  exports.default = SafeSvgRenderer;
@@ -48,10 +48,7 @@ function ActivitiesTypeSlice(props) {
48
48
  return Status.Empty;
49
49
  }, [type, activitiesByType]);
50
50
  (0, react_1.useEffect)(function () {
51
- if (!isActive ||
52
- !(type === null || type === void 0 ? void 0 : type.slug) ||
53
- !!activitiesByType ||
54
- isLoadingActivities[type.slug])
51
+ if (!isActive || !(type === null || type === void 0 ? void 0 : type.slug) || !!activitiesByType || isLoadingActivities[type.slug])
55
52
  return;
56
53
  updateActivities({
57
54
  transaction_types: type.slug,
@@ -81,7 +81,7 @@ function ActivityItem(props) {
81
81
  return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
82
82
  width: "fit-content",
83
83
  height: "fit-content",
84
- }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: activityData.icon, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: activityData.transaction_type }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
84
+ }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: activityData.icon, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: activityData.transaction_type }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
85
85
  fontSize: theme.typography.fontSize12,
86
86
  textTransform: "capitalize",
87
87
  color: getStatusColor(),
@@ -29,15 +29,12 @@ var fakeSeries = [
29
29
  {
30
30
  name: "All",
31
31
  data: [
32
- 1003785.6864951615, 1003795.988344575, 1003827.99766239,
33
- 1003899.7426850981, 1003891.7710159089, 1003810.6439517767,
34
- 1003780.7195320514, 1003797.9506016063, 1003781.455378438,
35
- 1003782.0072632281, 1003715.167883104, 1003724.9791682598,
36
- 1003716.6018329085, 1003711.3282671372, 1003686.1868489254,
37
- 1003625.4795220237, 1003584.3334449014, 1003498.9139435134,
38
- 1003310.7825506503, 1003339.72584186, 1003334.3069939599,
39
- 1003364.3540547496, 1003394.4011155394, 1003398.386950134,
40
- 1003233.005474726, 1003185.2981006557, 1003165.7981714085,
32
+ 1003785.6864951615, 1003795.988344575, 1003827.99766239, 1003899.7426850981, 1003891.7710159089,
33
+ 1003810.6439517767, 1003780.7195320514, 1003797.9506016063, 1003781.455378438, 1003782.0072632281,
34
+ 1003715.167883104, 1003724.9791682598, 1003716.6018329085, 1003711.3282671372, 1003686.1868489254,
35
+ 1003625.4795220237, 1003584.3334449014, 1003498.9139435134, 1003310.7825506503, 1003339.72584186,
36
+ 1003334.3069939599, 1003364.3540547496, 1003394.4011155394, 1003398.386950134, 1003233.005474726,
37
+ 1003185.2981006557, 1003165.7981714085,
41
38
  ],
42
39
  },
43
40
  ];
@@ -99,9 +96,7 @@ var AmountGroupAndChart = function (props) {
99
96
  left: 0,
100
97
  bottom: 0,
101
98
  transition: "all 500ms ease-in-out",
102
- transform: !expandAreaChart
103
- ? "translateY(-100%) translateX(25%) scale(0.5)"
104
- : "none",
99
+ transform: !expandAreaChart ? "translateY(-100%) translateX(25%) scale(0.5)" : "none",
105
100
  }, children: (0, jsx_runtime_1.jsx)(DelayMounted_1.default, { delay: 800, children: (0, jsx_runtime_1.jsx)(NeonLineChart_1.default, { showMinMaxValues: expandAreaChart, series: fakeSeries, categories: labels, sx: {
106
101
  width: "100%",
107
102
  height: "fit-content",
@@ -30,6 +30,6 @@ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
30
30
  var Icon_1 = __importDefault(require("../Icon"));
31
31
  var CloseModal = function (props) {
32
32
  var rest = __rest(props, []);
33
- return ((0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ src: (0, getIcon_1.default)("close_modal"), sx: __assign({ width: "1.5rem", height: "1.5rem" }, props.sx) }, rest)));
33
+ return (0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ src: (0, getIcon_1.default)("close_modal"), sx: __assign({ width: "1.5rem", height: "1.5rem" }, props.sx) }, rest));
34
34
  };
35
35
  exports.default = CloseModal;
@@ -197,7 +197,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
197
197
  return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: handleOnOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
198
198
  backgroundColor: "transparent",
199
199
  width: "100%",
200
- }, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Authentication", onClose: handleClose, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "1rem", width: "100%" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: ["Enter your passcode to confirm", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { fontWeight: theme.typography.fontWeight600 }, children: action })] }), (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }));
200
+ }, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Authentication", onClose: handleClose, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "1rem", width: "100%" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: ["Enter your passcode to confirm ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { fontWeight: theme.typography.fontWeight600 }, children: action })] }), (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }));
201
201
  });
202
202
  ConfirmByPasscode.displayName = "ConfirmByPasscode";
203
203
  exports.default = ConfirmByPasscode;
@@ -4,5 +4,5 @@ interface CopyTextComponentProps extends GeneralProps {
4
4
  iconSuccess?: React.ReactNode;
5
5
  hideTextMessage?: boolean;
6
6
  }
7
- declare const CopyTextComponent: ({ value, iconSuccess, children, hideTextMessage, sx, }: CopyTextComponentProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const CopyTextComponent: ({ value, iconSuccess, children, hideTextMessage, sx }: CopyTextComponentProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export default CopyTextComponent;
@@ -21,6 +21,6 @@ var Icon_1 = __importDefault(require("../Icon"));
21
21
  var Button_1 = __importDefault(require("../Button"));
22
22
  function EmptyData(props) {
23
23
  var theme = (0, material_1.useTheme)();
24
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center", justifyContent: "center" }), props.sx), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 48, src: props.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: props.title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: props.description }), props.action && ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: props.action, children: props.actionText }))] }));
24
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center", justifyContent: "center" }), props.sx), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 48, src: props.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: props.title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: props.description }), props.action && (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: props.action, children: props.actionText })] }));
25
25
  }
26
26
  exports.default = EmptyData;
@@ -56,16 +56,11 @@ function Fees(props) {
56
56
  result[index].feeInCurrency += fee.feeInCurrency;
57
57
  result[index].feeInUSD += fee.feeInUSD;
58
58
  result[index].feePercent += fee.feePercent;
59
- result[index].feePercentInCurrency =
60
- ((_a = result[index].feeInCurrency) !== null && _a !== void 0 ? _a : 0) + amount * (fee.feePercent / 100);
61
- result[index].feePercentInUSD =
62
- ((_b = result[index].feeInUSD) !== null && _b !== void 0 ? _b : 0) +
63
- amount * (fee.feePercent / 100) * rate;
64
- var totalFeeInCurrency = ((_c = result[index].feeInCurrency) !== null && _c !== void 0 ? _c : 0) +
65
- ((_d = result[index].feePercentInCurrency) !== null && _d !== void 0 ? _d : 0);
59
+ result[index].feePercentInCurrency = ((_a = result[index].feeInCurrency) !== null && _a !== void 0 ? _a : 0) + amount * (fee.feePercent / 100);
60
+ result[index].feePercentInUSD = ((_b = result[index].feeInUSD) !== null && _b !== void 0 ? _b : 0) + amount * (fee.feePercent / 100) * rate;
61
+ var totalFeeInCurrency = ((_c = result[index].feeInCurrency) !== null && _c !== void 0 ? _c : 0) + ((_d = result[index].feePercentInCurrency) !== null && _d !== void 0 ? _d : 0);
66
62
  var token = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (token) { var _a; return token.currency_slug === ((_a = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _a === void 0 ? void 0 : _a.slug); });
67
- result[index].isEnoughBalanceToPay =
68
- +((_e = token === null || token === void 0 ? void 0 : token.current_value) !== null && _e !== void 0 ? _e : 0) >= totalFeeInCurrency;
63
+ result[index].isEnoughBalanceToPay = +((_e = token === null || token === void 0 ? void 0 : token.current_value) !== null && _e !== void 0 ? _e : 0) >= totalFeeInCurrency;
69
64
  }
70
65
  });
71
66
  console.warn("🚀 ~ consttokensFee:FeeDetailType[]=useMemo ~ result:", result);
@@ -65,11 +65,6 @@ var Formatter = function (_a) {
65
65
  mr: "0.125rem",
66
66
  }, children: "< " })), !(numberDisplay === 0) && !hideStart && ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", style: startStyle, children: startDisplay })), !lessThan && numberDisplay > 0 && numberDisplay < 0.000001 ? ((0, jsx_runtime_1.jsxs)("span", { className: "font-primary", children: ["0.0", (0, jsx_runtime_1.jsx)("sub", { children: lengthFromDot }), formattedNumber.slice(2 + lengthFromDot, lengthValueAllowed - 2 + lengthFromDot)] })) : ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", children: lessThan
67
67
  ? "0.01"
68
- : (0, formatter_1.default)(isLessThan
69
- ? Number(numberDisplay).toFixed(2)
70
- : numberDisplay, useCompact, useCompactOnThousand, lengthValueAllowed) })), !hideUnit &&
71
- !!unitDisplay &&
72
- !noUnitSpacing &&
73
- !(numberDisplay === 0) && ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", style: unitStyle, onClick: onClickUnit, children: unitDisplay }))] })) }), children: (0, jsx_runtime_1.jsx)(Formatter, { disableTooltip: true, start: start, value: value, lengthValueAllowed: 12, useCompact: false, unit: unit, allowShowZero: true, disableAdjustUnitColor: true, hideStart: hideStart, hideUnit: hideUnit }) }));
68
+ : (0, formatter_1.default)(isLessThan ? Number(numberDisplay).toFixed(2) : numberDisplay, useCompact, useCompactOnThousand, lengthValueAllowed) })), !hideUnit && !!unitDisplay && !noUnitSpacing && !(numberDisplay === 0) && ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", style: unitStyle, onClick: onClickUnit, children: unitDisplay }))] })) }), children: (0, jsx_runtime_1.jsx)(Formatter, { disableTooltip: true, start: start, value: value, lengthValueAllowed: 12, useCompact: false, unit: unit, allowShowZero: true, disableAdjustUnitColor: true, hideStart: hideStart, hideUnit: hideUnit }) }));
74
69
  };
75
70
  exports.default = Formatter;
@@ -27,10 +27,6 @@ var material_1 = require("@mui/material");
27
27
  var Icon = function (props) {
28
28
  var _a, _b;
29
29
  var src = props.src, alt = props.alt, onClick = props.onClick, width = props.width, height = props.height, sx = props.sx, rest = __rest(props, ["src", "alt", "onClick", "width", "height", "sx"]);
30
- return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: "img", src: src, alt: alt, onClick: onClick }, rest, { sx: __assign({ display: "block", width: ((_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : false)
31
- ? "".concat((width || height || 0) / 16, "rem")
32
- : "auto", height: ((_b = height !== null && height !== void 0 ? height : width) !== null && _b !== void 0 ? _b : false)
33
- ? "".concat((height || width || 0) / 16, "rem")
34
- : "auto" }, sx) })));
30
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: "img", src: src, alt: alt, onClick: onClick }, rest, { sx: __assign({ display: "block", width: ((_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : false) ? "".concat((width || height || 0) / 16, "rem") : "auto", height: ((_b = height !== null && height !== void 0 ? height : width) !== null && _b !== void 0 ? _b : false) ? "".concat((height || width || 0) / 16, "rem") : "auto" }, sx) })));
35
31
  };
36
32
  exports.default = Icon;
@@ -33,6 +33,6 @@ var Text_1 = __importDefault(require("../Text"));
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, material_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: 0 }), sx), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 32, src: icon }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2, 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 && ((0, jsx_runtime_1.jsx)(Icon_1.default, { width: 10, src: (0, getIcon_1.default)("right_arrow"), sx: { ml: "auto" } })))] })));
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: 0 }), sx), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 32, src: icon }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2, 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 && (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 10, src: (0, getIcon_1.default)("right_arrow"), sx: { ml: "auto" } }))] })));
37
37
  }
38
38
  exports.default = ListItemCustom;
@@ -197,7 +197,7 @@ var LockToken = (0, react_1.forwardRef)(function (props, ref) {
197
197
  return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: type_1.ActionConfirm.LOCK, trigger: props.children, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: token === null || token === void 0 ? void 0 : token.name }) }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
198
198
  fontWeight: theme.typography.fontWeight600,
199
199
  color: theme.palette.text.secondary,
200
- }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: token === null || token === void 0 ? void 0 : token.balance, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) })] }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }))] })), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
200
+ }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: token === null || token === void 0 ? void 0 : token.balance, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) })] }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] })), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
201
201
  });
202
202
  LockToken.displayName = "LockToken";
203
203
  exports.default = LockToken;
@@ -7,6 +7,6 @@ export interface NeonLineChartPropsTypes extends GeneralProps {
7
7
  }>;
8
8
  showMinMaxValues?: boolean;
9
9
  }
10
- declare function NeonLineChart({ series, categories, showMinMaxValues, sx, }: NeonLineChartPropsTypes): import("react/jsx-runtime").JSX.Element;
10
+ declare function NeonLineChart({ series, categories, showMinMaxValues, sx }: NeonLineChartPropsTypes): import("react/jsx-runtime").JSX.Element;
11
11
  declare const _default: import("react").MemoExoticComponent<typeof NeonLineChart>;
12
12
  export default _default;
@@ -35,8 +35,6 @@ var NetworkSelection = function (props) {
35
35
  var networkDataString = props.networkData, onClick = props.onClick, rest = __rest(props, ["networkData", "onClick"]);
36
36
  var theme = (0, material_1.useTheme)();
37
37
  var networkData = (0, react_1.useMemo)(function () { return (0, parsePropsData_1.default)(networkDataString); }, [networkDataString]);
38
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: props.active
39
- ? "background.secondary16"
40
- : "background.white16", padding: "".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8), borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: props.active ? "border.secondary" : "border.white24", gap: theme.mixins.gaps.g8 }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.icon, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (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 })] })));
38
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: props.active ? "background.secondary16" : "background.white16", padding: "".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8), borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: props.active ? "border.secondary" : "border.white24", gap: theme.mixins.gaps.g8 }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.icon, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (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 })] })));
41
39
  };
42
40
  exports.default = NetworkSelection;
@@ -48,7 +48,7 @@ var CustomOtpInput = function (props) {
48
48
  backgroundColor: "#ffffff29",
49
49
  }, renderInput: function (props) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "decimal" })), (0, jsx_runtime_1.jsx)("style", { children: "input::selection {\n background-color: transparent; \n color: white; \n }" })] })); } })));
50
50
  default:
51
- return ((0, jsx_runtime_1.jsx)(react_otp_input_1.default, __assign({}, rest, { renderInput: function (props) { return ((0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "text", type: "text" }))); } })));
51
+ return (0, jsx_runtime_1.jsx)(react_otp_input_1.default, __assign({}, rest, { renderInput: function (props) { return (0, jsx_runtime_1.jsx)("input", __assign({}, props, { inputMode: "text", type: "text" })); } }));
52
52
  }
53
53
  };
54
54
  exports.default = CustomOtpInput;
@@ -136,13 +136,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
136
136
  return masterWallet;
137
137
  }
138
138
  return (_a = blockchainWallets === null || blockchainWallets === void 0 ? void 0 : blockchainWallets.find(function (item) { return item.networkSlug === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug); })) === null || _a === void 0 ? void 0 : _a.blockchainAddress;
139
- }, [
140
- blockchainWallets,
141
- selectedNetwork,
142
- selectedMethod,
143
- masterWallet,
144
- selectedToken,
145
- ]);
139
+ }, [blockchainWallets, selectedNetwork, selectedMethod, masterWallet, selectedToken]);
146
140
  var qrCodeValue = (0, react_1.useMemo)(function () {
147
141
  var _a, _b;
148
142
  if (!receiveAddress || !selectedToken) {
@@ -165,10 +159,10 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
165
159
  }, [receiveAddress, selectedToken, amount, selectedMethod]);
166
160
  var warningMessage = (0, react_1.useMemo)(function () {
167
161
  if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !amount) {
168
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name }), " "] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
162
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name }), " "] }), " ", "and ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
169
163
  }
170
164
  if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !!amount) {
171
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
165
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", unless you will lose your assets."] }));
172
166
  }
173
167
  if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && !amount) {
174
168
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name })] }), ", unless you will lose your assets."] }));
@@ -201,8 +195,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
201
195
  close: close,
202
196
  }); });
203
197
  var handleBack = function () {
204
- if (currentStep === ReceiveStep.SHOW_QR_CODE &&
205
- selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
198
+ if (currentStep === ReceiveStep.SHOW_QR_CODE && selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
206
199
  gotoStep(ReceiveStep.SELECT_TOKEN);
207
200
  return;
208
201
  }
@@ -284,14 +277,10 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
284
277
  };
285
278
  (0, react_1.useEffect)(function () {
286
279
  console.warn("🚀 ~ useEffect ~ isAuthenticated:", isAuthenticated, receiveExternalTokens, isLoadingReceiveExternalToken, receiveInternalTokens, isLoadingReceiveInternalToken);
287
- if (isAuthenticated &&
288
- !receiveExternalTokens &&
289
- !isLoadingReceiveExternalToken) {
280
+ if (isAuthenticated && !receiveExternalTokens && !isLoadingReceiveExternalToken) {
290
281
  updateReceiveExternalToken();
291
282
  }
292
- if (isAuthenticated &&
293
- !receiveInternalTokens &&
294
- !isLoadingReceiveInternalToken) {
283
+ if (isAuthenticated && !receiveInternalTokens && !isLoadingReceiveInternalToken) {
295
284
  updateReceiveInternalToken();
296
285
  }
297
286
  }, [
@@ -311,9 +300,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
311
300
  autoHeight: true,
312
301
  spaceBetween: 32,
313
302
  }, disableSwipe: true, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(ReceiveMethods).map(function (item, index) {
314
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () {
315
- return handleSelectMethod(item);
316
- }, sx: {
303
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () { return handleSelectMethod(item); }, sx: {
317
304
  my: theme.mixins.customMargin.m12,
318
305
  } })] }, item));
319
306
  }) }) }, ReceiveStep.SELECT_METHOD), (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, height: "fit-content" }), children: [!receiveTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0 && (0, jsx_runtime_1.jsx)(EmptyData_1.default, {}), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item) {
@@ -329,9 +316,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
329
316
  display: "flex",
330
317
  flexDirection: "column",
331
318
  gap: theme.mixins.gaps.g16,
332
- }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.black24, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, alignItems: "flex-start", backdropFilter: "blur(10px)" }), id: "share-receive-info", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white", alignSelf: "center" }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { textAlign: "center" }), children: ["Receive", " ", (0, jsx_runtime_1.jsxs)("strong", { children: [!!amount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }), " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), " ", selectedMethod === ReceiveMethods.RECEIVE_INTERNAL
333
- ? "Internally"
334
- : "Externally"] }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
319
+ }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.black24, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, alignItems: "flex-start", backdropFilter: "blur(10px)" }), id: "share-receive-info", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white", alignSelf: "center" }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { textAlign: "center" }), children: ["Receive", " ", (0, jsx_runtime_1.jsxs)("strong", { children: [!!amount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }), " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), " ", selectedMethod === ReceiveMethods.RECEIVE_INTERNAL ? "Internally" : "Externally"] }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
335
320
  position: "relative",
336
321
  width: "fit-content",
337
322
  height: "fit-content",
@@ -342,18 +327,14 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
342
327
  backdropFilter: "blur(10px)",
343
328
  }, children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: (0, getIcon_1.default)("ton"), bgColor: "transparent" }) }), selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
344
329
  transform: "translateX(0.5rem)",
345
- } }), onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), 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)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: selectedMethod === ReceiveMethods.RECEIVE_INTERNAL
346
- ? "Internal address"
347
- : "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("tooltip"), width: 16 }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the", " ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all" }), children: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: receiveAddress || "", children: receiveAddress }) })] }), !!warningMessage && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage }) }))] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
330
+ } }), onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), 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)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: selectedMethod === ReceiveMethods.RECEIVE_INTERNAL ? "Internal address" : "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("tooltip"), width: 16 }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the", " ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all" }), children: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: receiveAddress || "", children: receiveAddress }) })] }), !!warningMessage && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage }) }))] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
348
331
  width: "100%",
349
332
  display: "flex",
350
333
  justifyContent: "center",
351
334
  }, trigger: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
352
335
  fontSize: theme.typography.fontSize12,
353
336
  textTransform: "none",
354
- }, children: [amount ? "Edit" : "+ Set", " amount"] }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), (0, jsx_runtime_1.jsx)(material_1.Input, { placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value), sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize16 }), value: inputAmount, onChange: handleChangeAmount }), amountError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError
355
- ? Button_1.BUTTON_STATUS.DISABLED
356
- : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: qrCodeValue, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { className: "gap-1.5 flex items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
337
+ }, children: [amount ? "Edit" : "+ Set", " amount"] }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), (0, jsx_runtime_1.jsx)(material_1.Input, { placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value), sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize16 }), value: inputAmount, onChange: handleChangeAmount }), amountError && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && (0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError ? Button_1.BUTTON_STATUS.DISABLED : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: qrCodeValue, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { className: "gap-1.5 flex items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
357
338
  fontSize: theme.typography.fontSize12,
358
339
  fontWeight: theme.typography.fontWeight400,
359
340
  leading: theme.typography.leading160,
@@ -15,5 +15,5 @@ export interface TimeFilterData {
15
15
  startDate?: string;
16
16
  endDate?: string;
17
17
  }
18
- declare const TimeFilter: ({ initialValue, onChange, hideAll, }: TimeFilterProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const TimeFilter: ({ initialValue, onChange, hideAll }: TimeFilterProps) => import("react/jsx-runtime").JSX.Element;
19
19
  export default TimeFilter;
@@ -45,9 +45,7 @@ var TokenSelection = function (props) {
45
45
  var _a;
46
46
  return balance * +((_a = tokenData === null || tokenData === void 0 ? void 0 : tokenData.usd_rate) !== null && _a !== void 0 ? _a : 0);
47
47
  }, [balance, tokenData]);
48
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(tokenData); }, sx: __assign({ backgroundColor: props.active
49
- ? "background.secondary16"
50
- : "background.white16", border: "1px solid", borderColor: props.active ? "border.secondary" : "transparent", borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p12, display: "flex", alignItems: "center", cursor: "pointer" }, sx) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: tokenData === null || tokenData === void 0 ? void 0 : tokenData.icon, sx: {
48
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(tokenData); }, sx: __assign({ backgroundColor: props.active ? "background.secondary16" : "background.white16", border: "1px solid", borderColor: props.active ? "border.secondary" : "transparent", borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p12, display: "flex", alignItems: "center", cursor: "pointer" }, sx) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: tokenData === null || tokenData === void 0 ? void 0 : tokenData.icon, sx: {
51
49
  borderRadius: theme.mixins.customRadius.full,
52
50
  } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.valueDescription, children: tokenData === null || tokenData === void 0 ? void 0 : tokenData.full_name })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { marginLeft: "auto", alignItems: "end" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.value, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balance }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.valueDescription, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balanceInUSD, start: "~ $" }) })] })] })));
53
51
  };
@@ -18,6 +18,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
19
19
  var Icon_1 = __importDefault(require("../Icon"));
20
20
  var WaitingData = function (props) {
21
- return ((0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("waiting_data", "gif"), width: 28, sx: __assign({}, props.sx) }));
21
+ return (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("waiting_data", "gif"), width: 28, sx: __assign({}, props.sx) });
22
22
  };
23
23
  exports.default = WaitingData;
@@ -182,9 +182,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
182
182
  var onlyChangeAddress = (0, react_1.useRef)(false);
183
183
  var _v = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), sendButtonStatus = _v[0], setSendButtonStatus = _v[1];
184
184
  var withdrawToken = (0, react_1.useMemo)(function () {
185
- return selectedMethod === SendMethods.TRANSFER_EXTERNAL
186
- ? withdrawTokens
187
- : sendInternalTokens;
185
+ return selectedMethod === SendMethods.TRANSFER_EXTERNAL ? withdrawTokens : sendInternalTokens;
188
186
  }, [withdrawTokens, sendInternalTokens, selectedMethod]);
189
187
  var networks = (0, react_1.useMemo)(function () {
190
188
  console.warn("🚀 ~ networks ~ selectedToken:", selectedToken);
@@ -337,9 +335,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
337
335
  if (onlyChangeAddress.current) {
338
336
  return;
339
337
  }
340
- var tokenSet = (data === null || data === void 0 ? void 0 : data.jetton)
341
- ? findWithdrawToken((data === null || data === void 0 ? void 0 : data.jetton) || "")
342
- : selectedToken;
338
+ var tokenSet = (data === null || data === void 0 ? void 0 : data.jetton) ? findWithdrawToken((data === null || data === void 0 ? void 0 : data.jetton) || "") : selectedToken;
343
339
  if (!tokenSet) {
344
340
  gotoStep(WithdrawStep.SELECT_TOKEN);
345
341
  }
@@ -348,8 +344,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
348
344
  setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
349
345
  gotoStep(WithdrawStep.FORM);
350
346
  }
351
- !!(data === null || data === void 0 ? void 0 : data.amount) &&
352
- setAmount(getAmountAfterDecimal((data === null || data === void 0 ? void 0 : data.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
347
+ !!(data === null || data === void 0 ? void 0 : data.amount) && setAmount(getAmountAfterDecimal((data === null || data === void 0 ? void 0 : data.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
353
348
  !!(data === null || data === void 0 ? void 0 : data.text) && setMemo(data === null || data === void 0 ? void 0 : data.text);
354
349
  };
355
350
  var handleSelectMethod = function (method) {
@@ -404,8 +399,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
404
399
  return amountNumber || "";
405
400
  };
406
401
  var handleBack = function () {
407
- if (currentStep === WithdrawStep.FORM &&
408
- selectedMethod === SendMethods.TRANSFER_INTERNAL) {
402
+ if (currentStep === WithdrawStep.FORM && selectedMethod === SendMethods.TRANSFER_INTERNAL) {
409
403
  gotoStep(WithdrawStep.SELECT_TOKEN);
410
404
  return;
411
405
  }
@@ -487,8 +481,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
487
481
  return [2 /*return*/];
488
482
  }
489
483
  if (validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address) {
490
- tonTransferParam.address =
491
- validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address;
484
+ tonTransferParam.address = validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address;
492
485
  }
493
486
  setSendInfoGet(tonTransferParam);
494
487
  (_d = backDropRef.current) === null || _d === void 0 ? void 0 : _d.close();
@@ -504,8 +497,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
504
497
  setRecipientAddressError(undefined);
505
498
  }
506
499
  if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address)) {
507
- if (isReceiveInternal ||
508
- selectedMethod === SendMethods.TRANSFER_INTERNAL) {
500
+ if (isReceiveInternal || selectedMethod === SendMethods.TRANSFER_INTERNAL) {
509
501
  handleSelectTransferInternal(tonTransferParam);
510
502
  }
511
503
  else {
@@ -513,8 +505,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
513
505
  }
514
506
  }
515
507
  else if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.valid)) {
516
- if (selectedMethod === SendMethods.TRANSFER_EXTERNAL ||
517
- selectedMethod === SendMethods.SCAN_QR_CODE) {
508
+ if (selectedMethod === SendMethods.TRANSFER_EXTERNAL || selectedMethod === SendMethods.SCAN_QR_CODE) {
518
509
  handleSelectContinueTransferExternal(tonTransferParam);
519
510
  }
520
511
  else {
@@ -612,13 +603,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
612
603
  }
613
604
  };
614
605
  (0, react_1.useEffect)(function () {
615
- if (isAuthenticated && !withdrawToken && !isLoadingWithdrawToken) {
606
+ if (isAuthenticated && !withdrawTokens && !isLoadingWithdrawToken) {
616
607
  updateWithdrawToken();
617
608
  }
618
- if (isAuthenticated && !withdrawToken && !isLoadingSendInternalToken) {
609
+ if (isAuthenticated && !sendInternalTokens && !isLoadingSendInternalToken) {
619
610
  updateSendInternalToken();
620
611
  }
621
- }, [isAuthenticated]);
612
+ }, [isAuthenticated, isLoadingWithdrawToken, isLoadingSendInternalToken]);
622
613
  (0, react_1.useEffect)(function () {
623
614
  validateAmount();
624
615
  }, [validateAmount]);
@@ -636,10 +627,8 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
636
627
  : WITHDRAW_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: [(0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
637
628
  autoHeight: true,
638
629
  spaceBetween: 32,
639
- }, disableSwipe: true, children: [(0, jsx_runtime_1.jsxs)(react_2.SwiperSlide, { children: [(0, jsx_runtime_1.jsxs)(Button_1.default.Primary, { onClick: testPushNotification, children: [" ", "Push"] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
640
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () {
641
- return handleSelectMethod(item);
642
- }, sx: {
630
+ }, disableSwipe: true, children: [(0, jsx_runtime_1.jsxs)(react_2.SwiperSlide, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: testPushNotification, children: " Push" }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
631
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () { return handleSelectMethod(item); }, sx: {
643
632
  py: theme.mixins.customPadding.p12,
644
633
  } })] }, item));
645
634
  }) })] }, WithdrawStep.SELECT_METHOD), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: withdrawToken === null || withdrawToken === void 0 ? void 0 : withdrawToken.map(function (item) {
@@ -682,8 +671,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
682
671
  ? Button_1.BUTTON_STATUS.DISABLED
683
672
  : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
684
673
  wordBreak: "break-all",
685
- }, children: recipientAddress }) }), selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }), !!memo &&
686
- selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo })), ((_b = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _b === void 0 ? void 0 : _b.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
674
+ }, children: recipientAddress }) }), selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }), !!memo && selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo })), ((_b = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _b === void 0 ? void 0 : _b.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
687
675
  fontWeight: theme.typography.fontWeight600,
688
676
  fontSize: theme.typography.fontSize16,
689
677
  }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }) })] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.SEND, onConfirmSuccess: handleSend, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: sendButtonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) })] }) }, WithdrawStep.FORM)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
@@ -83,8 +83,7 @@ var loginHandler = function () { return __awaiter(void 0, void 0, void 0, functi
83
83
  },
84
84
  })];
85
85
  }
86
- if (!((0, isExpired_1.default)(loginInfo.expiresAt) &&
87
- !(0, isExpired_1.default)(loginInfo.refreshExpiresAt))) return [3 /*break*/, 8];
86
+ if (!((0, isExpired_1.default)(loginInfo.expiresAt) && !(0, isExpired_1.default)(loginInfo.refreshExpiresAt))) return [3 /*break*/, 8];
88
87
  return [4 /*yield*/, (0, refreshTokenKeycloak_1.default)(loginInfo.refreshToken)];
89
88
  case 4:
90
89
  refreshedTokens = _a.sent();
@@ -10,16 +10,13 @@ function useFormatter() {
10
10
  var userInfo = {}.userInfo;
11
11
  var tokensRateState = {}.tokensRateState;
12
12
  var currency = (_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo.settings) === null || _a === void 0 ? void 0 : _a.currency;
13
- var isDollar = ((_b = currency === null || currency === void 0 ? void 0 : currency.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("usd")) ||
14
- ((_c = currency === null || currency === void 0 ? void 0 : currency.toLowerCase()) === null || _c === void 0 ? void 0 : _c.includes("$"));
13
+ var isDollar = ((_b = currency === null || currency === void 0 ? void 0 : currency.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("usd")) || ((_c = currency === null || currency === void 0 ? void 0 : currency.toLowerCase()) === null || _c === void 0 ? void 0 : _c.includes("$"));
15
14
  var rate = ((_d = tokensRateState === null || tokensRateState === void 0 ? void 0 : tokensRateState[currency]) === null || _d === void 0 ? void 0 : _d.USD) || 1;
16
15
  var formatValue = function (value, hideUnit) {
17
16
  var valueDisplay = (0, formatter_1.default)((0, roundToTwoSignificantDecimals_1.default)(value / rate), false, true);
18
17
  if (hideUnit)
19
18
  return valueDisplay;
20
- return ((isDollar ? "$" : "") +
21
- valueDisplay +
22
- (isDollar ? "" : !!currency ? " ".concat(currency) : ""));
19
+ return (isDollar ? "$" : "") + valueDisplay + (isDollar ? "" : !!currency ? " ".concat(currency) : "");
23
20
  };
24
21
  return {
25
22
  formatValue: formatValue,
@@ -140,9 +140,7 @@ function ActivitiesProvider(_a) {
140
140
  case 2:
141
141
  response_1 = _d.sent();
142
142
  console.warn("🚀 ~ getBalance ~ response:", response_1);
143
- setActivityTypes(__spreadArray([
144
- const_1.ACTIVITIES_TYPE_ALL
145
- ], ((_c = (_b = response_1 === null || response_1 === void 0 ? void 0 : response_1.data) === null || _b === void 0 ? void 0 : _b.transaction_types) !== null && _c !== void 0 ? _c : []), true));
143
+ setActivityTypes(__spreadArray([const_1.ACTIVITIES_TYPE_ALL], ((_c = (_b = response_1 === null || response_1 === void 0 ? void 0 : response_1.data) === null || _b === void 0 ? void 0 : _b.transaction_types) !== null && _c !== void 0 ? _c : []), true));
146
144
  setActivities(function (prev) {
147
145
  var _a;
148
146
  var _b, _c, _d;
@@ -64,16 +64,11 @@ var useWalletData_1 = __importDefault(require("../../hooks/useWalletData"));
64
64
  var ably_service_1 = require("../../services/ably/ably.service");
65
65
  var material_1 = require("@mui/material");
66
66
  var notistack_1 = require("notistack");
67
- var Slide_1 = __importDefault(require("@mui/material/Slide"));
68
67
  exports.initialRealtime = {
69
68
  transaction: undefined,
70
69
  isConnected: false,
71
70
  pushNotification: function () { },
72
71
  };
73
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
- function SlideTransition(props) {
75
- return (0, jsx_runtime_1.jsx)(Slide_1.default, __assign({}, props, { direction: "down" }));
76
- }
77
72
  function GrowTransition(props) {
78
73
  return (0, jsx_runtime_1.jsx)(material_1.Grow, __assign({}, props));
79
74
  }
@@ -97,8 +92,13 @@ function RealtimeProvider(_a) {
97
92
  ablyService.listenMessage(masterWallet, function (message) {
98
93
  // eslint-disable-next-line no-console
99
94
  console.log("🚀 ~ ablyService.listenMessage ~ message:", message);
95
+ var eventData = message.data;
100
96
  setIsConnected(true);
101
- setTransaction(message);
97
+ setTransaction(eventData);
98
+ var theMessage = eventHandler(eventData);
99
+ if (theMessage) {
100
+ pushNotification(theMessage);
101
+ }
102
102
  });
103
103
  }
104
104
  catch (error) {
@@ -106,9 +106,7 @@ function RealtimeProvider(_a) {
106
106
  }
107
107
  }, [masterWallet]);
108
108
  var closeNotification = function (id) {
109
- setNotifications(function (prev) {
110
- return prev.map(function (n) { return (n.id === id ? __assign(__assign({}, n), { open: false }) : n); });
111
- });
109
+ setNotifications(function (prev) { return prev.map(function (n) { return (n.id === id ? __assign(__assign({}, n), { open: false }) : n); }); });
112
110
  };
113
111
  return ((0, jsx_runtime_1.jsxs)(exports.RealtimeContext.Provider, { value: {
114
112
  isConnected: isConnected,
@@ -127,7 +125,38 @@ function RealtimeProvider(_a) {
127
125
  mx: "auto",
128
126
  padding: "".concat(theme.mixins.customPadding.p0, " ").concat(theme.mixins.customPadding.p12),
129
127
  fontSize: theme.typography.fontSize14,
128
+ "& .MuiAlert-message": {
129
+ padding: "".concat(theme.mixins.customPadding.p6, " ").concat(theme.mixins.customPadding.p0),
130
+ },
130
131
  }, children: notification.message }) }, notification.id));
131
132
  }) })] }));
132
133
  }
133
134
  exports.default = RealtimeProvider;
135
+ var eventHandler = function (messageEvent) {
136
+ if (!messageEvent)
137
+ return null;
138
+ var type = messageEvent.transaction_type;
139
+ var amount = messageEvent.amount;
140
+ var currency = messageEvent.currency_slug;
141
+ var status = messageEvent.transaction_status;
142
+ var transactionId = messageEvent.id;
143
+ var notificationType = "success";
144
+ switch (status) {
145
+ case "processing":
146
+ notificationType = "info";
147
+ break;
148
+ case "failed":
149
+ notificationType = "error";
150
+ break;
151
+ case "success":
152
+ notificationType = "success";
153
+ break;
154
+ default:
155
+ notificationType = "info";
156
+ }
157
+ return {
158
+ message: "".concat(type, " ").concat(amount, " ").concat(currency, " is ").concat(status),
159
+ type: notificationType,
160
+ id: "".concat(transactionId, "-").concat(status),
161
+ };
162
+ };
@@ -1,10 +1,11 @@
1
+ import { ReactNode } from "react";
1
2
  export interface RealtimeProviderDataType {
2
3
  transaction: any;
3
4
  isConnected: boolean;
4
5
  pushNotification: (notification: NotificationType) => void;
5
6
  }
6
7
  export interface NotificationType {
7
- message: string;
8
+ message: ReactNode;
8
9
  type: "success" | "error" | "warning" | "info";
9
10
  duration?: number;
10
11
  id: string;
@@ -92,10 +92,10 @@ function ReceiveProvider(_a) {
92
92
  var _this = this;
93
93
  var children = _a.children;
94
94
  var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
95
- var _b = (0, react_1.useState)(true), isLoadingReceiveExternalToken = _b[0], setIsLoadingReceiveExternalToken = _b[1];
96
- var _c = react_1.default.useState(undefined), receiveExternalTokens = _c[0], setReceiveExternalTokens = _c[1];
97
- var _d = (0, react_1.useState)(true), isLoadingReceiveInternalToken = _d[0], setIsLoadingReceiveInternalToken = _d[1];
98
- var _e = react_1.default.useState(undefined), receiveInternalTokens = _e[0], setReceiveInternalTokens = _e[1];
95
+ var _b = (0, react_1.useState)(exports.initialReceive.isLoadingReceiveExternalToken), isLoadingReceiveExternalToken = _b[0], setIsLoadingReceiveExternalToken = _b[1];
96
+ var _c = react_1.default.useState(exports.initialReceive.receiveExternalTokens), receiveExternalTokens = _c[0], setReceiveExternalTokens = _c[1];
97
+ var _d = (0, react_1.useState)(exports.initialReceive.isLoadingReceiveInternalToken), isLoadingReceiveInternalToken = _d[0], setIsLoadingReceiveInternalToken = _d[1];
98
+ var _e = react_1.default.useState(exports.initialReceive.receiveInternalTokens), receiveInternalTokens = _e[0], setReceiveInternalTokens = _e[1];
99
99
  var updateReceiveExternalToken = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
100
100
  var response, error_1;
101
101
  return __generator(this, function (_a) {
@@ -91,10 +91,10 @@ function WithdrawProvider(_a) {
91
91
  var _this = this;
92
92
  var children = _a.children;
93
93
  var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
94
- var _b = (0, react_1.useState)(true), isLoadingWithdrawToken = _b[0], setIsLoadingWithdrawToken = _b[1];
95
- var _c = react_1.default.useState(undefined), withdrawTokens = _c[0], setWithdrawTokens = _c[1];
96
- var _d = (0, react_1.useState)(true), isLoadingSendInternalToken = _d[0], setIsLoadingSendInternalToken = _d[1];
97
- var _e = react_1.default.useState(undefined), sendInternalTokens = _e[0], setSendInternalTokens = _e[1];
94
+ var _b = (0, react_1.useState)(exports.initialWithdraw.isLoadingWithdrawToken), isLoadingWithdrawToken = _b[0], setIsLoadingWithdrawToken = _b[1];
95
+ var _c = react_1.default.useState(exports.initialWithdraw.withdrawTokens), withdrawTokens = _c[0], setWithdrawTokens = _c[1];
96
+ var _d = (0, react_1.useState)(exports.initialWithdraw.isLoadingSendInternalToken), isLoadingSendInternalToken = _d[0], setIsLoadingSendInternalToken = _d[1];
97
+ var _e = react_1.default.useState(exports.initialWithdraw.sendInternalTokens), sendInternalTokens = _e[0], setSendInternalTokens = _e[1];
98
98
  var updateWithdrawToken = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
99
99
  var response, error_1;
100
100
  return __generator(this, function (_a) {
@@ -8,9 +8,7 @@ function compactWalletAddress(walletAddress, isLinkAff) {
8
8
  if ((walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.length) <= 8) {
9
9
  return walletAddress;
10
10
  }
11
- return ((walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(0, !isLinkAff ? 3 : 15)) +
12
- "..." +
13
- (walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(!isLinkAff ? -3 : -10)));
11
+ return (walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(0, !isLinkAff ? 3 : 15)) + "..." + (walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(!isLinkAff ? -3 : -10));
14
12
  }
15
13
  catch (err) {
16
14
  console.error("🚀 ~ compactWalletAddress ~ err:", err);
@@ -43,11 +43,7 @@ var formatter = function (value, useCompact, useCompactOnThousand, lengthAllowed
43
43
  // is not natural number
44
44
  var indexOfDecimalDot = numberToString.indexOf(".");
45
45
  var before = numberToString.slice(0, indexOfDecimalDot);
46
- var after = numberToString.slice(indexOfDecimalDot + 1, indexOfDecimalDot +
47
- 1 +
48
- (lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1 <= 1
49
- ? 2
50
- : lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1));
46
+ var after = numberToString.slice(indexOfDecimalDot + 1, indexOfDecimalDot + 1 + (lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1 <= 1 ? 2 : lengthAllowed - (before === null || before === void 0 ? void 0 : before.length) - 1));
51
47
  var beforeFormatted = before.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator);
52
48
  var afterFormatted = (_b = (_a = Number("0.".concat(after))) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.replace("0.", "");
53
49
  return "".concat(beforeFormatted).concat(+afterFormatted ? "." + afterFormatted : "");
@@ -7,9 +7,7 @@ function getStandardNumber(value) {
7
7
  return stringValue;
8
8
  }
9
9
  else {
10
- var beforeE = stringValue
11
- .slice(0, stringValue.indexOf("e-"))
12
- .replace(".", "");
10
+ var beforeE = stringValue.slice(0, stringValue.indexOf("e-")).replace(".", "");
13
11
  var afterE = stringValue.slice(stringValue.indexOf("e-") + 2);
14
12
  var result = "";
15
13
  for (var i = 0; i < +afterE + 1; i++) {
@@ -7,8 +7,7 @@ function lengthFromDotToFirstNonZero(numString) {
7
7
  return -1;
8
8
  }
9
9
  var firstNonZeroIndex = dotIndex + 1;
10
- while (firstNonZeroIndex < (numString === null || numString === void 0 ? void 0 : numString.length) &&
11
- numString[firstNonZeroIndex] === "0") {
10
+ while (firstNonZeroIndex < (numString === null || numString === void 0 ? void 0 : numString.length) && numString[firstNonZeroIndex] === "0") {
12
11
  firstNonZeroIndex++;
13
12
  }
14
13
  if (firstNonZeroIndex >= (numString === null || numString === void 0 ? void 0 : numString.length)) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.456",
3
+ "version": "0.0.458",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "clean": "rm -rf dist",
9
9
  "build": "npm run format && tsc",
10
- "format": "prettier --write . && eslint --fix --ignore-pattern .next --ignore-pattern node_modules",
10
+ "format": "prettier --write . && eslint --fix --ignore-pattern .next --ignore-pattern node_modules --ignore-pattern dist",
11
11
  "version:patch": "npm version patch",
12
12
  "version:minor": "npm version minor",
13
13
  "version:major": "npm version major",