tek-wallet 0.0.628 → 0.0.630

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 (24) hide show
  1. package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +6 -4
  2. package/dist/components/TekWallet/components/ui/AnalyticGroup/index.js +30 -12
  3. package/dist/components/TekWallet/components/ui/ConfirmTransaction/index.js +1 -0
  4. package/dist/components/TekWallet/components/ui/Fees/index.js +1 -0
  5. package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +2 -1
  6. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +78 -40
  7. package/dist/components/TekWallet/components/ui/SendExternalTokenWithdrawn/index.d.ts +14 -0
  8. package/dist/components/TekWallet/components/ui/SendExternalTokenWithdrawn/index.js +133 -0
  9. package/dist/components/TekWallet/components/ui/TimeFilter/index.js +4 -3
  10. package/dist/components/TekWallet/components/ui/TokenItem/index.d.ts +1 -0
  11. package/dist/components/TekWallet/components/ui/TokenItem/index.js +14 -3
  12. package/dist/components/TekWallet/components/ui/TokenSelection/index.js +2 -2
  13. package/dist/components/TekWallet/components/ui/TokensBoard/index.js +10 -5
  14. package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +2 -1
  15. package/dist/components/TekWallet/components/views/AssetView/index.js +4 -24
  16. package/dist/components/TekWallet/index.d.ts +1 -0
  17. package/dist/components/TekWallet/index.js +1 -0
  18. package/dist/components/TekWallet/providers/ContentHiddenProvider/index.d.ts +10 -0
  19. package/dist/components/TekWallet/providers/ContentHiddenProvider/index.js +22 -0
  20. package/dist/components/TekWallet/providers/TekWalletProvider/index.js +2 -1
  21. package/dist/components/TekWallet/services/axios/validate-wallet-address-service/index.js +6 -0
  22. package/dist/components/TekWallet/theme/mui/theme.d.ts +4 -0
  23. package/dist/components/TekWallet/theme/mui/theme.js +4 -0
  24. package/package.json +1 -1
@@ -26,6 +26,7 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
26
26
  var NeonLineChart_1 = __importDefault(require("../NeonLineChart"));
27
27
  var Icon_1 = __importDefault(require("../Icon"));
28
28
  var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
29
+ var ContentHiddenProvider_1 = require("../../../providers/ContentHiddenProvider");
29
30
  var fakeSeries = [
30
31
  {
31
32
  name: "All",
@@ -76,6 +77,7 @@ var variants = {
76
77
  var AmountGroupAndChart = function (props) {
77
78
  var _a = (0, react_1.useState)(false), expandAreaChart = _a[0], setExpandAreaChart = _a[1];
78
79
  var _b = (0, react_1.useState)(), timeRangeData = _b[0], setTimeRangeData = _b[1];
80
+ var isHidden = (0, ContentHiddenProvider_1.useContentHidden)().isHidden;
79
81
  var theme = (0, ThemeProvider_1.useTheme)();
80
82
  var handleChangeTimeRange = function (data) {
81
83
  setTimeRangeData(data);
@@ -99,6 +101,7 @@ var AmountGroupAndChart = function (props) {
99
101
  bottom: 0,
100
102
  transition: "all 500ms ease-in-out",
101
103
  transform: !expandAreaChart ? "translateX(-25%) scale(0.5)" : "none",
104
+ display: isHidden && !expandAreaChart ? "none" : "block",
102
105
  }, 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: {
103
106
  width: "100%",
104
107
  height: "fit-content",
@@ -106,9 +109,8 @@ var AmountGroupAndChart = function (props) {
106
109
  transform: !expandAreaChart ? "translateY(-100%)" : "none",
107
110
  my: theme.mixins.customMargin.m3,
108
111
  } }) }) }), (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { style: {
109
- position: "absolute",
110
- right: "40%",
111
- bottom: 10,
112
+ position: "relative",
113
+ transform: "translateY(350%)",
112
114
  }, initial: "hidden", animate: expandAreaChart ? "visible" : "hidden", variants: variants, transition: {
113
115
  opacity: {
114
116
  duration: expandAreaChart ? 0.5 : 0.25,
@@ -129,6 +131,6 @@ var AmountGroupAndChart = function (props) {
129
131
  ? "rotate(180deg) translateX(900%) translateY(120%)"
130
132
  : "translateX(-50%) translateY(100%)",
131
133
  zIndex: 20,
132
- }, width: 20, src: (0, getIcon_1.default)("expand"), onClick: toggleExpand }) })] })] }) }));
134
+ }, width: 20, src: (0, getIcon_1.default)("".concat(!expandAreaChart ? "expand" : "collapse")), onClick: toggleExpand }) })] })] }) }));
133
135
  };
134
136
  exports.default = AmountGroupAndChart;
@@ -19,30 +19,44 @@ var Text_1 = __importDefault(require("../Text"));
19
19
  var Formatter_1 = __importDefault(require("../Formatter"));
20
20
  var Icon_1 = __importDefault(require("../Icon"));
21
21
  var material_1 = require("@mui/material");
22
- var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
23
22
  var providers_1 = require("../../../providers");
23
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
24
+ var ContentHiddenProvider_1 = require("../../../providers/ContentHiddenProvider");
24
25
  var AnalyticGroup = function (props) {
25
26
  var theme = (0, providers_1.useTheme)();
27
+ var _a = (0, ContentHiddenProvider_1.useContentHidden)(), isHidden = _a.isHidden, setIsHidden = _a.setIsHidden;
28
+ var toggleHidden = function () {
29
+ setIsHidden(!isHidden);
30
+ };
26
31
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, position: "relative", bottom: "30px" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
27
32
  fontSize: theme.typography.fontSize15,
28
33
  fontWeight: theme.typography.fontWeight500,
29
34
  color: theme.palette.text.accent2,
30
- }, children: "Total Amount" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("not_see"), width: 16, height: 16 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
35
+ }, children: "Total Amount" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("not_see"), onClick: toggleHidden, width: 16, height: 16 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
31
36
  display: "flex",
