tek-wallet 0.0.240 → 0.0.242
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.
|
@@ -14,10 +14,10 @@ export declare enum SendMethods {
|
|
|
14
14
|
TRANSFER_EXTERNAL = "transfer external"
|
|
15
15
|
}
|
|
16
16
|
export declare enum WithdrawStep {
|
|
17
|
-
SELECT_METHOD =
|
|
18
|
-
SELECT_TOKEN =
|
|
19
|
-
SELECT_NETWORK =
|
|
20
|
-
CONFIRM =
|
|
17
|
+
SELECT_METHOD = 0,
|
|
18
|
+
SELECT_TOKEN = 1,
|
|
19
|
+
SELECT_NETWORK = 2,
|
|
20
|
+
CONFIRM = 3
|
|
21
21
|
}
|
|
22
22
|
declare const WithdrawFunction: import("react").ForwardRefExoticComponent<WithdrawFunctionProps & import("react").RefAttributes<WithdrawFunctionRef>>;
|
|
23
23
|
export default WithdrawFunction;
|
|
@@ -45,10 +45,10 @@ var SendMethods;
|
|
|
45
45
|
})(SendMethods || (exports.SendMethods = SendMethods = {}));
|
|
46
46
|
var WithdrawStep;
|
|
47
47
|
(function (WithdrawStep) {
|
|
48
|
-
WithdrawStep[WithdrawStep["SELECT_METHOD"] =
|
|
49
|
-
WithdrawStep[WithdrawStep["SELECT_TOKEN"] =
|
|
50
|
-
WithdrawStep[WithdrawStep["SELECT_NETWORK"] =
|
|
51
|
-
WithdrawStep[WithdrawStep["CONFIRM"] =
|
|
48
|
+
WithdrawStep[WithdrawStep["SELECT_METHOD"] = 0] = "SELECT_METHOD";
|
|
49
|
+
WithdrawStep[WithdrawStep["SELECT_TOKEN"] = 1] = "SELECT_TOKEN";
|
|
50
|
+
WithdrawStep[WithdrawStep["SELECT_NETWORK"] = 2] = "SELECT_NETWORK";
|
|
51
|
+
WithdrawStep[WithdrawStep["CONFIRM"] = 3] = "CONFIRM";
|
|
52
52
|
})(WithdrawStep || (exports.WithdrawStep = WithdrawStep = {}));
|
|
53
53
|
var WITHDRAW_STEP_NAME = (_a = {},
|
|
54
54
|
_a[WithdrawStep.SELECT_METHOD] = "Select method",
|
|
@@ -107,6 +107,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
107
107
|
setCurrentStep(step);
|
|
108
108
|
(_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
|
|
109
109
|
};
|
|
110
|
+
var handleReSelectNetwork = function () {
|
|
111
|
+
gotoStep(WithdrawStep.SELECT_NETWORK);
|
|
112
|
+
};
|
|
110
113
|
var clearValues = function () {
|
|
111
114
|
setSelectedToken(undefined);
|
|
112
115
|
setSelectedNetwork(undefined);
|
|
@@ -168,7 +171,9 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
168
171
|
alignItems: "center",
|
|
169
172
|
minHeight: "2rem",
|
|
170
173
|
mb: theme.mixins.customMargin.m20,
|
|
171
|
-
}, overrideBack: handleBack, hideBack: currentStep === WithdrawStep.SELECT_METHOD, center:
|
|
174
|
+
}, overrideBack: handleBack, hideBack: currentStep === WithdrawStep.SELECT_METHOD, center: currentStep == WithdrawStep.CONFIRM
|
|
175
|
+
? "Confirm withdrawn ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name)
|
|
176
|
+
: WITHDRAW_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
|
|
172
177
|
autoHeight: true,
|
|
173
178
|
spaceBetween: 32,
|
|
174
179
|
}, disableSwipe: true, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: Object.values(SendMethods).map(function (item) {
|
|
@@ -182,11 +187,15 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
182
187
|
if (!item)
|
|
183
188
|
return null;
|
|
184
189
|
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));
|
|
185
|
-
}) }) }, 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.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8 }), 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, {
|
|
190
|
+
}) }) }, 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.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8 }), 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, { sx: {
|
|
191
|
+
paddingRight: theme.mixins.customPadding.p12,
|
|
192
|
+
}, inputRest: {
|
|
186
193
|
placeholder: "Enter recipient address",
|
|
187
194
|
value: recipientAddress,
|
|
188
195
|
onChange: handleChangeRecipientAddress,
|
|
189
|
-
}, rightPart: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { sx: __assign({}, theme.mixins.smallButton), 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: "
|
|
196
|
+
}, rightPart: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { sx: __assign({}, theme.mixins.smallButton), children: "Paste" }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", sx: { height: "90%" } }), (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: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto", cursor: "pointer" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), onClick: handleReSelectNetwork, children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 10, src: (0, getIcon_1.default)("right_arrow") })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Enter amount" }), (0, jsx_runtime_1.jsx)(Input_1.default, { sx: {
|
|
197
|
+
paddingRight: theme.mixins.customPadding.p12,
|
|
198
|
+
}, inputRest: {
|
|
190
199
|
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),
|
|
191
200
|
value: amount,
|
|
192
201
|
onChange: handleChangeAmount,
|