tek-wallet 0.0.752 → 0.0.753
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/index.d.ts +7 -0
- package/dist/components/TekWallet/components/index.js +7 -0
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.js +14 -3
- package/dist/components/TekWallet/components/ui/BackHeader/index.js +5 -1
- package/dist/components/TekWallet/components/ui/BottomActionLayout/index.d.ts +3 -3
- package/dist/components/TekWallet/components/ui/BottomActionLayout/index.js +24 -6
- package/dist/components/TekWallet/components/ui/Button/index.js +2 -2
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +2 -6
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.d.ts +6 -2
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.js +92 -12
- package/dist/components/TekWallet/components/ui/ConfirmSendInternal/index.d.ts +4 -2
- package/dist/components/TekWallet/components/ui/ConfirmSendInternal/index.js +12 -4
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.js +112 -0
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.d.ts +18 -0
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.js +169 -0
- package/dist/components/TekWallet/components/ui/CopyableText/index.js +1 -1
- package/dist/components/TekWallet/components/ui/DetailSwap/index.js +1 -1
- package/dist/components/TekWallet/components/ui/Fees/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/Fees/index.js +51 -41
- package/dist/components/TekWallet/components/ui/FeesAutoDebounce/index.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/FeesAutoDebounce/index.js +223 -0
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +2 -2
- package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +13 -13
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +6 -4
- package/dist/components/TekWallet/components/ui/Formatter/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/Formatter/index.js +4 -2
- package/dist/components/TekWallet/components/ui/FunctionItem/index.js +5 -4
- package/dist/components/TekWallet/components/ui/Icon/index.d.ts +4 -2
- package/dist/components/TekWallet/components/ui/Icon/index.js +44 -3
- package/dist/components/TekWallet/components/ui/Input/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +3 -3
- package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/SendExternalToken/index.js +1 -1
- package/dist/components/TekWallet/components/ui/SendExternalTokenWithdrawn/index.d.ts +2 -5
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +12 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +27 -15
- package/dist/components/TekWallet/components/ui/SwapFunction/index.js +4 -4
- package/dist/components/TekWallet/components/ui/SwapToken/index.d.ts +2 -3
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +1 -3
- package/dist/components/TekWallet/components/ui/ValidateWalletAddress/index.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/ValidateWalletAddress/index.js +67 -0
- package/dist/components/TekWallet/components/ui/WaitingData/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/WaitingData/index.js +10 -6
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +70 -32
- package/dist/components/TekWallet/components/views/AssetView/Menu.d.ts +7 -0
- package/dist/components/TekWallet/components/views/AssetView/Menu.js +25 -0
- package/dist/components/TekWallet/components/views/AssetView/index.js +25 -26
- package/dist/components/TekWallet/components/views/NotFoundView/index.d.ts +2 -0
- package/dist/components/TekWallet/components/views/NotFoundView/index.js +7 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +450 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Result.d.ts +14 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Result.js +140 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectNetwork.d.ts +10 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectNetwork.js +34 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectToken.d.ts +8 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/SelectToken.js +173 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Summary.d.ts +12 -0
- package/dist/components/TekWallet/components/views/SendExternalView/components/Summary.js +131 -0
- package/dist/components/TekWallet/components/views/SendExternalView/index.d.ts +23 -0
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +143 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.js +380 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +381 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Result.d.ts +13 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Result.js +128 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/SelectToken.d.ts +8 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/SelectToken.js +173 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Summary.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Summary.js +126 -0
- package/dist/components/TekWallet/components/views/SendInternalView/index.d.ts +24 -0
- package/dist/components/TekWallet/components/views/SendInternalView/index.js +155 -0
- package/dist/components/TekWallet/components/views/SwapView/components/CardTo/index.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SwapView/components/CardTo/index.js +111 -0
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.d.ts +14 -0
- package/dist/components/TekWallet/components/views/SwapView/components/FromCard/index.js +180 -0
- package/dist/components/TekWallet/components/views/SwapView/components/SelectToken.d.ts +9 -0
- package/dist/components/TekWallet/components/views/SwapView/components/SelectToken.js +173 -0
- package/dist/components/TekWallet/components/views/SwapView/components/Summary.d.ts +14 -0
- package/dist/components/TekWallet/components/views/SwapView/components/Summary.js +239 -0
- package/dist/components/TekWallet/components/views/SwapView/functions/convertTokensRate.d.ts +3 -0
- package/dist/components/TekWallet/components/views/SwapView/functions/convertTokensRate.js +14 -0
- package/dist/components/TekWallet/components/views/SwapView/index.d.ts +11 -0
- package/dist/components/TekWallet/components/views/SwapView/index.js +218 -0
- package/dist/components/TekWallet/components/views/TekWalletView/expose.d.ts +2 -0
- package/dist/components/TekWallet/components/views/TekWalletView/expose.js +18 -0
- package/dist/components/TekWallet/components/views/TekWalletView/index.d.ts +3 -0
- package/dist/components/TekWallet/components/views/TekWalletView/index.js +16 -0
- package/dist/components/TekWallet/components/views/TekWalletView/routes.d.ts +9 -0
- package/dist/components/TekWallet/components/views/TekWalletView/routes.js +74 -0
- package/dist/components/TekWallet/hooks/useValidateAmount.d.ts +26 -0
- package/dist/components/TekWallet/hooks/useValidateAmount.js +103 -0
- package/dist/components/TekWallet/providers/EventHandlerProvider/index.js +5 -0
- package/dist/components/TekWallet/providers/RealtimeProvider/index.js +2 -2
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +3 -0
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +8 -2
- package/dist/components/TekWallet/providers/WithdrawProvider/index.js +36 -0
- package/dist/components/TekWallet/services/axios/get-est-fee-service/type.d.ts +5 -4
- package/dist/components/TekWallet/services/axios/send-external-service/type.d.ts +5 -30
- package/dist/components/TekWallet/services/axios/swap-service/type.d.ts +4 -0
- package/dist/components/TekWallet/services/axios/transfer-internal-service/type.d.ts +4 -32
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +3 -3
- package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +3 -3
- package/dist/components/TekWallet/theme/mui/theme.js +9 -9
- package/dist/components/TekWallet/utils/stop.d.ts +3 -0
- package/dist/components/TekWallet/utils/stop.js +6 -0
- package/package.json +2 -2
- package/dist/components/TekWallet/components/ui/CardFrom/index.d.ts +0 -10
- package/dist/components/TekWallet/components/ui/CardFrom/index.js +0 -91
- package/dist/components/TekWallet/components/ui/CardTo/index.d.ts +0 -10
- package/dist/components/TekWallet/components/ui/CardTo/index.js +0 -39
- package/dist/components/TekWallet/components/ui/ConfirmLayout copy/index.d.ts +0 -7
- package/dist/components/TekWallet/components/ui/ConfirmLayout copy/index.js +0 -67
- package/dist/components/TekWallet/components/views/HelpView/index.d.ts +0 -2
- package/dist/components/TekWallet/components/views/HelpView/index.js +0 -7
|
@@ -14,3 +14,10 @@ export * from "./ui/Formatter";
|
|
|
14
14
|
export * from "./ui/TokenItem";
|
|
15
15
|
export * from "./ui/ConfirmTransferInternal";
|
|
16
16
|
export * from "./ui/Button";
|
|
17
|
+
export * from "./ui/ConfirmSendInternal";
|
|
18
|
+
export * from "./ui/ConfirmSendExternal";
|
|
19
|
+
export * from "./ui/ConfirmSwapToken";
|
|
20
|
+
export * from "./views/TekWalletView/expose";
|
|
21
|
+
export * from "./views/SendInternalView";
|
|
22
|
+
export * from "./views/SendExternalView";
|
|
23
|
+
export * from "./views/SwapView";
|
|
@@ -30,3 +30,10 @@ __exportStar(require("./ui/Formatter"), exports);
|
|
|
30
30
|
__exportStar(require("./ui/TokenItem"), exports);
|
|
31
31
|
__exportStar(require("./ui/ConfirmTransferInternal"), exports);
|
|
32
32
|
__exportStar(require("./ui/Button"), exports);
|
|
33
|
+
__exportStar(require("./ui/ConfirmSendInternal"), exports);
|
|
34
|
+
__exportStar(require("./ui/ConfirmSendExternal"), exports);
|
|
35
|
+
__exportStar(require("./ui/ConfirmSwapToken"), exports);
|
|
36
|
+
__exportStar(require("./views/TekWalletView/expose"), exports);
|
|
37
|
+
__exportStar(require("./views/SendInternalView"), exports);
|
|
38
|
+
__exportStar(require("./views/SendExternalView"), exports);
|
|
39
|
+
__exportStar(require("./views/SwapView"), exports);
|
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -21,7 +32,7 @@ var StatusDisplay_2 = __importDefault(require("../../ui/StatusDisplay"));
|
|
|
21
32
|
var material_1 = require("@mui/material");
|
|
22
33
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
23
34
|
var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
24
|
-
var header = props.header, footer = props.footer, children = props.children, sx = props.sx, className = props.className, classNames = props.classNames, statusMessage = props.statusMessage;
|
|
35
|
+
var header = props.header, footer = props.footer, children = props.children, sx = props.sx, className = props.className, classNames = props.classNames, statusMessage = props.statusMessage, rest = __rest(props, ["header", "footer", "children", "sx", "className", "classNames", "statusMessage"]);
|
|
25
36
|
var _a = (0, react_1.useState)(StatusDisplay_1.StatusDisplayType.Normal), status = _a[0], setStatus = _a[1];
|
|
26
37
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
27
38
|
(0, react_1.useImperativeHandle)(ref, function () {
|
|
@@ -40,7 +51,7 @@ var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
40
51
|
},
|
|
41
52
|
};
|
|
42
53
|
});
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: ref, sx: __assign({ height: "100%", width: "100%", display: "grid", gridTemplateRows: "auto 1fr auto", position: "relative", backgroundColor: theme.palette.background.white }, sx), className: className, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.header, children: header }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.body, children: children }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.footer, children: footer }), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ ref: ref, sx: __assign({ height: "100%", width: "100%", display: "grid", gridTemplateRows: "auto 1fr auto", position: "relative", backgroundColor: theme.palette.background.white }, sx), className: className }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.header, children: header }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.body, children: children }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%" }, className: classNames === null || classNames === void 0 ? void 0 : classNames.footer, children: footer }), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
44
55
|
position: "absolute",
|
|
45
56
|
inset: 0,
|
|
46
57
|
display: "flex",
|
|
@@ -49,7 +60,7 @@ var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
49
60
|
backgroundColor: "blackBackground.16",
|
|
50
61
|
backdropFilter: "blur(4px)",
|
|
51
62
|
zIndex: 50,
|
|
52
|
-
}, children: (0, jsx_runtime_1.jsx)(StatusDisplay_2.default, { status: status, statusMessage: statusMessage === null || statusMessage === void 0 ? void 0 : statusMessage[status] }) }))] }));
|
|
63
|
+
}, children: (0, jsx_runtime_1.jsx)(StatusDisplay_2.default, { status: status, statusMessage: statusMessage === null || statusMessage === void 0 ? void 0 : statusMessage[status] }) }))] })));
|
|
53
64
|
});
|
|
54
65
|
ChildPageLayout.displayName = "ChildPageLayout";
|
|
55
66
|
exports.default = ChildPageLayout;
|
|
@@ -20,6 +20,7 @@ var BackArrow_1 = __importDefault(require("../BackArrow"));
|
|
|
20
20
|
var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"));
|
|
21
21
|
var material_1 = require("@mui/material");
|
|
22
22
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
23
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
23
24
|
var BackHeader = function (props) {
|
|
24
25
|
var router = (0, useCustomRouter_1.default)();
|
|
25
26
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
@@ -41,6 +42,9 @@ var BackHeader = function (props) {
|
|
|
41
42
|
transform: "translateX(-0.25rem)",
|
|
42
43
|
transition: "transform 0.2s ease-in-out",
|
|
43
44
|
},
|
|
44
|
-
}, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " "
|
|
45
|
+
}, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
46
|
+
color: theme.palette.text.black,
|
|
47
|
+
fontSize: theme.typography.fontSize12,
|
|
48
|
+
}, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), theme.mixins.headerTitle), children: center })), children, right && (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { marginLeft: "auto" }, children: right })] }));
|
|
45
49
|
};
|
|
46
50
|
exports.default = BackHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface BottomActionLayoutProps extends
|
|
1
|
+
import { BoxProps } from "@mui/material";
|
|
2
|
+
interface BottomActionLayoutProps extends BoxProps {
|
|
3
3
|
}
|
|
4
|
-
declare function BottomActionLayout({ children }: BottomActionLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function BottomActionLayout({ children, sx, ...rest }: BottomActionLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default BottomActionLayout;
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
26
|
var material_1 = require("@mui/material");
|
|
5
27
|
var providers_1 = require("../../../providers");
|
|
6
28
|
function BottomActionLayout(_a) {
|
|
7
|
-
var children = _a.children;
|
|
29
|
+
var children = _a.children, sx = _a.sx, rest = __rest(_a, ["children", "sx"]);
|
|
8
30
|
var theme = (0, providers_1.useTheme)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
10
|
-
width: "100%",
|
|
11
|
-
px: theme.mixins.pagePadding,
|
|
12
|
-
pb: theme.mixins.customPadding.p24,
|
|
13
|
-
}, children: children }));
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: __assign({ width: "100%", paddingLeft: theme.mixins.pagePadding, paddingRight: theme.mixins.pagePadding, paddingBottom: theme.mixins.customPadding.p24 }, sx) }, rest, { children: children })));
|
|
14
32
|
}
|
|
15
33
|
exports.default = BottomActionLayout;
|
|
@@ -56,7 +56,7 @@ Button.Primary = function (props) {
|
|
|
56
56
|
// color: theme.palette.text.white24,
|
|
57
57
|
// },
|
|
58
58
|
// };
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, sx: __assign({ backgroundColor: theme.palette.background.primary, color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, textTransform: "capitalize", position: "relative", px: theme.mixins.customPadding.p16, py: theme.mixins.customPadding.p12, fontWeight: theme.typography.fontWeight500, fontSize: theme.typography.fontSize14, lineHeight: theme.typography.leading100 }, sx), disabled: status !== BUTTON_STATUS.ENABLED, children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
60
60
|
position: "absolute",
|
|
61
61
|
inset: 0,
|
|
62
62
|
display: "flex",
|
|
@@ -70,7 +70,7 @@ Button.Primary.displayName = "Button.Primary";
|
|
|
70
70
|
Button.Secondary = function (props) {
|
|
71
71
|
var sx = props.sx, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, rest = __rest(props, ["sx", "status"]);
|
|
72
72
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", sx: __assign({ color: theme.palette.text.primary, borderRadius: theme.mixins.customRadius.r12, borderColor: "currentcolor", textTransform: "capitalize", position: "relative"
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", sx: __assign({ color: theme.palette.text.primary, borderRadius: theme.mixins.customRadius.r12, borderColor: "currentcolor", textTransform: "capitalize", position: "relative" }, sx), disabled: status !== BUTTON_STATUS.ENABLED })));
|
|
74
74
|
};
|
|
75
75
|
Button.Secondary.displayName = "Button.Secondary";
|
|
76
76
|
Button.Text = function (props) {
|
|
@@ -99,7 +99,7 @@ var useWarningWrongPasscode_1 = require("../../../hooks/useWarningWrongPasscode"
|
|
|
99
99
|
var clsx_1 = __importDefault(require("clsx"));
|
|
100
100
|
var passcodeLength = 6;
|
|
101
101
|
var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
102
|
-
var onConfirmSuccess = props.onConfirmSuccess;
|
|
102
|
+
var onConfirmSuccess = props.onConfirmSuccess, sx = props.sx;
|
|
103
103
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
104
104
|
var _a = (0, react_1.useState)(""), passcode = _a[0], setPasscode = _a[1];
|
|
105
105
|
var loadingRef = (0, react_1.useRef)(null);
|
|
@@ -190,11 +190,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
190
190
|
}); }, [handleClose, onConfirmSuccess, passcode]);
|
|
191
191
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
|
|
192
192
|
width: "100%",
|
|
193
|
-
}, useBrowserInput: false, htmlFor: keyboardId, children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, triggerStatus: props.triggerStatus, sx: {
|
|
194
|
-
width: "100%",
|
|
195
|
-
maxWidth: "calc(100dvw - 2rem)",
|
|
196
|
-
display: "flex",
|
|
197
|
-
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: passcode, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, classNames: {
|
|
193
|
+
}, useBrowserInput: false, htmlFor: keyboardId, children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, triggerStatus: props.triggerStatus, sx: __assign({ width: "100%", maxWidth: "calc(100dvw - 2rem)", display: "flex" }, sx), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: passcode, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, classNames: {
|
|
198
194
|
keyboardContainer: (0, clsx_1.default)({
|
|
199
195
|
"!hidden": isLocked,
|
|
200
196
|
}),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ConfirmLayoutProps } from "../ConfirmLayout";
|
|
2
2
|
import { SendExternalBody, SendExternalResponse } from "../../../services/axios/send-external-service/type";
|
|
3
3
|
import { NetworkData } from "../../../services/axios/type";
|
|
4
|
+
import { SxProps } from "@mui/material";
|
|
5
|
+
import { ReactEventHandler } from "react";
|
|
4
6
|
export interface SendExternalDataType extends Omit<SendExternalBody, "network" | "passcode"> {
|
|
5
7
|
network: NetworkData;
|
|
6
8
|
}
|
|
@@ -10,7 +12,9 @@ export interface ConfirmSendExternalProps extends Omit<ConfirmLayoutProps, "acti
|
|
|
10
12
|
onStart?: () => void;
|
|
11
13
|
onFinally?: () => void;
|
|
12
14
|
onError?: (error: Error | unknown) => void;
|
|
13
|
-
children
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
sx?: SxProps;
|
|
17
|
+
onClose?: ReactEventHandler;
|
|
14
18
|
}
|
|
15
|
-
export declare const ConfirmSendExternal: ({ payload, onSuccess, onStart, onFinally, onError, children, }: ConfirmSendExternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const ConfirmSendExternal: ({ payload, onSuccess, onStart, onFinally, onError, children, sx, onClose: onDone, }: ConfirmSendExternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
20
|
export default ConfirmSendExternal;
|
|
@@ -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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
48
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
49
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -55,29 +88,52 @@ exports.ConfirmSendExternal = void 0;
|
|
|
55
88
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
56
89
|
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
57
90
|
var send_external_service_1 = __importDefault(require("../../../services/axios/send-external-service"));
|
|
91
|
+
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
92
|
+
var react_1 = require("react");
|
|
93
|
+
var Result_1 = __importDefault(require("../../views/SendExternalView/components/Result"));
|
|
94
|
+
var DefaultPageLayout_1 = __importDefault(require("../../layouts/DefaultPageLayout"));
|
|
95
|
+
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
96
|
+
var stop_1 = __importDefault(require("../../../utils/stop"));
|
|
97
|
+
var useWallet_1 = __importDefault(require("../../../hooks/useWallet"));
|
|
98
|
+
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
99
|
+
var useRealtime_1 = __importDefault(require("../../../hooks/useRealtime"));
|
|
58
100
|
var ConfirmSendExternal = function (_a) {
|
|
59
|
-
var payload = _a.payload, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinally = _a.onFinally, onError = _a.onError, children = _a.children;
|
|
101
|
+
var payload = _a.payload, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinally = _a.onFinally, onError = _a.onError, children = _a.children, sx = _a.sx, onDone = _a.onClose;
|
|
60
102
|
var network = payload.network;
|
|
103
|
+
var _b = (0, react_1.useState)(), response = _b[0], setResponse = _b[1];
|
|
104
|
+
var thisTransactionId = (0, react_1.useRef)("");
|
|
105
|
+
var transaction = (0, useWallet_1.default)().transaction;
|
|
106
|
+
var pushNotification = (0, useRealtime_1.default)().pushNotification;
|
|
61
107
|
var handleConfirmSendExternal = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
108
|
+
var response_1, err_1, time;
|
|
109
|
+
var _a;
|
|
110
|
+
return __generator(this, function (_b) {
|
|
111
|
+
switch (_b.label) {
|
|
65
112
|
case 0:
|
|
66
|
-
|
|
113
|
+
_b.trys.push([0, 2, 3, 4]);
|
|
67
114
|
onStart === null || onStart === void 0 ? void 0 : onStart();
|
|
68
|
-
return [4 /*yield*/, (0, send_external_service_1.default)(__assign(__assign({}, payload), { network: network.slug, passcode: passcode }))];
|
|
115
|
+
return [4 /*yield*/, (0, send_external_service_1.default)(__assign(__assign({}, payload), { network: network.slug, passcode: passcode, await_completion: false }))];
|
|
69
116
|
case 1:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
117
|
+
response_1 = _b.sent();
|
|
118
|
+
setResponse(response_1.data);
|
|
119
|
+
thisTransactionId.current = response_1.data.id;
|
|
120
|
+
(_a = resultRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
121
|
+
if (response_1.success) {
|
|
122
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(response_1);
|
|
73
123
|
}
|
|
74
124
|
else {
|
|
75
|
-
throw new Error("Send external failed", { cause:
|
|
125
|
+
throw new Error("Send external failed", { cause: response_1 });
|
|
76
126
|
}
|
|
77
127
|
return [3 /*break*/, 4];
|
|
78
128
|
case 2:
|
|
79
|
-
err_1 =
|
|
129
|
+
err_1 = _b.sent();
|
|
80
130
|
console.error(err_1);
|
|
131
|
+
time = Date.now();
|
|
132
|
+
pushNotification({
|
|
133
|
+
id: "send-external-failed-".concat(time),
|
|
134
|
+
message: "Something went wrong, please try again later",
|
|
135
|
+
type: "error",
|
|
136
|
+
});
|
|
81
137
|
onError === null || onError === void 0 ? void 0 : onError(err_1);
|
|
82
138
|
return [3 /*break*/, 4];
|
|
83
139
|
case 3:
|
|
@@ -87,7 +143,31 @@ var ConfirmSendExternal = function (_a) {
|
|
|
87
143
|
}
|
|
88
144
|
});
|
|
89
145
|
}); };
|
|
90
|
-
|
|
146
|
+
var resultRef = (0, react_1.useRef)(null);
|
|
147
|
+
var handleCloseResult = function (e) {
|
|
148
|
+
var _a;
|
|
149
|
+
(_a = resultRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
150
|
+
onDone === null || onDone === void 0 ? void 0 : onDone(e);
|
|
151
|
+
};
|
|
152
|
+
(0, react_1.useEffect)(function () {
|
|
153
|
+
if (transaction &&
|
|
154
|
+
transaction.id === thisTransactionId.current &&
|
|
155
|
+
transaction.status !== type_1.TransactionStatus.Processing) {
|
|
156
|
+
setResponse(transaction);
|
|
157
|
+
}
|
|
158
|
+
}, [transaction]);
|
|
159
|
+
return ((0, jsx_runtime_1.jsxs)(ConfirmByPasscode_1.default, { sx: sx, onConfirmSuccess: handleConfirmSendExternal, children: [children, (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: resultRef, sx: {
|
|
160
|
+
width: 0,
|
|
161
|
+
height: 0,
|
|
162
|
+
position: "absolute",
|
|
163
|
+
top: 0,
|
|
164
|
+
left: 0,
|
|
165
|
+
}, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
166
|
+
height: "100dvh",
|
|
167
|
+
width: "100dvw",
|
|
168
|
+
}, onClick: stop_1.default, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
|
|
169
|
+
height: "100%",
|
|
170
|
+
}, children: (0, jsx_runtime_1.jsx)(Result_1.default, { transaction: response, payload: payload, onDone: handleCloseResult }) }) }) })] }));
|
|
91
171
|
};
|
|
92
172
|
exports.ConfirmSendExternal = ConfirmSendExternal;
|
|
93
173
|
exports.default = exports.ConfirmSendExternal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransferInternalBody, TransferInternalResponse } from "../../../services/axios/transfer-internal-service/type";
|
|
2
|
+
import { SxProps } from "@mui/material";
|
|
2
3
|
export interface SendInternalDataType extends Omit<TransferInternalBody, "passcode"> {
|
|
3
4
|
}
|
|
4
5
|
export interface SendInternalResponse extends TransferInternalResponse {
|
|
@@ -9,7 +10,8 @@ export interface ConfirmSendInternalProps {
|
|
|
9
10
|
onStart?: () => void;
|
|
10
11
|
onFinally?: () => void;
|
|
11
12
|
onError?: (error: Error | unknown) => void;
|
|
12
|
-
children
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
sx?: SxProps;
|
|
13
15
|
}
|
|
14
|
-
export declare function ConfirmSendInternal({ payload, onSuccess, onStart, onFinally, onError, children, }: ConfirmSendInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ConfirmSendInternal({ payload, onSuccess, onStart, onFinally, onError, children, sx, }: ConfirmSendInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export default ConfirmSendInternal;
|
|
@@ -53,19 +53,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.ConfirmSendInternal = ConfirmSendInternal;
|
|
55
55
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
56
|
+
var useRealtime_1 = __importDefault(require("../../../hooks/useRealtime"));
|
|
56
57
|
var transfer_internal_service_1 = __importDefault(require("../../../services/axios/transfer-internal-service"));
|
|
57
58
|
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
58
59
|
function ConfirmSendInternal(_a) {
|
|
59
60
|
var _this = this;
|
|
60
|
-
var payload = _a.payload, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinally = _a.onFinally, onError = _a.onError, children = _a.children;
|
|
61
|
+
var payload = _a.payload, onSuccess = _a.onSuccess, onStart = _a.onStart, onFinally = _a.onFinally, onError = _a.onError, children = _a.children, sx = _a.sx;
|
|
62
|
+
var pushNotification = (0, useRealtime_1.default)().pushNotification;
|
|
61
63
|
var handleConfirmSendInternal = function (passcode) { return __awaiter(_this, void 0, void 0, function () {
|
|
62
|
-
var response, err_1;
|
|
64
|
+
var response, err_1, time;
|
|
63
65
|
return __generator(this, function (_a) {
|
|
64
66
|
switch (_a.label) {
|
|
65
67
|
case 0:
|
|
66
68
|
_a.trys.push([0, 2, 3, 4]);
|
|
67
69
|
onStart === null || onStart === void 0 ? void 0 : onStart();
|
|
68
|
-
return [4 /*yield*/, (0, transfer_internal_service_1.default)(__assign(__assign({}, payload), { passcode: passcode }))];
|
|
70
|
+
return [4 /*yield*/, (0, transfer_internal_service_1.default)(__assign(__assign({}, payload), { passcode: passcode, await_completion: true }))];
|
|
69
71
|
case 1:
|
|
70
72
|
response = _a.sent();
|
|
71
73
|
if (response.success) {
|
|
@@ -78,6 +80,12 @@ function ConfirmSendInternal(_a) {
|
|
|
78
80
|
case 2:
|
|
79
81
|
err_1 = _a.sent();
|
|
80
82
|
console.error(err_1);
|
|
83
|
+
time = Date.now();
|
|
84
|
+
pushNotification({
|
|
85
|
+
id: "send-internal-failed-".concat(time),
|
|
86
|
+
message: "Something went wrong, please try again later",
|
|
87
|
+
type: "error",
|
|
88
|
+
});
|
|
81
89
|
onError === null || onError === void 0 ? void 0 : onError(err_1);
|
|
82
90
|
return [3 /*break*/, 4];
|
|
83
91
|
case 3:
|
|
@@ -87,6 +95,6 @@ function ConfirmSendInternal(_a) {
|
|
|
87
95
|
}
|
|
88
96
|
});
|
|
89
97
|
}); };
|
|
90
|
-
return ((0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { onConfirmSuccess: handleConfirmSendInternal, children: children }));
|
|
98
|
+
return ((0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { sx: sx, onConfirmSuccess: handleConfirmSendInternal, children: children }));
|
|
91
99
|
}
|
|
92
100
|
exports.default = ConfirmSendInternal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactEventHandler } from "react";
|
|
2
|
+
import { SwapResponse } from "../../../services/axios/swap-service/type";
|
|
3
|
+
interface ResultProps {
|
|
4
|
+
transaction?: SwapResponse["data"];
|
|
5
|
+
onDone?: ReactEventHandler;
|
|
6
|
+
}
|
|
7
|
+
export default function Result(props: ResultProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type { ResultProps };
|
|
@@ -0,0 +1,112 @@
|
|
|
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 = Result;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var material_1 = require("@mui/material");
|
|
20
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
21
|
+
var react_1 = require("react");
|
|
22
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
23
|
+
var providers_1 = require("../../../providers");
|
|
24
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
25
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
26
|
+
var useFormatter_1 = __importDefault(require("../../../hooks/useFormatter"));
|
|
27
|
+
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
28
|
+
var InlineTitleValue_1 = __importDefault(require("../InlineTitleValue"));
|
|
29
|
+
var convertTokensRate_1 = __importDefault(require("../../views/SwapView/functions/convertTokensRate"));
|
|
30
|
+
function Result(props) {
|
|
31
|
+
var theme = (0, providers_1.useTheme)();
|
|
32
|
+
var formatDate = (0, useFormatter_1.default)().formatDate;
|
|
33
|
+
var transaction = props.transaction, onDone = props.onDone;
|
|
34
|
+
var status = (0, react_1.useMemo)(function () { return (transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status) || "failed"; }, [transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status]);
|
|
35
|
+
var amount = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.amount; }, [transaction === null || transaction === void 0 ? void 0 : transaction.amount]);
|
|
36
|
+
var toAmount = 1;
|
|
37
|
+
var fromToken = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.currency_data; }, [transaction === null || transaction === void 0 ? void 0 : transaction.currency_data]);
|
|
38
|
+
var toToken = (0, react_1.useMemo)(function () { return transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data; }, [transaction === null || transaction === void 0 ? void 0 : transaction.to_currency_data]);
|
|
39
|
+
var toTokenRate = (0, react_1.useMemo)(function () {
|
|
40
|
+
if (!fromToken || !toToken)
|
|
41
|
+
return 0;
|
|
42
|
+
return (0, convertTokensRate_1.default)(fromToken, toToken, 1);
|
|
43
|
+
}, [fromToken, toToken]);
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "column",
|
|
47
|
+
gap: 3,
|
|
48
|
+
height: "100%",
|
|
49
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
50
|
+
display: "flex",
|
|
51
|
+
flexDirection: "column",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
gap: theme.mixins.gaps.g16,
|
|
54
|
+
my: "auto",
|
|
55
|
+
backgroundColor: theme.palette.background.tertiary,
|
|
56
|
+
borderRadius: theme.mixins.customRadius.r16,
|
|
57
|
+
padding: theme.mixins.customPadding.p16,
|
|
58
|
+
paddingTop: "0px",
|
|
59
|
+
}, children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: status === "success" ? "IC_CHECK_CIRCLE" : "IC_ERROR_CIRCLE", width: 100, sx: {
|
|
60
|
+
transform: "translateY(-50%)",
|
|
61
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
flexDirection: "column",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
66
|
+
fontSize: theme.typography.fontSize13,
|
|
67
|
+
color: theme.palette.text.accent2,
|
|
68
|
+
}, children: "Swap" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
69
|
+
color: status === type_1.TransactionStatus.Success
|
|
70
|
+
? theme.palette.text.successStatus
|
|
71
|
+
: theme.palette.text.errorStatus,
|
|
72
|
+
textTransform: "capitalize",
|
|
73
|
+
fontWeight: 600,
|
|
74
|
+
fontSize: theme.typography.fontSize24,
|
|
75
|
+
}, children: status })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", borderTop: "1px ".concat(theme.palette.border.accent3, " solid") } }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
76
|
+
width: "100%",
|
|
77
|
+
position: "relative",
|
|
78
|
+
}, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
79
|
+
display: "flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
gap: theme.mixins.gaps.g4,
|
|
82
|
+
position: "relative",
|
|
83
|
+
zIndex: 1,
|
|
84
|
+
}, children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: fromToken === null || fromToken === void 0 ? void 0 : fromToken.link, sx: {
|
|
85
|
+
width: 20,
|
|
86
|
+
height: 20,
|
|
87
|
+
borderRadius: "999px",
|
|
88
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "inherit" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }) }), (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_SWAP", sx: {
|
|
89
|
+
width: 16,
|
|
90
|
+
height: 16,
|
|
91
|
+
mx: "auto",
|
|
92
|
+
transform: "rotate(-90deg)",
|
|
93
|
+
} }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: toToken === null || toToken === void 0 ? void 0 : toToken.link, sx: {
|
|
94
|
+
width: 20,
|
|
95
|
+
height: 20,
|
|
96
|
+
borderRadius: "999px",
|
|
97
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: "inherit" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: toAmount }) })] }) }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Price", titleStyle: {
|
|
98
|
+
fontSize: "0.6875rem",
|
|
99
|
+
fontWeight: 500,
|
|
100
|
+
color: "gray.700",
|
|
101
|
+
}, value: !!toTokenRate && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["1 ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.name, " ~ ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: toTokenRate, unit: toToken === null || toToken === void 0 ? void 0 : toToken.name })] })), isAligned: true }), !!(transaction === null || transaction === void 0 ? void 0 : transaction.date_created) && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Date", titleStyle: {
|
|
102
|
+
fontSize: "0.6875rem",
|
|
103
|
+
fontWeight: 500,
|
|
104
|
+
color: "gray.700",
|
|
105
|
+
}, value: !!toTokenRate && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: formatDate(transaction === null || transaction === void 0 ? void 0 : transaction.date_created, true) })), isAligned: true }))] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
106
|
+
marginTop: "auto",
|
|
107
|
+
width: "100%",
|
|
108
|
+
display: "grid",
|
|
109
|
+
gridTemplateColumns: "1fr",
|
|
110
|
+
gap: theme.mixins.gaps.g8,
|
|
111
|
+
}, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, onClick: onDone, children: "Done" }) })] }) }));
|
|
112
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
2
|
+
import { ConfirmLayoutProps } from "../ConfirmLayout";
|
|
3
|
+
import { ReactEventHandler } from "react";
|
|
4
|
+
import { SwapBody, SwapResponse } from "../../../services/axios/swap-service/type";
|
|
5
|
+
export interface SwapDataType extends Omit<SwapBody, "passcode" | "network"> {
|
|
6
|
+
}
|
|
7
|
+
export interface ConfirmSwapTokenProps extends Omit<ConfirmLayoutProps, "action"> {
|
|
8
|
+
payload: SwapDataType;
|
|
9
|
+
onSuccess?: (data: SwapResponse) => any;
|
|
10
|
+
onStart?: () => void;
|
|
11
|
+
onFinally?: () => void;
|
|
12
|
+
onError?: (error: Error | unknown) => void;
|
|
13
|
+
onDone?: ReactEventHandler;
|
|
14
|
+
sx?: SxProps;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const ConfirmSwapToken: (props: ConfirmSwapTokenProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default ConfirmSwapToken;
|