32
37
  flexDirection: "column",
33
38
  alignItems: "flex-end",
34
39
  gap: theme.mixins.gaps.g6,
35
40
  fontSize: theme.typography.fontSize12,
36
- }, children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.g6 }), children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { sx: { fontWeight: theme.typography.fontWeight700 }, value: 1000000 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
37
- fontWeight: theme.typography.fontWeight400,
38
- fontSize: "0.8em",
39
- }, children: "USDC" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width: 8 })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
41
+ }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.g6 }), children: !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { sx: { fontWeight: theme.typography.fontWeight700 }, value: 1000000 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
42
+ fontWeight: theme.typography.fontWeight400,
43
+ fontSize: "0.8em",
44
+ }, children: "USDC" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width: 8 })] })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
45
+ fontSize: theme.typography.fontSize24,
46
+ fontWeight: theme.typography.fontWeight700,
47
+ color: theme.palette.text.black,
48
+ }, children: "*****" })) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
40
49
  fontWeight: theme.typography.fontWeight600,
41
50
  leading: theme.typography.leading140,
42
51
  fontSize: theme.typography.fontSize12,
43
52
  textTransform: "capitalize",
44
53
  color: theme.palette.text.accent,
45
- }, children: props.timeRange }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_drop_up"), width: 8 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.increase, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight600, borderBottom: "1px dashed currentColor" }), children: "5.63 (+3,22%)" })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
54
+ }, children: props.timeRange }), !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_drop_up"), width: 8 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.alertStatus, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight600, borderBottom: "1px dashed currentColor" }), children: "5.63 (+3,22%)" })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
55
+ fontSize: theme.typography.fontSize12,
56
+ fontWeight: theme.typography.fontWeight600,
57
+ color: theme.palette.text.accent2,
58
+ display: theme.mixins.row,
59
+ }, children: "****" }))] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
46
60
  width: "110%",
47
61
  borderColor: "".concat(theme.palette.border.accent),
48
62
  opacity: 0.2,
@@ -53,10 +67,14 @@ var AnalyticGroup = function (props) {
53
67
  fontSize: theme.typography.fontSize12,
54
68
  textTransform: "capitalize",
55
69
  color: theme.palette.text.accent,
56
- }, children: "Profit" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("approximately"), width: 15, height: 15 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
57
- fontSize: theme.typography.fontSize12,
58
- fontWeight: theme.typography.fontWeight600,
59
- color: theme.palette.text.accent2,
60
- }, children: "250k XP" })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("mark"), width: 15, height: 15 })] })] })] }));
70
+ }, children: "Profit" }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("approximately"), width: 15, height: 15 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
71
+ fontSize: theme.typography.fontSize12,
72
+ fontWeight: theme.typography.fontWeight600,
73
+ color: theme.palette.text.accent2,
74
+ }, children: "250k XP" })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
75
+ fontSize: theme.typography.fontSize12,
76
+ fontWeight: theme.typography.fontWeight600,
77
+ color: theme.palette.text.accent2,
78
+ }, children: "****" })) }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("mark"), width: 15, height: 15 })] })] })] }));
61
79
  };
62
80
  exports.default = AnalyticGroup;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __assign = (this && this.__assign) || function () {
3
4
  __assign = Object.assign || function(t) {
4
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __assign = (this && this.__assign) || function () {
3
4
  __assign = Object.assign || function(t) {
4
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -32,10 +32,11 @@ var Text_1 = __importDefault(require("../Text"));
32
32
  var parsePropsData_1 = __importDefault(require("../../../utils/parsePropsData"));
33
33
  var material_1 = require("@mui/material");
34
34
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
35
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
35
36
  var NetworkSelection = function (props) {
36
37
  var networkDataString = props.networkData, onClick = props.onClick, active = props.active, rest = __rest(props, ["networkData", "onClick", "active"]);
37
38
  var theme = (0, ThemeProvider_1.useTheme)();
38
39
  var networkData = (0, react_1.useMemo)(function () { return (0, parsePropsData_1.default)(networkDataString); }, [networkDataString]);
39
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: 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: 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 })] })));
40
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), padding: "".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8), borderRadius: theme.mixins.customRadius.r12, border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), gap: theme.mixins.gaps.g8, justifyContent: "space-between" }), onClick: function () { return onClick === null || onClick === void 0 ? void 0 : onClick(networkData); }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.icon, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "text.white", whiteSpace: "nowrap", textTransform: "capitalize" }), children: networkData === null || networkData === void 0 ? void 0 : networkData.name }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13, fontWeight: theme.typography.fontWeight400 }), children: ["Minimum Deposit: 0.0003 ", networkData === null || networkData === void 0 ? void 0 : networkData.name] })] })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, height: 20, src: (0, getIcon_1.default)(active ? "circle_checked" : "circle_unchecked") }) })] })));
40
41
  };
41
42
  exports.default = NetworkSelection;
@@ -79,6 +79,8 @@ var CustomTooltip_1 = __importDefault(require("../CustomTooltip"));
79
79
  var DialogContentLayout_1 = __importDefault(require("../DialogContentLayout"));
80
80
  var Input_1 = __importDefault(require("../Input"));
81
81
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
82
+ var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
83
+ var LineValue_1 = __importDefault(require("../LineValue"));
82
84
  var ReceiveMethods;
