tek-wallet 0.0.532 → 0.0.534
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/layouts/DefaultPageLayout/index.d.ts +2 -2
- package/dist/components/ui/AnalyticGroup/index.js +1 -0
- package/dist/components/ui/SendExternalToken/index.js +8 -8
- package/dist/components/ui/SwapToken/index.js +6 -6
- package/dist/components/views/AssetView/index.d.ts +2 -1
- package/dist/components/views/AssetView/index.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface DefaultPageLayoutProps extends
|
|
1
|
+
import { BoxProps } from "@mui/material";
|
|
2
|
+
interface DefaultPageLayoutProps extends BoxProps {
|
|
3
3
|
}
|
|
4
4
|
declare const DefaultPageLayout: (props: DefaultPageLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default DefaultPageLayout;
|
|
@@ -31,6 +31,7 @@ var AnalyticGroup = function (props) {
|
|
|
31
31
|
leading: theme.typography.leading140,
|
|
32
32
|
fontSize: theme.typography.fontSize14,
|
|
33
33
|
textTransform: "capitalize",
|
|
34
|
+
color: theme.palette.text.white,
|
|
34
35
|
}, children: props.timeRange }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_increase"), width: 12 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.increase, borderBottom: "1px dashed currentColor" }), children: "5.63 (+3,22%)" })] })] }));
|
|
35
36
|
};
|
|
36
37
|
exports.default = AnalyticGroup;
|
|
@@ -272,14 +272,14 @@ var SendExternalToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
272
272
|
return undefined;
|
|
273
273
|
return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
|
|
274
274
|
}, [estimateFee, amount]);
|
|
275
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, children:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
275
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, 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.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
276
|
+
wordBreak: "break-all",
|
|
277
|
+
}, children: toAddress }), valueDescription: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: errorAddress }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Network", value: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: network === null || network === void 0 ? void 0 : network.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: network === null || network === void 0 ? void 0 : network.name })] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }), !!memo && (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: tokenSlug })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
278
|
+
fontWeight: theme.typography.fontWeight600,
|
|
279
|
+
fontSize: theme.typography.fontSize16,
|
|
280
|
+
}, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.customMargin.m6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] }))] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSendExternalToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee || isValidatingAddress || errorAddress
|
|
281
|
+
? Button_1.BUTTON_STATUS.DISABLED
|
|
282
|
+
: buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }), (0, jsx_runtime_1.jsx)(Activities_1.default, { ref: activitiesRef })] }) }));
|
|
283
283
|
});
|
|
284
284
|
SendExternalToken.displayName = "SendExternalToken";
|
|
285
285
|
exports.default = SendExternalToken;
|
|
@@ -99,7 +99,6 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
|
99
99
|
var Fees_1 = __importDefault(require("../Fees"));
|
|
100
100
|
var get_est_fee_service_1 = __importDefault(require("../../../services/axios/get-est-fee-service"));
|
|
101
101
|
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
102
|
-
var Activities_1 = __importDefault(require("../Activities"));
|
|
103
102
|
var useSwapData_1 = __importDefault(require("../../../hooks/useSwapData"));
|
|
104
103
|
var swap_service_1 = __importDefault(require("../../../services/axios/swap-service"));
|
|
105
104
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
@@ -133,9 +132,10 @@ var SwapToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
133
132
|
return fromTokens === null || fromTokens === void 0 ? void 0 : fromTokens.find(function (token) { return token.slug === fromTokenSlug; });
|
|
134
133
|
}, [fromTokenSlug, fromTokens]);
|
|
135
134
|
var toToken = (0, react_1.useMemo)(function () {
|
|
135
|
+
var _a;
|
|
136
136
|
if (!fromToken)
|
|
137
137
|
return undefined;
|
|
138
|
-
return fromToken.outputs.find(function (token) { return token.slug === toTokenSlug; });
|
|
138
|
+
return (_a = fromToken.outputs) === null || _a === void 0 ? void 0 : _a.find(function (token) { return token.slug === toTokenSlug; });
|
|
139
139
|
}, [toTokenSlug, fromToken]);
|
|
140
140
|
var toAmount = (0, react_1.useMemo)(function () {
|
|
141
141
|
if (!toToken)
|
|
@@ -258,10 +258,10 @@ var SwapToken = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
258
258
|
return undefined;
|
|
259
259
|
return +toAmount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
|
|
260
260
|
}, [estimateFee, toAmount]);
|
|
261
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { onOpen: validateAll, ref: confirmLayoutDrawerRef, action: transactionSlug, trigger: props.children, 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.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { alignItems: "center", gap: 0 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: fromToken === null || fromToken === void 0 ? void 0 : fromToken.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: fromToken === null || fromToken === void 0 ? void 0 : fromToken.name })] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.bigValue), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("swap-one-direction"), width: 32 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: toToken === null || toToken === void 0 ? void 0 : toToken.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: toToken === null || toToken === void 0 ? void 0 : toToken.name })] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.bigValue), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: toAmount, unit: " ".concat(toToken === null || toToken === void 0 ? void 0 : toToken.name) }) })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g12 }), theme.mixins.valueDescription), { width: "100%", justifyContent: "center" }), children: ["1 ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.name, " ~ ", toToken === null || toToken === void 0 ? void 0 : toToken.rate, " ", toToken === null || toToken === void 0 ? void 0 : toToken.name] }), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: JSON.stringify(estimateFee), amount: +amount, tokenSlug: fromTokenSlug })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Receive amount estimated", value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
262
|
+
fontWeight: theme.typography.fontWeight600,
|
|
263
|
+
fontSize: theme.typography.fontSize16,
|
|
264
|
+
}, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) }) }) }), !!error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { mt: theme.mixins.customMargin.m6 }), children: [error, " ", !!errorAmount && (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: errorAmount, unit: " ".concat(token === null || token === void 0 ? void 0 : token.name) })] }))] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: transactionSlug, onConfirmSuccess: handleSwapToken, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: !!error || isLoadingEstimateFee ? Button_1.BUTTON_STATUS.DISABLED : buttonStatus, sx: { width: "100%" }, children: "Confirm" }) })] }) }) }));
|
|
265
265
|
});
|
|
266
266
|
SwapToken.displayName = "SwapToken";
|
|
267
267
|
exports.default = SwapToken;
|
|
@@ -27,16 +27,16 @@ var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
|
27
27
|
var Text_1 = __importDefault(require("../../ui/Text"));
|
|
28
28
|
var material_2 = require("@mui/material");
|
|
29
29
|
var AmountGroupAndChart_1 = __importDefault(require("../../ui/AmountGroupAndChart"));
|
|
30
|
-
var AssetView = function () {
|
|
30
|
+
var AssetView = function (props) {
|
|
31
31
|
var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
|
|
32
32
|
var theme = (0, material_2.useTheme)();
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isAuthenticated && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isAuthenticated && ((0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(AmountGroupAndChart_1.default, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isAuthenticated && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Please connect your wallet to get asset information" })), !!isAuthenticated && ((0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, __assign({}, props, { children: [(0, jsx_runtime_1.jsx)(AmountGroupAndChart_1.default, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
34
34
|
display: "grid",
|
|
35
35
|
gridTemplateColumns: "repeat(4, 1fr)",
|
|
36
36
|
gap: theme.mixins.gaps.g12,
|
|
37
37
|
position: "relative",
|
|
38
38
|
zIndex: 50,
|
|
39
39
|
my: theme.mixins.customMargin.m20,
|
|
40
|
-
}, children: [(0, jsx_runtime_1.jsx)(ReceiveFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("receive"), label: "Receive", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(WithdrawFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("withdraw"), label: "Withdraw", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("fortune", "gif"), label: "Fortune", sx: { width: "100%" } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("p2p", "gif"), label: "P2P", sx: { width: "100%" } }) })] }), (0, jsx_runtime_1.jsx)(TokensBoard_1.default, {})] }))] }));
|
|
40
|
+
}, children: [(0, jsx_runtime_1.jsx)(ReceiveFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("receive"), label: "Receive", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(WithdrawFunction_1.default, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("withdraw"), label: "Withdraw", sx: { width: "100%" } }) }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("fortune", "gif"), label: "Fortune", sx: { width: "100%" } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(FunctionItem_1.default, { icon: (0, getIcon_1.default)("p2p", "gif"), label: "P2P", sx: { width: "100%" } }) })] }), (0, jsx_runtime_1.jsx)(TokensBoard_1.default, {})] })))] }));
|
|
41
41
|
};
|
|
42
42
|
exports.default = AssetView;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ import LockToken from "./components/ui/LockToken";
|
|
|
7
7
|
import AssetView from "./components/views/AssetView";
|
|
8
8
|
import useWallet from "./hooks/useWallet";
|
|
9
9
|
import Activities from "./components/ui/Activities";
|
|
10
|
+
import SwapToken from "./components/ui/SwapToken";
|
|
10
11
|
export * from "./types/expose-type";
|
|
11
|
-
export { TekWalletProvider, tekWalletHandler, RequireConnect, GetWalletSeedPhrase, ReceiveFunction, useWallet, LockToken, AssetView, Activities, };
|
|
12
|
+
export { TekWalletProvider, tekWalletHandler, RequireConnect, GetWalletSeedPhrase, ReceiveFunction, useWallet, LockToken, AssetView, Activities, SwapToken, };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Activities = exports.AssetView = exports.LockToken = exports.useWallet = exports.ReceiveFunction = exports.GetWalletSeedPhrase = exports.RequireConnect = exports.tekWalletHandler = exports.TekWalletProvider = void 0;
|
|
20
|
+
exports.SwapToken = exports.Activities = exports.AssetView = exports.LockToken = exports.useWallet = exports.ReceiveFunction = exports.GetWalletSeedPhrase = exports.RequireConnect = exports.tekWalletHandler = exports.TekWalletProvider = void 0;
|
|
21
21
|
var TekWalletProvider_1 = __importDefault(require("./providers/TekWalletProvider"));
|
|
22
22
|
exports.TekWalletProvider = TekWalletProvider_1.default;
|
|
23
23
|
var handlers_1 = __importDefault(require("./handlers"));
|
|
@@ -36,5 +36,6 @@ var useWallet_1 = __importDefault(require("./hooks/useWallet"));
|
|
|
36
36
|
exports.useWallet = useWallet_1.default;
|
|
37
37
|
var Activities_1 = __importDefault(require("./components/ui/Activities"));
|
|
38
38
|
exports.Activities = Activities_1.default;
|
|
39
|
+
var SwapToken_1 = __importDefault(require("./components/ui/SwapToken"));
|
|
40
|
+
exports.SwapToken = SwapToken_1.default;
|
|
39
41
|
__exportStar(require("./types/expose-type"), exports);
|
|
40
|
-
//
|