tek-wallet 0.0.606 → 0.0.607

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.
@@ -34,35 +34,33 @@ var BUTTON_STATUS;
34
34
  BUTTON_STATUS["ENABLED"] = "enabled";
35
35
  })(BUTTON_STATUS || (exports.BUTTON_STATUS = BUTTON_STATUS = {}));
36
36
  var Button = function (props) {
37
- var _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, sx = props.sx, rest = __rest(props, ["status", "sx"]);
38
- return ((0, jsx_runtime_1.jsx)(material_1.Button, __assign({ disabled: status !== BUTTON_STATUS.ENABLED }, rest, { sx: __assign({ textTransform: "capitalize" }, sx), children: props.children })));
37
+ var _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, rest = __rest(props, ["status"]);
38
+ return ((0, jsx_runtime_1.jsx)(material_1.Button, __assign({ disabled: status !== BUTTON_STATUS.ENABLED }, rest, { children: props.children })));
39
39
  };
40
40
  Button.displayName = "Button";
41
41
  Button.Primary = function (props) {
42
- var _a;
43
- var sx = props.sx, children = props.children, _b = props.status, status = _b === void 0 ? BUTTON_STATUS.ENABLED : _b, rest = __rest(props, ["sx", "children", "status"]);
42
+ var children = props.children, _a = props.status, status = _a === void 0 ? BUTTON_STATUS.ENABLED : _a, rest = __rest(props, ["children", "status"]);
44
43
  var theme = (0, material_1.useTheme)();
45
- var disabledStyles = (_a = {},
46
- _a[BUTTON_STATUS.LOADING] = {
47
- backgroundColor: theme.palette.background.secondary16,
48
- color: theme.palette.background.secondary,
49
- },
50
- _a[BUTTON_STATUS.ERROR] = {
51
- backgroundColor: theme.palette.background.error16,
52
- color: theme.palette.background.error,
53
- },
54
- _a[BUTTON_STATUS.DISABLED] = {
55
- backgroundColor: theme.palette.background.white16,
56
- color: theme.palette.text.white24,
57
- },
58
- _a);
59
- return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", color: "primary", status: status, sx: __assign({ borderRadius: theme.mixins.customRadius.full, "&.Mui-disabled": __assign({}, disabledStyles[status]) }, sx), children: [status === BUTTON_STATUS.LOADING && ((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)(material_1.CircularProgress, { color: "inherit", size: 20 }), "Processing"] })), status === BUTTON_STATUS.ERROR && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Error" }), status === BUTTON_STATUS.ENABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }), status === BUTTON_STATUS.DISABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })] })));
44
+ // const disabledStyles: Record<string, SxProps> = {
45
+ // [BUTTON_STATUS.LOADING]: {
46
+ // backgroundColor: theme.palette.background.secondary16,
47
+ // color: theme.palette.background.secondary,
48
+ // },
49
+ // [BUTTON_STATUS.ERROR]: {
50
+ // backgroundColor: theme.palette.background.error16,
51
+ // color: theme.palette.background.error,
52
+ // },
53
+ // [BUTTON_STATUS.DISABLED]: {
54
+ // backgroundColor: theme.palette.background.white16,
55
+ // color: theme.palette.text.white24,
56
+ // },
57
+ // };
58
+ return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", status: status, children: [status === BUTTON_STATUS.LOADING && ((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)(material_1.CircularProgress, { color: "inherit", size: 20 }), "Processing"] })), status === BUTTON_STATUS.ERROR && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Error" }), status === BUTTON_STATUS.ENABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }), status === BUTTON_STATUS.DISABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })] })));
60
59
  };
61
60
  Button.Primary.displayName = "Button.Primary";
