tek-wallet 0.0.462 → 0.0.464
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/ActivityItem/index.js +12 -7
- package/dist/components/ui/ReceiveFunction/index.js +1 -1
- package/dist/components/ui/WithdrawFunction/index.js +1 -1
- package/dist/hooks/useEventHandler.js +1 -1
- package/dist/providers/ActivitiesProvider/const.d.ts +2 -5
- package/dist/providers/ActivitiesProvider/const.js +6 -0
- package/dist/providers/LockTokenProvider/index.js +3 -1
- package/dist/services/axios/get-activities-service/type.d.ts +12 -7
- package/dist/services/axios/get-activities-service/type.js +20 -0
- package/package.json +1 -1
|
@@ -43,22 +43,27 @@ function ActivityItem(props) {
|
|
|
43
43
|
return undefined;
|
|
44
44
|
return (0, parsePropsData_1.default)(data);
|
|
45
45
|
}, [data]);
|
|
46
|
-
var type = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type;
|
|
47
46
|
var status = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_status;
|
|
48
|
-
var
|
|
49
|
-
return
|
|
47
|
+
var type = (0, react_1.useMemo)(function () {
|
|
48
|
+
return activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type;
|
|
49
|
+
}, [activityData]);
|
|
50
|
+
var slug = (0, react_1.useMemo)(function () {
|
|
51
|
+
return type === null || type === void 0 ? void 0 : type.slug;
|
|
50
52
|
}, [type]);
|
|
53
|
+
var isIncrease = (0, react_1.useMemo)(function () {
|
|
54
|
+
return slug === type_1.TransactionSlug.Deposit;
|
|
55
|
+
}, [slug]);
|
|
51
56
|
var descriptionElement = (0, react_1.useMemo)(function () {
|
|
52
|
-
var isReceive =
|
|
57
|
+
var isReceive = slug === type_1.TransactionSlug.Receive || slug === type_1.TransactionSlug.Deposit;
|
|
53
58
|
if (isReceive) {
|
|
54
59
|
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
60
|
}
|
|
56
|
-
var isSend =
|
|
61
|
+
var isSend = slug === type_1.TransactionSlug.Send || slug === type_1.TransactionSlug.Withdrawn;
|
|
57
62
|
if (isSend) {
|
|
58
63
|
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
64
|
}
|
|
60
65
|
return null;
|
|
61
|
-
}, [
|
|
66
|
+
}, [slug, activityData === null || activityData === void 0 ? void 0 : activityData.from_address, activityData === null || activityData === void 0 ? void 0 : activityData.to_address]);
|
|
62
67
|
var getStatusColor = (0, react_1.useCallback)(function () {
|
|
63
68
|
switch (status) {
|
|
64
69
|
case type_1.TransactionStatus.Processing:
|
|
@@ -81,7 +86,7 @@ function ActivityItem(props) {
|
|
|
81
86
|
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, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
82
87
|
width: "fit-content",
|
|
83
88
|
height: "fit-content",
|
|
84
|
-
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src:
|
|
89
|
+
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.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: 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: {
|
|
85
90
|
fontSize: theme.typography.fontSize12,
|
|
86
91
|
textTransform: "capitalize",
|
|
87
92
|
color: getStatusColor(),
|
|
@@ -282,7 +282,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
282
282
|
if (isAuthenticated && !receiveInternalTokens) {
|
|
283
283
|
updateReceiveInternalToken();
|
|
284
284
|
}
|
|
285
|
-
}, [isAuthenticated]);
|
|
285
|
+
}, [isAuthenticated, receiveExternalTokens, receiveInternalTokens]);
|
|
286
286
|
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
|
|
287
287
|
width: "100%",
|
|
288
288
|
display: "flex",
|
|
@@ -601,7 +601,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
601
601
|
if (isAuthenticated && !sendInternalTokens) {
|
|
602
602
|
updateSendInternalToken();
|
|
603
603
|
}
|
|
604
|
-
}, [isAuthenticated]);
|
|
604
|
+
}, [isAuthenticated, withdrawTokens, sendInternalTokens]);
|
|
605
605
|
(0, react_1.useEffect)(function () {
|
|
606
606
|
validateAmount();
|
|
607
607
|
}, [validateAmount]);
|
|
@@ -31,7 +31,7 @@ var useEventHandler = function () {
|
|
|
31
31
|
notificationType = "info";
|
|
32
32
|
}
|
|
33
33
|
return {
|
|
34
|
-
message: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { textTransform: "capitalize" }, children: type }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: currency }), " is", " ", status] })),
|
|
34
|
+
message: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { textTransform: "capitalize" }, children: type.name }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: currency }), " is", " ", status] })),
|
|
35
35
|
type: notificationType,
|
|
36
36
|
id: "".concat(transactionId, "-").concat(status),
|
|
37
37
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionType } from "../../services/axios/get-activities-service/type";
|
|
2
2
|
export declare const ACTIVITIES_PAGE_SIZE = 10;
|
|
3
|
-
export declare const ACTIVITIES_TYPE_ALL:
|
|
4
|
-
name: string;
|
|
5
|
-
slug: TransactionSlug;
|
|
6
|
-
};
|
|
3
|
+
export declare const ACTIVITIES_TYPE_ALL: TransactionType;
|
|
@@ -4,6 +4,12 @@ exports.ACTIVITIES_TYPE_ALL = exports.ACTIVITIES_PAGE_SIZE = void 0;
|
|
|
4
4
|
var type_1 = require("../../services/axios/get-activities-service/type");
|
|
5
5
|
exports.ACTIVITIES_PAGE_SIZE = 10;
|
|
6
6
|
exports.ACTIVITIES_TYPE_ALL = {
|
|
7
|
+
id: -1,
|
|
8
|
+
status: "all",
|
|
7
9
|
name: "All",
|
|
8
10
|
slug: type_1.TransactionSlug.All,
|
|
11
|
+
description: null,
|
|
12
|
+
icon: "",
|
|
13
|
+
link: "",
|
|
14
|
+
icon_svg: "",
|
|
9
15
|
};
|
|
@@ -119,8 +119,10 @@ function LockTokensProvider(_a) {
|
|
|
119
119
|
});
|
|
120
120
|
}); }, [isAuthenticated, isLoadingLockToken]);
|
|
121
121
|
(0, react_1.useEffect)(function () {
|
|
122
|
+
if (!!lockTokens)
|
|
123
|
+
return;
|
|
122
124
|
updateLockToken();
|
|
123
|
-
}, [
|
|
125
|
+
}, [isAuthenticated, lockTokens]);
|
|
124
126
|
return ((0, jsx_runtime_1.jsx)(exports.LockTokensContext.Provider, { value: {
|
|
125
127
|
isLoadingLockToken: isLoadingLockToken,
|
|
126
128
|
lockTokens: lockTokens,
|
|
@@ -17,17 +17,13 @@ export interface Data {
|
|
|
17
17
|
transaction_types: TransactionType[];
|
|
18
18
|
paginated: Paginated;
|
|
19
19
|
}
|
|
20
|
-
export interface TransactionType {
|
|
21
|
-
name: string;
|
|
22
|
-
slug: TransactionSlug;
|
|
23
|
-
}
|
|
24
20
|
export interface Transaction {
|
|
25
21
|
id: number;
|
|
26
|
-
transaction_type:
|
|
22
|
+
transaction_type: TransactionType;
|
|
27
23
|
from_address: string;
|
|
28
24
|
to_address: string;
|
|
29
25
|
network: string;
|
|
30
|
-
from_app_slug:
|
|
26
|
+
from_app_slug: string;
|
|
31
27
|
currency_slug: string;
|
|
32
28
|
fee: string;
|
|
33
29
|
amount: string;
|
|
@@ -36,10 +32,19 @@ export interface Transaction {
|
|
|
36
32
|
user_updated: string;
|
|
37
33
|
date_created: string;
|
|
38
34
|
date_updated: null;
|
|
39
|
-
description: null
|
|
35
|
+
description: null;
|
|
40
36
|
from_locked_balance: null;
|
|
41
37
|
to_locked_balance: null;
|
|
38
|
+
}
|
|
39
|
+
export interface TransactionType {
|
|
40
|
+
id: number;
|
|
41
|
+
status: string;
|
|
42
|
+
name: string;
|
|
43
|
+
slug: TransactionSlug;
|
|
44
|
+
description: null;
|
|
42
45
|
icon: string;
|
|
46
|
+
link: string;
|
|
47
|
+
icon_svg: string;
|
|
43
48
|
}
|
|
44
49
|
export declare enum TransactionSlug {
|
|
45
50
|
All = "all",
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactionStatus = exports.TransactionSlug = void 0;
|
|
4
|
+
// export interface Transaction {
|
|
5
|
+
// id: number;
|
|
6
|
+
// transaction_type: TransactionSlug;
|
|
7
|
+
// from_address: string;
|
|
8
|
+
// to_address: string;
|
|
9
|
+
// network: string;
|
|
10
|
+
// from_app_slug: null | string;
|
|
11
|
+
// currency_slug: string;
|
|
12
|
+
// fee: string;
|
|
13
|
+
// amount: string;
|
|
14
|
+
// transaction_status: TransactionStatus;
|
|
15
|
+
// user_created: string;
|
|
16
|
+
// user_updated: string;
|
|
17
|
+
// date_created: string;
|
|
18
|
+
// date_updated: null;
|
|
19
|
+
// description: null | string;
|
|
20
|
+
// from_locked_balance: null;
|
|
21
|
+
// to_locked_balance: null;
|
|
22
|
+
// icon: string;
|
|
23
|
+
// }
|
|
4
24
|
var TransactionSlug;
|
|
5
25
|
(function (TransactionSlug) {
|
|
6
26
|
TransactionSlug["All"] = "all";
|