tek-wallet 0.0.737 → 0.0.738

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 (67) hide show
  1. package/dist/components/TekWallet/components/ui/Button/index.js +1 -1
  2. package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +23 -31
  3. package/dist/components/TekWallet/components/ui/EmptyData/index.js +1 -2
  4. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.d.ts +8 -0
  5. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareAction.js +149 -0
  6. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.d.ts +8 -0
  7. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareDrawer.js +21 -0
  8. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.d.ts +9 -0
  9. package/dist/components/TekWallet/components/ui/FiatDeposit/components/shareImage.js +125 -0
  10. package/dist/components/TekWallet/components/ui/FiatDeposit/index.d.ts +5 -0
  11. package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +254 -0
  12. package/dist/components/TekWallet/components/ui/Formatter/index.js +9 -8
  13. package/dist/components/TekWallet/components/ui/HistorySwap/index.js +2 -3
  14. package/dist/components/TekWallet/components/ui/ListItemCustom/index.d.ts +2 -1
  15. package/dist/components/TekWallet/components/ui/ListItemCustom/index.js +9 -2
  16. package/dist/components/TekWallet/components/ui/LoadingLayout/index.d.ts +2 -0
  17. package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +3 -3
  18. package/dist/components/TekWallet/components/ui/OTP/index.d.ts +1 -0
  19. package/dist/components/TekWallet/components/ui/OTP/index.js +3 -1
  20. package/dist/components/TekWallet/components/ui/PageHeader/index.js +1 -1
  21. package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
  22. package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +4 -1
  23. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.d.ts +2 -0
  24. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpButton.js +53 -0
  25. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.d.ts +5 -0
  26. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/HelpView.js +80 -0
  27. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.d.ts +10 -0
  28. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortGroup.js +64 -0
  29. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/SortTool.d.ts +11 -0
  30. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/{sortByBalance.js → SortTool.js} +20 -19
  31. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.d.ts +9 -1
  32. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +198 -86
  33. package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +3 -4
  34. package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +4 -0
  35. package/dist/components/TekWallet/components/ui/SvgPath/index.js +7 -3
  36. package/dist/components/TekWallet/components/ui/TimeText/index.d.ts +5 -0
  37. package/dist/components/TekWallet/components/ui/TimeText/index.js +22 -0
  38. package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +24 -10
  39. package/dist/components/TekWallet/hooks/useConvertTime.d.ts +3 -0
  40. package/dist/components/TekWallet/hooks/useConvertTime.js +25 -0
  41. package/dist/components/TekWallet/hooks/useEventHandler.js +7 -10
  42. package/dist/components/TekWallet/hooks/useFormatter.d.ts +2 -0
  43. package/dist/components/TekWallet/hooks/useFormatter.js +2 -0
  44. package/dist/components/TekWallet/hooks/useWarningWrongPasscode.d.ts +14 -0
  45. package/dist/components/TekWallet/hooks/useWarningWrongPasscode.js +153 -0
  46. package/dist/components/TekWallet/providers/WalletDataProviderNoImport/index.js +5 -2
  47. package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.d.ts +1 -1
  48. package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/index.js +9 -19
  49. package/dist/components/TekWallet/services/axios/authentication-by-passcode-service/type.d.ts +14 -0
  50. package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.d.ts +13 -0
  51. package/dist/components/TekWallet/services/axios/get-deposit-fiat-info-service/getDepositFiatInfoService.js +55 -0
  52. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.d.ts +3 -0
  53. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/components.js +158 -0
  54. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.d.ts +55 -0
  55. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/palette.js +45 -0
  56. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.d.ts +2 -0
  57. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/theme.js +13 -0
  58. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.d.ts +39 -0
  59. package/dist/components/TekWallet/theme/mui/deposit-fiat-theme/typography.js +65 -0
  60. package/dist/components/TekWallet/theme/mui/theme.js +6 -6
  61. package/dist/components/TekWallet/types/expose-type.d.ts +49 -0
  62. package/dist/components/TekWallet/utils/cn.d.ts +2 -0
  63. package/dist/components/TekWallet/utils/cn.js +12 -0
  64. package/dist/components/TekWallet/utils/formatDate.d.ts +9 -6
  65. package/dist/components/TekWallet/utils/formatDate.js +410 -91
  66. package/package.json +5 -2
  67. package/dist/components/TekWallet/components/ui/ReceiveFunction/components/sortByBalance.d.ts +0 -11
