tek-wallet 0.0.307 → 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) {
|
|
@@ -243,7 +245,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
243
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; });
|
|
244
246
|
};
|
|
245
247
|
var handleScanAllQrCode = function (result) { return __awaiter(void 0, void 0, void 0, function () {
|
|
246
|
-
var text, tonTransferParam, validateWalletAddress
|
|
248
|
+
var text, tonTransferParam, validateWalletAddress;
|
|
247
249
|
var _a, _b, _c, _d, _e;
|
|
248
250
|
return __generator(this, function (_f) {
|
|
249
251
|
switch (_f.label) {
|
|
@@ -265,13 +267,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
265
267
|
setInfoDialogContent("Unsupported QR");
|
|
266
268
|
return [2 /*return*/];
|
|
267
269
|
}
|
|
268
|
-
|
|
269
|
-
withdrawToken = findWithdrawToken((tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.jetton) || "");
|
|
270
|
-
if (!!withdrawToken) {
|
|
271
|
-
setSelectedToken(withdrawToken);
|
|
272
|
-
setAmount(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.amount);
|
|
273
|
-
}
|
|
274
|
-
setMemo(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.text);
|
|
270
|
+
setSendInfoGet(tonTransferParam);
|
|
275
271
|
(_d = backDropRef.current) === null || _d === void 0 ? void 0 : _d.close();
|
|
276
272
|
console.warn("validateWalletAddress", validateWalletAddress);
|
|
277
273
|
// if(validateWalletAddress?.is_current_wallet) {
|
|
@@ -280,6 +276,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
280
276
|
if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address)) {
|
|
281
277
|
//internal
|
|
282
278
|
console.warn("internal");
|
|
279
|
+
setRecipientAddressInternal(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address);
|
|
283
280
|
(_e = suggestUseTransferInternalDialogRef.current) === null || _e === void 0 ? void 0 : _e.open();
|
|
284
281
|
}
|
|
285
282
|
else if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.valid)) {
|
|
@@ -300,24 +297,35 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
300
297
|
var handleSelectTransferInternal = function () {
|
|
301
298
|
var _a;
|
|
302
299
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
303
|
-
|
|
300
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
301
|
+
if (!tokenSet) {
|
|
304
302
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
305
303
|
}
|
|
306
304
|
else {
|
|
305
|
+
setSelectedToken(tokenSet);
|
|
306
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
307
307
|
gotoStep(WithdrawStep.CONFIRM);
|
|
308
308
|
}
|
|
309
309
|
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
310
|
+
setRecipientAddress(recipientAddressInternal);
|
|
311
|
+
setAmount(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount);
|
|
310
312
|
};
|
|
311
313
|
var handleSelectContinueTransferExternal = function () {
|
|
312
314
|
var _a;
|
|
313
315
|
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
314
|
-
|
|
316
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
317
|
+
if (!tokenSet) {
|
|
315
318
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
316
319
|
}
|
|
317
320
|
else {
|
|
321
|
+
setSelectedToken(tokenSet);
|
|
322
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
318
323
|
gotoStep(WithdrawStep.CONFIRM);
|
|
319
324
|
}
|
|
320
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);
|
|
321
329
|
};
|
|
322
330
|
(0, react_1.useEffect)(function () {
|
|
323
331
|
if (isAuthenticated && !withdrawTokens) {
|