tek-wallet 0.0.735 → 0.0.737

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.
Files changed (76) hide show
  1. package/dist/components/TekWallet/components/index.d.ts +2 -0
  2. package/dist/components/TekWallet/components/index.js +2 -0
  3. package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +13 -12
  4. package/dist/components/TekWallet/components/ui/AnalyticGroup/index.js +10 -11
  5. package/dist/components/TekWallet/components/ui/DrawerComponent/index.d.ts +2 -0
  6. package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +9 -12
  7. package/dist/components/TekWallet/components/ui/Fees/index.d.ts +1 -1
  8. package/dist/components/TekWallet/components/ui/Fees/index.js +2 -2
  9. package/dist/components/TekWallet/components/ui/HistorySwap/index.js +3 -2
  10. package/dist/components/TekWallet/components/ui/IncomeWallet/components/AnalyticGroup.d.ts +8 -0
  11. package/dist/components/TekWallet/components/ui/IncomeWallet/components/AnalyticGroup.js +87 -0
  12. package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.d.ts +7 -0
  13. package/dist/components/TekWallet/components/ui/IncomeWallet/components/BalanceChart.js +170 -0
  14. package/dist/components/TekWallet/components/ui/IncomeWallet/components/FunctionItem.d.ts +11 -0
  15. package/dist/components/TekWallet/components/ui/IncomeWallet/components/FunctionItem.js +29 -0
  16. package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.d.ts +7 -0
  17. package/dist/components/TekWallet/components/ui/IncomeWallet/components/HistoryItem.js +60 -0
  18. package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.d.ts +13 -0
  19. package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.js +69 -0
  20. package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthWithdraw.d.ts +13 -0
  21. package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthWithdraw.js +67 -0
  22. package/dist/components/TekWallet/components/ui/IncomeWallet/components/deposit/index.d.ts +6 -0
  23. package/dist/components/TekWallet/components/ui/IncomeWallet/components/deposit/index.js +13 -0
  24. package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.d.ts +6 -0
  25. package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.js +19 -0
  26. package/dist/components/TekWallet/components/ui/IncomeWallet/index.d.ts +8 -0
  27. package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +57 -0
  28. package/dist/components/TekWallet/components/ui/IncomeWallet/types/index.d.ts +2 -0
  29. package/dist/components/TekWallet/components/ui/IncomeWallet/types/index.js +18 -0
  30. package/dist/components/TekWallet/components/ui/IncomeWallet/types/transaction.history.dto.d.ts +15 -0
  31. package/dist/components/TekWallet/components/ui/IncomeWallet/types/transaction.history.dto.js +2 -0
  32. package/dist/components/TekWallet/components/ui/IncomeWallet/types/userinfo.dto.d.ts +12 -0
  33. package/dist/components/TekWallet/components/ui/IncomeWallet/types/userinfo.dto.js +2 -0
  34. package/dist/components/TekWallet/components/ui/ModalLayout/index.d.ts +1 -1
  35. package/dist/components/TekWallet/components/ui/ModalLayout/index.js +1 -1
  36. package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
  37. package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +1 -1
  38. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.d.ts +1 -3
  39. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +13 -27
  40. package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +3 -2
  41. package/dist/components/TekWallet/components/ui/Spacer/index.d.ts +5 -0
  42. package/dist/components/TekWallet/components/ui/Spacer/index.js +7 -0
  43. package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +5 -0
  44. package/dist/components/TekWallet/components/ui/SvgPath/index.js +7 -2
  45. package/dist/components/TekWallet/components/ui/TransferConfirmation/index.d.ts +1 -0
  46. package/dist/components/TekWallet/components/ui/TransferConfirmation/index.js +21 -14
  47. package/dist/components/TekWallet/index.d.ts +10 -0
  48. package/dist/components/TekWallet/index.js +10 -0
  49. package/dist/components/TekWallet/theme/mui/theme.d.ts +5 -0
  50. package/dist/components/TekWallet/theme/mui/theme.js +5 -0
  51. package/dist/components/TekWallet/types/expose-type.d.ts +0 -46
  52. package/dist/components/TekWallet/utils/ref.extension.d.ts +3 -0
  53. package/dist/components/TekWallet/utils/ref.extension.js +8 -0
  54. package/package.json +1 -1
  55. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.d.ts +0 -8
  56. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +0 -149
  57. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.d.ts +0 -8
  58. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +0 -21
  59. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.d.ts +0 -9
  60. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +0 -125
  61. package/dist/components/TekWallet/components/ui/FiatDeposit/index.d.ts +0 -5
  62. package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +0 -254
  63. package/dist/components/TekWallet/components/ui/TimeText/index.d.ts +0 -5
  64. package/dist/components/TekWallet/components/ui/TimeText/index.js +0 -22
  65. package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.d.ts +0 -13
  66. package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.js +0 -55
  67. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +0 -3
  68. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +0 -158
  69. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +0 -55
  70. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +0 -45
  71. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +0 -2
  72. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +0 -13
  73. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +0 -39
  74. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +0 -65
  75. package/dist/components/TekWallet/utils/cn.d.ts +0 -2
  76. package/dist/components/TekWallet/utils/cn.js +0 -12
