tek-wallet 0.0.521 → 0.0.523

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.
@@ -2,8 +2,10 @@ import { AccordionProps } from "@mui/material";
2
2
  export interface FeesProps extends Omit<AccordionProps, "children"> {
3
3
  feesData: string;
4
4
  amount: number;
5
+ isFeePaidByAmount?: boolean;
5
6
  onEnoughBalanceToPayFee?: () => void;
6
7
  onNotEnoughBalanceToPayFee?: () => void;
8
+ tokenSlug: string;
7
9
  }
8
10
  declare function Fees(props: FeesProps): import("react/jsx-runtime").JSX.Element;
9
11
  export default Fees;
@@ -37,47 +37,51 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
37
37
  var react_1 = require("react");
38
38
  var ReceiveFunction_1 = __importDefault(require("../ReceiveFunction"));
39
39
  function Fees(props) {
40
- var sx = props.sx, amount = props.amount, feesDataString = props.feesData, rest = __rest(props, ["sx", "amount", "feesData"]);
40
+ var sx = props.sx, amount = props.amount, feesDataString = props.feesData, isFeePaidByAmount = props.isFeePaidByAmount, tokenSlug = props.tokenSlug, rest = __rest(props, ["sx", "amount", "feesData", "isFeePaidByAmount", "tokenSlug"]);
41
41
  var theme = (0, material_1.useTheme)();
42
42
  var feesData = (0, parsePropsData_1.default)(feesDataString);
43
43
  var tokens = (0, useWalletData_1.default)().tokens;
44
- var tokensFee = (0, react_1.useMemo)(function () {
44
+ var getBalanceUseToPaidFee = (0, react_1.useCallback)(function (tokenSlugMustBePaidFee) {
45
+ if (isFeePaidByAmount && tokenSlugMustBePaidFee === tokenSlug) {
46
+ return amount;
47
+ }
48
+ var tokenMustBePaidFee = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (token) { return token.currency_slug === tokenSlugMustBePaidFee; });
49
+ return tokenMustBePaidFee === null || tokenMustBePaidFee === void 0 ? void 0 : tokenMustBePaidFee.current_value;
50
+ }, [isFeePaidByAmount, amount, tokenSlug, tokens]);
51
+ var tokensFeeGroupBySlug = (0, react_1.useMemo)(function () {
45
52
  var _a;
46
53
  var result = [];
47
54
  (_a = feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail) === null || _a === void 0 ? void 0 : _a.forEach(function (fee) {
48
- var _a, _b, _c, _d, _e;
55
+ var _a, _b, _c;
49
56
  var index = result === null || result === void 0 ? void 0 : result.findIndex(function (feeDetail) { var _a, _b; return ((_a = feeDetail.currency) === null || _a === void 0 ? void 0 : _a.slug) === ((_b = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _b === void 0 ? void 0 : _b.slug); });
50
57
  if (index === -1) {
51
58
  result.push(fee);
52
59
  }
53
60
  else {
54
- var rate = fee.feeInUSD / fee.feeInCurrency;
55
61
  result[index].feeFixed += fee.feeFixed;
56
62
  result[index].feeInCurrency += fee.feeInCurrency;
57
63
  result[index].feeInUSD += fee.feeInUSD;
58
64
  result[index].feePercent += fee.feePercent;
59
- result[index].feePercentInCurrency = ((_a = result[index].feeInCurrency) !== null && _a !== void 0 ? _a : 0) + amount * (fee.feePercent / 100);
60
- result[index].feePercentInUSD = ((_b = result[index].feeInUSD) !== null && _b !== void 0 ? _b : 0) + amount * (fee.feePercent / 100) * rate;
61
- var totalFeeInCurrency = ((_c = result[index].feeInCurrency) !== null && _c !== void 0 ? _c : 0) + ((_d = result[index].feePercentInCurrency) !== null && _d !== void 0 ? _d : 0);
62
- var token = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (token) { var _a; return token.currency_slug === ((_a = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _a === void 0 ? void 0 : _a.slug); });
63
- result[index].isEnoughBalanceToPay = +((_e = token === null || token === void 0 ? void 0 : token.current_value) !== null && _e !== void 0 ? _e : 0) >= totalFeeInCurrency;
65
+ var totalFeeInCurrency = (_a = result[index].feeInCurrency) !== null && _a !== void 0 ? _a : 0;
66
+ var balanceUseToPaidFee = getBalanceUseToPaidFee((_c = (_b = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _b === void 0 ? void 0 : _b.slug) !== null && _c !== void 0 ? _c : "");
67
+ result[index].isEnoughBalanceToPay = +(balanceUseToPaidFee !== null && balanceUseToPaidFee !== void 0 ? balanceUseToPaidFee : 0) >= totalFeeInCurrency;
64
68
  }
65
69
  });
66
70
  return result;
67
- }, [tokens, feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, amount]);
71
+ }, [feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, getBalanceUseToPaidFee]);
68
72
  var feeCheckedBalance = (0, react_1.useMemo)(function () {
69
73
  var _a, _b;
70
74
  return ((_b = (_a = feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail) === null || _a === void 0 ? void 0 : _a.map(function (fee) {
71
- var theFee = tokensFee === null || tokensFee === void 0 ? void 0 : tokensFee.find(function (feeDetail) { var _a, _b; return ((_a = feeDetail.currency) === null || _a === void 0 ? void 0 : _a.slug) === ((_b = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _b === void 0 ? void 0 : _b.slug); });
75
+ var theFee = tokensFeeGroupBySlug === null || tokensFeeGroupBySlug === void 0 ? void 0 : tokensFeeGroupBySlug.find(function (feeDetail) { var _a, _b; return ((_a = feeDetail.currency) === null || _a === void 0 ? void 0 : _a.slug) === ((_b = fee === null || fee === void 0 ? void 0 : fee.currency) === null || _b === void 0 ? void 0 : _b.slug); });
72
76
  return __assign(__assign({}, fee), { isEnoughBalanceToPay: theFee === null || theFee === void 0 ? void 0 : theFee.isEnoughBalanceToPay });
73
77
  })) !== null && _b !== void 0 ? _b : []);
74
- }, [tokensFee, feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail]);
78
+ }, [tokensFeeGroupBySlug, feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail]);
75
79
  var isEnoughBalanceToPayFee = (0, react_1.useMemo)(function () {
76
80
  return feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.some(function (fee) { return !fee.isEnoughBalanceToPay; });
77
81
  }, [feeCheckedBalance]);
78
82
  var totalFeeInUSD = (0, react_1.useMemo)(function () {
79
- return tokensFee === null || tokensFee === void 0 ? void 0 : tokensFee.reduce(function (acc, fee) { var _a, _b; return acc + ((_a = fee.feeInUSD) !== null && _a !== void 0 ? _a : 0) + ((_b = fee.feePercentInUSD) !== null && _b !== void 0 ? _b : 0); }, 0);
80
- }, [tokensFee]);
83
+ return feesData === null || feesData === void 0 ? void 0 : feesData.feeInUSD;
84
+ }, [feesData]);
81
85
  return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, __assign({ defaultExpanded: true }, rest, { sx: __assign({ "&.MuiAccordion-root": {
82
86
  backgroundColor: "transparent",
83
87
  margin: 0,
@@ -96,7 +100,7 @@ function Fees(props) {
96
100
  }, "& .MuiAccordionDetails-root": {
97
101
  paddingLeft: theme.mixins.customPadding.p12,
98
102
  paddingRight: theme.mixins.customPadding.p12,
99
- } }, sx), children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width: 20 }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Total fees" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: totalFeeInUSD, start: "~ $", disableTooltip: true }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.AccordionDetails, { 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.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { alignItems: "stretch" }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g8, alignItems: "center" }), children: feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.map(function (item, index) {
103
+ } }, sx), children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_down"), width: 20 }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%" }), onClick: function () { return console.warn(feeCheckedBalance, feesData); }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Total fees" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: totalFeeInUSD, start: "~ $", disableTooltip: true }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.AccordionDetails, { 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.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { alignItems: "stretch" }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g8, alignItems: "center" }), children: feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.map(function (item, index) {
100
104
  var _a;