83
85
  (function (ReceiveMethods) {
84
86
  ReceiveMethods["RECEIVE_INTERNAL"] = "Receive internally";
@@ -101,7 +103,9 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
101
103
  var drawerRef = (0, react_1.useRef)(null);
102
104
  var amountDrawerRef = (0, react_1.useRef)(null);
103
105
  var _a = (0, react_1.useState)(), selectedMethod = _a[0], setSelectedMethod = _a[1];
104
- var swiperRef = (0, react_1.useRef)(null);
106
+ // const swiperRef = useRef<SwiperControlledRef>(null);
107
+ var modalSwiperRef = (0, react_1.useRef)(null);
108
+ var pageSwiperRef = (0, react_1.useRef)(null);
105
109
  var theme = (0, ThemeProvider_1.useTheme)();
106
110
  var _b = (0, react_1.useState)(ReceiveStep.SELECT_METHOD), currentStep = _b[0], setCurrentStep = _b[1];
107
111
  var _c = (0, react_1.useState)(), selectedToken = _c[0], setSelectedToken = _c[1];
@@ -160,13 +164,13 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
160
164
  }, [receiveAddress, selectedToken, amount, selectedMethod]);
161
165
  var warningMessage = (0, react_1.useMemo)(function () {
162
166
  if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !amount) {
163
- 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: " ".concat(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."] }));
167
+ 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.primary.main }, 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: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }), " "] }), " ", "and ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", unless you will lose your assets."] }));
164
168
  }
165
169
  if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !!amount) {
166
170
  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."] }));
167
171
  }
168
172
  if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && !amount) {
169
- 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: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) })] }), ", unless you will lose your assets."] }));
173
+ 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.primary.main }, 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: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) })] }), ", unless you will lose your assets."] }));
170
174
  }
171
175
  return null;
172
176
  }, [selectedMethod, selectedToken, amount]);
@@ -214,12 +218,18 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
214
218
  }
215
219
  };
216
220
  var gotoStep = function (step) {
217
- var _a;
221
+ var _a, _b;
218
222
  if (step === ReceiveStep.SELECT_METHOD) {
219
223
  clearValues();
220
224
  }
221
225
  setCurrentStep(step);
222
- (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
226
+ // swiperRef.current?.slideTo(step);
227
+ if (step === ReceiveStep.SELECT_METHOD) {
228
+ (_a = modalSwiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
229
+ }
230
+ else {
231
+ (_b = pageSwiperRef.current) === null || _b === void 0 ? void 0 : _b.slideTo(step - 1);
232
+ }
223
233
  };
224
234
  var handleSelectToken = function (token) {
225
235
  setSelectedToken(token);
@@ -289,44 +299,82 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
289
299
  updateReceiveInternalToken();
290
300
  }
291
301
  }, [isInitPasscode, receiveExternalTokens, receiveInternalTokens]);
292
- return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
302
+ return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: currentStep === ReceiveStep.SELECT_METHOD ? ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
303
+ width: "100%",
304
+ display: "flex",
305
+ alignItems: "center",
306
+ minHeight: "2rem",
307
+ mb: theme.mixins.customMargin.m20,
308
+ }, overrideBack: handleBack, hideBack: currentStep === ReceiveStep.SELECT_METHOD, center: RECEIVE_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto", mr: theme.mixins.customMargin.m12 }, onClick: close }) }), children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { ref: modalSwiperRef, swiperProps: {
309
+ autoHeight: true,
310
+ spaceBetween: 32,
311
+ }, disableSwipe: true, initialActiveTab: 0, 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) {
312
+ 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: {
313
+ my: theme.mixins.customMargin.m12,
314
+ } })] }, item));
315
+ }) }) }, ReceiveStep.SELECT_METHOD) }, receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) })) : ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
316
+ padding: theme.mixins.pagePadding,
317
+ position: "relative",
318
+ }, header: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
293
319
  width: "100%",
294
320
  display: "flex",
295
321
  alignItems: "center",
296
322
  minHeight: "2rem",
297
323
  mb: theme.mixins.customMargin.m20,
298
- }, overrideBack: handleBack, hideBack: currentStep === ReceiveStep.SELECT_METHOD, center: RECEIVE_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: {
324
+ }, overrideBack: handleBack, center: RECEIVE_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto", mr: theme.mixins.customMargin.m12 }, onClick: close }) }), footer: currentStep === ReceiveStep.SHOW_QR_CODE && ((0, jsx_runtime_1.jsx)(material_1.Box, { className: "px-4 w-full", children: (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", children: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { sx: __assign(__assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), { backgroundColor: theme.palette.primary.main, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12 }), fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
325
+ fontSize: theme.typography.fontSize12,
326
+ fontWeight: theme.typography.fontWeight400,
327
+ leading: theme.typography.leading160,
328
+ textTransform: "capitalize",
329
+ }, children: "Share" }) }) }) })), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: pageSwiperRef, swiperProps: {
299
330
  autoHeight: true,
300
331
  spaceBetween: 32,
301
- }, disableSwipe: true, initialActiveTab: currentStep, 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) {
302
- 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: {
303
- my: theme.mixins.customMargin.m12,
304
- } })] }, item));
305
- }) }) }, 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) {
332
+ }, disableSwipe: true, initialActiveTab: currentStep - 1, children: [(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 && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputBase, { startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { className: "size-5 text-black", position: "start", children: (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "size-5", src: (0, getIcon_1.default)("search") }) }), placeholder: "Search", className: "w-full flex items-center py-1 px-2", sx: {
333
+ borderRadius: theme.mixins.customRadius.r12,
334
+ border: "1px solid",
335
+ borderColor: theme.palette.border.accent3,
336
+ background: theme.palette.background.white,
337
+ color: theme.palette.text.black,
338
+ "input::placeholder": {
339
+ fontSize: theme.typography.fontSize11,
340
+ pl: theme.mixins.customPadding.p4,
341
+ fontWeight: theme.typography.fontWeight500,
342
+ color: theme.palette.text.black,
343
+ },
344
+ } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
345
+ display: theme.mixins.row,
346
+ justifyContent: "space-between",
347
+ mt: theme.mixins.customMargin.m16,
348
+ }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 0.5, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight600 }), children: "Token" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col gap-[0.8px]", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { className: "w-2", src: (0, getIcon_1.default)("arrow_drop_up") }), (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "w-2", src: (0, getIcon_1.default)("arrow_drop_down") })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 0.5, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight600 }), children: "Balance" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col gap-[0.8px]", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { className: "w-2", src: (0, getIcon_1.default)("arrow_drop_up") }), (0, jsx_runtime_1.jsx)(Icon_1.default, { className: "w-2", src: (0, getIcon_1.default)("arrow_drop_down") })] })] })] })] })), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item) {
306
349
  var stringifiedTokenData = JSON.stringify(item);
307
350
  if (!item)
308
351
  return null;
309
352
  return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) === item.id }, item.id));