62
61
  Button.Secondary = function (props) {
63
- var sx = props.sx, rest = __rest(props, ["sx"]);
64
- var theme = (0, material_1.useTheme)();
65
- return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", color: "secondary", sx: __assign({ borderRadius: theme.mixins.customRadius.full, borderColor: "currentColor" }, sx) })));
62
+ var rest = __rest(props, []);
63
+ return (0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined" }));
66
64
  };
67
65
  Button.Secondary.displayName = "Button.Secondary";
68
66
  Button.Text = function (props) {
@@ -189,7 +189,10 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
189
189
  }
190
190
  });
191
191
  }); };
192
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: handleOnOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
192
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: handleOnOpen, onClose: handleOnClose, sx: {
193
+ width: "100%",
194
+ maxWidth: "calc(100dvw - 2rem)",
195
+ }, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
193
196
  backgroundColor: "transparent",
194
197
  width: "100%",
195
198
  }, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Authentication", onClose: handleClose, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "1rem", width: "100%" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: ["Enter your passcode to confirm ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { fontWeight: theme.typography.fontWeight600 }, children: action })] }), (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }));
@@ -6,6 +6,10 @@ export interface ConfirmLayoutProps extends DrawerComponentProps {
6
6
  transferAmount?: number;
7
7
  link?: string;
8
8
  currency?: string;
9
+ header?: {
10
+ rightAdornment?: React.ReactNode;
11
+ };
12
+ isFlag?: boolean;
9
13
  }
10
14
  declare const ConfirmLayout: import("react").ForwardRefExoticComponent<Omit<ConfirmLayoutProps, "ref"> & import("react").RefAttributes<DrawerComponentRef>>;
11
15
  export default ConfirmLayout;
@@ -63,14 +63,14 @@ var jsx_runtime_1 = require("react/jsx-runtime");
63
63
  var material_1 = require("@mui/material");
64
64
  var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
65
65
  var react_1 = require("react");
66
+ var type_1 = require("../../../services/axios/get-activities-service/type");
66
67
  var Text_1 = __importDefault(require("../Text"));
67
68
  var Formatter_1 = __importDefault(require("../Formatter"));
68
69
  var Icon_1 = __importDefault(require("../Icon"));
69
70
  var ChildPageLayout_1 = __importDefault(require("../../../layouts/ChildPageLayout"));
70
71
  var PageHeader_1 = __importDefault(require("../PageHeader"));
71
- var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
72
72
  var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
73
- var children = props.children, rest = __rest(props, ["children"]);
73
+ var children = props.children, action = props.action, header = props.header, _a = props.isFlag, isFlag = _a === void 0 ? true : _a, rest = __rest(props, ["children", "action", "header", "isFlag"]);
74
74
  var theme = (0, material_1.useTheme)();
75
75
  var confirmByPasscodeDrawerRef = (0, react_1.useRef)(null);
76
76
  var handleOnClose = function () {
@@ -95,15 +95,15 @@ var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
95
95
  (_a = confirmByPasscodeDrawerRef.current) === null || _a === void 0 ? void 0 : _a.unlockStatus();
96
96
  },
97
97
  }); });
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,
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: action === type_1.TransactionSlug.Withdrawn ? "Confirm Transaction" : "Confirm deposit", overrideBack: handleOnClose, rightAdornment: header === null || header === void 0 ? void 0 : header.rightAdornment }), 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: [isFlag && ((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.primary,
100
100
  fontSize: theme.typography.fontSize24,
101
101
  fontWeight: theme.typography.fontWeight600,
102
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
103
  fontWeight: theme.typography.fontWeight500,
104
104
  fontSize: theme.typography.fontSize15,
105
105
  color: theme.palette.text.accent2,
106
- }, children: props.currency })] })] }), children] }) }) })));
106
+ }, children: props.currency })] })] })), children] }) }) })));
107
107
  });
108
108
  ConfirmLayout.displayName = "ConfirmLayout";
109
109
  exports.default = ConfirmLayout;
