tek-wallet 0.0.609 → 0.0.611
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.
|
@@ -67,11 +67,15 @@ function Fees(props) {
|
|
|
67
67
|
})) !== null && _b !== void 0 ? _b : []);
|
|
68
68
|
}, [feesData === null || feesData === void 0 ? void 0 : feesData.feeDetail, getBalanceUseToPaidFee]);
|
|
69
69
|
var isNotEnoughBalanceToPayFee = (0, react_1.useMemo)(function () {
|
|
70
|
-
var _a;
|
|
71
70
|
var isNotEnoughBalanceToPay = feeCheckedBalance === null || feeCheckedBalance === void 0 ? void 0 : feeCheckedBalance.some(function (fee) { return !fee.isEnoughBalanceToPay; });
|
|
72
|
-
(_a = props.onEnoughBalanceToPayFee) === null || _a === void 0 ? void 0 : _a.call(props, !isNotEnoughBalanceToPay);
|
|
73
71
|
return isNotEnoughBalanceToPay;
|
|
74
72
|
}, [feeCheckedBalance]);
|
|
73
|
+
(0, react_1.useEffect)(function () {
|
|
74
|
+
var _a;
|
|
75
|
+
if (isNotEnoughBalanceToPayFee) {
|
|
76
|
+
(_a = props.onEnoughBalanceToPayFee) === null || _a === void 0 ? void 0 : _a.call(props, !isNotEnoughBalanceToPayFee);
|
|
77
|
+
}
|
|
78
|
+
}, [isNotEnoughBalanceToPayFee]);
|
|
75
79
|
var totalFeeInUSD = (0, react_1.useMemo)(function () {
|
|
76
80
|
return feesData === null || feesData === void 0 ? void 0 : feesData.feeInUSD;
|
|
77
81
|
}, [feesData]);
|
|
@@ -104,6 +104,7 @@ var get_est_fee_service_1 = __importDefault(require("../../../services/axios/get
|
|
|
104
104
|
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
105
105
|
var validate_wallet_address_service_1 = __importDefault(require("../../../services/axios/validate-wallet-address-service"));
|
|
106
106
|
var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
|
|
107
|
+
var CopyableText_1 = __importDefault(require("../CopyableText"));
|
|
107
108
|
var SendExternalTokenError;
|
|
108
109
|
(function (SendExternalTokenError) {
|
|
109
110
|
SendExternalTokenError["TOKEN_NOT_FOUND"] = "Token not found";
|
|
@@ -262,19 +263,28 @@ var SendExternalToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
262
263
|
open: handleOpen,
|
|
263
264
|
close: handleClose,
|
|
264
265
|
}); });
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}, [estimateFee, amount]);
|
|
270
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.
|
|
266
|
+
var formatted = "".concat(toAddress.slice(0, 8), "...").concat(toAddress.slice(-3));
|
|
267
|
+
// const estimateReceive = useMemo(() => {
|
|
268
|
+
// if (!estimateFee || !amount) return undefined;
|
|
269
|
+
// return +amount - +estimateFee?.feeInCurrency;
|
|
270
|
+
// }, [estimateFee, amount]);
|
|
271
|
+
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, isFlag: false, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), { textAlign: "start", mr: "auto" }), component: "p", children: "Transaction summary" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, ml: "auto", alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { component: "p", sx: __assign({}, theme.mixins.value), children: token === null || token === void 0 ? void 0 : token.name })] }), 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.g4, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.link, sx: {
|
|
272
|
+
borderRadius: theme.mixins.customRadius.full,
|
|
273
|
+
} }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }), 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: "Address", value: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
271
274
|
wordBreak: "break-all",
|
|
272
|
-
}, children:
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
}, children: (0, jsx_runtime_1.jsx)(CopyableText_1.default, { copyText: toAddress, displayText: formatted }) }) }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Type", value: "On-chain withdraw" }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Comment", 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, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug, onEnoughBalanceToPayFee: setIsEnoughBalanceToPayFee })), !!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 || !isEnoughBalanceToPayFee
|
|
276
|
+
? Button_1.BUTTON_STATUS.DISABLED
|
|
277
|
+
: buttonStatus, sx: {
|
|
278
|
+
position: "absolute",
|
|
279
|
+
bottom: "1.5rem",
|
|
280
|
+
left: "50%",
|
|
281
|
+
transform: "translateX(-50%)",
|
|
282
|
+
width: "calc(100dvw - 2rem)",
|
|
283
|
+
backgroundColor: "#1E4841",
|
|
284
|
+
fontWeight: theme.typography.fontWeight500,
|
|
285
|
+
fontSize: theme.typography.fontSize14,
|
|
286
|
+
borderRadius: theme.mixins.customRadius.r12,
|
|
287
|
+
}, children: "Confirm" }) })] })] }) }));
|
|
278
288
|
});
|
|
279
289
|
SendExternalToken.displayName = "SendExternalToken";
|
|
280
290
|
exports.default = SendExternalToken;
|