310
- })] }) }, ReceiveStep.SELECT_TOKEN), (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 }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item) {
311
- if (!item)
312
- return null;
313
- return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id }, item.id));
314
- }) }) }, ReceiveStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
353
+ })] }) }, ReceiveStep.SELECT_TOKEN), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [networks && networks.length > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { borderRadius: theme.mixins.customRadius.r16, background: theme.palette.background.accent3, gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.fieldTitle), { fontWeight: theme.typography.fontWeight700, color: theme.palette.text.darkContrast }), children: "Choosing a network? Let us help!" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight500 }), children: "Select the network used by your sending platform." }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: 0.5, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
354
+ color: theme.palette.primary.main,
355
+ fontWeight: theme.typography.fontWeight600,
356
+ fontSize: theme.typography.fontSize10,
357
+ }, children: "Learn more" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 6, height: 6, src: (0, getIcon_1.default)("keyboard_arrow_down") })] })] })), networks === null || networks === void 0 ? void 0 : networks.map(function (item) {
358
+ if (!item)
359
+ return null;
360
+ return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id }, item.id));
361
+ })] }) }, ReceiveStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
315
362
  display: "flex",
316
363
  flexDirection: "column",
317
364
  gap: theme.mixins.gaps.g16,
318
- }, 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.jsx)("strong", { children: !!amount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }), " ", selectedMethod === ReceiveMethods.RECEIVE_INTERNAL ? "Internally" : "Externally"] }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
319
- position: "relative",
320
- width: "fit-content",
321
- height: "fit-content",
322
- alignSelf: "center",
323
- borderRadius: theme.mixins.customRadius.r12,
324
- overflow: "hidden",
325
- backgroundColor: theme.palette.background.white,
326
- backdropFilter: "blur(10px)",
327
- }, 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": {
328
- transform: "translateX(0.5rem)",
329
- } }), 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: {
365
+ }, 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.tertiary, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, paddingTop: "80px", alignItems: "flex-start", position: "relative", marginTop: "75px" }), id: "share-receive-info", children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
366
+ color: theme.palette.border.accent,
367
+ width: "100%",
368
+ } }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link) || (0, getIcon_1.default)("clock"), bgColor: "transparent", size: 150 }) }), 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, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), onClick: handleBack, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
369
+ transform: "translateX(0.5rem)",
370
+ } }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { className: "w-6 h-6 rounded-full", src: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link) || (0, getIcon_1.default)("clock") }), (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.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), className: "w-2 h-2" })] })] })), (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.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copy"), className: "w-5 h-5" })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
371
+ color: theme.palette.border.accent,
372
+ width: "100%",
373
+ } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize14 }), children: "Minimum Top Up" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize14 }), children: ["0.003 ", selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize14 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize14 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize14 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize14 }), children: "~ 20 Minutes" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
374
+ color: theme.palette.border.accent,
375
+ width: "100%",
376
+ mt: theme.mixins.customMargin.m12,
377
+ } }), !!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
378
  width: "100%",
331
379
  display: "flex",
332
380
  justifyContent: "center",
@@ -341,17 +389,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
341
389
  onChange: handleChangeAmount,
342
390
  type: "text",
343
391
  inputMode: "decimal",
344
- }, rightPart: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }), 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: {
345
- fontSize: theme.typography.fontSize12,
346
- fontWeight: theme.typography.fontWeight400,
347
- leading: theme.typography.leading160,
348
- textTransform: "capitalize",
349
- }, children: "Copy" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copy"), width: 20 })] }) }), (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { sx: __assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
350
- fontSize: theme.typography.fontSize12,
351
- fontWeight: theme.typography.fontWeight400,
352
- leading: theme.typography.leading160,
353
- textTransform: "capitalize",
354
- }, children: "Share" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("share"), width: 20 })] }) })] })] }) }, ReceiveStep.SHOW_QR_CODE)] }, receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) }) }) }));
392
+ }, rightPart: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }), 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" })] })] }) }) })] }) }, ReceiveStep.SHOW_QR_CODE)] }, receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) })) }) }));
355
393
  });
356
394
  exports.ReceiveFunction.displayName = "ReceiveFunction";
357
395
  exports.default = exports.ReceiveFunction;
