tek-wallet 0.0.822 → 0.0.824
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TekWallet/components/layouts/ChildPageLayout/index.js +3 -1
- package/dist/components/TekWallet/components/layouts/DefaultPageLayout/index.js +3 -1
- package/dist/components/TekWallet/components/ui/AssetViewHeader/index.js +2 -0
- package/dist/components/TekWallet/components/ui/AssetsBoard/index.js +1 -0
- package/dist/components/TekWallet/components/ui/Input/ClearInput.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/{WithdrawFunction/components/tutorial.js → Input/ClearInput.js} +5 -9
- package/dist/components/TekWallet/components/ui/Input/PasteInput.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/{WithdrawFunction/components/transferHistory.js → Input/PasteInput.js} +5 -9
- package/dist/components/TekWallet/components/ui/Input/QrScan.d.ts +5 -0
- package/dist/components/TekWallet/components/ui/Input/QrScan.js +31 -0
- package/dist/components/TekWallet/components/ui/Input/index.d.ts +12 -10
- package/dist/components/TekWallet/components/ui/Input/index.js +120 -19
- package/dist/components/TekWallet/components/ui/Input/index_bk.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/Input/index_bk.js +46 -0
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +12 -5
- package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +54 -77
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +24 -68
- package/dist/components/TekWallet/components/views/SendNftView/components/Form.js +19 -65
- package/dist/components/TekWallet/components/views/SettingView/index.js +2 -2
- package/dist/components/TekWallet/index.d.ts +1 -0
- package/dist/components/TekWallet/index.js +1 -0
- package/dist/components/TekWallet/providers/TanstackReactQuery/index.js +4 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +9 -3
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +2 -2
- package/package.json +1 -1
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.d.ts +0 -13
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.js +0 -48
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.d.ts +0 -29
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.js +0 -235
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.d.ts +0 -7
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.js +0 -45
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.d.ts +0 -7
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.js +0 -45
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.d.ts +0 -14
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +0 -111
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/transferHistory.d.ts +0 -5
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/tutorial.d.ts +0 -5
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.d.ts +0 -38
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +0 -570
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.d.ts +0 -11
- package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.js +0 -382
- package/dist/components/TekWallet/utils/sort.utils.d.ts +0 -3
- package/dist/components/TekWallet/utils/sort.utils.js +0 -24
|
@@ -98,7 +98,6 @@ var lodash_1 = require("lodash");
|
|
|
98
98
|
var Button_1 = __importStar(require("../../../ui/Button"));
|
|
99
99
|
var expose_1 = require("../../../../services/axios/expose");
|
|
100
100
|
var __1 = require("..");
|
|
101
|
-
var QrCodeReader_1 = __importDefault(require("../../../ui/QrCodeReader"));
|
|
102
101
|
var Icon_1 = __importDefault(require("../../../ui/Icon"));
|
|
103
102
|
var get_est_fee_service_1 = __importDefault(require("../../../../services/axios/get-est-fee-service"));
|
|
104
103
|
var type_1 = require("../../../../services/axios/get-activities-service/type");
|
|
@@ -131,7 +130,6 @@ function Form(props) {
|
|
|
131
130
|
var _f = (0, react_1.useState)(undefined), comment = _f[0], setComment = _f[1];
|
|
132
131
|
var _g = (0, react_1.useState)(), memoError = _g[0], setMemoError = _g[1];
|
|
133
132
|
var _h = (0, react_1.useState)(false), isValidatingAddress = _h[0], setIsValidatingAddress = _h[1];
|
|
134
|
-
var scannerAddressQrCodeRef = (0, react_1.useRef)(null);
|
|
135
133
|
var _j = (0, react_1.useState)(false), isEstimatingFee = _j[0], setIsLoadingEstimateFee = _j[1];
|
|
136
134
|
var _k = (0, react_1.useState)(), estimateFee = _k[0], setEstimateFee = _k[1];
|
|
137
135
|
var _l = (0, react_1.useState)(false), isEnoughBalanceToPayFee = _l[0], setIsEnoughBalanceToPayFee = _l[1];
|
|
@@ -273,52 +271,33 @@ function Form(props) {
|
|
|
273
271
|
setSelectedNetwork(undefined);
|
|
274
272
|
setNetworks([]);
|
|
275
273
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
274
|
+
// const handlePaste = async () => {
|
|
275
|
+
// const text = await navigator.clipboard.readText();
|
|
276
|
+
// const address = text.trim();
|
|
277
|
+
// if (!address) {
|
|
278
|
+
// return;
|
|
279
|
+
// }
|
|
280
|
+
// handleChangeRecipientAddress({
|
|
281
|
+
// target: { value: address },
|
|
282
|
+
// } as React.ChangeEvent<HTMLInputElement>);
|
|
283
|
+
// };
|
|
284
|
+
// const handleClearRecipientAddress = () => {
|
|
285
|
+
// handleChangeRecipientAddress({
|
|
286
|
+
// target: { value: "" },
|
|
287
|
+
// } as React.ChangeEvent<HTMLInputElement>);
|
|
288
|
+
// };
|
|
289
|
+
var sanitizeScanText = function (text) {
|
|
290
|
+
var address = "";
|
|
291
|
+
var isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
292
|
+
if (isReceiveInternal) {
|
|
293
|
+
var data = JSON.parse(text);
|
|
294
|
+
address = data === null || data === void 0 ? void 0 : data.address;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
address = text;
|
|
298
|
+
}
|
|
299
|
+
return address;
|
|
298
300
|
};
|
|
299
|
-
var handleScanAddressQrCode = function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
300
|
-
var text, address, isReceiveInternal, data;
|
|
301
|
-
var _a;
|
|
302
|
-
return __generator(this, function (_b) {
|
|
303
|
-
closeScannerAddressQrCode();
|
|
304
|
-
text = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.rawValue;
|
|
305
|
-
address = "";
|
|
306
|
-
isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
307
|
-
if (isReceiveInternal) {
|
|
308
|
-
data = JSON.parse(text);
|
|
309
|
-
address = data === null || data === void 0 ? void 0 : data.address;
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
address = text;
|
|
313
|
-
}
|
|
314
|
-
if (!address)
|
|
315
|
-
return [2 /*return*/];
|
|
316
|
-
handleChangeRecipientAddress({
|
|
317
|
-
target: { value: address },
|
|
318
|
-
});
|
|
319
|
-
return [2 /*return*/];
|
|
320
|
-
});
|
|
321
|
-
}); };
|
|
322
301
|
var handleChangeAmount = function (e) {
|
|
323
302
|
var amount = e.target.value;
|
|
324
303
|
setAmount(amount);
|
|
@@ -363,14 +342,9 @@ function Form(props) {
|
|
|
363
342
|
extraTransactions: null,
|
|
364
343
|
}, estimateFee);
|
|
365
344
|
};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
};
|
|
370
|
-
var closeScannerAddressQrCode = function () {
|
|
371
|
-
var _a;
|
|
372
|
-
(_a = scannerAddressQrCodeRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
373
|
-
};
|
|
345
|
+
// const openScannerAddressQrCode = () => {
|
|
346
|
+
// scannerAddressQrCodeRef.current?.open();
|
|
347
|
+
// };
|
|
374
348
|
var handleKeyboardOpen = function () {
|
|
375
349
|
setIsKeyboardOpen(true);
|
|
376
350
|
};
|
|
@@ -417,28 +391,29 @@ function Form(props) {
|
|
|
417
391
|
fontSize: theme.typography.fontSize14,
|
|
418
392
|
color: theme.palette.text.primary,
|
|
419
393
|
fontWeight: theme.typography.fontWeight700,
|
|
420
|
-
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}, rightPart: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8 }), children: !!recipientAddress ? ((0, jsx_runtime_1.jsx)("label", { htmlFor: "recipient-address-input-id", children: (0, jsx_runtime_1.jsx)(material_1.Box, { onClick: handleClearRecipientAddress, sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8, cursor: "pointer" }), children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 12, height: 12 }, children: SvgPath_1.IC_CLOSE }) }) })) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8, color: "primary.main" }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { onClick: openScannerAddressQrCode, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_SCAN", sx: { width: 20, height: 20 } }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", variant: "fullWidth", flexItem: true }), (0, jsx_runtime_1.jsx)(material_1.Box, { onClick: handlePaste, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_DOCUMENTS", sx: { width: 20, height: 20 } }) })] })) }) }), !!recipientAddressError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationError), children: recipientAddressError }))] }), allowSelectNetwork && ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, transition: { duration: 0.3 }, style: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8, willChange: "height, opacity" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
394
|
+
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { canClear: true, canPaste: true, canScan: true, value: recipientAddress, sanitizeScanText: sanitizeScanText, slotProps: {
|
|
395
|
+
input: {
|
|
396
|
+
placeholder: "Enter recipient address",
|
|
397
|
+
onChange: handleChangeRecipientAddress,
|
|
398
|
+
id: "recipient-address-input-id",
|
|
399
|
+
},
|
|
400
|
+
} }), !!recipientAddressError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationError), children: recipientAddressError }))] }), allowSelectNetwork && ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, transition: { duration: 0.3 }, style: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8, willChange: "height, opacity" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
428
401
|
fontSize: theme.typography.fontSize14,
|
|
429
402
|
color: theme.palette.text.primary,
|
|
430
403
|
fontWeight: theme.typography.fontWeight700,
|
|
431
404
|
}, children: "Network" }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: selectNetworkDrawerRef, trigger: (0, jsx_runtime_1.jsx)(Input_1.default, { sx: {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
405
|
+
width: "100%",
|
|
406
|
+
}, value: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name) || "", slotProps: {
|
|
407
|
+
input: {
|
|
408
|
+
placeholder: "Select a network",
|
|
409
|
+
onChange: handleChangeRecipientAddress,
|
|
410
|
+
inputProps: {
|
|
411
|
+
readOnly: true,
|
|
412
|
+
},
|
|
413
|
+
startAdornment: ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8 }), children: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_NETWORK", src: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.link) || undefined, sx: { width: 24, height: 24, mr: 2 } }) })),
|
|
414
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: "block" }, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 10, height: 18, display: "block" }, children: SvgPath_1.ARROW_DOWN }) })),
|
|
440
415
|
},
|
|
441
|
-
}
|
|
416
|
+
} }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Select network", onClose: closeSelectNetwork, children: (0, jsx_runtime_1.jsx)(SelectNetwork_1.default, { networks: networks, selectedNetwork: selectedNetwork, selectedToken: selectedToken, onChangeNetwork: handleChangeNetwork }) }) })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8, alignItems: "center", justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
442
417
|
fontSize: theme.typography.fontSize14,
|
|
443
418
|
color: theme.palette.text.primary,
|
|
444
419
|
fontWeight: theme.typography.fontWeight700,
|
|
@@ -462,11 +437,13 @@ function Form(props) {
|
|
|
462
437
|
fontSize: theme.typography.fontSize14,
|
|
463
438
|
color: theme.palette.text.primary,
|
|
464
439
|
fontWeight: theme.typography.fontWeight700,
|
|
465
|
-
}, children: "Memo" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Input_1.default, {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
440
|
+
}, children: "Memo" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Input_1.default, { slotProps: {
|
|
441
|
+
input: {
|
|
442
|
+
placeholder: "Enter memo if needed",
|
|
443
|
+
value: comment,
|
|
444
|
+
onChange: handleChangeComment,
|
|
445
|
+
},
|
|
446
|
+
}, canClear: true, canPaste: true }), !!memoError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationError), children: memoError }))] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationDescription), children: "Enter memo if your receiving platform requires one to avoid losing your funds." })] }), (0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: estimateFee, amount: +amount, tokenSlug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "", feesStyle: Fees_1.FeesStyle.WITH_BACKGROUND, setIsEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { loading: isValidatingAddress || isEstimatingFee, onClick: handleContinue, status: !recipientAddress ||
|
|
470
447
|
!selectedNetwork ||
|
|
471
448
|
!amount ||
|
|
472
449
|
!!recipientAddressError ||
|
|
@@ -96,8 +96,6 @@ var lodash_1 = require("lodash");
|
|
|
96
96
|
var Button_1 = __importStar(require("../../../ui/Button"));
|
|
97
97
|
var expose_1 = require("../../../../services/axios/expose");
|
|
98
98
|
var __1 = require("..");
|
|
99
|
-
var QrCodeReader_1 = __importDefault(require("../../../ui/QrCodeReader"));
|
|
100
|
-
var Icon_1 = __importDefault(require("../../../ui/Icon"));
|
|
101
99
|
var get_est_fee_service_1 = __importDefault(require("../../../../services/axios/get-est-fee-service"));
|
|
102
100
|
var type_1 = require("../../../../services/axios/get-activities-service/type");
|
|
103
101
|
var Fees_1 = __importStar(require("../../../ui/Fees"));
|
|
@@ -125,7 +123,6 @@ function Form(props) {
|
|
|
125
123
|
var _e = (0, react_1.useState)(), amountError = _e[0], setAmountError = _e[1];
|
|
126
124
|
var _f = (0, react_1.useState)(undefined), comment = _f[0], setComment = _f[1];
|
|
127
125
|
var _g = (0, react_1.useState)(false), isValidatingAddress = _g[0], setIsValidatingAddress = _g[1];
|
|
128
|
-
var scannerAddressQrCodeRef = (0, react_1.useRef)(null);
|
|
129
126
|
var _h = (0, react_1.useState)(false), isEstimatingFee = _h[0], setIsLoadingEstimateFee = _h[1];
|
|
130
127
|
var _j = (0, react_1.useState)(), estimateFee = _j[0], setEstimateFee = _j[1];
|
|
131
128
|
var _k = (0, react_1.useState)(false), isEnoughBalanceToPayFee = _k[0], setIsEnoughBalanceToPayFee = _k[1];
|
|
@@ -226,29 +223,6 @@ function Form(props) {
|
|
|
226
223
|
setRecipientAddress(address);
|
|
227
224
|
validateAddress(address);
|
|
228
225
|
};
|
|
229
|
-
var handlePaste = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
230
|
-
var text, address;
|
|
231
|
-
return __generator(this, function (_a) {
|
|
232
|
-
switch (_a.label) {
|
|
233
|
-
case 0: return [4 /*yield*/, navigator.clipboard.readText()];
|
|
234
|
-
case 1:
|
|
235
|
-
text = _a.sent();
|
|
236
|
-
address = text.trim();
|
|
237
|
-
if (!address) {
|
|
238
|
-
return [2 /*return*/];
|
|
239
|
-
}
|
|
240
|
-
handleChangeRecipientAddress({
|
|
241
|
-
target: { value: address },
|
|
242
|
-
});
|
|
243
|
-
return [2 /*return*/];
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}); };
|
|
247
|
-
var handleClearRecipientAddress = function () {
|
|
248
|
-
handleChangeRecipientAddress({
|
|
249
|
-
target: { value: "" },
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
226
|
var handleChangeAmount = function (e) {
|
|
253
227
|
var amount = e.target.value;
|
|
254
228
|
setAmount(amount);
|
|
@@ -279,37 +253,18 @@ function Form(props) {
|
|
|
279
253
|
message: comment,
|
|
280
254
|
}, estimateFee);
|
|
281
255
|
};
|
|
282
|
-
var
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
256
|
+
var sanitizeScanText = function (text) {
|
|
257
|
+
var address = "";
|
|
258
|
+
var isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
259
|
+
if (isReceiveInternal) {
|
|
260
|
+
var data = JSON.parse(text);
|
|
261
|
+
address = data === null || data === void 0 ? void 0 : data.address;
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
address = text;
|
|
265
|
+
}
|
|
266
|
+
return address;
|
|
289
267
|
};
|
|
290
|
-
var handleScanAddressQrCode = function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
291
|
-
var text, address, isReceiveInternal, data;
|
|
292
|
-
var _a;
|
|
293
|
-
return __generator(this, function (_b) {
|
|
294
|
-
closeScannerAddressQrCode();
|
|
295
|
-
text = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.rawValue;
|
|
296
|
-
address = "";
|
|
297
|
-
isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
298
|
-
if (isReceiveInternal) {
|
|
299
|
-
data = JSON.parse(text);
|
|
300
|
-
address = data === null || data === void 0 ? void 0 : data.address;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
address = text;
|
|
304
|
-
}
|
|
305
|
-
if (!address)
|
|
306
|
-
return [2 /*return*/];
|
|
307
|
-
handleChangeRecipientAddress({
|
|
308
|
-
target: { value: address },
|
|
309
|
-
});
|
|
310
|
-
return [2 /*return*/];
|
|
311
|
-
});
|
|
312
|
-
}); };
|
|
313
268
|
var keyboardId = (0, useUniqueId_1.useUniqueId)("form-keyboard");
|
|
314
269
|
var handleKeyboardOpen = function () {
|
|
315
270
|
setIsKeyboardOpen(true);
|
|
@@ -337,13 +292,13 @@ function Form(props) {
|
|
|
337
292
|
fontSize: theme.typography.fontSize14,
|
|
338
293
|
color: theme.palette.text.primary,
|
|
339
294
|
fontWeight: theme.typography.fontWeight700,
|
|
340
|
-
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
},
|
|
295
|
+
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { slotProps: {
|
|
296
|
+
input: {
|
|
297
|
+
placeholder: "Enter recipient address",
|
|
298
|
+
value: recipientAddress,
|
|
299
|
+
onChange: handleChangeRecipientAddress,
|
|
300
|
+
},
|
|
301
|
+
}, canClear: true, canPaste: true, canScan: true, sanitizeScanText: sanitizeScanText }), !!recipientAddressError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationError), children: recipientAddressError }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g8, alignItems: "center", justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
347
302
|
fontSize: theme.typography.fontSize14,
|
|
348
303
|
color: theme.palette.text.primary,
|
|
349
304
|
fontWeight: theme.typography.fontWeight700,
|
|
@@ -372,11 +327,12 @@ function Form(props) {
|
|
|
372
327
|
fontSize: theme.typography.fontSize14,
|
|
373
328
|
color: theme.palette.text.primary,
|
|
374
329
|
fontWeight: theme.typography.fontWeight700,
|
|
375
|
-
}, children: "Message" }), (0, jsx_runtime_1.jsx)(Input_1.default, {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
330
|
+
}, children: "Message" }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: comment, slotProps: {
|
|
331
|
+
input: {
|
|
332
|
+
placeholder: "Enter comment if needed",
|
|
333
|
+
onChange: handleChangeComment,
|
|
334
|
+
},
|
|
335
|
+
}, canClear: true, canPaste: true })] }), (0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: estimateFee, amount: +amount, tokenSlug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "", feesStyle: Fees_1.FeesStyle.WITH_BACKGROUND, setIsEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { loading: isValidatingAddress || isEstimatingFee, onClick: handleContinue, status: !recipientAddress ||
|
|
380
336
|
!amount ||
|
|
381
337
|
!!recipientAddressError ||
|
|
382
338
|
!!amountError ||
|
|
@@ -87,7 +87,6 @@ exports.default = Form;
|
|
|
87
87
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
88
88
|
var material_1 = require("@mui/material");
|
|
89
89
|
var Input_1 = __importDefault(require("../../../ui/Input"));
|
|
90
|
-
var SvgPath_1 = require("../../../ui/SvgPath");
|
|
91
90
|
var Text_1 = __importDefault(require("../../../ui/Text"));
|
|
92
91
|
var mui_1 = require("../../../../theme/mui");
|
|
93
92
|
var react_1 = require("react");
|
|
@@ -95,8 +94,6 @@ var validate_wallet_address_service_1 = __importDefault(require("../../../../ser
|
|
|
95
94
|
var lodash_1 = require("lodash");
|
|
96
95
|
var Button_1 = __importStar(require("../../../ui/Button"));
|
|
97
96
|
var expose_1 = require("../../../../services/axios/expose");
|
|
98
|
-
var QrCodeReader_1 = __importDefault(require("../../../ui/QrCodeReader"));
|
|
99
|
-
var Icon_1 = __importDefault(require("../../../ui/Icon"));
|
|
100
97
|
var ChildPageLayout_1 = __importDefault(require("../../../layouts/ChildPageLayout"));
|
|
101
98
|
var navigation_1 = require("next/navigation");
|
|
102
99
|
var react_2 = require("motion/react");
|
|
@@ -115,7 +112,6 @@ function Form(props) {
|
|
|
115
112
|
var _a = (0, react_1.useState)(""), recipientAddress = _a[0], setRecipientAddress = _a[1];
|
|
116
113
|
var _b = (0, react_1.useState)(), recipientAddressError = _b[0], setRecipientAddressError = _b[1];
|
|
117
114
|
var _c = (0, react_1.useState)(false), isValidatingAddress = _c[0], setIsValidatingAddress = _c[1];
|
|
118
|
-
var scannerAddressQrCodeRef = (0, react_1.useRef)(null);
|
|
119
115
|
var selectedNetwork = (0, useNft_1.default)(nftId).network;
|
|
120
116
|
var validateAddress = function (address) {
|
|
121
117
|
if (!address) {
|
|
@@ -171,52 +167,18 @@ function Form(props) {
|
|
|
171
167
|
setRecipientAddress(address);
|
|
172
168
|
validateAddress(address);
|
|
173
169
|
};
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
handleChangeRecipientAddress({
|
|
186
|
-
target: { value: address },
|
|
187
|
-
});
|
|
188
|
-
return [2 /*return*/];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}); };
|
|
192
|
-
var handleClearRecipientAddress = function () {
|
|
193
|
-
handleChangeRecipientAddress({
|
|
194
|
-
target: { value: "" },
|
|
195
|
-
});
|
|
170
|
+
var sanitizeScanText = function (text) {
|
|
171
|
+
var address = "";
|
|
172
|
+
var isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
173
|
+
if (isReceiveInternal) {
|
|
174
|
+
var data = JSON.parse(text);
|
|
175
|
+
address = data === null || data === void 0 ? void 0 : data.address;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
address = text;
|
|
179
|
+
}
|
|
180
|
+
return address;
|
|
196
181
|
};
|
|
197
|
-
var handleScanAddressQrCode = function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
198
|
-
var text, address, isReceiveInternal, data;
|
|
199
|
-
var _a;
|
|
200
|
-
return __generator(this, function (_b) {
|
|
201
|
-
closeScannerAddressQrCode();
|
|
202
|
-
text = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.rawValue;
|
|
203
|
-
address = "";
|
|
204
|
-
isReceiveInternal = text === null || text === void 0 ? void 0 : text.includes("isTekWalletReceiveInternal");
|
|
205
|
-
if (isReceiveInternal) {
|
|
206
|
-
data = JSON.parse(text);
|
|
207
|
-
address = data === null || data === void 0 ? void 0 : data.address;
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
address = text;
|
|
211
|
-
}
|
|
212
|
-
if (!address)
|
|
213
|
-
return [2 /*return*/];
|
|
214
|
-
handleChangeRecipientAddress({
|
|
215
|
-
target: { value: address },
|
|
216
|
-
});
|
|
217
|
-
return [2 /*return*/];
|
|
218
|
-
});
|
|
219
|
-
}); };
|
|
220
182
|
var handleContinue = function () {
|
|
221
183
|
if (!selectedNetwork)
|
|
222
184
|
return;
|
|
@@ -225,14 +187,6 @@ function Form(props) {
|
|
|
225
187
|
network: selectedNetwork,
|
|
226
188
|
});
|
|
227
189
|
};
|
|
228
|
-
var openScannerAddressQrCode = function () {
|
|
229
|
-
var _a;
|
|
230
|
-
(_a = scannerAddressQrCodeRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
231
|
-
};
|
|
232
|
-
var closeScannerAddressQrCode = function () {
|
|
233
|
-
var _a;
|
|
234
|
-
(_a = scannerAddressQrCodeRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
235
|
-
};
|
|
236
190
|
(0, react_1.useEffect)(function () {
|
|
237
191
|
if (address) {
|
|
238
192
|
handleChangeRecipientAddress({
|
|
@@ -251,14 +205,14 @@ function Form(props) {
|
|
|
251
205
|
fontSize: theme.typography.fontSize14,
|
|
252
206
|
color: theme.palette.text.primary,
|
|
253
207
|
fontWeight: theme.typography.fontWeight700,
|
|
254
|
-
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
},
|
|
208
|
+
}, children: "Wallet address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { slotProps: {
|
|
209
|
+
input: {
|
|
210
|
+
placeholder: "Enter recipient address",
|
|
211
|
+
value: recipientAddress,
|
|
212
|
+
onChange: handleChangeRecipientAddress,
|
|
213
|
+
id: "recipient-address-input-id",
|
|
214
|
+
},
|
|
215
|
+
}, canClear: true, canPaste: true, canScan: true, sanitizeScanText: sanitizeScanText }), !!recipientAddressError && !isValidatingAddress && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.validationError), children: recipientAddressError }))] }), (0, jsx_runtime_1.jsx)(ConfirmSendNft_1.default, { payload: payload, sx: { width: "100%", marginTop: "auto" }, childrenRender: function (isSendingNft) { return ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { fullWidth: true, loading: isValidatingAddress || isSendingNft, onClick: handleContinue, status: !recipientAddress ||
|
|
262
216
|
!selectedNetwork ||
|
|
263
217
|
!!recipientAddressError ||
|
|
264
218
|
!nftId ||
|
|
@@ -72,9 +72,9 @@ var SettingView = function (props) {
|
|
|
72
72
|
onLogout === null || onLogout === void 0 ? void 0 : onLogout();
|
|
73
73
|
setButtonStatus(Button_1.BUTTON_STATUS.LOADING);
|
|
74
74
|
};
|
|
75
|
-
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Setting" }), children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(ChangePasscode_1.default, { children: (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { hideTag: true, title: "Change Passcode", description: "Change your passcode", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "2rem", height: "2rem", color: "text.secondary" }, children: SvgPath_1.IC_CHANGE_PASSCODE }) }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Setting" }), children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(ChangePasscode_1.default, { children: (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { hideTag: true, title: "Change Passcode", description: "Change your passcode", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: "2rem", height: "2rem", color: "text.secondary" }, children: SvgPath_1.IC_CHANGE_PASSCODE }) }) }), !!onLogout && ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: {
|
|
76
76
|
marginTop: "auto",
|
|
77
|
-
}, color: "error", onClick: handleLogout, status: buttonStatus, children: "Logout" })] }) }));
|
|
77
|
+
}, color: "error", onClick: handleLogout, status: buttonStatus, children: "Logout" }))] }) }));
|
|
78
78
|
};
|
|
79
79
|
exports.SettingView = SettingView;
|
|
80
80
|
exports.default = exports.SettingView;
|
|
@@ -31,3 +31,4 @@ __exportStar(require("./providers/TekWalletProvider"), exports);
|
|
|
31
31
|
__exportStar(require("./components/ui/UpdateLockToken"), exports);
|
|
32
32
|
__exportStar(require("./theme/mui/palette"), exports);
|
|
33
33
|
__exportStar(require("./theme/mui/utils/deepMergeTheme"), exports);
|
|
34
|
+
__exportStar(require("./handlers"), exports);
|
|
@@ -16,7 +16,10 @@ function TanstackReactQuery(_a) {
|
|
|
16
16
|
if (typeof window === "undefined") {
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
|
-
return (0, query_sync_storage_persister_1.createSyncStoragePersister)({
|
|
19
|
+
return (0, query_sync_storage_persister_1.createSyncStoragePersister)({
|
|
20
|
+
storage: window.localStorage,
|
|
21
|
+
key: "tek-wallet-react-query-cache",
|
|
22
|
+
});
|
|
20
23
|
}, []);
|
|
21
24
|
if (!persister) {
|
|
22
25
|
return (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: query_config_1.queryClient, children: children });
|
|
@@ -16,13 +16,19 @@ export interface Options {
|
|
|
16
16
|
hideBackButtons: Partial<Record<Views, boolean>>;
|
|
17
17
|
disableRefetchOnFocus?: boolean;
|
|
18
18
|
}
|
|
19
|
+
export interface OffsetOptions {
|
|
20
|
+
top?: number;
|
|
21
|
+
bottom?: number;
|
|
22
|
+
left?: number;
|
|
23
|
+
right?: number;
|
|
24
|
+
}
|
|
19
25
|
export interface TekWalletProviderProps {
|
|
20
26
|
children: ReactNode;
|
|
21
27
|
isSSO?: boolean;
|
|
22
28
|
accessToken?: string;
|
|
23
29
|
options?: Options;
|
|
24
30
|
onLogout?: () => void;
|
|
25
|
-
|
|
31
|
+
offset?: OffsetOptions;
|
|
26
32
|
NotFoundPage?: ReactNode;
|
|
27
33
|
overrideQRScanMethod?: () => Promise<string>;
|
|
28
34
|
theme?: Theme;
|
|
@@ -32,7 +38,7 @@ export interface TekWalletContextType {
|
|
|
32
38
|
isSSO: boolean | undefined;
|
|
33
39
|
options?: Options;
|
|
34
40
|
onLogout?: () => void;
|
|
35
|
-
|
|
41
|
+
offset?: OffsetOptions;
|
|
36
42
|
theme?: Theme;
|
|
37
43
|
themeMode?: ThemeModes;
|
|
38
44
|
overrideQRScanMethod?: () => Promise<string>;
|
|
@@ -40,7 +46,7 @@ export interface TekWalletContextType {
|
|
|
40
46
|
accessToken?: string;
|
|
41
47
|
}
|
|
42
48
|
export declare const TekWalletContext: import("react").Context<TekWalletContextType>;
|
|
43
|
-
export declare function TekWalletProvider({ children, isSSO, accessToken, options,
|
|
49
|
+
export declare function TekWalletProvider({ children, isSSO, accessToken, options, offset: offset, onLogout, overrideQRScanMethod, theme, themeMode, NotFoundPage, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
50
|
export default TekWalletProvider;
|
|
45
51
|
export declare const useWalletSetup: () => TekWalletContextType;
|
|
46
52
|
export declare const useKeyboardThemeMode: () => THEME;
|
|
@@ -33,7 +33,7 @@ var initialTekWalletContext = {
|
|
|
33
33
|
};
|
|
34
34
|
exports.TekWalletContext = (0, react_1.createContext)(initialTekWalletContext);
|
|
35
35
|
function TekWalletProvider(_a) {
|
|
36
|
-
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options,
|
|
36
|
+
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, offset = _a.offset, onLogout = _a.onLogout, overrideQRScanMethod = _a.overrideQRScanMethod, theme = _a.theme, themeMode = _a.themeMode, NotFoundPage = _a.NotFoundPage;
|
|
37
37
|
var WalletProvider = isSSO ? WalletDataProviderNoImport_1.default : WalletDataProvider_1.default;
|
|
38
38
|
var _b = (0, react_1.useState)("1"), resetTrigger = _b[0], setResetTrigger = _b[1];
|
|
39
39
|
var onDisconnect = function () {
|
|
@@ -43,7 +43,7 @@ function TekWalletProvider(_a) {
|
|
|
43
43
|
isSSO: isSSO,
|
|
44
44
|
options: options,
|
|
45
45
|
onLogout: onLogout,
|
|
46
|
-
|
|
46
|
+
offset: offset,
|
|
47
47
|
overrideQRScanMethod: overrideQRScanMethod,
|
|
48
48
|
theme: theme,
|
|
49
49
|
themeMode: themeMode,
|
package/package.json
CHANGED
package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SortBalance, SortToken } from "..";
|
|
2
|
-
import { WithdrawCurrency } from "../../../../services/axios/get-withdraw-tokens-list-service/type";
|
|
3
|
-
interface SelectTokenProps {
|
|
4
|
-
sortToken?: SortToken;
|
|
5
|
-
setSortToken?: (sortToken: SortToken) => void;
|
|
6
|
-
sortBalance?: SortBalance;
|
|
7
|
-
setSortBalance?: (sortBalance: SortBalance) => void;
|
|
8
|
-
withdrawToken?: WithdrawCurrency[];
|
|
9
|
-
selectedToken?: WithdrawCurrency;
|
|
10
|
-
handleSelectToken?: (token: WithdrawCurrency) => void;
|
|
11
|
-
}
|
|
12
|
-
export default function SelectToken(props: SelectTokenProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export type { SelectTokenProps };
|