@@ -44,6 +44,26 @@ var __importStar = (this && this.__importStar) || (function () {
44
44
  return result;
45
45
  };
46
46
  })();
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
59
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
60
+ if (ar || !(i in from)) {
61
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
62
+ ar[i] = from[i];
63
+ }
64
+ }
65
+ return to.concat(ar || Array.prototype.slice.call(from));
66
+ };
47
67
  var __importDefault = (this && this.__importDefault) || function (mod) {
48
68
  return (mod && mod.__esModule) ? mod : { "default": mod };
49
69
  };
@@ -78,17 +98,20 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
78
98
  var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
79
99
  var LineValue_1 = __importDefault(require("../LineValue"));
80
100
  var SvgPath_1 = require("../SvgPath");
81
- var sortByBalance_1 = __importDefault(require("./components/sortByBalance"));
82
- var ReceiveHistory_1 = __importDefault(require("../ReceiveHistory"));
83
- var sort_utils_1 = require("../../../utils/sort.utils");
84
101
  var PageHeader_1 = __importDefault(require("../PageHeader"));
85
102
  var BottomActionLayout_1 = __importDefault(require("../BottomActionLayout"));
86
103
  var xhub_keyboard_1 = require("xhub-keyboard");
87
104
  var useUniqueId_1 = require("../../../hooks/useUniqueId");
105
+ var FiatDeposit_1 = __importDefault(require("../FiatDeposit"));
106
+ var lodash_1 = require("lodash");
107
+ var HelpButton_1 = __importDefault(require("./components/HelpButton"));
108
+ var SortGroup_1 = __importStar(require("./components/SortGroup"));
109
+ var SortTool_1 = require("./components/SortTool");
88
110
  var ReceiveMethods;
89
111
  (function (ReceiveMethods) {
90
112
  ReceiveMethods["RECEIVE_INTERNAL"] = "Receive internally";
91
113
  ReceiveMethods["RECEIVE_EXTERNAL"] = "Receive externally";
114
+ ReceiveMethods["RECEIVE_FIAT"] = "Receive fiat";
92
115
  })(ReceiveMethods || (exports.ReceiveMethods = ReceiveMethods = {}));
93
116
  var ReceiveStep;
