tek-wallet 0.0.635 → 0.0.637

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.
@@ -193,6 +193,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
193
193
  return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: handleOnOpen, onClose: handleOnClose, sx: {
194
194
  width: "100%",
195
195
  maxWidth: "calc(100dvw - 2rem)",
196
+ display: "flex",
196
197
  }, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
197
198
  backgroundColor: "transparent",
198
199
  width: "100%",
@@ -75,7 +75,7 @@ function Fees(props) {
75
75
  if (!isNotEnoughBalanceToPayFee) {
76
76
  setIsEnoughBalanceToPayFee === null || setIsEnoughBalanceToPayFee === void 0 ? void 0 : setIsEnoughBalanceToPayFee(!isNotEnoughBalanceToPayFee);
77
77
  }
78
- }, [isNotEnoughBalanceToPayFee]);
78
+ }, [isNotEnoughBalanceToPayFee, setIsEnoughBalanceToPayFee]);
79
79
  var totalfee_in_usd = (0, react_1.useMemo)(function () {
80
80
  return feesData === null || feesData === void 0 ? void 0 : feesData.fee_in_usd;
81
81
  }, [feesData]);
@@ -1,8 +0,0 @@
1
- interface TransferAmountProps {
2
- title?: string;
3
- amount?: number;
4
- link?: string;
5
- currency?: string;
6
- }
7
- export default function TransferAmount(props: TransferAmountProps): import("react/jsx-runtime").JSX.Element;
8
- export type { TransferAmountProps };
@@ -1,37 +1,58 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.default = TransferAmount;
18
- var jsx_runtime_1 = require("react/jsx-runtime");
19
- var material_1 = require("@mui/material");
20
- var material_2 = require("@mui/material");
21
- var Icon_1 = __importDefault(require("../../Icon"));
22
- var ThemeProvider_1 = require("../../../../providers/ThemeProvider");
23
- var Formatter_1 = __importDefault(require("../../Formatter"));
24
- var Text_1 = __importDefault(require("../../Text"));
25
- function TransferAmount(props) {
26
- var theme = (0, ThemeProvider_1.useTheme)();
27
- var title = props.title, amount = props.amount, currency = props.currency;
28
- return ((0, jsx_runtime_1.jsxs)(material_2.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "center", marginTop: theme.mixins.customMargin.m16, marginBottom: theme.mixins.customMargin.m12, gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.sessionDescription), { textTransform: "capitalize" }), children: title }), (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, sx: {
29
- color: theme.palette.text.primary,
30
- fontSize: theme.typography.fontSize24,
31
- fontWeight: theme.typography.fontWeight600,
32
- } }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 0.5, children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: props.link, width: 16, height: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
33
- fontWeight: theme.typography.fontWeight500,
34
- fontSize: theme.typography.fontSize15,
35
- color: theme.palette.text.accent2,
36
- }, children: currency })] })] }));
37
- }
2
+ // import { Stack } from "@mui/material";
3
+ // import { Box } from "@mui/material";
4
+ // import Icon from "../../Icon";
5
+ // import { useTheme } from "../../../../providers/ThemeProvider";
6
+ // import Formatter from "../../Formatter";
7
+ // import Text from "../../Text";
8
+ // interface TransferAmountProps {
9
+ // title?: string;
10
+ // amount?: number;
11
+ // link?: string;
12
+ // currency?: string;
13
+ // }
14
+ // export default function TransferAmount(props: TransferAmountProps) {
15
+ // const theme = useTheme();
16
+ // const { title, amount, currency } = props;
17
+ // return (
18
+ // <Box
19
+ // sx={{
20
+ // ...theme.mixins.column,
21
+ // alignItems: "center",
22
+ // marginTop: theme.mixins.customMargin.m16,
23
+ // marginBottom: theme.mixins.customMargin.m12,
24
+ // gap: theme.mixins.gaps.g4,
25
+ // }}
26
+ // >
27
+ // <Text
28
+ // sx={{
29
+ // ...theme.mixins.sessionDescription,
30
+ // textTransform: "capitalize",
31
+ // }}
32
+ // >
33
+ // {title}
34
+ // </Text>
35
+ // <Formatter
36
+ // value={amount}
37
+ // sx={{
38
+ // color: theme.palette.text.primary,
39
+ // fontSize: theme.typography.fontSize24,
40
+ // fontWeight: theme.typography.fontWeight600,
41
+ // }}
42
+ // />
43
+ // <Stack direction={"row"} alignItems={"center"} gap={0.5}>
44
+ // <Icon src={props.link} width={16} height={16} />
45
+ // <Text
46
+ // sx={{
47
+ // fontWeight: theme.typography.fontWeight500,
48
+ // fontSize: theme.typography.fontSize15,
49
+ // color: theme.palette.text.accent2,
50
+ // }}
51
+ // >
52
+ // {currency}
53
+ // </Text>
54
+ // </Stack>
55
+ // </Box>
56
+ // );
57
+ // }
58
+ // export type { TransferAmountProps };
@@ -1,11 +0,0 @@
1
- import { TransferInternalData } from "..";
2
- import { FeesDataType } from "../../../../services/axios/get-est-fee-service/type";
3
- interface TransferInfoProps {
4
- transferData: TransferInternalData;
5
- estimateFee?: FeesDataType;
6
- amount?: number;
7
- tokenSlug?: string;
8
- setIsEnoughBalanceToPayFee: (isEnough: boolean) => void;
9
- }
10
- export default function TransferInfo(props: TransferInfoProps): import("react/jsx-runtime").JSX.Element;
11
- export type { TransferInfoProps };
@@ -1,81 +1,152 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.default = TransferInfo;
18
- var jsx_runtime_1 = require("react/jsx-runtime");
19
- var IconText_1 = __importDefault(require("../../../ui/IconText"));
20
- var LineValue_1 = __importDefault(require("../../LineValue"));
21
- var material_1 = require("@mui/material");
22
- var Fees_1 = __importDefault(require("../../Fees"));
23
- var Text_1 = __importDefault(require("../../Text"));
24
- var safeText_1 = require("../../../../utils/safeText");
25
- var Icon_1 = __importDefault(require("../../Icon"));
26
- var CopyTextComponent_1 = __importDefault(require("../../CopyTextComponent"));
27
- var getIcon_1 = __importDefault(require("../../../../utils/getIcon"));
28
- var providers_1 = require("../../../../providers");
29
- function TransferInfo(props) {
30
- var _a, _b, _c, _d, _e, _f, _g;
31
- var transferData = props.transferData, estimateFee = props.estimateFee, amount = props.amount, tokenSlug = props.tokenSlug, setIsEnoughBalanceToPayFee = props.setIsEnoughBalanceToPayFee;
32
- var theme = (0, providers_1.useTheme)();
33
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: (_a = theme.mixins.gaps) === null || _a === void 0 ? void 0 : _a.g12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
34
- fontWeight: theme.typography.fontWeight700,
35
- color: theme.palette.primary.contrastText,
36
- fontSize: theme.typography.fontSize18,
37
- marginTop: (_b = theme.mixins.customMargin) === null || _b === void 0 ? void 0 : _b.m12,
38
- }, children: "transferSummary" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: (_c = theme.mixins.gaps) === null || _c === void 0 ? void 0 : _c.g12 }), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "transferTo", sxField: {
39
- fontSize: theme.typography.fontSize11,
40
- fontWeight: theme.typography.fontWeight500,
41
- color: theme.palette.text.darkContrast,
42
- }, value: (0, jsx_runtime_1.jsx)(IconText_1.default, { title: (0, safeText_1.safeText)((_d = transferData.receiver) === null || _d === void 0 ? void 0 : _d.nick_name), sx: {
43
- fontSize: theme.typography.fontSize14,
44
- fontWeight: theme.typography.fontWeight700,
45
- }, beforeIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_e = transferData.receiver) === null || _e === void 0 ? void 0 : _e.avatar, width: 16, height: 16 }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "network", sxField: {
46
- fontSize: theme.typography.fontSize11,
47
- fontWeight: theme.typography.fontWeight500,
48
- color: theme.palette.text.darkContrast,
49
- }, value: (0, jsx_runtime_1.jsx)(IconText_1.default, { title: (0, safeText_1.safeText)(transferData.network), sx: {
50
- fontSize: theme.typography.fontSize14,
51
- fontWeight: theme.typography.fontWeight700,
52
- }, beforeIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: transferData.link, width: 16, height: 16, isRounded: true }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "address", sxField: {
53
- fontSize: theme.typography.fontSize11,
54
- fontWeight: theme.typography.fontWeight500,
55
- color: theme.palette.text.darkContrast,
56
- }, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: transferData.to_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: (_f = theme.mixins.gaps) === null || _f === void 0 ? void 0 : _f.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
57
- fontSize: theme.typography.fontSize14,
58
- fontWeight: theme.typography.fontWeight700,
59
- }, children: (0, safeText_1.safeText)(transferData.to_address, { isShort: true }) }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("ic_copy") })] }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "type", sxField: {
60
- fontSize: theme.typography.fontSize11,
61
- fontWeight: theme.typography.fontWeight500,
62
- color: theme.palette.text.darkContrast,
63
- }, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
64
- fontSize: theme.typography.fontSize14,
65
- fontWeight: theme.typography.fontWeight700,
66
- }, children: (0, safeText_1.safeText)(transferData.type) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "message", sxField: {
67
- fontSize: theme.typography.fontSize11,
68
- fontWeight: theme.typography.fontWeight500,
69
- color: theme.palette.text.darkContrast,
70
- }, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
71
- fontSize: theme.typography.fontSize14,
72
- fontWeight: theme.typography.fontWeight700,
73
- }, children: (0, safeText_1.safeText)(transferData.message) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "datetime", sxField: {
74
- fontSize: theme.typography.fontSize11,
75
- fontWeight: theme.typography.fontWeight500,
76
- color: theme.palette.text.darkContrast,
77
- }, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
78
- fontSize: theme.typography.fontSize14,
79
- fontWeight: theme.typography.fontWeight700,
80
- }, children: (0, safeText_1.safeDateTimeText)(transferData.datetime) }) }), ((_g = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.fee_detail) === null || _g === void 0 ? void 0 : _g.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug !== null && tokenSlug !== void 0 ? tokenSlug : "", setIsEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee }))] })] }));
81
- }
2
+ // import IconText from "../../../ui/IconText";
3
+ // import LineValue from "../../LineValue";
4
+ // import { Box } from "@mui/material";
5
+ // import { TransferInternalData } from "..";
6
+ // import { FeesDataType } from "../../../../services/axios/get-est-fee-service/type";
7
+ // import Text from "../../Text";
8
+ // import { safeDateTimeText, safeText } from "../../../../utils/safeText";
9
+ // import Icon from "../../Icon";
10
+ // import CopyTextComponent from "../../CopyTextComponent";
11
+ // import getIcon from "../../../../utils/getIcon";
12
+ // import { useTheme } from "../../../../providers";
13
+ // interface TransferInfoProps {
14
+ // transferData: TransferInternalData;
15
+ // estimateFee?: FeesDataType;
16
+ // amount?: number;
17
+ // tokenSlug?: string;
18
+ // }
19
+ // export default function TransferInfo(props: TransferInfoProps) {
20
+ // const { transferData, } = props;
21
+ // const theme = useTheme();
22
+ // return (
23
+ // <Box sx={{ ...theme.mixins.column, gap: theme.mixins.gaps?.g12 }}>
24
+ // <Text
25
+ // sx={{
26
+ // fontWeight: theme.typography.fontWeight700,
27
+ // color: theme.palette.primary.contrastText,
28
+ // fontSize: theme.typography.fontSize18,
29
+ // marginTop: theme.mixins.customMargin?.m12,
30
+ // }}
31
+ // >
32
+ // {"transferSummary"}
33
+ // </Text>
34
+ // <Box sx={{ ...theme.mixins.column, gap: theme.mixins.gaps?.g12 }}>
35
+ // <LineValue
36
+ // field={"transferTo"}
37
+ // sxField={{
38
+ // fontSize: theme.typography.fontSize11,
39
+ // fontWeight: theme.typography.fontWeight500,
40
+ // color: theme.palette.text.darkContrast,
41
+ // }}
42
+ // value={
43
+ // <IconText
44
+ // title={safeText(transferData.receiver?.nick_name)}
45
+ // sx={{
46
+ // fontSize: theme.typography.fontSize14,
47
+ // fontWeight: theme.typography.fontWeight700,
48
+ // }}
49
+ // beforeIcon={<Icon src={transferData.receiver?.avatar} width={16} height={16} />}
50
+ // />
51
+ // }
52
+ // />
53
+ // <LineValue
54
+ // field={"network"}
55
+ // sxField={{
56
+ // fontSize: theme.typography.fontSize11,
57
+ // fontWeight: theme.typography.fontWeight500,
58
+ // color: theme.palette.text.darkContrast,
59
+ // }}
60
+ // value={
61
+ // <IconText
62
+ // title={safeText(transferData.network)}
63
+ // sx={{
64
+ // fontSize: theme.typography.fontSize14,
65
+ // fontWeight: theme.typography.fontWeight700,
66
+ // }}
67
+ // beforeIcon={<Icon src={transferData.link} width={16} height={16} isRounded={true} />}
68
+ // />
69
+ // }
70
+ // />
71
+ // <LineValue
72
+ // field={"address"}
73
+ // sxField={{
74
+ // fontSize: theme.typography.fontSize11,
75
+ // fontWeight: theme.typography.fontWeight500,
76
+ // color: theme.palette.text.darkContrast,
77
+ // }}
78
+ // value={
79
+ // <CopyTextComponent value={transferData.to_address}>
80
+ // <Box sx={{ ...theme.mixins.row, gap: theme.mixins.gaps?.g8 }}>
81
+ // <Text
82
+ // sx={{
83
+ // fontSize: theme.typography.fontSize14,
84
+ // fontWeight: theme.typography.fontWeight700,
85
+ // }}
86
+ // >
87
+ // {safeText(transferData.to_address, { isShort: true })}
88
+ // </Text>
89
+ // <Icon src={getIcon("ic_copy")} />
90
+ // </Box>
91
+ // </CopyTextComponent>
92
+ // }
93
+ // />
94
+ // <LineValue
95
+ // field={"type"}
96
+ // sxField={{
97
+ // fontSize: theme.typography.fontSize11,
98
+ // fontWeight: theme.typography.fontWeight500,
99
+ // color: theme.palette.text.darkContrast,
100
+ // }}
101
+ // value={
102
+ // <Text
103
+ // sx={{
104
+ // fontSize: theme.typography.fontSize14,
105
+ // fontWeight: theme.typography.fontWeight700,
106
+ // }}
107
+ // >
108
+ // {safeText(transferData.type)}
109
+ // </Text>
110
+ // }
111
+ // />
112
+ // <LineValue
113
+ // field={"message"}
114
+ // sxField={{
115
+ // fontSize: theme.typography.fontSize11,
116
+ // fontWeight: theme.typography.fontWeight500,
117
+ // color: theme.palette.text.darkContrast,
118
+ // }}
119
+ // value={
120
+ // <Text
121
+ // sx={{
122
+ // fontSize: theme.typography.fontSize14,
123
+ // fontWeight: theme.typography.fontWeight700,
124
+ // }}
125
+ // >
126
+ // {safeText(transferData.message)}
127
+ // </Text>
128
+ // }
129
+ // />
130
+ // <LineValue
131
+ // field={"datetime"}
132
+ // sxField={{
133
+ // fontSize: theme.typography.fontSize11,
134
+ // fontWeight: theme.typography.fontWeight500,
135
+ // color: theme.palette.text.darkContrast,
136
+ // }}
137
+ // value={
138
+ // <Text
139
+ // sx={{
140
+ // fontSize: theme.typography.fontSize14,
141
+ // fontWeight: theme.typography.fontWeight700,
142
+ // }}
143
+ // >
144
+ // {safeDateTimeText(transferData.datetime)}
145
+ // </Text>
146
+ // }
147
+ // />
148
+ // </Box>
149
+ // </Box>
150
+ // );
151
+ // }
152
+ // export type { TransferInfoProps };
@@ -1,6 +0,0 @@
1
- import { TransferInternalData } from "..";
2
- interface TransferTargetProps {
3
- transferData: TransferInternalData;
4
- }
5
- export default function TransferTarget(props: TransferTargetProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,39 +1,65 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.default = TransferTarget;
18
- var jsx_runtime_1 = require("react/jsx-runtime");
19
- var material_1 = require("@mui/material");
20
- var getImage_1 = __importDefault(require("../../../../utils/getImage"));
21
- var UserInfo_1 = __importDefault(require("../../UserInfo"));
22
- var Text_1 = __importDefault(require("../../Text"));
23
- var Icon_1 = __importDefault(require("../../Icon"));
24
- var getIcon_1 = __importDefault(require("../../../../utils/getIcon"));
25
- var providers_1 = require("../../../../providers");
26
- function TransferTarget(props) {
27
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
28
- var transferData = props.transferData;
29
- var theme = (0, providers_1.useTheme)();
30
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: (_a = theme.mixins.gaps) === null || _a === void 0 ? void 0 : _a.g12, padding: (_b = theme.mixins.customPadding) === null || _b === void 0 ? void 0 : _b.p12, borderRadius: (_c = theme.mixins.customRadius) === null || _c === void 0 ? void 0 : _c.r16, backgroundColor: (_d = theme.palette.background) === null || _d === void 0 ? void 0 : _d.primary, backgroundImage: "url(".concat((0, getImage_1.default)("logo_transfer", "png"), ")"), backgroundPosition: "right", backgroundRepeat: "no-repeat" }), children: [(0, jsx_runtime_1.jsx)(UserInfo_1.default, { user: transferData.user, variant: "multiple", rightPart: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
31
- color: (_e = theme.palette.text) === null || _e === void 0 ? void 0 : _e.secondary,
32
- fontWeight: (_f = theme.typography) === null || _f === void 0 ? void 0 : _f.fontWeight500,
33
- fontSize: (_g = theme.typography) === null || _g === void 0 ? void 0 : _g.fontSize13,
34
- }, children: "From" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1.5 items-center", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("ic_transfer") }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-px border-t-[1px] border-t-accent opacity-25 border-dashed" })] }), (0, jsx_runtime_1.jsx)(UserInfo_1.default, { user: transferData.receiver, variant: "multiple", rightPart: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
35
- color: (_h = theme.palette.text) === null || _h === void 0 ? void 0 : _h.secondary,
36
- fontWeight: (_j = theme.typography) === null || _j === void 0 ? void 0 : _j.fontWeight500,
37
- fontSize: (_k = theme.typography) === null || _k === void 0 ? void 0 : _k.fontSize13,
38
- }, children: "To" }) })] }));
39
- }
2
+ // import { Box } from "@mui/material";
3
+ // import { TransferInternalData } from "..";
4
+ // import getImage from "../../../../utils/getImage";
5
+ // import UserInfo from "../../UserInfo";
6
+ // import Text from "../../Text";
7
+ // import Icon from "../../Icon";
8
+ // import getIcon from "../../../../utils/getIcon";
9
+ // import { useTheme } from "../../../../providers";
10
+ // interface TransferTargetProps {
11
+ // transferData: TransferInternalData;
12
+ // }
13
+ // export default function TransferTarget(props: TransferTargetProps) {
14
+ // const { transferData } = props;
15
+ // const theme = useTheme();
16
+ // return (
17
+ // <Box
18
+ // sx={{
19
+ // ...theme.mixins.column,
20
+ // gap: theme.mixins.gaps?.g12,
21
+ // padding: theme.mixins.customPadding?.p12,
22
+ // borderRadius: theme.mixins.customRadius?.r16,
23
+ // backgroundColor: theme.palette.background?.primary,
24
+ // backgroundImage: `url(${getImage("logo_transfer", "png")})`,
25
+ // backgroundPosition: "right",
26
+ // backgroundRepeat: "no-repeat",
27
+ // }}
28
+ // >
29
+ // <UserInfo
30
+ // user={transferData.user}
31
+ // variant="multiple"
32
+ // rightPart={
33
+ // <Text
34
+ // sx={{
35
+ // color: theme.palette.text?.secondary,
36
+ // fontWeight: theme.typography?.fontWeight500,
37
+ // fontSize: theme.typography?.fontSize13,
38
+ // }}
39
+ // >
40
+ // From
41
+ // </Text>
42
+ // }
43
+ // />
44
+ // <div className="flex gap-1.5 items-center">
45
+ // <Icon src={getIcon("ic_transfer")} />
46
+ // <div className="w-full h-px border-t-[1px] border-t-accent opacity-25 border-dashed" />
47
+ // </div>
48
+ // <UserInfo
49
+ // user={transferData.receiver}
50
+ // variant="multiple"
51
+ // rightPart={
52
+ // <Text
53
+ // sx={{
54
+ // color: theme.palette.text?.secondary,
55
+ // fontWeight: theme.typography?.fontWeight500,
56
+ // fontSize: theme.typography?.fontSize13,
57
+ // }}
58
+ // >
59
+ // To
60
+ // </Text>
61
+ // }
62
+ // />
63
+ // </Box>
64
+ // );
65
+ // }
@@ -1,11 +1,9 @@
1
1
  import { ConfirmLayoutProps } from "../../ui/ConfirmLayout";
