tek-wallet 0.0.437 → 0.0.439
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/ui/Activities/index.js +62 -6
- package/dist/components/ui/ActivityItem/index.d.ts +6 -0
- package/dist/components/ui/ActivityItem/index.js +90 -0
- package/dist/components/ui/BackHeader/index.js +4 -1
- package/dist/components/ui/DrawerComponent/index.d.ts +3 -1
- package/dist/components/ui/DrawerComponent/index.js +3 -1
- package/dist/providers/ActivitiesProvider/const.d.ts +2 -1
- package/dist/providers/ActivitiesProvider/const.js +2 -1
- package/dist/providers/ActivitiesProvider/index.js +2 -1
- package/dist/providers/ActivitiesProvider/type.d.ts +2 -2
- package/dist/services/axios/get-activities-service/type.d.ts +22 -4
- package/dist/services/axios/get-activities-service/type.js +20 -0
- package/dist/theme/mui/theme.js +13 -0
- package/dist/utils/compactWalletAddress.d.ts +1 -0
- package/dist/utils/compactWalletAddress.js +19 -0
- package/package.json +1 -1
|
@@ -1,12 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
49
|
};
|
|
6
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
51
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
52
|
var react_1 = require("react");
|
|
9
|
-
var DrawerComponent_1 =
|
|
53
|
+
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
10
54
|
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
11
55
|
var DefaultPageLayout_1 = __importDefault(require("../../layouts/DefaultPageLayout"));
|
|
12
56
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
@@ -15,7 +59,10 @@ var SwiperControlled_1 = __importDefault(require("../SwiperControlled"));
|
|
|
15
59
|
var useActivities_1 = __importDefault(require("../../../hooks/useActivities"));
|
|
16
60
|
var material_1 = require("@mui/material");
|
|
17
61
|
var react_2 = require("swiper/react");
|
|
18
|
-
var
|
|
62
|
+
var ActivityItem_1 = __importDefault(require("../ActivityItem"));
|
|
63
|
+
var EmptyData_1 = __importDefault(require("../EmptyData"));
|
|
64
|
+
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
65
|
+
var prefix = "activities_";
|
|
19
66
|
var Activities = (0, react_1.forwardRef)(function (props, ref) {
|
|
20
67
|
var drawerRef = (0, react_1.useRef)(null);
|
|
21
68
|
var theme = (0, material_1.useTheme)();
|
|
@@ -40,7 +87,10 @@ var Activities = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
40
87
|
close();
|
|
41
88
|
handleOnClose();
|
|
42
89
|
};
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, {
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Activities", overrideBack: handleBack }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: { height: "100%" }, children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { swiperProps: {
|
|
91
|
+
slidesPerView: 1,
|
|
92
|
+
spaceBetween: 40,
|
|
93
|
+
}, tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
44
94
|
return ((0, jsx_runtime_1.jsx)(material_1.Tab, { disableRipple: true, label: type.name, value: index, "data-index": index, sx: {
|
|
45
95
|
padding: "0 ".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8),
|
|
46
96
|
minHeight: "unset",
|
|
@@ -58,9 +108,15 @@ var Activities = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
58
108
|
}, swiperStyle: {
|
|
59
109
|
flex: 1,
|
|
60
110
|
}, children: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
111
|
+
var activitiesByType = activities === null || activities === void 0 ? void 0 : activities[type.slug];
|
|
112
|
+
var isEmpty = !(activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.length);
|
|
113
|
+
return ((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: [isEmpty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), title: "No ".concat(type.name, " activities") })), !isEmpty &&
|
|
114
|
+
(activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.map(function (activity, index) {
|
|
115
|
+
if (!activity)
|
|
116
|
+
return null;
|
|
117
|
+
var dataAsJson = JSON.stringify(activity);
|
|
118
|
+
return (0, jsx_runtime_1.jsx)(ActivityItem_1.default, { data: dataAsJson }, index);
|
|
119
|
+
}))] }) }, index));
|
|
64
120
|
}) }) }) }) }) }));
|
|
65
121
|
});
|
|
66
122
|
Activities.displayName = "Activities";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ListItemButtonProps } from "@mui/material";
|
|
2
|
+
interface ActivityItemProps extends ListItemButtonProps {
|
|
3
|
+
data?: string;
|
|
4
|
+
}
|
|
5
|
+
declare function ActivityItem(props: ActivityItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export default ActivityItem;
|
|
@@ -0,0 +1,90 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var material_1 = require("@mui/material");
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var parsePropsData_1 = __importDefault(require("../../../utils/parsePropsData"));
|
|
32
|
+
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
33
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
34
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
35
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
36
|
+
var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
|
|
37
|
+
var compactWalletAddress_1 = __importDefault(require("../../../utils/compactWalletAddress"));
|
|
38
|
+
function ActivityItem(props) {
|
|
39
|
+
var sx = props.sx, data = props.data, rest = __rest(props, ["sx", "data"]);
|
|
40
|
+
var theme = (0, material_1.useTheme)();
|
|
41
|
+
var activityData = (0, react_1.useMemo)(function () {
|
|
42
|
+
if (!data)
|
|
43
|
+
return undefined;
|
|
44
|
+
return (0, parsePropsData_1.default)(data);
|
|
45
|
+
}, [data]);
|
|
46
|
+
var type = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type;
|
|
47
|
+
var status = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_status;
|
|
48
|
+
var isIncrease = (0, react_1.useMemo)(function () {
|
|
49
|
+
return type === type_1.TransactionSlug.Deposit;
|
|
50
|
+
}, [type]);
|
|
51
|
+
var descriptionElement = (0, react_1.useMemo)(function () {
|
|
52
|
+
var isReceive = type === type_1.TransactionSlug.Receive || type === type_1.TransactionSlug.Deposit;
|
|
53
|
+
if (isReceive) {
|
|
54
|
+
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)] });
|
|
55
|
+
}
|
|
56
|
+
var isSend = type === type_1.TransactionSlug.Send || type === type_1.TransactionSlug.Withdrawn;
|
|
57
|
+
if (isSend) {
|
|
58
|
+
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)] });
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}, [status]);
|
|
62
|
+
var getStatusColor = (0, react_1.useCallback)(function () {
|
|
63
|
+
switch (status) {
|
|
64
|
+
case type_1.TransactionStatus.Processing:
|
|
65
|
+
return theme.palette.text.loadingStatus;
|
|
66
|
+
case type_1.TransactionStatus.Success:
|
|
67
|
+
return theme.palette.text.successStatus;
|
|
68
|
+
case type_1.TransactionStatus.Failed:
|
|
69
|
+
return theme.palette.text.warningStatus;
|
|
70
|
+
default:
|
|
71
|
+
return theme.palette.text.primary;
|
|
72
|
+
}
|
|
73
|
+
}, [status, theme]);
|
|
74
|
+
var getAmountColor = (0, react_1.useCallback)(function () {
|
|
75
|
+
if (isIncrease)
|
|
76
|
+
return theme.palette.text.successStatus;
|
|
77
|
+
return theme.palette.text.white;
|
|
78
|
+
}, [isIncrease, theme]);
|
|
79
|
+
if (!activityData)
|
|
80
|
+
return null;
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12 }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
82
|
+
width: "fit-content",
|
|
83
|
+
height: "fit-content",
|
|
84
|
+
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: activityData.icon, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: activityData.transaction_type }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
85
|
+
fontSize: theme.typography.fontSize12,
|
|
86
|
+
textTransform: "capitalize",
|
|
87
|
+
color: getStatusColor(),
|
|
88
|
+
}, 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) })] })] })));
|
|
89
|
+
}
|
|
90
|
+
exports.default = ActivityItem;
|
|
@@ -40,6 +40,9 @@ var BackHeader = function (props) {
|
|
|
40
40
|
transform: "translateX(-0.25rem)",
|
|
41
41
|
transition: "transform 0.2s ease-in-out",
|
|
42
42
|
},
|
|
43
|
-
}, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
43
|
+
}, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
44
|
+
color: theme.palette.text.white,
|
|
45
|
+
fontSize: theme.typography.fontSize12,
|
|
46
|
+
}, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), theme.mixins.headerTitle), children: center })), children] }));
|
|
44
47
|
};
|
|
45
48
|
exports.default = BackHeader;
|
|
@@ -2,7 +2,9 @@ import { GeneralProps, UnknownFunction } from "../../../types/ui";
|
|
|
2
2
|
import { SwipeableDrawerProps } from "@mui/material";
|
|
3
3
|
export declare enum DRAWER_DIRECTION {
|
|
4
4
|
LEFT = "left",
|
|
5
|
-
RIGHT = "right"
|
|
5
|
+
RIGHT = "right",
|
|
6
|
+
TOP = "top",
|
|
7
|
+
BOTTOM = "bottom"
|
|
6
8
|
}
|
|
7
9
|
export interface DrawerComponentProps extends Omit<GeneralProps, "onClick" | "sx">, Omit<SwipeableDrawerProps, "onClose" | "onToggle" | "onOpen"> {
|
|
8
10
|
onOpen?: UnknownFunction;
|
|
@@ -30,6 +30,8 @@ var DRAWER_DIRECTION;
|
|
|
30
30
|
(function (DRAWER_DIRECTION) {
|
|
31
31
|
DRAWER_DIRECTION["LEFT"] = "left";
|
|
32
32
|
DRAWER_DIRECTION["RIGHT"] = "right";
|
|
33
|
+
DRAWER_DIRECTION["TOP"] = "top";
|
|
34
|
+
DRAWER_DIRECTION["BOTTOM"] = "bottom";
|
|
33
35
|
})(DRAWER_DIRECTION || (exports.DRAWER_DIRECTION = DRAWER_DIRECTION = {}));
|
|
34
36
|
var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
35
37
|
var onOpen = props.onOpen, onClose = props.onClose, onToggle = props.onToggle, sx = props.sx, trigger = props.trigger, direction = props.direction, children = props.children, disableSwipe = props.disableSwipe, rest = __rest(props, ["onOpen", "onClose", "onToggle", "sx", "trigger", "direction", "children", "disableSwipe"]);
|
|
@@ -84,7 +86,7 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
84
86
|
overflow: "hidden",
|
|
85
87
|
boxShadow: "none",
|
|
86
88
|
},
|
|
87
|
-
}, anchor: direction ||
|
|
89
|
+
}, anchor: direction || DRAWER_DIRECTION.BOTTOM, open: isOpen !== null && isOpen !== void 0 ? isOpen : isShowDrawerComponent, onOpen: onDrawerOpen, onClose: onDrawerClose, children: children }))] }));
|
|
88
90
|
});
|
|
89
91
|
DrawerComponent.displayName = "DrawerComponent";
|
|
90
92
|
exports.default = DrawerComponent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ACTIVITIES_TYPE_ALL = exports.ACTIVITIES_PAGE_SIZE = void 0;
|
|
4
|
+
var type_1 = require("../../services/axios/get-activities-service/type");
|
|
4
5
|
exports.ACTIVITIES_PAGE_SIZE = 10;
|
|
5
6
|
exports.ACTIVITIES_TYPE_ALL = {
|
|
6
7
|
name: "All",
|
|
7
|
-
slug:
|
|
8
|
+
slug: type_1.TransactionSlug.All,
|
|
8
9
|
};
|
|
@@ -140,7 +140,8 @@ function ActivitiesProvider(_a) {
|
|
|
140
140
|
setActivities(function (prev) {
|
|
141
141
|
var _a;
|
|
142
142
|
var _b, _c, _d;
|
|
143
|
-
|
|
143
|
+
var slug = (query === null || query === void 0 ? void 0 : query.transaction_type) || const_1.ACTIVITIES_TYPE_ALL.slug;
|
|
144
|
+
return __assign(__assign({}, (prev !== null && prev !== void 0 ? prev : {})), (_a = {}, _a[slug] = __spreadArray(__spreadArray([], ((_b = prev === null || prev === void 0 ? void 0 : prev[slug]) !== null && _b !== void 0 ? _b : []), true), ((_d = (_c = response_1 === null || response_1 === void 0 ? void 0 : response_1.data) === null || _c === void 0 ? void 0 : _c.transactions) !== null && _d !== void 0 ? _d : []), true), _a));
|
|
144
145
|
});
|
|
145
146
|
setIsLoadingActivities(false);
|
|
146
147
|
return [3 /*break*/, 3];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction, TransactionType } from "../../services/axios/get-activities-service/type";
|
|
1
|
+
import { Transaction, TransactionSlug, TransactionType } from "../../services/axios/get-activities-service/type";
|
|
2
2
|
export interface ActivitiesProviderDataType {
|
|
3
3
|
isLoadingActivities: boolean;
|
|
4
4
|
activities: Activities | undefined;
|
|
@@ -7,6 +7,6 @@ export interface ActivitiesProviderDataType {
|
|
|
7
7
|
page: number;
|
|
8
8
|
gotoPage: (page: number) => void;
|
|
9
9
|
}
|
|
10
|
-
export type Activities = Record<
|
|
10
|
+
export type Activities = Partial<Record<TransactionSlug, Transaction[]>>;
|
|
11
11
|
export interface ActivityTypes extends TransactionType {
|
|
12
12
|
}
|
|
@@ -4,7 +4,7 @@ export interface GetActivitiesServiceQuery {
|
|
|
4
4
|
take?: number;
|
|
5
5
|
from_date?: string;
|
|
6
6
|
to_date?: string;
|
|
7
|
-
transaction_type?:
|
|
7
|
+
transaction_type?: TransactionSlug;
|
|
8
8
|
}
|
|
9
9
|
export interface GetActivitiesServiceResponse {
|
|
10
10
|
success: boolean;
|
|
@@ -19,11 +19,11 @@ export interface Data {
|
|
|
19
19
|
}
|
|
20
20
|
export interface TransactionType {
|
|
21
21
|
name: string;
|
|
22
|
-
slug:
|
|
22
|
+
slug: TransactionSlug;
|
|
23
23
|
}
|
|
24
24
|
export interface Transaction {
|
|
25
25
|
id: number;
|
|
26
|
-
transaction_type:
|
|
26
|
+
transaction_type: TransactionSlug;
|
|
27
27
|
from_address: string;
|
|
28
28
|
to_address: string;
|
|
29
29
|
network: string;
|
|
@@ -31,7 +31,7 @@ export interface Transaction {
|
|
|
31
31
|
currency_slug: string;
|
|
32
32
|
fee: string;
|
|
33
33
|
amount: string;
|
|
34
|
-
transaction_status:
|
|
34
|
+
transaction_status: TransactionStatus;
|
|
35
35
|
user_created: string;
|
|
36
36
|
user_updated: string;
|
|
37
37
|
date_created: string;
|
|
@@ -39,4 +39,22 @@ export interface Transaction {
|
|
|
39
39
|
description: null | string;
|
|
40
40
|
from_locked_balance: null;
|
|
41
41
|
to_locked_balance: null;
|
|
42
|
+
icon: string;
|
|
43
|
+
}
|
|
44
|
+
export declare enum TransactionSlug {
|
|
45
|
+
All = "all",
|
|
46
|
+
Send = "send",
|
|
47
|
+
Receive = "receive",
|
|
48
|
+
Swap = "swap",
|
|
49
|
+
TransferInternal = "transfer-internal",
|
|
50
|
+
Deposit = "deposit",
|
|
51
|
+
Withdrawn = "withdrawn",
|
|
52
|
+
UpdateBalances = "update-balances",
|
|
53
|
+
LockedBalances = "locked_balance",
|
|
54
|
+
CapitalAdjustment = "capital-adjustment"
|
|
55
|
+
}
|
|
56
|
+
export declare enum TransactionStatus {
|
|
57
|
+
Processing = "processing",
|
|
58
|
+
Success = "success",
|
|
59
|
+
Failed = "failed"
|
|
42
60
|
}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionStatus = exports.TransactionSlug = void 0;
|
|
4
|
+
var TransactionSlug;
|
|
5
|
+
(function (TransactionSlug) {
|
|
6
|
+
TransactionSlug["All"] = "all";
|
|
7
|
+
TransactionSlug["Send"] = "send";
|
|
8
|
+
TransactionSlug["Receive"] = "receive";
|
|
9
|
+
TransactionSlug["Swap"] = "swap";
|
|
10
|
+
TransactionSlug["TransferInternal"] = "transfer-internal";
|
|
11
|
+
TransactionSlug["Deposit"] = "deposit";
|
|
12
|
+
TransactionSlug["Withdrawn"] = "withdrawn";
|
|
13
|
+
TransactionSlug["UpdateBalances"] = "update-balances";
|
|
14
|
+
TransactionSlug["LockedBalances"] = "locked_balance";
|
|
15
|
+
TransactionSlug["CapitalAdjustment"] = "capital-adjustment";
|
|
16
|
+
})(TransactionSlug || (exports.TransactionSlug = TransactionSlug = {}));
|
|
17
|
+
var TransactionStatus;
|
|
18
|
+
(function (TransactionStatus) {
|
|
19
|
+
TransactionStatus["Processing"] = "processing";
|
|
20
|
+
TransactionStatus["Success"] = "success";
|
|
21
|
+
TransactionStatus["Failed"] = "failed";
|
|
22
|
+
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
package/dist/theme/mui/theme.js
CHANGED
|
@@ -293,6 +293,19 @@ var theme = (0, styles_1.createTheme)({
|
|
|
293
293
|
fontSize: typography.fontSize12,
|
|
294
294
|
lineHeight: typography.leading140,
|
|
295
295
|
},
|
|
296
|
+
activityTitle: {
|
|
297
|
+
color: text.white,
|
|
298
|
+
fontWeight: typography.fontWeight500,
|
|
299
|
+
fontSize: typography.fontSize14,
|
|
300
|
+
lineHeight: typography.leading140,
|
|
301
|
+
textTransform: "capitalize",
|
|
302
|
+
},
|
|
303
|
+
activityDescription: {
|
|
304
|
+
color: text.white64,
|
|
305
|
+
fontWeight: typography.fontWeight400,
|
|
306
|
+
fontSize: typography.fontSize12,
|
|
307
|
+
lineHeight: typography.leading140,
|
|
308
|
+
},
|
|
296
309
|
},
|
|
297
310
|
});
|
|
298
311
|
exports.default = theme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function compactWalletAddress(walletAddress?: string, isLinkAff?: boolean): string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = compactWalletAddress;
|
|
4
|
+
function compactWalletAddress(walletAddress, isLinkAff) {
|
|
5
|
+
try {
|
|
6
|
+
if (!walletAddress)
|
|
7
|
+
return undefined;
|
|
8
|
+
if ((walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.length) <= 8) {
|
|
9
|
+
return walletAddress;
|
|
10
|
+
}
|
|
11
|
+
return ((walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(0, !isLinkAff ? 3 : 15)) +
|
|
12
|
+
"..." +
|
|
13
|
+
(walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.slice(!isLinkAff ? -3 : -10)));
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
console.error("🚀 ~ compactWalletAddress ~ err:", err);
|
|
17
|
+
return walletAddress;
|
|
18
|
+
}
|
|
19
|
+
}
|