94
117
  (function (ReceiveStep) {
@@ -103,33 +126,46 @@ var RECEIVE_STEP_NAME = (_a = {},
103
126
  _a[ReceiveStep.SELECT_NETWORK] = "Select network",
104
127
  _a[ReceiveStep.SHOW_QR_CODE] = "Scan QR code",
105
128
  _a);
106
- exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
129
+ var searchDebounce = (0, lodash_1.debounce)(function (callback) {
130
+ callback();
131
+ }, 500, { leading: true, trailing: true });
132
+ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
133
+ var _b = _a.functionsList, functionsList = _b === void 0 ? [ReceiveMethods.RECEIVE_EXTERNAL, ReceiveMethods.RECEIVE_INTERNAL] : _b, gotoHistory = _a.gotoHistory, userInfo = _a.userInfo, props = __rest(_a, ["functionsList", "gotoHistory", "userInfo"]);
107
134
  var drawerRef = (0, react_1.useRef)(null);
108
135
  var amountDrawerRef = (0, react_1.useRef)(null);
109
- var _a = (0, react_1.useState)(), selectedMethod = _a[0], setSelectedMethod = _a[1];
136
+ var _c = (0, react_1.useState)(), selectedMethod = _c[0], setSelectedMethod = _c[1];
110
137
  var stepDrawerRef = (0, react_1.useRef)(null);
111
138
  var stepSwiperRef = (0, react_1.useRef)(null);
112
139
  var amountInputRef = (0, react_1.useRef)(null);
113
- var _b = (0, react_1.useState)(false), isSharing = _b[0], setIsSharing = _b[1];
114
- var _c = (0, react_1.useState)(), sortBalance = _c[0], setSortBalance = _c[1];
115
- var historyRef = (0, react_1.useRef)(null);
140
+ var _d = (0, react_1.useState)(false), isSharing = _d[0], setIsSharing = _d[1];
116
141
  var theme = (0, ThemeProvider_1.useTheme)();
117
- var _d = (0, react_1.useState)(ReceiveStep.SELECT_METHOD), currentStep = _d[0], setCurrentStep = _d[1];
118
- var _e = (0, react_1.useState)(), selectedToken = _e[0], setSelectedToken = _e[1];
119
- var _f = (0, react_1.useState)(), selectedNetwork = _f[0], setSelectedNetwork = _f[1];
120
- var _g = (0, useWalletData_1.default)(), isInitPasscode = _g.isInitPasscode, blockchainWallets = _g.blockchainWallets, masterWallet = _g.masterWallet;
121
- var _h = (0, react_1.useState)(""), inputAmount = _h[0], setInputAmount = _h[1];
122
- var _j = (0, react_1.useState)(""), amount = _j[0], setAmount = _j[1];
123
- var _k = (0, react_1.useState)(""), amountError = _k[0], setAmountError = _k[1];
142
+ var _e = (0, react_1.useState)(ReceiveStep.SELECT_METHOD), currentStep = _e[0], setCurrentStep = _e[1];
143
+ var _f = (0, react_1.useState)(), selectedToken = _f[0], setSelectedToken = _f[1];
144
+ var _g = (0, react_1.useState)(), selectedNetwork = _g[0], setSelectedNetwork = _g[1];
145
+ var _h = (0, useWalletData_1.default)(), isInitPasscode = _h.isInitPasscode, blockchainWallets = _h.blockchainWallets, masterWallet = _h.masterWallet;
146
+ var _j = (0, react_1.useState)(""), inputAmount = _j[0], setInputAmount = _j[1];
147
+ var _k = (0, react_1.useState)(""), amount = _k[0], setAmount = _k[1];
148
+ var _l = (0, react_1.useState)(""), amountError = _l[0], setAmountError = _l[1];
124
149
  var keyboardId = (0, useUniqueId_1.useUniqueId)("receive-function-keyboard");
125
- // const [receiveTokens, setReceiveTokens] = useState<ReceiveTokenType[]>([]);
126
- var _l = (0, useReceiveData_1.default)(), receiveExternalTokens = _l.receiveExternalTokens, updateReceiveExternalToken = _l.updateReceiveExternalToken, receiveInternalTokens = _l.receiveInternalTokens, updateReceiveInternalToken = _l.updateReceiveInternalToken;
150
+ var chooseNetworkSupportDrawerRef = (0, react_1.useRef)(null);
151
+ var _m = (0, useReceiveData_1.default)(), receiveExternalTokens = _m.receiveExternalTokens, updateReceiveExternalToken = _m.updateReceiveExternalToken, receiveInternalTokens = _m.receiveInternalTokens, updateReceiveInternalToken = _m.updateReceiveInternalToken;
152
+ var _o = (0, react_1.useState)(), searchedReceiveTokens = _o[0], setSearchedReceiveTokens = _o[1];
153
+ var _p = (0, react_1.useState)(""), searchValue = _p[0], setSearchValue = _p[1];
154
+ var isExternal = (0, react_1.useMemo)(function () {
155
+ return selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL;
156
+ }, [selectedMethod]);
157
+ var isInternal = (0, react_1.useMemo)(function () {
158
+ return selectedMethod === ReceiveMethods.RECEIVE_INTERNAL;
159
+ }, [selectedMethod]);
127
160
  var receiveTokens = (0, react_1.useMemo)(function () {
128
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
129
- return (0, sort_utils_1.sortByBalance)(receiveInternalTokens || [], sortBalance);
161
+ if (isInternal) {
162
+ return receiveInternalTokens;
130
163
  }
131
- return (0, sort_utils_1.sortByBalance)(receiveExternalTokens || [], sortBalance);
132
- }, [receiveExternalTokens, receiveInternalTokens, selectedMethod, sortBalance]);
164
+ return receiveExternalTokens;
165
+ }, [isInternal, receiveExternalTokens, receiveInternalTokens]);
166
+ var handleGotoHistory = (0, react_1.useCallback)(function () {
167
+ gotoHistory === null || gotoHistory === void 0 ? void 0 : gotoHistory(selectedMethod);
168
+ }, [selectedMethod, gotoHistory]);
133
169
  var networks = (0, react_1.useMemo)(function () {
134
170
  if (!selectedToken) {
135
171
  return [];
@@ -146,17 +182,17 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
146
182
  if (!selectedToken) {
147
183
  return undefined;
148
184
  }
149
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
185
+ if (isInternal) {
150
186
  return masterWallet;
151
187
  }
152
188
  return (_a = blockchainWallets === null || blockchainWallets === void 0 ? void 0 : blockchainWallets.find(function (item) { return item.networkSlug === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug); })) === null || _a === void 0 ? void 0 : _a.blockchainAddress;
153
- }, [blockchainWallets, selectedNetwork, selectedMethod, masterWallet, selectedToken]);
189
+ }, [selectedToken, isInternal, blockchainWallets, masterWallet, selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug]);
154
190
  var qrCodeValue = (0, react_1.useMemo)(function () {
155
191
  var _a, _b, _c;
156
192
  if (!receiveAddress || !selectedToken) {
157
193
  return "";
158
194
  }
159
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
195
+ if (isInternal) {
160
196
  var tonTransferParamInternal = {
161
197
  address: receiveAddress,
162
198
  amount: +amount * Math.pow(10, ((_a = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.decimal) !== null && _a !== void 0 ? _a : 0)),
@@ -171,19 +207,23 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
171
207
  }
172
208
  // return `ton://transfer/${receiveAddress}?jetton=${selectedToken?.network_data?.[0]?.address}&text=test-text&amount=${+amount * 10 ** (selectedToken?.decimal ?? 0)}`;
173
209
  return "".concat(receiveAddress);
174
- }, [receiveAddress, selectedToken, amount, selectedMethod]);
210
+ }, [receiveAddress, selectedToken, isInternal, amount]);
175
211
  var warningMessage = (0, react_1.useMemo)(function () {
176
- if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !amount) {
177
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }), " "] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", unless you will lose your assets."] }));
212
+ if (isExternal && !amount) {
213
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please send an amount be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }), " "] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", or you will lose your assets."] }));
178
214
  }
