tek-wallet 0.0.714 → 0.0.716
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/IncomeWallet/components/WealthDeposit.d.ts +6 -2
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/WealthDeposit.js +4 -9
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/deposit/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/deposit/index.js +1 -86
- package/dist/components/TekWallet/components/ui/IncomeWallet/components/history/index.js +8 -1
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.d.ts +3 -8
- package/dist/components/TekWallet/components/ui/IncomeWallet/index.js +3 -73
- package/dist/components/TekWallet/types/expose-type.d.ts +0 -1
- package/dist/components/TekWallet/types/expose-type.js +0 -15
- package/package.json +2 -3
- package/dist/components/TekWallet/components/ui/IncomeWallet/zustand/transfer.zus.d.ts +0 -23
- package/dist/components/TekWallet/components/ui/IncomeWallet/zustand/transfer.zus.js +0 -78
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { WealthsUserInfoDto } from "../types";
|
|
1
2
|
interface WealthDepositProps {
|
|
2
3
|
children: React.ReactNode;
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
userInfo?: WealthsUserInfoDto;
|
|
5
|
+
setAmount?: (amount: string) => void;
|
|
6
|
+
amount?: string;
|
|
7
|
+
content?: React.ReactNode;
|
|
8
|
+
footer?: React.ReactNode;
|
|
5
9
|
}
|
|
6
10
|
export default function WealthDeposit(props: WealthDepositProps): import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export type { WealthDepositProps };
|
|
@@ -43,8 +43,6 @@ var DrawerComponent_1 = __importStar(require("../../DrawerComponent"));
|
|
|
43
43
|
var ModalLayout_1 = __importDefault(require("../../ModalLayout"));
|
|
44
44
|
var deposit_1 = __importDefault(require("./deposit"));
|
|
45
45
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
46
|
-
var shallow_1 = require("zustand/react/shallow");
|
|
47
|
-
var transfer_zus_1 = __importDefault(require("../zustand/transfer.zus"));
|
|
48
46
|
var PageHeader_1 = __importDefault(require("../../PageHeader"));
|
|
49
47
|
var useUniqueId_1 = require("../../../../hooks/useUniqueId");
|
|
50
48
|
function WealthDeposit(props) {
|
|
@@ -59,14 +57,11 @@ function WealthDeposit(props) {
|
|
|
59
57
|
};
|
|
60
58
|
var keyboardId = (0, useUniqueId_1.useUniqueId)("confirm-passcode-keyboard");
|
|
61
59
|
var keyboardRef = (0, react_1.useRef)(null);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}); })), setAmount = _a.setAmount, amount = _a.amount;
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: amount, onChange: function (value) {
|
|
67
|
-
setAmount(value);
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onClose: handleOnClose, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { ref: keyboardRef, id: keyboardId, value: props.amount, onChange: function (value) {
|
|
61
|
+
var _a;
|
|
62
|
+
(_a = props === null || props === void 0 ? void 0 : props.setAmount) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
68
63
|
}, keyboardType: xhub_keyboard_1.KeyboardType.Double, layoutType: xhub_keyboard_1.LayoutType.Integer, viewFullHeight: true, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: close, fullScreen: true, backgroundColor: "#fff", overrideHeader: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Topup", overrideBack: handleOnClose, sx: {
|
|
69
64
|
height: "fit-content",
|
|
70
65
|
color: "text.tertiary",
|
|
71
|
-
} }), children: (0, jsx_runtime_1.jsx)(deposit_1.default, {
|
|
66
|
+
} }), children: (0, jsx_runtime_1.jsx)(deposit_1.default, { keyboardId: keyboardId, depositContent: props.content, footer: props.footer }) }) }) }));
|
|
72
67
|
}
|
|
@@ -1,98 +1,13 @@
|
|
|
1
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
-
var ownKeys = function(o) {
|
|
31
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
-
var ar = [];
|
|
33
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
-
return ar;
|
|
35
|
-
};
|
|
36
|
-
return ownKeys(o);
|
|
37
|
-
};
|
|
38
|
-
return function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
})();
|
|
46
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
4
|
};
|
|
49
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
6
|
exports.default = Deposit;
|
|
51
7
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
52
|
-
var shallow_1 = require("zustand/react/shallow");
|
|
53
|
-
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
54
|
-
var Text_1 = __importDefault(require("../../../Text"));
|
|
55
|
-
var transfer_zus_1 = __importDefault(require("../../zustand/transfer.zus"));
|
|
56
|
-
var Column_1 = __importDefault(require("../../../Column"));
|
|
57
|
-
var Spacer_1 = __importDefault(require("../../../Spacer"));
|
|
58
|
-
var Row_1 = __importDefault(require("../../../Row"));
|
|
59
|
-
var Button_1 = __importStar(require("../../../Button"));
|
|
60
8
|
var ChildPageLayout_1 = __importDefault(require("../../../../layouts/ChildPageLayout"));
|
|
61
|
-
var providers_1 = require("../../../../../providers");
|
|
62
|
-
var DepositTitle = function (props) {
|
|
63
|
-
var theme = (0, providers_1.useTheme)();
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(Row_1.default, { className: "flex items-center justify-between", children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.inputLabel), children: props.title }) }));
|
|
65
|
-
};
|
|
66
9
|
function Deposit(props) {
|
|
67
|
-
var _a;
|
|
68
|
-
var theme = (0, providers_1.useTheme)();
|
|
69
|
-
var _b = (0, transfer_zus_1.default)((0, shallow_1.useShallow)(function (state) { return ({
|
|
70
|
-
amount: state.amount,
|
|
71
|
-
amountError: state.amountError,
|
|
72
|
-
allowContinue: state.allowContinue,
|
|
73
|
-
}); })), amount = _b.amount, amountError = _b.amountError, allowContinue = _b.allowContinue;
|
|
74
10
|
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
75
11
|
backgroundColor: "white",
|
|
76
|
-
}, footer:
|
|
77
|
-
width: "calc(100dvw - 2rem)",
|
|
78
|
-
}, status: allowContinue ? Button_1.BUTTON_STATUS.ENABLED : Button_1.BUTTON_STATUS.DISABLED, disabled: !allowContinue, onClick: function () {
|
|
79
|
-
props.onContinue(amount !== null && amount !== void 0 ? amount : "0");
|
|
80
|
-
}, children: "Continue" }), children: (0, jsx_runtime_1.jsxs)(Column_1.default, { children: [(0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "1rem" }), (0, jsx_runtime_1.jsx)(DepositTitle, { title: "Amount" }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { className: "w-full", useBrowserInput: false, htmlFor: (_a = props.keyboardId) !== null && _a !== void 0 ? _a : "", children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Input, { placeholder: "Enter amount", value: amount, displayType: xhub_keyboard_1.DisplayType.Double, styles: {
|
|
81
|
-
container: {
|
|
82
|
-
padding: "0.6rem 1rem",
|
|
83
|
-
borderRadius: "0.5rem",
|
|
84
|
-
fontSize: "0.813rem",
|
|
85
|
-
fontWeight: "medium",
|
|
86
|
-
lineHeight: "140%",
|
|
87
|
-
},
|
|
88
|
-
input: {
|
|
89
|
-
fontSize: "0.813rem",
|
|
90
|
-
fontWeight: "medium",
|
|
91
|
-
lineHeight: "140%",
|
|
92
|
-
},
|
|
93
|
-
}, rightElement: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
94
|
-
color: theme.palette.text.primary,
|
|
95
|
-
fontSize: theme.typography.fontSize13,
|
|
96
|
-
lineHeight: theme.typography.leading140,
|
|
97
|
-
}, children: "WealthS" }), elementsAcceptIds: [props.keyboardId] }) }), amountError && (0, jsx_runtime_1.jsx)(Text_1.default, { className: "text-error", children: amountError })] }) }));
|
|
12
|
+
}, footer: props.footer, children: props.depositContent }));
|
|
98
13
|
}
|
|
@@ -5,8 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = TransactionHistory;
|
|
7
7
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var providers_1 = require("../../../../../providers");
|
|
8
9
|
var Column_1 = __importDefault(require("../../../Column"));
|
|
10
|
+
var Text_1 = __importDefault(require("../../../Text"));
|
|
9
11
|
var HistoryItem_1 = __importDefault(require("../HistoryItem"));
|
|
10
12
|
function TransactionHistory(props) {
|
|
11
|
-
|
|
13
|
+
var theme = (0, providers_1.useTheme)();
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Column_1.default, { children: props.listItem.length > 0 ? (props.listItem.map(function (item) { return (0, jsx_runtime_1.jsx)(HistoryItem_1.default, { tradeHistory: item }, item.id); })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
15
|
+
fontSize: theme.typography.fontSize12,
|
|
16
|
+
fontWeight: theme.typography.fontWeight500,
|
|
17
|
+
color: theme.palette.text.accent2,
|
|
18
|
+
}, children: "No transaction found!" })) }));
|
|
12
19
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { TransactionHistoryDto } from "./types/transaction.history.dto";
|
|
2
|
-
import { WealthsUserInfoDto } from "./types/userinfo.dto";
|
|
3
1
|
interface IncomeWalletProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
deposit: (amount: string) => Promise<any>;
|
|
8
|
-
transactionHistory?: TransactionHistoryDto[];
|
|
9
|
-
userInfo?: WealthsUserInfoDto;
|
|
2
|
+
listItemFunction: React.ReactNode[];
|
|
3
|
+
transactionHistory: React.ReactNode;
|
|
4
|
+
balanceChart: React.ReactNode;
|
|
10
5
|
}
|
|
11
6
|
export declare const IncomeWallet: (props: IncomeWalletProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
7
|
export default IncomeWallet;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
2
|
"use client";
|
|
4
3
|
var __assign = (this && this.__assign) || function () {
|
|
5
4
|
__assign = Object.assign || function(t) {
|
|
@@ -21,25 +20,18 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
21
20
|
var material_1 = require("@mui/material");
|
|
22
21
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
23
22
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
24
|
-
var BalanceChart_1 = __importDefault(require("./components/BalanceChart"));
|
|
25
|
-
var WealthDeposit_1 = __importDefault(require("./components/WealthDeposit"));
|
|
26
23
|
var Text_1 = __importDefault(require("../Text"));
|
|
27
|
-
var SvgPath_1 = require("../SvgPath");
|
|
28
|
-
var FunctionItem_1 = __importDefault(require("./components/FunctionItem"));
|
|
29
|
-
var WealthWithdraw_1 = __importDefault(require("./components/WealthWithdraw"));
|
|
30
|
-
var history_1 = __importDefault(require("./components/history"));
|
|
31
24
|
var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
|
|
32
25
|
var PageHeader_1 = __importDefault(require("../PageHeader"));
|
|
33
26
|
var Column_1 = __importDefault(require("../Column"));
|
|
34
27
|
var Spacer_1 = __importDefault(require("../Spacer"));
|
|
35
28
|
var IncomeWallet = function (props) {
|
|
36
|
-
var _a;
|
|
37
29
|
var isInitPasscode = (0, useWalletData_1.default)().isInitPasscode;
|
|
38
30
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
39
31
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isInitPasscode && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isInitPasscode && ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, __assign({}, props, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "WealthS" }), children: (0, jsx_runtime_1.jsxs)(Column_1.default, { sx: {
|
|
40
32
|
paddingLeft: theme.mixins.customPadding.p16,
|
|
41
33
|
paddingRight: theme.mixins.customPadding.p16,
|
|
42
|
-
}, children: [
|
|
34
|
+
}, children: [props.balanceChart, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
43
35
|
display: "grid",
|
|
44
36
|
gridTemplateColumns: "repeat(4, 1fr)",
|
|
45
37
|
gap: theme.mixins.gaps.g12,
|
|
@@ -54,75 +46,13 @@ var IncomeWallet = function (props) {
|
|
|
54
46
|
color: theme.palette.text.primary,
|
|
55
47
|
fontWeight: theme.typography.fontWeight600,
|
|
56
48
|
},
|
|
57
|
-
}, children:
|
|
58
|
-
props.deposit(amount);
|
|
59
|
-
}, children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
|
|
60
|
-
borderRight: "1px solid ".concat(theme.palette.border.accent3),
|
|
61
|
-
placeContent: "center",
|
|
62
|
-
columnSpan: 1,
|
|
63
|
-
}, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: SvgPath_1.IC_DEPOSIT, width: 30, height: 30, label: "Topup", sx: {
|
|
64
|
-
width: "100%",
|
|
65
|
-
} }) }) }), (0, jsx_runtime_1.jsx)(WealthWithdraw_1.default, { onContinue: function (amount) {
|
|
66
|
-
props.deposit(amount);
|
|
67
|
-
}, children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { sx: {
|
|
68
|
-
borderRight: "1px solid ".concat(theme.palette.border.accent3),
|
|
69
|
-
placeContent: "center",
|
|
70
|
-
columnSpan: 1,
|
|
71
|
-
}, children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: SvgPath_1.IC_WITHDRAW, width: 30, height: 30, label: "Withdraw", sx: {
|
|
72
|
-
width: "100%",
|
|
73
|
-
} }) }) })] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
49
|
+
}, children: props.listItemFunction.map(function (item) { return item; }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
74
50
|
fontWeight: theme.typography.fontWeight700,
|
|
75
51
|
leading: theme.typography.leading140,
|
|
76
52
|
fontSize: theme.typography.fontSize18,
|
|
77
53
|
textTransform: "capitalize",
|
|
78
54
|
color: theme.palette.text.primary,
|
|
79
|
-
}, children: "History" }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }),
|
|
80
|
-
{
|
|
81
|
-
id: 1,
|
|
82
|
-
merchantCode: "Merchant 1",
|
|
83
|
-
destinationAccount: "1234567890",
|
|
84
|
-
sourceAccount: "1234567890",
|
|
85
|
-
amount: 100,
|
|
86
|
-
createTime: "2021-01-01",
|
|
87
|
-
inOut: "in",
|
|
88
|
-
content: "Merchant 1 transfer to Merchant 2",
|
|
89
|
-
tradeType: "tradeType 1",
|
|
90
|
-
itemCode: "itemCode 1",
|
|
91
|
-
request: "request 1",
|
|
92
|
-
syncDip: 1,
|
|
93
|
-
status: 1,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 2,
|
|
97
|
-
merchantCode: "Merchant 2",
|
|
98
|
-
destinationAccount: "1234567890",
|
|
99
|
-
sourceAccount: "1234567890",
|
|
100
|
-
amount: 200,
|
|
101
|
-
createTime: "2021-01-01",
|
|
102
|
-
inOut: "out",
|
|
103
|
-
content: "Merchant 2 transfer to Merchant 3",
|
|
104
|
-
tradeType: "tradeType 2",
|
|
105
|
-
itemCode: "itemCode 2",
|
|
106
|
-
request: "request 2",
|
|
107
|
-
syncDip: 2,
|
|
108
|
-
status: 2,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: 3,
|
|
112
|
-
merchantCode: "Merchant 3",
|
|
113
|
-
destinationAccount: "1234567890",
|
|
114
|
-
sourceAccount: "1234567890",
|
|
115
|
-
amount: 300,
|
|
116
|
-
createTime: "2021-01-01",
|
|
117
|
-
inOut: "in",
|
|
118
|
-
content: "Merchant 3 transfer to Merchant 1",
|
|
119
|
-
tradeType: "tradeType 3",
|
|
120
|
-
itemCode: "itemCode 3",
|
|
121
|
-
request: "request 3",
|
|
122
|
-
syncDip: 3,
|
|
123
|
-
status: 3,
|
|
124
|
-
},
|
|
125
|
-
] })] }) })))] }));
|
|
55
|
+
}, children: "History" }), (0, jsx_runtime_1.jsx)(Spacer_1.default, { value: "0.25rem" }), props.transactionHistory] }) })))] }));
|
|
126
56
|
};
|
|
127
57
|
exports.IncomeWallet = IncomeWallet;
|
|
128
58
|
exports.default = exports.IncomeWallet;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.REFRESH_TOKEN_STATUS = exports.LoginMessage = void 0;
|
|
18
4
|
// 1. Enums
|
|
@@ -29,4 +15,3 @@ var REFRESH_TOKEN_STATUS;
|
|
|
29
15
|
REFRESH_TOKEN_STATUS["FAILED"] = "Refresh token is failed";
|
|
30
16
|
REFRESH_TOKEN_STATUS["SUCCESS"] = "Refresh token is successfully";
|
|
31
17
|
})(REFRESH_TOKEN_STATUS || (exports.REFRESH_TOKEN_STATUS = REFRESH_TOKEN_STATUS = {}));
|
|
32
|
-
__exportStar(require("../components/ui/IncomeWallet/types"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tek-wallet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.716",
|
|
4
4
|
"description": "A custom React provider with TypeScript support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -61,8 +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.22"
|
|
65
|
-
"zustand": "^5.0.4"
|
|
64
|
+
"xhub-keyboard": "^0.0.22"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
67
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare enum AmountError {
|
|
2
|
-
INSUFFICIENT_BALANCE = "\u24D8 Insufficient transaction fee!",
|
|
3
|
-
MAX_LIMIT = "\u24D8 Enter a maximum amount of",
|
|
4
|
-
MIN_LIMIT = "\u24D8 Enter a minimum amount of"
|
|
5
|
-
}
|
|
6
|
-
type TransferState = {
|
|
7
|
-
amount: string | undefined;
|
|
8
|
-
message: string | undefined;
|
|
9
|
-
allowContinue: boolean;
|
|
10
|
-
amountError: string | null;
|
|
11
|
-
autoAllowContinue: boolean;
|
|
12
|
-
continueBtnRef: React.RefObject<HTMLButtonElement | null> | null;
|
|
13
|
-
setLatestTransactionId: (id: string | null) => void;
|
|
14
|
-
setAmount: (amount: string) => void;
|
|
15
|
-
setMessage: (message: string) => void;
|
|
16
|
-
setAmountError: (error: string | null) => void;
|
|
17
|
-
checkIfAllValid: () => void;
|
|
18
|
-
reset: () => void;
|
|
19
|
-
setAutoAllowContinue: (value: boolean) => void;
|
|
20
|
-
setContinueBtnRef: (ref: React.RefObject<HTMLButtonElement | null>) => void;
|
|
21
|
-
};
|
|
22
|
-
declare const useTransferState: import("zustand").UseBoundStore<import("zustand").StoreApi<TransferState>>;
|
|
23
|
-
export default useTransferState;
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AmountError = void 0;
|
|
15
|
-
var zustand_1 = require("zustand");
|
|
16
|
-
var AmountError;
|
|
17
|
-
(function (AmountError) {
|
|
18
|
-
AmountError["INSUFFICIENT_BALANCE"] = "\u24D8 Insufficient transaction fee!";
|
|
19
|
-
AmountError["MAX_LIMIT"] = "\u24D8 Enter a maximum amount of";
|
|
20
|
-
AmountError["MIN_LIMIT"] = "\u24D8 Enter a minimum amount of";
|
|
21
|
-
})(AmountError || (exports.AmountError = AmountError = {}));
|
|
22
|
-
var initialState = {
|
|
23
|
-
amount: undefined, //undefined ,
|
|
24
|
-
message: undefined,
|
|
25
|
-
allowContinue: false,
|
|
26
|
-
amountError: null,
|
|
27
|
-
autoAllowContinue: false,
|
|
28
|
-
continueBtnRef: null,
|
|
29
|
-
setLatestTransactionId: function () { },
|
|
30
|
-
setAmount: function () { },
|
|
31
|
-
setMessage: function () { },
|
|
32
|
-
setAmountError: function () { },
|
|
33
|
-
checkIfAllValid: function () { return false; },
|
|
34
|
-
setAutoAllowContinue: function () { },
|
|
35
|
-
setContinueBtnRef: function () { },
|
|
36
|
-
reset: function () { },
|
|
37
|
-
};
|
|
38
|
-
var useTransferState = (0, zustand_1.create)(function (set, get) { return (__assign(__assign({}, initialState), { setAmount: function (amount) {
|
|
39
|
-
set({ amount: amount });
|
|
40
|
-
// if (amount && balance) {
|
|
41
|
-
// if (Number(amount) > Number(balance)) {
|
|
42
|
-
// set({ amountError: `${AmountError.MAX_LIMIT} ${balance}` });
|
|
43
|
-
// } else if (Number(amount) <= 0) {
|
|
44
|
-
// set({ amountError: `${AmountError.MIN_LIMIT} ${balance}` });
|
|
45
|
-
// } else {
|
|
46
|
-
// set({ amountError: null });
|
|
47
|
-
// }
|
|
48
|
-
// }
|
|
49
|
-
get().checkIfAllValid();
|
|
50
|
-
}, setMessage: function (message) {
|
|
51
|
-
set({ message: message });
|
|
52
|
-
}, checkIfAllValid: function () {
|
|
53
|
-
var _a = get(), amount = _a.amount, amountError = _a.amountError;
|
|
54
|
-
set({
|
|
55
|
-
allowContinue: !!amount && !amountError,
|
|
56
|
-
});
|
|
57
|
-
}, setAutoAllowContinue: function (value) {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
if (value === get().autoAllowContinue) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (value) {
|
|
63
|
-
(_b = (_a = get().continueBtnRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.click();
|
|
64
|
-
}
|
|
65
|
-
set({ autoAllowContinue: value });
|
|
66
|
-
}, setContinueBtnRef: function (ref) {
|
|
67
|
-
set({ continueBtnRef: ref });
|
|
68
|
-
}, reset: function () {
|
|
69
|
-
set({
|
|
70
|
-
amount: undefined, //undefined ,
|
|
71
|
-
message: undefined,
|
|
72
|
-
allowContinue: false,
|
|
73
|
-
amountError: null,
|
|
74
|
-
autoAllowContinue: false,
|
|
75
|
-
continueBtnRef: null,
|
|
76
|
-
});
|
|
77
|
-
} })); });
|
|
78
|
-
exports.default = useTransferState;
|