tek-wallet 0.0.395 → 0.0.397

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.
@@ -65,6 +65,7 @@ function Fees(props) {
65
65
  +((_d = token === null || token === void 0 ? void 0 : token.current_value) !== null && _d !== void 0 ? _d : 0) >= totalFeeInCurrency;
66
66
  }
67
67
  });
68
+ console.warn("🚀 ~ consttokensFee:FeeDetailType[]=useMemo ~ result:", result);
68
69
  return result;
69
70
  }, [tokens, feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, amount]);
70
71
  var feeCheckedBalance = (0, react_1.useMemo)(function () {
@@ -340,7 +340,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
340
340
  }, trigger: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
341
341
  fontSize: theme.typography.fontSize12,
342
342
  textTransform: "none",
343
- }, children: [amount ? "Edit" : "+ Set", " amount"] }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { 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.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "+ Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " ", "amount"] }), (0, jsx_runtime_1.jsx)(material_1.Input, { placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value), sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize16 }), value: inputAmount, onChange: handleChangeAmount }), 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
343
+ }, children: [amount ? "Edit" : "+ Set", " amount"] }), children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { 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.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), (0, jsx_runtime_1.jsx)(material_1.Input, { placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value), sx: __assign(__assign({}, theme.mixins.value), { fontSize: theme.typography.fontSize16 }), value: inputAmount, onChange: handleChangeAmount }), 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
344
344
  ? Button_1.BUTTON_STATUS.DISABLED
345
345
  : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: qrCodeValue, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { className: "gap-1.5 flex items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
346
346
  fontSize: theme.typography.fontSize12,
@@ -12,6 +12,7 @@ export interface SwiperControlledRef {
12
12
  slideTo: (index: number) => void;
13
13
  next: () => void;
14
14
  prev: () => void;
15
+ update: () => void;
15
16
  }
16
17
  declare const SwiperControlled: import("react").ForwardRefExoticComponent<SwiperControlledProps & import("react").RefAttributes<SwiperControlledRef>>;
17
18
  export default SwiperControlled;
@@ -40,10 +40,15 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
40
40
  var _a, _b;
41
41
  (_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slidePrev();
42
42
  };
43
+ var update = function () {
44
+ var _a, _b;
45
+ (_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.update();
46
+ };
43
47
  (0, react_2.useImperativeHandle)(ref, function () { return ({
44
48
  slideTo: slideTo,
45
49
  next: next,
46
50
  prev: prev,
51
+ update: update,
47
52
  }); });
48
53
  var handleSlideChange = function (swiper) {
49
54
  setActiveTab(swiper.activeIndex);
@@ -193,9 +193,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
193
193
  return undefined;
194
194
  return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
195
195
  }, [estimateFee, amount]);
196
- var swiperKey = (0, react_1.useMemo)(function () {
196
+ (0, react_1.useEffect)(function () {
197
197
  var _a;
198
- return "".concat((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length, "-").concat(amountError, "-").concat(recipientAddressError);
198
+ (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.update();
199
199
  }, [estimateFee, amountError, recipientAddressError]);
200
200
  var clearValues = function () {
201
201
  setSelectedToken(undefined);
@@ -578,22 +578,22 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
578
578
  : WITHDRAW_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: [(0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
579
579
  autoHeight: true,
580
580
  spaceBetween: 32,
581
- }, disableSwipe: true, initialActiveTab: currentStep, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
581
+ }, disableSwipe: true, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
582
582
  return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () {
583
583
  return handleSelectMethod(item);
584
584
  }, sx: {
585
585
  my: theme.mixins.customMargin.m12,
586
586
  } })] }, item));
587
- }) }) }), (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, height: "fit-content" }), children: withdrawToken === null || withdrawToken === void 0 ? void 0 : withdrawToken.map(function (item) {
587
+ }) }) }, WithdrawStep.SELECT_METHOD), (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, height: "fit-content" }), children: withdrawToken === null || withdrawToken === void 0 ? void 0 : withdrawToken.map(function (item) {
588
588
  var stringifiedTokenData = JSON.stringify(item);
589
589
  if (!item)
590
590
  return null;
591
591
  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 }, item.id));
592
- }) }) }), (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 }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item) {
592
+ }) }) }, WithdrawStep.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 }), children: networks === null || networks === void 0 ? void 0 : networks.map(function (item) {
593
593
  if (!item)
594
594
  return null;
595
595
  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 }, item.id));
596
- }) }) }), (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.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Recipient address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { sx: {
596
+ }) }) }, WithdrawStep.SELECT_NETWORK), (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.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Recipient address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { sx: {
597
597
  paddingRight: theme.mixins.customPadding.p12,
598
598
  }, inputRest: {
599
599
  placeholder: "Enter recipient address",
@@ -621,7 +621,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
621
621
  !selectedToken ||
622
622
  isLoadingEstimateFee
623
623
  ? Button_1.BUTTON_STATUS.DISABLED
624
- : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] }) }, swiperKey)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
624
+ : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] }) }, WithdrawStep.FORM)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
625
625
  textAlign: "center",
626
626
  display: "inline-block",
627
627
  width: "100%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.395",
3
+ "version": "0.0.397",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",