tek-wallet 0.0.298 → 0.0.299

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.
@@ -108,9 +108,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
108
108
  var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
109
109
  var _d = (0, useWithdrawData_1.default)(), withdrawTokens = _d.withdrawTokens, updateWithdrawToken = _d.updateWithdrawToken;
110
110
  var _e = (0, react_1.useState)(), infoDialogContent = _e[0], setInfoDialogContent = _e[1];
111
- var _f = (0, react_1.useState)(""), amount = _f[0], setAmount = _f[1];
112
- var _g = (0, react_1.useState)(""), memo = _g[0], setMemo = _g[1];
113
- var _h = (0, react_1.useState)(""), recipientAddress = _h[0], setRecipientAddress = _h[1];
111
+ var _f = (0, react_1.useState)(undefined), amount = _f[0], setAmount = _f[1];
112
+ var _g = (0, react_1.useState)(undefined), memo = _g[0], setMemo = _g[1];
113
+ var _h = (0, react_1.useState)(undefined), recipientAddress = _h[0], setRecipientAddress = _h[1];
114
114
  var scannerAllQrCodeRef = (0, react_1.useRef)(null);
115
115
  var scannerAddressQrCodeRef = (0, react_1.useRef)(null);
116
116
  var backDropRef = (0, react_1.useRef)(null);
@@ -257,8 +257,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
257
257
  setInfoDialogContent("Unsupported QR");
258
258
  return [2 /*return*/];
259
259
  }
260
+ setRecipientAddress(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.address);
261
+ setAmount(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.amount);
262
+ setMemo(tonTransferParam === null || tonTransferParam === void 0 ? void 0 : tonTransferParam.text);
260
263
  (_d = backDropRef.current) === null || _d === void 0 ? void 0 : _d.close();
261
- setInfoDialogContent("Unsupported QR Code, please scan a valid QR code or enter the recipient address manually");
262
264
  console.warn("validateWalletAddress", validateWalletAddress);
263
265
  // if(validateWalletAddress?.is_current_wallet) {
264
266
  // return
@@ -270,6 +272,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
270
272
  }
271
273
  else if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.valid)) {
272
274
  //external
275
+ handleSelectContinueTransferExternal();
273
276
  console.warn("external");
274
277
  }
275
278
  else {
@@ -282,6 +285,16 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
282
285
  });
283
286
  }); };
284
287
  var handleScanAddressQrCode = function () { };
288
+ var handleSelectTransferInternal = function () {
289
+ var _a;
290
+ (_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
291
+ gotoStep(WithdrawStep.CONFIRM);
292
+ };
293
+ var handleSelectContinueTransferExternal = function () {
294
+ var _a;
295
+ (_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
296
+ gotoStep(WithdrawStep.CONFIRM);
297
+ };
285
298
  (0, react_1.useEffect)(function () {
286
299
  if (isAuthenticated && !withdrawTokens) {
287
300
  console.warn("🚀 ~ updateWithdrawToken ~ isAuthenticated:", isAuthenticated);
@@ -330,11 +343,11 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
330
343
  placeholder: "Enter memo",
331
344
  value: memo,
332
345
  onChange: handleChangeMemo,
333
- } })] }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, 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: infoDialogContent, actions: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsOk), { width: "100%" }), onClick: handleClearInfoDialogContent, children: "Ok" }) }) }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { ref: suggestUseTransferInternalDialogRef, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: "This wallet is supported transfer internal, use it for faster transaction?", actions: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
346
+ } })] }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, 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: infoDialogContent, actions: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsOk), { width: "100%" }), onClick: handleClearInfoDialogContent, children: "Ok" }) }) }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { ref: suggestUseTransferInternalDialogRef, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: "This wallet is supported send internally, use it for faster transaction?", actions: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
334
347
  display: "grid",
335
- gridTemplate: "1fr 1fr",
348
+ gridTemplateColumns: "1fr auto 1fr",
336
349
  gap: theme.mixins.gaps.g8,
337
- }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsCancel), { width: "100%" }), onClick: handleClearInfoDialogContent, children: "Keep continue" }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", variant: "middle", flexItem: true }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsOk), { width: "100%" }), onClick: handleClearInfoDialogContent, children: "Ok" })] }) }) })] }) }) }));
350
+ }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsCancel), { width: "100%" }), onClick: handleSelectContinueTransferExternal, children: "Keep continue" }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", variant: "middle", flexItem: true }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.dialogActionsOk), { width: "100%" }), onClick: handleSelectTransferInternal, children: "Ok" })] }) }) })] }) }) }));
338
351
  });
339
352
  WithdrawFunction.displayName = "WithdrawFunction";
340
353
  exports.default = WithdrawFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.298",
3
+ "version": "0.0.299",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",