tek-wallet 0.0.510 → 0.0.512
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.
|
@@ -64,6 +64,8 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
64
64
|
update: update,
|
|
65
65
|
}); });
|
|
66
66
|
var rememberTab = function (index) {
|
|
67
|
+
if (!tabParamName)
|
|
68
|
+
return;
|
|
67
69
|
var params = new URLSearchParams(window.location.search);
|
|
68
70
|
params.set(tabParamName, index.toString());
|
|
69
71
|
router.replace("".concat(pathname, "?").concat(params.toString()));
|
|
@@ -355,28 +355,36 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
357
|
var getEstimateFee = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
358
|
-
var isValidateAmount
|
|
358
|
+
var isValidateAmount;
|
|
359
359
|
return __generator(this, function (_a) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
360
|
+
if (!selectedToken)
|
|
361
|
+
return [2 /*return*/];
|
|
362
|
+
isValidateAmount = validateAmount();
|
|
363
|
+
console.warn("🚀 ~ getEstimateFee ~ isValidateAmount:", isValidateAmount);
|
|
364
|
+
if (!isValidateAmount)
|
|
365
|
+
return [2 /*return*/];
|
|
366
|
+
console.warn("🚀 ~ getEstimateFee ~ isValidateAmount 2:", !isValidateAmount);
|
|
367
|
+
setIsLoadingEstimateFee(true);
|
|
368
|
+
getEstimateFeeDebounce(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
369
|
+
var response;
|
|
370
|
+
return __generator(this, function (_a) {
|
|
371
|
+
switch (_a.label) {
|
|
372
|
+
case 0: return [4 /*yield*/, (0, get_est_fee_service_1.default)({
|
|
373
|
+
amount: "".concat(amount),
|
|
374
|
+
transaction_type: selectedMethod === SendMethods.TRANSFER_EXTERNAL
|
|
375
|
+
? type_1.TransactionSlug.Withdrawn
|
|
376
|
+
: type_1.TransactionSlug.TransferInternal,
|
|
377
|
+
currency: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "",
|
|
378
|
+
})];
|
|
379
|
+
case 1:
|
|
380
|
+
response = _a.sent();
|
|
381
|
+
setIsLoadingEstimateFee(false);
|
|
382
|
+
setEstimateFee(response === null || response === void 0 ? void 0 : response.data);
|
|
383
|
+
return [2 /*return*/];
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}); });
|
|
387
|
+
return [2 /*return*/];
|
|
380
388
|
});
|
|
381
389
|
}); }, [selectedToken, validateAmount, amount, selectedMethod]);
|
|
382
390
|
var openScannerAddressQrCode = function () {
|
|
@@ -527,7 +535,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
527
535
|
}
|
|
528
536
|
}, [isAuthenticated, withdrawTokens, sendInternalTokens]);
|
|
529
537
|
(0, react_1.useEffect)(function () {
|
|
530
|
-
|
|
538
|
+
getEstimateFee();
|
|
531
539
|
}, [getEstimateFee]);
|
|
532
540
|
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, children: (0, jsx_runtime_1.jsxs)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
|
|
533
541
|
width: "100%",
|