101
105
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_2.Fragment, { children: [index !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
102
106
  borderRight: "1px dashed ".concat(theme.palette.border.white24),
@@ -107,7 +111,9 @@ function Fees(props) {
107
111
  return ((0, jsx_runtime_1.jsx)(FeeDetail, { feeName: (_a = item.feeType) === null || _a === void 0 ? void 0 : _a.name, feeInCurrency: item.feeInCurrency, feeInUSD: item.feeInUSD, currencyName: (_b = item.currency) === null || _b === void 0 ? void 0 : _b.name }, (_c = item.feeType) === null || _c === void 0 ? void 0 : _c.name));
108
112
  }) })] }), isEnoughBalanceToPayFee && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: ["You don't have enough balance to pay the fee, please ", " ", (0, jsx_runtime_1.jsxs)(ReceiveFunction_1.default, { children: [" ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
109
113
  textDecoration: "underline",
110
- }, children: "Topup more" })] }), " ", "to continue"] }))] }) })] })));
114
+ cursor: "pointer",
115
+ fontWeight: theme.typography.fontWeight600,
116
+ }, children: "deposit more" })] }), " ", "to continue"] }))] }) })] })));
111
117
  }
112
118
  exports.default = Fees;
113
119
  var FeeDetail = function (_a) {
@@ -195,7 +195,7 @@ var SendExternalToken = (0, react_1.forwardRef)(function (props, ref) {
195
195
  message = (_a.sent()).message;
196
196
  setIsValidatingAddress(false);
197
197
  if (message !== type_2.ValidateWalletAddressResultMessage.EXTERNAL_WALLET) {
198
- setErrorAddress(message);
198
+ setErrorAddress("Invalid wallet address");
199
199
  return [2 /*return*/, false];
200
200
  }
201
201
  setErrorAddress(undefined);
@@ -274,10 +274,12 @@ var SendExternalToken = (0, react_1.forwardRef)(function (props, ref) {
274
274
  }, [estimateFee, amount]);
275
275
  return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, 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)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
276
276
  wordBreak: "break-all",
277
- }, children: toAddress }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
277
+ }, children: toAddress }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
278
278
  fontWeight: theme.typography.fontWeight600,
