tek-wallet 0.0.398 → 0.0.400
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.
|
@@ -40,7 +40,7 @@ Button.displayName = "Button";
|
|
|
40
40
|
Button.Primary = function (props) {
|
|
41
41
|
var sx = props.sx, children = props.children, rest = __rest(props, ["sx", "children"]);
|
|
42
42
|
var theme = (0, material_1.useTheme)();
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "contained", color: "primary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full, "
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "contained", color: "primary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full, "&.Mui-disabled": {
|
|
44
44
|
backgroundColor: theme.palette.background.white16,
|
|
45
45
|
color: theme.palette.text.white24,
|
|
46
46
|
} }, sx), children: children })));
|
|
@@ -168,8 +168,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
168
168
|
var _o = (0, react_1.useState)(), selectedMethod = _o[0], setSelectedMethod = _o[1];
|
|
169
169
|
var _p = (0, react_1.useState)(), sendInfoGet = _p[0], setSendInfoGet = _p[1];
|
|
170
170
|
var _q = (0, react_1.useState)(false), isLoadingEstimateFee = _q[0], setIsLoadingEstimateFee = _q[1];
|
|
171
|
-
var _r = (0, react_1.useState)(),
|
|
172
|
-
var _s = (0, react_1.useState)(),
|
|
171
|
+
var _r = (0, react_1.useState)(false), isValidatingAddress = _r[0], setIsValidatingAddress = _r[1];
|
|
172
|
+
var _s = (0, react_1.useState)(), estimateFee = _s[0], setEstimateFee = _s[1];
|
|
173
|
+
var _t = (0, react_1.useState)(), recipientAddressError = _t[0], setRecipientAddressError = _t[1];
|
|
173
174
|
var onlyChangeAddress = (0, react_1.useRef)(false);
|
|
174
175
|
var withdrawToken = (0, react_1.useMemo)(function () {
|
|
175
176
|
return selectedMethod === SendMethods.TRANSFER_EXTERNAL
|
|
@@ -194,8 +195,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
194
195
|
return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
|
|
195
196
|
}, [estimateFee, amount]);
|
|
196
197
|
(0, react_1.useEffect)(function () {
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
setTimeout(function () {
|
|
199
|
+
var _a;
|
|
200
|
+
(_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
201
|
+
}, 50);
|
|
199
202
|
}, [estimateFee, amountError, recipientAddressError]);
|
|
200
203
|
var clearValues = function () {
|
|
201
204
|
setSelectedToken(undefined);
|
|
@@ -318,7 +321,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
318
321
|
if (onlyChangeAddress.current) {
|
|
319
322
|
return;
|
|
320
323
|
}
|
|
321
|
-
var tokenSet =
|
|
324
|
+
var tokenSet = (data === null || data === void 0 ? void 0 : data.jetton)
|
|
325
|
+
? findWithdrawToken(data === null || data === void 0 ? void 0 : data.jetton)
|
|
326
|
+
: selectedToken;
|
|
322
327
|
if (!tokenSet) {
|
|
323
328
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
324
329
|
}
|
|
@@ -412,13 +417,14 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
412
417
|
return __generator(this, function (_b) {
|
|
413
418
|
switch (_b.label) {
|
|
414
419
|
case 0:
|
|
415
|
-
|
|
420
|
+
setIsValidatingAddress(true);
|
|
416
421
|
return [4 /*yield*/, (0, validate_wallet_address_service_1.default)({
|
|
417
422
|
address: address,
|
|
418
423
|
network: network,
|
|
419
424
|
})];
|
|
420
425
|
case 1:
|
|
421
426
|
validateWalletAddress = _b.sent();
|
|
427
|
+
setIsValidatingAddress(false);
|
|
422
428
|
if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.valid)) {
|
|
423
429
|
setRecipientAddressError(undefined);
|
|
424
430
|
}
|
|
@@ -619,7 +625,8 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
619
625
|
!recipientAddress ||
|
|
620
626
|
!amount ||
|
|
621
627
|
!selectedToken ||
|
|
622
|
-
isLoadingEstimateFee
|
|
628
|
+
isLoadingEstimateFee ||
|
|
629
|
+
isValidatingAddress
|
|
623
630
|
? Button_1.BUTTON_STATUS.DISABLED
|
|
624
631
|
: 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
632
|
textAlign: "center",
|