2
2
  import { SendInternalBody, SendInternalResponse } from "../../../services/axios/send-internal-service/type";
3
- import { TransferInfoDto } from "./type";
4
- import { FeesDataType } from "../../../services/axios/get-est-fee-service/type";
5
- export type TransferInternalData = Omit<SendInternalBody, "passcode"> & TransferInfoDto;
3
+ export type TransferInternalData = Omit<SendInternalBody, "passcode">;
6
4
  interface TransferTokenProps extends Omit<ConfirmLayoutProps, "action"> {
7
5
  transferData: TransferInternalData;
8
- initFeeData?: FeesDataType;
6
+ transferContent: React.ReactNode;
9
7
  onTransferSuccess?: (data: SendInternalResponse) => any;
10
8
  }
11
9
  export interface TransferTokenRef {
@@ -98,13 +98,9 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
98
98
  var type_1 = require("../../../services/axios/get-activities-service/type");
99
99
  var useWithdrawData_1 = __importDefault(require("../../../hooks/useWithdrawData"));
100
100
  var send_internal_service_1 = __importDefault(require("../../../services/axios/send-internal-service"));
101
- var transferTarget_1 = __importDefault(require("./components/transferTarget"));
102
- var transferInfo_1 = __importDefault(require("./components/transferInfo"));
103
- var get_est_fee_service_1 = __importDefault(require("../../../services/axios/get-est-fee-service"));
104
101
  var validate_wallet_address_service_1 = __importDefault(require("../../../services/axios/validate-wallet-address-service"));
105
102
  var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
106
103
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
107
- var transferAmount_1 = __importDefault(require("./components/transferAmount"));
108
104
  var TransferError;
109
105
  (function (TransferError) {
110
106
  TransferError["TOKEN_NOT_FOUND"] = "Token not found";
@@ -113,11 +109,10 @@ var TransferError;
113
109
  TransferError["MIN_AMOUNT"] = "Min amount";
114
110
  TransferError["FAILED"] = "Failed";
115
111
  })(TransferError || (exports.TransferError = TransferError = {}));
116
- var transactionSlug = type_1.TransactionSlug.TransferInternal;
117
112
  exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
118
113
  var _a, _b, _c;
119
114
  var theme = (0, ThemeProvider_1.useTheme)();
120
- var transferData = props.transferData;
115
+ var transferData = props.transferData, transferContent = props.transferContent;
121
116
  var _d = (0, useWithdrawData_1.default)(), sendInternalTokens = _d.sendInternalTokens, updateSendInternalToken = _d.updateSendInternalToken;
122
117
  var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
123
118
  var confirmLayoutDrawerRef = (0, react_1.useRef)(null);
@@ -126,33 +121,8 @@ exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
126
121
  var _g = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _g[0], setButtonStatus = _g[1];
127
122
  var _h = (0, react_1.useState)(false), isValidatingAddress = _h[0], setIsValidatingAddress = _h[1];
128
123
  var _j = (0, react_1.useState)(undefined), errorAddress = _j[0], setErrorAddress = _j[1];
129
- var _k = (0, react_1.useState)(props.initFeeData), estimateFee = _k[0], setEstimateFee = _k[1];
130
- var _l = (0, react_1.useState)(false), isLoadingEstimateFee = _l[0], setIsLoadingEstimateFee = _l[1];
131
- var _m = (0, react_1.useState)(false), isEnoughBalanceToPayFee = _m[0], setIsEnoughBalanceToPayFee = _m[1];
132
- var amount = transferData.amount;
133
124
  var toAddress = transferData.to_address;
134
125
  var tokenSlug = transferData.currency_slug;
135
- var getEstimateFee = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
136
- var response;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0:
140
- if (!tokenSlug)
141
- return [2 /*return*/];
142
- setIsLoadingEstimateFee(true);
143
- return [4 /*yield*/, (0, get_est_fee_service_1.default)({
144
- amount: "".concat(amount),
145
- transaction_type: transactionSlug,
146
- currency: tokenSlug || "",
147
- })];
148
- case 1:
149
- response = _a.sent();
150
- setIsLoadingEstimateFee(false);
151
- setEstimateFee(response === null || response === void 0 ? void 0 : response.data);
152
- return [2 /*return*/, true];
153
- }
154
- });
155
- }); }, [amount, tokenSlug]);
156
126
  var token = (0, react_1.useMemo)(function () {
157
127
  return sendInternalTokens === null || sendInternalTokens === void 0 ? void 0 : sendInternalTokens.find(function (token) { return token.slug === tokenSlug; });
158
128
  }, [tokenSlug, sendInternalTokens]);