179
- if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !!amount) {
180
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", unless you will lose your assets."] }));
181
- }
182
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && !amount) {
183
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) })] }), ", unless you will lose your assets."] }));
215
+ if (isExternal && !!amount) {
216
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", or you will lose your assets."] }));
184
217
  }
185
218
  return null;
186
- }, [selectedMethod, selectedNetwork, amount, selectedToken]);
219
+ }, [
220
+ isExternal,
221
+ amount,
222
+ theme.palette.primary.main,
223
+ selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.min_value,
224
+ selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.max_value,
225
+ selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name,
226
+ ]);
187
227
  var handleShareProgress = function () {
188
228
  setIsSharing(true);
189
229
  };
@@ -197,6 +237,8 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
197
237
  setSelectedToken(undefined);
198
238
  setSelectedNetwork(undefined);
199
239
  setSelectedMethod(undefined);
240
+ setSearchValue("");
241
+ setSearchedReceiveTokens([]);
200
242
  handleShareFinish();
201
243
  };
202
244
  var open = function () {
@@ -213,16 +255,15 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
213
255
  close: close,
214
256
  }); });
215
257
  var handleBack = function () {
216
- if (currentStep === ReceiveStep.SHOW_QR_CODE &&
217
- selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
258
+ if (currentStep === ReceiveStep.SHOW_QR_CODE && isInternal) {
218
259
  gotoStep(ReceiveStep.SELECT_TOKEN);
219
260
  return;
220
261
  }
221
262
  gotoStep(currentStep - 1);
222
263
  };
223
- var closeHistory = function () {
264
+ var closeChooseNetworkSupport = function () {
224
265
  var _a;
225
- (_a = historyRef.current) === null || _a === void 0 ? void 0 : _a.close();
266
+ (_a = chooseNetworkSupportDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
226
267
  };
227
268
  var handleSelectMethod = function (method) {
228
269
  setSelectedMethod(method);
@@ -247,7 +288,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
247
288
  var handleSelectToken = function (token) {
248
289
  setSelectedToken(token);
249
290
  if (!!token) {
250
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
291
+ if (isInternal) {
251
292
  gotoStep(ReceiveStep.SHOW_QR_CODE);
252
293
  }
253
294
  else {
@@ -318,63 +359,124 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
318
359
  }, [isInitPasscode, receiveExternalTokens, receiveInternalTokens]);
319
360
  var sharedImageName = (0, react_1.useMemo)(function () {
320
361
  var _a;
321
- if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
362
+ if (isInternal) {
322
363
  return masterWallet;
323
364
  }
324
365
  var blockchainAddress = (_a = blockchainWallets === null || blockchainWallets === void 0 ? void 0 : blockchainWallets.find(function (item) { return item.networkSlug === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug); })) === null || _a === void 0 ? void 0 : _a.blockchainAddress;
325
366
  return blockchainAddress;
326
- }, [blockchainWallets, masterWallet, selectedMethod, selectedNetwork]);
367
+ }, [blockchainWallets, isInternal, masterWallet, selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug]);
368
+ var handleSearch = function (e) {
369
+ var searchValue = e.target.value;
370
+ setSearchValue(searchValue);
371
+ searchDebounce(function () {
372
+ if (searchValue.length > 0) {
373
+ var filteredTokens = receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.filter(function (item) {
374
+ return item.name.toLowerCase().includes(searchValue.toLowerCase());
375
+ });
376
+ setSearchedReceiveTokens(filteredTokens || []);
377
+ }
378
+ else {
379
+ setSearchedReceiveTokens(receiveTokens);
380
+ }
381
+ });
382
+ };
383
+ var isSearching = (0, react_1.useMemo)(function () {
384
+ return searchValue.length > 0;
385
+ }, [searchValue]);
386
+ var isLoadingDepositTokens = (0, react_1.useMemo)(function () {
387
+ return !receiveTokens;
388
+ }, [receiveTokens]);
389
+ var isEmptyDepositTokens = (0, react_1.useMemo)(function () {
390
+ return !isLoadingDepositTokens && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0;
391
+ }, [isLoadingDepositTokens, receiveTokens]);
392
+ var isEmptySearch = (0, react_1.useMemo)(function () {
393
+ return isSearching && (searchedReceiveTokens === null || searchedReceiveTokens === void 0 ? void 0 : searchedReceiveTokens.length) === 0;
394
+ }, [isSearching, searchedReceiveTokens]);
395
+ var _q = (0, react_1.useState)([]), tokenRender = _q[0], setTokenRender = _q[1];
396
+ (0, react_1.useEffect)(function () {
397
+ if (isSearching) {
398
+ setTokenRender(searchedReceiveTokens || []);
399
+ }
400
+ else {
401
+ setTokenRender(receiveTokens || []);
402
+ }
403
+ }, [isSearching, searchedReceiveTokens, receiveTokens]);
404
+ var handleSort = function (sortBy, sortOrder) {
405
+ var sortedTokens = __spreadArray([], tokenRender, true);
406
+ sortedTokens.sort(function (a, b) {
407
+ var _a, _b;
408
+ if (sortBy === SortGroup_1.SortByType.Name) {
409
+ return sortOrder === SortTool_1.SortOrder.ASC
410
+ ? ((_a = a === null || a === void 0 ? void 0 : a.name) === null || _a === void 0 ? void 0 : _a.localeCompare((b === null || b === void 0 ? void 0 : b.name) || "")) || 0
411
+ : ((_b = b === null || b === void 0 ? void 0 : b.name) === null || _b === void 0 ? void 0 : _b.localeCompare((a === null || a === void 0 ? void 0 : a.name) || "")) || 0;
412
+ }
413
+ return sortOrder === SortTool_1.SortOrder.ASC
414
+ ? +((a === null || a === void 0 ? void 0 : a.balance) || 0) - +((b === null || b === void 0 ? void 0 : b.balance) || 0)
415
+ : +((b === null || b === void 0 ? void 0 : b.balance) || 0) - +((a === null || a === void 0 ? void 0 : a.balance) || 0);
416
+ });
417
+ setTokenRender(sortedTokens);
418
+ };
419
+ var handleClearSearch = function () {
420
+ setSearchValue("");
421
+ };
327
422
  return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { sx: props.sx, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
328
423
  width: "100%",
329
- }, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); } }), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); } })] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
424
+ }, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [functionsList.includes(ReceiveMethods.RECEIVE_INTERNAL) && ((0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); }, recommended: true })), functionsList.includes(ReceiveMethods.RECEIVE_EXTERNAL) && ((0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); }, recommended: true })), functionsList.includes(ReceiveMethods.RECEIVE_FIAT) && ((0, jsx_runtime_1.jsx)(FiatDeposit_1.default, { children: (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Fiat-Gateway", description: "Experimental deposit via bank transfer", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), recommended: false }) }))] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
330
425
  position: "relative",
331
426
  sx: "100dvh",
332
- }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, marginLeft: "auto" }), 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, { orientation: "vertical", sx: {
333
- height: "1rem",
334
- width: "1px",
335
- backgroundColor: theme.palette.border.accent3,
336
- } }), (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: closeHistory }) })] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
427
+ }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: RECEIVE_STEP_NAME[Math.max(currentStep, ReceiveStep.SELECT_TOKEN)], overrideBack: handleBack, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, marginLeft: "auto" }), children: [(0, jsx_runtime_1.jsx)(HelpButton_1.default, {}), false && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", sx: {
428
+ height: "1rem",
429
+ width: "1px",
430
+ backgroundColor: theme.palette.border.accent3,
431
+ } }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20, display: "block" }, onClick: handleGotoHistory, children: SvgPath_1.IC_HISTORY })] }))] }) }), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
337
432
  maxHeight: currentStep === ReceiveStep.SHOW_QR_CODE ? "120px" : 0,