@@ -0,0 +1,12 @@
1
+ export type CopyableTextProps = {
2
+ copyText: string;
3
+ displayText?: string;
4
+ sx?: {
5
+ container?: object;
6
+ text?: object;
7
+ icon?: object;
8
+ button?: object;
9
+ };
10
+ };
11
+ declare const CopyableText: ({ copyText, displayText, sx }: CopyableTextProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default CopyableText;
@@ -0,0 +1,85 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
25
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ var jsx_runtime_1 = require("react/jsx-runtime");
52
+ var react_1 = require("react");
53
+ var material_1 = require("@mui/material");
54
+ var CopyableText = function (_a) {
55
+ var copyText = _a.copyText, displayText = _a.displayText, sx = _a.sx;
56
+ var _b = (0, react_1.useState)(false), copied = _b[0], setCopied = _b[1];
57
+ var handleCopy = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
58
+ var error_1;
59
+ return __generator(this, function (_a) {
60
+ switch (_a.label) {
61
+ case 0:
62
+ _a.trys.push([0, 2, , 3]);
63
+ return [4 /*yield*/, navigator.clipboard.writeText(copyText)];
64
+ case 1:
65
+ _a.sent();
66
+ setCopied(true);
67
+ return [3 /*break*/, 3];
68
+ case 2:
69
+ error_1 = _a.sent();
70
+ console.error("Failed to copy text:", error_1);
71
+ return [3 /*break*/, 3];
72
+ case 3: return [2 /*return*/];
73
+ }
74
+ });
75
+ }); }, [copyText]);
76
+ (0, react_1.useEffect)(function () {
77
+ var timer;
78
+ if (copied) {
79
+ timer = setTimeout(function () { return setCopied(false); }, 2000);
80
+ }
81
+ return function () { return clearTimeout(timer); };
82
+ }, [copied]);
83
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", gap: 0.5, sx: sx === null || sx === void 0 ? void 0 : sx.container, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: copied ? "success.main" : "text.primary", sx: sx === null || sx === void 0 ? void 0 : sx.text, children: copied ? "Copied!" : displayText || copyText }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: handleCopy, size: "small", sx: __assign({ padding: 0.5 }, sx === null || sx === void 0 ? void 0 : sx.button), children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_860_5627", maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "20", height: "20", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_860_5627)", children: (0, jsx_runtime_1.jsx)("path", { d: "M7.54804 14.5826C7.17293 14.5826 6.85587 14.4531 6.59685 14.1941C6.33783 13.9351 6.20831 13.618 6.20831 13.2429V3.75577C6.20831 3.38066 6.33783 3.06359 6.59685 2.80456C6.85587 2.54553 7.17293 2.41602 7.54804 2.41602H15.0352C15.4103 2.41602 15.7273 2.54553 15.9864 2.80456C16.2454 3.06359 16.3749 3.38066 16.3749 3.75577V13.2429C16.3749 13.618 16.2454 13.9351 15.9864 14.1941C15.7273 14.4531 15.4103 14.5826 15.0352 14.5826H7.54804ZM7.54804 13.4993H15.0352C15.0993 13.4993 15.158 13.4726 15.2115 13.4192C15.2649 13.3658 15.2916 13.307 15.2916 13.2429V3.75577C15.2916 3.69166 15.2649 3.63288 15.2115 3.57945C15.158 3.52604 15.0993 3.49933 15.0352 3.49933H7.54804C7.48393 3.49933 7.42517 3.52604 7.37175 3.57945C7.31832 3.63288 7.2916 3.69166 7.2916 3.75577V13.2429C7.2916 13.307 7.31832 13.3658 7.37175 13.4192C7.42517 13.4726 7.48393 13.4993 7.54804 13.4993ZM4.96473 17.1659C4.58963 17.1659 4.27257 17.0364 4.01354 16.7774C3.75451 16.5184 3.625 16.2013 3.625 15.8262V5.25577H4.70831V15.8262C4.70831 15.8903 4.73502 15.9491 4.78844 16.0025C4.84187 16.0559 4.90063 16.0826 4.96473 16.0826H13.5352V17.1659H4.96473Z", fill: "#1E4841" }) })] }) }) })] }));
84
+ };
85
+ exports.default = CopyableText;
@@ -110,7 +110,7 @@ function Fees(props) {
110
110
  width: "100%",
111
111
  ml: theme.mixins.gaps.g8,
112
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) {
113
+ } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), 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) {
114
114
  var _a;
115
115
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_2.Fragment, { children: [index !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
116
116
  borderRight: "1px dashed ".concat(theme.palette.border.white24),
@@ -104,6 +104,7 @@ var get_est_fee_service_1 = __importDefault(require("../../../services/axios/get
104
104
  var type_1 = require("../../../services/axios/get-activities-service/type");
105
105
  var validate_wallet_address_service_1 = __importDefault(require("../../../services/axios/validate-wallet-address-service"));
106
106
  var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
107
+ var CopyableText_1 = __importDefault(require("../CopyableText"));
107
108
  var SendExternalTokenError;
108
109
  (function (SendExternalTokenError) {
109
110
  SendExternalTokenError["TOKEN_NOT_FOUND"] = "Token not found";
@@ -261,19 +262,16 @@ var SendExternalToken = (0, react_1.forwardRef)(function (props, ref) {
261
262
  open: handleOpen,
262
263
  close: handleClose,
263
264
  }); });
264
- var estimateReceive = (0, react_1.useMemo)(function () {
265
- if (!estimateFee || !amount)
266
- return undefined;
267
- return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
268
- }, [estimateFee, amount]);
269
- return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
265
+ var formatted = "".concat(toAddress.slice(0, 8), "...").concat(toAddress.slice(-3));
266
+ return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, isFlag: false, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), { textAlign: "start", mr: "auto" }), component: "p", children: "Transaction summary" }), (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: "Amount", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, ml: "auto", alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", sx: __assign({}, theme.mixins.value), children: token === null || token === void 0 ? void 0 : token.name })] }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.link, sx: {
267
+ borderRadius: theme.mixins.customRadius.full,
268
+ } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Address", value: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
270
269
  wordBreak: "break-all",
271
- }, children: toAddress }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: "Receive amount estimated" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
272
- fontWeight: theme.typography.fontWeight600,
273
- fontSize: theme.typography.fontSize16,
274
- }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.customMargin.m6 }), 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)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress
270
+ }, children: (0, jsx_runtime_1.jsx)(CopyableText_1.default, { copyText: toAddress, displayText: formatted }) }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Type", value: "On-chain withdraw" }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Comment", value: memo }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug })), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.customMargin.m6 }), 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: transactionSlug, onConfirmSuccess: handleSendExternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
271
+ width: "100%",
272
+ }, status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress
275
273
  ? Button_1.BUTTON_STATUS.DISABLED