@@ -179,7 +149,7 @@ exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
179
149
  setError(undefined);
180
150
  setErrorAmount(undefined);
181
151
  return true;
182
- }, [sendInternalTokens, token]);
152
+ }, [token, transferData.amount]);
183
153
  var validateAddress = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
184
154
  var message;
185
155
  return __generator(this, function (_a) {
@@ -209,10 +179,9 @@ exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
209
179
  if (!isAmountValid)
210
180
  return [2 /*return*/, false];
211
181
  validateAddress();
212
- getEstimateFee();
213
182
  return [2 /*return*/];
214
183
  });
215
- }); }, [validateAmount, validateAddress, getEstimateFee]);
184
+ }); }, [validateAmount, validateAddress]);
216
185
  var handleSendInternalToken = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
217
186
  var response, err_1;
218
187
  var _a, _b;
@@ -267,18 +236,13 @@ exports.TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
267
236
  updateSendInternalToken();
268
237
  }
269
238
  }, [sendInternalTokens, updateSendInternalToken, isInitPasscode]);
270
- // const estimateReceive = useMemo(() => {
271
- // if (!estimateFee || !amount) return undefined;
272
- // return +amount - +estimateFee?.fee_in_currency;
273
- // }, [estimateFee, amount]);
274
- return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: type_1.TransactionSlug.TransferInternal, trigger: props.children, onOpen: validateAll, children: [(0, jsx_runtime_1.jsx)(transferAmount_1.default, { title: "Transfer Amount", amount: amount, link: token === null || token === void 0 ? void 0 : token.link, currency: token === null || token === void 0 ? void 0 : token.name }), (0, jsx_runtime_1.jsx)(transferTarget_1.default, { transferData: transferData }), (0, jsx_runtime_1.jsx)(transferInfo_1.default, { transferData: transferData, estimateFee: estimateFee, amount: amount, tokenSlug: tokenSlug, setIsEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: (_a = theme.mixins.gaps) === null || _a === void 0 ? void 0 : _a.g6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "center", mt: (_b = theme.mixins.customMargin) === null || _b === void 0 ? void 0 : _b.m12, mb: (_c = theme.mixins.customMargin) === null || _c === void 0 ? void 0 : _c.m16, position: "absolute", bottom: 0, left: 0, right: 0 }), children: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.TransactionSlug.TransferInternal, onConfirmSuccess: handleSendInternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
239
+ return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: type_1.TransactionSlug.TransferInternal, trigger: props.children, onOpen: validateAll, children: [transferContent, !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: (_a = theme.mixins.gaps) === null || _a === void 0 ? void 0 : _a.g6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "center", mt: (_b = theme.mixins.customMargin) === null || _b === void 0 ? void 0 : _b.m12, mb: (_c = theme.mixins.customMargin) === null || _c === void 0 ? void 0 : _c.m16, position: "absolute", bottom: 0, left: 0, right: 0 }), children: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.TransactionSlug.TransferInternal, onConfirmSuccess: handleSendInternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
275
240
  width: "100%",