@@ -0,0 +1,14 @@
1
+ import { ConfirmLayoutProps } from "../ConfirmLayout";
2
+ import { SendExternalBody, SendExternalResponse } from "../../../services/axios/send-external-service/type";
3
+ import { NetworkData } from "../../../services/axios/type";
4
+ export interface SendExternalDataType extends Omit<SendExternalBody, "network" | "passcode"> {
5
+ network: NetworkData;
6
+ }
7
+ export interface SendExternalTokenWithdrawnProps extends Omit<ConfirmLayoutProps, "action"> {
8
+ sendExternalData: SendExternalDataType;
9
+ onSuccess?: (data: SendExternalResponse) => any;
10
+ onStart?: () => void;
11
+ children: React.ReactNode;
12
+ }
13
+ declare const SendExternalTokenWithdrawn: ({ sendExternalData, onSuccess, onStart, children, }: SendExternalTokenWithdrawnProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default SendExternalTokenWithdrawn;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ "use client";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
48
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
49
+ return new (P || (P = Promise))(function (resolve, reject) {
50
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
51
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
52
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
53
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
54
+ });
55
+ };
56
+ var __generator = (this && this.__generator) || function (thisArg, body) {
57
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
58
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
59
+ function verb(n) { return function (v) { return step([n, v]); }; }
60
+ function step(op) {
61
+ if (f) throw new TypeError("Generator is already executing.");
62
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
63
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
64
+ if (y = 0, t) op = [op[0] & 2, t.value];
65
+ switch (op[0]) {
66
+ case 0: case 1: t = op; break;
67
+ case 4: _.label++; return { value: op[1], done: false };
68
+ case 5: _.label++; y = op[1]; op = [0]; continue;
69
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
70
+ default:
71
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
72
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
73
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
74
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
75
+ if (t[2]) _.ops.pop();
76
+ _.trys.pop(); continue;
77
+ }
78
+ op = body.call(thisArg, _);
79
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
80
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
81
+ }
82
+ };
83
+ var __importDefault = (this && this.__importDefault) || function (mod) {
84
+ return (mod && mod.__esModule) ? mod : { "default": mod };
85
+ };
86
+ Object.defineProperty(exports, "__esModule", { value: true });
87
+ var jsx_runtime_1 = require("react/jsx-runtime");
88
+ var Button_1 = __importStar(require("../Button"));
89
+ var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
90
+ var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
91
+ var react_1 = require("react");
92
+ var RequireConnect_1 = __importDefault(require("../RequireConnect"));
93
+ var send_external_service_1 = __importDefault(require("../../../services/axios/send-external-service"));
94
+ var type_1 = require("../../../services/axios/get-activities-service/type");
95
+ var transactionSlug = type_1.TransactionSlug.Withdrawn;
96
+ var SendExternalTokenWithdrawn = function (_a) {
97
+ var sendExternalData = _a.sendExternalData, onSuccess = _a.onSuccess, onStart = _a.onStart, children = _a.children;
98
+ var _b = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _b[0], setButtonStatus = _b[1];
99
+ var network = sendExternalData.network;
100
+ var handleSendExternalTokenWithdrawn = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
101
+ var response, err_1;
102
+ return __generator(this, function (_a) {
103
+ switch (_a.label) {
104
+ case 0:
105
+ _a.trys.push([0, 2, , 3]);
106
+ onStart === null || onStart === void 0 ? void 0 : onStart();
107
+ setButtonStatus(Button_1.BUTTON_STATUS.LOADING);
108
+ return [4 /*yield*/, (0, send_external_service_1.default)(__assign(__assign({}, sendExternalData), { network: network.slug, passcode: passcode }))];
109
+ case 1:
110
+ response = _a.sent();
111
+ if (response.success) {
112
+ setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
113
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(response);
114
+ }
115
+ else {
116
+ throw new Error("Send external failed");
117
+ }
118
+ return [3 /*break*/, 3];
119
+ case 2:
120
+ err_1 = _a.sent();
121
+ console.error(err_1);
122
+ setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
123
+ setTimeout(function () {
124
+ setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
125
+ }, 1200);
126
+ return [3 /*break*/, 3];
127
+ case 3: return [2 /*return*/];
128
+ }
129
+ });
130
+ }); };
131
+ return ((0, jsx_runtime_1.jsxs)(RequireConnect_1.default, { children: [children, (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { action: transactionSlug, children: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalTokenWithdrawn, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: buttonStatus, children: "Confirm" }) }) })] }));
132
+ };
133
+ exports.default = SendExternalTokenWithdrawn;
@@ -124,9 +124,10 @@ var TimeFilter = function (_a) {
124
124
  fontSize: theme.typography.fontSize11,
125
125
  borderRadius: theme.mixins.customRadius.r10,
126
126
  borderWidth: 1,
127
- borderColor: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.border.accent : theme.palette.text.accent,
128
- backgroundColor: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.background.white16 : "transparent",
129
- color: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.text.primary : theme.palette.text.accent2,
127
+ borderColor: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.primary.main : theme.palette.border.accent3,
128
+ backgroundColor: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.secondary.main : "transparent",
129
+ color: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.palette.primary.main : theme.palette.text.accent,
130
+ fontWeight: (value === null || value === void 0 ? void 0 : value.type) === type ? theme.typography.fontWeight600 : theme.typography.fontWeight500,
130
131
  transition: "background 0.2s, color 0.2s, border-color 0.2s",
131
132
  overflow: "hidden",
132
133
  } }), (value === null || value === void 0 ? void 0 : value.type) === type && ((0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("rectangle"), width: 22, height: 22, sx: {
@@ -2,6 +2,7 @@ type TokenDataStringified = string;
2
2
  interface TokenItemProps {
3
3
  className?: string;
4
4
  tokenData: TokenDataStringified;
5
+ showSmallAssets?: boolean;
5
6
  }
6
7
  declare const TokenItem: (props: TokenItemProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default TokenItem;
@@ -21,18 +21,29 @@ var Text_1 = __importDefault(require("../Text"));
21
21
  var Formatter_1 = __importDefault(require("../Formatter"));
22
22
  var material_1 = require("@mui/material");
23
23
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
24
+ var ContentHiddenProvider_1 = require("../../../providers/ContentHiddenProvider");
24
25
  var TokenItem = function (props) {
25
- var _a;
26
26
  var theme = (0, ThemeProvider_1.useTheme)();
27
27
  var tokenData = (0, react_1.useMemo)(function () { return JSON.parse(props.tokenData); }, [props.tokenData]);
28
28
  var currency = (0, react_1.useMemo)(function () { return tokenData.currency; }, [tokenData]);
29
+ var isHidden = (0, ContentHiddenProvider_1.useContentHidden)().isHidden;
30
+ // const pnlValue = useMemo(() => Number(tokenData.pnl || 0), [tokenData.pnl]);
31
+ var shouldHideSmallAsset = props.showSmallAssets && currency.name === "USD";
29
32
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
30
- display: "grid",
33
+ display: !shouldHideSmallAsset ? "grid" : "none",
31
34
  gridTemplateColumns: "1.55fr 1fr 1fr",
32
35
  gap: theme.mixins.gaps.g12,
33
36
  py: theme.mixins.customPadding.p8,
34
37
  }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, sx: {
35
38
  borderRadius: theme.mixins.customRadius.full,
36
- }, src: currency.link }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { flex: 1 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: currency.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: currency.full_name })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g1, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: +((_a = tokenData.current_value) !== null && _a !== void 0 ? _a : 0) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 100 }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g1, textAlign: "right" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 70000 }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 3.72 }) })] })] }));
39
+ }, src: currency.link }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { flex: 1 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: currency.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: currency.full_name })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g1, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeight700 }), children: !isHidden ? (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: tokenData.current_value }) : "***" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: !isHidden ? (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 100 }) : "***" })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g1, textAlign: "right" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.alertStatus, fontWeight: theme.typography.fontWeight700 }), children: !isHidden ? ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 70000 })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
40
+ fontSize: theme.typography.fontSize14,
41
+ fontWeight: theme.typography.fontWeight600,
42
+ color: theme.palette.text.black,
43
+ }, children: "***" })) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.alertStatus }), children: !isHidden ? ((0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 3.72 })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
44
+ fontSize: theme.typography.fontSize12,
45
+ fontWeight: theme.typography.fontWeight600,
46
+ color: theme.palette.text.accent2,
47
+ }, children: "***" })) })] })] }));
37
48
  };
