tek-wallet 0.0.709 → 0.0.713
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/ui/IncomeWallet/components/AnalyticGroup.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/AnalyticGroup.js +87 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.js +2 -2
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.d.ts +7 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.js +60 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.d.ts +6 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.js +12 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +98 -33
- package/dist/components/TekWallet/components/ui/IncomeWallet/types/transaction.history.dto.d.ts +15 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/types/transaction.history.dto.js +2 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/types/userinfo.dto.d.ts +12 -0
- package/dist/components/TekWallet/components/ui/IncomeWallet/types/userinfo.dto.js +2 -0
- package/dist/components/TekWallet/components/ui/SendExternalTokenWithdrawn/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/SendExternalTokenWithdrawn/index.js +2 -2
- package/dist/components/TekWallet/components/ui/SwapToken/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/SwapToken/index.js +12 -11
- package/dist/components/TekWallet/components/ui/UpdateLockToken/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../../types/ui";
|
|
2
|
+
import { UserInfoDto } from "../types/userinfo.dto";
|
|
3
|
+
interface AnalyticGroupProps extends GeneralProps {
|
|
4
|
+
timeRange?: string;
|
|
5
|
+
userInfo?: UserInfoDto;
|
|
6
|
+
}
|
|
7
|
+
declare const AnalyticGroup: (props: AnalyticGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default AnalyticGroup;
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var material_1 = require("@mui/material");
|
|
19
|
+
var Text_1 = __importDefault(require("../../Text"));
|
|
20
|
+
var Formatter_1 = __importDefault(require("../../Formatter"));
|
|
21
|
+
var providers_1 = require("../../../../providers");
|
|
22
|
+
var ContentHiddenProvider_1 = require("../../../../providers/ContentHiddenProvider");
|
|
23
|
+
var SvgPath_1 = require("../../SvgPath");
|
|
24
|
+
var Column_1 = __importDefault(require("../../Column"));
|
|
25
|
+
var Spacer_1 = __importDefault(require("../../Spacer"));
|
|
26
|
+
var AnalyticGroup = function (props) {
|
|
27
|
+
var _a;
|
|
28
|
+
var theme = (0, providers_1.useTheme)();
|
|
29
|
+
var _b = (0, ContentHiddenProvider_1.useContentHidden)(), isHidden = _b.isHidden, setIsHidden = _b.setIsHidden;
|
|
30
|
+
var userInfo = props.userInfo;
|
|
31
|
+
var toggleHidden = function () {
|
|
32
|
+
setIsHidden(!isHidden);
|
|
33
|
+
};
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(Column_1.default, { children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: {
|
|
35
|
+
fontSize: theme.typography.fontSize12,
|
|
36
|
+
fontWeight: theme.typography.fontWeight500,
|
|
37
|
+
color: theme.palette.text.accent2,
|
|
38
|
+
}, children: ["Welcome, ", userInfo === null || userInfo === void 0 ? void 0 : userInfo.accountName, "!"] }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, position: "relative", bottom: "30px" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
39
|
+
fontSize: theme.typography.fontSize15,
|
|
40
|
+
fontWeight: theme.typography.fontWeight500,
|
|
41
|
+
color: theme.palette.text.accent2,
|
|
42
|
+
}, children: "Total Amount" }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { onClick: toggleHidden, sx: { cursor: "pointer", width: 14, height: 14 }, children: SvgPath_1.IC_NO_SEE })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
alignItems: "flex-end",
|
|
46
|
+
gap: theme.mixins.gaps.g6,
|
|
47
|
+
fontSize: theme.typography.fontSize12,
|
|
48
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.g6 }), children: !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { sx: { fontWeight: theme.typography.fontWeight700 }, value: (_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo.amount) !== null && _a !== void 0 ? _a : 0 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
49
|
+
fontWeight: theme.typography.fontWeight400,
|
|
50
|
+
fontSize: "0.8em",
|
|
51
|
+
}, children: "WealthS" }), (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: {
|
|
52
|
+
fontSize: theme.typography.fontSize24,
|
|
53
|
+
fontWeight: theme.typography.fontWeight700,
|
|
54
|
+
color: theme.palette.text.black,
|
|
55
|
+
}, children: "*****" })) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
56
|
+
fontWeight: theme.typography.fontWeight600,
|
|
57
|
+
leading: theme.typography.leading140,
|
|
58
|
+
fontSize: theme.typography.fontSize12,
|
|
59
|
+
textTransform: "capitalize",
|
|
60
|
+
color: theme.palette.text.accent,
|
|
61
|
+
}, children: props.timeRange }), !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 8, height: 8 }, children: SvgPath_1.ARROW_DROP_UP }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.alertStatus, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight600, borderBottom: "1px dashed currentColor" }), children: "5.63 (+3,22%)" })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
62
|
+
fontSize: theme.typography.fontSize12,
|
|
63
|
+
fontWeight: theme.typography.fontWeight600,
|
|
64
|
+
color: theme.palette.text.accent2,
|
|
65
|
+
display: theme.mixins.row,
|
|
66
|
+
}, children: "****" }))] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
67
|
+
width: "110%",
|
|
68
|
+
borderColor: "".concat(theme.palette.border.accent),
|
|
69
|
+
opacity: 0.2,
|
|
70
|
+
marginTop: theme.mixins.customMargin.m4,
|
|
71
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
72
|
+
fontWeight: theme.typography.fontWeight500,
|
|
73
|
+
leading: theme.typography.leading140,
|
|
74
|
+
fontSize: theme.typography.fontSize12,
|
|
75
|
+
textTransform: "capitalize",
|
|
76
|
+
color: theme.palette.text.accent,
|
|
77
|
+
}, children: "Profit" }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: !isHidden ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
78
|
+
fontSize: theme.typography.fontSize12,
|
|
79
|
+
fontWeight: theme.typography.fontWeight600,
|
|
80
|
+
color: theme.palette.text.accent2,
|
|
81
|
+
}, children: "\u2248 250 WealthS" }) })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
82
|
+
fontSize: theme.typography.fontSize12,
|
|
83
|
+
fontWeight: theme.typography.fontWeight600,
|
|
84
|
+
color: theme.palette.text.accent2,
|
|
85
|
+
}, children: "****" })) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 14, height: 14 }, children: SvgPath_1.IC_INFORMATION })] })] })] })] }));
|
|
86
|
+
};
|
|
87
|
+
exports.default = AnalyticGroup;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { GeneralProps } from "../../../../types/ui";
|
|
2
|
+
import { UserInfoDto } from "../types/userinfo.dto";
|
|
2
3
|
interface BalanceChartProps extends GeneralProps {
|
|
4
|
+
userInfo?: UserInfoDto;
|
|
3
5
|
}
|
|
4
6
|
declare const BalanceChart: (props: BalanceChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default BalanceChart;
|
|
@@ -51,13 +51,13 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
51
51
|
var react_1 = require("react");
|
|
52
52
|
var framer_motion_1 = require("framer-motion");
|
|
53
53
|
var material_1 = require("@mui/material");
|
|
54
|
-
var AnalyticGroup_1 = __importDefault(require("../../AnalyticGroup"));
|
|
55
54
|
var TimeFilter_1 = __importStar(require("../../TimeFilter"));
|
|
56
55
|
var ContentHiddenProvider_1 = require("../../../../providers/ContentHiddenProvider");
|
|
57
56
|
var providers_1 = require("../../../../providers");
|
|
58
57
|
var DelayMounted_1 = __importDefault(require("../../DelayMounted"));
|
|
59
58
|
var NeonLineChart_1 = __importDefault(require("../../NeonLineChart"));
|
|
60
59
|
var SvgPath_1 = require("../../SvgPath");
|
|
60
|
+
var AnalyticGroup_1 = __importDefault(require("./AnalyticGroup"));
|
|
61
61
|
var fakeSeries = [
|
|
62
62
|
{
|
|
63
63
|
name: "All",
|
|
@@ -117,7 +117,7 @@ var BalanceChart = function (props) {
|
|
|
117
117
|
var toggleExpand = function () {
|
|
118
118
|
setExpandAreaChart(function (prev) { return !prev; });
|
|
119
119
|
};
|
|
120
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, props.sx), { width: "100%" }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(AnalyticGroup_1.default, { timeRange: timeRangeData === null || timeRangeData === void 0 ? void 0 : timeRangeData.type }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { position: "relative", marginTop: theme.mixins.customMargin.m12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, props.sx), { width: "100%" }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(AnalyticGroup_1.default, { timeRange: timeRangeData === null || timeRangeData === void 0 ? void 0 : timeRangeData.type, userInfo: props.userInfo }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { position: "relative", marginTop: theme.mixins.customMargin.m12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
121
121
|
width: "100%",
|
|
122
122
|
position: "relative",
|
|
123
123
|
transition: "all 500ms ease-in-out",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var Row_1 = __importDefault(require("../../Row"));
|
|
8
|
+
var Column_1 = __importDefault(require("../../Column"));
|
|
9
|
+
var Text_1 = __importDefault(require("../../Text"));
|
|
10
|
+
var providers_1 = require("../../../../providers");
|
|
11
|
+
var Spacer_1 = __importDefault(require("../../Spacer"));
|
|
12
|
+
var convertIntoPrice = function (amount) {
|
|
13
|
+
return amount.toLocaleString("en-US", {
|
|
14
|
+
style: "currency",
|
|
15
|
+
currency: "USD",
|
|
16
|
+
minimumFractionDigits: 0,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var HistoryItem = function (_a) {
|
|
20
|
+
var _b, _c;
|
|
21
|
+
var tradeHistory = _a.tradeHistory;
|
|
22
|
+
var theme = (0, providers_1.useTheme)();
|
|
23
|
+
var isIncome = ((_b = tradeHistory.inOut) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "in";
|
|
24
|
+
var sign = isIncome ? "+" : "-";
|
|
25
|
+
var amount = convertIntoPrice((_c = tradeHistory.amount) !== null && _c !== void 0 ? _c : 0);
|
|
26
|
+
var amountColor = isIncome ? "#008000" : "#FF0000";
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(Row_1.default, { sx: {
|
|
28
|
+
borderBottom: "1px solid ".concat(theme.palette.border.accent3),
|
|
29
|
+
width: "100%",
|
|
30
|
+
justifyContent: "space-between",
|
|
31
|
+
padding: "0.5rem 0",
|
|
32
|
+
}, children: [(0, jsx_runtime_1.jsxs)(Column_1.default, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
33
|
+
fontSize: theme.typography.fontSize14,
|
|
34
|
+
fontWeight: theme.typography.fontWeight600,
|
|
35
|
+
lineHeight: theme.typography.leading140,
|
|
36
|
+
color: theme.palette.text.primary,
|
|
37
|
+
}, children: tradeHistory.itemCode }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
38
|
+
fontSize: theme.typography.fontSize11,
|
|
39
|
+
fontWeight: theme.typography.fontWeight400,
|
|
40
|
+
lineHeight: theme.typography.leading140,
|
|
41
|
+
color: theme.palette.text.primary,
|
|
42
|
+
}, children: tradeHistory.content }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
43
|
+
fontSize: theme.typography.fontSize11,
|
|
44
|
+
fontWeight: theme.typography.fontWeight400,
|
|
45
|
+
lineHeight: theme.typography.leading140,
|
|
46
|
+
color: theme.palette.text.primary,
|
|
47
|
+
}, children: tradeHistory.createTime })] }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: { color: amountColor }, children: [sign, amount] })] })
|
|
48
|
+
// <div style={styles.row}>
|
|
49
|
+
// <div style={styles.leftColumn}>
|
|
50
|
+
// <div style={styles.itemCode}>{tradeHistory.itemCode}</div>
|
|
51
|
+
// <div style={styles.content}>{tradeHistory.content}</div>
|
|
52
|
+
// <div style={styles.createTime}>{tradeHistory.createTime}</div>
|
|
53
|
+
// </div>
|
|
54
|
+
// <div style={{ ...styles.amount, color: amountColor }}>
|
|
55
|
+
// {sign}{amount}
|
|
56
|
+
// </div>
|
|
57
|
+
// </div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
exports.default = HistoryItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TransactionHistoryDto } from "../../types/transaction.history.dto";
|
|
2
|
+
interface TransactionHistoryProps {
|
|
3
|
+
listItem: TransactionHistoryDto[];
|
|
4
|
+
}
|
|
5
|
+
export default function TransactionHistory(props: TransactionHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export type { TransactionHistoryProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = TransactionHistory;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var Column_1 = __importDefault(require("../../../Column"));
|
|
9
|
+
var HistoryItem_1 = __importDefault(require("../HistoryItem"));
|
|
10
|
+
function TransactionHistory(props) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(Column_1.default, { children: props.listItem.map(function (item) { return ((0, jsx_runtime_1.jsx)(HistoryItem_1.default, { tradeHistory: item }, item.id)); }) }));
|
|
12
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { TransactionHistoryDto } from "./types/transaction.history.dto";
|
|
2
|
+
import { UserInfoDto } from "./types/userinfo.dto";
|
|
1
3
|
interface IncomeWalletProps {
|
|
2
4
|
balance: number;
|
|
3
5
|
getTransactionHistory: () => Promise<any>;
|
|
4
6
|
withdraw: (amount: string) => Promise<any>;
|
|
5
7
|
deposit: (amount: string) => Promise<any>;
|
|
8
|
+
transactionHistory?: TransactionHistoryDto[];
|
|
9
|
+
userInfo?: UserInfoDto;
|
|
6
10
|
}
|
|
7
11
|
export declare const IncomeWallet: (props: IncomeWalletProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export default IncomeWallet;
|
|
@@ -19,8 +19,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.IncomeWallet = void 0;
|
|
20
20
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
21
|
var material_1 = require("@mui/material");
|
|
22
|
-
var DefaultPageLayout_1 = __importDefault(require("../../layouts/DefaultPageLayout"));
|
|
23
|
-
var TokensBoard_1 = __importDefault(require("../TokensBoard"));
|
|
24
22
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
25
23
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
26
24
|
var BalanceChart_1 = __importDefault(require("./components/BalanceChart"));
|
|
@@ -29,41 +27,108 @@ var Text_1 = __importDefault(require("../Text"));
|
|
|
29
27
|
var SvgPath_1 = require("../SvgPath");
|
|
30
28
|
var FunctionItem_1 = __importDefault(require("./components/FunctionItem"));
|
|
31
29
|
var WealthWithdraw_1 = __importDefault(require("./components/WealthWithdraw"));
|
|
30
|
+
var history_1 = __importDefault(require("./components/history"));
|
|
31
|
+
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
32
|
+
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
33
|
+
var Column_1 = __importDefault(require("../Column"));
|
|
34
|
+
var Spacer_1 = __importDefault(require("../Spacer"));
|
|
32
35
|
var IncomeWallet = function (props) {
|
|
36
|
+
var _a;
|
|
33
37
|
var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
|
|
34
38
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isInitPasscode && ((0, jsx_runtime_1.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, __assign({}, props, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "WealthS" }), children: (0, jsx_runtime_1.jsxs)(Column_1.default, { sx: {
|
|
40
|
+
paddingLeft: theme.mixins.customPadding.p16,
|
|
41
|
+
paddingRight: theme.mixins.customPadding.p16,
|
|
42
|
+
}, children: [(0, jsx_runtime_1.jsx)(BalanceChart_1.default, { userInfo: {
|
|
43
|
+
amount: 1000000,
|
|
44
|
+
accountName: "TEKPAY-01",
|
|
45
|
+
interestRate: 0.01,
|
|
46
|
+
bankAcc: "1234567890",
|
|
47
|
+
address: "1234567890",
|
|
48
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
49
|
+
display: "grid",
|
|
50
|
+
gridTemplateColumns: "repeat(4, 1fr)",
|
|
51
|
+
gap: theme.mixins.gaps.g12,
|
|
52
|
+
position: "relative",
|
|
53
|
+
zIndex: 50,
|
|
54
|
+
my: theme.mixins.customMargin.m20,
|
|
55
|
+
paddingTop: theme.mixins.customPadding.p16,
|
|
56
|
+
paddingBottom: theme.mixins.customPadding.p8,
|
|
57
|
+
backgroundColor: theme.palette.background.tertiary,
|
|
58
|
+
borderRadius: theme.mixins.customRadius.r16,
|
|
59
|
+
"& .MuiListItem-root, & .MuiListItem-root *": {
|
|
60
|
+
color: theme.palette.text.primary,
|
|
61
|
+
fontWeight: theme.typography.fontWeight600,
|
|
62
|
+
},
|
|
63
|
+
}, children: [(0, jsx_runtime_1.jsx)(WealthDeposit_1.default, { onContinue: function (amount) {
|
|
64
|
+
props.deposit(amount);
|
|
65
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
|
|
66
|
+
borderRight: "1px solid ".concat(theme.palette.border.accent3),
|
|
67
|
+
placeContent: "center",
|
|
68
|
+
columnSpan: 1,
|
|
69
|
+
}, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: SvgPath_1.IC_DEPOSIT, width: 30, height: 30, label: "Topup", sx: {
|
|
70
|
+
width: "100%",
|
|
71
|
+
} }) }) }), (0, jsx_runtime_1.jsx)(WealthWithdraw_1.default, { onContinue: function (amount) {
|
|
72
|
+
props.deposit(amount);
|
|
73
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
|
|
74
|
+
borderRight: "1px solid ".concat(theme.palette.border.accent3),
|
|
75
|
+
placeContent: "center",
|
|
76
|
+
columnSpan: 1,
|
|
77
|
+
}, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: SvgPath_1.IC_WITHDRAW, width: 30, height: 30, label: "Withdraw", sx: {
|
|
78
|
+
width: "100%",
|
|
79
|
+
} }) }) })] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
80
|
+
fontWeight: theme.typography.fontWeight700,
|
|
81
|
+
leading: theme.typography.leading140,
|
|
82
|
+
fontSize: theme.typography.fontSize18,
|
|
83
|
+
textTransform: "capitalize",
|
|
47
84
|
color: theme.palette.text.primary,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
}, children: "History" }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }), (0, jsx_runtime_1.jsx)(history_1.default, { listItem: (_a = props.transactionHistory) !== null && _a !== void 0 ? _a : [
|
|
86
|
+
{
|
|
87
|
+
id: 1,
|
|
88
|
+
merchantCode: "Merchant 1",
|
|
89
|
+
destinationAccount: "1234567890",
|
|
90
|
+
sourceAccount: "1234567890",
|
|
91
|
+
amount: 100,
|
|
92
|
+
createTime: "2021-01-01",
|
|
93
|
+
inOut: "in",
|
|
94
|
+
content: "Merchant 1 transfer to Merchant 2",
|
|
95
|
+
tradeType: "tradeType 1",
|
|
96
|
+
itemCode: "itemCode 1",
|
|
97
|
+
request: "request 1",
|
|
98
|
+
syncDip: 1,
|
|
99
|
+
status: 1,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 2,
|
|
103
|
+
merchantCode: "Merchant 2",
|
|
104
|
+
destinationAccount: "1234567890",
|
|
105
|
+
sourceAccount: "1234567890",
|
|
106
|
+
amount: 200,
|
|
107
|
+
createTime: "2021-01-01",
|
|
108
|
+
inOut: "out",
|
|
109
|
+
content: "Merchant 2 transfer to Merchant 3",
|
|
110
|
+
tradeType: "tradeType 2",
|
|
111
|
+
itemCode: "itemCode 2",
|
|
112
|
+
request: "request 2",
|
|
113
|
+
syncDip: 2,
|
|
114
|
+
status: 2,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 3,
|
|
118
|
+
merchantCode: "Merchant 3",
|
|
119
|
+
destinationAccount: "1234567890",
|
|
120
|
+
sourceAccount: "1234567890",
|
|
121
|
+
amount: 300,
|
|
122
|
+
createTime: "2021-01-01",
|
|
123
|
+
inOut: "in",
|
|
124
|
+
content: "Merchant 3 transfer to Merchant 1",
|
|
125
|
+
tradeType: "tradeType 3",
|
|
126
|
+
itemCode: "itemCode 3",
|
|
127
|
+
request: "request 3",
|
|
128
|
+
syncDip: 3,
|
|
129
|
+
status: 3,
|
|
130
|
+
},
|
|
131
|
+
] })] }) })))] }));
|
|
67
132
|
};
|
|
68
133
|
exports.IncomeWallet = IncomeWallet;
|
|
69
134
|
exports.default = exports.IncomeWallet;
|
package/dist/components/TekWallet/components/ui/IncomeWallet/types/transaction.history.dto.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TransactionHistoryDto {
|
|
2
|
+
id?: number;
|
|
3
|
+
merchantCode?: string;
|
|
4
|
+
destinationAccount?: string;
|
|
5
|
+
sourceAccount?: string;
|
|
6
|
+
amount?: number;
|
|
7
|
+
content?: string;
|
|
8
|
+
createTime?: string;
|
|
9
|
+
inOut?: string;
|
|
10
|
+
tradeType?: string;
|
|
11
|
+
itemCode?: string;
|
|
12
|
+
request?: any;
|
|
13
|
+
syncDip?: number;
|
|
14
|
+
status?: number;
|
|
15
|
+
}
|
|
@@ -9,10 +9,11 @@ export interface SendExternalTokenWithdrawnProps extends Omit<ConfirmLayoutProps
|
|
|
9
9
|
onSuccess?: (data: SendExternalResponse) => any;
|
|
10
10
|
onStart?: () => void;
|
|
11
11
|
onFinish?: () => void;
|
|
12
|
+
onError?: (error: Error | unknown) => void;
|
|
12
13
|
children: React.ReactNode;
|
|
13
14
|
trigger: React.ReactNode;
|
|
14
15
|
btnConfirm?: React.ReactNode;
|
|
15
16
|
overrideHeader?: React.ReactNode;
|
|
16
17
|
}
|
|
17
|
-
declare const SendExternalTokenWithdrawn: ({ sendExternalData, onSuccess, onStart, onFinish, children, trigger, btnConfirm, overrideHeader, }: SendExternalTokenWithdrawnProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const SendExternalTokenWithdrawn: ({ sendExternalData, onSuccess, onStart, onFinish, onError, children, trigger, btnConfirm, overrideHeader, }: SendExternalTokenWithdrawnProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default SendExternalTokenWithdrawn;
|
|
@@ -94,7 +94,7 @@ var send_external_service_1 = __importDefault(require("../../../services/axios/s
|
|
|
94
94
|
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
95
95
|
var transactionSlug = type_1.TransactionSlug.Withdrawn;
|
|
96
96
|
var SendExternalTokenWithdrawn = function (_a) {
|
|
97
|
-
var sendExternalData = _a.sendExternalData, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinish = _a.onFinish, children = _a.children, trigger = _a.trigger, btnConfirm = _a.btnConfirm, overrideHeader = _a.overrideHeader;
|
|
97
|
+
var sendExternalData = _a.sendExternalData, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinish = _a.onFinish, onError = _a.onError, children = _a.children, trigger = _a.trigger, btnConfirm = _a.btnConfirm, overrideHeader = _a.overrideHeader;
|
|
98
98
|
var _b = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _b[0], setButtonStatus = _b[1];
|
|
99
99
|
var network = sendExternalData.network;
|
|
100
100
|
var confirmLayoutDrawerRef = (0, react_1.useRef)(null);
|
|
@@ -121,7 +121,7 @@ var SendExternalTokenWithdrawn = function (_a) {
|
|
|
121
121
|
return [3 /*break*/, 4];
|
|
122
122
|
case 2:
|
|
123
123
|
err_1 = _b.sent();
|
|
124
|
-
|
|
124
|
+
onError === null || onError === void 0 ? void 0 : onError(err_1);
|
|
125
125
|
setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
126
126
|
setTimeout(function () {
|
|
127
127
|
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
@@ -10,6 +10,7 @@ interface SwapTokenProps extends Omit<ConfirmLayoutProps, "action"> {
|
|
|
10
10
|
initFeeData?: FeesDataType;
|
|
11
11
|
onStart?: () => void;
|
|
12
12
|
onFinish?: () => void;
|
|
13
|
+
onError?: (error: Error | unknown) => void;
|
|
13
14
|
sx?: SxProps;
|
|
14
15
|
btnConfirm?: React.ReactNode;
|
|
15
16
|
children?: React.ReactNode;
|
|
@@ -130,7 +130,7 @@ exports.SwapToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
130
130
|
var amount = props.sendData.amount;
|
|
131
131
|
var fromTokenSlug = props.sendData.currency_slug;
|
|
132
132
|
var toTokenSlug = props.sendData.to_currency_slug;
|
|
133
|
-
var sx = props.sx, children = props.children, btnConfirm = props.btnConfirm, trigger = props.trigger, overrideHeader = props.overrideHeader
|
|
133
|
+
var sx = props.sx, children = props.children, btnConfirm = props.btnConfirm, trigger = props.trigger, overrideHeader = props.overrideHeader;
|
|
134
134
|
var fromToken = (0, react_1.useMemo)(function () {
|
|
135
135
|
return fromTokens === null || fromTokens === void 0 ? void 0 : fromTokens.find(function (token) { return token.slug === fromTokenSlug; });
|
|
136
136
|
}, [fromTokenSlug, fromTokens]);
|
|
@@ -206,19 +206,20 @@ exports.SwapToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
206
206
|
}); }, [validateAmount, getEstimateFee]);
|
|
207
207
|
var handleSwapToken = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
208
|
var response, err_1;
|
|
209
|
-
var _a, _b;
|
|
210
|
-
return __generator(this, function (
|
|
211
|
-
switch (
|
|
209
|
+
var _a, _b, _c, _d, _e;
|
|
210
|
+
return __generator(this, function (_f) {
|
|
211
|
+
switch (_f.label) {
|
|
212
212
|
case 0:
|
|
213
|
-
|
|
213
|
+
_f.trys.push([0, 2, 3, 4]);
|
|
214
|
+
(_a = props.onStart) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
214
215
|
setButtonStatus(Button_1.BUTTON_STATUS.LOADING);
|
|
215
216
|
return [4 /*yield*/, (0, swap_service_1.default)(__assign(__assign({}, props.sendData), { passcode: passcode }))];
|
|
216
217
|
case 1:
|
|
217
|
-
response =
|
|
218
|
+
response = _f.sent();
|
|
218
219
|
if (response.success) {
|
|
219
|
-
(
|
|
220
|
+
(_b = confirmLayoutDrawerRef.current) === null || _b === void 0 ? void 0 : _b.close();
|
|
220
221
|
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
221
|
-
(
|
|
222
|
+
(_c = props.onSuccess) === null || _c === void 0 ? void 0 : _c.call(props, response);
|
|
222
223
|
setTimeout(function () {
|
|
223
224
|
var _a;
|
|
224
225
|
(_a = activitiesRef.current) === null || _a === void 0 ? void 0 : _a.openTab(0);
|
|
@@ -229,15 +230,15 @@ exports.SwapToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
229
230
|
}
|
|
230
231
|
return [3 /*break*/, 4];
|
|
231
232
|
case 2:
|
|
232
|
-
err_1 =
|
|
233
|
-
|
|
233
|
+
err_1 = _f.sent();
|
|
234
|
+
(_d = props.onError) === null || _d === void 0 ? void 0 : _d.call(props, err_1);
|
|
234
235
|
setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
235
236
|
setTimeout(function () {
|
|
236
237
|
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
237
238
|
}, 1200);
|
|
238
239
|
return [3 /*break*/, 4];
|
|
239
240
|
case 3:
|
|
240
|
-
onFinish === null ||
|
|
241
|
+
(_e = props.onFinish) === null || _e === void 0 ? void 0 : _e.call(props);
|
|
241
242
|
return [7 /*endfinally*/];
|
|
242
243
|
case 4: return [2 /*return*/];
|
|
243
244
|
}
|
|
@@ -108,6 +108,7 @@ var UpdateLockTokenError;
|
|
|
108
108
|
UpdateLockTokenError["MIN_AMOUNT"] = "Min amount";
|
|
109
109
|
UpdateLockTokenError["FAILED"] = "Failed";
|
|
110
110
|
})(UpdateLockTokenError || (exports.UpdateLockTokenError = UpdateLockTokenError = {}));
|
|
111
|
+
//
|
|
111
112
|
exports.UpdateLockToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
112
113
|
var _a;
|
|
113
114
|
var theme = (0, ThemeProvider_1.useTheme)();
|