tek-wallet 0.0.311 → 0.0.313
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.
|
@@ -177,6 +177,42 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
177
177
|
clearValues();
|
|
178
178
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
179
179
|
};
|
|
180
|
+
var findWithdrawToken = function (contract_address) {
|
|
181
|
+
return withdrawTokens === null || withdrawTokens === void 0 ? void 0 : withdrawTokens.find(function (item) { return (item === null || item === void 0 ? void 0 : item.address) === contract_address; });
|
|
182
|
+
};
|
|
183
|
+
var handleSelectTransferInternal = function () {
|
|
184
|
+
var _a;
|
|
185
|
+
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
186
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
187
|
+
if (!tokenSet) {
|
|
188
|
+
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
setSelectedToken(tokenSet);
|
|
192
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
193
|
+
gotoStep(WithdrawStep.CONFIRM);
|
|
194
|
+
}
|
|
195
|
+
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
196
|
+
setRecipientAddress(recipientAddressInternal);
|
|
197
|
+
setAmount((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || "");
|
|
198
|
+
};
|
|
199
|
+
var handleSelectContinueTransferExternal = function () {
|
|
200
|
+
var _a;
|
|
201
|
+
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
202
|
+
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
203
|
+
if (!tokenSet) {
|
|
204
|
+
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
setSelectedToken(tokenSet);
|
|
208
|
+
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
209
|
+
gotoStep(WithdrawStep.CONFIRM);
|
|
210
|
+
}
|
|
211
|
+
setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
|
|
212
|
+
setRecipientAddress(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.address);
|
|
213
|
+
setAmount((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || "");
|
|
214
|
+
setMemo(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.text);
|
|
215
|
+
};
|
|
180
216
|
var handleSelectMethod = function (method) {
|
|
181
217
|
var _a;
|
|
182
218
|
console.warn("🚀 ~ handleSelectMethod ~ method:", method);
|
|
@@ -199,6 +235,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
199
235
|
(_a = scannerAllQrCodeRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
200
236
|
break;
|
|
201
237
|
case SendMethods.TRANSFER_INTERNAL:
|
|
238
|
+
handleSelectTransferInternal();
|
|
202
239
|
break;
|
|
203
240
|
case SendMethods.TRANSFER_EXTERNAL:
|
|
204
241
|
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
@@ -242,9 +279,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
242
279
|
// network: data?.network,
|
|
243
280
|
// });
|
|
244
281
|
// };
|
|
245
|
-
var findWithdrawToken = function (contract_address) {
|
|
246
|
-
return withdrawTokens === null || withdrawTokens === void 0 ? void 0 : withdrawTokens.find(function (item) { return (item === null || item === void 0 ? void 0 : item.address) === contract_address; });
|
|
247
|
-
};
|
|
248
282
|
var handleScanAllQrCode = function (result) { return __awaiter(void 0, void 0, void 0, function () {
|
|
249
283
|
var text, tonTransferParam, validateWalletAddress;
|
|
250
284
|
var _a, _b, _c, _d, _e;
|
|
@@ -295,39 +329,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
295
329
|
});
|
|
296
330
|
}); };
|
|
297
331
|
var handleScanAddressQrCode = function () { };
|
|
298
|
-
var handleSelectTransferInternal = function () {
|
|
299
|
-
var _a;
|
|
300
|
-
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
301
|
-
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
302
|
-
if (!tokenSet) {
|
|
303
|
-
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
setSelectedToken(tokenSet);
|
|
307
|
-
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
308
|
-
gotoStep(WithdrawStep.CONFIRM);
|
|
309
|
-
}
|
|
310
|
-
setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
|
|
311
|
-
setRecipientAddress(recipientAddressInternal);
|
|
312
|
-
setAmount((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || "");
|
|
313
|
-
};
|
|
314
|
-
var handleSelectContinueTransferExternal = function () {
|
|
315
|
-
var _a;
|
|
316
|
-
(_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
317
|
-
var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
|
|
318
|
-
if (!tokenSet) {
|
|
319
|
-
gotoStep(WithdrawStep.SELECT_TOKEN);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
setSelectedToken(tokenSet);
|
|
323
|
-
setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
|
|
324
|
-
gotoStep(WithdrawStep.CONFIRM);
|
|
325
|
-
}
|
|
326
|
-
setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
|
|
327
|
-
setRecipientAddress(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.address);
|
|
328
|
-
setAmount((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || "");
|
|
329
|
-
setMemo(sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.text);
|
|
330
|
-
};
|
|
331
332
|
(0, react_1.useEffect)(function () {
|
|
332
333
|
if (isAuthenticated && !withdrawTokens) {
|
|
333
334
|
console.warn("🚀 ~ updateWithdrawToken ~ isAuthenticated:", isAuthenticated);
|
|
@@ -370,8 +371,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
370
371
|
paddingRight: theme.mixins.customPadding.p12,
|
|
371
372
|
}, inputRest: {
|
|
372
373
|
placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, " ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name),
|
|
373
|
-
value: amount,
|
|
374
|
+
value: amount.toString(),
|
|
374
375
|
onChange: handleChangeAmount,
|
|
376
|
+
type: "text",
|
|
377
|
+
inputMode: "decimal",
|
|
375
378
|
}, rightPart: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
376
379
|
fontWeight: theme.typography.fontWeight600,
|
|
377
380
|
color: theme.palette.text.secondary,
|