38
49
  exports.default = TokenItem;
@@ -45,8 +45,8 @@ 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: active ? "background.secondary16" : "background.white16", border: "1px solid", borderColor: 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.link, 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: active ? "".concat(theme.palette.background.tertiary) : "".concat(theme.palette.background.white), border: "1px solid", borderColor: active ? "".concat(theme.palette.primary.main) : "".concat(theme.palette.border.accent3), 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.link, sx: {
49
49
  borderRadius: theme.mixins.customRadius.full,
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: "~ $" }) })] })] })));
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: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: balanceInUSD, start: "~ $" }) })] })] })));
51
51
  };
52
52
  exports.default = TokenSelection;
@@ -22,9 +22,14 @@ var TokenItem_1 = __importDefault(require("../TokenItem"));
22
22
  var material_1 = require("@mui/material");
23
23
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
24
24
  var WaitingData_1 = __importDefault(require("../WaitingData"));
25
+ var react_1 = require("react");
25
26
  var TokensBoard = function () {
26
27
  var tokens = (0, useWalletData_1.default)().tokens;
27
28
  var theme = (0, ThemeProvider_1.useTheme)();
29
+ var _a = (0, react_1.useState)(false), showSmallAssets = _a[0], setShowSmallAssets = _a[1];
30
+ var toggleDisplay = function () {
31
+ setShowSmallAssets(!showSmallAssets);
32
+ };
28
33
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
29
34
  // ...theme.mixins.paper,
30
35
  // backgroundColor: "background.white",
@@ -42,10 +47,10 @@ var TokensBoard = function () {
42
47
  width: "1.5rem",
43
48
  height: "1.5rem",
44
49
  "& .MuiSvgIcon-root": {
45
- color: theme.palette.text.primary,
50
+ color: theme.palette.text.accent,
46
51
  },
47
- } })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
48
- borderColor: theme.palette.border.accent,
52
+ }, onClick: toggleDisplay })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
53
+ borderColor: theme.palette.border.accent3,
49
54
  } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, mt: theme.mixins.customMargin.m8, pt: theme.mixins.customPadding.p8, minHeight: !tokens ? "20rem" : "unset" }), children: [!!tokens && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
50
55
  display: "grid",
51
56
  gridTemplateColumns: "1.55fr 1fr 1fr",
@@ -70,11 +75,11 @@ var TokensBoard = function () {
70
75
  color: theme.palette.text.accent2,
71
76
  }, children: "PnL" })] })), tokens === null || tokens === void 0 ? void 0 : tokens.map(function (item) {
72
77
  var stringifiedTokenData = JSON.stringify(__assign({}, item));
73
- return (0, jsx_runtime_1.jsx)(TokenItem_1.default, { tokenData: stringifiedTokenData }, item.id);
78
+ return (0, jsx_runtime_1.jsx)(TokenItem_1.default, { showSmallAssets: showSmallAssets, tokenData: stringifiedTokenData }, item.id);
74
79
  }), !tokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, { sx: { margin: "auto" } })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
