tek-wallet 0.0.350 → 0.0.352
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.
|
@@ -162,6 +162,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
162
162
|
var _o = (0, react_1.useState)(), sendInfoGet = _o[0], setSendInfoGet = _o[1];
|
|
163
163
|
var _p = (0, react_1.useState)(), recipientAddressError = _p[0], setRecipientAddressError = _p[1];
|
|
164
164
|
var _q = (0, react_1.useState)(), recipientAddressInternal = _q[0], setRecipientAddressInternal = _q[1];
|
|
165
|
+
var onlyChangeAddress = (0, react_1.useRef)(false);
|
|
165
166
|
var networks = (0, react_1.useMemo)(function () {
|
|
166
167
|
console.warn("🚀 ~ networks ~ selectedToken:", selectedToken);
|
|
167
168
|
if (!selectedToken) {
|
|
@@ -187,6 +188,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
187
188
|
setAmountErrorMessage(undefined);
|
|
188
189
|
setHiddenError(true);
|
|
189
190
|
setRecipientAddressError(undefined);
|
|
191
|
+
onlyChangeAddress.current = false;
|
|
190
192
|
};
|
|
191
193
|
var handleClearRecipientAddress = function () {
|
|
192
194
|
setRecipientAddress("");
|
|
@@ -271,8 +273,11 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
271
273
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
272
274
|
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
273
275
|
console.warn("🚀 ~ handleSelectTransferInternal ~ sendInfoGet:", sendInfoGet);
|
|
274
|
-
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
275
276
|
setRecipientAddress(recipientAddressInternal);
|
|
277
|
+
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
278
|
+
if (!onlyChangeAddress.current) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
276
281
|
setAmount(getAmountAfterDecimal((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
|
|
277
282
|
if (!tokenSet) {
|
|
278
283
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
@@ -288,6 +293,11 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
288
293
|
console.warn("🚀 ~ data handleSelectContinueTransferExternal:", data);
|
|
289
294
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
290
295
|
var tokenSet = findWithdrawToken((data === null || data === void 0 ? void 0 : data.jetton) || "");
|
|
296
|
+
setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
|
|
297
|
+
setRecipientAddress(data === null || data === void 0 ? void 0 : data.address);
|
|
298
|
+
if (!onlyChangeAddress.current) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
291
301
|
if (!tokenSet) {
|
|
292
302
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
293
303
|
}
|
|
@@ -296,8 +306,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
296
306
|
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
297
307
|
gotoStep(WithdrawStep.CONFIRM);
|
|
298
308
|
}
|
|
299
|
-
setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
|
|
300
|
-
setRecipientAddress(data === null || data === void 0 ? void 0 : data.address);
|
|
301
309
|
setAmount(getAmountAfterDecimal((data === null || data === void 0 ? void 0 : data.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
|
|
302
310
|
setMemo(data === null || data === void 0 ? void 0 : data.text);
|
|
303
311
|
};
|
|
@@ -351,14 +359,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
351
359
|
setSelectedNetwork(network);
|
|
352
360
|
gotoStep(WithdrawStep.CONFIRM);
|
|
353
361
|
};
|
|
354
|
-
// const handleValidateWalletAddress = async (
|
|
355
|
-
// data: ValidateWalletAddressBody
|
|
356
|
-
// ) => {
|
|
357
|
-
// const validateWalletAddress = await validateWalletAddressService({
|
|
358
|
-
// address: data?.address,
|
|
359
|
-
// network: data?.network,
|
|
360
|
-
// });
|
|
361
|
-
// };
|
|
362
362
|
var handleValidateWalletAddress = function (address, network) { return __awaiter(void 0, void 0, void 0, function () {
|
|
363
363
|
var validateWalletAddress;
|
|
364
364
|
var _a;
|
|
@@ -444,7 +444,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
446
|
}); };
|
|
447
|
-
var handleScanAddressQrCode = function () {
|
|
447
|
+
var handleScanAddressQrCode = function (result) { return __awaiter(void 0, void 0, void 0, function () {
|
|
448
|
+
return __generator(this, function (_a) {
|
|
449
|
+
onlyChangeAddress.current = true;
|
|
450
|
+
handleScanAllQrCode(result);
|
|
451
|
+
return [2 /*return*/];
|
|
452
|
+
});
|
|
453
|
+
}); };
|
|
448
454
|
(0, react_1.useEffect)(function () {
|
|
449
455
|
if (isAuthenticated && !withdrawTokens) {
|
|
450
456
|
console.warn("🚀 ~ updateWithdrawToken ~ isAuthenticated:", isAuthenticated);
|
|
@@ -501,11 +507,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
501
507
|
placeholder: "Enter memo",
|
|
502
508
|
value: memo,
|
|
503
509
|
onChange: handleChangeMemo,
|
|
504
|
-
} })] })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, status: amountError ||
|
|
510
|
+
} })] })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, status: !!amountError ||
|
|
505
511
|
!recipientAddress ||
|
|
506
512
|
!amount ||
|
|
507
513
|
!selectedToken ||
|
|
508
|
-
!selectedNetwork ||
|
|
509
514
|
!!recipientAddressError
|
|
510
515
|
? Button_1.BUTTON_STATUS.DISABLED
|
|
511
516
|
: Button_1.BUTTON_STATUS.ENABLED, children: "Confirm" })] }) }, WithdrawStep.CONFIRM)] }, withdrawTokens === null || withdrawTokens === void 0 ? void 0 : withdrawTokens.length), (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: {
|