tek-wallet 0.0.287 → 0.0.289
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.
- package/dist/components/ui/AppDialog/index.d.ts +11 -0
- package/dist/components/ui/AppDialog/index.js +38 -0
- package/dist/components/ui/DialogContentLayout/index.d.ts +8 -0
- package/dist/components/ui/DialogContentLayout/index.js +36 -0
- package/dist/components/ui/WithdrawFunction/index.js +17 -6
- package/dist/services/axios/validate-wallet-address-service/index.d.ts +1 -1
- package/dist/services/axios/validate-wallet-address-service/index.js +9 -2
- package/dist/theme/mui/theme.js +15 -0
- package/package.json +1 -1
- /package/dist/components/ui/{BackDrop → AppBackDrop}/index.d.ts +0 -0
- /package/dist/components/ui/{BackDrop → AppBackDrop}/index.js +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DialogProps } from "@mui/material";
|
|
2
|
+
import { GeneralProps } from "../../../types/ui";
|
|
3
|
+
interface AppDialogProps extends Omit<DialogProps, "open">, Omit<GeneralProps, "sx" | "onClick"> {
|
|
4
|
+
overrideOpen?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface AppDialogRef {
|
|
7
|
+
open: () => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const AppDialog: import("react").ForwardRefExoticComponent<Omit<AppDialogProps, "ref"> & import("react").RefAttributes<AppDialogRef>>;
|
|
11
|
+
export default AppDialog;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
|
+
var material_1 = require("@mui/material");
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var AppDialog = (0, react_1.forwardRef)(function (props, ref) {
|
|
29
|
+
var _a = (0, react_1.useState)(false), isOpen = _a[0], setIsOpen = _a[1];
|
|
30
|
+
var sx = props.sx, children = props.children, overrideOpen = props.overrideOpen, rest = __rest(props, ["sx", "children", "overrideOpen"]);
|
|
31
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
32
|
+
open: function () { return setIsOpen(true); },
|
|
33
|
+
close: function () { return setIsOpen(false); },
|
|
34
|
+
}); });
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Dialog, __assign({ open: overrideOpen !== null && overrideOpen !== void 0 ? overrideOpen : isOpen, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", sx: __assign({}, sx) }, rest, { children: children })));
|
|
36
|
+
});
|
|
37
|
+
AppDialog.displayName = "AppDialog";
|
|
38
|
+
exports.default = AppDialog;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BoxProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
interface DialogContentLayoutProps extends Omit<BoxProps, "content" | "actions"> {
|
|
4
|
+
content?: ReactNode;
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function DialogContentLayout(props: DialogContentLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DialogContentLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var material_1 = require("@mui/material");
|
|
30
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
31
|
+
function DialogContentLayout(props) {
|
|
32
|
+
var content = props.content, actions = props.actions, sx = props.sx, rest = __rest(props, ["content", "actions", "sx"]);
|
|
33
|
+
var theme = (0, material_1.useTheme)();
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, padding: theme.mixins.customPadding.p12, borderRadius: theme.mixins.theBorderRadius.r12, backgroundColor: theme.palette.background.black64, backdropFilter: "blur(12px)" }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.dialogContent), children: content }), !!actions && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), actions] })));
|
|
35
|
+
}
|
|
36
|
+
exports.default = DialogContentLayout;
|
|
@@ -76,7 +76,9 @@ var Input_1 = __importDefault(require("../Input"));
|
|
|
76
76
|
var QrCodeReader_1 = __importDefault(require("../QrCodeReader"));
|
|
77
77
|
var validate_wallet_address_service_1 = __importDefault(require("../../../services/axios/validate-wallet-address-service"));
|
|
78
78
|
var parseTonTransferUrl_1 = __importDefault(require("../../../utils/parseTonTransferUrl"));
|
|
79
|
-
var
|
|
79
|
+
var AppBackDrop_1 = __importDefault(require("../AppBackDrop"));
|
|
80
|
+
var DialogContentLayout_1 = __importDefault(require("../DialogContentLayout"));
|
|
81
|
+
var AppDialog_1 = __importDefault(require("../AppDialog"));
|
|
80
82
|
var SendMethods;
|
|
81
83
|
(function (SendMethods) {
|
|
82
84
|
SendMethods["SCAN_QR_CODE"] = "scan qr code";
|
|
@@ -105,13 +107,14 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
105
107
|
var _c = (0, react_1.useState)(), selectedNetwork = _c[0], setSelectedNetwork = _c[1];
|
|
106
108
|
var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
|
|
107
109
|
var _d = (0, useWithdrawData_1.default)(), withdrawTokens = _d.withdrawTokens, updateWithdrawToken = _d.updateWithdrawToken;
|
|
108
|
-
var _e = (0, react_1.useState)(
|
|
109
|
-
var _f = (0, react_1.useState)(""),
|
|
110
|
-
var _g = (0, react_1.useState)(""),
|
|
110
|
+
var _e = (0, react_1.useState)(), dialogContent = _e[0], setDialogContent = _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
114
|
var scannerAllQrCodeRef = (0, react_1.useRef)(null);
|
|
112
115
|
var scannerAddressQrCodeRef = (0, react_1.useRef)(null);
|
|
113
116
|
var backDropRef = (0, react_1.useRef)(null);
|
|
114
|
-
var
|
|
117
|
+
var _j = (0, react_1.useState)(), selectedMethod = _j[0], setSelectedMethod = _j[1];
|
|
115
118
|
var networks = (0, react_1.useMemo)(function () {
|
|
116
119
|
console.warn("🚀 ~ networks ~ selectedToken:", selectedToken);
|
|
117
120
|
if (!selectedToken) {
|
|
@@ -245,8 +248,16 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
245
248
|
})];
|
|
246
249
|
case 1:
|
|
247
250
|
validateWalletAddress = _e.sent();
|
|
251
|
+
if (!validateWalletAddress) {
|
|
252
|
+
alert("Unsupported QR");
|
|
253
|
+
return [2 /*return*/];
|
|
254
|
+
}
|
|
248
255
|
(_d = backDropRef.current) === null || _d === void 0 ? void 0 : _d.close();
|
|
256
|
+
setDialogContent("Unsupported QR, please scan a valid QR code or enter the recipient address manually");
|
|
249
257
|
console.warn("validateWalletAddress", validateWalletAddress);
|
|
258
|
+
// if(validateWalletAddress?.is_current_wallet) {
|
|
259
|
+
// return
|
|
260
|
+
// }
|
|
250
261
|
if (!!(validateWalletAddress === null || validateWalletAddress === void 0 ? void 0 : validateWalletAddress.master_wallet_address)) {
|
|
251
262
|
//internal
|
|
252
263
|
console.warn("internal");
|
|
@@ -313,7 +324,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
313
324
|
placeholder: "Enter memo",
|
|
314
325
|
value: memo,
|
|
315
326
|
onChange: handleChangeMemo,
|
|
316
|
-
} })] }), (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)(
|
|
327
|
+
} })] }), (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: !!dialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: dialogContent, actions: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { children: "Confirm" }) }) })] }) }) }));
|
|
317
328
|
});
|
|
318
329
|
WithdrawFunction.displayName = "WithdrawFunction";
|
|
319
330
|
exports.default = WithdrawFunction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ValidateWalletAddressBody, ValidateWalletAddressData } from "./type";
|
|
2
|
-
declare const validateWalletAddressService: (body: ValidateWalletAddressBody) => Promise<ValidateWalletAddressData>;
|
|
2
|
+
declare const validateWalletAddressService: (body: ValidateWalletAddressBody) => Promise<ValidateWalletAddressData | undefined>;
|
|
3
3
|
export default validateWalletAddressService;
|
|
@@ -41,14 +41,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var userClientRequest_1 = __importDefault(require("../clients/userClientRequest"));
|
|
43
43
|
var validateWalletAddressService = function (body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
-
var response;
|
|
44
|
+
var response, error_1;
|
|
45
45
|
var _a;
|
|
46
46
|
return __generator(this, function (_b) {
|
|
47
47
|
switch (_b.label) {
|
|
48
|
-
case 0:
|
|
48
|
+
case 0:
|
|
49
|
+
_b.trys.push([0, 2, , 3]);
|
|
50
|
+
return [4 /*yield*/, userClientRequest_1.default.get("/crypto/validate-address/".concat(body.network, "?address=").concat(body.address))];
|
|
49
51
|
case 1:
|
|
50
52
|
response = _b.sent();
|
|
51
53
|
return [2 /*return*/, (_a = response.data) === null || _a === void 0 ? void 0 : _a.data];
|
|
54
|
+
case 2:
|
|
55
|
+
error_1 = _b.sent();
|
|
56
|
+
console.error(error_1);
|
|
57
|
+
return [2 /*return*/];
|
|
58
|
+
case 3: return [2 /*return*/];
|
|
52
59
|
}
|
|
53
60
|
});
|
|
54
61
|
}); };
|
package/dist/theme/mui/theme.js
CHANGED
|
@@ -265,6 +265,21 @@ var theme = (0, styles_1.createTheme)({
|
|
|
265
265
|
borderRadius: theBorderRadius.full,
|
|
266
266
|
lineHeight: typography.leading100,
|
|
267
267
|
},
|
|
268
|
+
dialogContent: {
|
|
269
|
+
fontSize: typography.fontSize14,
|
|
270
|
+
lineHeight: typography.leading140,
|
|
271
|
+
color: text.white64,
|
|
272
|
+
},
|
|
273
|
+
dialogActionsOk: {
|
|
274
|
+
fontSize: typography.fontSize14,
|
|
275
|
+
lineHeight: typography.leading140,
|
|
276
|
+
color: "#2482ff",
|
|
277
|
+
},
|
|
278
|
+
dialogActionsCancel: {
|
|
279
|
+
fontSize: typography.fontSize14,
|
|
280
|
+
lineHeight: typography.leading140,
|
|
281
|
+
color: text.white64,
|
|
282
|
+
},
|
|
268
283
|
},
|
|
269
284
|
});
|
|
270
285
|
exports.default = theme;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|