tek-wallet 0.0.478 → 0.0.480

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.
@@ -23,8 +23,9 @@ var react_2 = require("react");
23
23
  var Formatter_1 = __importDefault(require("../Formatter"));
24
24
  var Text_1 = __importDefault(require("../Text"));
25
25
  var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
26
+ var CopyTextComponent_1 = __importDefault(require("../CopyTextComponent"));
26
27
  function ActivityDetail(props) {
27
- var _a;
28
+ var _a, _b;
28
29
  var theme = (0, material_1.useTheme)();
29
30
  var activityData = props.activityData;
30
31
  var status = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_status;
@@ -62,10 +63,10 @@ function ActivityDetail(props) {
62
63
  }, [isIncrease, theme]);
63
64
  if (!activityData)
64
65
  return null;
65
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_a = activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
66
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g6, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: (_b = activityData.currency_data) === null || _b === void 0 ? void 0 : _b.name }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
66
67
  fontSize: theme.typography.fontSize12,
67
68
  textTransform: "capitalize",
68
69
  color: getStatusColor(),
69
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), 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({}, theme.mixins.value), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] })), isSend && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "To" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] }))] })] }));
70
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12, 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: "right" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] }) })), isSend && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.to_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: "To" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "right" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] }) }))] })] }));
70
71
  }
71
72
  exports.default = ActivityDetail;
@@ -39,11 +39,11 @@ var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
39
39
  var ActivityDetail_1 = __importDefault(require("../ActivityDetail"));
40
40
  var ModalLayout_1 = __importDefault(require("../ModalLayout"));
41
41
  function ActivityItem(props) {
42
- var _a;
42
+ var _a, _b;
43
43
  var sx = props.sx, data = props.data, rest = __rest(props, ["sx", "data"]);
44
44
  var theme = (0, material_1.useTheme)();
45
45
  var detailDrawerRef = (0, react_1.useRef)(null);
46
- var _b = (0, react_1.useState)(false), isOpenDetail = _b[0], setIsOpenDetail = _b[1];
46
+ var _c = (0, react_1.useState)(false), isOpenDetail = _c[0], setIsOpenDetail = _c[1];
47
47
  var activityData = (0, react_1.useMemo)(function () {
48
48
  if (!data)
49
49
  return undefined;
@@ -64,7 +64,7 @@ function ActivityItem(props) {
64
64
  if (isReceive) {
65
65
  return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["From: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.from_address)] });
66
66
  }
67
- var isSend = slug === type_1.TransactionSlug.Send || slug === type_1.TransactionSlug.Withdrawn;
67
+ var isSend = slug === type_1.TransactionSlug.Send || slug === type_1.TransactionSlug.Withdrawn || slug === type_1.TransactionSlug.TransferInternal;
68
68
  if (isSend) {
69
69
  return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["To: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.to_address)] });
70
70
  }
@@ -107,13 +107,13 @@ function ActivityItem(props) {
107
107
  }, [isIncrease, theme]);
108
108
  if (!activityData)
109
109
  return null;
110
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ onClick: openDetail, sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
110
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%" }, children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ onClick: openDetail, sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
111
111
  width: "fit-content",
112
112
  height: "fit-content",
113
113
  }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: 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, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
114
114
  fontSize: theme.typography.fontSize12,
115
115
  textTransform: "capitalize",
116
116
  color: getStatusColor(),
117
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, onClose: onCloseDetail, children: isOpenDetail && ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_a = activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) })) })] }));
117
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: (_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.name }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, onClose: onCloseDetail, children: isOpenDetail && ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_b = activityData.transaction_type) === null || _b === void 0 ? void 0 : _b.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) })) })] }));
118
118
  }
119
119
  exports.default = ActivityItem;
@@ -1,4 +1,4 @@
1
- import { Paginated } from "../type";
1
+ import { Paginated, Currency } from "../type";
2
2
  export interface GetActivitiesServiceQuery {
3
3
  page?: number;
4
4
  take?: number;
@@ -35,6 +35,7 @@ export interface Transaction {
35
35
  description: null;
36
36
  from_locked_balance: null;
37
37
  to_locked_balance: null;
38
+ currency_data: Currency;
38
39
  }
39
40
  export interface TransactionType {
40
41
  id: number;
@@ -1,4 +1,5 @@
1
1
  import { TransactionSlug } from "../get-activities-service/type";
2
+ import { Currency } from "../type";
2
3
  export interface GetEstimateFeeServiceQuery {
3
4
  amount: string;
4
5
  transaction_type: TransactionSlug;
@@ -29,14 +30,6 @@ export interface FeeDetailType {
29
30
  feePercentInCurrency?: number;
30
31
  isEnoughBalanceToPay?: boolean;
31
32
  }
32
- export interface Currency {
33
- id: number;
34
- name: string;
35
- slug: string;
36
- full_name: string;
37
- icon: string;
38
- link: string;
39
- }
40
33
  export interface FeeType {
41
34
  name: string;
42
35
  slug: string;
@@ -19,3 +19,12 @@ export interface NetworkData {
19
19
  network_type: string;
20
20
  icon: string;
21
21
  }
22
+ export interface Currency {
23
+ id: number;
24
+ name: string;
25
+ slug: string;
26
+ full_name: string;
27
+ icon: string;
28
+ link: string;
29
+ icon_svg: string;
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.478",
3
+ "version": "0.0.480",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",