tek-wallet 0.0.686 → 0.0.688
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/BackArrow/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +10 -7
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +41 -43
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +3 -3
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.d.ts +6 -11
- package/dist/components/TekWallet/components/ui/TransferConfirmation/index.js +21 -16
- package/dist/components/TekWallet/components/ui/TransferInternal/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/TransferInternal/index.js +6 -6
- package/dist/components/TekWallet/index.d.ts +0 -1
- package/dist/components/TekWallet/index.js +0 -1
- package/dist/components/TekWallet/services/axios/instructions-service/index.d.ts +1 -2
- package/dist/components/TekWallet/services/axios/instructions-service/type.d.ts +5 -0
- package/dist/components/TekWallet/services/axios/swap-service/type.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/TekWallet/services/axios/instructions-service/response.type.d.ts +0 -59
- package/dist/components/TekWallet/services/axios/instructions-service/response.type.js +0 -2
|
@@ -15,6 +15,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var material_1 = require("@mui/material");
|
|
16
16
|
var SvgPath_1 = require("../SvgPath");
|
|
17
17
|
var BackArrow = function (props) {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: __assign(
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: __assign({}, props.sx), children: SvgPath_1.IC_BACK }));
|
|
19
19
|
};
|
|
20
20
|
exports.default = BackArrow;
|
|
@@ -53,16 +53,13 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
53
53
|
if (video) {
|
|
54
54
|
var stream = video.srcObject;
|
|
55
55
|
var track = stream === null || stream === void 0 ? void 0 : stream.getTracks()[0];
|
|
56
|
-
console.warn("🚀 ~ toggleFlash ~ track:", track.getCapabilities());
|
|
57
56
|
var torch = track.getCapabilities().torch;
|
|
58
|
-
console.warn("🚀 ~ toggleFlash ~ torch:", torch);
|
|
59
57
|
if (torch) {
|
|
60
58
|
track
|
|
61
59
|
.applyConstraints({
|
|
62
60
|
advanced: [{ torch: !flashEnabled }],
|
|
63
61
|
})
|
|
64
62
|
.then(function () {
|
|
65
|
-
console.warn("🚀 ~ toggleFlash ~ flashEnabled:", flashEnabled);
|
|
66
63
|
setFlashEnabled(!flashEnabled);
|
|
67
64
|
})
|
|
68
65
|
.catch(function (err) { return console.error("Error toggling flash:", err); });
|
|
@@ -81,9 +78,15 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
81
78
|
}, [isOpen]);
|
|
82
79
|
// Thêm CSS animation vào document khi component được mount
|
|
83
80
|
(0, react_1.useEffect)(function () {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
// Tạo thẻ style
|
|
82
|
+
var styleTag = document.createElement("style");
|
|
83
|
+
styleTag.innerHTML = "\n @keyframes move-up-down {\n 0% {\n top: 0%;\n } \n 50% {\n top: 100%;\n }\n 100% {\n top: 0%;\n }\n }\n ";
|
|
84
|
+
// Thêm thẻ style vào head của tài liệu
|
|
85
|
+
document.head.appendChild(styleTag);
|
|
86
|
+
// Cleanup khi component unmount
|
|
87
|
+
return function () {
|
|
88
|
+
document.head.removeChild(styleTag);
|
|
89
|
+
};
|
|
87
90
|
}, []); // Chỉ chạy một lần khi component mount
|
|
88
91
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: props.children, ref: drawerRef, onClose: onClose, onOpen: onOpen, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
|
|
89
92
|
position: "absolute",
|
|
@@ -128,7 +131,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
128
131
|
width: "100%",
|
|
129
132
|
height: "2px",
|
|
130
133
|
backgroundImage: "linear-gradient(to right, transparent, currentColor, transparent)",
|
|
131
|
-
|
|
134
|
+
animation: "move-up-down 4s infinite linear",
|
|
132
135
|
} }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
133
136
|
position: "absolute",
|
|
134
137
|
borderTopLeftRadius: STYLES.borderRadius,
|
|
@@ -104,7 +104,6 @@ var RECEIVE_STEP_NAME = (_a = {},
|
|
|
104
104
|
_a[ReceiveStep.SHOW_QR_CODE] = "Scan QR code",
|
|
105
105
|
_a);
|
|
106
106
|
exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
107
|
-
var onClose = props.onClose;
|
|
108
107
|
var drawerRef = (0, react_1.useRef)(null);
|
|
109
108
|
var amountDrawerRef = (0, react_1.useRef)(null);
|
|
110
109
|
var _a = (0, react_1.useState)(), selectedMethod = _a[0], setSelectedMethod = _a[1];
|
|
@@ -170,29 +169,27 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
170
169
|
};
|
|
171
170
|
return JSON.stringify(tonTransferParamInternal);
|
|
172
171
|
}
|
|
173
|
-
return "ton://transfer/".concat(receiveAddress, "?jetton=").concat((_e = (_d = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.network_data) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.address, "&amount=").concat(+amount * Math.pow(10, ((_f = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.decimal) !== null && _f !== void 0 ? _f : 0)));
|
|
172
|
+
return "ton://transfer/".concat(receiveAddress, "?jetton=").concat((_e = (_d = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.network_data) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.address, "&text=test-text&amount=").concat(+amount * Math.pow(10, ((_f = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.decimal) !== null && _f !== void 0 ? _f : 0)));
|
|
174
173
|
}, [receiveAddress, selectedToken, amount, selectedMethod]);
|
|
175
174
|
var warningMessage = (0, react_1.useMemo)(function () {
|
|
176
|
-
if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL) {
|
|
175
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !amount) {
|
|
177
176
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) }), " "] }), " ", "and", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", unless you will lose your assets."] }));
|
|
178
177
|
}
|
|
179
|
-
if (selectedMethod === ReceiveMethods.
|
|
178
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_EXTERNAL && !!amount) {
|
|
179
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Please", " ", (0, jsx_runtime_1.jsx)("strong", { style: { color: theme.palette.primary.main }, children: "select the correct network" }), ", unless you will lose your assets."] }));
|
|
180
|
+
}
|
|
181
|
+
if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && !amount) {
|
|
180
182
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The amount must be between", " ", (0, jsx_runtime_1.jsxs)("strong", { style: { color: theme.palette.primary.main }, children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value }), " to", " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value, unit: " ".concat(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) })] }), ", unless you will lose your assets."] }));
|
|
181
183
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.min_value,
|
|
186
|
-
selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value,
|
|
187
|
-
selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name,
|
|
188
|
-
]);
|
|
189
|
-
var handleShareProgress = (0, react_1.useCallback)(function () {
|
|
184
|
+
return null;
|
|
185
|
+
}, [selectedMethod, selectedToken, amount]);
|
|
186
|
+
var handleShareProgress = function () {
|
|
190
187
|
setIsSharing(true);
|
|
191
|
-
}
|
|
192
|
-
var handleShareFinish =
|
|
188
|
+
};
|
|
189
|
+
var handleShareFinish = function () {
|
|
193
190
|
setIsSharing(false);
|
|
194
|
-
}
|
|
195
|
-
var clearValues =
|
|
191
|
+
};
|
|
192
|
+
var clearValues = function () {
|
|
196
193
|
setInputAmount("");
|
|
197
194
|
setAmount("");
|
|
198
195
|
setAmountError("");
|
|
@@ -200,48 +197,32 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
200
197
|
setSelectedNetwork(undefined);
|
|
201
198
|
setSelectedMethod(undefined);
|
|
202
199
|
handleShareFinish();
|
|
203
|
-
}
|
|
200
|
+
};
|
|
204
201
|
var open = function () {
|
|
205
202
|
var _a;
|
|
206
203
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
207
204
|
};
|
|
208
|
-
var
|
|
209
|
-
var _a;
|
|
210
|
-
if (step === ReceiveStep.SELECT_METHOD) {
|
|
211
|
-
clearValues();
|
|
212
|
-
}
|
|
213
|
-
setCurrentStep(step);
|
|
214
|
-
(_a = stepSwiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step - 1);
|
|
215
|
-
}, [clearValues, stepDrawerRef, stepSwiperRef]);
|
|
216
|
-
var handleOnClose = (0, react_1.useCallback)(function () {
|
|
217
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
218
|
-
gotoStep(ReceiveStep.SELECT_METHOD);
|
|
219
|
-
}, [gotoStep, onClose]);
|
|
220
|
-
var close = (0, react_1.useCallback)(function () {
|
|
205
|
+
var close = function () {
|
|
221
206
|
var _a;
|
|
222
207
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
223
|
-
|
|
224
|
-
}
|
|
208
|
+
gotoStep(ReceiveStep.SELECT_METHOD);
|
|
209
|
+
};
|
|
225
210
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
226
211
|
open: open,
|
|
227
212
|
close: close,
|
|
228
213
|
}); });
|
|
229
|
-
var handleBack =
|
|
230
|
-
var _a;
|
|
214
|
+
var handleBack = function () {
|
|
231
215
|
if (currentStep === ReceiveStep.SHOW_QR_CODE &&
|
|
232
216
|
selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
|
|
233
217
|
gotoStep(ReceiveStep.SELECT_TOKEN);
|
|
234
218
|
return;
|
|
235
219
|
}
|
|
236
|
-
if (currentStep === ReceiveStep.SELECT_TOKEN) {
|
|
237
|
-
(_a = stepDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
238
|
-
}
|
|
239
220
|
gotoStep(currentStep - 1);
|
|
240
|
-
}
|
|
241
|
-
var closeHistory =
|
|
221
|
+
};
|
|
222
|
+
var closeHistory = function () {
|
|
242
223
|
var _a;
|
|
243
224
|
(_a = historyRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
244
|
-
}
|
|
225
|
+
};
|
|
245
226
|
var handleSelectMethod = function (method) {
|
|
246
227
|
setSelectedMethod(method);
|
|
247
228
|
switch (method) {
|
|
@@ -253,6 +234,15 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
253
234
|
break;
|
|
254
235
|
}
|
|
255
236
|
};
|
|
237
|
+
var gotoStep = function (step) {
|
|
238
|
+
var _a, _b;
|
|
239
|
+
if (step === ReceiveStep.SELECT_METHOD) {
|
|
240
|
+
clearValues();
|
|
241
|
+
(_a = stepDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
242
|
+
}
|
|
243
|
+
setCurrentStep(step);
|
|
244
|
+
(_b = stepSwiperRef.current) === null || _b === void 0 ? void 0 : _b.slideTo(step - 1);
|
|
245
|
+
};
|
|
256
246
|
var handleSelectToken = function (token) {
|
|
257
247
|
setSelectedToken(token);
|
|
258
248
|
if (!!token) {
|
|
@@ -312,6 +302,11 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
312
302
|
setInputAmount("");
|
|
313
303
|
(_a = amountDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
314
304
|
};
|
|
305
|
+
var handleOnClose = function () {
|
|
306
|
+
var _a;
|
|
307
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
308
|
+
gotoStep(ReceiveStep.SELECT_METHOD);
|
|
309
|
+
};
|
|
315
310
|
(0, react_1.useEffect)(function () {
|
|
316
311
|
if (isInitPasscode && !receiveExternalTokens) {
|
|
317
312
|
updateReceiveExternalToken();
|
|
@@ -328,7 +323,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
328
323
|
var blockchainAddress = (_a = blockchainWallets === null || blockchainWallets === void 0 ? void 0 : blockchainWallets.find(function (item) { return item.networkSlug === (selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.slug); })) === null || _a === void 0 ? void 0 : _a.blockchainAddress;
|
|
329
324
|
return blockchainAddress;
|
|
330
325
|
}, [blockchainWallets, masterWallet, selectedMethod, selectedNetwork]);
|
|
331
|
-
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { sx: props.sx, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT,
|
|
326
|
+
return ((0, jsx_runtime_1.jsx)(RequireConnect_1.default, { sx: props.sx, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
|
|
332
327
|
width: "100%",
|
|
333
328
|
}, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_INTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); } }), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 24, height: 24 }, children: SvgPath_1.IC_RECEIVE_EXTERNAL }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); } })] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
334
329
|
position: "relative",
|
|
@@ -344,8 +339,11 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
344
339
|
? "max-height 0.3s linear 0.3s"
|
|
345
340
|
: "max-height 0s linear",
|
|
346
341
|
}, children: (0, jsx_runtime_1.jsx)(Share_1.default, { elementId: "share-receive-info", onProgress: handleShareProgress, onFinish: handleShareFinish, imageName: sharedImageName, children: (0, jsx_runtime_1.jsx)(BottomActionLayout_1.default, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { fullWidth: true, status: isSharing ? Button_1.BUTTON_STATUS.LOADING : undefined, children: "Share" }) }) }) }), children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { padding: theme.mixins.pagePadding }, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: stepSwiperRef, swiperProps: {
|
|
342
|
+
// autoHeight: true,
|
|
347
343
|
spaceBetween: 32,
|
|
348
|
-
}, disableSwipe: true,
|
|
344
|
+
}, disableSwipe: true,
|
|
345
|
+
// key={`step_${currentStep}`}
|
|
346
|
+
initialActiveTab: currentStep - 1, children: [(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.g12, height: "fit-content" }), children: [!receiveTokens && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) === 0 && (0, jsx_runtime_1.jsx)(EmptyData_1.default, {}), receiveTokens && (receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputBase, { startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_SEARCH }) }), placeholder: "Search", sx: {
|
|
349
347
|
borderRadius: theme.mixins.customRadius.r12,
|
|
350
348
|
border: "1px solid",
|
|
351
349
|
borderColor: theme.palette.border.accent3,
|
|
@@ -393,7 +391,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
393
391
|
: "Address" }), selectedMethod === ReceiveMethods.RECEIVE_INTERNAL && ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { trigger: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16, mb: "3px" }, children: SvgPath_1.IC_TOOLTIP }), children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.warning), children: ["This address is used to receive token by internal transfer. You can not use it for blockchain transaction. If you want to receive token by blockchain, please select the ", (0, jsx_runtime_1.jsx)("strong", { children: "Receive External" }), " method instead."] }) }) }))] }), (0, jsx_runtime_1.jsxs)(CopyTextComponent_1.default, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), value: receiveAddress || "", children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", maxWidth: "85%" }), children: receiveAddress }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_COPY })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
394
392
|
color: theme.palette.border.accent,
|
|
395
393
|
width: "100%",
|
|
396
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.
|
|
394
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [!!amount && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Amount" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: [amount, " ", selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name] }) })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Minimum Top Up" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: ["0.003 ", selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Top Up Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 7 Minutes" }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { color: theme.palette.text.accent, fontSize: theme.typography.fontSize13 }), children: "Withdrawal Arrival Time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.activityTitle), { fontSize: theme.typography.fontSize13 }), children: "~ 20 Minutes" }) })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
397
395
|
color: theme.palette.border.accent,
|
|
398
396
|
width: "100%",
|
|
399
397
|
mt: theme.mixins.customMargin.m12,
|
|
@@ -13,7 +13,7 @@ exports.IC_CLOSE = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", v
|
|
|
13
13
|
exports.IC_TIMELINE_DOT = ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("rect", { width: "14", height: "14", rx: "7", fill: "#C5E99F" }), (0, jsx_runtime_1.jsx)("circle", { cx: "7", cy: "7", r: "3", fill: "#121212" })] }));
|
|
14
14
|
exports.IC_COPY = ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_860_5627", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "20", height: "20", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_860_5627)", children: (0, jsx_runtime_1.jsx)("path", { d: "M7.54804 14.5826C7.17293 14.5826 6.85587 14.4531 6.59685 14.1941C6.33783 13.9351 6.20831 13.618 6.20831 13.2429V3.75577C6.20831 3.38066 6.33783 3.06359 6.59685 2.80456C6.85587 2.54553 7.17293 2.41602 7.54804 2.41602H15.0352C15.4103 2.41602 15.7273 2.54553 15.9864 2.80456C16.2454 3.06359 16.3749 3.38066 16.3749 3.75577V13.2429C16.3749 13.618 16.2454 13.9351 15.9864 14.1941C15.7273 14.4531 15.4103 14.5826 15.0352 14.5826H7.54804ZM7.54804 13.4993H15.0352C15.0993 13.4993 15.158 13.4726 15.2115 13.4192C15.2649 13.3658 15.2916 13.307 15.2916 13.2429V3.75577C15.2916 3.69166 15.2649 3.63288 15.2115 3.57945C15.158 3.52604 15.0993 3.49933 15.0352 3.49933H7.54804C7.48393 3.49933 7.42517 3.52604 7.37175 3.57945C7.31832 3.63288 7.2916 3.69166 7.2916 3.75577V13.2429C7.2916 13.307 7.31832 13.3658 7.37175 13.4192C7.42517 13.4726 7.48393 13.4993 7.54804 13.4993ZM4.96473 17.1659C4.58963 17.1659 4.27257 17.0364 4.01354 16.7774C3.75451 16.5184 3.625 16.2013 3.625 15.8262V5.25577H4.70831V15.8262C4.70831 15.8903 4.73502 15.9491 4.78844 16.0025C4.84187 16.0559 4.90063 16.0826 4.96473 16.0826H13.5352V17.1659H4.96473Z", fill: "#1E4841" }) })] }));
|
|
15
15
|
exports.IC_FACE_ID = ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.125 7.5V5.83333C3.125 5.115 3.41 4.42583 3.91833 3.91833C4.42583 3.41 5.115 3.125 5.83333 3.125H7.5C7.845 3.125 8.125 2.845 8.125 2.5C8.125 2.155 7.845 1.875 7.5 1.875H5.83333C4.78333 1.875 3.77667 2.29167 3.03417 3.03417C2.29167 3.77667 1.875 4.78333 1.875 5.83333V7.5C1.875 7.845 2.155 8.125 2.5 8.125C2.845 8.125 3.125 7.845 3.125 7.5Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5 3.125H14.1667C14.885 3.125 15.5742 3.41 16.0817 3.91833C16.59 4.42583 16.875 5.115 16.875 5.83333V7.5C16.875 7.845 17.155 8.125 17.5 8.125C17.845 8.125 18.125 7.845 18.125 7.5V5.83333C18.125 4.78333 17.7083 3.77667 16.9658 3.03417C16.2233 2.29167 15.2167 1.875 14.1667 1.875C13.2483 1.875 12.5 1.875 12.5 1.875C12.155 1.875 11.875 2.155 11.875 2.5C11.875 2.845 12.155 3.125 12.5 3.125Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.875 12.5V14.1667C1.875 15.2167 2.29167 16.2233 3.03417 16.9658C3.77667 17.7083 4.78333 18.125 5.83333 18.125H7.5C7.845 18.125 8.125 17.845 8.125 17.5C8.125 17.155 7.845 16.875 7.5 16.875H5.83333C5.115 16.875 4.42583 16.59 3.91833 16.0817C3.41 15.5742 3.125 14.885 3.125 14.1667C3.125 13.2483 3.125 12.5 3.125 12.5C3.125 12.155 2.845 11.875 2.5 11.875C2.155 11.875 1.875 12.155 1.875 12.5Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5 18.125H14.1667C15.2167 18.125 16.2233 17.7083 16.9658 16.9658C17.7083 16.2233 18.125 15.2167 18.125 14.1667C18.125 13.2483 18.125 12.5 18.125 12.5C18.125 12.155 17.845 11.875 17.5 11.875C17.155 11.875 16.875 12.155 16.875 12.5V14.1667C16.875 14.885 16.59 15.5742 16.0817 16.0817C15.5742 16.59 14.885 16.875 14.1667 16.875C13.2483 16.875 12.5 16.875 12.5 16.875C12.155 16.875 11.875 17.155 11.875 17.5C11.875 17.845 12.155 18.125 12.5 18.125Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.2915 7.08398V7.91732C12.2915 8.26232 12.5715 8.54232 12.9165 8.54232C13.2615 8.54232 13.5415 8.26232 13.5415 7.91732V7.08398C13.5415 6.73898 13.2615 6.45898 12.9165 6.45898C12.5715 6.45898 12.2915 6.73898 12.2915 7.08398Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.4585 7.08398V7.91732C6.4585 8.26232 6.7385 8.54232 7.0835 8.54232C7.4285 8.54232 7.7085 8.26232 7.7085 7.91732V7.08398C7.7085 6.73898 7.4285 6.45898 7.0835 6.45898C6.7385 6.45898 6.4585 6.73898 6.4585 7.08398Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.79152 10.4473V8.33398C9.79152 7.98898 10.0715 7.70898 10.4165 7.70898C10.7615 7.70898 11.0415 7.98898 11.0415 8.33398V10.834C11.0415 11.0707 10.9073 11.2873 10.6957 11.3932L9.86235 11.8098C9.55402 11.964 9.17818 11.839 9.02402 11.5298C8.86985 11.2215 8.99485 10.8457 9.30402 10.6915L9.79152 10.4473Z", fill: "#121212" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.4752 12.4743C12.5885 12.361 12.7443 12.291 12.9168 12.291C13.2618 12.291 13.5418 12.571 13.5418 12.916C13.5418 13.0885 13.4718 13.2443 13.3585 13.3577C13.2452 13.471 13.3585 13.3585 13.3577 13.3593C11.5035 15.2135 8.49683 15.2135 6.64266 13.3593C6.64183 13.3585 6.64183 13.3577 6.64183 13.3577C6.5285 13.2443 6.4585 13.0885 6.4585 12.916C6.4585 12.571 6.7385 12.291 7.0835 12.291C7.256 12.291 7.41183 12.361 7.52516 12.4743C7.6385 12.5877 7.526 12.4743 7.52683 12.4752C8.89266 13.841 11.1077 13.841 12.4735 12.4752C12.4743 12.4743 12.4752 12.4743 12.4752 12.4743Z", fill: "#121212" })] }));
|
|
16
|
-
exports.IC_PASSCODE = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "
|
|
16
|
+
exports.IC_PASSCODE = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsxs)("g", { opacity: "0.16", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_899_12669", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "20", height: "20", children: (0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_899_12669)", children: (0, jsx_runtime_1.jsx)("path", { d: "M1.87497 15.6252V14.3752H18.125V15.6252H1.87497ZM2.57684 10.6156L1.71788 10.1187L2.47434 8.78872H0.961426V7.79497H2.47434L1.71788 6.50664L2.57684 6.00977L3.3333 7.29831L4.08976 6.00977L4.94872 6.50664L4.19226 7.79497H5.70518V8.78872H4.19226L4.94872 10.1187L4.08976 10.6156L3.3333 9.28539L2.57684 10.6156ZM9.24351 10.6156L8.38455 10.1187L9.14101 8.78872H7.62809V7.79497H9.14101L8.38455 6.50664L9.24351 6.00977L9.99997 7.29831L10.7564 6.00977L11.6154 6.50664L10.8589 7.79497H12.3718V8.78872H10.8589L11.6154 10.1187L10.7564 10.6156L9.99997 9.28539L9.24351 10.6156ZM15.9102 10.6156L15.0512 10.1187L15.8077 8.78872H14.2948V7.79497H15.8077L15.0512 6.50664L15.9102 6.00977L16.6666 7.29831L17.4231 6.00977L18.2821 6.50664L17.5256 7.79497H19.0385V8.78872H17.5256L18.2821 10.1187L17.4231 10.6156L16.6666 9.28539L15.9102 10.6156Z", fill: "#121212" }) })] }) }));
|
|
17
17
|
exports.IC_HELP = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M10 5.03501C8.62634 3.80281 6.84533 3.12246 5 3.12501C4.12333 3.12501 3.28167 3.27501 2.5 3.55167V15.4267C3.30302 15.1434 4.14847 14.9991 5 15C6.92083 15 8.67333 15.7225 10 16.91M10 5.03501C11.3736 3.80274 13.1547 3.12238 15 3.12501C15.8767 3.12501 16.7183 3.27501 17.5 3.55167V15.4267C16.697 15.1434 15.8515 14.9991 15 15C13.1547 14.9975 11.3737 15.6778 10 16.91M10 5.03501V16.91", stroke: "#121212", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
18
18
|
exports.IC_SWAP = ((0, jsx_runtime_1.jsx)("svg", { width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 4.75L4.75 1M4.75 1L8.5 4.75M4.75 1V12.25M16 12.25L12.25 16M12.25 16L8.5 12.25M12.25 16V4.75", stroke: "#1E4841", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
19
19
|
exports.IC_ARROW_BLACK_DROP = ((0, jsx_runtime_1.jsx)("svg", { width: "9", height: "6", viewBox: "0 0 9 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M4.40375 5.2016L0 0.797852H8.8075L4.40375 5.2016Z", fill: "#121212" }) }));
|
|
@@ -28,5 +28,5 @@ exports.IC_ARROW_DROP_UP = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height:
|
|
|
28
28
|
exports.IC_ARROW_DROP_DOWN = ((0, jsx_runtime_1.jsx)("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5L4 4.5L0 0.5L8 0.5Z", fill: "#A3A3A3" }) }));
|
|
29
29
|
exports.IC_CHECK = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.5 10C0.5 4.615 4.865 0.25 10.25 0.25C15.635 0.25 20 4.615 20 10C20 15.385 15.635 19.75 10.25 19.75C4.865 19.75 0.5 15.385 0.5 10ZM13.86 8.186C13.92 8.10605 13.9634 8.01492 13.9877 7.91795C14.012 7.82098 14.0166 7.72014 14.0014 7.62135C13.9861 7.52257 13.9512 7.42782 13.8989 7.3427C13.8465 7.25757 13.7776 7.18378 13.6963 7.12565C13.6149 7.06753 13.5228 7.02624 13.4253 7.00423C13.3278 6.98221 13.2269 6.97991 13.1285 6.99746C13.0301 7.01501 12.9362 7.05205 12.8523 7.10641C12.7684 7.16077 12.6962 7.23135 12.64 7.314L9.404 11.844L7.78 10.22C7.63783 10.0875 7.44978 10.0154 7.25548 10.0188C7.06118 10.0223 6.87579 10.101 6.73838 10.2384C6.60097 10.3758 6.52225 10.5612 6.51882 10.7555C6.5154 10.9498 6.58752 11.1378 6.72 11.28L8.97 13.53C9.04699 13.6069 9.1398 13.6662 9.24199 13.7036C9.34418 13.7411 9.45329 13.7559 9.56176 13.7469C9.67023 13.738 9.77546 13.7055 9.87013 13.6519C9.9648 13.5982 10.0467 13.5245 10.11 13.436L13.86 8.186Z", fill: "#1E4841" }) }));
|
|
30
30
|
exports.IC_UNCHECK = ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M19 10C19 11.1819 18.7672 12.3522 18.3149 13.4442C17.8626 14.5361 17.1997 15.5282 16.364 16.364C15.5282 17.1997 14.5361 17.8626 13.4442 18.3149C12.3522 18.7672 11.1819 19 10 19C8.8181 19 7.64778 18.7672 6.55585 18.3149C5.46392 17.8626 4.47177 17.1997 3.63604 16.364C2.80031 15.5282 2.13738 14.5361 1.68508 13.4442C1.23279 12.3522 1 11.1819 1 10C1 7.61305 1.94821 5.32387 3.63604 3.63604C5.32387 1.94821 7.61305 1 10 1C12.3869 1 14.6761 1.94821 16.364 3.63604C18.0518 5.32387 19 7.61305 19 10Z", stroke: "#E5E6E6", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
31
|
-
exports.IC_BACK = ((0, jsx_runtime_1.
|
|
32
|
-
exports.IC_TOOLTIP = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841",
|
|
31
|
+
exports.IC_BACK = ((0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("mask", { id: "mask0_452_16413", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24", children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24", fill: "#D9D9D9" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_452_16413)", children: (0, jsx_runtime_1.jsx)("path", { d: "M14 17.6534L8.34619 11.9995L14 6.3457L15.0538 7.39953L10.4538 11.9995L15.0538 16.5995L14 17.6534Z", fill: "#121212" }) })] }));
|
|
32
|
+
exports.IC_TOOLTIP = ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5V7.5M13 7C13 7.78793 12.8448 8.56815 12.5433 9.2961C12.2417 10.0241 11.7998 10.6855 11.2426 11.2426C10.6855 11.7998 10.0241 12.2417 9.2961 12.5433C8.56815 12.8448 7.78793 13 7 13C6.21207 13 5.43185 12.8448 4.7039 12.5433C3.97595 12.2417 3.31451 11.7998 2.75736 11.2426C2.20021 10.6855 1.75825 10.0241 1.45672 9.2961C1.15519 8.56815 1 7.78793 1 7C1 5.4087 1.63214 3.88258 2.75736 2.75736C3.88258 1.63214 5.4087 1 7 1C8.5913 1 10.1174 1.63214 11.2426 2.75736C12.3679 3.88258 13 5.4087 13 7ZM7 9.5H7.00533V9.50533H7V9.5Z", stroke: "#1E4841", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { ConfirmLayoutProps } from "../ConfirmLayout";
|
|
2
|
+
import { SendInternalResponse } from "../../../services/axios/send-internal-service/type";
|
|
2
3
|
import { InstructionBody } from "../../../services/axios/instructions-service/type";
|
|
3
|
-
import { InstructionResponse } from "../../../services/axios/instructions-service/response.type";
|
|
4
|
-
export type TransferConfirmationData = InstructionBody & {
|
|
5
|
-
amount: number;
|
|
6
|
-
currency_slug: string;
|
|
7
|
-
to_address: string;
|
|
8
|
-
};
|
|
9
4
|
interface TransferConfirmationProps extends Omit<ConfirmLayoutProps, "action"> {
|
|
10
|
-
transferData:
|
|
5
|
+
transferData: InstructionBody;
|
|
11
6
|
transferContent: React.ReactNode;
|
|
12
7
|
titleHeader: string;
|
|
13
|
-
onTransferSuccess?: (data:
|
|
8
|
+
onTransferSuccess?: (data: SendInternalResponse) => any;
|
|
14
9
|
}
|
|
15
|
-
export interface
|
|
10
|
+
export interface TransferTokenRef {
|
|
16
11
|
open: () => void;
|
|
17
12
|
close: () => void;
|
|
18
13
|
}
|
|
19
|
-
export declare enum
|
|
14
|
+
export declare enum TransferError {
|
|
20
15
|
TOKEN_NOT_FOUND = "Token not found",
|
|
21
16
|
NOT_ENOUGH_BALANCE = "Not enough balance",
|
|
22
17
|
MAX_AMOUNT = "Max amount",
|
|
23
18
|
MIN_AMOUNT = "Min amount",
|
|
24
19
|
FAILED = "Failed"
|
|
25
20
|
}
|
|
26
|
-
export declare const TransferConfirmation: import("react").ForwardRefExoticComponent<Omit<TransferConfirmationProps, "ref"> & import("react").RefAttributes<
|
|
21
|
+
export declare const TransferConfirmation: import("react").ForwardRefExoticComponent<Omit<TransferConfirmationProps, "ref"> & import("react").RefAttributes<TransferTokenRef>>;
|
|
27
22
|
export default TransferConfirmation;
|
|
@@ -85,7 +85,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
85
85
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
86
86
|
};
|
|
87
87
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
88
|
-
exports.TransferConfirmation = exports.
|
|
88
|
+
exports.TransferConfirmation = exports.TransferError = void 0;
|
|
89
89
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
90
90
|
var Button_1 = __importStar(require("../Button"));
|
|
91
91
|
var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
|
|
@@ -101,14 +101,14 @@ var validate_wallet_address_service_1 = __importDefault(require("../../../servic
|
|
|
101
101
|
var type_2 = require("../../../services/axios/validate-wallet-address-service/type");
|
|
102
102
|
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
103
103
|
var instructions_service_1 = __importDefault(require("../../../services/axios/instructions-service"));
|
|
104
|
-
var
|
|
105
|
-
(function (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})(
|
|
104
|
+
var TransferError;
|
|
105
|
+
(function (TransferError) {
|
|
106
|
+
TransferError["TOKEN_NOT_FOUND"] = "Token not found";
|
|
107
|
+
TransferError["NOT_ENOUGH_BALANCE"] = "Not enough balance";
|
|
108
|
+
TransferError["MAX_AMOUNT"] = "Max amount";
|
|
109
|
+
TransferError["MIN_AMOUNT"] = "Min amount";
|
|
110
|
+
TransferError["FAILED"] = "Failed";
|
|
111
|
+
})(TransferError || (exports.TransferError = TransferError = {}));
|
|
112
112
|
exports.TransferConfirmation = (0, react_1.forwardRef)(function (props, ref) {
|
|
113
113
|
var _a;
|
|
114
114
|
var theme = (0, material_1.useTheme)();
|
|
@@ -121,29 +121,34 @@ exports.TransferConfirmation = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
121
121
|
var _e = (0, react_1.useState)(Button_1.BUTTON_STATUS.ENABLED), buttonStatus = _e[0], setButtonStatus = _e[1];
|
|
122
122
|
var _f = (0, react_1.useState)(false), isValidatingAddress = _f[0], setIsValidatingAddress = _f[1];
|
|
123
123
|
var _g = (0, react_1.useState)(undefined), errorAddress = _g[0], setErrorAddress = _g[1];
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
var _h = (0, react_1.useMemo)(function () {
|
|
125
|
+
return {
|
|
126
|
+
transferDetails: transferData.instructions[0],
|
|
127
|
+
amount: transferData.instructions[0].currency_update_info[0].amount,
|
|
128
|
+
currencySlug: transferData.instructions[0].currency_update_info[0].currency_slug,
|
|
129
|
+
};
|
|
130
|
+
}, [transferData]), transferDetails = _h.transferDetails, amount = _h.amount, currencySlug = _h.currencySlug;
|
|
131
|
+
var toAddress = transferDetails.master_wallet_address;
|
|
127
132
|
var token = (0, react_1.useMemo)(function () {
|
|
128
133
|
return sendInternalTokens === null || sendInternalTokens === void 0 ? void 0 : sendInternalTokens.find(function (token) { return token.slug === currencySlug; });
|
|
129
134
|
}, [currencySlug, sendInternalTokens]);
|
|
130
135
|
var validateAmount = (0, react_1.useCallback)(function () {
|
|
131
136
|
if (!token) {
|
|
132
|
-
setError(
|
|
137
|
+
setError(TransferError.TOKEN_NOT_FOUND);
|
|
133
138
|
return false;
|
|
134
139
|
}
|
|
135
140
|
if (amount > token.max_value) {
|
|
136
|
-
setError(
|
|
141
|
+
setError(TransferError.MAX_AMOUNT);
|
|
137
142
|
setErrorAmount(token.max_value);
|
|
138
143
|
return false;
|
|
139
144
|
}
|
|
140
145
|
if (amount < token.min_value) {
|
|
141
|
-
setError(
|
|
146
|
+
setError(TransferError.MIN_AMOUNT);
|
|
142
147
|
setErrorAmount(token.min_value);
|
|
143
148
|
return false;
|
|
144
149
|
}
|
|
145
150
|
if (amount > +token.balance) {
|
|
146
|
-
setError(
|
|
151
|
+
setError(TransferError.NOT_ENOUGH_BALANCE);
|
|
147
152
|
setErrorAmount(token.balance);
|
|
148
153
|
return false;
|
|
149
154
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfirmLayoutProps } from "
|
|
1
|
+
import { ConfirmLayoutProps } from "../ConfirmLayout";
|
|
2
2
|
import { SendInternalBody, SendInternalResponse } from "../../../services/axios/send-internal-service/type";
|
|
3
3
|
export type TransferInternalData = Omit<SendInternalBody, "passcode">;
|
|
4
4
|
interface TransferTokenProps extends Omit<ConfirmLayoutProps, "action"> {
|
|
@@ -86,13 +86,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
86
86
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87
87
|
exports.TransferInternal = exports.TransferError = void 0;
|
|
88
88
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
89
|
-
var Button_1 = __importStar(require("
|
|
90
|
-
var ConfirmLayout_1 = __importDefault(require("
|
|
91
|
-
var Formatter_1 = __importDefault(require("
|
|
92
|
-
var ConfirmByPasscode_1 = __importDefault(require("
|
|
89
|
+
var Button_1 = __importStar(require("../Button"));
|
|
90
|
+
var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
|
|
91
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
92
|
+
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
93
93
|
var react_1 = require("react");
|
|
94
|
-
var Text_1 = __importDefault(require("
|
|
95
|
-
var RequireConnect_1 = __importDefault(require("
|
|
94
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
95
|
+
var RequireConnect_1 = __importDefault(require("../RequireConnect"));
|
|
96
96
|
var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
|
|
97
97
|
var type_1 = require("../../../services/axios/get-activities-service/type");
|
|
98
98
|
var useWithdrawData_1 = __importDefault(require("../../../hooks/useWithdrawData"));
|
|
@@ -35,4 +35,3 @@ __exportStar(require("./components/index"), exports);
|
|
|
35
35
|
__exportStar(require("./providers/TekWalletProvider"), exports);
|
|
36
36
|
__exportStar(require("./components/ui/UpdateLockToken"), exports);
|
|
37
37
|
__exportStar(require("./components/ui/SendExternalTokenWithdrawn"), exports);
|
|
38
|
-
__exportStar(require("./components/ui/TransferConfirmation"), exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InstructionResponse } from "./
|
|
2
|
-
import { InstructionBody } from "./type";
|
|
1
|
+
import { InstructionBody, InstructionResponse } from "./type";
|
|
3
2
|
declare const instructionsService: (body: InstructionBody) => Promise<InstructionResponse>;
|
|
4
3
|
export default instructionsService;
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export type InstructionMetadata = string;
|
|
2
|
-
export interface InstructionResponse {
|
|
3
|
-
success: boolean;
|
|
4
|
-
message: string;
|
|
5
|
-
timestamp: string;
|
|
6
|
-
data?: DataInstructionResponse;
|
|
7
|
-
}
|
|
8
|
-
interface DataInstructionResponse {
|
|
9
|
-
id?: number;
|
|
10
|
-
transaction_type?: string;
|
|
11
|
-
from_address?: string;
|
|
12
|
-
to_address?: string;
|
|
13
|
-
network?: string;
|
|
14
|
-
currency_slug?: string;
|
|
15
|
-
fee?: string;
|
|
16
|
-
amount?: string;
|
|
17
|
-
transaction_status?: string;
|
|
18
|
-
user_created?: string;
|
|
19
|
-
user_updated?: string;
|
|
20
|
-
date_created?: string;
|
|
21
|
-
date_updated?: null;
|
|
22
|
-
description?: null;
|
|
23
|
-
currency_usd_rate?: null;
|
|
24
|
-
from_app_slug?: string;
|
|
25
|
-
fee_info?: FeeInfo;
|
|
26
|
-
order_id?: null;
|
|
27
|
-
currency_data?: Currency;
|
|
28
|
-
metadata?: InstructionMetadata;
|
|
29
|
-
}
|
|
30
|
-
interface FeeInfo {
|
|
31
|
-
fee_detail?: FeeDetail[];
|
|
32
|
-
fee_in_currency?: number;
|
|
33
|
-
fee_in_usd?: number;
|
|
34
|
-
original_amount_in_currency?: number;
|
|
35
|
-
original_amount_in_usd?: number;
|
|
36
|
-
original_currency?: string;
|
|
37
|
-
}
|
|
38
|
-
interface FeeDetail {
|
|
39
|
-
currency?: Currency;
|
|
40
|
-
fee_fixed?: number;
|
|
41
|
-
fee_in_currency?: number;
|
|
42
|
-
fee_in_usd?: number;
|
|
43
|
-
fee_percent?: number;
|
|
44
|
-
fee_type?: FeeType;
|
|
45
|
-
}
|
|
46
|
-
interface FeeType {
|
|
47
|
-
name?: string;
|
|
48
|
-
slug?: string;
|
|
49
|
-
}
|
|
50
|
-
interface Currency {
|
|
51
|
-
full_name?: string;
|
|
52
|
-
icon?: string;
|
|
53
|
-
id?: number;
|
|
54
|
-
link?: string;
|
|
55
|
-
name?: string;
|
|
56
|
-
slug?: string;
|
|
57
|
-
usd_rate?: number;
|
|
58
|
-
}
|
|
59
|
-
export {};
|