tek-wallet 0.0.767 → 0.0.769
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/ActivityDetail/index.js +6 -2
- package/dist/components/TekWallet/components/ui/ChangePasscode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +3 -3
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.d.ts +2 -2
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/Result.js +2 -2
- package/dist/components/TekWallet/components/ui/DetailSwap/index.js +1 -1
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +1 -1
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QRCode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +43 -12
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +5 -3
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +1 -1
- package/dist/components/TekWallet/components/ui/SwapFunction/index.js +2 -2
- package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +19 -9
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +1 -1
- package/dist/components/TekWallet/components/views/AssetView/index.js +2 -35
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +7 -5
- package/dist/components/TekWallet/components/views/DetailActivityView/LoadingView.d.ts +2 -0
- package/dist/components/TekWallet/components/views/DetailActivityView/LoadingView.js +29 -0
- package/dist/components/TekWallet/components/views/DetailActivityView/index.js +92 -5
- package/dist/components/TekWallet/components/views/SendExternalView/components/Result.js +4 -4
- package/dist/components/TekWallet/components/views/SendExternalView/components/Summary.js +5 -5
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +3 -2
- package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +10 -0
- package/dist/components/TekWallet/components/views/SendInternalView/components/Result.js +3 -3
- package/dist/components/TekWallet/components/views/SendInternalView/components/Summary.js +3 -3
- package/dist/components/TekWallet/components/views/SendInternalView/index.js +3 -4
- package/dist/components/TekWallet/components/views/SwapView/index.js +4 -3
- package/dist/components/TekWallet/hooks/useEventHandler.js +0 -1
- package/dist/components/TekWallet/services/axios/get-activities-service/type.d.ts +1 -0
- package/dist/components/TekWallet/services/axios/get-activity-service/index.d.ts +3 -0
- package/dist/components/TekWallet/services/axios/get-activity-service/index.js +54 -0
- package/dist/components/TekWallet/services/axios/get-activity-service/type.d.ts +10 -0
- package/dist/components/TekWallet/services/axios/get-activity-service/type.js +2 -0
- package/package.json +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/reader.json +0 -2644
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
3
39
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
40
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
41
|
};
|
|
@@ -14,18 +50,69 @@ var ActivityDetail_1 = __importDefault(require("../../ui/ActivityDetail"));
|
|
|
14
50
|
var EmptyData_1 = __importDefault(require("../../ui/EmptyData"));
|
|
15
51
|
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
16
52
|
var DefaultPageLayout_1 = __importDefault(require("../../layouts/DefaultPageLayout"));
|
|
53
|
+
var get_activity_service_1 = __importDefault(require("../../../services/axios/get-activity-service"));
|
|
54
|
+
var LoadingView_1 = __importDefault(require("./LoadingView"));
|
|
55
|
+
var ActivityDataStatus;
|
|
56
|
+
(function (ActivityDataStatus) {
|
|
57
|
+
ActivityDataStatus["Loading"] = "loading";
|
|
58
|
+
ActivityDataStatus["NotFound"] = "not_found";
|
|
59
|
+
ActivityDataStatus["Error"] = "error";
|
|
60
|
+
ActivityDataStatus["Filled"] = "filled";
|
|
61
|
+
})(ActivityDataStatus || (ActivityDataStatus = {}));
|
|
17
62
|
var DetailActivityView = function (props) {
|
|
63
|
+
var _a;
|
|
18
64
|
var sx = props.sx, id = props.id;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
65
|
+
var _b = (0, useWallet_1.default)(), masterWallet = _b.masterWallet, activities = _b.activities;
|
|
66
|
+
var _c = (0, react_1.useState)(ActivityDataStatus.Loading), activityDataStatus = _c[0], setActivityDataStatus = _c[1];
|
|
67
|
+
var _d = (0, react_1.useState)(null), activityData = _d[0], setActivityData = _d[1];
|
|
21
68
|
(0, react_1.useEffect)(function () {
|
|
22
69
|
var _a, _b;
|
|
70
|
+
if (!id) {
|
|
71
|
+
setActivityDataStatus(ActivityDataStatus.NotFound);
|
|
72
|
+
setActivityData(null);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
23
75
|
if (activities) {
|
|
24
76
|
var activity = (_b = (_a = Object.values(activities)) === null || _a === void 0 ? void 0 : _a.flat()) === null || _b === void 0 ? void 0 : _b.find(function (activity) { return "".concat(activity.id) === "".concat(id); });
|
|
25
|
-
|
|
77
|
+
if (activity) {
|
|
78
|
+
setActivityData(activity);
|
|
79
|
+
setActivityDataStatus(ActivityDataStatus.Filled);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (!!masterWallet) {
|
|
84
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var response, error_1;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
_a.trys.push([0, 2, , 3]);
|
|
90
|
+
setActivityDataStatus(ActivityDataStatus.Loading);
|
|
91
|
+
return [4 /*yield*/, (0, get_activity_service_1.default)({ id: id })];
|
|
92
|
+
case 1:
|
|
93
|
+
response = _a.sent();
|
|
94
|
+
setActivityData(response.data);
|
|
95
|
+
setActivityDataStatus(ActivityDataStatus.Filled);
|
|
96
|
+
return [3 /*break*/, 3];
|
|
97
|
+
case 2:
|
|
98
|
+
error_1 = _a.sent();
|
|
99
|
+
console.error("🚀 ~ DetailActivityView ~ error:", error_1);
|
|
100
|
+
if (error_1.status === 404) {
|
|
101
|
+
setActivityDataStatus(ActivityDataStatus.NotFound);
|
|
102
|
+
setActivityData(null);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
setActivityDataStatus(ActivityDataStatus.Error);
|
|
106
|
+
setActivityData(null);
|
|
107
|
+
}
|
|
108
|
+
return [3 /*break*/, 3];
|
|
109
|
+
case 3: return [2 /*return*/];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}); })();
|
|
26
113
|
}
|
|
27
|
-
}, [activities, id]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Detail" }), sx: sx, children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { children: [
|
|
114
|
+
}, [activities, id, masterWallet]);
|
|
115
|
+
return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "".concat(((_a = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.name) || "", " Detail") }), sx: sx, children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { children: [activityDataStatus === ActivityDataStatus.Loading && (0, jsx_runtime_1.jsx)(LoadingView_1.default, {}), activityDataStatus === ActivityDataStatus.Filled && ((0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData })), activityDataStatus === ActivityDataStatus.NotFound && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { marginBottom: "auto", marginTop: "4rem" }, icon: (0, getIcon_1.default)("empty_" + "all"), description: "Activity not found" })), activityDataStatus === ActivityDataStatus.Error && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { marginBottom: "auto", marginTop: "4rem" }, icon: (0, getIcon_1.default)("error_" + "detail_activity"), description: "Something went wrong, please try again later" }))] }) }));
|
|
29
116
|
};
|
|
30
117
|
exports.DetailActivityView = DetailActivityView;
|
|
31
118
|
exports.default = exports.DetailActivityView;
|
|
@@ -112,22 +112,22 @@ function Result(props) {
|
|
|
112
112
|
fontWeight: 600,
|
|
113
113
|
fontSize: theme.typography.fontSize24,
|
|
114
114
|
}, children: status })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", borderTop: "1px ".concat(theme.palette.border.accent3, " solid") } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.bigValue), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "- ", value: amount, unit: tokenName }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", borderTop: "1px ".concat(theme.palette.border.accent3, " solid") } }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Recipient address", titleStyle: {
|
|
115
|
-
fontSize: "0.
|
|
115
|
+
fontSize: "0.875rem",
|
|
116
116
|
fontWeight: 500,
|
|
117
117
|
color: "gray.700",
|
|
118
118
|
}, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: recipientAddress || "", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-row gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, safeText_1.safeText)(recipientAddress || "", { isShort: true }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
119
119
|
width: 16,
|
|
120
120
|
height: 16,
|
|
121
121
|
}, children: SvgPath_1.IC_COPY })] }) }), isAligned: true }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Network", titleStyle: {
|
|
122
|
-
fontSize: "0.
|
|
122
|
+
fontSize: "0.875rem",
|
|
123
123
|
fontWeight: 500,
|
|
124
124
|
color: "gray.700",
|
|
125
125
|
}, value: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.link, width: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.name })] }), isAligned: true }), message && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Message", titleStyle: {
|
|
126
|
-
fontSize: "0.
|
|
126
|
+
fontSize: "0.875rem",
|
|
127
127
|
fontWeight: 500,
|
|
128
128
|
color: "gray.700",
|
|
129
129
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: message }), isAligned: true })), dateCreated && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Date time", titleStyle: {
|
|
130
|
-
fontSize: "0.
|
|
130
|
+
fontSize: "0.875rem",
|
|
131
131
|
fontWeight: 500,
|
|
132
132
|
color: "gray.700",
|
|
133
133
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: formatDate(dateCreated, true) }), isAligned: true })), !!feeInfo && ((0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: feeInfo, amount: +(amount || 0), tokenSlug: (response === null || response === void 0 ? void 0 : response.currency_slug) || "", feesStyle: Fees_1.FeesStyle.DEFAULT }))] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
@@ -89,24 +89,24 @@ function Summary(props) {
|
|
|
89
89
|
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), { textAlign: "start", mr: "auto" }), children: "Transaction summary" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
90
90
|
display: "flex",
|
|
91
91
|
flexDirection: "column",
|
|
92
|
-
gap:
|
|
92
|
+
gap: theme.mixins.gaps.g12,
|
|
93
93
|
}, children: [(0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Amount", titleStyle: {
|
|
94
|
-
fontSize: "0.
|
|
94
|
+
fontSize: "0.875rem",
|
|
95
95
|
fontWeight: 500,
|
|
96
96
|
color: "gray.700",
|
|
97
97
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name }) }), isAligned: true }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Recipient address", titleStyle: {
|
|
98
|
-
fontSize: "0.
|
|
98
|
+
fontSize: "0.875rem",
|
|
99
99
|
fontWeight: 500,
|
|
100
100
|
color: "gray.700",
|
|
101
101
|
}, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: recipientAddress || "", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-row gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, safeText_1.safeText)(recipientAddress || "", { isShort: true }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
102
102
|
width: 16,
|
|
103
103
|
height: 16,
|
|
104
104
|
}, children: SvgPath_1.IC_COPY })] }) }), isAligned: true }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Network", titleStyle: {
|
|
105
|
-
fontSize: "0.
|
|
105
|
+
fontSize: "0.875rem",
|
|
106
106
|
fontWeight: 500,
|
|
107
107
|
color: "gray.700",
|
|
108
108
|
}, value: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: payload.network.link, width: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: payload.network.name })] }), isAligned: true }), memo && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Comment", titleStyle: {
|
|
109
|
-
fontSize: "0.
|
|
109
|
+
fontSize: "0.875rem",
|
|
110
110
|
fontWeight: 500,
|
|
111
111
|
color: "gray.700",
|
|
112
112
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: memo }), isAligned: true })), (0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: estimateFee, amount: +(amount || 0), tokenSlug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "", feesStyle: Fees_1.FeesStyle.DEFAULT })] }), (0, jsx_runtime_1.jsx)(ConfirmSendExternal_1.default, __assign({ sx: {
|
|
@@ -112,7 +112,8 @@ var SendExternalView = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
112
112
|
setIsChangeSlidePromptly(true);
|
|
113
113
|
}, []);
|
|
114
114
|
var startNewTransaction = function () {
|
|
115
|
-
gotoStep(SendExternalStep.SELECT_TOKEN);
|
|
115
|
+
// gotoStep(SendExternalStep.SELECT_TOKEN);
|
|
116
|
+
router.back();
|
|
116
117
|
};
|
|
117
118
|
(0, react_1.useEffect)(function () {
|
|
118
119
|
if (isInitPasscode && !withdrawTokens) {
|
|
@@ -130,7 +131,7 @@ var SendExternalView = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
130
131
|
height: "100%",
|
|
131
132
|
}, children: payload && ((0, jsx_runtime_1.jsx)(Summary_1.default, { estimateFee: estimateFee, payload: __assign(__assign({}, payload), { await_completion: true }), selectedToken: selectedToken, confirmProps: {
|
|
132
133
|
onSuccess: handleSendSuccess,
|
|
133
|
-
|
|
134
|
+
onDone: startNewTransaction,
|
|
134
135
|
} })) }) }, SendExternalStep.CONFIRM)] }) }));
|
|
135
136
|
});
|
|
136
137
|
SendExternalView.displayName = "SendExternalView";
|
|
@@ -105,6 +105,7 @@ var xhub_keyboard_1 = require("xhub-keyboard");
|
|
|
105
105
|
var useUniqueId_1 = require("../../../../hooks/useUniqueId");
|
|
106
106
|
var ChildPageLayout_1 = __importDefault(require("../../../layouts/ChildPageLayout"));
|
|
107
107
|
var Formatter_1 = __importDefault(require("../../../ui/Formatter"));
|
|
108
|
+
var navigation_1 = require("next/navigation");
|
|
108
109
|
var validateAddressDebounce = (0, lodash_1.debounce)(function (callback) {
|
|
109
110
|
callback();
|
|
110
111
|
}, 500, { leading: true, trailing: true });
|
|
@@ -114,6 +115,8 @@ var getEstimateFeeDebounce = (0, lodash_1.debounce)(function (callback) {
|
|
|
114
115
|
function Form(props) {
|
|
115
116
|
var _this = this;
|
|
116
117
|
var theme = (0, providers_1.useTheme)();
|
|
118
|
+
var searchParams = (0, navigation_1.useSearchParams)();
|
|
119
|
+
var address = searchParams.get("address") || "";
|
|
117
120
|
var selectedToken = props.selectedToken, onContinue = props.onContinue, sx = props.sx;
|
|
118
121
|
var _a = (0, react_1.useState)(""), recipientAddress = _a[0], setRecipientAddress = _a[1];
|
|
119
122
|
var _b = (0, react_1.useState)(), recipientAddressError = _b[0], setRecipientAddressError = _b[1];
|
|
@@ -314,6 +317,13 @@ function Form(props) {
|
|
|
314
317
|
var handleKeyboardClose = function () {
|
|
315
318
|
setIsKeyboardOpen(false);
|
|
316
319
|
};
|
|
320
|
+
(0, react_1.useEffect)(function () {
|
|
321
|
+
if (address) {
|
|
322
|
+
handleChangeRecipientAddress({
|
|
323
|
+
target: { value: address },
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}, [address]);
|
|
317
327
|
return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { styles: {
|
|
318
328
|
container: {
|
|
319
329
|
height: "100%",
|
|
@@ -104,18 +104,18 @@ function Result(props) {
|
|
|
104
104
|
fontWeight: 600,
|
|
105
105
|
fontSize: theme.typography.fontSize24,
|
|
106
106
|
}, children: status })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", borderTop: "1px ".concat(theme.palette.border.accent3, " solid") } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.bigValue), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "- ", value: amount, unit: tokenName }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", borderTop: "1px ".concat(theme.palette.border.accent3, " solid") } }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Recipient address", titleStyle: {
|
|
107
|
-
fontSize: "0.
|
|
107
|
+
fontSize: "0.875rem",
|
|
108
108
|
fontWeight: 500,
|
|
109
109
|
color: "gray.700",
|
|
110
110
|
}, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: recipientAddress || "", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-row gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, safeText_1.safeText)(recipientAddress || "", { isShort: true }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
111
111
|
width: 16,
|
|
112
112
|
height: 16,
|
|
113
113
|
}, children: SvgPath_1.IC_COPY })] }) }), isAligned: true }), message && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Message", titleStyle: {
|
|
114
|
-
fontSize: "0.
|
|
114
|
+
fontSize: "0.875rem",
|
|
115
115
|
fontWeight: 500,
|
|
116
116
|
color: "gray.700",
|
|
117
117
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: message }), isAligned: true })), dateCreated && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Date time", titleStyle: {
|
|
118
|
-
fontSize: "0.
|
|
118
|
+
fontSize: "0.875rem",
|
|
119
119
|
fontWeight: 500,
|
|
120
120
|
color: "gray.700",
|
|
121
121
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: formatDate(dateCreated, true) }), isAligned: true })), (0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: feeInfo || estimateFee, amount: +(amount || 0), tokenSlug: ((_j = response === null || response === void 0 ? void 0 : response.data) === null || _j === void 0 ? void 0 : _j.currency_slug) || "", feesStyle: Fees_1.FeesStyle.DEFAULT })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
@@ -90,18 +90,18 @@ function Summary(props) {
|
|
|
90
90
|
flexDirection: "column",
|
|
91
91
|
gap: 3,
|
|
92
92
|
}, children: [(0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Amount", titleStyle: {
|
|
93
|
-
fontSize: "0.
|
|
93
|
+
fontSize: "0.875rem",
|
|
94
94
|
fontWeight: 500,
|
|
95
95
|
color: "gray.700",
|
|
96
96
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name }) }), isAligned: true }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Recipient address", titleStyle: {
|
|
97
|
-
fontSize: "0.
|
|
97
|
+
fontSize: "0.875rem",
|
|
98
98
|
fontWeight: 500,
|
|
99
99
|
color: "gray.700",
|
|
100
100
|
}, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: recipientAddress || "", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { className: "flex flex-row gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, safeText_1.safeText)(recipientAddress || "", { isShort: true }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: {
|
|
101
101
|
width: 16,
|
|
102
102
|
height: 16,
|
|
103
103
|
}, children: SvgPath_1.IC_COPY })] }) }), isAligned: true }), message && ((0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Message", titleStyle: {
|
|
104
|
-
fontSize: "0.
|
|
104
|
+
fontSize: "0.875rem",
|
|
105
105
|
fontWeight: 500,
|
|
106
106
|
color: "gray.700",
|
|
107
107
|
}, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: message }), isAligned: true })), (0, jsx_runtime_1.jsx)(Fees_1.default, { isFeePaidByAmount: true, feesData: estimateFee, amount: +(amount || 0), tokenSlug: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.slug) || "", feesStyle: Fees_1.FeesStyle.DEFAULT })] }), (0, jsx_runtime_1.jsx)(ConfirmSendInternal_1.default, __assign({ sx: {
|
|
@@ -108,9 +108,8 @@ exports.SendInternalView = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
108
108
|
gotoStep(currentStep - 1);
|
|
109
109
|
};
|
|
110
110
|
var handleCloseResult = (0, react_1.useCallback)(function () {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, [gotoStep]);
|
|
111
|
+
router.back();
|
|
112
|
+
}, []);
|
|
114
113
|
var gotoConfirmStep = function (payload, estimateFee) {
|
|
115
114
|
gotoStep(TransferStep.CONFIRM);
|
|
116
115
|
setPayload(payload);
|
|
@@ -143,7 +142,7 @@ exports.SendInternalView = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
143
142
|
paddingRight: "0px",
|
|
144
143
|
paddingTop: "0px",
|
|
145
144
|
paddingBottom: "0px",
|
|
146
|
-
}, children: selectedToken && ((0, jsx_runtime_1.jsx)(Form_1.default, { sx: __assign({}, theme.mixins.pagePadding), selectedToken: selectedToken, onContinue: gotoConfirmStep }, clearFormKey)) }) }, TransferStep.FORM), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: { minHeight: "100%" }, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
|
|
145
|
+
}, children: selectedToken && ((0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(Form_1.default, { sx: __assign({}, theme.mixins.pagePadding), selectedToken: selectedToken, onContinue: gotoConfirmStep }, clearFormKey) })) }) }, TransferStep.FORM), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: { minHeight: "100%" }, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
|
|
147
146
|
height: "100%",
|
|
148
147
|
}, children: payload && ((0, jsx_runtime_1.jsx)(Summary_1.default, { estimateFee: estimateFee, payload: __assign(__assign({}, payload), { await_completion: true }), selectedToken: selectedToken, confirmProps: {
|
|
149
148
|
onSuccess: handleSendSuccess,
|
|
@@ -150,9 +150,10 @@ var SwapView = function () {
|
|
|
150
150
|
gotoStep(currentStep - 1);
|
|
151
151
|
}, [currentStep, clearValues, router]);
|
|
152
152
|
var handleNewTransaction = (0, react_1.useCallback)(function () {
|
|
153
|
-
clearValues();
|
|
154
|
-
gotoStep(SwapStep.FORM);
|
|
155
|
-
setIsChangeSlidePromptly(false);
|
|
153
|
+
// clearValues();
|
|
154
|
+
// gotoStep(SwapStep.FORM);
|
|
155
|
+
// setIsChangeSlidePromptly(false);
|
|
156
|
+
router.back();
|
|
156
157
|
}, [clearValues]);
|
|
157
158
|
var handleOnSuccessSwap = (0, react_1.useCallback)(function () {
|
|
158
159
|
setIsChangeSlidePromptly(true);
|
|
@@ -13,7 +13,6 @@ var useWallet_1 = __importDefault(require("./useWallet"));
|
|
|
13
13
|
var useEventHandler = function () {
|
|
14
14
|
var _a = (0, useWallet_1.default)(), updateLockToken = _a.updateLockToken, updateReceiveExternalToken = _a.updateReceiveExternalToken, updateReceiveInternalToken = _a.updateReceiveInternalToken, updateSendInternalToken = _a.updateSendInternalToken, updateSwapTokens = _a.updateSwapTokens, updateWalletDetail = _a.updateWalletDetail, updateWithdrawToken = _a.updateWithdrawToken, updateLockedToken = _a.updateLockedToken, updateActivities = _a.updateActivities;
|
|
15
15
|
var updateData = (0, react_1.useCallback)(function (transactionType, showActivities) {
|
|
16
|
-
console.warn("🚀 ~ useEventHandler ~ transactionType:", transactionType);
|
|
17
16
|
updateWithdrawToken();
|
|
18
17
|
updateSendInternalToken();
|
|
19
18
|
updateReceiveInternalToken();
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var userClientRequest_1 = __importDefault(require("../clients/userClientRequest"));
|
|
43
|
+
var getActivityService = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var response;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0: return [4 /*yield*/, userClientRequest_1.default.get("/transaction/".concat(params === null || params === void 0 ? void 0 : params.id))];
|
|
48
|
+
case 1:
|
|
49
|
+
response = _a.sent();
|
|
50
|
+
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.data];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}); };
|
|
54
|
+
exports.default = getActivityService;
|