tek-wallet 0.0.603 → 0.0.605
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/ConfirmLayout/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/ConfirmLayout/index.js +48 -5
- package/dist/components/TekWallet/components/ui/ConfirmLayout copy/index.d.ts +7 -0
- package/dist/components/TekWallet/components/ui/ConfirmLayout copy/index.js +66 -0
- package/dist/components/TekWallet/components/ui/Fees/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/Fees/index.js +47 -18
- package/dist/components/TekWallet/components/ui/Icon/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/IconText/index.d.ts +9 -0
- package/dist/components/TekWallet/components/ui/IconText/index.js +25 -0
- package/dist/components/TekWallet/components/ui/LineValue/index.d.ts +4 -0
- package/dist/components/TekWallet/components/ui/LineValue/index.js +1 -1
- package/dist/components/TekWallet/components/ui/PageHeader/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/PageHeader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferInfo.d.ts +11 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferInfo.js +80 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferTarget.d.ts +6 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/components/transferTarget.js +39 -0
- package/dist/components/TekWallet/components/ui/TransferInternal/index.d.ts +5 -2
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +119 -32
- package/dist/components/TekWallet/components/ui/TransferInternal/type.d.ts +12 -0
- package/dist/components/TekWallet/components/ui/UserInfo/index.d.ts +9 -0
- package/dist/components/TekWallet/components/ui/UserInfo/index.js +30 -0
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.d.ts +2 -0
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +6 -2
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +3 -3
- package/dist/components/TekWallet/services/axios/get-send-tokens-list-service/type.d.ts +1 -0
- package/dist/components/TekWallet/theme/mui/theme.js +6 -0
- package/dist/components/TekWallet/types/expose-type.d.ts +10 -0
- package/dist/components/TekWallet/utils/safeText.d.ts +6 -0
- package/dist/components/TekWallet/utils/safeText.js +22 -0
- package/package.json +1 -1
|
@@ -2,6 +2,10 @@ import { DrawerComponentProps, DrawerComponentRef } from "../DrawerComponent";
|
|
|
2
2
|
import { TransactionSlug } from "../../../services/axios/get-activities-service/type";
|
|
3
3
|
export interface ConfirmLayoutProps extends DrawerComponentProps {
|
|
4
4
|
action: TransactionSlug;
|
|
5
|
+
title?: string;
|
|
6
|
+
transferAmount?: number;
|
|
7
|
+
link?: string;
|
|
8
|
+
currency?: string;
|
|
5
9
|
}
|
|
6
10
|
declare const ConfirmLayout: import("react").ForwardRefExoticComponent<Omit<ConfirmLayoutProps, "ref"> & import("react").RefAttributes<DrawerComponentRef>>;
|
|
7
11
|
export default ConfirmLayout;
|
|
@@ -11,6 +11,39 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
return __assign.apply(this, arguments);
|
|
13
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
|
+
})();
|
|
14
47
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
15
48
|
var t = {};
|
|
16
49
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -27,13 +60,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
60
|
};
|
|
28
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
-
var Text_1 = __importDefault(require("../Text"));
|
|
31
63
|
var material_1 = require("@mui/material");
|
|
64
|
+
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
65
|
+
var react_1 = require("react");
|
|
66
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
67
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
32
68
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
69
|
+
var ChildPageLayout_1 = __importDefault(require("../../../layouts/ChildPageLayout"));
|
|
70
|
+
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
33
71
|
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
34
|
-
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
35
|
-
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
36
|
-
var react_1 = require("react");
|
|
37
72
|
var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
38
73
|
var children = props.children, rest = __rest(props, ["children"]);
|
|
39
74
|
var theme = (0, material_1.useTheme)();
|
|
@@ -60,7 +95,15 @@ var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
60
95
|
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.unlockStatus();
|
|
61
96
|
},
|
|
62
97
|
}); });
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, __assign({ ref: confirmByPasscodeDrawerRef }, rest, { children: (0, jsx_runtime_1.jsx)(
|
|
98
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, __assign({ direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, ref: confirmByPasscodeDrawerRef }, rest, { children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Transfer Summary", overrideBack: handleOnClose, rightAdornment: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("clock"), width: 20, height: 20, className: "absolute right-2" }) }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "center", gap: theme.mixins.gaps.g16, padding: theme.mixins.customPadding.p16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.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: props.title }), (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.transferAmount, sx: {
|
|
99
|
+
color: theme.palette.text.mainGreen,
|
|
100
|
+
fontSize: theme.typography.fontSize24,
|
|
101
|
+
fontWeight: theme.typography.fontWeight600,
|
|
102
|
+
} }), (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: {
|
|
103
|
+
fontWeight: theme.typography.fontWeight500,
|
|
104
|
+
fontSize: theme.typography.fontSize15,
|
|
105
|
+
color: theme.palette.text.accent2,
|
|
106
|
+
}, children: props.currency })] })] }), children] }) }) })));
|
|
64
107
|
});
|
|
65
108
|
ConfirmLayout.displayName = "ConfirmLayout";
|
|
66
109
|
exports.default = ConfirmLayout;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DrawerComponentProps, DrawerComponentRef } from "../DrawerComponent";
|
|
2
|
+
import { TransactionSlug } from "../../../services/axios/get-activities-service/type";
|
|
3
|
+
export interface ConfirmLayoutProps extends DrawerComponentProps {
|
|
4
|
+
action: TransactionSlug;
|
|
5
|
+
}
|
|
6
|
+
declare const ConfirmLayout: import("react").ForwardRefExoticComponent<Omit<ConfirmLayoutProps, "ref"> & import("react").RefAttributes<DrawerComponentRef>>;
|
|
7
|
+
export default ConfirmLayout;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17
|
+
t[p] = s[p];
|
|
18
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
19
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
20
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
21
|
+
t[p[i]] = s[p[i]];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
31
|
+
var material_1 = require("@mui/material");
|
|
32
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
33
|
+
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
34
|
+
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
35
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
36
|
+
var react_1 = require("react");
|
|
37
|
+
var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
38
|
+
var children = props.children, rest = __rest(props, ["children"]);
|
|
39
|
+
var theme = (0, material_1.useTheme)();
|
|
40
|
+
var confirmByPasscodeDrawerRef = (0, react_1.useRef)(null);
|
|
41
|
+
var handleOnClose = function () {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
44
|
+
};
|
|
45
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
46
|
+
open: function () {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
49
|
+
},
|
|
50
|
+
close: function () {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
53
|
+
},
|
|
54
|
+
lockStatus: function () {
|
|
55
|
+
var _a;
|
|
56
|
+
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.lockStatus();
|
|
57
|
+
},
|
|
58
|
+
unlockStatus: function () {
|
|
59
|
+
var _a;
|
|
60
|
+
(_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.unlockStatus();
|
|
61
|
+
},
|
|
62
|
+
}); });
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, __assign({ ref: confirmByPasscodeDrawerRef }, rest, { children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: handleOnClose, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "center", gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "center", gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 64, sx: {}, src: (0, getIcon_1.default)("wallet_logo") }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Confirm action" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.sessionTitle), { textTransform: "capitalize" }), children: props.action })] }), children] }) }) })));
|
|
64
|
+
});
|
|
65
|
+
ConfirmLayout.displayName = "ConfirmLayout";
|
|
66
|
+
exports.default = ConfirmLayout;
|
|
@@ -3,7 +3,7 @@ export interface FeesProps extends Omit<AccordionProps, "children"> {
|
|
|
3
3
|
feesData: string;
|
|
4
4
|
amount: number;
|
|
5
5
|
isFeePaidByAmount?: boolean;
|
|
6
|
-
onEnoughBalanceToPayFee?: () => void;
|
|
6
|
+
onEnoughBalanceToPayFee?: (isEnough: boolean) => void;
|
|
7
7
|
onNotEnoughBalanceToPayFee?: () => void;
|
|
8
8
|
tokenSlug: string;
|
|
9
9
|
}
|
|
@@ -28,7 +28,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
29
|
var material_1 = require("@mui/material");
|
|
30
30
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
31
|
-
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
32
31
|
var Text_1 = __importDefault(require("../Text"));
|
|
33
32
|
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
34
33
|
var jsx_runtime_2 = require("react/jsx-runtime");
|
|
@@ -36,6 +35,7 @@ var parsePropsData_1 = __importDefault(require("../../../utils/parsePropsData"))
|
|
|
36
35
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
37
36
|
var react_1 = require("react");
|
|
38
37
|
var ReceiveFunction_1 = __importDefault(require("../ReceiveFunction"));
|
|
38
|
+
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
39
39
|
function Fees(props) {
|
|
40
40
|
var sx = props.sx, amount = props.amount, feesDataString = props.feesData, isFeePaidByAmount = props.isFeePaidByAmount, tokenSlug = props.tokenSlug, rest = __rest(props, ["sx", "amount", "feesData", "isFeePaidByAmount", "tokenSlug"]);
|
|
41
41
|
var theme = (0, material_1.useTheme)();
|
|
@@ -50,8 +50,12 @@ function Fees(props) {
|
|
|
50
50
|
return +((_a = tokenMustBePaidFee === null || tokenMustBePaidFee === void 0 ? void 0 : tokenMustBePaidFee.current_value) !== null && _a !== void 0 ? _a : 0);
|
|
51
51
|
}, [isFeePaidByAmount, amount, tokenSlug, tokens]);
|
|
52
52
|
var feeCheckedBalance = (0, react_1.useMemo)(function () {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
var feeDetail = (_a = feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail) !== null && _a !== void 0 ? _a : [];
|
|
55
|
+
if (feeDetail.length > 0) {
|
|
56
|
+
(_b = props.onEnoughBalanceToPayFee) === null || _b === void 0 ? void 0 : _b.call(props, true);
|
|
57
|
+
}
|
|
58
|
+
return ((_c = feeDetail === null || feeDetail === void 0 ? void 0 : feeDetail.map(function (fee, index, array) {
|
|
55
59
|
var _a, _b;
|
|
56
60
|
var totalFeeInCurrency = array === null || array === void 0 ? void 0 : array.reduce(function (acc, feeDetail) {
|
|
57
61
|
var _a, _b;
|
|
@@ -61,43 +65,61 @@ function Fees(props) {
|
|
|
61
65
|
return acc;
|
|
62
66
|
}, 0);
|
|
63
67
|
var balanceUseToPaidFee = getBalanceUseToPaidFee((_b = (_a = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _a === void 0 ? void 0 : _a.slug) !== null && _b !== void 0 ? _b : "");
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
var isEnoughBalanceToPay = balanceUseToPaidFee >= totalFeeInCurrency;
|
|
69
|
+
return __assign(__assign({}, fee), { isEnoughBalanceToPay: isEnoughBalanceToPay });
|
|
70
|
+
})) !== null && _c !== void 0 ? _c : []);
|
|
66
71
|
}, [feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, getBalanceUseToPaidFee]);
|
|
67
72
|
var isEnoughBalanceToPayFee = (0, react_1.useMemo)(function () {
|
|
68
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
var isEnoughBalanceToPay = feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.some(function (fee) { return !fee.isEnoughBalanceToPay; });
|
|
75
|
+
(_a = props.onEnoughBalanceToPayFee) === null || _a === void 0 ? void 0 : _a.call(props, isEnoughBalanceToPay);
|
|
76
|
+
return isEnoughBalanceToPay;
|
|
69
77
|
}, [feeCheckedBalance]);
|
|
70
78
|
var totalFeeInUSD = (0, react_1.useMemo)(function () {
|
|
71
79
|
return feesData === null || feesData === void 0 ? void 0 : feesData.feeInUSD;
|
|
72
80
|
}, [feesData]);
|
|
73
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, __assign({ defaultExpanded: true }, rest, { sx: __assign({ "&.MuiAccordion-root": {
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, __assign({ defaultExpanded: true }, rest, { disableGutters: true, sx: __assign({ "&.MuiAccordion-root": {
|
|
74
82
|
backgroundColor: "transparent",
|
|
75
83
|
margin: 0,
|
|
76
|
-
|
|
84
|
+
padding: 0,
|
|
85
|
+
borderRadius: 0,
|
|
77
86
|
}, "&.MuiAccordion-root::before": {
|
|
78
87
|
display: "none",
|
|
79
88
|
}, "& .MuiAccordionSummary-root": {
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
margin: 0,
|
|
90
|
+
padding: 0,
|
|
91
|
+
minHeight: 0,
|
|
82
92
|
}, "& .MuiAccordionSummary-content": {
|
|
93
|
+
margin: 0,
|
|
94
|
+
padding: 0,
|
|
83
95
|
display: "inline-block",
|
|
84
96
|
width: "100%",
|
|
85
97
|
}, "& .MuiAccordionSummary-content.Mui-expanded": {
|
|
86
|
-
|
|
87
|
-
marginBottom: theme.mixins.customMargin.m12,
|
|
98
|
+
margin: 0,
|
|
88
99
|
}, "& .MuiAccordionDetails-root": {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} }, sx), children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width:
|
|
100
|
+
margin: 0,
|
|
101
|
+
padding: 0,
|
|
102
|
+
} }, sx), children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width: 10, height: 10 }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
103
|
+
fontSize: theme.typography.fontSize11,
|
|
104
|
+
fontWeight: theme.typography.fontWeight500,
|
|
105
|
+
color: theme.palette.text.darkContrast,
|
|
106
|
+
}, children: "Total fees" }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
107
|
+
borderTop: "1px dashed ".concat(theme.palette.border.accent),
|
|
108
|
+
flex: 1,
|
|
109
|
+
height: "1px",
|
|
110
|
+
width: "100%",
|
|
111
|
+
ml: theme.mixins.gaps.g8,
|
|
112
|
+
mr: theme.mixins.gaps.g8,
|
|
113
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto", mr: theme.mixins.gaps.g8 }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: totalFeeInUSD, start: "~ $", disableTooltip: true }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.AccordionDetails, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8, pt: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { alignItems: "stretch" }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g8, alignItems: "center", justifyContent: "center" }), children: feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.map(function (item, index) {
|
|
92
114
|
var _a;
|
|
93
115
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_2.Fragment, { children: [index !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
94
116
|
borderRight: "1px dashed ".concat(theme.palette.border.white24),
|
|
95
117
|
flex: 1,
|
|
96
|
-
} })), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("timeline_dot"), width:
|
|
118
|
+
} })), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("timeline_dot"), width: 14, height: 14 })] }, (_a = item.feeType) === null || _a === void 0 ? void 0 : _a.name));
|
|
97
119
|
}) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { flex: 1, gap: theme.mixins.gaps.g8 }), children: feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.map(function (item) {
|
|
98
120
|
var _a, _b, _c;
|
|
99
121
|
return ((0, jsx_runtime_1.jsx)(FeeDetail, { feeName: (_a = item.feeType) === null || _a === void 0 ? void 0 : _a.name, feeInCurrency: item.feeInCurrency, feeInUSD: item.feeInUSD, currencyName: (_b = item.currency) === null || _b === void 0 ? void 0 : _b.name }, (_c = item.feeType) === null || _c === void 0 ? void 0 : _c.name));
|
|
100
|
-
}) })] }), isEnoughBalanceToPayFee && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: ["You don't have enough balance to pay the fee, please ", " ", (0, jsx_runtime_1.jsxs)(ReceiveFunction_1.default, { children: [" ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
122
|
+
}) })] }), !isEnoughBalanceToPayFee && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: ["You don't have enough balance to pay the fee, please ", " ", (0, jsx_runtime_1.jsxs)(ReceiveFunction_1.default, { children: [" ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
101
123
|
textDecoration: "underline",
|
|
102
124
|
cursor: "pointer",
|
|
103
125
|
fontWeight: theme.typography.fontWeight600,
|
|
@@ -107,5 +129,12 @@ exports.default = Fees;
|
|
|
107
129
|
var FeeDetail = function (_a) {
|
|
108
130
|
var feeName = _a.feeName, feeInCurrency = _a.feeInCurrency, feeInUSD = _a.feeInUSD, currencyName = _a.currencyName;
|
|
109
131
|
var theme = (0, material_1.useTheme)();
|
|
110
|
-
return ((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)(
|
|
132
|
+
return ((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: {
|
|
133
|
+
fontSize: theme.typography.fontSize11,
|
|
134
|
+
fontWeight: theme.typography.fontWeight500,
|
|
135
|
+
lineHeight: theme.typography.leading160,
|
|
136
|
+
color: theme.palette.text.accent,
|
|
137
|
+
pl: theme.mixins.gaps.g12,
|
|
138
|
+
whiteSpace: "nowrap",
|
|
139
|
+
}, children: feeName }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { flex: 1, width: "fit-content", alignItems: "flex-end" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: feeInCurrency, unit: " ".concat(currencyName) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: feeInUSD, start: "~ $" }) })] })] }));
|
|
111
140
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
2
|
+
interface IconTextProps {
|
|
3
|
+
title: string;
|
|
4
|
+
beforeIcon?: React.ReactNode | undefined;
|
|
5
|
+
afterIcon?: React.ReactNode | undefined;
|
|
6
|
+
sx?: SxProps;
|
|
7
|
+
}
|
|
8
|
+
export default function IconText(props: IconTextProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export type { IconTextProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
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 = IconText;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
20
|
+
var material_1 = require("@mui/material");
|
|
21
|
+
function IconText(props) {
|
|
22
|
+
var title = props.title, beforeIcon = props.beforeIcon, afterIcon = props.afterIcon, sx = props.sx;
|
|
23
|
+
var theme = (0, material_1.useTheme)();
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12 }), children: [beforeIcon && beforeIcon, (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, sx), children: title }), afterIcon && afterIcon] }));
|
|
25
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { SxProps } from "@mui/material";
|
|
2
3
|
import { ReactNode } from "react";
|
|
3
4
|
interface LineValueProps extends GeneralProps {
|
|
4
5
|
field?: ReactNode;
|
|
5
6
|
value?: ReactNode;
|
|
6
7
|
valueDescription?: ReactNode;
|
|
8
|
+
sxField?: SxProps;
|
|
9
|
+
sxValue?: SxProps;
|
|
10
|
+
sxValueDescription?: SxProps;
|
|
7
11
|
}
|
|
8
12
|
declare const LineValue: (props: LineValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
13
|
export default LineValue;
|
|
@@ -21,6 +21,6 @@ var material_1 = require("@mui/material");
|
|
|
21
21
|
var LineValue = function (props) {
|
|
22
22
|
var theme = (0, material_1.useTheme)();
|
|
23
23
|
var field = props.field, value = props.value, valueDescription = props.valueDescription;
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { alignItems: "
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { alignItems: "center", gap: theme.mixins.gaps.g32 }), props.sx), children: [!!field && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.valueDescription), props.sxField), { whiteSpace: "nowrap" }), children: field })), (!!value || !!valueDescription) && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { flex: 1, alignItems: "end", gap: theme.mixins.gaps.g2 }), children: [!!value && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.value), { textAlign: "right" }), props.sxValue), children: value })), !!valueDescription && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), props.sxValueDescription), children: valueDescription }))] }))] }));
|
|
25
25
|
};
|
|
26
26
|
exports.default = LineValue;
|
|
@@ -2,6 +2,7 @@ import { GeneralProps } from "../../../types/ui";
|
|
|
2
2
|
interface PageHeaderProps extends GeneralProps {
|
|
3
3
|
overrideBack?: (e: React.MouseEvent<HTMLDivElement>) => unknown;
|
|
4
4
|
title?: React.ReactNode;
|
|
5
|
+
rightAdornment?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
declare const PageHeader: (props: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default PageHeader;
|
|
@@ -21,6 +21,6 @@ var BackHeader_1 = __importDefault(require("../BackHeader"));
|
|
|
21
21
|
var Text_1 = __importDefault(require("../Text"));
|
|
22
22
|
var PageHeader = function (props) {
|
|
23
23
|
var theme = (0, material_1.useTheme)();
|
|
24
|
-
return ((0, jsx_runtime_1.
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(BackHeader_1.default, { overrideBack: props.overrideBack, sx: __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", height: "100%", position: "relative", paddingLeft: theme.mixins.pagePadding.paddingLeft, paddingRight: theme.mixins.pagePadding.paddingRight }, props.sx), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), theme.mixins.center), children: props.title }), props.rightAdornment && props.rightAdornment] }));
|
|
25
25
|
};
|
|
26
26
|
exports.default = PageHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
onEnoughBalanceToPayFee: (isEnough: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export default function TransferInfo(props: TransferInfoProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export type { TransferInfoProps };
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
function TransferInfo(props) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
var transferData = props.transferData, estimateFee = props.estimateFee, amount = props.amount, tokenSlug = props.tokenSlug;
|
|
31
|
+
var theme = (0, material_1.useTheme)();
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
33
|
+
fontWeight: theme.typography.fontWeight700,
|
|
34
|
+
color: theme.palette.primary.contrastText,
|
|
35
|
+
fontSize: theme.typography.fontSize18,
|
|
36
|
+
marginTop: theme.mixins.customMargin.m12,
|
|
37
|
+
}, children: "transferSummary" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "transferTo", sxField: {
|
|
38
|
+
fontSize: theme.typography.fontSize11,
|
|
39
|
+
fontWeight: theme.typography.fontWeight500,
|
|
40
|
+
color: theme.palette.text.darkContrast,
|
|
41
|
+
}, value: (0, jsx_runtime_1.jsx)(IconText_1.default, { title: (0, safeText_1.safeText)((_a = transferData.receiver) === null || _a === void 0 ? void 0 : _a.nick_name), sx: {
|
|
42
|
+
fontSize: theme.typography.fontSize14,
|
|
43
|
+
fontWeight: theme.typography.fontWeight700,
|
|
44
|
+
}, beforeIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_b = transferData.receiver) === null || _b === void 0 ? void 0 : _b.avatar, width: 24, height: 24, rounded: true }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "network", sxField: {
|
|
45
|
+
fontSize: theme.typography.fontSize11,
|
|
46
|
+
fontWeight: theme.typography.fontWeight500,
|
|
47
|
+
color: theme.palette.text.darkContrast,
|
|
48
|
+
}, value: (0, jsx_runtime_1.jsx)(IconText_1.default, { title: (0, safeText_1.safeText)(transferData.network), sx: {
|
|
49
|
+
fontSize: theme.typography.fontSize14,
|
|
50
|
+
fontWeight: theme.typography.fontWeight700,
|
|
51
|
+
}, beforeIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: transferData.link, width: 24, height: 24, rounded: true }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "address", sxField: {
|
|
52
|
+
fontSize: theme.typography.fontSize11,
|
|
53
|
+
fontWeight: theme.typography.fontWeight500,
|
|
54
|
+
color: theme.palette.text.darkContrast,
|
|
55
|
+
}, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: (0, safeText_1.safeText)(transferData.to_address, { isShort: true }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
56
|
+
fontSize: theme.typography.fontSize14,
|
|
57
|
+
fontWeight: theme.typography.fontWeight700,
|
|
58
|
+
}, 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: {
|
|
59
|
+
fontSize: theme.typography.fontSize11,
|
|
60
|
+
fontWeight: theme.typography.fontWeight500,
|
|
61
|
+
color: theme.palette.text.darkContrast,
|
|
62
|
+
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
63
|
+
fontSize: theme.typography.fontSize14,
|
|
64
|
+
fontWeight: theme.typography.fontWeight700,
|
|
65
|
+
}, children: (0, safeText_1.safeText)(transferData.type) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "message", sxField: {
|
|
66
|
+
fontSize: theme.typography.fontSize11,
|
|
67
|
+
fontWeight: theme.typography.fontWeight500,
|
|
68
|
+
color: theme.palette.text.darkContrast,
|
|
69
|
+
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
70
|
+
fontSize: theme.typography.fontSize14,
|
|
71
|
+
fontWeight: theme.typography.fontWeight700,
|
|
72
|
+
}, children: (0, safeText_1.safeText)(transferData.message) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "datetime", sxField: {
|
|
73
|
+
fontSize: theme.typography.fontSize11,
|
|
74
|
+
fontWeight: theme.typography.fontWeight500,
|
|
75
|
+
color: theme.palette.text.darkContrast,
|
|
76
|
+
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
77
|
+
fontSize: theme.typography.fontSize14,
|
|
78
|
+
fontWeight: theme.typography.fontWeight700,
|
|
79
|
+
}, children: (0, safeText_1.safeDateTimeText)(transferData.datetime) }) }), ((_c = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _c === void 0 ? void 0 : _c.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 : "", onEnoughBalanceToPayFee: props.onEnoughBalanceToPayFee }))] })] }));
|
|
80
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
function TransferTarget(props) {
|
|
26
|
+
var transferData = props.transferData;
|
|
27
|
+
var theme = (0, material_1.useTheme)();
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, padding: theme.mixins.customPadding.p12, borderRadius: theme.mixins.customRadius.r16, backgroundColor: theme.palette.text.mainGreen, 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: {
|
|
29
|
+
color: theme.palette.text.secondaryGreen,
|
|
30
|
+
fontWeight: theme.typography.fontWeight500,
|
|
31
|
+
fontSize: theme.typography.fontSize11,
|
|
32
|
+
marginRight: theme.mixins.customMargin.m6,
|
|
33
|
+
}, 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: {
|
|
34
|
+
color: theme.palette.text.secondaryGreen,
|
|
35
|
+
fontWeight: theme.typography.fontWeight500,
|
|
36
|
+
fontSize: theme.typography.fontSize11,
|
|
37
|
+
marginRight: theme.mixins.customMargin.m6,
|
|
38
|
+
}, children: "To" }) })] }));
|
|
39
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { ConfirmLayoutProps } from "
|
|
1
|
+
import { ConfirmLayoutProps } from "../../ui/ConfirmLayout";
|
|
2
2
|
import { SendInternalBody, SendInternalResponse } from "../../../services/axios/send-internal-service/type";
|
|
3
|
-
|
|
3
|
+
import { TransferInfoDto } from "./type";
|
|
4
|
+
import { FeesDataType } from "../../../services/axios/get-est-fee-service/type";
|
|
5
|
+
export type TransferInternalData = Omit<SendInternalBody, "passcode"> & TransferInfoDto;
|
|
4
6
|
interface TransferTokenProps extends Omit<ConfirmLayoutProps, "action"> {
|
|
5
7
|
transferData: TransferInternalData;
|
|
8
|
+
initFeeData?: FeesDataType;
|
|
6
9
|
onTransferSuccess?: (data: SendInternalResponse) => any;
|
|
7
10
|
}
|
|
8
11
|
export interface TransferTokenRef {
|
|
@@ -87,18 +87,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
87
87
|
exports.TransferError = void 0;
|
|
88
88
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
89
89
|
var material_1 = require("@mui/material");
|
|
90
|
-
var Button_1 = __importStar(require("
|
|
91
|
-
var ConfirmLayout_1 = __importDefault(require("
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
90
|
+
var Button_1 = __importStar(require("../../ui/Button"));
|
|
91
|
+
var ConfirmLayout_1 = __importDefault(require("../../ui/ConfirmLayout"));
|
|
92
|
+
var Formatter_1 = __importDefault(require("../../ui/Formatter"));
|
|
93
|
+
var ConfirmByPasscode_1 = __importDefault(require("../../ui/ConfirmByPasscode"));
|
|
95
94
|
var react_1 = require("react");
|
|
96
|
-
var Text_1 = __importDefault(require("
|
|
97
|
-
var RequireConnect_1 = __importDefault(require("
|
|
95
|
+
var Text_1 = __importDefault(require("../../ui/Text"));
|
|
96
|
+
var RequireConnect_1 = __importDefault(require("../../ui/RequireConnect"));
|
|
98
97
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
99
98
|
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
100
99
|
var useWithdrawData_1 = __importDefault(require("../../../hooks/useWithdrawData"));
|
|
101
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
|
+
var validate_wallet_address_service_1 = __importDefault(require("../../../services/axios/validate-wallet-address-service"));
|
|
105
|
+
var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
|
|
102
106
|
var TransferError;
|
|
103
107
|
(function (TransferError) {
|
|
104
108
|
TransferError["TOKEN_NOT_FOUND"] = "Token not found";
|
|
@@ -107,60 +111,134 @@ var TransferError;
|
|
|
107
111
|
TransferError["MIN_AMOUNT"] = "Min amount";
|
|
108
112
|
TransferError["FAILED"] = "Failed";
|
|
109
113
|
})(TransferError || (exports.TransferError = TransferError = {}));
|
|
114
|
+
var transactionSlug = type_1.TransactionSlug.TransferInternal;
|
|
110
115
|
var TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
|
|
111
116
|
var theme = (0, material_1.useTheme)();
|
|
112
117
|
var transferData = props.transferData;
|
|
113
118
|
var _a = (0, useWithdrawData_1.default)(), sendInternalTokens = _a.sendInternalTokens, updateSendInternalToken = _a.updateSendInternalToken;
|
|
114
119
|
var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
|
|
115
120
|
var confirmLayoutDrawerRef = (0, react_1.useRef)(null);
|
|
116
|
-
var _b = (0, react_1.useState)(undefined),
|
|
117
|
-
var _c = (0, react_1.useState)(undefined),
|
|
118
|
-
var _d = (0, react_1.useState)(
|
|
119
|
-
var _e = (0, react_1.useState)(
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
var _b = (0, react_1.useState)(undefined), error = _b[0], setError = _b[1];
|
|
122
|
+
var _c = (0, react_1.useState)(undefined), errorAmount = _c[0], setErrorAmount = _c[1];
|
|
123
|
+
var _d = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _d[0], setButtonStatus = _d[1];
|
|
124
|
+
var _e = (0, react_1.useState)(false), isValidatingAddress = _e[0], setIsValidatingAddress = _e[1];
|
|
125
|
+
var _f = (0, react_1.useState)(undefined), errorAddress = _f[0], setErrorAddress = _f[1];
|
|
126
|
+
var _g = (0, react_1.useState)(props.initFeeData), estimateFee = _g[0], setEstimateFee = _g[1];
|
|
127
|
+
var _h = (0, react_1.useState)(false), isLoadingEstimateFee = _h[0], setIsLoadingEstimateFee = _h[1];
|
|
128
|
+
var _j = (0, react_1.useState)(false), isEnoughBalanceToPayFee = _j[0], setIsEnoughBalanceToPayFee = _j[1];
|
|
129
|
+
var amount = transferData.amount;
|
|
130
|
+
var toAddress = transferData.to_address;
|
|
131
|
+
var tokenSlug = transferData.currency_slug;
|
|
132
|
+
var getEstimateFee = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
|
+
var response;
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0:
|
|
137
|
+
if (!tokenSlug)
|
|
138
|
+
return [2 /*return*/];
|
|
139
|
+
setIsLoadingEstimateFee(true);
|
|
140
|
+
return [4 /*yield*/, (0, get_est_fee_service_1.default)({
|
|
141
|
+
amount: "".concat(amount),
|
|
142
|
+
transaction_type: transactionSlug,
|
|
143
|
+
currency: tokenSlug || "",
|
|
144
|
+
})];
|
|
145
|
+
case 1:
|
|
146
|
+
response = _a.sent();
|
|
147
|
+
setIsLoadingEstimateFee(false);
|
|
148
|
+
setEstimateFee(response === null || response === void 0 ? void 0 : response.data);
|
|
149
|
+
return [2 /*return*/, true];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}); }, [amount, tokenSlug]);
|
|
153
|
+
var token = (0, react_1.useMemo)(function () {
|
|
154
|
+
return sendInternalTokens === null || sendInternalTokens === void 0 ? void 0 : sendInternalTokens.find(function (token) { return token.slug === tokenSlug; });
|
|
155
|
+
}, [tokenSlug, sendInternalTokens]);
|
|
156
|
+
var validateAmount = (0, react_1.useCallback)(function () {
|
|
123
157
|
if (!token) {
|
|
124
158
|
setError(TransferError.TOKEN_NOT_FOUND);
|
|
125
|
-
return;
|
|
159
|
+
return false;
|
|
126
160
|
}
|
|
127
161
|
if (transferData.amount > token.max_value) {
|
|
128
162
|
setError(TransferError.MAX_AMOUNT);
|
|
129
163
|
setErrorAmount(token.max_value);
|
|
130
|
-
return;
|
|
164
|
+
return false;
|
|
131
165
|
}
|
|
132
166
|
if (transferData.amount < token.min_value) {
|
|
133
167
|
setError(TransferError.MIN_AMOUNT);
|
|
134
168
|
setErrorAmount(token.min_value);
|
|
135
|
-
return;
|
|
169
|
+
return false;
|
|
136
170
|
}
|
|
137
171
|
if (transferData.amount > +token.balance) {
|
|
138
172
|
setError(TransferError.NOT_ENOUGH_BALANCE);
|
|
139
173
|
setErrorAmount(token.balance);
|
|
140
|
-
return;
|
|
174
|
+
return false;
|
|
141
175
|
}
|
|
142
176
|
setError(undefined);
|
|
143
177
|
setErrorAmount(undefined);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
178
|
+
return true;
|
|
179
|
+
}, [sendInternalTokens, token]);
|
|
180
|
+
var validateAddress = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
181
|
+
var message;
|
|
182
|
+
return __generator(this, function (_a) {
|
|
183
|
+
switch (_a.label) {
|
|
184
|
+
case 0:
|
|
185
|
+
setIsValidatingAddress(true);
|
|
186
|
+
return [4 /*yield*/, (0, validate_wallet_address_service_1.default)({
|
|
187
|
+
address: toAddress,
|
|
188
|
+
network: "ton",
|
|
189
|
+
})];
|
|
190
|
+
case 1:
|
|
191
|
+
message = (_a.sent()).message;
|
|
192
|
+
setIsValidatingAddress(false);
|
|
193
|
+
if (message !== type_2.ValidateWalletAddressResultMessage.INTERNAL_WALLET) {
|
|
194
|
+
setErrorAddress("Invalid wallet address");
|
|
195
|
+
return [2 /*return*/, false];
|
|
196
|
+
}
|
|
197
|
+
setErrorAddress(undefined);
|
|
198
|
+
return [2 /*return*/, true];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); }, [toAddress]);
|
|
202
|
+
var validateAll = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
203
|
+
var isAmountValid;
|
|
204
|
+
return __generator(this, function (_a) {
|
|
205
|
+
isAmountValid = validateAmount();
|
|
206
|
+
if (!isAmountValid)
|
|
207
|
+
return [2 /*return*/, false];
|
|
208
|
+
validateAddress();
|
|
209
|
+
getEstimateFee();
|
|
210
|
+
return [2 /*return*/];
|
|
211
|
+
});
|
|
212
|
+
}); }, [validateAmount, validateAddress, getEstimateFee]);
|
|
213
|
+
var handleSendInternalToken = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
|
+
var response, err_1;
|
|
147
215
|
var _a, _b;
|
|
148
216
|
return __generator(this, function (_c) {
|
|
149
217
|
switch (_c.label) {
|
|
150
218
|
case 0:
|
|
219
|
+
_c.trys.push([0, 2, , 3]);
|
|
151
220
|
setButtonStatus(Button_1.BUTTON_STATUS.LOADING);
|
|
152
|
-
return [4 /*yield*/, (0, send_internal_service_1.default)(__assign({ passcode: passcode }
|
|
221
|
+
return [4 /*yield*/, (0, send_internal_service_1.default)(__assign(__assign({}, props.transferData), { passcode: passcode }))];
|
|
153
222
|
case 1:
|
|
154
223
|
response = _c.sent();
|
|
155
224
|
if (response.success) {
|
|
156
225
|
(_a = confirmLayoutDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
226
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
157
227
|
(_b = props.onTransferSuccess) === null || _b === void 0 ? void 0 : _b.call(props, response);
|
|
158
228
|
}
|
|
159
229
|
else {
|
|
160
|
-
|
|
230
|
+
throw new Error("Send internal failed");
|
|
161
231
|
}
|
|
162
|
-
|
|
163
|
-
|
|
232
|
+
return [3 /*break*/, 3];
|
|
233
|
+
case 2:
|
|
234
|
+
err_1 = _c.sent();
|
|
235
|
+
console.error(err_1);
|
|
236
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
237
|
+
setTimeout(function () {
|
|
238
|
+
setButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
239
|
+
}, 1200);
|
|
240
|
+
return [3 /*break*/, 3];
|
|
241
|
+
case 3: return [2 /*return*/];
|
|
164
242
|
}
|
|
165
243
|
});
|
|
166
244
|
}); };
|
|
@@ -169,6 +247,7 @@ var TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
169
247
|
if (!isInitPasscode)
|
|
170
248
|
throw new Error("Please connect your wallet");
|
|
171
249
|
(_a = confirmLayoutDrawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
250
|
+
validateAll();
|
|
172
251
|
};
|
|
173
252
|
var handleClose = function () {
|
|
174
253
|
var _a;
|
|
@@ -185,13 +264,21 @@ var TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
185
264
|
updateSendInternalToken();
|
|
186
265
|
}
|
|
187
266
|
}, [sendInternalTokens, updateSendInternalToken]);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
267
|
+
// const estimateReceive = useMemo(() => {
|
|
268
|
+
// if (!estimateFee || !amount) return undefined;
|
|
269
|
+
// return +amount - +estimateFee?.feeInCurrency;
|
|
270
|
+
// }, [estimateFee, amount]);
|
|
271
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { title: "Transfer Amount", link: token === null || token === void 0 ? void 0 : token.link, transferAmount: transferData.amount, ref: confirmLayoutDrawerRef, action: type_1.TransactionSlug.TransferInternal, trigger: props.children, currency: token === null || token === void 0 ? void 0 : token.name, onOpen: validateAll, children: [(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, onEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.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: theme.mixins.customMargin.m12, mb: theme.mixins.customMargin.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, { status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress || !isEnoughBalanceToPayFee
|
|
272
|
+
? Button_1.BUTTON_STATUS.DISABLED
|
|
273
|
+
: buttonStatus, sx: {
|
|
274
|
+
backgroundColor: theme.palette.text.mainGreen,
|
|
275
|
+
color: theme.palette.text.secondaryGreen,
|
|
276
|
+
fontWeight: theme.typography.fontWeight500,
|
|
277
|
+
fontSize: theme.typography.fontSize14,
|
|
278
|
+
borderRadius: theme.mixins.customRadius.r16,
|
|
279
|
+
height: "40px",
|
|
280
|
+
width: "calc(100dvw - 2rem)",
|
|
281
|
+
}, fullWidth: true, children: "Confirm" }) }) })] }) }));
|
|
195
282
|
});
|
|
196
283
|
TransferInternal.displayName = "TransferInternal";
|
|
197
284
|
exports.default = TransferInternal;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import { FeesDataType } from "../../../services/axios/get-est-fee-service/type";
|
|
2
|
+
import { UserInfoDto } from "../../../types/expose-type";
|
|
1
3
|
export interface LockData {
|
|
2
4
|
amount: number;
|
|
3
5
|
tokenSlug: string;
|
|
4
6
|
}
|
|
7
|
+
export interface TransferInfoDto {
|
|
8
|
+
network?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
datetime?: string;
|
|
12
|
+
link?: string;
|
|
13
|
+
user?: UserInfoDto;
|
|
14
|
+
receiver?: UserInfoDto;
|
|
15
|
+
fee?: FeesDataType;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UserInfoDto } from "../../../types/expose-type";
|
|
2
|
+
export type UserInfoVariant = "single" | "multiple";
|
|
3
|
+
export interface IUserInfoProps {
|
|
4
|
+
user: UserInfoDto | undefined;
|
|
5
|
+
rightPart?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
variant?: UserInfoVariant;
|
|
8
|
+
}
|
|
9
|
+
export default function UserInfo({ user, rightPart }: IUserInfoProps): import("react/jsx-runtime").JSX.Element | "loading...";
|
|
@@ -0,0 +1,30 @@
|
|
|
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 = UserInfo;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var getImage_1 = __importDefault(require("../../../utils/getImage"));
|
|
9
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
10
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
11
|
+
var material_1 = require("@mui/material");
|
|
12
|
+
function UserInfo(_a) {
|
|
13
|
+
var _b;
|
|
14
|
+
var user = _a.user, rightPart = _a.rightPart;
|
|
15
|
+
var theme = (0, material_1.useTheme)();
|
|
16
|
+
if (!user)
|
|
17
|
+
return "loading...";
|
|
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)(Icon_1.default, { src: (_b = user.avatar) !== null && _b !== void 0 ? _b : (0, getImage_1.default)("default-ava", "png"), width: 24, height: 24, sx: {
|
|
19
|
+
position: "relative",
|
|
20
|
+
borderRadius: theme.mixins.customRadius.full,
|
|
21
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
22
|
+
color: theme.palette.background.white,
|
|
23
|
+
fontWeight: theme.typography.fontWeight500,
|
|
24
|
+
fontSize: theme.typography.fontSize13,
|
|
25
|
+
}, children: user.nick_name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
26
|
+
color: theme.palette.text.accent,
|
|
27
|
+
fontWeight: theme.typography.fontWeight500,
|
|
28
|
+
fontSize: theme.typography.fontSize11,
|
|
29
|
+
}, children: user.user_name })] })] }), rightPart] }));
|
|
30
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Options } from "../TekWalletProvider";
|
|
1
2
|
export interface EventHandlerProviderProps {
|
|
2
3
|
children: React.ReactNode;
|
|
4
|
+
options?: Options;
|
|
3
5
|
}
|
|
4
6
|
declare function EventHandlerProvider(props: EventHandlerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default EventHandlerProvider;
|
|
@@ -12,10 +12,14 @@ function EventHandlerProvider(props) {
|
|
|
12
12
|
var eventHandler = (0, useEventHandler_1.useEventHandler)().eventHandler;
|
|
13
13
|
var _a = (0, useRealtime_1.default)(), pushNotification = _a.pushNotification, transaction = _a.transaction;
|
|
14
14
|
var activitiesRef = (0, react_1.useRef)(null);
|
|
15
|
+
var options = props.options;
|
|
16
|
+
var hideDefaultActivities = options === null || options === void 0 ? void 0 : options.hideDefaultActivities;
|
|
15
17
|
var showActivities = (0, react_1.useCallback)(function () {
|
|
16
18
|
var _a;
|
|
19
|
+
if (hideDefaultActivities)
|
|
20
|
+
return;
|
|
17
21
|
(_a = activitiesRef.current) === null || _a === void 0 ? void 0 : _a.openTab(0);
|
|
18
|
-
}, []);
|
|
22
|
+
}, [hideDefaultActivities]);
|
|
19
23
|
(0, react_1.useEffect)(function () {
|
|
20
24
|
if (!eventHandler || !transaction)
|
|
21
25
|
return;
|
|
@@ -24,6 +28,6 @@ function EventHandlerProvider(props) {
|
|
|
24
28
|
pushNotification(theMessage);
|
|
25
29
|
}
|
|
26
30
|
}, [transaction]);
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.children,
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.children, !hideDefaultActivities && (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }));
|
|
28
32
|
}
|
|
29
33
|
exports.default = EventHandlerProvider;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { Theme } from "@mui/material";
|
|
3
|
-
export interface
|
|
4
|
-
|
|
3
|
+
export interface Options {
|
|
4
|
+
hideDefaultActivities?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export interface TekWalletProviderProps {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
isSSO?: boolean;
|
|
9
9
|
accessToken?: string;
|
|
10
10
|
theme?: Theme;
|
|
11
|
-
|
|
11
|
+
options?: Options;
|
|
12
12
|
}
|
|
13
13
|
export interface TekWalletContextType {
|
|
14
14
|
isSSO: boolean | undefined;
|
|
@@ -54,6 +54,7 @@ var border = {
|
|
|
54
54
|
black16: "rgba(0, 0, 0, 0.16)",
|
|
55
55
|
secondary: "#01FFFF",
|
|
56
56
|
secondary16: "rgba(1, 255, 255, 0.16)",
|
|
57
|
+
accent: "#A3A3A3",
|
|
57
58
|
};
|
|
58
59
|
var text = {
|
|
59
60
|
white: "#ffffff",
|
|
@@ -64,6 +65,11 @@ var text = {
|
|
|
64
65
|
black80: "rgba(0, 0, 0, 0.8)",
|
|
65
66
|
black64: "rgba(0, 0, 0, 0.64)",
|
|
66
67
|
black24: "rgba(0, 0, 0, 0.24)",
|
|
68
|
+
blackContrast: "#121212",
|
|
69
|
+
mainGreen: "#1E4841",
|
|
70
|
+
secondaryGreen: "#C5E99F",
|
|
71
|
+
accent: "#A3A3A3",
|
|
72
|
+
accent2: "#6B7271",
|
|
67
73
|
secondary: "#01FFFF",
|
|
68
74
|
successStatus: "#01FF00",
|
|
69
75
|
errorStatus: "#FE6565",
|
|
@@ -123,6 +123,16 @@ export interface User {
|
|
|
123
123
|
expires_in: number;
|
|
124
124
|
refresh_expires_in: number;
|
|
125
125
|
}
|
|
126
|
+
export type UserInfoDto = {
|
|
127
|
+
id?: string;
|
|
128
|
+
nick_name?: string;
|
|
129
|
+
user_name?: string;
|
|
130
|
+
email?: string;
|
|
131
|
+
avatar?: string;
|
|
132
|
+
bio?: string;
|
|
133
|
+
country_slug?: string;
|
|
134
|
+
user_type?: string;
|
|
135
|
+
};
|
|
126
136
|
export interface BlockchainWallet {
|
|
127
137
|
master_address: string;
|
|
128
138
|
blockchain_address: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const safeText: (text: string | undefined, options?: {
|
|
2
|
+
isShort?: boolean;
|
|
3
|
+
defaultValue?: string | undefined;
|
|
4
|
+
}) => string;
|
|
5
|
+
declare const safeDateTimeText: (text: string | undefined, defaultValue?: string | undefined) => string;
|
|
6
|
+
export { safeText, safeDateTimeText };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeDateTimeText = exports.safeText = void 0;
|
|
4
|
+
var safeText = function (text, options) {
|
|
5
|
+
var _a = options !== null && options !== void 0 ? options : {}, isShort = _a.isShort, defaultValue = _a.defaultValue;
|
|
6
|
+
if (!text)
|
|
7
|
+
return defaultValue !== null && defaultValue !== void 0 ? defaultValue : "-";
|
|
8
|
+
if (isShort) {
|
|
9
|
+
if (text.length < 10) {
|
|
10
|
+
return text;
|
|
11
|
+
}
|
|
12
|
+
return text.slice(0, 3) + "..." + text.slice(-9);
|
|
13
|
+
}
|
|
14
|
+
return text;
|
|
15
|
+
};
|
|
16
|
+
exports.safeText = safeText;
|
|
17
|
+
var safeDateTimeText = function (text, defaultValue) {
|
|
18
|
+
if (!text)
|
|
19
|
+
return defaultValue !== null && defaultValue !== void 0 ? defaultValue : "-";
|
|
20
|
+
return new Date(text).toLocaleString();
|
|
21
|
+
};
|
|
22
|
+
exports.safeDateTimeText = safeDateTimeText;
|