tek-wallet 0.0.533 → 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.
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tek-wallet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.534",
|
|
4
4
|
"description": "A custom React provider with TypeScript support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -80,4 +80,4 @@
|
|
|
80
80
|
"type": "git",
|
|
81
81
|
"url": "https://github.com/TheHappyLife/tek-wallet"
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
}
|