75
80
  borderColor: theme.palette.border.accent,
76
81
  } }), !!tokens && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
77
82
  paddingTop: theme.mixins.customPadding.p16,
78
- }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({ fontSize: theme.typography.fontSize16, color: theme.palette.text.primary, fontWeight: theme.typography.fontWeight600, lineHeight: theme.typography.leading140, width: "fit-content", textDecoration: "underline", textUnderlineOffset: ".3rem", textDecorationThickness: ".1rem", px: theme.mixins.customPadding.p5, cursor: "pointer", mx: "auto" }, theme.mixins.row), children: "View all assets" }) }))] }));
83
+ }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({ fontSize: theme.typography.fontSize14, color: theme.palette.primary.main, fontWeight: theme.typography.fontWeight600, lineHeight: theme.typography.leading140, width: "fit-content", textDecoration: "underline", textUnderlineOffset: ".3rem", textDecorationThickness: ".1rem", px: theme.mixins.customPadding.p5, cursor: "pointer", mx: "auto" }, theme.mixins.row), children: "View all assets" }) }))] }));
79
84
  };
80
85
  exports.default = TokensBoard;
@@ -120,6 +120,7 @@ var SendExternalToken_1 = __importDefault(require("../SendExternalToken"));
120
120
  var SendInternalToken_1 = __importDefault(require("../SendInternalToken"));
121
121
  var createDebounce_1 = __importDefault(require("../../../utils/createDebounce"));
122
122
  var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
123
+ var providers_1 = require("../../../providers");
123
124
  var SendMethods;
124
125
  (function (SendMethods) {
125
126
  SendMethods["SCAN_QR_CODE"] = "scan qr code";
@@ -153,7 +154,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
153
154
  var _a;
154
155
  var drawerRef = (0, react_1.useRef)(null);
155
156
  var swiperRef = (0, react_1.useRef)(null);
156
- var theme = (0, material_1.useTheme)();
157
+ var theme = (0, providers_1.useTheme)();
157
158
  var _b = (0, react_1.useState)(WithdrawStep.SELECT_METHOD), currentStep = _b[0], setCurrentStep = _b[1];
158
159
  var _c = (0, react_1.useState)(), selectedToken = _c[0], setSelectedToken = _c[1];
159
160
  var _d = (0, react_1.useState)(), selectedNetwork = _d[0], setSelectedNetwork = _d[1];
@@ -40,44 +40,24 @@ var AssetView = function (props) {
40
40
  my: theme.mixins.customMargin.m20,
41
41
  paddingTop: theme.mixins.customPadding.p16,
42
42
  paddingBottom: theme.mixins.customPadding.p8,
43
- backgroundColor: theme.palette.text.secondary,
43
+ backgroundColor: theme.palette.background.tertiary,
44
44
  borderRadius: theme.mixins.customRadius.r16,
45
45
  "& .MuiListItem-root, & .MuiListItem-root *": {
46
46
  color: theme.palette.text.primary,
47
47
  fontWeight: theme.typography.fontWeight600,
48
48
  },
49
49
  }, children: [(0, jsx_runtime_1.jsx)(ReceiveFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
50
- borderRight: "1px solid ".concat(theme.palette.border.accent),
50
+ borderRight: "1px solid ".concat(theme.palette.border.accent3),
51
51
  placeContent: "center",
52
52
  columnSpan: 1,
53
53
  }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("receive"), label: "Receive", sx: {
54
54
  width: "100%",
55
55
  } }) }) }), (0, jsx_runtime_1.jsx)(WithdrawFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
56
- borderRight: "1px solid ".concat(theme.palette.border.accent),
56
+ borderRight: "1px solid ".concat(theme.palette.border.accent3),
57
57
  placeContent: "center",
58
58
  columnSpan: 1,
59
59
  }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("withdraw"), label: "Withdraw", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
60
- borderRight: "1px solid ".concat(theme.palette.border.accent),
61
- placeContent: "center",
62
- columnSpan: 1,
63
- }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("fortune", "gif"), label: "Fortune", sx: { width: "100%" } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("p2p", "gif"), label: "P2P", sx: { width: "100%" } }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "horizontal", sx: {
64
- gridColumn: "1 / -1",
65
- width: "95%",
66
- borderWidth: "1px",
67
- borderColor: theme.palette.border.accent,
68
- opacity: 0.75,
69
- my: theme.mixins.customMargin.m12,
70
- margin: "0 auto",
71
- } }), (0, jsx_runtime_1.jsx)(ReceiveFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
72
- borderRight: "1px solid ".concat(theme.palette.border.accent),
73
- placeContent: "center",
74
- columnSpan: 1,
75
- }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("receive"), label: "Receive", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(WithdrawFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
76
- borderRight: "1px solid ".concat(theme.palette.border.accent),
77
- placeContent: "center",
78
- columnSpan: 1,
79
- }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("withdraw"), label: "Withdraw", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
80
- borderRight: "1px solid ".concat(theme.palette.border.accent),
60
+ borderRight: "1px solid ".concat(theme.palette.border.accent3),
81
61
  placeContent: "center",
82
62
  columnSpan: 1,
83
63
  }, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("fortune", "gif"), label: "Fortune", sx: { width: "100%" } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("p2p", "gif"), label: "P2P", sx: { width: "100%" } }) })] }), (0, jsx_runtime_1.jsx)(TokensBoard_1.default, {})] })))] }));
