tek-wallet 0.0.763 → 0.0.765
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TekWallet/components/index.d.ts +2 -0
- package/dist/components/TekWallet/components/index.js +2 -0
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.d.ts +6 -0
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.js +2 -2
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/style.d.ts +2 -0
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/style.js +9 -0
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.js +6 -6
- package/dist/components/TekWallet/components/ui/ActivityDetail/index.js +5 -4
- package/dist/components/TekWallet/components/ui/ActivityItem/index.js +2 -2
- package/dist/components/TekWallet/components/ui/AnalyticGroupCenter/index.js +1 -1
- package/dist/components/TekWallet/components/ui/Button/index.js +2 -2
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +6 -7
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.js +7 -4
- package/dist/components/TekWallet/components/ui/DelayMounted/index.js +1 -1
- package/dist/components/TekWallet/components/ui/DetailSwapResult/index.js +6 -6
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +1 -1
- package/dist/components/TekWallet/components/ui/NetworkSelection/index.js +3 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +126 -107
- package/dist/components/TekWallet/components/ui/ScanQRToSend/index.js +7 -2
- package/dist/components/TekWallet/components/ui/SmartList/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/SmartList/index.js +2 -2
- package/dist/components/TekWallet/components/ui/SwapFunction/index.js +37 -38
- package/dist/components/TekWallet/components/ui/TokenSelection/index.js +1 -1
- package/dist/components/TekWallet/components/ui/WaitingData/index.js +7 -6
- package/dist/components/TekWallet/components/views/ActivityView/index.js +5 -2
- package/dist/components/TekWallet/components/views/AssetView/index.js +16 -6
- package/dist/components/TekWallet/components/views/NotFoundView/index.js +31 -1
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +102 -77
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +1 -7
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +60 -59
- package/dist/components/TekWallet/components/views/SendInternalView/index.js +2 -2
- package/dist/components/TekWallet/components/views/SettingView/index.js +44 -2
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/FromCardSkeleton.d.ts +2 -0
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/FromCardSkeleton.js +27 -0
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.d.ts +3 -2
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.js +22 -24
- package/dist/components/TekWallet/components/views/SwapView/components/{CardTo → ToCard}/index.d.ts +2 -2
- package/dist/components/TekWallet/components/views/SwapView/components/{CardTo → ToCard}/index.js +2 -2
- package/dist/components/TekWallet/components/views/SwapView/index.d.ts +1 -10
- package/dist/components/TekWallet/components/views/SwapView/index.js +41 -59
- package/dist/components/TekWallet/components/views/TekWalletView/index.js +2 -2
- package/dist/components/TekWallet/hooks/useEventHandler.js +2 -2
- package/dist/components/TekWallet/providers/ActivitiesProvider/const.d.ts +1 -1
- package/dist/components/TekWallet/providers/ActivitiesProvider/const.js +1 -1
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +3 -3
- package/dist/components/TekWallet/providers/RealtimeProvider/index.js +5 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +6 -0
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +7 -1
- package/dist/components/TekWallet/services/axios/get-swap-tokens-list-service/type.d.ts +1 -0
- package/dist/components/TekWallet/services/axios/type.d.ts +1 -0
- package/dist/components/TekWallet/theme/mui/theme.js +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SxProps } from "@mui/material";
|
|
2
2
|
import { TransactionType } from "../../../services/axios/get-activities-service/type";
|
|
3
|
+
import { SmartListProps } from "../SmartList";
|
|
3
4
|
export interface ActivitiesTypeSlicePropsType {
|
|
4
5
|
type: TransactionType;
|
|
5
6
|
isActive?: boolean;
|
|
6
7
|
limitItems?: number;
|
|
7
8
|
sx?: SxProps;
|
|
9
|
+
smartListProps?: Partial<SmartListProps>;
|
|
8
10
|
}
|
|
9
11
|
export declare enum Status {
|
|
10
12
|
Loading = "loading",
|
|
@@ -38,7 +38,7 @@ function ActivitiesTypeSlice(props) {
|
|
|
38
38
|
var _a, _b;
|
|
39
39
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
40
40
|
var _c = (0, useActivities_1.default)(), activities = _c.activities, loadActivities = _c.loadActivities, loadOutActivityType = _c.loadOutActivityType;
|
|
41
|
-
var type = props.type, isActive = props.isActive, limitItems = props.limitItems, sx = props.sx;
|
|
41
|
+
var type = props.type, isActive = props.isActive, limitItems = props.limitItems, sx = props.sx, smartListProps = props.smartListProps;
|
|
42
42
|
var options = (0, TekWalletProvider_1.useWalletConfig)().options;
|
|
43
43
|
var basePath = (options || {}).basePath;
|
|
44
44
|
var activitiesByType = (0, react_1.useMemo)(function () {
|
|
@@ -61,14 +61,14 @@ function ActivitiesTypeSlice(props) {
|
|
|
61
61
|
var loadMore = (0, react_1.useCallback)(function () {
|
|
62
62
|
loadActivities(type.slug);
|
|
63
63
|
}, [loadActivities, type.slug]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", height: "100%", display: "flex"
|
|
65
|
-
((activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.length) || 0) < (limitItems || Infinity), loadingComponent: (0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton:
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", height: "100%", display: "flex" }, sx), children: [status === Status.Loading && ((0, jsx_runtime_1.jsx)(WaitingData_1.default, { sx: { marginBottom: "auto", p: theme.mixins.customPadding.p16 } })), status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { marginBottom: "auto", marginTop: "4rem" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(SmartList_1.default, { loadMoreData: loadMore, sx: __assign({ px: theme.mixins.customPadding.p16 }, smartListProps === null || smartListProps === void 0 ? void 0 : smartListProps.sx), hasMore: !loadOutActivityType[type.slug] &&
|
|
65
|
+
((activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.length) || 0) < (limitItems || Infinity), loadingComponent: (0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton: 4, sx: {
|
|
66
|
+
marginTop: theme.mixins.customMargin.m12,
|
|
67
|
+
} }), bodySx: __assign({ pb: theme.mixins.customPadding.p32, pt: theme.mixins.customPadding.p16 }, smartListProps === null || smartListProps === void 0 ? void 0 : smartListProps.bodySx), children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: (_b = activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.slice(0, limitItems)) === null || _b === void 0 ? void 0 : _b.map(function (activity, index) {
|
|
66
68
|
if (!activity)
|
|
67
69
|
return null;
|
|
68
70
|
var dataAsJson = JSON.stringify(activity);
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(ActivityItem_1.default
|
|
70
|
-
// onClick={() => openDetail(activity)}
|
|
71
|
-
, { data: dataAsJson, component: link_1.default, href: "".concat(basePath || "", "/tek-wallet/activity/").concat(activity.id) }, index));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(ActivityItem_1.default, { data: dataAsJson, component: link_1.default, href: "".concat(basePath || "", "/tek-wallet/activity/").concat(activity.id) }, activity.id + index));
|
|
72
72
|
}) }) }) }))] }));
|
|
73
73
|
}
|
|
74
74
|
exports.default = ActivitiesTypeSlice;
|
|
@@ -26,6 +26,7 @@ var Text_1 = __importDefault(require("../Text"));
|
|
|
26
26
|
var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
|
|
27
27
|
var CopyTextComponent_1 = __importDefault(require("../CopyTextComponent"));
|
|
28
28
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
29
|
+
var SvgPath_1 = require("../SvgPath");
|
|
29
30
|
function ActivityDetail(props) {
|
|
30
31
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
31
32
|
var activityData = props.activityData;
|
|
@@ -37,12 +38,12 @@ function ActivityDetail(props) {
|
|
|
37
38
|
var slug = (0, react_2.useMemo)(function () {
|
|
38
39
|
return type === null || type === void 0 ? void 0 : type.slug;
|
|
39
40
|
}, [type]);
|
|
40
|
-
var isIncrease = (0, react_2.useMemo)(function () {
|
|
41
|
-
return slug === type_1.TransactionSlug.DEPOSIT;
|
|
42
|
-
}, [slug]);
|
|
43
41
|
var isReceive = (0, react_2.useMemo)(function () {
|
|
44
42
|
return slug === type_1.TransactionSlug.RECEIVE || slug === type_1.TransactionSlug.DEPOSIT;
|
|
45
43
|
}, [slug]);
|
|
44
|
+
var isIncrease = (0, react_2.useMemo)(function () {
|
|
45
|
+
return isReceive;
|
|
46
|
+
}, [isReceive]);
|
|
46
47
|
var isSwap = (0, react_2.useMemo)(function () {
|
|
47
48
|
return slug === type_1.TransactionSlug.SWAP;
|
|
48
49
|
}, [slug]);
|
|
@@ -90,6 +91,6 @@ function ActivityDetail(props) {
|
|
|
90
91
|
fontSize: theme.typography.fontSize12,
|
|
91
92
|
textTransform: "capitalize",
|
|
92
93
|
color: getStatusColor(),
|
|
93
|
-
}, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: 0, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.from_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "From" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "left" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] }) })), !!toAddress && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: toAddress, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Recipient address" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "left" }), children: toAddress })] }) }))] })] }));
|
|
94
|
+
}, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: 0, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.from_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "From" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g24, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "left" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16 }, children: SvgPath_1.IC_COPY })] })] }) })), !!toAddress && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: toAddress, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Recipient address" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g24, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "left" }), children: toAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16 }, children: SvgPath_1.IC_COPY })] })] }) }))] })] }));
|
|
94
95
|
}
|
|
95
96
|
exports.default = ActivityDetail;
|
|
@@ -92,10 +92,10 @@ function ActivityItem(props) {
|
|
|
92
92
|
}, [isIncrease, theme]);
|
|
93
93
|
if (!activityData)
|
|
94
94
|
return null;
|
|
95
|
-
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.tertiary, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.
|
|
95
|
+
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.tertiary, borderRadius: theme.mixins.customRadius.r16, backdropFilter: "blur(12px)", p: theme.mixins.customPadding.p16, flexGrow: "unset" }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
96
96
|
width: "fit-content",
|
|
97
97
|
height: "fit-content",
|
|
98
|
-
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 28, sx: { borderRadius: theme.mixins.customRadius.full } }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.
|
|
98
|
+
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 28, sx: { borderRadius: theme.mixins.customRadius.full } }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (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, { size: 12, sx: {
|
|
99
99
|
color: theme.palette.text.loadingStatus,
|
|
100
100
|
} })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
101
101
|
fontSize: theme.typography.fontSize12,
|
|
@@ -52,7 +52,7 @@ var AnalyticGroup = function (props) {
|
|
|
52
52
|
fontSize: theme.typography.fontSize12,
|
|
53
53
|
}, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { alignItems: "baseline", fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.g2 }), children: isShowBalance ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { sx: { fontWeight: theme.typography.fontWeight700 }, value: totalBalanceInUSD, unit: "USD", hideUnitOutSide: true }), !!totalBalanceInUSD && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
54
54
|
fontWeight: theme.typography.fontWeight400,
|
|
55
|
-
fontSize: "
|
|
55
|
+
fontSize: "1em",
|
|
56
56
|
}, children: "$" }), false && ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 8, height: 8 }, children: SvgPath_1.ARROW_DROP_DOWN }))] }))] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
57
57
|
fontSize: theme.typography.fontSize24,
|
|
58
58
|
fontWeight: theme.typography.fontWeight700,
|
|
@@ -40,7 +40,7 @@ var Button = function (props) {
|
|
|
40
40
|
};
|
|
41
41
|
Button.displayName = "Button";
|
|
42
42
|
Button.Primary = function (props) {
|
|
43
|
-
var children = props.children, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, sx = props.sx, rest = __rest(props, ["children", "status", "sx"]);
|
|
43
|
+
var children = props.children, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, sx = props.sx, loading = props.loading, rest = __rest(props, ["children", "status", "sx", "loading"]);
|
|
44
44
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
45
45
|
// const disabledStyles: Record<string, SxProps> = {
|
|
46
46
|
// [BUTTON_STATUS.LOADING]: {
|
|
@@ -56,7 +56,7 @@ Button.Primary = function (props) {
|
|
|
56
56
|
// color: theme.palette.text.white24,
|
|
57
57
|
// },
|
|
58
58
|
// };
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p12, fontWeight: theme.typography.fontWeight500, fontSize: theme.typography.fontSize14, lineHeight: theme.typography.leading100 }, sx), disabled: status !== BUTTON_STATUS.ENABLED, children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p12, fontWeight: theme.typography.fontWeight500, fontSize: theme.typography.fontSize14, lineHeight: theme.typography.leading100 }, sx), disabled: status !== BUTTON_STATUS.ENABLED, loading: loading || status === BUTTON_STATUS.LOADING, children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
60
60
|
position: "absolute",
|
|
61
61
|
inset: 0,
|
|
62
62
|
display: "flex",
|
|
@@ -96,7 +96,6 @@ var xhub_keyboard_1 = require("xhub-keyboard");
|
|
|
96
96
|
var useUniqueId_1 = require("../../../hooks/useUniqueId");
|
|
97
97
|
var xhub_keyboard_2 = require("xhub-keyboard");
|
|
98
98
|
var useWarningWrongPasscode_1 = require("../../../hooks/useWarningWrongPasscode");
|
|
99
|
-
var clsx_1 = __importDefault(require("clsx"));
|
|
100
99
|
var passcodeLength = 6;
|
|
101
100
|
var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
102
101
|
var onConfirmSuccess = props.onConfirmSuccess, sx = props.sx;
|
|
@@ -187,13 +186,13 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
187
186
|
case 5: return [2 /*return*/];
|
|
188
187
|
}
|
|
189
188
|
});
|
|
190
|
-
}); }, [handleClose, onConfirmSuccess, passcode]);
|
|
189
|
+
}); }, [handleClose, handleVerifyPasscode, onConfirmSuccess, passcode]);
|
|
191
190
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
|
|
192
191
|
width: "100%",
|
|
193
|
-
}, useBrowserInput: false, htmlFor: keyboardId, children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, triggerStatus: props.triggerStatus, sx: __assign({ width: "100%", maxWidth: "calc(100dvw - 2rem)", display: "flex" }, sx), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: passcode, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer,
|
|
194
|
-
keyboardContainer:
|
|
195
|
-
"
|
|
196
|
-
}
|
|
192
|
+
}, useBrowserInput: false, htmlFor: keyboardId, children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, triggerStatus: props.triggerStatus, sx: __assign({ width: "100%", maxWidth: "calc(100dvw - 2rem)", display: "flex" }, sx), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: passcode, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, styles: {
|
|
193
|
+
keyboardContainer: {
|
|
194
|
+
display: isLocked ? "none" : "block",
|
|
195
|
+
},
|
|
197
196
|
}, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
|
|
198
197
|
backgroundColor: "transparent",
|
|
199
198
|
width: "100%",
|
|
@@ -204,7 +203,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
204
203
|
backgroundColor: theme.palette.background.tertiary,
|
|
205
204
|
}, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "0.75rem", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
|
|
206
205
|
width: "100%",
|
|
207
|
-
}, useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { disabled: isLocked, value: passcode, onChange: handlePasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), warningContent, unknownError] }) }) }) }) }));
|
|
206
|
+
}, useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { disabled: isLocked, value: passcode, onChange: handlePasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), !isLocked && warningContent, unknownError] }) }) }) }) }));
|
|
208
207
|
});
|
|
209
208
|
ConfirmByPasscode.displayName = "ConfirmByPasscode";
|
|
210
209
|
exports.default = ConfirmByPasscode;
|
|
@@ -28,12 +28,13 @@ var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
|
28
28
|
var InlineTitleValue_1 = __importDefault(require("../InlineTitleValue"));
|
|
29
29
|
var convertTokensRate_1 = __importDefault(require("../../views/SwapView/functions/convertTokensRate"));
|
|
30
30
|
function Result(props) {
|
|
31
|
+
var _a;
|
|
31
32
|
var theme = (0, providers_1.useTheme)();
|
|
32
33
|
var formatDate = (0, useFormatter_1.default)().formatDate;
|
|
33
34
|
var transaction = props.transaction, onDone = props.onDone;
|
|
34
35
|
var status = (0, react_1.useMemo)(function () { return (transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status) || "failed"; }, [transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status]);
|
|
35
36
|
var amount = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.amount; }, [transaction === null || transaction === void 0 ? void 0 : transaction.amount]);
|
|
36
|
-
var toAmount =
|
|
37
|
+
var toAmount = (0, react_1.useMemo)(function () { var _a; return (_a = transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data) === null || _a === void 0 ? void 0 : _a.swap_total_amount; }, [(_a = transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data) === null || _a === void 0 ? void 0 : _a.swap_total_amount]);
|
|
37
38
|
var fromToken = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.currency_data; }, [transaction === null || transaction === void 0 ? void 0 : transaction.currency_data]);
|
|
38
39
|
var toToken = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data; }, [transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data]);
|
|
39
40
|
var toTokenRate = (0, react_1.useMemo)(function () {
|
|
@@ -85,11 +86,13 @@ function Result(props) {
|
|
|
85
86
|
width: 20,
|
|
86
87
|
height: 20,
|
|
87
88
|
borderRadius: "999px",
|
|
88
|
-
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "inherit" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }) }), (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_SWAP", sx: {
|
|
89
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "inherit" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { mx: "auto" } }), (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_SWAP", sx: {
|
|
89
90
|
width: 16,
|
|
90
91
|
height: 16,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
position: "absolute",
|
|
93
|
+
left: "50%",
|
|
94
|
+
top: "50%",
|
|
95
|
+
transform: "translate(-50%, -50%) rotate(-90deg)",
|
|
93
96
|
} }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: toToken === null || toToken === void 0 ? void 0 : toToken.link, sx: {
|
|
94
97
|
width: 20,
|
|
95
98
|
height: 20,
|
|
@@ -5,7 +5,7 @@ var react_1 = require("react");
|
|
|
5
5
|
function DelayMounted(_a) {
|
|
6
6
|
var children = _a.children, _b = _a.delay, delay = _b === void 0 ? 1000 : _b;
|
|
7
7
|
var _c = (0, react_1.useState)(false), allowMount = _c[0], setAllowMount = _c[1];
|
|
8
|
-
(0, react_1.
|
|
8
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
9
9
|
var timeout = setTimeout(function () {
|
|
10
10
|
setAllowMount(true);
|
|
11
11
|
}, delay);
|
|
@@ -28,7 +28,7 @@ var LineValue_1 = __importDefault(require("../LineValue"));
|
|
|
28
28
|
var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
|
|
29
29
|
var roundToTwoSignificantDecimals_1 = __importDefault(require("../../../utils/roundToTwoSignificantDecimals"));
|
|
30
30
|
var DetailSwapResult = function (_a) {
|
|
31
|
-
var _b, _c
|
|
31
|
+
var _b, _c;
|
|
32
32
|
var onClose = _a.onClose, swapData = _a.swapData;
|
|
33
33
|
var transaction = (0, useWallet_1.default)().transaction;
|
|
34
34
|
var theme = (0, providers_1.useTheme)();
|
|
@@ -38,7 +38,7 @@ var DetailSwapResult = function (_a) {
|
|
|
38
38
|
return ((_b = (_a = resultData === null || resultData === void 0 ? void 0 : resultData.fee_info) === null || _a === void 0 ? void 0 : _a.fee_detail) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item === null || item === void 0 ? void 0 : item.currency; })) || [];
|
|
39
39
|
}, [resultData]);
|
|
40
40
|
var getOutputs = feeInfo === null || feeInfo === void 0 ? void 0 : feeInfo.map(function (item) { return item === null || item === void 0 ? void 0 : item.outputs; });
|
|
41
|
-
var getDetailOutputs = ((
|
|
41
|
+
var getDetailOutputs = (0, react_1.useMemo)(function () { var _a; return ((_a = getOutputs === null || getOutputs === void 0 ? void 0 : getOutputs[0]) === null || _a === void 0 ? void 0 : _a.map(function (item) { return item; })) || []; }, [getOutputs]);
|
|
42
42
|
var getInfoDetailOutputs = (0, react_1.useMemo)(function () {
|
|
43
43
|
return (getDetailOutputs === null || getDetailOutputs === void 0 ? void 0 : getDetailOutputs[0]) || {};
|
|
44
44
|
}, [getDetailOutputs]);
|
|
@@ -90,13 +90,13 @@ var DetailSwapResult = function (_a) {
|
|
|
90
90
|
width: "100%",
|
|
91
91
|
color: theme.palette.text.accent,
|
|
92
92
|
mt: theme.mixins.customMargin.m12,
|
|
93
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between", mt: theme.mixins.customMargin.m16 }), 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: (
|
|
93
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between", mt: theme.mixins.customMargin.m16 }), 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: (_b = resultData === null || resultData === void 0 ? void 0 : resultData.currency_data) === null || _b === void 0 ? void 0 : _b.link, width: 20, height: 20, className: "rounded-full" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
94
94
|
fontSize: theme.typography.fontSize14,
|
|
95
95
|
fontWeight: theme.typography.fontWeight700,
|
|
96
|
-
}, children: resultData === null || resultData === void 0 ? void 0 : resultData.amount })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("swap_horizontal"), width: 20, height: 20 }), (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: getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.link, width: 20, height: 20, className: "rounded-full" }), (0, jsx_runtime_1.
|
|
96
|
+
}, children: resultData === null || resultData === void 0 ? void 0 : resultData.amount })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("swap_horizontal"), width: 20, height: 20 }), (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: getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.link, width: 20, height: 20, className: "rounded-full" }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: {
|
|
97
97
|
fontSize: theme.typography.fontSize14,
|
|
98
98
|
fontWeight: theme.typography.fontWeight700,
|
|
99
|
-
}, children: (0, roundToTwoSignificantDecimals_1.default)(
|
|
99
|
+
}, children: [(0, roundToTwoSignificantDecimals_1.default)(getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.swap_total_amount), "cc"] })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
100
100
|
width: "100%",
|
|
101
101
|
color: theme.palette.text.accent,
|
|
102
102
|
mt: theme.mixins.customMargin.m12,
|
|
@@ -110,7 +110,7 @@ var DetailSwapResult = function (_a) {
|
|
|
110
110
|
fontSize: theme.typography.fontSize14,
|
|
111
111
|
fontWeight: theme.typography.fontWeight700,
|
|
112
112
|
ml: theme.mixins.customMargin.m8,
|
|
113
|
-
}, children: ["1 ", (
|
|
113
|
+
}, children: ["1 ", (_c = resultData === null || resultData === void 0 ? void 0 : resultData.currency_data) === null || _c === void 0 ? void 0 : _c.full_name, " ~ ", getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.swap_amount, " ", getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.full_name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
114
114
|
fontSize: theme.typography.fontSize12,
|
|
115
115
|
color: theme.palette.text.blackContrast,
|
|
116
116
|
}, children: "Date time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
@@ -33,7 +33,7 @@ var SvgPath_1 = require("../SvgPath");
|
|
|
33
33
|
function ListItemCustom(_a) {
|
|
34
34
|
var title = _a.title, description = _a.description, icon = _a.icon, rightIcon = _a.rightIcon, hideDefaultRightIcon = _a.hideDefaultRightIcon, sx = _a.sx, recommended = _a.recommended, hideTag = _a.hideTag, rest = __rest(_a, ["title", "description", "icon", "rightIcon", "hideDefaultRightIcon", "sx", "recommended", "hideTag"]);
|
|
35
35
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({}, rest, { sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, padding: "calc(".concat(theme.mixins.customPadding.p16, " + 6px) ").concat(theme.mixins.customPadding.p16), border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, backgroundColor: theme.palette.background.white, position: "relative", overflow: "hidden" }), sx), children: [!hideTag && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
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: "calc(".concat(theme.mixins.customPadding.p16, " + 6px) ").concat(theme.mixins.customPadding.p16), border: "1px solid ".concat(theme.palette.border.accent3), borderRadius: theme.mixins.customRadius.r16, backgroundColor: theme.palette.background.white, backdropFilter: "blur(12px)", position: "relative", overflow: "hidden" }), sx), children: [!hideTag && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
37
37
|
position: "absolute",
|
|
38
38
|
top: "-9px",
|
|
39
39
|
left: "-1px",
|
|
@@ -40,6 +40,8 @@ var NetworkSelection = function (props) {
|
|
|
40
40
|
var networkData = (0, react_1.useMemo)(function () { return (0, parsePropsData_1.default)(networkDataString); }, [networkDataString]);
|
|
41
41
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({}, rest, { sx: __assign(__assign({}, theme.mixins.row), { backgroundColor: active
|
|
42
42
|
? "".concat(theme.palette.background.tertiary)
|
|
43
|
-
: "".concat(theme.palette.background.white), padding: theme.mixins.customPadding.p16, borderRadius: theme.mixins.customRadius.
|
|
43
|
+
: "".concat(theme.palette.background.white), backdropFilter: "blur(12px)", padding: theme.mixins.customPadding.p16, borderRadius: theme.mixins.customRadius.r16, 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 () {
|
|
44
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(networkData);
|
|
45
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkData === null || networkData === void 0 ? void 0 : networkData.link, sx: { borderRadius: theme.mixins.customRadius.full }, width: 24 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "text.white", whiteSpace: "nowrap", textTransform: "capitalize" }), children: networkData === null || networkData === void 0 ? void 0 : networkData.name }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13, fontWeight: theme.typography.fontWeight400 }), children: ["Minimum transaction amount:", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: networkData === null || networkData === void 0 ? void 0 : networkData.min_value, unit: token === null || token === void 0 ? void 0 : token.name }) })] })] })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: active ? SvgPath_1.IC_CHECK : SvgPath_1.IC_UNCHECK })] })));
|
|
44
46
|
};
|
|
45
47
|
exports.default = NetworkSelection;
|