338
433
  overflow: "hidden",
339
434
  transition: currentStep === ReceiveStep.SHOW_QR_CODE
340
435
  ? "max-height 0.3s linear 0.3s"
341
436
  : "max-height 0s linear",
342
437
  }, children: (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", onProgress: handleShareProgress, onFinish: handleShareFinish, imageName: sharedImageName, children: (0, jsx_runtime_1.jsx)(BottomActionLayout_1.default, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { fullWidth: true, status: isSharing ? Button_1.BUTTON_STATUS.LOADING : undefined, children: "Share" }) }) }) }), children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { padding: theme.mixins.pagePadding }, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
343
- // autoHeight: true,
344
438
  spaceBetween: 32,
345
- }, disableSwipe: true,
346
- // key={`step_${currentStep}`}
347
- initialActiveTab: currentStep - 1, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: [!receiveTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0 && (0, jsx_runtime_1.jsx)(EmptyData_1.default, {}), receiveTokens && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputBase, { startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_SEARCH }) }), placeholder: "Search", sx: {
348
- borderRadius: theme.mixins.customRadius.r12,
349
- border: "1px solid",
350
- borderColor: theme.palette.border.accent3,
351
- background: theme.palette.background.white,
352
- color: theme.palette.text.black,
353
- py: theme.mixins.customPadding.p6,
354
- px: theme.mixins.customPadding.p12,
355
- fontSize: theme.typography.fontSize16,
356
- "input::placeholder": {
357
- fontSize: theme.typography.fontSize12,
358
- pl: theme.mixins.customPadding.p4,
359
- fontWeight: theme.typography.fontWeight500,
360
- color: theme.palette.text.black,
361
- },
362
- } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
363
- display: theme.mixins.row,
364
- justifyContent: "space-between",
365
- mt: theme.mixins.customMargin.m16,
366
- }, children: [(0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Token" }), (0, jsx_runtime_1.jsx)(sortByBalance_1.default, { name: "Balance",
367
- // sortBalance={sortBalance}
368
- setSortBalance: setSortBalance })] })] })), receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.map(function (item, index) {
439
+ }, disableSwipe: true, initialActiveTab: currentStep - 1, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: [!isEmptyDepositTokens && ((0, jsx_runtime_1.jsx)(material_1.InputBase, { onChange: handleSearch, startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_SEARCH }) }), value: searchValue, placeholder: "Search", sx: {
440
+ borderRadius: theme.mixins.customRadius.r12,
441
+ border: "1px solid",
442
+ borderColor: theme.palette.border.accent3,
443
+ background: theme.palette.background.white,
444
+ color: theme.palette.text.black,
445
+ py: theme.mixins.customPadding.p6,
446
+ px: theme.mixins.customPadding.p12,
447
+ fontSize: theme.typography.fontSize16,
448
+ lineHeight: "100%",
449
+ "input::placeholder": {
450
+ fontSize: theme.typography.fontSize12,
451
+ pl: theme.mixins.customPadding.p4,
452
+ fontWeight: theme.typography.fontWeight500,
453
+ color: theme.palette.text.black,
454
+ lineHeight: "100%",
455
+ },
456
+ }, endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", sx: {
457
+ visibility: isSearching ? "visible" : "hidden",
458
+ }, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
459
+ width: 20,
460
+ height: 20,
461
+ p: theme.mixins.customPadding.p4,
462
+ cursor: "pointer",
463
+ }, onClick: handleClearSearch, children: SvgPath_1.IC_CLOSE }) }) })), (tokenRender === null || tokenRender === void 0 ? void 0 : tokenRender.length) > 0 && (0, jsx_runtime_1.jsx)(SortGroup_1.default, { onChange: handleSort }), isLoadingDepositTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), isEmptyDepositTokens && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { py: "4rem" }, title: "No deposit tokens", description: "No deposit tokens" })), isSearching && isEmptySearch && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { py: "4rem" }, title: "No search results", description: "Let's try again with a different search" })), tokenRender === null || tokenRender === void 0 ? void 0 : tokenRender.map(function (item, index) {
369
464
  var stringifiedTokenData = JSON.stringify(item);
370
465
  if (!item)
371
466
  return null;
372
467
  return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) === item.id }, "token_".concat(item.id, "_").concat(index)));