279
279
  fontSize: theme.typography.fontSize16,
280
- }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] }))] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee || isValidatingAddress ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }), (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }) }));
280
+ }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.customMargin.m6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] }))] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress
281
+ ? Button_1.BUTTON_STATUS.DISABLED
282
+ : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }), (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }) }));
281
283
  });
282
284
  SendExternalToken.displayName = "SendExternalToken";
283
285
  exports.default = SendExternalToken;
@@ -232,7 +232,7 @@ var SendInternalToken = (0, react_1.forwardRef)(function (props, ref) {
232
232
  }, [validateAmount, props.sendInternalData]);
233
233
  return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, 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)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
234
234
  wordBreak: "break-all",
235
- }, children: toAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
235
+ }, children: toAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
236
236
  fontWeight: theme.typography.fontWeight600,
237
237
  fontSize: theme.typography.fontSize16,
238
238
  }, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.gaps.g6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] }))] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendInternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
@@ -587,7 +587,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
587
587
  placeholder: "Enter memo",
588
588
  value: memo,
589
589
  onChange: handleChangeMemo,
590
- } })] })), !!((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), estimateReceive !== undefined && !amountError && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Receive amount estimated" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(SendExternalToken_1.default, { initFeeData: estimateFee, sendExternalData: {
590
+ } })] })), !!((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "" })), estimateReceive !== undefined && !amountError && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Receive amount estimated" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(SendExternalToken_1.default, { initFeeData: estimateFee, sendExternalData: {
591
591
  amount: "".concat(amount),
592
592
  currency_slug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "",
593
593
  to_address: recipientAddress || "",
@@ -26,8 +26,6 @@ export interface FeeDetailType {
26
26
  feePercent: number;
27
27
  currency: Currency;
28
28
  feeFixed: number;
29
- feePercentInUSD?: number;
30
- feePercentInCurrency?: number;
31
29
  isEnoughBalanceToPay?: boolean;
32
30
  }
33
31
  export interface FeeType {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.521",
3
+ "version": "0.0.523",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",