276
- : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
274
+ : buttonStatus, children: "Confirm" }) }) })] }) }));
277
275
  });
278
276
  SendExternalToken.displayName = "SendExternalToken";
279
277
  exports.default = SendExternalToken;
@@ -25,13 +25,13 @@ var getIcon_1 = __importDefault(require("../../../../utils/getIcon"));
25
25
  function TransferTarget(props) {
26
26
  var transferData = props.transferData;
27
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,
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.background.primary, 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.secondary,
30
30
  fontWeight: theme.typography.fontWeight500,
31
31
  fontSize: theme.typography.fontSize11,
32
32
  marginRight: theme.mixins.customMargin.m6,
33
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,
34
+ color: theme.palette.text.secondary,
35
35
  fontWeight: theme.typography.fontWeight500,
36
36
  fontSize: theme.typography.fontSize11,
37
37
  marginRight: theme.mixins.customMargin.m6,
@@ -268,17 +268,11 @@ var TransferInternal = (0, react_1.forwardRef)(function (props, ref) {
268
268
  // if (!estimateFee || !amount) return undefined;
269
269
  // return +amount - +estimateFee?.feeInCurrency;
270
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
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, { sx: {
272
+ width: "100%",
273
+ }, status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress || !isEnoughBalanceToPayFee
272
274
  ? 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" }) }) })] }) }));
275
+ : buttonStatus, fullWidth: true, children: "Confirm" }) }) })] }) }));
282
276
  });
