tek-wallet 0.0.306 → 0.0.308
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.
|
@@ -116,6 +116,8 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
116
116
|
var backDropRef = (0, react_1.useRef)(null);
|
|
117
117
|
var suggestUseTransferInternalDialogRef = (0, react_1.useRef)(null);
|
|
118
118
|
var _j = (0, react_1.useState)(), selectedMethod = _j[0], setSelectedMethod = _j[1];
|
|
119
|
+
var _k = (0, react_1.useState)(), sendInfoGet = _k[0], setSendInfoGet = _k[1];
|
|
120
|
+
var _l = (0, react_1.useState)(), recipientAddressInternal = _l[0], setRecipientAddressInternal = _l[1];
|
|
119
121
|
var networks = (0, react_1.useMemo)(function () {
|
|
120
122
|
console.warn("🚀 ~ networks ~ selectedToken:", selectedToken);
|
|
121
123
|
if (!selectedToken) {
|
|
@@ -209,6 +211,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
209
211
|
if (currentStep === WithdrawStep.CONFIRM &&
|
|
210
212
|
selectedMethod === SendMethods.TRANSFER_INTERNAL) {
|
|
211
213
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
214
|
+
return;
|
|
212
215
|
}
|
|
213
216
|
(_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.prev();
|
|
214
217
|
setCurrentStep(function (prev) { return prev - 1; });
|
|
@@ -242,7 +245,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
242
245
|
return withdrawTokens === null || withdrawTokens === void 0 ? void 0 : withdrawTokens.find(function (item) { return (item === null || item === void 0 ? void 0 : item.address) === contract_address; });
|
|
243
246
|
};
|
|
244
247
|
var handleScanAllQrCode = function (result) { return __awaiter(void 0, void 0, void 0, function () {
|
|
245
|
-
var text, tonTransferParam, validateWalletAddress
|
|
248
|
+
var text, tonTransferParam, validateWalletAddress;
|
|
246
249
|
var _a, _b, _c, _d, _e;
|
|
247
250
|
return __generator(this, function (_f) {
|
|
248
251
|
switch (_f.label) {
|
|
@@ -264,13 +267,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
264
267
|
setInfoDialogContent("Unsupported QR");
|
|
265
268
|
return [2 /*return*/];
|
|
266
269
|
}
|
|
267
|
-
|
|
268
|
-
withdrawToken = findWithdrawToken((tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.jetton) || "");
|
|
269
|
-
if (!!withdrawToken) {
|
|
270
|
-
setSelectedToken(withdrawToken);
|
|
271
|
-
setAmount(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.amount);
|
|
272
|
-
}
|
|
273
|
-
setMemo(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.text);
|
|
270
|
+
setSendInfoGet(tonTransferParam);
|
|
274
271
|
(_d = backDropRef.current) === null || _d === void 0 ? void 0 : _d.close();
|
|
275
272
|
console.warn("validateWalletAddress", validateWalletAddress);
|
|
276
273
|
// if(validateWalletAddress?.is_current_wallet) {
|
|
@@ -279,6 +276,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
279
276
|
if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address)) {
|
|
280
277
|
//internal
|
|
281
278
|
console.warn("internal");
|
|
279
|
+
setRecipientAddressInternal(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address);
|
|
282
280
|
(_e = suggestUseTransferInternalDialogRef.current) === null || _e === void 0 ? void 0 : _e.open();
|
|
283
281
|
}
|
|
284
282
|
else if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.valid)) {
|
|
@@ -299,24 +297,35 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
299
297
|
var handleSelectTransferInternal = function () {
|
|
300
298
|
var _a;
|
|
301
299
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
302
|
-
|
|
300
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
301
|
+
if (!tokenSet) {
|
|
303
302
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
304
303
|
}
|
|
305
304
|
else {
|
|
305
|
+
setSelectedToken(tokenSet);
|
|
306
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
306
307
|
gotoStep(WithdrawStep.CONFIRM);
|
|
307
308
|
}
|
|
308
309
|
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
310
|
+
setRecipientAddress(recipientAddressInternal);
|
|
311
|
+
setAmount(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount);
|
|
309
312
|
};
|
|
310
313
|
var handleSelectContinueTransferExternal = function () {
|
|
311
314
|
var _a;
|
|
312
315
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
313
|
-
|
|
316
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
317
|
+
if (!tokenSet) {
|
|
314
318
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
315
319
|
}
|
|
316
320
|
else {
|
|
321
|
+
setSelectedToken(tokenSet);
|
|
322
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
317
323
|
gotoStep(WithdrawStep.CONFIRM);
|
|
318
324
|
}
|
|
319
325
|
setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
|
|
326
|
+
setRecipientAddress(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.address);
|
|
327
|
+
setAmount(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount);
|
|
328
|
+
setMemo(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.text);
|
|
320
329
|
};
|
|
321
330
|
(0, react_1.useEffect)(function () {
|
|
322
331
|
if (isAuthenticated && !withdrawTokens) {
|