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, response;
358
+ var isValidateAmount;
359
359
  return __generator(this, function (_a) {
360
- switch (_a.label) {
361
- case 0:
362
- if (!selectedToken)
363
- return [2 /*return*/];
364
- isValidateAmount = validateAmount();
365
- console.warn("🚀 ~ getEstimateFee ~ isValidateAmount:", isValidateAmount);
366
- if (!isValidateAmount)
367
- return [2 /*return*/];
368
- setIsLoadingEstimateFee(true);
369
- return [4 /*yield*/, (0, get_est_fee_service_1.default)({
370
- amount: "".concat(amount),
371
- transaction_type: selectedMethod === SendMethods.TRANSFER_EXTERNAL ? type_1.TransactionSlug.Withdrawn : type_1.TransactionSlug.TransferInternal,
372
- currency: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "",
373
- })];
374
- case 1:
375
- response = _a.sent();
376
- setIsLoadingEstimateFee(false);
377
- setEstimateFee(response === null || response === void 0 ? void 0 : response.data);
378
- return [2 /*return*/];
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
- getEstimateFeeDebounce(getEstimateFee);
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%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.510",
3
+ "version": "0.0.512",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",