283
277
  TransferInternal.displayName = "TransferInternal";
284
278
  exports.default = TransferInternal;
@@ -18,6 +18,7 @@ export interface NetworkData {
18
18
  slug: string;
19
19
  network_type: string;
20
20
  icon: string;
21
+ link: string;
21
22
  icon_svg: string;
22
23
  address: string;
23
24
  }
@@ -38,8 +38,10 @@ var background = {
38
38
  black64: "rgba(0, 0, 0, 0.64)",
39
39
  black24: "rgba(0, 0, 0, 0.24)",
40
40
  black16: "rgba(0, 0, 0, 0.16)",
41
- secondary: "#01FFFF",
42
- secondary16: "rgba(1, 255, 255, 0.16)",
41
+ primary: "#1E4841",
42
+ primary16: "#1E484129",
43
+ secondary: "#C5E99F",
44
+ secondary16: "#C5E99F29",
43
45
  error: "#FE6565",
44
46
  error16: "rgba(254, 101, 101, 0.16)",
45
47
  };
@@ -66,11 +68,10 @@ var text = {
66
68
  black64: "rgba(0, 0, 0, 0.64)",
67
69
  black24: "rgba(0, 0, 0, 0.24)",
68
70
  blackContrast: "#121212",
69
- mainGreen: "#1E4841",
70
- secondaryGreen: "#C5E99F",
71
+ primary: "#1E4841",
72
+ secondary: "#C5E99F",
71
73
  accent: "#A3A3A3",
72
74
  accent2: "#6B7271",
73
- secondary: "#01FFFF",
74
75
  successStatus: "#01FF00",
75
76
  errorStatus: "#FE6565",
76
77
  loadingStatus: "#01FFFF",
@@ -167,12 +168,12 @@ var shadows = [
167
168
  var theme = (0, styles_1.createTheme)({
168
169
  palette: {
169
170
  primary: {
170
- main: "#ffffff",
171
+ main: "#1E4841",
171
172
  contrastText: "#000000",
172
173
  },
173
174
  secondary: {
174
- main: "#01FFFF",
175
- contrastText: "#01FFFF",
175
+ main: "#C5E99F",
176
+ contrastText: "#000000",
176
177
  },
177
178
  background: background,
178
179
  border: border,
@@ -181,6 +182,39 @@ var theme = (0, styles_1.createTheme)({
181
182
  },
182
183
  typography: typography,
183
184
  shadows: shadows,
185
+ components: {
186
+ MuiButton: {
187
+ variants: [
188
+ {
189
+ props: { variant: "contained" },
190
+ style: {
191
+ color: text.secondary,
192
+ backgroundColor: background.primary,
193
+ fontSize: typography.fontSize16,
194
+ lineHeight: typography.leading100,
195
+ fontWeight: typography.fontWeight500,
196
+ padding: "".concat(customPadding.p12, " ").concat(customPadding.p16),
197
+ borderRadius: customRadius.r12,
198
+ textTransform: "capitalize",
199
+ },
200
+ },
201
+ {
202
+ props: { variant: "outlined" },
203
+ style: {
204
+ color: text.primary,
205
+ backgroundColor: "transparent",
206
+ fontSize: typography.fontSize16,
207
+ lineHeight: typography.leading100,
208
+ fontWeight: typography.fontWeight500,
209
+ padding: "".concat(customPadding.p12, " ").concat(customPadding.p16),
210
+ borderRadius: customRadius.r12,
211
+ textTransform: "capitalize",
212
+ borderColor: "currentColor",
213
+ },
214
+ },
215
+ ],
216
+ },
217
+ },
184
218
  mixins: {
185
219
  pagePadding: pagePadding,
186
220
  customPadding: customPadding,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.606",
3
+ "version": "0.0.607",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",