@@ -19,3 +19,4 @@ export type * from "./services/axios/validate-wallet-address-service/type";
19
19
  export * from "./components/index";
20
20
  export * from "./providers/TekWalletProvider";
21
21
  export * from "./components/ui/UpdateLockToken";
22
+ export * from "./components/ui/SendExternalTokenWithdrawn";
@@ -34,3 +34,4 @@ __exportStar(require("./services/axios/validate-wallet-address-service"), export
34
34
  __exportStar(require("./components/index"), exports);
35
35
  __exportStar(require("./providers/TekWalletProvider"), exports);
36
36
  __exportStar(require("./components/ui/UpdateLockToken"), exports);
37
+ __exportStar(require("./components/ui/SendExternalTokenWithdrawn"), exports);
@@ -0,0 +1,10 @@
1
+ interface ContentHiddenContextType {
2
+ isHidden: boolean;
3
+ setIsHidden: (isHidden: boolean) => void;
4
+ }
5
+ export declare function useContentHidden(): ContentHiddenContextType;
6
+ interface ContentHiddenProviderProps {
7
+ children: React.ReactNode;
8
+ }
9
+ export default function ContentHiddenProvider({ children }: ContentHiddenProviderProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useContentHidden = useContentHidden;
4
+ exports.default = ContentHiddenProvider;
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var ContentHiddenContext = (0, react_1.createContext)({
8
+ isHidden: false,
9
+ setIsHidden: function () { },
10
+ });
11
+ function useContentHidden() {
12
+ var context = (0, react_1.useContext)(ContentHiddenContext);
13
+ if (!context) {
14
+ throw new Error("useContentHidden must be used within a ContentHiddenProvider");
15
+ }
16
+ return context;
17
+ }
18
+ function ContentHiddenProvider(_a) {
19
+ var children = _a.children;
20
+ var _b = (0, react_1.useState)(false), isHidden = _b[0], setIsHidden = _b[1];
21
+ return (0, jsx_runtime_1.jsx)(ContentHiddenContext.Provider, { value: { isHidden: isHidden, setIsHidden: setIsHidden }, children: children });
22
+ }
@@ -18,6 +18,7 @@ var SwapProvider_1 = __importDefault(require("../SwapProvider"));
18
18
  var WalletDataProviderNoImport_1 = __importDefault(require("../WalletDataProviderNoImport"));
19
19
  var WalletDataProvider_1 = __importDefault(require("../WalletDataProvider"));
20
20
  var ThemeProvider_1 = require("../ThemeProvider");
21
+ var ContentHiddenProvider_1 = __importDefault(require("../ContentHiddenProvider"));
21
22
  var initialTekWalletContext = {
22
23
  isSSO: undefined,
23
24
  };
@@ -29,6 +30,6 @@ function TekWalletProvider(_a) {
29
30
  var onDisconnect = function () {
30
31
  setResetTrigger(function (prev) { return prev + "1"; });
31
32
  };
32
- return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
33
+ return ((0, jsx_runtime_1.jsx)(ContentHiddenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }) }));
33
34
  }
34
35
  exports.default = TekWalletProvider;
@@ -48,6 +48,12 @@ var validateWalletAddressService = function (body) { return __awaiter(void 0, vo
48
48
  switch (_b.label) {
49
49
  case 0:
50
50
  _b.trys.push([0, 2, , 3]);
51
+ if (!body.address || !body.network) {
52
+ return [2 /*return*/, {
53
+ message: type_1.ValidateWalletAddressResultMessage.ERROR,
54
+ data: undefined,
55
+ }];
56
+ }
51
57
  return [4 /*yield*/, userClientRequest_1.default.get("/crypto/validate-address/".concat(body.network, "?address=").concat(body.address))];
52
58
  case 1:
53
59
  response = _b.sent();
@@ -24,6 +24,8 @@ declare const theme: {
24
24
  secondary16: string;
25
25
  error: string;
26
26
  error16: string;
27
+ tertiary: string;
28
+ accent3: string;
27
29
  };
28
30
  border: {
29
31
  white: string;
@@ -37,6 +39,7 @@ declare const theme: {
37
39
  secondary: string;
38
40
  secondary16: string;
39
41
  accent: string;
42
+ accent3: string;
40
43
  };
41
44
  text: {
42
45
  white: string;
@@ -58,6 +61,7 @@ declare const theme: {
58
61
  increase: string;
59
62
  decrease: string;
60
63
  warningStatus: string;
64
+ alertStatus: string;
61
65
  };
62
66
  divider: string;
63
67
  };
@@ -43,6 +43,8 @@ var background = {
43
43
  secondary16: "#C5E99F29",
44
44
  error: "#FE6565",
45
45
  error16: "rgba(254, 101, 101, 0.16)",
46
+ tertiary: "#ECF4E9",
47
+ accent3: "#E5E6E6",
46
48
  };
47
49
  var border = {
48
50
  white: "#ffffff",
@@ -56,6 +58,7 @@ var border = {
56
58
  secondary: "#01FFFF",
57
59
  secondary16: "rgba(1, 255, 255, 0.16)",
58
60
  accent: "#A3A3A3",
61
+ accent3: "#E5E6E6",
59
62
  };
60
63
  var text = {
61
64
  white: "#ffffff",
@@ -77,6 +80,7 @@ var text = {
77
80
  increase: "#01FF00",
78
81
  decrease: "#FE6565",
79
82
  warningStatus: "#FFA500",
83
+ alertStatus: "#1EA031",
80
84
  };
81
85
  var gaps = {
82
86
  g2: "0.125rem",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.628",
3
+ "version": "0.0.630",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",