tek-wallet 0.0.230 → 0.0.232
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/Input/index.d.ts +10 -0
- package/dist/components/ui/Input/index.js +34 -0
- package/dist/components/ui/WithdrawFunction/index.d.ts +1 -1
- package/dist/components/ui/WithdrawFunction/index.js +10 -30
- package/dist/providers/TekWalletProvider/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface InputProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
inputRest?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
4
|
+
inputStyles?: React.CSSProperties;
|
|
5
|
+
leftPart?: React.ReactNode;
|
|
6
|
+
rightPart?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type InputRef = HTMLInputElement;
|
|
9
|
+
declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default Input;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 Input = (0, react_1.forwardRef)(function (props, inputRef) {
|
|
29
|
+
var inputRest = props.inputRest, inputClassName = props.inputStyles, leftPart = props.leftPart, rightPart = props.rightPart, rest = __rest(props, ["inputRest", "inputStyles", "leftPart", "rightPart"]);
|
|
30
|
+
var theme = (0, material_1.useTheme)();
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ ref: inputRef, sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, borderRadius: theme.mixins.theBorderRadius.r12, padding: theme.mixins.customPadding.p3, backgroundColor: "background.white16" }) }, rest, { children: [leftPart, (0, jsx_runtime_1.jsx)("input", __assign({}, inputRest, { style: __assign({ backgroundColor: "transparent", border: "none", outline: "none", fontSize: theme.typography.fontSize16, lineHeight: theme.typography.leading140, fontWeight: theme.typography.fontWeight400, color: theme.palette.text.white }, inputClassName) })), rightPart] })));
|
|
32
|
+
});
|
|
33
|
+
Input.displayName = "Input";
|
|
34
|
+
exports.default = Input;
|
|
@@ -17,7 +17,7 @@ export declare enum WithdrawStep {
|
|
|
17
17
|
SELECT_METHOD = 1,
|
|
18
18
|
SELECT_TOKEN = 2,
|
|
19
19
|
SELECT_NETWORK = 3,
|
|
20
|
-
|
|
20
|
+
CONFIRM = 4
|
|
21
21
|
}
|
|
22
22
|
declare const WithdrawFunction: import("react").ForwardRefExoticComponent<WithdrawFunctionProps & import("react").RefAttributes<WithdrawFunctionRef>>;
|
|
23
23
|
export default WithdrawFunction;
|
|
@@ -25,20 +25,18 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
|
25
25
|
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
26
26
|
var react_2 = require("swiper/react");
|
|
27
27
|
var BackHeader_1 = __importDefault(require("../BackHeader"));
|
|
28
|
-
var QRCode_1 = __importDefault(require("../QRCode"));
|
|
29
28
|
var Text_1 = __importDefault(require("../Text"));
|
|
30
29
|
var material_1 = require("@mui/material");
|
|
31
|
-
var CopyTextComponent_1 = __importDefault(require("../CopyTextComponent"));
|
|
32
30
|
var Button_1 = __importDefault(require("../Button"));
|
|
33
31
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
34
32
|
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
35
|
-
var Share_1 = __importDefault(require("../Share"));
|
|
36
33
|
var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
|
|
37
34
|
var TokenSelection_1 = __importDefault(require("../TokenSelection"));
|
|
38
35
|
var CloseModal_1 = __importDefault(require("../CloseModal"));
|
|
39
36
|
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
40
37
|
var useWithdrawData_1 = __importDefault(require("../../../hooks/useWithdrawData"));
|
|
41
38
|
var ListItemCustom_1 = __importDefault(require("../ListItemCustom"));
|
|
39
|
+
var Input_1 = __importDefault(require("../Input"));
|
|
42
40
|
var SendMethods;
|
|
43
41
|
(function (SendMethods) {
|
|
44
42
|
SendMethods["SCAN_QR_CODE"] = "scan qr code";
|
|
@@ -50,13 +48,13 @@ var WithdrawStep;
|
|
|
50
48
|
WithdrawStep[WithdrawStep["SELECT_METHOD"] = 1] = "SELECT_METHOD";
|
|
51
49
|
WithdrawStep[WithdrawStep["SELECT_TOKEN"] = 2] = "SELECT_TOKEN";
|
|
52
50
|
WithdrawStep[WithdrawStep["SELECT_NETWORK"] = 3] = "SELECT_NETWORK";
|
|
53
|
-
WithdrawStep[WithdrawStep["
|
|
51
|
+
WithdrawStep[WithdrawStep["CONFIRM"] = 4] = "CONFIRM";
|
|
54
52
|
})(WithdrawStep || (exports.WithdrawStep = WithdrawStep = {}));
|
|
55
53
|
var WITHDRAW_STEP_NAME = (_a = {},
|
|
56
54
|
_a[WithdrawStep.SELECT_METHOD] = "Select method",
|
|
57
55
|
_a[WithdrawStep.SELECT_TOKEN] = "Select token",
|
|
58
56
|
_a[WithdrawStep.SELECT_NETWORK] = "Select network",
|
|
59
|
-
_a[WithdrawStep.
|
|
57
|
+
_a[WithdrawStep.CONFIRM] = "Confirm",
|
|
60
58
|
_a);
|
|
61
59
|
var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
62
60
|
var drawerRef = (0, react_1.useRef)(null);
|
|
@@ -153,31 +151,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
153
151
|
if (!item)
|
|
154
152
|
return null;
|
|
155
153
|
return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify(item), active: (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.id) === item.id }, item.id));
|
|
156
|
-
}) }) }, WithdrawStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
alignSelf: "center",
|
|
164
|
-
borderRadius: theme.mixins.theBorderRadius.r12,
|
|
165
|
-
overflow: "hidden",
|
|
166
|
-
backgroundColor: theme.palette.background.white,
|
|
167
|
-
backdropFilter: "blur(10px)",
|
|
168
|
-
}, children: (0, jsx_runtime_1.jsx)(QRCode_1.default, { value: "qrCodeValue", title: "Deposit ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name), logo: (0, getIcon_1.default)("ton"), bgColor: "transparent" }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "button", sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2, cursor: "pointer", transition: "transform 0.3s ease-in-out", "&:active": {
|
|
169
|
-
transform: "translateX(0.5rem)",
|
|
170
|
-
} }), onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("right_arrow"), width: 10 })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, color: "text.white" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "Address" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.theBorderRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: ["Deposit", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.text.white }, children: ["min ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.text.white }, children: "select the correct network" }), ", or you will lose your assets."] }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: "qrCodeValue", children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { className: "gap-1.5 flex items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
171
|
-
fontSize: theme.typography.fontSize12,
|
|
172
|
-
fontWeight: theme.typography.fontWeight400,
|
|
173
|
-
leading: "typography.leading150",
|
|
174
|
-
textTransform: "capitalize",
|
|
175
|
-
}, children: "Copy" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copy"), width: 20 })] }) }), (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-deposit-info", children: (0, jsx_runtime_1.jsxs)(Button_1.default.Secondary, { sx: __assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
176
|
-
fontSize: theme.typography.fontSize12,
|
|
177
|
-
fontWeight: theme.typography.fontWeight400,
|
|
178
|
-
leading: "typography.leading150",
|
|
179
|
-
textTransform: "capitalize",
|
|
180
|
-
}, children: "Share" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("share"), width: 20 })] }) })] })] }) }, WithdrawStep.SHOW_QR_CODE)] }, withdrawTokens === null || withdrawTokens === void 0 ? void 0 : withdrawTokens.length) }) }) }));
|
|
154
|
+
}) }) }, WithdrawStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { 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)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Recipient address" }), (0, jsx_runtime_1.jsx)(Input_1.default, { inputRest: {
|
|
155
|
+
placeholder: "Enter recipient address",
|
|
156
|
+
}, rightPart: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { children: "Paste" }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("qr_can"), width: 20 })] }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Select network" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name })] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Enter amount" }), (0, jsx_runtime_1.jsx)(Input_1.default, { inputRest: {
|
|
157
|
+
placeholder: "".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value, " - ").concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value),
|
|
158
|
+
}, rightPart: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { children: "Max" }) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Memo" }), (0, jsx_runtime_1.jsx)(Input_1.default, { inputRest: {
|
|
159
|
+
placeholder: "Enter memo",
|
|
160
|
+
} }), (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) }) }) }));
|
|
181
161
|
});
|
|
182
162
|
WithdrawFunction.displayName = "WithdrawFunction";
|
|
183
163
|
exports.default = WithdrawFunction;
|
|
@@ -9,8 +9,9 @@ var WalletDataProvider_1 = __importDefault(require("../WalletDataProvider"));
|
|
|
9
9
|
var mui_1 = __importDefault(require("../../theme/mui"));
|
|
10
10
|
var DepositProvider_1 = __importDefault(require("../DepositProvider"));
|
|
11
11
|
var LockTokenProvider_1 = __importDefault(require("../LockTokenProvider"));
|
|
12
|
+
var WithdrawProvider_1 = __importDefault(require("../WithdrawProvider"));
|
|
12
13
|
function TekWalletProvider(_a) {
|
|
13
14
|
var children = _a.children;
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(WalletDataProvider_1.default, { children: (0, jsx_runtime_1.jsx)(DepositProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(mui_1.default, { children: children }) }) }) }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(WalletDataProvider_1.default, { children: (0, jsx_runtime_1.jsx)(DepositProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(mui_1.default, { children: children }) }) }) }) }));
|
|
15
16
|
}
|
|
16
17
|
exports.default = TekWalletProvider;
|