373
- })] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, display: selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL ? "flex" : "none" }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
374
- if (!item)
375
- return null;
376
- return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id, token: selectedToken }, "network_".concat(item.id, "_").concat(index)));
377
- }) }) }, "slide_step_".concat(ReceiveStep.SELECT_NETWORK)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
468
+ })] }) }, "slide_step_".concat(ReceiveStep.SELECT_TOKEN)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, display: isExternal ? "flex" : "none" }), children: [(networks === null || networks === void 0 ? void 0 : networks.length) > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { borderRadius: theme.mixins.customRadius.r16, background: theme.palette.background.accent3, gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.fieldTitle), { fontWeight: theme.typography.fontWeight700, color: theme.palette.text.darkContrast }), children: "Choosing a network? Let us help!" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityDescription), { color: theme.palette.text.accent, fontWeight: theme.typography.fontWeight500 }), children: "Select the network used by your sending platform." }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: 0.125, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: chooseNetworkSupportDrawerRef, sx: {
469
+ mt: 0.25,
470
+ }, trigger: (0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: {
471
+ color: theme.palette.primary.main,
472
+ fontWeight: theme.typography.fontWeight600,
473
+ fontSize: theme.typography.fontSize10,
474
+ lineHeight: "100%",
475
+ }, children: "Learn more" }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "How to choose my top up network", onClose: closeChooseNetworkSupport, 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.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "Lorem ipsum dolor sit amet consectetur. Vitae faucibus ornare lectus arcu sit sed et. Eu integer pharetra posuere lobortis varius dapibus risus. Pellentesque quis id diam ante lectus ornare tristique." }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "Eget viverra quis facilisis velit mattis. Risus sed egestas vitae ridiculus odio sit eu adipiscing. Scelerisque nunc nec nisl mauris venenatis viverra est dictumst adipiscing." }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "div", sx: __assign(__assign({}, theme.mixins.listDescription), { color: theme.palette.text.blackContrast }), children: "Id pulvinar aliquam quam ut sed ut pharetra turpis ipsum. Condimentum eget a interdum neque sagittis lobortis proin nisi. Magna id massa risus elit at." })] }) }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 6, height: 6, mt: "4px" }, children: (0, jsx_runtime_1.jsx)("svg", { width: "4", height: "6", viewBox: "0 0 4 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M3.7 3L0.7 6L0 5.3L2.3 3L0 0.7L0.7 0L3.7 3Z", fill: "#1C461D" }) }) })] })] })), networks === null || networks === void 0 ? void 0 : networks.map(function (item, index) {
476
+ if (!item)
477
+ return null;
478
+ return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id, token: selectedToken }, "network_".concat(item.id, "_").concat(index)));
479
+ })] }) }, "slide_step_".concat(ReceiveStep.SELECT_NETWORK)), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
378
480
  display: "flex",