241
+ minHeight: "50px",
276
242
  backgroundColor: theme.palette.background.primary,
277
243
  color: theme.palette.text.secondary,
278
244
  borderRadius: theme.mixins.customRadius.r12,
279
- }, status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress || !isEnoughBalanceToPayFee
280
- ? Button_1.BUTTON_STATUS.DISABLED
281
- : buttonStatus, fullWidth: true, children: "Confirm" }) }) })] }) }));
245
+ }, status: !!error || isValidatingAddress || errorAddress ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, fullWidth: true, children: "Confirm" }) }) })] }) }));
282
246
  });
283
247
  exports.TransferInternal.displayName = "TransferInternal";
284
248
  exports.default = exports.TransferInternal;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = UserInfo;
7
7
  var jsx_runtime_1 = require("react/jsx-runtime");
8
8
  var getImage_1 = __importDefault(require("../../../utils/getImage"));
9
- var Icon_1 = __importDefault(require("../Icon"));
10
9
  var Text_1 = __importDefault(require("../Text"));
11
10
  var material_1 = require("@mui/material");
12
11
  var ThemeProvider_1 = require("../../../providers/ThemeProvider");
@@ -16,9 +15,9 @@ function UserInfo(_a) {
16
15
  var theme = (0, ThemeProvider_1.useTheme)();
17
16
  if (!user)
18
17
  return "loading...";
19
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex gap-3 items-center", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_b = user.avatar) !== null && _b !== void 0 ? _b : (0, getImage_1.default)("default-ava", "png"), width: 24, height: 24, sx: {
20
- position: "relative",
21
- borderRadius: theme.mixins.customRadius.full,
18
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex gap-3 items-center", children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: (_b = user.avatar) !== null && _b !== void 0 ? _b : (0, getImage_1.default)("default-ava", "png"), sx: {
19
+ width: 24,
20
+ height: 24,
22
21
  } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