@@ -1,254 +0,0 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- var __importDefault = (this && this.__importDefault) || function (mod) {
47
- return (mod && mod.__esModule) ? mod : { "default": mod };
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.CopyIcon = void 0;
51
- exports.default = FiatDeposit;
52
- var jsx_runtime_1 = require("react/jsx-runtime");
53
- var material_1 = require("@mui/material");
54
- var react_1 = require("react");
55
- var SvgPath_1 = require("../SvgPath");
56
- var ReceiveHistory_1 = __importDefault(require("../ReceiveHistory"));
57
- var xhub_keyboard_1 = require("xhub-keyboard");
58
- var useUniqueId_1 = require("../../../hooks/useUniqueId");
59
- var getDepositFiatInfoService_1 = __importDefault(require("../../../services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService"));
60
- var useWallet_1 = __importDefault(require("../../../hooks/useWallet"));
61
- var image_1 = __importDefault(require("next/image"));
62
- var usehooks_ts_1 = require("usehooks-ts");
63
- var TimeText_1 = __importDefault(require("../TimeText"));
64
- var formatter_1 = __importDefault(require("../Formatter/functions/formatter"));
65
- var shareDrawer_1 = __importDefault(require("./components/shareDrawer"));
66
- var link_1 = __importDefault(require("next/link"));
67
- var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
68
- var theme_1 = __importDefault(require("../../../theme/mui/deposit-fiat-theme/theme"));
69
- // Because PageHeader component don't work
70
- var BackArrow = function (props) {
71
- return ((0, jsx_runtime_1.jsxs)("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, props, { children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_6061_2295", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_6061_2295)", children: (0, jsx_runtime_1.jsx)("path", { d: "M14 17.6538L8.34619 12L14 6.34619L15.0538 7.40002L10.4538 12L15.0538 16.6L14 17.6538Z", fill: "#121212" }) })] })));
72
- };
73
- var Header = function (_a) {
74
- var handleBack = _a.handleBack;
75
- var historyRef = (0, react_1.useRef)(null);
76
- return ((0, jsx_runtime_1.jsxs)(material_1.Grid2, { display: "grid", py: "0.75rem", px: "1rem", container: true, sx: {
77
- gridTemplateColumns: "1fr 1fr 1fr",
78
- gridTemplateRows: "1fr",
79
- alignItems: "center",
80
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid2, { children: (0, jsx_runtime_1.jsx)(BackArrow, { onClick: handleBack }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { display: "flex", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title01", sx: { width: "100%", textAlign: "center" }, children: "Top up" }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "end", gap: ".5rem", children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_HELP }), (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true, sx: { width: "1px" } }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: historyRef, trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, children: SvgPath_1.IC_HISTORY }), direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(ReceiveHistory_1.default, { onClose: function () { var _a; return (_a = historyRef.current) === null || _a === void 0 ? void 0 : _a.close(); } }) })] }) })] }));
81
- };
82
- var CopyIcon = function () {
83
- return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M11 11.5V13.75C11 14.164 10.664 14.5 10.25 14.5H3.75C3.55109 14.5 3.36032 14.421 3.21967 14.2803C3.07902 14.1397 3 13.9489 3 13.75V5.25C3 4.836 3.336 4.5 3.75 4.5H5C5.33505 4.49977 5.66954 4.52742 6 4.58267M11 11.5H13.25C13.664 11.5 14 11.164 14 10.75V7.5C14 4.52667 11.838 2.05933 9 1.58267C8.66954 1.52742 8.33505 1.49977 8 1.5H6.75C6.336 1.5 6 1.836 6 2.25V4.58267M11 11.5H6.75C6.55109 11.5 6.36032 11.421 6.21967 11.2803C6.07902 11.1397 6 10.9489 6 10.75V4.58267M14 9V7.75C14 7.15326 13.7629 6.58097 13.341 6.15901C12.919 5.73705 12.3467 5.5 11.75 5.5H10.75C10.5511 5.5 10.3603 5.42098 10.2197 5.28033C10.079 5.13968 10 4.94891 10 4.75V3.75C10 3.45453 9.9418 3.16195 9.82873 2.88896C9.71566 2.61598 9.54992 2.36794 9.34099 2.15901C9.13206 1.95008 8.88402 1.78435 8.61104 1.67127C8.33806 1.5582 8.04547 1.5 7.75 1.5H7", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
84
- };
85
- exports.CopyIcon = CopyIcon;
86
- function FiatDeposit(_a) {
87
- var _b, _c, _d, _e, _f;
88
- var children = _a.children;
89
- var amountInputRef = (0, react_1.useRef)(null);
90
- var _g = (0, useWallet_1.default)(), masterWallet = _g.masterWallet, transaction = _g.transaction, updateActivities = _g.updateActivities, receiveExternalTokens = _g.receiveExternalTokens, tokens = _g.tokens, pushNotification = _g.pushNotification;
91
- var _h = (0, react_1.useState)(false), open = _h[0], setOpen = _h[1];
92
- var _j = (0, react_1.useState)(false), openQR = _j[0], setOpenQR = _j[1];
93
- var _k = (0, react_1.useState)(false), openShare = _k[0], setOpenShare = _k[1];
94
- var keyboardId = (0, useUniqueId_1.useUniqueId)("receive-function-keyboard");
95
- var _l = (0, react_1.useState)(""), inputAmount = _l[0], setInputAmount = _l[1];
96
- var _m = (0, react_1.useState)(null), depositData = _m[0], setDepositData = _m[1];
97
- var _o = (0, react_1.useState)(false), loading = _o[0], setLoading = _o[1];
98
- var _p = (0, react_1.useState)(null), error = _p[0], setError = _p[1];
99
- var _q = (0, react_1.useState)(false), copySuccess = _q[0], setCopySuccess = _q[1];
100
- var _r = (0, usehooks_ts_1.useCountdown)({
101
- countStart: 600,
102
- }), count = _r[0], _s = _r[1], startCountdown = _s.startCountdown, resetCountdown = _s.resetCountdown;
103
- var handleChangeAmount = function (value) {
104
- var amountNumber = Number(value);
105
- if (isNaN(amountNumber)) {
106
- return;
107
- }
108
- setInputAmount(value);
109
- };
110
- var validateInput = function (input) {
111
- var token = receiveExternalTokens === null || receiveExternalTokens === void 0 ? void 0 : receiveExternalTokens.find(function (item) { return item.slug.toLocaleLowerCase() === "vnd"; });
112
- if (!token) {
113
- setError("Token not found");
114
- return false;
115
- }
116
- if (+input <= token.min_value) {
117
- setError("Minimum deposit amount is ".concat((0, formatter_1.default)(token.min_value, false, false)));
118
- return false;
119
- }
120
- if (+input > token.max_value) {
121
- setError("Maximum deposit amount is ".concat((0, formatter_1.default)(token.max_value, false, false)));
122
- return false;
123
- }
124
- return true;
125
- };
126
- var handleClick = function () {
127
- if (loading)
128
- return;
129
- if (!validateInput(inputAmount.toString())) {
130
- setLoading(false);
131
- return;
132
- }
133
- setLoading(true);
134
- (0, getDepositFiatInfoService_1.default)({
135
- amount: +inputAmount,
136
- to_address: masterWallet !== null && masterWallet !== void 0 ? masterWallet : "",
137
- currency_slug: "vnd",
138
- network: "ton",
139
- network_address: "vnd",
140
- await_completion: false,
141
- orderInfo: "test",
142
- email: "test@gmail.com",
143
- })
144
- .then(function (res) {
145
- setDepositData(res);
146
- setOpenQR(true);
147
- resetCountdown();
148
- startCountdown();
149
- })
150
- .finally(function () {
151
- setLoading(false);
152
- });
153
- };
154
- (0, react_1.useEffect)(function () {
155
- if (copySuccess) {
156
- var timeout_1 = setTimeout(function () { return setCopySuccess(false); }, 2000);
157
- return function () { return clearTimeout(timeout_1); };
158
- }
159
- }, [copySuccess]);
160
- var handleCopyLink = function (text) {
161
- if (!(depositData === null || depositData === void 0 ? void 0 : depositData.id) || copySuccess)
162
- return;
163
- navigator.clipboard
164
- .writeText(text)
165
- .then(function () {
166
- setCopySuccess(true);
167
- })
168
- .catch(function (err) {
169
- console.error("Failed to copy link:", err);
170
- });
171
- };
172
- (0, react_1.useEffect)(function () {
173
- if ((transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status) === "success") {
174
- updateActivities();
175
- setOpen(false);
176
- setOpenQR(false);
177
- setOpenShare(false);
178
- setInputAmount("");
179
- pushNotification({
180
- message: "Deposit successful!",
181
- type: "success",
182
- id: "deposit-fiat-success",
183
- });
184
- }
185
- // eslint-disable-next-line react-hooks/exhaustive-deps
186
- }, [transaction]);
187
- (0, react_1.useEffect)(function () {
188
- if (inputAmount && !isNaN(Number(inputAmount)) && validateInput(inputAmount.toString())) {
189
- setError(null);
190
- }
191
- // eslint-disable-next-line react-hooks/exhaustive-deps
192
- }, [inputAmount]);
193
- return ((0, jsx_runtime_1.jsxs)(material_1.ThemeProvider, { theme: theme_1.default, children: [(0, jsx_runtime_1.jsx)("span", { onClick: function (e) {
194
- e.stopPropagation();
195
- setOpen(true);
196
- }, children: children }), (0, jsx_runtime_1.jsxs)(material_1.Drawer, { open: open, onClose: function () {
197
- setOpen(false);
198
- setInputAmount("");
199
- }, anchor: "right", keepMounted: false, onClick: function (e) { return e.stopPropagation(); }, children: [(0, jsx_runtime_1.jsx)(Header, { handleBack: function () {
200
- setOpen(false);
201
- setInputAmount("");
202
- } }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, onChange: handleChangeAmount, keyboardType: xhub_keyboard_1.KeyboardType.Double, value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), keyboardId: "amount-keyboard-id", classNames: {
203
- children: "fc",
204
- }, styles: {
205
- container: {
206
- height: "100%",
207
- },
208
- }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { height: "100%", flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { height: 0, flex: 1, p: "1rem", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "column", p: "1rem", sx: {
209
- backgroundColor: theme_1.default.palette.tertiary.main,
210
- border: "1px solid",
211
- borderColor: theme_1.default.palette.accent3.main,
212
- borderRadius: "1rem",
213
- gap: "0.5rem",
214
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title02", color: "positive", children: "You Pay" }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { autoFocus: true, alwaysFocus: true, ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, styles: {
215
- container: {
216
- border: "1px solid ".concat(error ? theme_1.default.palette.error.main : theme_1.default.palette.primary.main),
217
- },
218
- }, rightElement: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", gap: "4px", flexShrink: 0, pl: "1rem", children: [(0, jsx_runtime_1.jsx)(image_1.default, { alt: "", width: 16, height: 16, src: (_c = (_b = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (item) { return item.currency_slug.toLocaleLowerCase() === "vnd"; })) === null || _b === void 0 ? void 0 : _b.currency.link) !== null && _c !== void 0 ? _c : "/" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content01", color: "accent2", children: "VND" })] }) }) }), error && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "content02", color: "error", display: "flex", alignItems: "center", gap: "4px", children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5.25V7.4375M12.25 7C12.25 7.68944 12.1142 8.37213 11.8504 9.00909C11.5865 9.64605 11.1998 10.2248 10.7123 10.7123C10.2248 11.1998 9.64605 11.5865 9.00909 11.8504C8.37213 12.1142 7.68944 12.25 7 12.25C6.31056 12.25 5.62787 12.1142 4.99091 11.8504C4.35395 11.5865 3.7752 11.1998 3.28769 10.7123C2.80018 10.2248 2.41347 9.64605 2.14963 9.00909C1.8858 8.37213 1.75 7.68944 1.75 7C1.75 5.60761 2.30312 4.27226 3.28769 3.28769C4.27226 2.30312 5.60761 1.75 7 1.75C8.39239 1.75 9.72774 2.30312 10.7123 3.28769C11.6969 4.27226 12.25 5.60761 12.25 7ZM7 9.1875H7.00467V9.19217H7V9.1875Z", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), error] }))] }) }), (0, jsx_runtime_1.jsx)(material_1.Stack, { pt: "12px", id: "input-amount-action", children: (0, jsx_runtime_1.jsx)(material_1.Box, { px: "1rem", pb: "1.5rem", children: (0, jsx_runtime_1.jsx)(material_1.Button, { loading: loading, disabled: loading || !!error, onClick: handleClick, fullWidth: true, children: "Continue" }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Drawer, { open: openQR, onClose: function () { return setOpenQR(false); }, anchor: "right", keepMounted: false, onClick: function (e) { return e.stopPropagation(); }, children: [(0, jsx_runtime_1.jsx)(Header, { handleBack: function () {
219
- setOpen(false);
220
- setOpenQR(false);
221
- setInputAmount("");
222
- } }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { height: "100%", p: "1rem", pt: "26%", children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { height: 0, flex: 1, width: "100%", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { alignItems: "center", p: "1rem", sx: {
223
- backgroundColor: theme_1.default.palette.tertiary.main,
224
- border: "1px solid",
225
- borderColor: theme_1.default.palette.accent3.main,
226
- borderRadius: "1rem",
227
- gap: "0.75rem",
228
- }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", width: "45%", mt: "-25%", sx: { aspectRatio: "1 / 1" }, children: [(0, jsx_runtime_1.jsx)(image_1.default, { alt: "", fill: true, src: (_d = depositData === null || depositData === void 0 ? void 0 : depositData.qr_code) !== null && _d !== void 0 ? _d : "/", style: { filter: count === 0 ? "blur(6px)" : "none" } }), count === 0 && ((0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", position: "absolute", alignItems: "center", justifyContent: "center", sx: {
229
- background: "transparent",
230
- inset: 0,
231
- }, onClick: handleClick, children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M16.0234 9.34794H21.0154L17.8344 6.16494C16.8103 5.14081 15.5346 4.40433 14.1356 4.02955C12.7366 3.65476 11.2636 3.65487 9.86464 4.02986C8.4657 4.40486 7.19014 5.14153 6.16617 6.16581C5.14221 7.19009 4.40594 8.46588 4.03138 9.86494M2.98537 19.6439V14.6519M2.98537 14.6519H7.97738M2.98537 14.6519L6.16537 17.8349C7.18949 18.8591 8.46517 19.5955 9.86416 19.9703C11.2632 20.3451 12.7362 20.345 14.1351 19.97C15.534 19.595 16.8096 18.8584 17.8336 17.8341C18.8575 16.8098 19.5938 15.534 19.9684 14.1349M21.0154 4.35594V9.34594", stroke: "#1E4841", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "title01", sx: {
232
- fontSize: "1.5rem",
233
- fontWeight: 600,
234
- lineHeight: "140%",
235
- display: "flex",
236
- alignItems: "center",
237
- flexDirection: "column",
238
- }, color: "primary", children: [(0, formatter_1.default)((_e = depositData === null || depositData === void 0 ? void 0 : depositData.amount) !== null && _e !== void 0 ? _e : 0, false, false) || "--", (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title01", sx: {
239
- fontSize: "0.938rem",
240
- fontWeight: 500,
241
- lineHeight: "140%",
242
- }, color: "accent2", children: "VND" })] }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { display: "flex", alignItems: "center", gap: "0.375rem", variant: "title03", color: "accent2", children: ["Top up time left", (0, jsx_runtime_1.jsx)(TimeText_1.default, { seconds: count }), (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841", strokeLinecap: "round", strokeLinejoin: "round" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { display: "flex", flexDirection: "column", alignItems: "center", gap: "0.375rem", variant: "title01", children: [depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_name, (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content02", color: "accent2", children: depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.bank_name }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "title02", display: "flex", alignItems: "center", gap: "0.25rem", children: [copySuccess ? "Copied!" : depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_number, (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "icon", onClick: function () { var _a; return handleCopyLink((_a = depositData === null || depositData === void 0 ? void 0 : depositData.metadata.bank_account.account_number) !== null && _a !== void 0 ? _a : ""); }, children: (0, jsx_runtime_1.jsx)(exports.CopyIcon, {}) })] }), (0, jsx_runtime_1.jsx)(link_1.default, { href: (_f = depositData === null || depositData === void 0 ? void 0 : depositData._link.payment_link.href) !== null && _f !== void 0 ? _f : "#", target: "_blank", rel: "noopener noreferrer", style: {
243
- marginTop: "-0.5rem",
244
- }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "content02", sx: { textDecoration: "underline", fontStyle: "italic" }, children: "Transfer" }) })] })] }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { pt: "0.75rem", pb: "1rem", width: "100%", children: (0, jsx_runtime_1.jsx)(material_1.Button, { disabled: loading, loading: loading, onClick: function () {
245
- if (count === 0) {
246
- handleClick();
247
- }
248
- else {
249
- setOpenShare(true);
250
- }
251
- }, fullWidth: true, children: count === 0 ? "Reload" : "Share" }) })] })] }), (0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, { keepMounted: false, anchor: "bottom", open: openShare, onOpen: function () { return setOpenShare(true); }, onClose: function () { return setOpenShare(false); }, classes: { paper: "rounded-t-2xl" }, sx: {
252
- zIndex: 1201,
253
- }, onClick: function (e) { return e.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(shareDrawer_1.default, { count: count, depositData: depositData, handleRefresh: handleClick, onClose: function () { return setOpenShare(false); } }) })] }));
254
- }
@@ -1,5 +0,0 @@
1
- export interface ITimeTextProps {
2
- seconds: number;
3
- format?: "hh:mm:ss" | "mm:ss";
4
- }
5
- export default function TimeText({ seconds, format }: ITimeTextProps): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = TimeText;
4
- var jsx_runtime_1 = require("react/jsx-runtime");
5
- var material_1 = require("@mui/material");
6
- function TimeText(_a) {
7
- var seconds = _a.seconds, _b = _a.format, format = _b === void 0 ? "mm:ss" : _b;
8
- var formatTime = function (totalSeconds, timeFormat) {
9
- var hours = Math.floor(totalSeconds / 3600);
10
- var minutes = Math.floor((totalSeconds % 3600) / 60);
11
- var secs = totalSeconds % 60;
12
- var pad = function (num) { return num.toString().padStart(2, "0"); };
13
- if (timeFormat === "hh:mm:ss") {
14
- return "".concat(pad(hours), ":").concat(pad(minutes), ":").concat(pad(secs));
15
- }
16
- else if (timeFormat === "mm:ss") {
17
- return "".concat(pad(minutes), ":").concat(pad(secs));
18
- }
19
- return "".concat(pad(minutes), ":").concat(pad(secs));
20
- };
21
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "title03", color: seconds ? "success" : "error", children: formatTime(seconds, format) }));
22
- }
@@ -1,13 +0,0 @@
1
- import { FiatDepositData } from "../../../types/expose-type";
2
- export interface GetDepositFiatInfoServicePayLoad {
3
- amount: number;
4
- to_address: string;
5
- currency_slug: string;
6
- network: string;
7
- network_address: string;
8
- await_completion: boolean;
9
- orderInfo: string;
10
- email: string;
11
- }
12
- declare const getDepositFiatInfoService: (payload: GetDepositFiatInfoServicePayLoad) => Promise<FiatDepositData>;
13
- export default getDepositFiatInfoService;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- var userClientRequest_1 = __importDefault(require("../clients/userClientRequest"));
43
- var getDepositFiatInfoService = function (payload) { return __awaiter(void 0, void 0, void 0, function () {
44
- var response;
45
- var _a;
46
- return __generator(this, function (_b) {
47
- switch (_b.label) {
48
- case 0: return [4 /*yield*/, userClientRequest_1.default.post("/transaction/request-sub-payment", payload)];
49
- case 1:
50
- response = _b.sent();
51
- return [2 /*return*/, (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data];
52
- }
53
- });
54
- }); };
55
- exports.default = getDepositFiatInfoService;
@@ -1,3 +0,0 @@
1
- import type { Theme } from "@mui/material";
2
- import type { Components, CssVarsTheme } from "@mui/material/styles";
3
- export declare const components: Components<Omit<Theme, "components" | "palette"> & CssVarsTheme> | undefined;
@@ -1,158 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.components = void 0;
15
- exports.components = {
16
- MuiCssBaseline: {
17
- styleOverrides: {
18
- "*": {
19
- fontFamily: "inherit",
20
- color: "inherit",
21
- },
22
- },
23
- },
24
- MuiButton: {
25
- styleOverrides: {
26
- root: function (_a) {
27
- var theme = _a.theme;
28
- return (__assign(__assign({}, theme.typography.supportButton), { fontWeight: 600, textTransform: "none", padding: theme.spacing(".75rem", 2), minHeight: 0, minWidth: 0, borderRadius: ".75rem" }));
29
- },
30
- endIcon: function (_a) {
31
- var theme = _a.theme;
32
- return ({
33
- marginLeft: theme.spacing(0.5),
34
- });
35
- },
36
- },
37
- defaultProps: {
38
- variant: "contained",
39
- color: "primary",
40
- loadingPosition: "center",
41
- },
42
- variants: [
43
- {
44
- props: { variant: "icon" },
45
- style: function (_a) {
46
- var theme = _a.theme;
47
- return (__assign(__assign({}, theme.typography.supportButton), { textTransform: "none", padding: theme.spacing(0), minWidth: "unset", width: "fit-content" }));
48
- },
49
- },
50
- {
51
- props: { variant: "text" },
52
- style: function (_a) {
53
- var theme = _a.theme;
54
- return (__assign(__assign({}, theme.typography.supportButton), { textTransform: "none", padding: theme.spacing(0), minWidth: "2rem", width: "fit-content" }));
55
- },
56
- },
57
- {
58
- props: { size: "small" },
59
- style: function (_a) {
60
- var theme = _a.theme;
61
- return (__assign(__assign({}, theme.typography.content01), { textTransform: "none", borderRadius: ".5rem", padding: theme.spacing(".25rem", "1rem"), width: "fit-content" }));
62
- },
63
- },
64
- {
65
- props: { disabled: true },
66
- style: function (_a) {
67
- var theme = _a.theme;
68
- return ({
69
- backgroundColor: "".concat(theme.palette.accent3.main, " !important"),
70
- color: "".concat(theme.palette.accent.main, " !important"),
71
- });
72
- },
73
- },
74
- {
75
- props: { loading: true, color: "primary" },
76
- style: function () { return ({
77
- background: "linear-gradient(0deg, rgba(30, 72, 65, 0.20) 0%, rgba(30, 72, 65, 0.20) 100%), #FFF !important",
78
- color: "#1E484180 !important",
79
- }); },
80
- },
81
- {
82
- props: { loading: true, color: "secondary" },
83
- style: function () { return ({
84
- background: "linear-gradient(0deg, rgba(197, 233, 159, 0.20) 0%, rgba(197, 233, 159, 0.20) 100%), #FFF !important",
85
- color: "#1E484180 !important",
86
- }); },
87
- },
88
- {
89
- props: { loading: true, variant: "outlined" },
90
- style: function (_a) {
91
- var theme = _a.theme;
92
- return ({
93
- background: "".concat(theme.palette.negative.main, " !important"),
94
- color: "#8EA3A0 !important",
95
- borderColor: "#A3AFAD !important",
96
- });
97
- },
98
- },
99
- {
100
- props: { loading: true, size: "small", color: "primary" },
101
- style: function () { return ({
102
- color: "transparent !important",
103
- "& .MuiCircularProgress-circle": {
104
- stroke: "#8EA3A0",
105
- },
106
- }); },
107
- },
108
- {
109
- props: { loading: true, size: "small", color: "secondary" },
110
- style: function () { return ({
111
- color: "transparent !important",
112
- "& .MuiCircularProgress-circle": {
113
- stroke: "#1E484180",
114
- },
115
- }); },
116
- },
117
- {
118
- props: { loading: true, size: "small", color: "secondary" },
119
- style: function () { return ({
120
- color: "transparent !important",
121
- "& .MuiCircularProgress-circle": {
122
- stroke: "#8EA3A0",
123
- },
124
- }); },
125
- },
126
- ],
127
- },
128
- MuiSwipeableDrawer: {
129
- defaultProps: {
130
- anchor: "bottom",
131
- },
132
- },
133
- MuiDrawer: {
134
- styleOverrides: {
135
- root: function (_a) {
136
- var theme = _a.theme;
137
- return ({
138
- "& .MuiDrawer-paperAnchorRight": {
139
- backgroundColor: theme.palette.negative.main,
140
- left: 0,
141
- },
142
- });
143
- },
144
- },
145
- },
146
- MuiDivider: {
147
- styleOverrides: {
148
- root: function (_a) {
149
- var theme = _a.theme;
150
- return ({
151
- backgroundColor: theme.palette.accent3.main,
152
- color: theme.palette.accent3.main,
153
- opacity: 0.5,
154
- });
155
- },
156
- },
157
- },
158
- };
@@ -1,55 +0,0 @@
1
- import type { PaletteColor, PaletteOptions } from "@mui/material";
2
- import "@mui/material/styles";
3
- declare module "@mui/material/styles" {
4
- interface Palette {
5
- tertiary: Partial<PaletteColor>;
6
- positive: Partial<PaletteColor>;
7
- negative: Partial<PaletteColor>;
8
- accent: Partial<PaletteColor>;
9
- accent2: Partial<PaletteColor>;
10
- accent3: Partial<PaletteColor>;
11
- }
12
- interface PaletteOptions {
13
- tertiary?: Partial<PaletteColor>;
14
- positive?: Partial<PaletteColor>;
15
- negative?: Partial<PaletteColor>;
16
- accent?: Partial<PaletteColor>;
17
- accent2?: Partial<PaletteColor>;
18
- accent3?: Partial<PaletteColor>;
19
- }
20
- interface TypographyPropsColorOverrides {
21
- tertiary?: Partial<PaletteColor>;
22
- positive?: Partial<PaletteColor>;
23
- negative?: Partial<PaletteColor>;
24
- accent?: Partial<PaletteColor>;
25
- accent2?: Partial<PaletteColor>;
26
- accent3?: Partial<PaletteColor>;
27
- }
28
- }
29
- declare module "@mui/material/Button" {
30
- interface ButtonPropsColorOverrides {
31
- tertiary: true;
32
- positive: true;
33
- negative: true;
34
- accent: true;
35
- accent2: true;
36
- accent3: true;
37
- }
38
- interface ButtonPropsVariantOverrides {
39
- icon: true;
40
- text: true;
41
- outlined: true;
42
- contained: true;
43
- }
44
- }
45
- declare module "@mui/material/Typography" {
46
- interface TypographyPropsColorOverrides {
47
- tertiary: true;
48
- positive: true;
49
- negative: true;
50
- accent: true;
51
- accent2: true;
52
- accent3: true;
53
- }
54
- }
55
- export declare const palette: PaletteOptions;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.palette = void 0;
4
- require("@mui/material/styles");
5
- exports.palette = {
6
- primary: {
7
- main: "#1E4841",
8
- contrastText: "#BBF49C",
9
- },
10
- secondary: {
11
- main: "#BBF49C",
12
- contrastText: "#1E4841",
13
- },
14
- tertiary: {
15
- main: "#ECF4E9",
16
- },
17
- positive: {
18
- main: "#121212",
19
- },
20
- negative: {
21
- main: "#FFFFFF",
22
- contrastText: "#1E4841",
23
- },
24
- accent: {
25
- main: "#A3A3A3",
26
- },
27
- accent2: {
28
- main: "#6B7271",
29
- },
30
- accent3: {
31
- main: "#E5E6E6",
32
- },
33
- error: {
34
- main: "#FF434E",
35
- },
36
- success: {
37
- main: "#1EA031",
38
- },
39
- warning: {
40
- main: "#EEAF00",
41
- },
42
- info: {
43
- main: "#29C8F0",
44
- },
45
- };
@@ -1,2 +0,0 @@
1
- declare const theme: import("@mui/material/styles").Theme;
2
- export default theme;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var styles_1 = require("@mui/material/styles");
4
- var components_1 = require("./components");
5
- var palette_1 = require("./palette");
6
- var typography_1 = require("./typography");
7
- var theme = (0, styles_1.createTheme)({
8
- typography: typography_1.typography,
9
- cssVariables: true,
10
- palette: palette_1.palette,
11
- components: components_1.components,
12
- });
13
- exports.default = theme;