379
481
  flexDirection: "column",
380
482
  gap: theme.mixins.gaps.g16,
@@ -383,20 +485,27 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
383
485
  width: "100%",
384
486
  } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: [(0, jsx_runtime_1.jsx)(QRCode_1.default, { value: qrCodeValue, logo: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.link, bgColor: "transparent", size: 150 }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { padding: theme.mixins.customPadding.p4, borderRadius: 9999, backgroundColor: theme.palette.background.white }), children: (0, jsx_runtime_1.jsx)(Icon_1.default, { crossOrigin: "anonymous", width: 24, height: 24, src: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.link, sx: {
385
487
  borderRadius: 9999,
386
- } }) })] }), selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), onClick: handleBack, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
488
+ } }) })] }), isExternal && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), onClick: handleBack, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
387
489
  transform: "translateX(0.5rem)",
388
490
  } }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 24, height: 24, sx: {
389
491
  borderRadius: "9999px",
390
- }, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 12, height: 12, ml: "auto" }, children: SvgPath_1.IC_CHEVRON_RIGHT })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: selectedMethod === ReceiveMethods.RECEIVE_INTERNAL
391
- ? "Internal address"
392
- : "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16, mb: "3px" }, children: SvgPath_1.IC_TOOLTIP }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_COPY })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
393
- color: theme.palette.border.accent,
394
- width: "100%",
395
- } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: [amount, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 20 Minutes" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
492
+ }, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
493
+ width: 12,
494
+ height: 12,
495
+ ml: "auto",
496
+ transform: "rotate(90deg)",
497
+ }, children: SvgPath_1.IC_CHEVRON_RIGHT })] })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: isInternal ? "Internal address" : "Address" }), isInternal && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16, mb: "3px" }, children: SvgPath_1.IC_TOOLTIP }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_COPY })] })] }), (!!userInfo || !!amount || isExternal || !!warningMessage) && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
396
498
  color: theme.palette.border.accent,
397
499
  width: "100%",