23
22
  color: theme.palette.background.white,
24
23
  fontWeight: theme.typography.fontWeight500,
@@ -30,7 +30,7 @@ var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
30
30
  showSuccess: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Success); },
31
31
  showError: function () { return setStatus(StatusDisplay_1.StatusDisplayType.Error); },
32
32
  }); });
33
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: ref, sx: __assign({ height: "100dvh", width: "100vw", display: "grid", gridTemplateRows: "auto 1fr auto", backgroundColor: theme.palette.background.white }, sx), children: [header && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%" }, sxHeader), children: header })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, sxContent), children: children }), footer && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", padding: theme.mixins.customPadding.p24 }, sxFooter), children: footer })), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: ref, sx: __assign({ height: "100dvh", width: "100vw", display: "grid", gridTemplateRows: "auto 1fr auto", backgroundColor: theme.palette.background.white }, sx), children: [header && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%" }, sxHeader), children: header })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, sxContent), children: children }), footer && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", paddingLeft: theme.mixins.customPadding.p16, paddingRight: theme.mixins.customPadding.p16, paddingBottom: theme.mixins.customPadding.p24 }, sxFooter), children: footer })), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
34
34
  position: "absolute",
35
35
  inset: 0,
36
36
  display: "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.635",
3
+ "version": "0.0.637",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",