tek-wallet 0.0.672 → 0.0.674
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/TekWallet/components/ui/ConfirmByPasscode/index.js +5 -3
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +4 -2
- package/dist/components/TekWallet/components/ui/RequireConnect/index.js +2 -3
- package/dist/components/TekWallet/hooks/useEventHandler.js +1 -0
- package/dist/components/TekWallet/hooks/useUniqueId.d.ts +1 -0
- package/dist/components/TekWallet/hooks/useUniqueId.js +10 -0
- package/dist/components/TekWallet/services/axios/get-lock-tokens-list-service/index.js +1 -1
- package/package.json +2 -2
|
@@ -95,6 +95,7 @@ var LoadingLayout_1 = __importDefault(require("../LoadingLayout"));
|
|
|
95
95
|
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
96
96
|
var authentication_by_passcode_service_1 = __importDefault(require("../../../services/axios/authentication-by-passcode-service"));
|
|
97
97
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
98
|
+
var useUniqueId_1 = require("../../../hooks/useUniqueId");
|
|
98
99
|
var handleVerifyPasscode = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
100
|
var response, err_1;
|
|
100
101
|
return __generator(this, function (_a) {
|
|
@@ -120,6 +121,7 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
120
121
|
var _a = (0, react_1.useState)(""), otp = _a[0], setOtp = _a[1];
|
|
121
122
|
var loadingRef = (0, react_1.useRef)(null);
|
|
122
123
|
var _b = (0, react_1.useState)(""), authError = _b[0], setAuthError = _b[1];
|
|
124
|
+
var keyboardId = (0, useUniqueId_1.useUniqueId)("confirm-passcode-keyboard");
|
|
123
125
|
var drawerRef = (0, react_1.useRef)(null);
|
|
124
126
|
var handleCleardata = function () {
|
|
125
127
|
setOtp("");
|
|
@@ -197,18 +199,18 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
197
199
|
}); };
|
|
198
200
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
|
|
199
201
|
width: "100%",
|
|
200
|
-
}, useBrowserInput: false, htmlFor:
|
|
202
|
+
}, useBrowserInput: false, htmlFor: keyboardId, children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, sx: {
|
|
201
203
|
width: "100%",
|
|
202
204
|
maxWidth: "calc(100dvw - 2rem)",
|
|
203
205
|
display: "flex",
|
|
204
|
-
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id:
|
|
206
|
+
}, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, value: otp, onChange: handlePasscodeChange, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
|
|
205
207
|
backgroundColor: "transparent",
|
|
206
208
|
width: "100%",
|
|
207
209
|
}, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Enter Passcode", onClose: handleClose, sx: {
|
|
208
210
|
backgroundColor: theme.palette.background.tertiary,
|
|
209
211
|
}, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "0.75rem", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
|
|
210
212
|
width: "100%",
|
|
211
|
-
}, useBrowserInput: false, htmlFor:
|
|
213
|
+
}, useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handlePasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }) }));
|
|
212
214
|
});
|
|
213
215
|
ConfirmByPasscode.displayName = "ConfirmByPasscode";
|
|
214
216
|
exports.default = ConfirmByPasscode;
|
|
@@ -86,7 +86,7 @@ var DrawerComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
86
86
|
setIsShowDrawerComponent(true);
|
|
87
87
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
|
|
88
88
|
};
|
|
89
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ display: "
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({ display: "block" }, sx), className: className, onClick: toggle, children: trigger }), (0, jsx_runtime_1.jsx)(DrawerComponent, __assign({}, rest, { sx: {
|
|
90
90
|
"& .MuiDrawer-paper": {
|
|
91
91
|
backgroundColor: "transparent",
|
|
92
92
|
overflow: "hidden",
|
|
@@ -85,6 +85,7 @@ var sort_utils_1 = require("../../../utils/sort.utils");
|
|
|
85
85
|
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
86
86
|
var BottomActionLayout_1 = __importDefault(require("../BottomActionLayout"));
|
|
87
87
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
88
|
+
var useUniqueId_1 = require("../../../hooks/useUniqueId");
|
|
88
89
|
var ReceiveMethods;
|
|
89
90
|
(function (ReceiveMethods) {
|
|
90
91
|
ReceiveMethods["RECEIVE_INTERNAL"] = "Receive internally";
|
|
@@ -121,6 +122,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
121
122
|
var _h = (0, react_1.useState)(""), inputAmount = _h[0], setInputAmount = _h[1];
|
|
122
123
|
var _j = (0, react_1.useState)(""), amount = _j[0], setAmount = _j[1];
|
|
123
124
|
var _k = (0, react_1.useState)(""), amountError = _k[0], setAmountError = _k[1];
|
|
125
|
+
var keyboardId = (0, useUniqueId_1.useUniqueId)("receive-function-keyboard");
|
|
124
126
|
// const [receiveTokens, setReceiveTokens] = useState<ReceiveTokenType[]>([]);
|
|
125
127
|
var _l = (0, useReceiveData_1.default)(), receiveExternalTokens = _l.receiveExternalTokens, updateReceiveExternalToken = _l.updateReceiveExternalToken, receiveInternalTokens = _l.receiveInternalTokens, updateReceiveInternalToken = _l.updateReceiveInternalToken;
|
|
126
128
|
var receiveTokens = (0, react_1.useMemo)(function () {
|
|
@@ -387,11 +389,11 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
387
389
|
width: "100%",
|
|
388
390
|
display: "flex",
|
|
389
391
|
justifyContent: "center",
|
|
390
|
-
}, onOpen: handleAmountModalOpen, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor:
|
|
392
|
+
}, onOpen: handleAmountModalOpen, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
|
|
391
393
|
fontSize: theme.typography.fontSize14,
|
|
392
394
|
textTransform: "none",
|
|
393
395
|
fontWeight: theme.typography.fontWeight500,
|
|
394
|
-
}, children: [amount ? "Edit" : "+ Set", " amount"] }) }), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id:
|
|
396
|
+
}, children: [amount ? "Edit" : "+ Set", " amount"] }) }), children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, onChange: handleChangeAmount, keyboardType: xhub_keyboard_1.KeyboardType.Double, value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), keyboardId: "amount-keyboard-id", children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: function () { var _a; return (_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close(); }, title: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: [amount ? "Edit" : "Set", " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name, " amount"] }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { ref: amountInputRef, elementsAcceptIds: ["amount-keyboard-id"], value: inputAmount === null || inputAmount === void 0 ? void 0 : inputAmount.toString(), displayType: xhub_keyboard_1.DisplayType.Double, rightElement: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: handleClickMaxAmount, sx: __assign({}, theme.mixins.smallButton), children: "Max" }) }) }), amountError && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: amountError }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { width: "100%", mt: theme.mixins.customMargin.m8, gap: theme.mixins.gaps.g12 }), children: [!!amount && (0, jsx_runtime_1.jsx)(Button_1.default.Text, { onClick: handleUnset, children: "Unset" }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { flex: 1 }, onClick: handleContinue, status: !!amountError ? Button_1.BUTTON_STATUS.DISABLED : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] })] }) }) }) })] }) }, "slide_step_".concat(ReceiveStep.SHOW_QR_CODE))] }) }) }) }) }) }) }));
|
|
395
397
|
});
|
|
396
398
|
exports.ReceiveFunction.displayName = "ReceiveFunction";
|
|
397
399
|
exports.default = exports.ReceiveFunction;
|
|
@@ -51,7 +51,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
51
51
|
exports.RequireConnect = RequireConnect;
|
|
52
52
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
53
53
|
var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
|
|
54
|
-
var uuid_1 = require("uuid");
|
|
55
54
|
var AuthView_1 = __importDefault(require("../../views/AuthView"));
|
|
56
55
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
57
56
|
var react_1 = require("react");
|
|
@@ -59,13 +58,13 @@ var material_1 = require("@mui/material");
|
|
|
59
58
|
var AuthViewSignIn_1 = __importDefault(require("../../views/AuthViewSignIn"));
|
|
60
59
|
var ChangePasscodeView_1 = __importDefault(require("../../views/ChangePasscodeView"));
|
|
61
60
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
61
|
+
var useUniqueId_1 = require("../../../hooks/useUniqueId");
|
|
62
62
|
function RequireConnect(_a) {
|
|
63
63
|
var children = _a.children, signIn = _a.signIn, component = _a.component, sx = _a.sx;
|
|
64
64
|
var authViewRef = (0, react_1.useRef)(null);
|
|
65
65
|
var initPasscodeRef = (0, react_1.useRef)(null);
|
|
66
66
|
var _b = (0, useWalletData_1.default)(), isInitPasscode = _b.isInitPasscode, isSSO = _b.isSSO, isAuthenticated = _b.isAuthenticated;
|
|
67
|
-
var
|
|
68
|
-
var idPrefix = idPrefixRef.current;
|
|
67
|
+
var idPrefix = (0, useUniqueId_1.useUniqueId)();
|
|
69
68
|
var backAuthView = function () {
|
|
70
69
|
var _a;
|
|
71
70
|
(_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
@@ -41,6 +41,7 @@ var useEventHandler = function () {
|
|
|
41
41
|
showActivities === null || showActivities === void 0 ? void 0 : showActivities();
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
|
+
updateWalletDetail();
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
47
|
}, [updateActivities, updateWalletDetail, updateWithdrawToken, updateSendInternalToken]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useUniqueId: (name?: string) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUniqueId = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var uuid_1 = require("uuid");
|
|
6
|
+
var useUniqueId = function (name) {
|
|
7
|
+
var id = (0, react_1.useRef)((0, uuid_1.v4)());
|
|
8
|
+
return name ? "".concat(id.current, "-").concat(name) : id.current;
|
|
9
|
+
};
|
|
10
|
+
exports.useUniqueId = useUniqueId;
|
|
@@ -57,7 +57,7 @@ var getLockTokenList = function (query) { return __awaiter(void 0, void 0, void
|
|
|
57
57
|
return __generator(this, function (_a) {
|
|
58
58
|
switch (_a.label) {
|
|
59
59
|
case 0:
|
|
60
|
-
params = __assign(__assign({}, query), { transactionType: type_1.TransactionSlug.
|
|
60
|
+
params = __assign(__assign({}, query), { transactionType: type_1.TransactionSlug.LockedBalances });
|
|
61
61
|
return [4 /*yield*/, (0, get_config_tokens_list_service_1.default)(params)];
|
|
62
62
|
case 1:
|
|
63
63
|
response = _a.sent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tek-wallet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.674",
|
|
4
4
|
"description": "A custom React provider with TypeScript support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"ton-core": "^0.53.0",
|
|
62
62
|
"ton-crypto": "^3.2.0",
|
|
63
63
|
"uuid": "^11.1.0",
|
|
64
|
-
"xhub-keyboard": "^0.0.
|
|
64
|
+
"xhub-keyboard": "^0.0.20"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|