398
- mt: theme.mixins.customMargin.m12,
399
- } }), !!warningMessage && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage }) }))] }) }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
500
+ } })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!userInfo && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { sx: {
501
+ alignItems: "start",
502
+ }, field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Received user" }), value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 16, height: 16, src: userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar, sx: {
503
+ borderRadius: "9999px",
504
+ } }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2 }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { children: [userInfo === null || userInfo === void 0 ? void 0 : userInfo.nickname, " "] }) })] }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { children: userInfo === null || userInfo === void 0 ? void 0 : userInfo.username }) })), !!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize13 }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }) }) })), isExternal && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize13 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize13 }), children: "~ 20 Minutes" }) })] }))] }), !!warningMessage && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
505
+ color: theme.palette.border.accent,
506
+ width: "100%",
507
+ mt: theme.mixins.customMargin.m12,
508
+ } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: warningMessage })] }))] }) }), isInternal && ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: amountDrawerRef, sx: {
400
509
  width: "100%",
401
510
  display: "flex",
402
511
  justifyContent: "center",
@@ -404,7 +513,10 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
404
513
  fontSize: theme.typography.fontSize14,
405
514
  textTransform: "none",
406
515
  fontWeight: theme.typography.fontWeight500,
407
- }, children: [amount ? "Edit" : "+ Set", " amount"] }) }), children: (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", children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: function () { var _a; return (_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, title: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), 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.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, rightElement: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), amountError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError
516
+ display: "flex",
517
+ alignItems: "center",
518
+ gap: theme.mixins.gaps.g4,
519
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: amount ? SvgPath_1.IC_EDIT : SvgPath_1.IC_SET }), amount ? "Edit" : "Set", " amount"] }) }), children: (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", children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: function () { var _a; return (_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, title: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), 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.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, rightElement: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), amountError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError
408
520
  ? Button_1.BUTTON_STATUS.DISABLED
409
521
  : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }) }))] }) }, "slide_step_".concat(ReceiveStep.SHOW_QR_CODE))] }) }) }) }) }) }) }));
410
522
  });
@@ -201,7 +201,6 @@ var ReceiveHistory = function (props) {
201
201
  return [3 /*break*/, 5];
202
202
  case 4:
203
203
  setLoading(false);
204
- console.error("Error fetching swap history.");
205
204
  return [7 /*endfinally*/];
206
205
  case 5: return [2 /*return*/];
207
206
  }
@@ -366,7 +365,7 @@ var ReceiveHistory = function (props) {
366
365
  }, [currentId, hasOpenedDetail, selectedItem, transactionDetail, drawerRefs.current.detail]);
367
366
  return ((0, jsx_runtime_1.jsxs)(ChildPageLayout_1.default, { sx: {
368
367
  width: "100dvw",
369
- }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Top up history", overrideBack: props.onClose }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { px: theme.mixins.customPadding.p16,
368
+ }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Top Up History", overrideBack: props.onClose }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { px: theme.mixins.customPadding.p16,
370
369
  // pt: theme.mixins.customPadding.p16,
371
370
  gap: theme.mixins.gaps.g8, ml: theme.mixins.customMargin.m4 }), children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 4, children: [(0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: function (ref) {
372
371
  drawerRefs.current.status = ref !== null && ref !== void 0 ? ref : undefined;
@@ -421,7 +420,7 @@ var ReceiveHistory = function (props) {
421
420
  timestamp: selectedItem.date_created,
422
421
  success: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.transaction_status,
423
422
  message: "",
424
- } }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item) { return ((0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: function () {
423
+ } }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item, i) { return ((0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: function () {
425
424
  // handleTransactionClick(item.id);
426
425
  }, sx: {
427
426
  px: theme.mixins.customPadding.p16,
@@ -430,7 +429,7 @@ var ReceiveHistory = function (props) {
430
429
  opacity: 0.6,
431
430
  backgroundColor: theme.palette.border.accent3,
432
431
  my: theme.mixins.customMargin.m16,
433
- } })] }, item.id)); })] })) : (resultData.length == 0 &&
432
+ } })] }, i)); })] })) : (resultData.length == 0 &&
434
433
  !isLoading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign(__assign({}, theme.mixins.center), { padding: theme.mixins.customPadding.p24 }), theme.mixins.column), { gap: theme.mixins.gaps.g4, textAlign: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("result"), width: 62, height: 62, sx: {
435
434
  mx: "auto",
436
435
  mb: theme.mixins.customMargin.m12,
@@ -26,6 +26,10 @@ export declare const IC_CHECK: import("react/jsx-runtime").JSX.Element;
26
26
  export declare const IC_UNCHECK: import("react/jsx-runtime").JSX.Element;
27
27
  export declare const IC_BACK: import("react/jsx-runtime").JSX.Element;
28
28
  export declare const IC_TOOLTIP: import("react/jsx-runtime").JSX.Element;
29
+ export declare const IC_RECEIVE_TAG: import("react/jsx-runtime").JSX.Element;
30
+ export declare const IC_RECEIVE_TAG_RECOMMENDED: import("react/jsx-runtime").JSX.Element;
31
+ export declare const IC_EDIT: import("react/jsx-runtime").JSX.Element;
32
+ export declare const IC_SET: import("react/jsx-runtime").JSX.Element;
29
33
  export declare const IC_NO_SEE: import("react/jsx-runtime").JSX.Element;
30
34
  export declare const IC_EXPANDER_ARROW: import("react/jsx-runtime").JSX.Element;
31
35
  export declare const IC_INFORMATION: import("react/jsx-runtime").JSX.Element;