@matchain/matchid-sdk-react 0.1.56-alpha.3 → 0.1.56-alpha.5
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/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +59 -47
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +3 -3
- package/dist/{chunk-M5LCJX2T.mjs → chunk-2SJCPZJQ.mjs} +2 -2
- package/dist/{chunk-FKXS2XRG.mjs → chunk-GD7URBBZ.mjs} +54 -1
- package/dist/chunk-GD7URBBZ.mjs.map +1 -0
- package/dist/{chunk-KDVKIXOS.mjs → chunk-YR46VC65.mjs} +393 -354
- package/dist/chunk-YR46VC65.mjs.map +1 -0
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +416 -360
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +2 -2
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +234 -178
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +2 -2
- package/dist/icon.d.mts +2 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +53 -0
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +7 -1
- package/dist/{index-CsUEaGtM.d.ts → index-BcuSCgol.d.ts} +2 -2
- package/dist/{index-CPTgrfjn.d.mts → index-BlMLqmS2.d.mts} +1 -1
- package/dist/{index-B7ZEyP1j.d.ts → index-C1Nyy5zx.d.ts} +1 -1
- package/dist/{index-FKxw4Vaa.d.mts → index-CBcBTQyU.d.mts} +1 -1
- package/dist/{index-BXbfmVoU.d.mts → index-CD0dACxf.d.mts} +2 -2
- package/dist/{index-TjbO7d74.d.mts → index-CER00guz.d.mts} +1 -1
- package/dist/{index-BtjgRcNJ.d.ts → index-CjekOYJl.d.mts} +2 -2
- package/dist/{index-C82WIWvx.d.ts → index-DN-jrh8-.d.ts} +13 -3
- package/dist/{index-BKSGbw7b.d.mts → index-DdN22cwf.d.ts} +2 -2
- package/dist/{index-YPRyEYt6.d.mts → index-DkIIQLbh.d.ts} +10 -4
- package/dist/{index-4dZbgWG2.d.ts → index-DlaCsN95.d.ts} +1 -1
- package/dist/{index-DK7l3lsH.d.ts → index-lh6qBAf_.d.mts} +10 -4
- package/dist/{index-CwHXzvvB.d.ts → index-o0WW1c5O.d.ts} +1 -1
- package/dist/{index-D7E317WV.d.mts → index-xThRnNN3.d.mts} +13 -3
- package/dist/index.css +35 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +497 -412
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{types-DEsY_CPH.d.mts → types-CheN9vHJ.d.mts} +4 -0
- package/dist/{types-DEsY_CPH.d.ts → types-CheN9vHJ.d.ts} +4 -0
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +192 -105
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +4 -2
- package/example/src/pages/UI/components/Checkbox.tsx +10 -0
- package/example/src/pages/UI/components/Input.tsx +12 -0
- package/example/src/pages/UI/index.tsx +4 -0
- package/package.json +1 -1
- package/dist/chunk-FKXS2XRG.mjs.map +0 -1
- package/dist/chunk-KDVKIXOS.mjs.map +0 -1
- /package/dist/{chunk-M5LCJX2T.mjs.map → chunk-2SJCPZJQ.mjs.map} +0 -0
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
BitgetIcon,
|
|
27
27
|
CheckIcon,
|
|
28
28
|
CheckRoundIcon,
|
|
29
|
+
CheckboxCheckedIcon,
|
|
30
|
+
CheckboxIcon,
|
|
29
31
|
CloseEyeIcon,
|
|
30
32
|
CloseRoundIcon,
|
|
31
33
|
CopyIcon,
|
|
@@ -41,6 +43,7 @@ import {
|
|
|
41
43
|
GoogleIcon,
|
|
42
44
|
InfoLineIcon,
|
|
43
45
|
InfoRoundIcon,
|
|
46
|
+
InputLengthIcon,
|
|
44
47
|
LeatherIcon,
|
|
45
48
|
LinkedinIcon,
|
|
46
49
|
LoadingIcon_default,
|
|
@@ -63,7 +66,7 @@ import {
|
|
|
63
66
|
XIcon,
|
|
64
67
|
XverseIcon,
|
|
65
68
|
YoutubeIcon
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-GD7URBBZ.mjs";
|
|
67
70
|
import {
|
|
68
71
|
confirm_default,
|
|
69
72
|
connecting_default,
|
|
@@ -107,7 +110,7 @@ __export(components_exports, {
|
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
// src/components/EmailModal/index.tsx
|
|
110
|
-
import { useEffect as
|
|
113
|
+
import { useEffect as useEffect21, useState as useState19 } from "react";
|
|
111
114
|
|
|
112
115
|
// src/ui/Modal/index.tsx
|
|
113
116
|
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
@@ -240,7 +243,7 @@ function ConfirmModal({
|
|
|
240
243
|
}
|
|
241
244
|
|
|
242
245
|
// src/components/EmailModal/StepEmail.tsx
|
|
243
|
-
import { useEffect as
|
|
246
|
+
import { useEffect as useEffect5, useMemo, useState as useState4 } from "react";
|
|
244
247
|
|
|
245
248
|
// src/ui/Button/index.tsx
|
|
246
249
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
@@ -280,24 +283,45 @@ function Button({
|
|
|
280
283
|
}
|
|
281
284
|
|
|
282
285
|
// src/ui/Input/index.tsx
|
|
283
|
-
import { useState as useState3 } from "react";
|
|
286
|
+
import { useEffect as useEffect4, useRef, useState as useState3 } from "react";
|
|
284
287
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
285
288
|
function Input({
|
|
286
289
|
onChange,
|
|
287
290
|
type,
|
|
288
291
|
after,
|
|
292
|
+
showLength = false,
|
|
293
|
+
showClear = true,
|
|
289
294
|
className = "",
|
|
295
|
+
rows = 1,
|
|
296
|
+
maxRows = 4,
|
|
297
|
+
children,
|
|
290
298
|
...props
|
|
291
299
|
}) {
|
|
292
300
|
const [inputType, setInputType] = useState3(type);
|
|
293
301
|
const isDownMd = useDownMd();
|
|
302
|
+
const textareaRef = useRef(null);
|
|
303
|
+
useEffect4(() => {
|
|
304
|
+
const textarea = textareaRef.current;
|
|
305
|
+
if (textarea) {
|
|
306
|
+
textarea.style.height = "auto";
|
|
307
|
+
const lineHeight = 24;
|
|
308
|
+
const maxHeight = lineHeight * 4;
|
|
309
|
+
textarea.style.height = Math.min(textarea.scrollHeight, maxHeight) + "px";
|
|
310
|
+
}
|
|
311
|
+
}, [props.value]);
|
|
294
312
|
return /* @__PURE__ */ jsxs2(
|
|
295
313
|
"div",
|
|
296
314
|
{
|
|
297
|
-
className: `matchid-input-box ${props.value && props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`,
|
|
315
|
+
className: `matchid-input-box matchid-input-${type} ${props.value && props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`,
|
|
316
|
+
style: {
|
|
317
|
+
// @ts-ignore
|
|
318
|
+
"--max-rows": maxRows
|
|
319
|
+
},
|
|
298
320
|
children: [
|
|
299
|
-
/* @__PURE__ */ jsx4("
|
|
300
|
-
|
|
321
|
+
children ?? (type == "textarea" ? /* @__PURE__ */ jsx4("textarea", { rows: 1, onChange, ...props, className: "matchid-input-field", ref: textareaRef, style: {
|
|
322
|
+
maxHeight: maxRows * 24 + "px"
|
|
323
|
+
} }) : /* @__PURE__ */ jsx4("input", { type: inputType, onChange, ...props, className: "matchid-input-field" })),
|
|
324
|
+
type != "textarea" && showClear && props.value && props.value.length > 0 && /* @__PURE__ */ jsx4("div", { className: "matchid-input-delete-icon", onClick: (e) => {
|
|
301
325
|
if (onChange) {
|
|
302
326
|
onChange({ target: { value: "" } });
|
|
303
327
|
}
|
|
@@ -312,6 +336,14 @@ function Input({
|
|
|
312
336
|
type === "password" && /* @__PURE__ */ jsx4("div", { className: "matchid-input-eye-icon", onClick: () => {
|
|
313
337
|
setInputType(inputType === "password" ? "text" : "password");
|
|
314
338
|
}, children: inputType === "password" ? /* @__PURE__ */ jsx4(CloseEyeIcon, { size: isDownMd ? 16 : 20 }) : /* @__PURE__ */ jsx4(OpenEyeIcon, { size: isDownMd ? 16 : 20 }) }),
|
|
339
|
+
showLength && props.maxLength && /* @__PURE__ */ jsxs2("div", { className: `matchid-input-length`, children: [
|
|
340
|
+
/* @__PURE__ */ jsxs2("span", { children: [
|
|
341
|
+
props.value.length || 0,
|
|
342
|
+
"/",
|
|
343
|
+
props.maxLength
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ jsx4(InputLengthIcon, { color: "var(--icon-color)" })
|
|
346
|
+
] }),
|
|
315
347
|
after
|
|
316
348
|
]
|
|
317
349
|
}
|
|
@@ -343,7 +375,7 @@ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
|
343
375
|
function StepEmail(props) {
|
|
344
376
|
const intl = useIntl2();
|
|
345
377
|
const [emailVal, setEmailVal] = useState4("");
|
|
346
|
-
|
|
378
|
+
useEffect5(() => {
|
|
347
379
|
if (props.email) {
|
|
348
380
|
setEmailVal(props.email);
|
|
349
381
|
}
|
|
@@ -876,7 +908,7 @@ __export(hooks_exports, {
|
|
|
876
908
|
});
|
|
877
909
|
|
|
878
910
|
// src/hooks/useMatchEvents.ts
|
|
879
|
-
import { useEffect as
|
|
911
|
+
import { useEffect as useEffect6 } from "react";
|
|
880
912
|
|
|
881
913
|
// src/hooks/eventManager.ts
|
|
882
914
|
var EventManager = class {
|
|
@@ -908,7 +940,7 @@ var eventManager_default = eventManager;
|
|
|
908
940
|
|
|
909
941
|
// src/hooks/useMatchEvents.ts
|
|
910
942
|
function useMatchEvents(handlers) {
|
|
911
|
-
|
|
943
|
+
useEffect6(() => {
|
|
912
944
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
913
945
|
if (handler2) {
|
|
914
946
|
eventManager_default.on(event, handler2);
|
|
@@ -944,11 +976,11 @@ var useStore_default = useStore;
|
|
|
944
976
|
// src/hooks/useWallet.tsx
|
|
945
977
|
import { toAccount } from "viem/accounts";
|
|
946
978
|
import { createWalletClient } from "viem";
|
|
947
|
-
import { useEffect as
|
|
979
|
+
import { useEffect as useEffect9, useMemo as useMemo3 } from "react";
|
|
948
980
|
import { encodeDeployData } from "viem";
|
|
949
981
|
|
|
950
982
|
// src/context/ModalContext.tsx
|
|
951
|
-
import { useState as useState7, useCallback, createContext, useContext,
|
|
983
|
+
import { useState as useState7, useCallback, createContext, useContext, useRef as useRef2 } from "react";
|
|
952
984
|
import { createPortal } from "react-dom";
|
|
953
985
|
|
|
954
986
|
// src/ui/index.ts
|
|
@@ -956,6 +988,7 @@ var ui_exports = {};
|
|
|
956
988
|
__export(ui_exports, {
|
|
957
989
|
AlphaAvatar: () => AlphaAvatar,
|
|
958
990
|
Button: () => Button,
|
|
991
|
+
Checkbox: () => Checkbox,
|
|
959
992
|
ConfirmModal: () => ConfirmModal,
|
|
960
993
|
Drawer: () => Drawer,
|
|
961
994
|
Field: () => Field,
|
|
@@ -1000,7 +1033,7 @@ function Drawer({
|
|
|
1000
1033
|
}
|
|
1001
1034
|
|
|
1002
1035
|
// src/ui/HashPanel/index.tsx
|
|
1003
|
-
import { useEffect as
|
|
1036
|
+
import { useEffect as useEffect7, useState as useState5 } from "react";
|
|
1004
1037
|
|
|
1005
1038
|
// src/ui/ModalDrawer/index.tsx
|
|
1006
1039
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
@@ -1091,7 +1124,7 @@ function HashPanel({
|
|
|
1091
1124
|
};
|
|
1092
1125
|
const statusValue = error ? statusMaps.fail : statusMaps[status];
|
|
1093
1126
|
const [shouldRefetch, setShouldRefetch] = useState5(true);
|
|
1094
|
-
|
|
1127
|
+
useEffect7(() => {
|
|
1095
1128
|
if (hash) {
|
|
1096
1129
|
setShouldRefetch(true);
|
|
1097
1130
|
setStatus("pending");
|
|
@@ -1104,7 +1137,7 @@ function HashPanel({
|
|
|
1104
1137
|
chain,
|
|
1105
1138
|
refetchInterval: shouldRefetch ? 3e3 : false
|
|
1106
1139
|
});
|
|
1107
|
-
|
|
1140
|
+
useEffect7(() => {
|
|
1108
1141
|
if (hashQuery.data == 1 || hashQuery.data == -1) {
|
|
1109
1142
|
setShouldRefetch(false);
|
|
1110
1143
|
}
|
|
@@ -1308,29 +1341,34 @@ var LazyLottie = (props) => {
|
|
|
1308
1341
|
};
|
|
1309
1342
|
var Lottie_default = LazyLottie;
|
|
1310
1343
|
|
|
1344
|
+
// src/ui/Checkbox/index.tsx
|
|
1345
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1346
|
+
function Checkbox({
|
|
1347
|
+
checked = false,
|
|
1348
|
+
onChange
|
|
1349
|
+
}) {
|
|
1350
|
+
return checked ? /* @__PURE__ */ jsx16(CheckboxCheckedIcon, { onClick: () => onChange?.(false) }) : /* @__PURE__ */ jsx16(CheckboxIcon, { onClick: () => onChange?.(true) });
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1311
1353
|
// src/context/ModalContext.tsx
|
|
1312
|
-
import { jsx as
|
|
1354
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1313
1355
|
var ModalContext = createContext(null);
|
|
1314
1356
|
function ModalProvider({ children }) {
|
|
1315
1357
|
const [modalState, setModalState] = useState7({
|
|
1316
1358
|
modals: [],
|
|
1317
1359
|
highestZIndex: 100
|
|
1318
1360
|
});
|
|
1319
|
-
const highestIndexRef =
|
|
1361
|
+
const highestIndexRef = useRef2(100);
|
|
1320
1362
|
const getNextIndex = useCallback(() => {
|
|
1321
1363
|
highestIndexRef.current += 1;
|
|
1322
1364
|
return highestIndexRef.current;
|
|
1323
1365
|
}, []);
|
|
1324
1366
|
const closeModal = useCallback((index) => {
|
|
1325
|
-
console.log("closeModal", index);
|
|
1326
1367
|
setModalState((prevState) => ({
|
|
1327
1368
|
modals: prevState.modals.filter((modal) => modal.index !== index),
|
|
1328
1369
|
highestZIndex: prevState.highestZIndex
|
|
1329
1370
|
}));
|
|
1330
1371
|
}, []);
|
|
1331
|
-
useEffect7(() => {
|
|
1332
|
-
console.log("modalState", modalState);
|
|
1333
|
-
}, [modalState]);
|
|
1334
1372
|
const show = useCallback((content, index) => {
|
|
1335
1373
|
setModalState((prevState) => {
|
|
1336
1374
|
const modalIndex = index ?? getNextIndex();
|
|
@@ -1357,7 +1395,7 @@ function ModalProvider({ children }) {
|
|
|
1357
1395
|
index: modalIndex,
|
|
1358
1396
|
zIndex: newZIndex,
|
|
1359
1397
|
close: () => closeModal(modalIndex),
|
|
1360
|
-
content: ({ close, zIndex }) => /* @__PURE__ */
|
|
1398
|
+
content: ({ close, zIndex }) => /* @__PURE__ */ jsx17(ModalDrawer, { showClose: true, isOpen: true, onClose: close, title: props.title, zIndex, onBack: props.onBack, children: /* @__PURE__ */ jsx17(props.content, { close, zIndex }) })
|
|
1361
1399
|
}],
|
|
1362
1400
|
highestZIndex: newZIndex
|
|
1363
1401
|
};
|
|
@@ -1365,7 +1403,7 @@ function ModalProvider({ children }) {
|
|
|
1365
1403
|
}, [getNextIndex, closeModal]);
|
|
1366
1404
|
const modalElements = modalState.modals.map(
|
|
1367
1405
|
(modal) => modal.visible ? createPortal(
|
|
1368
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ jsx17(modal.content, { zIndex: modal.zIndex, close: modal.close }, modal.index),
|
|
1369
1407
|
document.body
|
|
1370
1408
|
) : null
|
|
1371
1409
|
);
|
|
@@ -1413,7 +1451,7 @@ var useTransactionStore = create3(devtools2(persistedState2));
|
|
|
1413
1451
|
var useTransactionStore_default = useTransactionStore;
|
|
1414
1452
|
|
|
1415
1453
|
// src/hooks/useWallet.tsx
|
|
1416
|
-
import { jsx as
|
|
1454
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1417
1455
|
var AppClientId = "react-sdk-" + getVersion();
|
|
1418
1456
|
function useWallet() {
|
|
1419
1457
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -1503,7 +1541,7 @@ function useWallet() {
|
|
|
1503
1541
|
return void 0;
|
|
1504
1542
|
}
|
|
1505
1543
|
}, [address]);
|
|
1506
|
-
|
|
1544
|
+
useEffect9(() => {
|
|
1507
1545
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
1508
1546
|
}, [evmAccount]);
|
|
1509
1547
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -1587,12 +1625,12 @@ function useWallet() {
|
|
|
1587
1625
|
address: evmAccount.address
|
|
1588
1626
|
});
|
|
1589
1627
|
modal.show((props) => {
|
|
1590
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ jsx18(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
1591
1629
|
});
|
|
1592
1630
|
return txHash;
|
|
1593
1631
|
} catch (error) {
|
|
1594
1632
|
modal.show((props) => {
|
|
1595
|
-
return /* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsx18(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, error: typeof error == "string" ? error : error.details || error.message, chain: _chain });
|
|
1596
1634
|
});
|
|
1597
1635
|
throw error;
|
|
1598
1636
|
}
|
|
@@ -1646,14 +1684,14 @@ function useWallet() {
|
|
|
1646
1684
|
|
|
1647
1685
|
// src/hooks/useCopyClipboard.ts
|
|
1648
1686
|
import copy from "copy-to-clipboard";
|
|
1649
|
-
import { useCallback as useCallback2, useEffect as
|
|
1687
|
+
import { useCallback as useCallback2, useEffect as useEffect10, useState as useState9 } from "react";
|
|
1650
1688
|
function useCopyClipboard(timeout = 500) {
|
|
1651
1689
|
const [isCopied, setIsCopied] = useState9(false);
|
|
1652
1690
|
const staticCopy = useCallback2((text) => {
|
|
1653
1691
|
const didCopy = copy(text);
|
|
1654
1692
|
setIsCopied(didCopy);
|
|
1655
1693
|
}, []);
|
|
1656
|
-
|
|
1694
|
+
useEffect10(() => {
|
|
1657
1695
|
if (isCopied) {
|
|
1658
1696
|
const hide = setTimeout(() => {
|
|
1659
1697
|
setIsCopied(false);
|
|
@@ -1670,7 +1708,7 @@ function useCopyClipboard(timeout = 500) {
|
|
|
1670
1708
|
// src/context/ToastContext.tsx
|
|
1671
1709
|
import { useState as useState10, useCallback as useCallback3, createContext as createContext2, useContext as useContext2 } from "react";
|
|
1672
1710
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1673
|
-
import { jsx as
|
|
1711
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1674
1712
|
var ToastContext = createContext2(null);
|
|
1675
1713
|
function ToastProvider({ children, zIndex = 299 }) {
|
|
1676
1714
|
const [toasts, setToasts] = useState10([]);
|
|
@@ -1683,21 +1721,21 @@ function ToastProvider({ children, zIndex = 299 }) {
|
|
|
1683
1721
|
setTimeout(() => removeToast(id), timeout);
|
|
1684
1722
|
}, [removeToast]);
|
|
1685
1723
|
const success = useCallback3((text, timeout) => {
|
|
1686
|
-
show({ icon: /* @__PURE__ */
|
|
1724
|
+
show({ icon: /* @__PURE__ */ jsx19(CheckRoundIcon, { color: "#2FCC00", size: 24 }), text, timeout });
|
|
1687
1725
|
}, [show]);
|
|
1688
1726
|
const error = useCallback3((text, timeout) => {
|
|
1689
|
-
show({ icon: /* @__PURE__ */
|
|
1727
|
+
show({ icon: /* @__PURE__ */ jsx19(ErrorRoundIcon, { size: 24 }), text, timeout });
|
|
1690
1728
|
}, [show]);
|
|
1691
1729
|
const ToastComponent = createPortal2(
|
|
1692
|
-
/* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ jsx19("div", { className: "matchid-toast-box", style: {
|
|
1693
1731
|
zIndex
|
|
1694
1732
|
}, children: toasts.reverse().map(({ id, icon, text }) => /* @__PURE__ */ jsxs9(
|
|
1695
1733
|
"div",
|
|
1696
1734
|
{
|
|
1697
1735
|
className: "matchid-toast",
|
|
1698
1736
|
children: [
|
|
1699
|
-
icon && /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1737
|
+
icon && /* @__PURE__ */ jsx19("span", { children: icon }),
|
|
1738
|
+
/* @__PURE__ */ jsx19("span", { children: text })
|
|
1701
1739
|
]
|
|
1702
1740
|
},
|
|
1703
1741
|
id
|
|
@@ -1849,7 +1887,7 @@ function useWalletAssetListQuery({
|
|
|
1849
1887
|
import { useMemo as useMemo4, useState as useState11 } from "react";
|
|
1850
1888
|
import { createPublicClient as createPublicClient3, formatUnits, http as http3, parseUnits } from "viem";
|
|
1851
1889
|
import { FormattedMessage as FormattedMessage2, useIntl as useIntl3 } from "react-intl";
|
|
1852
|
-
import { jsx as
|
|
1890
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1853
1891
|
function useMatchChain() {
|
|
1854
1892
|
const chainListQuery = useChainListQuery();
|
|
1855
1893
|
const modal = useModal();
|
|
@@ -1881,7 +1919,7 @@ function useMatchChain() {
|
|
|
1881
1919
|
const [selectedChainId, setSelectedChainId] = useState11(storeChainId2);
|
|
1882
1920
|
const isDownMd = useDownMd();
|
|
1883
1921
|
return /* @__PURE__ */ jsxs10("div", { className: `matchid-change-network-box`, children: [
|
|
1884
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ jsx20("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
|
|
1885
1923
|
return /* @__PURE__ */ jsxs10(
|
|
1886
1924
|
"div",
|
|
1887
1925
|
{
|
|
@@ -1889,19 +1927,19 @@ function useMatchChain() {
|
|
|
1889
1927
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
1890
1928
|
children: [
|
|
1891
1929
|
/* @__PURE__ */ jsxs10("div", { className: `matchid-change-network-item-content`, children: [
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ jsx20("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
1931
|
+
/* @__PURE__ */ jsx20("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
1894
1932
|
] }),
|
|
1895
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsx20(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
1896
1934
|
]
|
|
1897
1935
|
},
|
|
1898
1936
|
index
|
|
1899
1937
|
);
|
|
1900
1938
|
}) }),
|
|
1901
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsx20(Button, { size: "lg", highlight: true, onClick: () => {
|
|
1902
1940
|
setChainId2(selectedChainId || 0);
|
|
1903
1941
|
close();
|
|
1904
|
-
}, block: true, children: /* @__PURE__ */
|
|
1942
|
+
}, block: true, children: /* @__PURE__ */ jsx20(FormattedMessage2, { id: "confirm" }) })
|
|
1905
1943
|
] });
|
|
1906
1944
|
}
|
|
1907
1945
|
const showChangeNetwork = () => {
|
|
@@ -1938,7 +1976,7 @@ function useMatchChain() {
|
|
|
1938
1976
|
|
|
1939
1977
|
// src/hooks/useMatchWallet.tsx
|
|
1940
1978
|
import { QRCode } from "react-qrcode";
|
|
1941
|
-
import { useEffect as
|
|
1979
|
+
import { useEffect as useEffect13, useMemo as useMemo6, useRef as useRef3, useState as useState13 } from "react";
|
|
1942
1980
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
1943
1981
|
|
|
1944
1982
|
// src/config/index.tsx
|
|
@@ -2009,7 +2047,7 @@ var useContractStore_default = useContractStore;
|
|
|
2009
2047
|
import { FormattedMessage as FormattedMessage4, useIntl as useIntl5 } from "react-intl";
|
|
2010
2048
|
|
|
2011
2049
|
// src/components/ImportToken/index.tsx
|
|
2012
|
-
import { useEffect as
|
|
2050
|
+
import { useEffect as useEffect12, useMemo as useMemo5, useState as useState12 } from "react";
|
|
2013
2051
|
import { FormattedMessage as FormattedMessage3, useIntl as useIntl4 } from "react-intl";
|
|
2014
2052
|
import { useQueryClient } from "@tanstack/react-query";
|
|
2015
2053
|
import { defineChain, erc20Abi } from "viem";
|
|
@@ -2039,7 +2077,7 @@ function useIsContract({
|
|
|
2039
2077
|
}
|
|
2040
2078
|
|
|
2041
2079
|
// src/components/ImportToken/index.tsx
|
|
2042
|
-
import { jsx as
|
|
2080
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2043
2081
|
function ImportToken({ close }) {
|
|
2044
2082
|
const [status, setStatus] = useState12("");
|
|
2045
2083
|
const { token } = useUserInfo();
|
|
@@ -2080,7 +2118,7 @@ function ImportToken({ close }) {
|
|
|
2080
2118
|
}
|
|
2081
2119
|
};
|
|
2082
2120
|
const intl = useIntl4();
|
|
2083
|
-
|
|
2121
|
+
useEffect12(() => {
|
|
2084
2122
|
if (address.length === 42) {
|
|
2085
2123
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2086
2124
|
if (!reg.test(address)) {
|
|
@@ -2152,20 +2190,20 @@ function ImportToken({ close }) {
|
|
|
2152
2190
|
if (status == "success" || status == "fail") {
|
|
2153
2191
|
return /* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2154
2192
|
/* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2155
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsx21("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ jsx21(Lottie_default, { animationData: status == "success" ? success_default : fail_default, style: {
|
|
2156
2194
|
width: "96px",
|
|
2157
2195
|
height: "96px"
|
|
2158
2196
|
} }) }),
|
|
2159
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ jsx21("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ jsx21(FormattedMessage3, { id: "importSuccess" }) : /* @__PURE__ */ jsx21(FormattedMessage3, { id: "importFail" }) })
|
|
2160
2198
|
] }),
|
|
2161
|
-
status == "success" ? /* @__PURE__ */
|
|
2199
|
+
status == "success" ? /* @__PURE__ */ jsx21(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ jsx21(FormattedMessage3, { id: "close" }) }) : /* @__PURE__ */ jsx21(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ jsx21(FormattedMessage3, { id: "back" }) })
|
|
2162
2200
|
] });
|
|
2163
2201
|
}
|
|
2164
2202
|
return /* @__PURE__ */ jsxs11("div", { className: `matchid-import-token`, children: [
|
|
2165
2203
|
/* @__PURE__ */ jsxs11("div", { className: "matchid-import-token-form", children: [
|
|
2166
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx21(Field, { label: intl.formatMessage({
|
|
2167
2205
|
id: "tokenSmartContract"
|
|
2168
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */
|
|
2206
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ jsx21(
|
|
2169
2207
|
Input,
|
|
2170
2208
|
{
|
|
2171
2209
|
placeholder: intl.formatMessage({
|
|
@@ -2176,9 +2214,9 @@ function ImportToken({ close }) {
|
|
|
2176
2214
|
maxLength: 42
|
|
2177
2215
|
}
|
|
2178
2216
|
) }),
|
|
2179
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx21(Field, { label: intl.formatMessage({
|
|
2180
2218
|
id: "tokenSymbol"
|
|
2181
|
-
}), error: error.symbol, children: /* @__PURE__ */
|
|
2219
|
+
}), error: error.symbol, children: /* @__PURE__ */ jsx21(
|
|
2182
2220
|
Input,
|
|
2183
2221
|
{
|
|
2184
2222
|
placeholder: intl.formatMessage({
|
|
@@ -2189,9 +2227,9 @@ function ImportToken({ close }) {
|
|
|
2189
2227
|
maxLength: 16
|
|
2190
2228
|
}
|
|
2191
2229
|
) }),
|
|
2192
|
-
/* @__PURE__ */
|
|
2230
|
+
/* @__PURE__ */ jsx21(Field, { label: intl.formatMessage({
|
|
2193
2231
|
id: "tokenDecimals"
|
|
2194
|
-
}), error: error.decimals, children: /* @__PURE__ */
|
|
2232
|
+
}), error: error.decimals, children: /* @__PURE__ */ jsx21(
|
|
2195
2233
|
Input,
|
|
2196
2234
|
{
|
|
2197
2235
|
placeholder: intl.formatMessage({
|
|
@@ -2203,7 +2241,7 @@ function ImportToken({ close }) {
|
|
|
2203
2241
|
}
|
|
2204
2242
|
) })
|
|
2205
2243
|
] }),
|
|
2206
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ jsx21(
|
|
2207
2245
|
Button,
|
|
2208
2246
|
{
|
|
2209
2247
|
size: "lg",
|
|
@@ -2212,14 +2250,14 @@ function ImportToken({ close }) {
|
|
|
2212
2250
|
loading: loading || isContractQuery.isLoading,
|
|
2213
2251
|
disabled: !canImport || !isContractQuery.data,
|
|
2214
2252
|
highlight: true,
|
|
2215
|
-
children: /* @__PURE__ */
|
|
2253
|
+
children: /* @__PURE__ */ jsx21(FormattedMessage3, { id: "import" })
|
|
2216
2254
|
}
|
|
2217
2255
|
)
|
|
2218
2256
|
] });
|
|
2219
2257
|
}
|
|
2220
2258
|
|
|
2221
2259
|
// src/hooks/useMatchWallet.tsx
|
|
2222
|
-
import { jsx as
|
|
2260
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2223
2261
|
var ReceiveModal = () => {
|
|
2224
2262
|
const chain = useMatchChain();
|
|
2225
2263
|
const { address } = useWallet();
|
|
@@ -2235,8 +2273,8 @@ var ReceiveModal = () => {
|
|
|
2235
2273
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2236
2274
|
return /* @__PURE__ */ jsxs12("div", { className: `matchid-receive-modal`, children: [
|
|
2237
2275
|
/* @__PURE__ */ jsxs12("div", { className: "matchid-receive-container", children: [
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ jsx22("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ jsx22(FormattedMessage4, { id: "receiveQrcode" }) }),
|
|
2277
|
+
/* @__PURE__ */ jsx22("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ jsx22(
|
|
2240
2278
|
QRCode,
|
|
2241
2279
|
{
|
|
2242
2280
|
margin: "0",
|
|
@@ -2244,7 +2282,7 @@ var ReceiveModal = () => {
|
|
|
2244
2282
|
value: address
|
|
2245
2283
|
}
|
|
2246
2284
|
) }),
|
|
2247
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsx22(
|
|
2248
2286
|
"a",
|
|
2249
2287
|
{
|
|
2250
2288
|
href: chainLink,
|
|
@@ -2254,7 +2292,7 @@ var ReceiveModal = () => {
|
|
|
2254
2292
|
}
|
|
2255
2293
|
)
|
|
2256
2294
|
] }),
|
|
2257
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ jsx22(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ jsx22(
|
|
2258
2296
|
FormattedMessage4,
|
|
2259
2297
|
{
|
|
2260
2298
|
id: "copyAddress"
|
|
@@ -2300,8 +2338,8 @@ function useMatchWalletRecords() {
|
|
|
2300
2338
|
const [items, setItems] = useState13([]);
|
|
2301
2339
|
const { chainId, publicClient } = useMatchChain();
|
|
2302
2340
|
const { address } = useWallet();
|
|
2303
|
-
const hasMoreRef =
|
|
2304
|
-
const nextPageParamsRef =
|
|
2341
|
+
const hasMoreRef = useRef3(hasMore);
|
|
2342
|
+
const nextPageParamsRef = useRef3(void 0);
|
|
2305
2343
|
const { contracts, setContracts } = useContractStore_default();
|
|
2306
2344
|
const fetchMoreData = async () => {
|
|
2307
2345
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -2328,7 +2366,7 @@ function useMatchWalletRecords() {
|
|
|
2328
2366
|
hasMoreRef.current = true;
|
|
2329
2367
|
fetchMoreData();
|
|
2330
2368
|
};
|
|
2331
|
-
|
|
2369
|
+
useEffect13(() => {
|
|
2332
2370
|
if (chainId && address) {
|
|
2333
2371
|
onInit();
|
|
2334
2372
|
}
|
|
@@ -2563,7 +2601,7 @@ function useMatchWalletAssetList({
|
|
|
2563
2601
|
return { ...asset, balance, value, balanceValue };
|
|
2564
2602
|
});
|
|
2565
2603
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
2566
|
-
|
|
2604
|
+
useEffect13(() => {
|
|
2567
2605
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
2568
2606
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
2569
2607
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -2588,7 +2626,7 @@ function useMatchWalletAssetList({
|
|
|
2588
2626
|
}
|
|
2589
2627
|
|
|
2590
2628
|
// src/hooks/useReceipt.tsx
|
|
2591
|
-
import { useState as useState14, useCallback as useCallback4, useEffect as
|
|
2629
|
+
import { useState as useState14, useCallback as useCallback4, useEffect as useEffect14 } from "react";
|
|
2592
2630
|
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
2593
2631
|
import { createPublicClient as createPublicClient5, defineChain as defineChain2, http as http5 } from "viem";
|
|
2594
2632
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
@@ -2606,7 +2644,7 @@ function useReceiptCache() {
|
|
|
2606
2644
|
return false;
|
|
2607
2645
|
}
|
|
2608
2646
|
})();
|
|
2609
|
-
|
|
2647
|
+
useEffect14(() => {
|
|
2610
2648
|
if (isLocalStorageAvailable) {
|
|
2611
2649
|
try {
|
|
2612
2650
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -2723,7 +2761,7 @@ function useReceipt({
|
|
|
2723
2761
|
},
|
|
2724
2762
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2725
2763
|
});
|
|
2726
|
-
|
|
2764
|
+
useEffect14(() => {
|
|
2727
2765
|
if (query.data) {
|
|
2728
2766
|
setShouldRefetch(false);
|
|
2729
2767
|
}
|
|
@@ -2732,7 +2770,7 @@ function useReceipt({
|
|
|
2732
2770
|
}
|
|
2733
2771
|
|
|
2734
2772
|
// src/hooks/useTransaction.tsx
|
|
2735
|
-
import { useState as useState15, useCallback as useCallback5, useEffect as
|
|
2773
|
+
import { useState as useState15, useCallback as useCallback5, useEffect as useEffect15 } from "react";
|
|
2736
2774
|
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
2737
2775
|
import { createPublicClient as createPublicClient6, defineChain as defineChain3, http as http6 } from "viem";
|
|
2738
2776
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
@@ -2750,7 +2788,7 @@ function useTransactionCache() {
|
|
|
2750
2788
|
return false;
|
|
2751
2789
|
}
|
|
2752
2790
|
})();
|
|
2753
|
-
|
|
2791
|
+
useEffect15(() => {
|
|
2754
2792
|
if (isLocalStorageAvailable) {
|
|
2755
2793
|
try {
|
|
2756
2794
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -2867,7 +2905,7 @@ function useTransaction({
|
|
|
2867
2905
|
},
|
|
2868
2906
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2869
2907
|
});
|
|
2870
|
-
|
|
2908
|
+
useEffect15(() => {
|
|
2871
2909
|
if (query.data) {
|
|
2872
2910
|
setShouldRefetch(false);
|
|
2873
2911
|
}
|
|
@@ -2879,39 +2917,39 @@ function useTransaction({
|
|
|
2879
2917
|
import { create as create5 } from "zustand";
|
|
2880
2918
|
|
|
2881
2919
|
// src/hooks/useConfig.tsx
|
|
2882
|
-
import { jsx as
|
|
2920
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2883
2921
|
var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2884
2922
|
var WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2885
2923
|
function useWalletConfig() {
|
|
2886
2924
|
const isDownMd = useDownMd();
|
|
2887
2925
|
const walletMap = {
|
|
2888
2926
|
evm: {
|
|
2889
|
-
icon: /* @__PURE__ */
|
|
2890
|
-
activeIcon: /* @__PURE__ */
|
|
2927
|
+
icon: /* @__PURE__ */ jsx23(EVMDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2928
|
+
activeIcon: /* @__PURE__ */ jsx23(EVMLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2891
2929
|
name: "EVM",
|
|
2892
2930
|
method: "evm"
|
|
2893
2931
|
},
|
|
2894
2932
|
sol: {
|
|
2895
|
-
icon: /* @__PURE__ */
|
|
2896
|
-
activeIcon: /* @__PURE__ */
|
|
2933
|
+
icon: /* @__PURE__ */ jsx23(SOLDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2934
|
+
activeIcon: /* @__PURE__ */ jsx23(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2897
2935
|
name: "SOL",
|
|
2898
2936
|
method: "sol"
|
|
2899
2937
|
},
|
|
2900
2938
|
btc: {
|
|
2901
|
-
icon: /* @__PURE__ */
|
|
2902
|
-
activeIcon: /* @__PURE__ */
|
|
2939
|
+
icon: /* @__PURE__ */ jsx23(BTCDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2940
|
+
activeIcon: /* @__PURE__ */ jsx23(BTCLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2903
2941
|
name: "BTC",
|
|
2904
2942
|
method: "btc"
|
|
2905
2943
|
},
|
|
2906
2944
|
tron: {
|
|
2907
|
-
icon: /* @__PURE__ */
|
|
2908
|
-
activeIcon: /* @__PURE__ */
|
|
2945
|
+
icon: /* @__PURE__ */ jsx23(TRXDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2946
|
+
activeIcon: /* @__PURE__ */ jsx23(TRXLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2909
2947
|
name: "TRON",
|
|
2910
2948
|
method: "tron"
|
|
2911
2949
|
},
|
|
2912
2950
|
ton: {
|
|
2913
|
-
icon: /* @__PURE__ */
|
|
2914
|
-
activeIcon: /* @__PURE__ */
|
|
2951
|
+
icon: /* @__PURE__ */ jsx23(TonLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2952
|
+
activeIcon: /* @__PURE__ */ jsx23(TonLightIcon2, { size: isDownMd ? 36 : 40 }),
|
|
2915
2953
|
name: "TON",
|
|
2916
2954
|
method: "ton"
|
|
2917
2955
|
}
|
|
@@ -2961,9 +2999,9 @@ var useWalletModalStore = create5((set) => ({
|
|
|
2961
2999
|
}));
|
|
2962
3000
|
|
|
2963
3001
|
// src/components/CEXBindModal/index.tsx
|
|
2964
|
-
import { useEffect as
|
|
3002
|
+
import { useEffect as useEffect16, useMemo as useMemo7, useState as useState16 } from "react";
|
|
2965
3003
|
import { FormattedMessage as FormattedMessage5, useIntl as useIntl6 } from "react-intl";
|
|
2966
|
-
import { jsx as
|
|
3004
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2967
3005
|
function CEXBindModal({
|
|
2968
3006
|
onClose,
|
|
2969
3007
|
type,
|
|
@@ -2981,7 +3019,7 @@ function CEXBindModal({
|
|
|
2981
3019
|
const needPassphrase = useMemo7(() => {
|
|
2982
3020
|
return ["bitget", "okx"].includes(type.toLowerCase());
|
|
2983
3021
|
}, [type]);
|
|
2984
|
-
|
|
3022
|
+
useEffect16(() => {
|
|
2985
3023
|
if (isOpen) {
|
|
2986
3024
|
setSecret("");
|
|
2987
3025
|
setKey("");
|
|
@@ -3018,20 +3056,20 @@ function CEXBindModal({
|
|
|
3018
3056
|
setLoading(false);
|
|
3019
3057
|
}
|
|
3020
3058
|
};
|
|
3021
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ jsx24(ModalWithHeader, { showClose: true, isOpen, onClose, title: intl.formatMessage({
|
|
3022
3060
|
id: "CEXBindTitle"
|
|
3023
3061
|
}, {
|
|
3024
3062
|
type
|
|
3025
3063
|
}), ...props, children: /* @__PURE__ */ jsxs13("div", { className: "matchid-cex-modal", children: [
|
|
3026
3064
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
3027
|
-
/* @__PURE__ */
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */
|
|
3065
|
+
/* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(FormattedMessage5, { id: "CEXBindAttention" }) }),
|
|
3066
|
+
/* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(FormattedMessage5, { id: "CEXBindTips1" }) }),
|
|
3067
|
+
/* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(FormattedMessage5, { id: "CEXBindTips2" }) }),
|
|
3068
|
+
/* @__PURE__ */ jsx24("p", { children: /* @__PURE__ */ jsx24(FormattedMessage5, { id: "CEXBindTips3" }) })
|
|
3031
3069
|
] }),
|
|
3032
|
-
/* @__PURE__ */
|
|
3070
|
+
/* @__PURE__ */ jsx24(Field, { label: intl.formatMessage({
|
|
3033
3071
|
id: "CEXBindApiKey"
|
|
3034
|
-
}), children: /* @__PURE__ */
|
|
3072
|
+
}), children: /* @__PURE__ */ jsx24(
|
|
3035
3073
|
Input,
|
|
3036
3074
|
{
|
|
3037
3075
|
value: key,
|
|
@@ -3039,9 +3077,9 @@ function CEXBindModal({
|
|
|
3039
3077
|
placeholder: "**** **** ****"
|
|
3040
3078
|
}
|
|
3041
3079
|
) }),
|
|
3042
|
-
/* @__PURE__ */
|
|
3080
|
+
/* @__PURE__ */ jsx24(Field, { label: intl.formatMessage({
|
|
3043
3081
|
id: "CEXBindApiSecretKey"
|
|
3044
|
-
}), error: !needPassphrase && error, children: /* @__PURE__ */
|
|
3082
|
+
}), error: !needPassphrase && error, children: /* @__PURE__ */ jsx24(
|
|
3045
3083
|
Input,
|
|
3046
3084
|
{
|
|
3047
3085
|
value: secret,
|
|
@@ -3049,9 +3087,9 @@ function CEXBindModal({
|
|
|
3049
3087
|
placeholder: "**** **** ****"
|
|
3050
3088
|
}
|
|
3051
3089
|
) }),
|
|
3052
|
-
needPassphrase && /* @__PURE__ */
|
|
3090
|
+
needPassphrase && /* @__PURE__ */ jsx24(Field, { error, label: intl.formatMessage({
|
|
3053
3091
|
id: "CEXBindApiPassphrase"
|
|
3054
|
-
}), children: /* @__PURE__ */
|
|
3092
|
+
}), children: /* @__PURE__ */ jsx24(
|
|
3055
3093
|
Input,
|
|
3056
3094
|
{
|
|
3057
3095
|
value: APIPassphrase,
|
|
@@ -3059,7 +3097,7 @@ function CEXBindModal({
|
|
|
3059
3097
|
placeholder: "**** **** ****"
|
|
3060
3098
|
}
|
|
3061
3099
|
) }),
|
|
3062
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx24(
|
|
3063
3101
|
Button,
|
|
3064
3102
|
{
|
|
3065
3103
|
onClick: SubmitApi,
|
|
@@ -3067,7 +3105,7 @@ function CEXBindModal({
|
|
|
3067
3105
|
block: true,
|
|
3068
3106
|
loading,
|
|
3069
3107
|
disabled: !key || !secret,
|
|
3070
|
-
children: /* @__PURE__ */
|
|
3108
|
+
children: /* @__PURE__ */ jsx24(FormattedMessage5, { id: "continue" })
|
|
3071
3109
|
}
|
|
3072
3110
|
)
|
|
3073
3111
|
] }) });
|
|
@@ -3075,7 +3113,7 @@ function CEXBindModal({
|
|
|
3075
3113
|
|
|
3076
3114
|
// src/context/BusinessProvider.tsx
|
|
3077
3115
|
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
3078
|
-
import { Fragment as Fragment4, jsx as
|
|
3116
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3079
3117
|
function BusinessProvider({ children }) {
|
|
3080
3118
|
const { overview, token } = useUserInfo();
|
|
3081
3119
|
const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
|
|
@@ -3110,7 +3148,7 @@ function BusinessProvider({ children }) {
|
|
|
3110
3148
|
refetchInterval: 1e3 * 5
|
|
3111
3149
|
});
|
|
3112
3150
|
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
3113
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx25(
|
|
3114
3152
|
EVMModal,
|
|
3115
3153
|
{
|
|
3116
3154
|
isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
|
|
@@ -3120,7 +3158,7 @@ function BusinessProvider({ children }) {
|
|
|
3120
3158
|
zIndex: 199
|
|
3121
3159
|
}
|
|
3122
3160
|
),
|
|
3123
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ jsx25(
|
|
3124
3162
|
TRONModal,
|
|
3125
3163
|
{
|
|
3126
3164
|
isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
|
|
@@ -3130,7 +3168,7 @@ function BusinessProvider({ children }) {
|
|
|
3130
3168
|
zIndex: 199
|
|
3131
3169
|
}
|
|
3132
3170
|
),
|
|
3133
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx25(
|
|
3134
3172
|
TONModal,
|
|
3135
3173
|
{
|
|
3136
3174
|
isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
|
|
@@ -3140,7 +3178,7 @@ function BusinessProvider({ children }) {
|
|
|
3140
3178
|
zIndex: 199
|
|
3141
3179
|
}
|
|
3142
3180
|
),
|
|
3143
|
-
/* @__PURE__ */
|
|
3181
|
+
/* @__PURE__ */ jsx25(
|
|
3144
3182
|
BTCModal,
|
|
3145
3183
|
{
|
|
3146
3184
|
isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
|
|
@@ -3150,7 +3188,7 @@ function BusinessProvider({ children }) {
|
|
|
3150
3188
|
zIndex: 199
|
|
3151
3189
|
}
|
|
3152
3190
|
),
|
|
3153
|
-
/* @__PURE__ */
|
|
3191
|
+
/* @__PURE__ */ jsx25(
|
|
3154
3192
|
CEXBindModal,
|
|
3155
3193
|
{
|
|
3156
3194
|
isOpen: CEXIsOpen && (!!token && !!overview),
|
|
@@ -3159,7 +3197,7 @@ function BusinessProvider({ children }) {
|
|
|
3159
3197
|
zIndex: 199
|
|
3160
3198
|
}
|
|
3161
3199
|
),
|
|
3162
|
-
/* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ jsx25(
|
|
3163
3201
|
WalletModal,
|
|
3164
3202
|
{
|
|
3165
3203
|
isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
|
|
@@ -3174,14 +3212,14 @@ function BusinessProvider({ children }) {
|
|
|
3174
3212
|
}
|
|
3175
3213
|
|
|
3176
3214
|
// src/context/index.tsx
|
|
3177
|
-
import { jsx as
|
|
3215
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3178
3216
|
var Providers = ({ children }) => {
|
|
3179
|
-
return /* @__PURE__ */
|
|
3217
|
+
return /* @__PURE__ */ jsx26(ToastProvider, { children: /* @__PURE__ */ jsx26(ModalProvider, { children: /* @__PURE__ */ jsx26(BusinessProvider, { children }) }) });
|
|
3180
3218
|
};
|
|
3181
3219
|
var context_default = Providers;
|
|
3182
3220
|
|
|
3183
3221
|
// src/hooks/useWalletInit.ts
|
|
3184
|
-
import { useEffect as
|
|
3222
|
+
import { useEffect as useEffect17, useRef as useRef4 } from "react";
|
|
3185
3223
|
|
|
3186
3224
|
// src/utils/wallet.ts
|
|
3187
3225
|
var sendMessage = ({ method, data, resolve, reject, timeout }) => {
|
|
@@ -3214,11 +3252,11 @@ function useWalletInit({
|
|
|
3214
3252
|
}) {
|
|
3215
3253
|
const { endpoints, token, setWallet, appid, refreshOverview } = useLocalStore_default();
|
|
3216
3254
|
const { setWalletReady, walletReady } = useStore_default();
|
|
3217
|
-
const iframeReadyRef =
|
|
3218
|
-
|
|
3255
|
+
const iframeReadyRef = useRef4(walletReady);
|
|
3256
|
+
useEffect17(() => {
|
|
3219
3257
|
setWallet(config);
|
|
3220
3258
|
}, [config]);
|
|
3221
|
-
|
|
3259
|
+
useEffect17(() => {
|
|
3222
3260
|
matchlog_default.log("sdk.mpc.status", walletReady, iframeReadyRef.current);
|
|
3223
3261
|
iframeReadyRef.current = walletReady;
|
|
3224
3262
|
if (iframeReadyRef.current) {
|
|
@@ -3235,7 +3273,7 @@ function useWalletInit({
|
|
|
3235
3273
|
onReady();
|
|
3236
3274
|
}
|
|
3237
3275
|
}, [walletReady]);
|
|
3238
|
-
|
|
3276
|
+
useEffect17(() => {
|
|
3239
3277
|
if (!endpoints.auth || !appid || !token || !config) {
|
|
3240
3278
|
const existingIframe = getWalletIframe();
|
|
3241
3279
|
if (existingIframe) {
|
|
@@ -3335,7 +3373,7 @@ function useWalletInit({
|
|
|
3335
3373
|
}
|
|
3336
3374
|
}
|
|
3337
3375
|
}, [endpoints.auth, appid, token, config]);
|
|
3338
|
-
|
|
3376
|
+
useEffect17(() => {
|
|
3339
3377
|
const messageHandle = async (e) => {
|
|
3340
3378
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
3341
3379
|
return;
|
|
@@ -3416,7 +3454,7 @@ function useWalletInit({
|
|
|
3416
3454
|
}
|
|
3417
3455
|
|
|
3418
3456
|
// src/hooks/useInit.tsx
|
|
3419
|
-
import { useEffect as
|
|
3457
|
+
import { useEffect as useEffect18, useRef as useRef5 } from "react";
|
|
3420
3458
|
function useInit({
|
|
3421
3459
|
theme,
|
|
3422
3460
|
appid,
|
|
@@ -3436,24 +3474,24 @@ function useInit({
|
|
|
3436
3474
|
locale: realLocale
|
|
3437
3475
|
} = useLocalStore_default();
|
|
3438
3476
|
const walletModalStore = useWalletModalStore();
|
|
3439
|
-
const overviewLoadingRef =
|
|
3477
|
+
const overviewLoadingRef = useRef5(false);
|
|
3440
3478
|
const searchParams = new URLSearchParams(window.location.search);
|
|
3441
3479
|
const matchToken = searchParams.get("matchToken");
|
|
3442
3480
|
const matchidt = searchParams.get("matchidt");
|
|
3443
3481
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
3444
|
-
|
|
3482
|
+
useEffect18(() => {
|
|
3445
3483
|
setTheme(theme);
|
|
3446
3484
|
}, [theme]);
|
|
3447
|
-
|
|
3485
|
+
useEffect18(() => {
|
|
3448
3486
|
setAppid(appid);
|
|
3449
3487
|
}, [appid]);
|
|
3450
|
-
|
|
3488
|
+
useEffect18(() => {
|
|
3451
3489
|
setEndpoints(realEndpoints);
|
|
3452
3490
|
}, [realEndpoints]);
|
|
3453
|
-
|
|
3491
|
+
useEffect18(() => {
|
|
3454
3492
|
setLocale(locale || "en");
|
|
3455
3493
|
}, [locale]);
|
|
3456
|
-
|
|
3494
|
+
useEffect18(() => {
|
|
3457
3495
|
if (matchToken) {
|
|
3458
3496
|
const tokenData = JSON.parse(atob(matchToken));
|
|
3459
3497
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -3464,7 +3502,7 @@ function useInit({
|
|
|
3464
3502
|
}
|
|
3465
3503
|
}
|
|
3466
3504
|
}, [matchToken]);
|
|
3467
|
-
|
|
3505
|
+
useEffect18(() => {
|
|
3468
3506
|
if (matchidt) {
|
|
3469
3507
|
const tokenData = decodeURIComponent(matchidt);
|
|
3470
3508
|
const data = JSON.parse(decodeBase64(tokenData));
|
|
@@ -3494,7 +3532,7 @@ function useInit({
|
|
|
3494
3532
|
}
|
|
3495
3533
|
}
|
|
3496
3534
|
}, [matchidt]);
|
|
3497
|
-
|
|
3535
|
+
useEffect18(() => {
|
|
3498
3536
|
const onLoginMessage = (event) => {
|
|
3499
3537
|
const res = event.data;
|
|
3500
3538
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -3531,7 +3569,7 @@ function useInit({
|
|
|
3531
3569
|
overviewLoadingRef.current = false;
|
|
3532
3570
|
}
|
|
3533
3571
|
};
|
|
3534
|
-
|
|
3572
|
+
useEffect18(() => {
|
|
3535
3573
|
if (token) {
|
|
3536
3574
|
loadOverview();
|
|
3537
3575
|
}
|
|
@@ -4380,7 +4418,7 @@ import {
|
|
|
4380
4418
|
} from "@rainbow-me/rainbowkit/wallets";
|
|
4381
4419
|
import { arbitrum, base, bsc, mainnet, optimism, polygon } from "wagmi/chains";
|
|
4382
4420
|
import { WagmiProvider } from "wagmi";
|
|
4383
|
-
import { jsx as
|
|
4421
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4384
4422
|
var queryClient = new QueryClient();
|
|
4385
4423
|
var wagmiConfig = getDefaultConfig({
|
|
4386
4424
|
appName: "MatchID",
|
|
@@ -4419,7 +4457,7 @@ var MatchProvider = ({
|
|
|
4419
4457
|
useWalletInit({
|
|
4420
4458
|
config: wallet
|
|
4421
4459
|
});
|
|
4422
|
-
return /* @__PURE__ */
|
|
4460
|
+
return /* @__PURE__ */ jsx27(IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ jsx27(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx27(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx27(
|
|
4423
4461
|
MatchContext.Provider,
|
|
4424
4462
|
{
|
|
4425
4463
|
value: {
|
|
@@ -4430,7 +4468,7 @@ var MatchProvider = ({
|
|
|
4430
4468
|
theme,
|
|
4431
4469
|
locale: realLocale
|
|
4432
4470
|
},
|
|
4433
|
-
children: /* @__PURE__ */
|
|
4471
|
+
children: /* @__PURE__ */ jsx27(context_default, { children })
|
|
4434
4472
|
}
|
|
4435
4473
|
) }) }) });
|
|
4436
4474
|
};
|
|
@@ -4740,9 +4778,9 @@ function useUserInfo() {
|
|
|
4740
4778
|
}
|
|
4741
4779
|
|
|
4742
4780
|
// src/components/EmailModal/StepVerify.tsx
|
|
4743
|
-
import { useEffect as
|
|
4781
|
+
import { useEffect as useEffect20, useMemo as useMemo9, useRef as useRef6, useState as useState18 } from "react";
|
|
4744
4782
|
import { FormattedMessage as FormattedMessage6, useIntl as useIntl7 } from "react-intl";
|
|
4745
|
-
import { jsx as
|
|
4783
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4746
4784
|
function StepVerify(props) {
|
|
4747
4785
|
const intl = useIntl7();
|
|
4748
4786
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
@@ -4750,13 +4788,13 @@ function StepVerify(props) {
|
|
|
4750
4788
|
const [code, setCode] = useState18("");
|
|
4751
4789
|
const [sending, setSending] = useState18(false);
|
|
4752
4790
|
const [submitting, setSubmitting] = useState18(false);
|
|
4753
|
-
const sendTimeRef =
|
|
4791
|
+
const sendTimeRef = useRef6(0);
|
|
4754
4792
|
const [sendBtnText, setSendBtnText] = useState18(intl.formatMessage({
|
|
4755
4793
|
id: "send"
|
|
4756
4794
|
}));
|
|
4757
4795
|
const intervalTime = EMAIL_INTERVAL;
|
|
4758
4796
|
const codeLength = EMAIL_CODE_LENGTH;
|
|
4759
|
-
const intervalRef =
|
|
4797
|
+
const intervalRef = useRef6(null);
|
|
4760
4798
|
const isDownMd = useDownMd();
|
|
4761
4799
|
const onSend = async () => {
|
|
4762
4800
|
if (sendTimeRef.current > 0) {
|
|
@@ -4787,7 +4825,7 @@ function StepVerify(props) {
|
|
|
4787
4825
|
setSending(false);
|
|
4788
4826
|
}
|
|
4789
4827
|
};
|
|
4790
|
-
|
|
4828
|
+
useEffect20(() => {
|
|
4791
4829
|
onSend();
|
|
4792
4830
|
return () => {
|
|
4793
4831
|
if (intervalRef.current) {
|
|
@@ -4821,15 +4859,15 @@ function StepVerify(props) {
|
|
|
4821
4859
|
};
|
|
4822
4860
|
return /* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-box", children: [
|
|
4823
4861
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header", children: [
|
|
4824
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsx28("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx28(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
4825
4863
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header-content", children: [
|
|
4826
|
-
/* @__PURE__ */
|
|
4827
|
-
/* @__PURE__ */
|
|
4864
|
+
/* @__PURE__ */ jsx28("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
4865
|
+
/* @__PURE__ */ jsx28("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ jsx28(FormattedMessage6, { id: "sendEmailTips" }) })
|
|
4828
4866
|
] })
|
|
4829
4867
|
] }),
|
|
4830
|
-
/* @__PURE__ */
|
|
4868
|
+
/* @__PURE__ */ jsx28(Field, { label: intl.formatMessage({
|
|
4831
4869
|
id: "verificationCode"
|
|
4832
|
-
}), error, children: /* @__PURE__ */
|
|
4870
|
+
}), error, children: /* @__PURE__ */ jsx28(
|
|
4833
4871
|
Input,
|
|
4834
4872
|
{
|
|
4835
4873
|
placeholder: intl.formatMessage({
|
|
@@ -4839,7 +4877,7 @@ function StepVerify(props) {
|
|
|
4839
4877
|
maxLength: codeLength,
|
|
4840
4878
|
onChange: (e) => setCode(e.target.value),
|
|
4841
4879
|
value: code,
|
|
4842
|
-
after: /* @__PURE__ */
|
|
4880
|
+
after: /* @__PURE__ */ jsx28(
|
|
4843
4881
|
Button,
|
|
4844
4882
|
{
|
|
4845
4883
|
highlight: true,
|
|
@@ -4858,13 +4896,13 @@ function StepVerify(props) {
|
|
|
4858
4896
|
)
|
|
4859
4897
|
}
|
|
4860
4898
|
) }),
|
|
4861
|
-
/* @__PURE__ */
|
|
4899
|
+
/* @__PURE__ */ jsx28(Button, { disabled: !canContinue, loading: submitting, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ jsx28(FormattedMessage6, { id: "continue" }) })
|
|
4862
4900
|
] });
|
|
4863
4901
|
}
|
|
4864
4902
|
|
|
4865
4903
|
// src/components/EmailModal/index.tsx
|
|
4866
4904
|
import { useIntl as useIntl8 } from "react-intl";
|
|
4867
|
-
import { jsx as
|
|
4905
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4868
4906
|
function EmailModal({
|
|
4869
4907
|
isOpen = false,
|
|
4870
4908
|
width = 480,
|
|
@@ -4875,13 +4913,13 @@ function EmailModal({
|
|
|
4875
4913
|
const [step, setStep] = useState19("input");
|
|
4876
4914
|
const [emailVal, setEmailVal] = useState19("");
|
|
4877
4915
|
const intl = useIntl8();
|
|
4878
|
-
|
|
4916
|
+
useEffect21(() => {
|
|
4879
4917
|
if (!isOpen) {
|
|
4880
4918
|
setStep("input");
|
|
4881
4919
|
setEmailVal("");
|
|
4882
4920
|
}
|
|
4883
4921
|
}, [isOpen]);
|
|
4884
|
-
return /* @__PURE__ */
|
|
4922
|
+
return /* @__PURE__ */ jsx29(
|
|
4885
4923
|
ModalWithHeader,
|
|
4886
4924
|
{
|
|
4887
4925
|
isOpen,
|
|
@@ -4891,10 +4929,10 @@ function EmailModal({
|
|
|
4891
4929
|
id: "email"
|
|
4892
4930
|
}),
|
|
4893
4931
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
4894
|
-
children: step === "input" ? /* @__PURE__ */
|
|
4932
|
+
children: step === "input" ? /* @__PURE__ */ jsx29(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
4895
4933
|
setEmailVal(email);
|
|
4896
4934
|
setStep("verify");
|
|
4897
|
-
} }) : /* @__PURE__ */
|
|
4935
|
+
} }) : /* @__PURE__ */ jsx29(StepVerify, { email: emailVal, onSuccess: onLogin })
|
|
4898
4936
|
}
|
|
4899
4937
|
);
|
|
4900
4938
|
}
|
|
@@ -4924,7 +4962,7 @@ function useAppConfig() {
|
|
|
4924
4962
|
}
|
|
4925
4963
|
|
|
4926
4964
|
// src/components/LoginBox/index.tsx
|
|
4927
|
-
import { Fragment as Fragment5, jsx as
|
|
4965
|
+
import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4928
4966
|
var RecommendItem = ({
|
|
4929
4967
|
icon,
|
|
4930
4968
|
name,
|
|
@@ -4936,17 +4974,17 @@ var RecommendItem = ({
|
|
|
4936
4974
|
return /* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method", children: [
|
|
4937
4975
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
4938
4976
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-content", children: [
|
|
4939
|
-
/* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
4977
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
4978
|
+
/* @__PURE__ */ jsx30("span", { className: "matchid-login-recommend-method-name", children: name })
|
|
4941
4979
|
] }),
|
|
4942
|
-
footer ? footer : children ? /* @__PURE__ */
|
|
4980
|
+
footer ? footer : children ? /* @__PURE__ */ jsx30(
|
|
4943
4981
|
ArrowDownIcon,
|
|
4944
4982
|
{
|
|
4945
4983
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
4946
4984
|
size: 20,
|
|
4947
4985
|
color: "var(--matchid-arrow-color)"
|
|
4948
4986
|
}
|
|
4949
|
-
) : /* @__PURE__ */
|
|
4987
|
+
) : /* @__PURE__ */ jsx30(
|
|
4950
4988
|
ArrowRightIcon,
|
|
4951
4989
|
{
|
|
4952
4990
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -4955,7 +4993,7 @@ var RecommendItem = ({
|
|
|
4955
4993
|
}
|
|
4956
4994
|
)
|
|
4957
4995
|
] }),
|
|
4958
|
-
children && /* @__PURE__ */
|
|
4996
|
+
children && /* @__PURE__ */ jsx30(
|
|
4959
4997
|
"div",
|
|
4960
4998
|
{
|
|
4961
4999
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -5020,55 +5058,55 @@ function LoginBox({
|
|
|
5020
5058
|
const isDownMd = useDownMd();
|
|
5021
5059
|
const methodMap = {
|
|
5022
5060
|
wallet: {
|
|
5023
|
-
icon: /* @__PURE__ */
|
|
5061
|
+
icon: /* @__PURE__ */ jsx30(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
5024
5062
|
name: intl.formatMessage({ id: "wallet" }),
|
|
5025
5063
|
onClick: () => setShowWallet(!showWallet),
|
|
5026
5064
|
type: "wallet"
|
|
5027
5065
|
},
|
|
5028
5066
|
email: {
|
|
5029
|
-
icon: /* @__PURE__ */
|
|
5067
|
+
icon: /* @__PURE__ */ jsx30(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
5030
5068
|
name: intl.formatMessage({ id: "email" }),
|
|
5031
5069
|
onClick: () => {
|
|
5032
5070
|
setEmailOpen(true);
|
|
5033
5071
|
}
|
|
5034
5072
|
},
|
|
5035
5073
|
google: {
|
|
5036
|
-
icon: /* @__PURE__ */
|
|
5074
|
+
icon: /* @__PURE__ */ jsx30(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
5037
5075
|
name: "Google",
|
|
5038
5076
|
onClick: () => login("google")
|
|
5039
5077
|
},
|
|
5040
5078
|
twitter: {
|
|
5041
|
-
icon: /* @__PURE__ */
|
|
5079
|
+
icon: /* @__PURE__ */ jsx30(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
5042
5080
|
name: "X",
|
|
5043
5081
|
onClick: () => login("twitter")
|
|
5044
5082
|
},
|
|
5045
5083
|
telegram: {
|
|
5046
|
-
icon: /* @__PURE__ */
|
|
5084
|
+
icon: /* @__PURE__ */ jsx30(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
5047
5085
|
name: "Telegram",
|
|
5048
5086
|
onClick: () => login("telegram")
|
|
5049
5087
|
},
|
|
5050
5088
|
github: {
|
|
5051
|
-
icon: /* @__PURE__ */
|
|
5089
|
+
icon: /* @__PURE__ */ jsx30(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
5052
5090
|
name: "Github",
|
|
5053
5091
|
onClick: () => login("github")
|
|
5054
5092
|
},
|
|
5055
5093
|
discord: {
|
|
5056
|
-
icon: /* @__PURE__ */
|
|
5094
|
+
icon: /* @__PURE__ */ jsx30(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
5057
5095
|
name: "Discord",
|
|
5058
5096
|
onClick: () => login("discord")
|
|
5059
5097
|
},
|
|
5060
5098
|
linkedin: {
|
|
5061
|
-
icon: /* @__PURE__ */
|
|
5099
|
+
icon: /* @__PURE__ */ jsx30(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
5062
5100
|
name: "LinkedIn",
|
|
5063
5101
|
onClick: () => login("linkedin")
|
|
5064
5102
|
},
|
|
5065
5103
|
facebook: {
|
|
5066
|
-
icon: /* @__PURE__ */
|
|
5104
|
+
icon: /* @__PURE__ */ jsx30(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
5067
5105
|
name: "Facebook",
|
|
5068
5106
|
onClick: () => login("facebook")
|
|
5069
5107
|
},
|
|
5070
5108
|
youtube: {
|
|
5071
|
-
icon: /* @__PURE__ */
|
|
5109
|
+
icon: /* @__PURE__ */ jsx30(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
5072
5110
|
name: "Youtube",
|
|
5073
5111
|
onClick: () => login("youtube")
|
|
5074
5112
|
}
|
|
@@ -5076,8 +5114,8 @@ function LoginBox({
|
|
|
5076
5114
|
const { walletMap } = useWalletConfig();
|
|
5077
5115
|
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5078
5116
|
(!inModal || !emailOpen) && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-box", children: [
|
|
5079
|
-
/* @__PURE__ */
|
|
5080
|
-
return /* @__PURE__ */
|
|
5117
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
5118
|
+
return /* @__PURE__ */ jsx30(
|
|
5081
5119
|
RecommendItem,
|
|
5082
5120
|
{
|
|
5083
5121
|
icon: methodMap[m]?.icon,
|
|
@@ -5085,8 +5123,8 @@ function LoginBox({
|
|
|
5085
5123
|
onClick: methodMap[m]?.onClick,
|
|
5086
5124
|
showChildren: m == "wallet" && showWallet,
|
|
5087
5125
|
children: m == "wallet" && /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5088
|
-
/* @__PURE__ */
|
|
5089
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
5127
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
5090
5128
|
const m2 = walletMap[n];
|
|
5091
5129
|
return /* @__PURE__ */ jsxs16(
|
|
5092
5130
|
"div",
|
|
@@ -5097,15 +5135,15 @@ function LoginBox({
|
|
|
5097
5135
|
},
|
|
5098
5136
|
children: [
|
|
5099
5137
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
5100
|
-
/* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
5139
|
+
/* @__PURE__ */ jsx30(
|
|
5102
5140
|
"div",
|
|
5103
5141
|
{
|
|
5104
5142
|
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
5105
5143
|
children: m2.activeIcon
|
|
5106
5144
|
}
|
|
5107
5145
|
),
|
|
5108
|
-
/* @__PURE__ */
|
|
5146
|
+
/* @__PURE__ */ jsx30(
|
|
5109
5147
|
"span",
|
|
5110
5148
|
{
|
|
5111
5149
|
className: "matchid-login-recommend-wallet-item-name",
|
|
@@ -5113,7 +5151,7 @@ function LoginBox({
|
|
|
5113
5151
|
}
|
|
5114
5152
|
)
|
|
5115
5153
|
] }),
|
|
5116
|
-
/* @__PURE__ */
|
|
5154
|
+
/* @__PURE__ */ jsx30(
|
|
5117
5155
|
ArrowRightIcon,
|
|
5118
5156
|
{
|
|
5119
5157
|
className: "matchid-login-recommend-wallet-item-arrow",
|
|
@@ -5132,9 +5170,9 @@ function LoginBox({
|
|
|
5132
5170
|
);
|
|
5133
5171
|
}) }),
|
|
5134
5172
|
methodConfig.methods.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-other", children: [
|
|
5135
|
-
/* @__PURE__ */
|
|
5136
|
-
/* @__PURE__ */
|
|
5137
|
-
return /* @__PURE__ */
|
|
5173
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ jsx30(FormattedMessage7, { id: "otherLoginMethods" }) }),
|
|
5174
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
5175
|
+
return /* @__PURE__ */ jsx30(
|
|
5138
5176
|
"div",
|
|
5139
5177
|
{
|
|
5140
5178
|
className: "matchid-login-method-item",
|
|
@@ -5147,7 +5185,7 @@ function LoginBox({
|
|
|
5147
5185
|
}) })
|
|
5148
5186
|
] })
|
|
5149
5187
|
] }),
|
|
5150
|
-
/* @__PURE__ */
|
|
5188
|
+
/* @__PURE__ */ jsx30(
|
|
5151
5189
|
EmailModal,
|
|
5152
5190
|
{
|
|
5153
5191
|
isOpen: emailOpen,
|
|
@@ -5167,7 +5205,7 @@ import { useState as useState22 } from "react";
|
|
|
5167
5205
|
|
|
5168
5206
|
// src/components/LoginPanel/index.tsx
|
|
5169
5207
|
import { FormattedMessage as FormattedMessage8 } from "react-intl";
|
|
5170
|
-
import { jsx as
|
|
5208
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5171
5209
|
function LoginPanel({
|
|
5172
5210
|
header,
|
|
5173
5211
|
onClose,
|
|
@@ -5177,30 +5215,30 @@ function LoginPanel({
|
|
|
5177
5215
|
return /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel", children: [
|
|
5178
5216
|
header ? header : /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header", children: [
|
|
5179
5217
|
/* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header-content", children: [
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
5218
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ jsx31(FormattedMessage8, { id: "loginTitle" }) }),
|
|
5219
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ jsx31(FormattedMessage8, { id: "loginTips" }) })
|
|
5182
5220
|
] }),
|
|
5183
|
-
onClose && /* @__PURE__ */
|
|
5221
|
+
onClose && /* @__PURE__ */ jsx31("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx31(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
5184
5222
|
] }),
|
|
5185
|
-
/* @__PURE__ */
|
|
5186
|
-
/* @__PURE__ */
|
|
5223
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-panel-divide" }),
|
|
5224
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ jsx31(LoginBox, { ...props }) })
|
|
5187
5225
|
] });
|
|
5188
5226
|
}
|
|
5189
5227
|
|
|
5190
5228
|
// src/components/LoginModal/index.tsx
|
|
5191
|
-
import { jsx as
|
|
5229
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5192
5230
|
function LoginModal({
|
|
5193
5231
|
isOpen = false,
|
|
5194
5232
|
width = 480,
|
|
5195
5233
|
...props
|
|
5196
5234
|
}) {
|
|
5197
5235
|
const { isLogin } = useUserInfo();
|
|
5198
|
-
return /* @__PURE__ */
|
|
5236
|
+
return /* @__PURE__ */ jsx32(
|
|
5199
5237
|
Modal,
|
|
5200
5238
|
{
|
|
5201
5239
|
isOpen: isOpen && !isLogin,
|
|
5202
5240
|
width,
|
|
5203
|
-
children: /* @__PURE__ */
|
|
5241
|
+
children: /* @__PURE__ */ jsx32(LoginPanel, { ...props, inModal: true })
|
|
5204
5242
|
}
|
|
5205
5243
|
);
|
|
5206
5244
|
}
|
|
@@ -5209,10 +5247,10 @@ function LoginModal({
|
|
|
5209
5247
|
import { useState as useState21 } from "react";
|
|
5210
5248
|
|
|
5211
5249
|
// src/assets/icon/ProfileIcon.tsx
|
|
5212
|
-
import { jsx as
|
|
5250
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5213
5251
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
5214
5252
|
return /* @__PURE__ */ jsxs18("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5215
|
-
/* @__PURE__ */
|
|
5253
|
+
/* @__PURE__ */ jsx33(
|
|
5216
5254
|
"path",
|
|
5217
5255
|
{
|
|
5218
5256
|
fillRule: "evenodd",
|
|
@@ -5221,7 +5259,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5221
5259
|
fill: color
|
|
5222
5260
|
}
|
|
5223
5261
|
),
|
|
5224
|
-
/* @__PURE__ */
|
|
5262
|
+
/* @__PURE__ */ jsx33(
|
|
5225
5263
|
"path",
|
|
5226
5264
|
{
|
|
5227
5265
|
fillRule: "evenodd",
|
|
@@ -5235,7 +5273,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5235
5273
|
|
|
5236
5274
|
// src/components/UserPopover/index.tsx
|
|
5237
5275
|
import { FormattedMessage as FormattedMessage9, useIntl as useIntl10 } from "react-intl";
|
|
5238
|
-
import { jsx as
|
|
5276
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5239
5277
|
function UserContent() {
|
|
5240
5278
|
const { logout, address, username } = useUserInfo();
|
|
5241
5279
|
const [logouting, setLogouting] = useState21(false);
|
|
@@ -5259,31 +5297,31 @@ function UserContent() {
|
|
|
5259
5297
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
5260
5298
|
/* @__PURE__ */ jsxs19("div", { className: `matchid-user-popover-item-content`, children: [
|
|
5261
5299
|
icon,
|
|
5262
|
-
/* @__PURE__ */
|
|
5300
|
+
/* @__PURE__ */ jsx34("div", { className: "matchid-user-popover-item-text", children })
|
|
5263
5301
|
] }),
|
|
5264
5302
|
rightIcon
|
|
5265
5303
|
] });
|
|
5266
5304
|
};
|
|
5267
5305
|
const UserDivider = () => {
|
|
5268
|
-
return /* @__PURE__ */
|
|
5306
|
+
return /* @__PURE__ */ jsx34("div", { className: `matchid-user-popover-divider` });
|
|
5269
5307
|
};
|
|
5270
5308
|
const [usernameOpen, setUsernameOpen] = useState21(false);
|
|
5271
5309
|
const [copied, setCopied] = useCopyClipboard();
|
|
5272
5310
|
const intl = useIntl10();
|
|
5273
5311
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-content", children: [
|
|
5274
5312
|
/* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-list", children: [
|
|
5275
|
-
/* @__PURE__ */
|
|
5313
|
+
/* @__PURE__ */ jsx34(UserItem, { onClick: () => {
|
|
5276
5314
|
setCopied(address);
|
|
5277
|
-
}, icon: copied ? /* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5315
|
+
}, icon: copied ? /* @__PURE__ */ jsx34(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ jsx34(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx34(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
5316
|
+
/* @__PURE__ */ jsx34(UserDivider, {}),
|
|
5317
|
+
/* @__PURE__ */ jsx34(UserItem, { onClick: () => {
|
|
5280
5318
|
setUsernameOpen(true);
|
|
5281
|
-
}, icon: /* @__PURE__ */
|
|
5319
|
+
}, icon: /* @__PURE__ */ jsx34(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx34(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
5282
5320
|
id: "setUsername"
|
|
5283
5321
|
}) })
|
|
5284
5322
|
] }),
|
|
5285
|
-
/* @__PURE__ */
|
|
5286
|
-
/* @__PURE__ */
|
|
5323
|
+
/* @__PURE__ */ jsx34(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ jsx34(FormattedMessage9, { id: "disconnect" }) }),
|
|
5324
|
+
/* @__PURE__ */ jsx34(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
5287
5325
|
setUsernameOpen(false);
|
|
5288
5326
|
}, onSuccess: () => {
|
|
5289
5327
|
setUsernameOpen(false);
|
|
@@ -5294,12 +5332,12 @@ function UserPopover({
|
|
|
5294
5332
|
children,
|
|
5295
5333
|
...props
|
|
5296
5334
|
}) {
|
|
5297
|
-
return /* @__PURE__ */
|
|
5335
|
+
return /* @__PURE__ */ jsx34(Popover, { ...props, content: /* @__PURE__ */ jsx34(UserContent, {}), children });
|
|
5298
5336
|
}
|
|
5299
5337
|
|
|
5300
5338
|
// src/components/LoginButton/index.tsx
|
|
5301
5339
|
import { FormattedMessage as FormattedMessage10, useIntl as useIntl11 } from "react-intl";
|
|
5302
|
-
import { Fragment as Fragment6, jsx as
|
|
5340
|
+
import { Fragment as Fragment6, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5303
5341
|
function LoginButton({
|
|
5304
5342
|
loginRender,
|
|
5305
5343
|
methods,
|
|
@@ -5316,7 +5354,7 @@ function LoginButton({
|
|
|
5316
5354
|
const [loginOpen, setLoginOpen] = useState22(false);
|
|
5317
5355
|
if (!isLogin) {
|
|
5318
5356
|
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
5319
|
-
/* @__PURE__ */
|
|
5357
|
+
/* @__PURE__ */ jsx35(
|
|
5320
5358
|
LoginModal,
|
|
5321
5359
|
{
|
|
5322
5360
|
methods,
|
|
@@ -5327,31 +5365,31 @@ function LoginButton({
|
|
|
5327
5365
|
}
|
|
5328
5366
|
),
|
|
5329
5367
|
/* @__PURE__ */ jsxs20(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
5330
|
-
/* @__PURE__ */
|
|
5331
|
-
/* @__PURE__ */
|
|
5368
|
+
/* @__PURE__ */ jsx35(UnLoginIcon_default, {}),
|
|
5369
|
+
/* @__PURE__ */ jsx35("span", { children: /* @__PURE__ */ jsx35(FormattedMessage10, { id: "login" }) })
|
|
5332
5370
|
] })
|
|
5333
5371
|
] });
|
|
5334
5372
|
}
|
|
5335
|
-
return loginRender ? /* @__PURE__ */
|
|
5336
|
-
/* @__PURE__ */
|
|
5337
|
-
/* @__PURE__ */
|
|
5373
|
+
return loginRender ? /* @__PURE__ */ jsx35(Fragment6, { children: loginRender }) : /* @__PURE__ */ jsx35(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ jsxs20(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
5374
|
+
/* @__PURE__ */ jsx35(LoginIcon_default, {}),
|
|
5375
|
+
/* @__PURE__ */ jsx35("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
5338
5376
|
id: "user"
|
|
5339
5377
|
}) })
|
|
5340
5378
|
] }) });
|
|
5341
5379
|
}
|
|
5342
5380
|
|
|
5343
5381
|
// src/components/UsernameModal/index.tsx
|
|
5344
|
-
import { useEffect as
|
|
5382
|
+
import { useEffect as useEffect22, useMemo as useMemo11, useState as useState23 } from "react";
|
|
5345
5383
|
import { FormattedMessage as FormattedMessage11, useIntl as useIntl12 } from "react-intl";
|
|
5346
|
-
import { jsx as
|
|
5384
|
+
import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5347
5385
|
var ValidItem = ({
|
|
5348
5386
|
success = false,
|
|
5349
5387
|
text
|
|
5350
5388
|
}) => {
|
|
5351
5389
|
const isDownMd = useDownMd();
|
|
5352
5390
|
return /* @__PURE__ */ jsxs21("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
5353
|
-
success ? /* @__PURE__ */
|
|
5354
|
-
/* @__PURE__ */
|
|
5391
|
+
success ? /* @__PURE__ */ jsx36(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx36(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
5392
|
+
/* @__PURE__ */ jsx36("span", { children: text })
|
|
5355
5393
|
] });
|
|
5356
5394
|
};
|
|
5357
5395
|
function UsernameModal({
|
|
@@ -5365,7 +5403,7 @@ function UsernameModal({
|
|
|
5365
5403
|
const [val, setVal] = useState23(username);
|
|
5366
5404
|
const [error, setError] = useState23("");
|
|
5367
5405
|
const isDownMd = useDownMd();
|
|
5368
|
-
|
|
5406
|
+
useEffect22(() => {
|
|
5369
5407
|
if (isOpen) {
|
|
5370
5408
|
setVal(username);
|
|
5371
5409
|
setError("");
|
|
@@ -5399,12 +5437,12 @@ function UsernameModal({
|
|
|
5399
5437
|
}
|
|
5400
5438
|
};
|
|
5401
5439
|
const intl = useIntl12();
|
|
5402
|
-
return /* @__PURE__ */
|
|
5440
|
+
return /* @__PURE__ */ jsx36(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
5403
5441
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
5404
5442
|
}), children: /* @__PURE__ */ jsxs21("div", { className: "matchid-username-box", children: [
|
|
5405
|
-
/* @__PURE__ */
|
|
5443
|
+
/* @__PURE__ */ jsx36(Field, { label: intl.formatMessage({
|
|
5406
5444
|
id: "username"
|
|
5407
|
-
}), error, children: /* @__PURE__ */
|
|
5445
|
+
}), error, children: /* @__PURE__ */ jsx36(
|
|
5408
5446
|
Input,
|
|
5409
5447
|
{
|
|
5410
5448
|
placeholder: intl.formatMessage({
|
|
@@ -5418,7 +5456,7 @@ function UsernameModal({
|
|
|
5418
5456
|
}
|
|
5419
5457
|
) }),
|
|
5420
5458
|
/* @__PURE__ */ jsxs21("div", { className: "matchid-valid", children: [
|
|
5421
|
-
/* @__PURE__ */
|
|
5459
|
+
/* @__PURE__ */ jsx36(
|
|
5422
5460
|
ValidItem,
|
|
5423
5461
|
{
|
|
5424
5462
|
success: isValid,
|
|
@@ -5427,21 +5465,21 @@ function UsernameModal({
|
|
|
5427
5465
|
})
|
|
5428
5466
|
}
|
|
5429
5467
|
),
|
|
5430
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx36(ValidItem, { success: isLength, text: intl.formatMessage({
|
|
5431
5469
|
id: "usernameLengthError"
|
|
5432
5470
|
}) })
|
|
5433
5471
|
] }),
|
|
5434
|
-
/* @__PURE__ */
|
|
5472
|
+
/* @__PURE__ */ jsx36(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
5435
5473
|
marginTop: isDownMd ? "36px" : "64px"
|
|
5436
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */
|
|
5437
|
-
/* @__PURE__ */
|
|
5474
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx36(FormattedMessage11, { id: "confirm" }) }),
|
|
5475
|
+
/* @__PURE__ */ jsx36(Button, { style: {
|
|
5438
5476
|
marginTop: isDownMd ? "12px" : "24px"
|
|
5439
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */
|
|
5477
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx36(FormattedMessage11, { id: "cancel" }) })
|
|
5440
5478
|
] }) });
|
|
5441
5479
|
}
|
|
5442
5480
|
|
|
5443
5481
|
// src/components/EVMModal/index.tsx
|
|
5444
|
-
import { useCallback as useCallback6, useEffect as
|
|
5482
|
+
import { useCallback as useCallback6, useEffect as useEffect24, useState as useState26 } from "react";
|
|
5445
5483
|
import { useIntl as useIntl13 } from "react-intl";
|
|
5446
5484
|
|
|
5447
5485
|
// src/components/WalletModalContent/index.tsx
|
|
@@ -5455,7 +5493,7 @@ var walletConnectImage = wallet_default;
|
|
|
5455
5493
|
var walletSigningImage = signing_default;
|
|
5456
5494
|
|
|
5457
5495
|
// src/components/WalletModalContent/index.tsx
|
|
5458
|
-
import { jsx as
|
|
5496
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5459
5497
|
function WalletModalContent({
|
|
5460
5498
|
status,
|
|
5461
5499
|
error,
|
|
@@ -5525,15 +5563,15 @@ function WalletModalContent({
|
|
|
5525
5563
|
statusImage: walletConnectImage
|
|
5526
5564
|
};
|
|
5527
5565
|
}, [visible, connected, status, error, address]);
|
|
5528
|
-
return /* @__PURE__ */
|
|
5566
|
+
return /* @__PURE__ */ jsx37("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5529
5567
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5530
|
-
/* @__PURE__ */
|
|
5568
|
+
/* @__PURE__ */ jsx37(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5531
5569
|
width: 128,
|
|
5532
5570
|
height: 128
|
|
5533
5571
|
} }),
|
|
5534
|
-
/* @__PURE__ */
|
|
5572
|
+
/* @__PURE__ */ jsx37("div", { className: pageData.isError ? "matchid-error" : "", children: pageData.text })
|
|
5535
5573
|
] }),
|
|
5536
|
-
/* @__PURE__ */
|
|
5574
|
+
/* @__PURE__ */ jsx37(
|
|
5537
5575
|
Button,
|
|
5538
5576
|
{
|
|
5539
5577
|
block: true,
|
|
@@ -5609,15 +5647,15 @@ function WalletModalContentV2(props) {
|
|
|
5609
5647
|
statusImage: walletConnectImage
|
|
5610
5648
|
};
|
|
5611
5649
|
}, [props, submitting]);
|
|
5612
|
-
return /* @__PURE__ */
|
|
5650
|
+
return /* @__PURE__ */ jsx37("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5613
5651
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5614
|
-
/* @__PURE__ */
|
|
5652
|
+
/* @__PURE__ */ jsx37(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5615
5653
|
width: 128,
|
|
5616
5654
|
height: 128
|
|
5617
5655
|
} }),
|
|
5618
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ jsx37("div", { className: props.status == "error" ? "matchid-error" : "", children: pageData.text })
|
|
5619
5657
|
] }),
|
|
5620
|
-
/* @__PURE__ */
|
|
5658
|
+
/* @__PURE__ */ jsx37(
|
|
5621
5659
|
Button,
|
|
5622
5660
|
{
|
|
5623
5661
|
block: true,
|
|
@@ -5636,13 +5674,13 @@ import { RainbowKitProvider as RainbowKitProvider2, useConnectModal } from "@rai
|
|
|
5636
5674
|
import { useAccount, useChainId, useConfig, useDisconnect } from "wagmi";
|
|
5637
5675
|
|
|
5638
5676
|
// src/hooks/useWalletBox.ts
|
|
5639
|
-
import { useEffect as
|
|
5677
|
+
import { useEffect as useEffect23, useRef as useRef7, useState as useState25 } from "react";
|
|
5640
5678
|
function useWalletBox({
|
|
5641
5679
|
onInit
|
|
5642
5680
|
}) {
|
|
5643
5681
|
const [status, setStateStatus] = useState25("start");
|
|
5644
5682
|
const [error, setError] = useState25("");
|
|
5645
|
-
const statusRef =
|
|
5683
|
+
const statusRef = useRef7(status);
|
|
5646
5684
|
const [nonce, setNonce] = useState25();
|
|
5647
5685
|
const setStatus = (status2) => {
|
|
5648
5686
|
statusRef.current = status2;
|
|
@@ -5652,7 +5690,7 @@ function useWalletBox({
|
|
|
5652
5690
|
setError("");
|
|
5653
5691
|
setNonce(null);
|
|
5654
5692
|
};
|
|
5655
|
-
|
|
5693
|
+
useEffect23(() => {
|
|
5656
5694
|
init();
|
|
5657
5695
|
onInit({
|
|
5658
5696
|
setStatus
|
|
@@ -5899,7 +5937,7 @@ async function getEthersSigner(config, { chainId } = {}) {
|
|
|
5899
5937
|
// src/components/EVMModal/index.tsx
|
|
5900
5938
|
import { SiweMessage } from "siwe";
|
|
5901
5939
|
import "@rainbow-me/rainbowkit/styles.css";
|
|
5902
|
-
import { jsx as
|
|
5940
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
5903
5941
|
function WalletContent({
|
|
5904
5942
|
onSuccess,
|
|
5905
5943
|
type
|
|
@@ -5916,10 +5954,10 @@ function WalletContent({
|
|
|
5916
5954
|
setStatus2("start");
|
|
5917
5955
|
}
|
|
5918
5956
|
});
|
|
5919
|
-
|
|
5957
|
+
useEffect24(() => {
|
|
5920
5958
|
matchlog_default.log(`status=${status}`, `connectModalOpen=${connectModalOpen}`, `address=${address}`, `isConnected=${isConnected}`);
|
|
5921
5959
|
}, [status, connectModalOpen, isConnected, address]);
|
|
5922
|
-
|
|
5960
|
+
useEffect24(() => {
|
|
5923
5961
|
if (connectModalOpen) {
|
|
5924
5962
|
setStatus("connecting");
|
|
5925
5963
|
return;
|
|
@@ -5932,7 +5970,7 @@ function WalletContent({
|
|
|
5932
5970
|
setStatus("start");
|
|
5933
5971
|
}
|
|
5934
5972
|
}, [connectModalOpen, address]);
|
|
5935
|
-
|
|
5973
|
+
useEffect24(() => {
|
|
5936
5974
|
if (openConnectModal && !isConnected && !inited) {
|
|
5937
5975
|
openConnectModal && openConnectModal();
|
|
5938
5976
|
setInited(true);
|
|
@@ -6015,7 +6053,7 @@ function WalletContent({
|
|
|
6015
6053
|
setError(error2.reason || error2.message);
|
|
6016
6054
|
}
|
|
6017
6055
|
}, [nonce, status, address]);
|
|
6018
|
-
|
|
6056
|
+
useEffect24(() => {
|
|
6019
6057
|
if (signature) {
|
|
6020
6058
|
signature();
|
|
6021
6059
|
}
|
|
@@ -6057,7 +6095,7 @@ function WalletContent({
|
|
|
6057
6095
|
setNonce(void 0);
|
|
6058
6096
|
setStatus("start");
|
|
6059
6097
|
};
|
|
6060
|
-
return /* @__PURE__ */
|
|
6098
|
+
return /* @__PURE__ */ jsx38(
|
|
6061
6099
|
WalletModalContentV2,
|
|
6062
6100
|
{
|
|
6063
6101
|
status,
|
|
@@ -6075,18 +6113,18 @@ function EVMConnectModal({
|
|
|
6075
6113
|
...props
|
|
6076
6114
|
}) {
|
|
6077
6115
|
const intl = useIntl13();
|
|
6078
|
-
return /* @__PURE__ */
|
|
6116
|
+
return /* @__PURE__ */ jsx38(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6079
6117
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6080
6118
|
}, {
|
|
6081
6119
|
name: "EVM"
|
|
6082
|
-
}), children: /* @__PURE__ */
|
|
6120
|
+
}), children: /* @__PURE__ */ jsx38(WalletContent, { onSuccess, type }) });
|
|
6083
6121
|
}
|
|
6084
6122
|
function EVMModal(props) {
|
|
6085
|
-
return props.isOpen && /* @__PURE__ */
|
|
6123
|
+
return props.isOpen && /* @__PURE__ */ jsx38(RainbowKitProvider2, { children: /* @__PURE__ */ jsx38(EVMConnectModal, { ...props }) });
|
|
6086
6124
|
}
|
|
6087
6125
|
|
|
6088
6126
|
// src/components/TRONModal/index.tsx
|
|
6089
|
-
import React11, { useEffect as
|
|
6127
|
+
import React11, { useEffect as useEffect26, useMemo as useMemo14, useState as useState28 } from "react";
|
|
6090
6128
|
import { useIntl as useIntl14 } from "react-intl";
|
|
6091
6129
|
|
|
6092
6130
|
// src/lib/tron/TronLinkAdapter.ts
|
|
@@ -6120,7 +6158,7 @@ var TronLinkAdapter = class {
|
|
|
6120
6158
|
};
|
|
6121
6159
|
|
|
6122
6160
|
// src/hooks/useTRONWallet.ts
|
|
6123
|
-
import { useEffect as
|
|
6161
|
+
import { useEffect as useEffect25, useState as useState27 } from "react";
|
|
6124
6162
|
|
|
6125
6163
|
// src/lib/tron/BitgetAdapter.ts
|
|
6126
6164
|
var BitgetAdapter = class {
|
|
@@ -6167,7 +6205,7 @@ var useTRONWallet = () => {
|
|
|
6167
6205
|
const wallets = [new TronLinkAdapter(), new BitgetAdapter(), new OKXAdapter()];
|
|
6168
6206
|
const [installedWallets, setInstalledWallets] = useState27([]);
|
|
6169
6207
|
const [address, setAddress] = useState27(null);
|
|
6170
|
-
|
|
6208
|
+
useEffect25(() => {
|
|
6171
6209
|
const getInstalled = async () => {
|
|
6172
6210
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6173
6211
|
wallet: wallet2,
|
|
@@ -6181,7 +6219,7 @@ var useTRONWallet = () => {
|
|
|
6181
6219
|
const onConnect = async () => {
|
|
6182
6220
|
setAddress(await wallet.connect());
|
|
6183
6221
|
};
|
|
6184
|
-
|
|
6222
|
+
useEffect25(() => {
|
|
6185
6223
|
if (!wallet) {
|
|
6186
6224
|
setAddress(null);
|
|
6187
6225
|
}
|
|
@@ -6197,7 +6235,7 @@ var useTRONWallet = () => {
|
|
|
6197
6235
|
};
|
|
6198
6236
|
|
|
6199
6237
|
// src/components/TRONModal/index.tsx
|
|
6200
|
-
import { jsx as
|
|
6238
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6201
6239
|
function TRONConnectModal({
|
|
6202
6240
|
type = "login",
|
|
6203
6241
|
onSuccess,
|
|
@@ -6207,9 +6245,9 @@ function TRONConnectModal({
|
|
|
6207
6245
|
const intl = useIntl14();
|
|
6208
6246
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
6209
6247
|
const iconMaps = {
|
|
6210
|
-
tronlink: /* @__PURE__ */
|
|
6211
|
-
bitget: /* @__PURE__ */
|
|
6212
|
-
okx: /* @__PURE__ */
|
|
6248
|
+
tronlink: /* @__PURE__ */ jsx39(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
6249
|
+
bitget: /* @__PURE__ */ jsx39(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
6250
|
+
okx: /* @__PURE__ */ jsx39(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
6213
6251
|
};
|
|
6214
6252
|
const { events, login } = useMatch();
|
|
6215
6253
|
const [status, setStatus] = useState28("");
|
|
@@ -6283,7 +6321,7 @@ function TRONConnectModal({
|
|
|
6283
6321
|
statusRef.current = "";
|
|
6284
6322
|
}
|
|
6285
6323
|
};
|
|
6286
|
-
|
|
6324
|
+
useEffect26(() => {
|
|
6287
6325
|
if (wallet) {
|
|
6288
6326
|
console.log("onConnect");
|
|
6289
6327
|
onConnect();
|
|
@@ -6291,21 +6329,21 @@ function TRONConnectModal({
|
|
|
6291
6329
|
setStatus("");
|
|
6292
6330
|
}
|
|
6293
6331
|
}, [wallet]);
|
|
6294
|
-
|
|
6332
|
+
useEffect26(() => {
|
|
6295
6333
|
if (address) {
|
|
6296
6334
|
toLoginInWallet();
|
|
6297
6335
|
}
|
|
6298
6336
|
}, [address]);
|
|
6299
|
-
|
|
6337
|
+
useEffect26(() => {
|
|
6300
6338
|
if (!props.isOpen) {
|
|
6301
6339
|
disconnect();
|
|
6302
6340
|
}
|
|
6303
6341
|
}, [props.isOpen]);
|
|
6304
|
-
return /* @__PURE__ */
|
|
6342
|
+
return /* @__PURE__ */ jsx39(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6305
6343
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6306
6344
|
}, {
|
|
6307
6345
|
name: "TRON"
|
|
6308
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
6346
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx39(
|
|
6309
6347
|
WalletModalContent,
|
|
6310
6348
|
{
|
|
6311
6349
|
error,
|
|
@@ -6318,9 +6356,9 @@ function TRONConnectModal({
|
|
|
6318
6356
|
setVisible: () => {
|
|
6319
6357
|
}
|
|
6320
6358
|
}
|
|
6321
|
-
) : /* @__PURE__ */
|
|
6359
|
+
) : /* @__PURE__ */ jsx39("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs23("div", { className: "matchid-login-recommend-list", children: [
|
|
6322
6360
|
installedWallets.map((wallet2) => {
|
|
6323
|
-
return /* @__PURE__ */
|
|
6361
|
+
return /* @__PURE__ */ jsx39(
|
|
6324
6362
|
RecommendItem,
|
|
6325
6363
|
{
|
|
6326
6364
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -6333,14 +6371,14 @@ function TRONConnectModal({
|
|
|
6333
6371
|
);
|
|
6334
6372
|
}),
|
|
6335
6373
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
6336
|
-
return /* @__PURE__ */
|
|
6374
|
+
return /* @__PURE__ */ jsx39(
|
|
6337
6375
|
RecommendItem,
|
|
6338
6376
|
{
|
|
6339
6377
|
icon: iconMaps[wallet2.walletKey],
|
|
6340
6378
|
name: wallet2.name,
|
|
6341
6379
|
onClick: () => {
|
|
6342
6380
|
},
|
|
6343
|
-
footer: /* @__PURE__ */
|
|
6381
|
+
footer: /* @__PURE__ */ jsx39(Button, { size: "sm", onClick: () => {
|
|
6344
6382
|
window.open(wallet2.website);
|
|
6345
6383
|
}, children: "Install" })
|
|
6346
6384
|
},
|
|
@@ -6350,11 +6388,11 @@ function TRONConnectModal({
|
|
|
6350
6388
|
] }) }) });
|
|
6351
6389
|
}
|
|
6352
6390
|
function TRONModal(props) {
|
|
6353
|
-
return props.isOpen && /* @__PURE__ */
|
|
6391
|
+
return props.isOpen && /* @__PURE__ */ jsx39(TRONConnectModal, { ...props, type: props.type });
|
|
6354
6392
|
}
|
|
6355
6393
|
|
|
6356
6394
|
// src/components/TONModal/index.tsx
|
|
6357
|
-
import React12, { useEffect as
|
|
6395
|
+
import React12, { useEffect as useEffect27, useState as useState29 } from "react";
|
|
6358
6396
|
import { useIntl as useIntl15 } from "react-intl";
|
|
6359
6397
|
import {
|
|
6360
6398
|
TonConnectUIProvider,
|
|
@@ -6363,7 +6401,7 @@ import {
|
|
|
6363
6401
|
useTonConnectUI,
|
|
6364
6402
|
useTonWallet
|
|
6365
6403
|
} from "@tonconnect/ui-react";
|
|
6366
|
-
import { jsx as
|
|
6404
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
6367
6405
|
function WalletContent2({
|
|
6368
6406
|
onSuccess,
|
|
6369
6407
|
type
|
|
@@ -6377,7 +6415,7 @@ function WalletContent2({
|
|
|
6377
6415
|
const [status, setStatus] = useState29("");
|
|
6378
6416
|
const statusRef = React12.useRef(status);
|
|
6379
6417
|
const [error, setError] = useState29("");
|
|
6380
|
-
|
|
6418
|
+
useEffect27(() => {
|
|
6381
6419
|
const init = async () => {
|
|
6382
6420
|
if (tonConnectUI.connected) {
|
|
6383
6421
|
await tonConnectUI.disconnect();
|
|
@@ -6450,7 +6488,7 @@ function WalletContent2({
|
|
|
6450
6488
|
}
|
|
6451
6489
|
});
|
|
6452
6490
|
}, []);
|
|
6453
|
-
|
|
6491
|
+
useEffect27(() => {
|
|
6454
6492
|
if (wallet) {
|
|
6455
6493
|
setConnected(true);
|
|
6456
6494
|
console.log("Wallet connected:", wallet);
|
|
@@ -6461,7 +6499,7 @@ function WalletContent2({
|
|
|
6461
6499
|
setStatus("");
|
|
6462
6500
|
}
|
|
6463
6501
|
}, [wallet]);
|
|
6464
|
-
|
|
6502
|
+
useEffect27(() => {
|
|
6465
6503
|
console.log({
|
|
6466
6504
|
state,
|
|
6467
6505
|
wallet
|
|
@@ -6490,7 +6528,7 @@ function WalletContent2({
|
|
|
6490
6528
|
}
|
|
6491
6529
|
}
|
|
6492
6530
|
}, [state]);
|
|
6493
|
-
return /* @__PURE__ */
|
|
6531
|
+
return /* @__PURE__ */ jsx40(
|
|
6494
6532
|
WalletModalContent,
|
|
6495
6533
|
{
|
|
6496
6534
|
connected,
|
|
@@ -6524,24 +6562,24 @@ function TONConnectModal({
|
|
|
6524
6562
|
const intl = useIntl15();
|
|
6525
6563
|
const { endpoints, appid } = useLocalStore_default();
|
|
6526
6564
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
6527
|
-
return /* @__PURE__ */
|
|
6565
|
+
return /* @__PURE__ */ jsx40(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6528
6566
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6529
6567
|
}, {
|
|
6530
6568
|
name: "TON"
|
|
6531
|
-
}), children: /* @__PURE__ */
|
|
6569
|
+
}), children: /* @__PURE__ */ jsx40(
|
|
6532
6570
|
TonConnectUIProvider,
|
|
6533
6571
|
{
|
|
6534
6572
|
manifestUrl,
|
|
6535
|
-
children: /* @__PURE__ */
|
|
6573
|
+
children: /* @__PURE__ */ jsx40(WalletContent2, { onSuccess, type })
|
|
6536
6574
|
}
|
|
6537
6575
|
) });
|
|
6538
6576
|
}
|
|
6539
6577
|
function TONModal(props) {
|
|
6540
|
-
return props.isOpen && /* @__PURE__ */
|
|
6578
|
+
return props.isOpen && /* @__PURE__ */ jsx40(TONConnectModal, { ...props });
|
|
6541
6579
|
}
|
|
6542
6580
|
|
|
6543
6581
|
// src/components/BTCModal/index.tsx
|
|
6544
|
-
import React13, { useEffect as
|
|
6582
|
+
import React13, { useEffect as useEffect29, useMemo as useMemo15, useState as useState31 } from "react";
|
|
6545
6583
|
import { useIntl as useIntl16 } from "react-intl";
|
|
6546
6584
|
|
|
6547
6585
|
// src/lib/btc/UnisatAdapter.ts
|
|
@@ -6696,7 +6734,7 @@ var LeatherAdapter = class {
|
|
|
6696
6734
|
};
|
|
6697
6735
|
|
|
6698
6736
|
// src/hooks/useBTCWallet.ts
|
|
6699
|
-
import { useEffect as
|
|
6737
|
+
import { useEffect as useEffect28, useState as useState30 } from "react";
|
|
6700
6738
|
|
|
6701
6739
|
// src/lib/btc/PhantomAdapter.ts
|
|
6702
6740
|
var PhantomAdapter = class {
|
|
@@ -6736,7 +6774,7 @@ var useBTCWallet = () => {
|
|
|
6736
6774
|
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter(), new PhantomAdapter()];
|
|
6737
6775
|
const [installedWallets, setInstalledWallets] = useState30([]);
|
|
6738
6776
|
const [address, setAddress] = useState30(null);
|
|
6739
|
-
|
|
6777
|
+
useEffect28(() => {
|
|
6740
6778
|
const getInstalled = async () => {
|
|
6741
6779
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6742
6780
|
wallet: wallet2,
|
|
@@ -6750,7 +6788,7 @@ var useBTCWallet = () => {
|
|
|
6750
6788
|
const onConnect = async () => {
|
|
6751
6789
|
setAddress(await wallet.connect());
|
|
6752
6790
|
};
|
|
6753
|
-
|
|
6791
|
+
useEffect28(() => {
|
|
6754
6792
|
if (!wallet) {
|
|
6755
6793
|
setAddress(null);
|
|
6756
6794
|
}
|
|
@@ -6766,7 +6804,7 @@ var useBTCWallet = () => {
|
|
|
6766
6804
|
};
|
|
6767
6805
|
|
|
6768
6806
|
// src/components/BTCModal/index.tsx
|
|
6769
|
-
import { jsx as
|
|
6807
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6770
6808
|
function BTCConnectModal({
|
|
6771
6809
|
type = "login",
|
|
6772
6810
|
onSuccess,
|
|
@@ -6776,10 +6814,10 @@ function BTCConnectModal({
|
|
|
6776
6814
|
const intl = useIntl16();
|
|
6777
6815
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
6778
6816
|
const iconMaps = {
|
|
6779
|
-
leather: /* @__PURE__ */
|
|
6780
|
-
unisat: /* @__PURE__ */
|
|
6781
|
-
xverse: /* @__PURE__ */
|
|
6782
|
-
phantom: /* @__PURE__ */
|
|
6817
|
+
leather: /* @__PURE__ */ jsx41(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
6818
|
+
unisat: /* @__PURE__ */ jsx41(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
6819
|
+
xverse: /* @__PURE__ */ jsx41(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
6820
|
+
phantom: /* @__PURE__ */ jsx41(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
6783
6821
|
};
|
|
6784
6822
|
const { events, login } = useMatch();
|
|
6785
6823
|
const [status, setStatus] = useState31("");
|
|
@@ -6849,7 +6887,7 @@ function BTCConnectModal({
|
|
|
6849
6887
|
statusRef.current = "";
|
|
6850
6888
|
}
|
|
6851
6889
|
};
|
|
6852
|
-
|
|
6890
|
+
useEffect29(() => {
|
|
6853
6891
|
if (wallet) {
|
|
6854
6892
|
console.log("onConnect");
|
|
6855
6893
|
try {
|
|
@@ -6862,12 +6900,12 @@ function BTCConnectModal({
|
|
|
6862
6900
|
setStatus("");
|
|
6863
6901
|
}
|
|
6864
6902
|
}, [wallet]);
|
|
6865
|
-
|
|
6903
|
+
useEffect29(() => {
|
|
6866
6904
|
if (address) {
|
|
6867
6905
|
toLoginInWallet();
|
|
6868
6906
|
}
|
|
6869
6907
|
}, [address]);
|
|
6870
|
-
|
|
6908
|
+
useEffect29(() => {
|
|
6871
6909
|
if (!props.isOpen) {
|
|
6872
6910
|
disconnect();
|
|
6873
6911
|
}
|
|
@@ -6879,11 +6917,11 @@ function BTCConnectModal({
|
|
|
6879
6917
|
statusRef.current = "";
|
|
6880
6918
|
setError("");
|
|
6881
6919
|
};
|
|
6882
|
-
return /* @__PURE__ */
|
|
6920
|
+
return /* @__PURE__ */ jsx41(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6883
6921
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6884
6922
|
}, {
|
|
6885
6923
|
name: "BTC"
|
|
6886
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
6924
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx41(
|
|
6887
6925
|
WalletModalContent,
|
|
6888
6926
|
{
|
|
6889
6927
|
error,
|
|
@@ -6896,9 +6934,9 @@ function BTCConnectModal({
|
|
|
6896
6934
|
setVisible: () => {
|
|
6897
6935
|
}
|
|
6898
6936
|
}
|
|
6899
|
-
) : /* @__PURE__ */
|
|
6937
|
+
) : /* @__PURE__ */ jsx41("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs24("div", { className: "matchid-login-recommend-list", children: [
|
|
6900
6938
|
installedWallets.map((wallet2) => {
|
|
6901
|
-
return /* @__PURE__ */
|
|
6939
|
+
return /* @__PURE__ */ jsx41(
|
|
6902
6940
|
RecommendItem,
|
|
6903
6941
|
{
|
|
6904
6942
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -6911,14 +6949,14 @@ function BTCConnectModal({
|
|
|
6911
6949
|
);
|
|
6912
6950
|
}),
|
|
6913
6951
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
6914
|
-
return /* @__PURE__ */
|
|
6952
|
+
return /* @__PURE__ */ jsx41(
|
|
6915
6953
|
RecommendItem,
|
|
6916
6954
|
{
|
|
6917
6955
|
icon: iconMaps[wallet2.walletKey],
|
|
6918
6956
|
name: wallet2.name,
|
|
6919
6957
|
onClick: () => {
|
|
6920
6958
|
},
|
|
6921
|
-
footer: /* @__PURE__ */
|
|
6959
|
+
footer: /* @__PURE__ */ jsx41(Button, { size: "sm", onClick: () => {
|
|
6922
6960
|
window.open(wallet2.website);
|
|
6923
6961
|
}, children: "Install" })
|
|
6924
6962
|
},
|
|
@@ -6928,13 +6966,13 @@ function BTCConnectModal({
|
|
|
6928
6966
|
] }) }) });
|
|
6929
6967
|
}
|
|
6930
6968
|
function BTCModal(props) {
|
|
6931
|
-
return props.isOpen && /* @__PURE__ */
|
|
6969
|
+
return props.isOpen && /* @__PURE__ */ jsx41(BTCConnectModal, { ...props });
|
|
6932
6970
|
}
|
|
6933
6971
|
|
|
6934
6972
|
// src/components/WalletModal/index.tsx
|
|
6935
6973
|
import { useMemo as useMemo16 } from "react";
|
|
6936
6974
|
import { useIntl as useIntl17 } from "react-intl";
|
|
6937
|
-
import { jsx as
|
|
6975
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6938
6976
|
function WalletConnectModal({
|
|
6939
6977
|
type,
|
|
6940
6978
|
methods: _methods,
|
|
@@ -6952,13 +6990,13 @@ function WalletConnectModal({
|
|
|
6952
6990
|
const platform = config.platform.map((p) => p.toLowerCase());
|
|
6953
6991
|
return WALLET_METHODS.filter((m) => platform.includes(m));
|
|
6954
6992
|
}, [config.platform, _methods]);
|
|
6955
|
-
return /* @__PURE__ */
|
|
6993
|
+
return /* @__PURE__ */ jsx42(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6956
6994
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6957
6995
|
}, {
|
|
6958
6996
|
name: ""
|
|
6959
|
-
}), children: /* @__PURE__ */
|
|
6997
|
+
}), children: /* @__PURE__ */ jsx42("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsx42("div", { className: "matchid-login-recommend-list", children: methods.map((method, index) => {
|
|
6960
6998
|
const m = walletMap[method];
|
|
6961
|
-
return /* @__PURE__ */
|
|
6999
|
+
return /* @__PURE__ */ jsx42(
|
|
6962
7000
|
RecommendItem,
|
|
6963
7001
|
{
|
|
6964
7002
|
icon: m?.icon,
|
|
@@ -6972,21 +7010,21 @@ function WalletConnectModal({
|
|
|
6972
7010
|
}) }) }) });
|
|
6973
7011
|
}
|
|
6974
7012
|
function WalletModal(props) {
|
|
6975
|
-
return props.isOpen && /* @__PURE__ */
|
|
7013
|
+
return props.isOpen && /* @__PURE__ */ jsx42(WalletConnectModal, { ...props });
|
|
6976
7014
|
}
|
|
6977
7015
|
|
|
6978
7016
|
// src/components/AlphaAvatar/index.tsx
|
|
6979
|
-
import { useEffect as
|
|
6980
|
-
import { jsx as
|
|
7017
|
+
import { useEffect as useEffect30, useState as useState32 } from "react";
|
|
7018
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6981
7019
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
6982
7020
|
const [avatar, setAvatar] = useState32(void 0);
|
|
6983
|
-
|
|
7021
|
+
useEffect30(() => {
|
|
6984
7022
|
if (name) {
|
|
6985
7023
|
const char = name[0].toUpperCase();
|
|
6986
7024
|
setAvatar(char);
|
|
6987
7025
|
}
|
|
6988
7026
|
}, [name]);
|
|
6989
|
-
return /* @__PURE__ */
|
|
7027
|
+
return /* @__PURE__ */ jsx43("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
6990
7028
|
width: size,
|
|
6991
7029
|
height: size,
|
|
6992
7030
|
fontSize: Math.ceil(size / 2)
|
|
@@ -6994,7 +7032,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
6994
7032
|
}
|
|
6995
7033
|
|
|
6996
7034
|
// src/components/WalletAsset/index.tsx
|
|
6997
|
-
import { jsx as
|
|
7035
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6998
7036
|
function WalletAsset({
|
|
6999
7037
|
onAssetClick,
|
|
7000
7038
|
matchWalletAssetsOptions
|
|
@@ -7004,7 +7042,7 @@ function WalletAsset({
|
|
|
7004
7042
|
list: walletAssets.mergedAssets
|
|
7005
7043
|
});
|
|
7006
7044
|
const { list } = useMatchChain();
|
|
7007
|
-
return /* @__PURE__ */
|
|
7045
|
+
return /* @__PURE__ */ jsx44("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7008
7046
|
const clickFunc = onAssetClick && onAssetClick(n);
|
|
7009
7047
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7010
7048
|
const getFooterColor = () => {
|
|
@@ -7023,7 +7061,7 @@ function WalletAsset({
|
|
|
7023
7061
|
cursor: clickFunc ? "pointer" : "default"
|
|
7024
7062
|
}, children: [
|
|
7025
7063
|
/* @__PURE__ */ jsxs25("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
7026
|
-
n.icon ? /* @__PURE__ */
|
|
7064
|
+
n.icon ? /* @__PURE__ */ jsx44("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ jsx44(
|
|
7027
7065
|
AlphaAvatar2,
|
|
7028
7066
|
{
|
|
7029
7067
|
className: `matchid-wallet-asset-icon`,
|
|
@@ -7031,12 +7069,12 @@ function WalletAsset({
|
|
|
7031
7069
|
name: n.symbol || n.name || ""
|
|
7032
7070
|
}
|
|
7033
7071
|
),
|
|
7034
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7072
|
+
chain?.iconUrl && /* @__PURE__ */ jsx44("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
7035
7073
|
] }),
|
|
7036
7074
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-info`, children: [
|
|
7037
|
-
/* @__PURE__ */
|
|
7075
|
+
/* @__PURE__ */ jsx44("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
7038
7076
|
"price" in n && /* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-content`, children: [
|
|
7039
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx44("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ jsx44(
|
|
7040
7078
|
NumberFormatter,
|
|
7041
7079
|
{
|
|
7042
7080
|
value: n.price,
|
|
@@ -7044,7 +7082,7 @@ function WalletAsset({
|
|
|
7044
7082
|
tFixNum: 2
|
|
7045
7083
|
}
|
|
7046
7084
|
) }),
|
|
7047
|
-
/* @__PURE__ */
|
|
7085
|
+
/* @__PURE__ */ jsx44("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ jsx44(
|
|
7048
7086
|
NumberFormatter,
|
|
7049
7087
|
{
|
|
7050
7088
|
value: n.value,
|
|
@@ -7054,14 +7092,14 @@ function WalletAsset({
|
|
|
7054
7092
|
) })
|
|
7055
7093
|
] }),
|
|
7056
7094
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
7057
|
-
/* @__PURE__ */
|
|
7095
|
+
/* @__PURE__ */ jsx44("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ jsx44(
|
|
7058
7096
|
NumberFormatter,
|
|
7059
7097
|
{
|
|
7060
7098
|
value: n.balance,
|
|
7061
7099
|
tFixNum: 3
|
|
7062
7100
|
}
|
|
7063
7101
|
) }),
|
|
7064
|
-
"price_change_24h" in n && /* @__PURE__ */
|
|
7102
|
+
"price_change_24h" in n && /* @__PURE__ */ jsx44("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ jsx44(
|
|
7065
7103
|
NumberFormatter,
|
|
7066
7104
|
{
|
|
7067
7105
|
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
@@ -7077,10 +7115,10 @@ function WalletAsset({
|
|
|
7077
7115
|
}
|
|
7078
7116
|
|
|
7079
7117
|
// src/components/TokenSend/index.tsx
|
|
7080
|
-
import { useEffect as
|
|
7118
|
+
import { useEffect as useEffect31, useMemo as useMemo17, useState as useState33 } from "react";
|
|
7081
7119
|
import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, erc20Abi as erc20Abi3, http as http8, parseUnits as parseUnits2 } from "viem";
|
|
7082
7120
|
import { FormattedMessage as FormattedMessage12, useIntl as useIntl18 } from "react-intl";
|
|
7083
|
-
import { jsx as
|
|
7121
|
+
import { jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7084
7122
|
function Input2({
|
|
7085
7123
|
onChange,
|
|
7086
7124
|
placeholder,
|
|
@@ -7091,7 +7129,7 @@ function Input2({
|
|
|
7091
7129
|
size = "df"
|
|
7092
7130
|
}) {
|
|
7093
7131
|
return /* @__PURE__ */ jsxs26("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
7094
|
-
/* @__PURE__ */
|
|
7132
|
+
/* @__PURE__ */ jsx45(
|
|
7095
7133
|
"input",
|
|
7096
7134
|
{
|
|
7097
7135
|
placeholder,
|
|
@@ -7102,7 +7140,7 @@ function Input2({
|
|
|
7102
7140
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
7103
7141
|
}
|
|
7104
7142
|
),
|
|
7105
|
-
error && /* @__PURE__ */
|
|
7143
|
+
error && /* @__PURE__ */ jsx45("div", { className: "matchid-token-input-error-text", children: error })
|
|
7106
7144
|
] });
|
|
7107
7145
|
}
|
|
7108
7146
|
function TokenSend({
|
|
@@ -7214,7 +7252,7 @@ function TokenSend({
|
|
|
7214
7252
|
}
|
|
7215
7253
|
onClose();
|
|
7216
7254
|
};
|
|
7217
|
-
|
|
7255
|
+
useEffect31(() => {
|
|
7218
7256
|
const receiveMessage = (event) => {
|
|
7219
7257
|
if (event.data) {
|
|
7220
7258
|
if (event.data.source == "match-wallet") {
|
|
@@ -7230,24 +7268,24 @@ function TokenSend({
|
|
|
7230
7268
|
window.removeEventListener("message", receiveMessage);
|
|
7231
7269
|
};
|
|
7232
7270
|
}, []);
|
|
7233
|
-
return /* @__PURE__ */
|
|
7271
|
+
return /* @__PURE__ */ jsx45(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ jsx45(FormattedMessage12, { id: "send" }), onBack, children: /* @__PURE__ */ jsxs26("div", { className: `matchid-token-send-box`, children: [
|
|
7234
7272
|
/* @__PURE__ */ jsxs26("div", { className: "matchid-token-send-content", children: [
|
|
7235
7273
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-content`, children: [
|
|
7236
7274
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-header`, children: [
|
|
7237
|
-
/* @__PURE__ */
|
|
7275
|
+
/* @__PURE__ */ jsx45("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ jsx45(FormattedMessage12, { id: "amount" }) }),
|
|
7238
7276
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-chain`, children: [
|
|
7239
|
-
token.icon ? /* @__PURE__ */
|
|
7277
|
+
token.icon ? /* @__PURE__ */ jsx45(
|
|
7240
7278
|
"img",
|
|
7241
7279
|
{
|
|
7242
7280
|
src: token?.icon,
|
|
7243
7281
|
alt: token?.symbol,
|
|
7244
7282
|
className: `matchid-token-amount-chain-icon`
|
|
7245
7283
|
}
|
|
7246
|
-
) : /* @__PURE__ */
|
|
7247
|
-
/* @__PURE__ */
|
|
7284
|
+
) : /* @__PURE__ */ jsx45(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
7285
|
+
/* @__PURE__ */ jsx45("span", { children: token?.symbol })
|
|
7248
7286
|
] })
|
|
7249
7287
|
] }),
|
|
7250
|
-
/* @__PURE__ */
|
|
7288
|
+
/* @__PURE__ */ jsx45(
|
|
7251
7289
|
Input2,
|
|
7252
7290
|
{
|
|
7253
7291
|
type: "text",
|
|
@@ -7262,16 +7300,16 @@ function TokenSend({
|
|
|
7262
7300
|
),
|
|
7263
7301
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-footer`, children: [
|
|
7264
7302
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-title`, children: [
|
|
7265
|
-
/* @__PURE__ */
|
|
7303
|
+
/* @__PURE__ */ jsx45(FormattedMessage12, { id: "balance" }),
|
|
7266
7304
|
":"
|
|
7267
7305
|
] }),
|
|
7268
|
-
/* @__PURE__ */
|
|
7306
|
+
/* @__PURE__ */ jsx45("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ jsx45(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
7269
7307
|
] }),
|
|
7270
|
-
/* @__PURE__ */
|
|
7308
|
+
/* @__PURE__ */ jsx45(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
7271
7309
|
] }),
|
|
7272
7310
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-address-content`, children: [
|
|
7273
|
-
/* @__PURE__ */
|
|
7274
|
-
/* @__PURE__ */
|
|
7311
|
+
/* @__PURE__ */ jsx45("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ jsx45("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ jsx45(FormattedMessage12, { id: "receiveTitle" }) }) }),
|
|
7312
|
+
/* @__PURE__ */ jsx45(
|
|
7275
7313
|
Input2,
|
|
7276
7314
|
{
|
|
7277
7315
|
type: "text",
|
|
@@ -7287,7 +7325,7 @@ function TokenSend({
|
|
|
7287
7325
|
)
|
|
7288
7326
|
] })
|
|
7289
7327
|
] }),
|
|
7290
|
-
/* @__PURE__ */
|
|
7328
|
+
/* @__PURE__ */ jsx45(
|
|
7291
7329
|
Button,
|
|
7292
7330
|
{
|
|
7293
7331
|
size: "lg",
|
|
@@ -7296,7 +7334,7 @@ function TokenSend({
|
|
|
7296
7334
|
disabled: !canSend || !!txError,
|
|
7297
7335
|
onClick: onNext,
|
|
7298
7336
|
loading: loading || sending,
|
|
7299
|
-
children: /* @__PURE__ */
|
|
7337
|
+
children: /* @__PURE__ */ jsx45(FormattedMessage12, { id: "next" })
|
|
7300
7338
|
}
|
|
7301
7339
|
)
|
|
7302
7340
|
] }) });
|
|
@@ -7304,7 +7342,7 @@ function TokenSend({
|
|
|
7304
7342
|
|
|
7305
7343
|
// src/components/TokenDetail/index.tsx
|
|
7306
7344
|
import { FormattedMessage as FormattedMessage13, useIntl as useIntl19 } from "react-intl";
|
|
7307
|
-
import { jsx as
|
|
7345
|
+
import { jsx as jsx46, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7308
7346
|
function TokenDetail({
|
|
7309
7347
|
onClose,
|
|
7310
7348
|
token
|
|
@@ -7314,41 +7352,41 @@ function TokenDetail({
|
|
|
7314
7352
|
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
7315
7353
|
const onSend = () => {
|
|
7316
7354
|
modal.show((props) => {
|
|
7317
|
-
return /* @__PURE__ */
|
|
7355
|
+
return /* @__PURE__ */ jsx46(TokenSend, { onClose: () => {
|
|
7318
7356
|
props.close();
|
|
7319
7357
|
onClose();
|
|
7320
7358
|
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
7321
7359
|
});
|
|
7322
7360
|
};
|
|
7323
7361
|
const intl = useIntl19();
|
|
7324
|
-
return /* @__PURE__ */
|
|
7362
|
+
return /* @__PURE__ */ jsx46(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
7325
7363
|
id: "tokenDetails"
|
|
7326
7364
|
}), onClose, children: /* @__PURE__ */ jsxs27("div", { className: `matchid-token-detail`, children: [
|
|
7327
7365
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-main`, children: [
|
|
7328
7366
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-info`, children: [
|
|
7329
7367
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-logo`, children: [
|
|
7330
|
-
token.icon ? /* @__PURE__ */
|
|
7331
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7368
|
+
token.icon ? /* @__PURE__ */ jsx46("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ jsx46(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
7369
|
+
chain?.iconUrl && /* @__PURE__ */ jsx46("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
7332
7370
|
] }),
|
|
7333
7371
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-name`, children: [
|
|
7334
|
-
/* @__PURE__ */
|
|
7372
|
+
/* @__PURE__ */ jsx46(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
7335
7373
|
" ",
|
|
7336
7374
|
token.symbol
|
|
7337
7375
|
] })
|
|
7338
7376
|
] }),
|
|
7339
7377
|
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ jsxs27("div", { className: `matchid-token-contract`, children: [
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
/* @__PURE__ */
|
|
7378
|
+
/* @__PURE__ */ jsx46("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
7379
|
+
/* @__PURE__ */ jsx46("div", { className: "matchid-token-contract-address", children: token.address })
|
|
7342
7380
|
] })
|
|
7343
7381
|
] }),
|
|
7344
|
-
/* @__PURE__ */
|
|
7382
|
+
/* @__PURE__ */ jsx46(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ jsx46(FormattedMessage13, { id: "send" }) })
|
|
7345
7383
|
] }) });
|
|
7346
7384
|
}
|
|
7347
7385
|
|
|
7348
7386
|
// src/components/TokenSendList/index.tsx
|
|
7349
7387
|
import { useState as useState34 } from "react";
|
|
7350
7388
|
import { FormattedMessage as FormattedMessage14 } from "react-intl";
|
|
7351
|
-
import { jsx as
|
|
7389
|
+
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7352
7390
|
function TokenSendList({ close }) {
|
|
7353
7391
|
const isDownMd = useDownMd();
|
|
7354
7392
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -7360,14 +7398,14 @@ function TokenSendList({ close }) {
|
|
|
7360
7398
|
const modal = useModal();
|
|
7361
7399
|
const onNext = () => {
|
|
7362
7400
|
checked && modal.show((props) => {
|
|
7363
|
-
return /* @__PURE__ */
|
|
7401
|
+
return /* @__PURE__ */ jsx47(TokenSend, { onClose: () => {
|
|
7364
7402
|
props.close();
|
|
7365
7403
|
close();
|
|
7366
7404
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
7367
7405
|
});
|
|
7368
7406
|
};
|
|
7369
7407
|
return /* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-list-box", children: [
|
|
7370
|
-
/* @__PURE__ */
|
|
7408
|
+
/* @__PURE__ */ jsx47("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7371
7409
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7372
7410
|
return /* @__PURE__ */ jsxs28(
|
|
7373
7411
|
"div",
|
|
@@ -7377,10 +7415,10 @@ function TokenSendList({ close }) {
|
|
|
7377
7415
|
setChecked(n);
|
|
7378
7416
|
},
|
|
7379
7417
|
children: [
|
|
7380
|
-
/* @__PURE__ */
|
|
7418
|
+
/* @__PURE__ */ jsx47(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
7381
7419
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-content", children: [
|
|
7382
7420
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-logo", children: [
|
|
7383
|
-
n.icon ? /* @__PURE__ */
|
|
7421
|
+
n.icon ? /* @__PURE__ */ jsx47("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ jsx47(
|
|
7384
7422
|
AlphaAvatar2,
|
|
7385
7423
|
{
|
|
7386
7424
|
className: `matchid-token-send-icon`,
|
|
@@ -7388,7 +7426,7 @@ function TokenSendList({ close }) {
|
|
|
7388
7426
|
name: n.symbol || n.name || ""
|
|
7389
7427
|
}
|
|
7390
7428
|
),
|
|
7391
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7429
|
+
chain?.iconUrl && /* @__PURE__ */ jsx47(
|
|
7392
7430
|
"img",
|
|
7393
7431
|
{
|
|
7394
7432
|
src: chain.iconUrl,
|
|
@@ -7398,8 +7436,8 @@ function TokenSendList({ close }) {
|
|
|
7398
7436
|
)
|
|
7399
7437
|
] }),
|
|
7400
7438
|
/* @__PURE__ */ jsxs28("div", { className: `matchid-token-send-info`, children: [
|
|
7401
|
-
/* @__PURE__ */
|
|
7402
|
-
/* @__PURE__ */
|
|
7439
|
+
/* @__PURE__ */ jsx47("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
7440
|
+
/* @__PURE__ */ jsx47("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ jsx47(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
7403
7441
|
] })
|
|
7404
7442
|
] })
|
|
7405
7443
|
]
|
|
@@ -7407,17 +7445,17 @@ function TokenSendList({ close }) {
|
|
|
7407
7445
|
index
|
|
7408
7446
|
);
|
|
7409
7447
|
}) }),
|
|
7410
|
-
/* @__PURE__ */
|
|
7448
|
+
/* @__PURE__ */ jsx47(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ jsx47(FormattedMessage14, { id: "next" }) })
|
|
7411
7449
|
] });
|
|
7412
7450
|
}
|
|
7413
7451
|
|
|
7414
7452
|
// src/components/TransactionList/index.tsx
|
|
7415
7453
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
7416
|
-
import { useEffect as
|
|
7454
|
+
import { useEffect as useEffect32, useMemo as useMemo18, useState as useState35 } from "react";
|
|
7417
7455
|
import { decodeFunctionData, defineChain as defineChain5, formatUnits as formatUnits3 } from "viem";
|
|
7418
7456
|
import { erc20Abi as erc20Abi4 } from "viem";
|
|
7419
7457
|
import { FormattedMessage as FormattedMessage15 } from "react-intl";
|
|
7420
|
-
import { jsx as
|
|
7458
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7421
7459
|
var Item = ({ data }) => {
|
|
7422
7460
|
const { address } = useWallet();
|
|
7423
7461
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
@@ -7492,7 +7530,7 @@ var Item = ({ data }) => {
|
|
|
7492
7530
|
}
|
|
7493
7531
|
return "loading";
|
|
7494
7532
|
}, [data.extra?.status, data.source, hashQuery.data]);
|
|
7495
|
-
|
|
7533
|
+
useEffect32(() => {
|
|
7496
7534
|
if (data.hash) {
|
|
7497
7535
|
setShouldRefetch(status == "loading");
|
|
7498
7536
|
}
|
|
@@ -7512,10 +7550,10 @@ var Item = ({ data }) => {
|
|
|
7512
7550
|
className: `matchid-transaction-item`,
|
|
7513
7551
|
children: [
|
|
7514
7552
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transacton-item-container`, children: [
|
|
7515
|
-
/* @__PURE__ */
|
|
7553
|
+
/* @__PURE__ */ jsx48("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ jsx48(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
7516
7554
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-details`, children: [
|
|
7517
|
-
/* @__PURE__ */
|
|
7518
|
-
/* @__PURE__ */
|
|
7555
|
+
/* @__PURE__ */ jsx48("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
7556
|
+
/* @__PURE__ */ jsx48(
|
|
7519
7557
|
"div",
|
|
7520
7558
|
{
|
|
7521
7559
|
className: `matchid-transaction-item-timestamp`,
|
|
@@ -7525,10 +7563,10 @@ var Item = ({ data }) => {
|
|
|
7525
7563
|
] })
|
|
7526
7564
|
] }),
|
|
7527
7565
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
7528
|
-
/* @__PURE__ */
|
|
7529
|
-
status == "loading" && /* @__PURE__ */
|
|
7530
|
-
status == "success" && /* @__PURE__ */
|
|
7531
|
-
status == "error" && /* @__PURE__ */
|
|
7566
|
+
/* @__PURE__ */ jsx48(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
7567
|
+
status == "loading" && /* @__PURE__ */ jsx48(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
7568
|
+
status == "success" && /* @__PURE__ */ jsx48(CheckRoundIcon, { size: 16 }),
|
|
7569
|
+
status == "error" && /* @__PURE__ */ jsx48(InfoRoundIcon, { size: 16 })
|
|
7532
7570
|
] })
|
|
7533
7571
|
]
|
|
7534
7572
|
}
|
|
@@ -7538,7 +7576,7 @@ function TransactionList({
|
|
|
7538
7576
|
scrollableTarget
|
|
7539
7577
|
}) {
|
|
7540
7578
|
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
7541
|
-
return /* @__PURE__ */
|
|
7579
|
+
return /* @__PURE__ */ jsx48(
|
|
7542
7580
|
InfiniteScroll,
|
|
7543
7581
|
{
|
|
7544
7582
|
scrollableTarget,
|
|
@@ -7546,11 +7584,11 @@ function TransactionList({
|
|
|
7546
7584
|
next: fetchMoreData,
|
|
7547
7585
|
hasMore,
|
|
7548
7586
|
loader: /* @__PURE__ */ jsxs29("div", { className: "matchid-list-nomore", children: [
|
|
7549
|
-
/* @__PURE__ */
|
|
7587
|
+
/* @__PURE__ */ jsx48(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
7550
7588
|
"Loading..."
|
|
7551
7589
|
] }),
|
|
7552
|
-
endMessage: items.length > 0 ? /* @__PURE__ */
|
|
7553
|
-
children: items.length == 0 && !hasMore ? /* @__PURE__ */
|
|
7590
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ jsx48("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx48(FormattedMessage15, { id: "noMoreRecords" }) }) : /* @__PURE__ */ jsx48("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx48(FormattedMessage15, { id: "noRecords" }) }),
|
|
7591
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ jsx48("div", { className: "mt-[150px]" }) : /* @__PURE__ */ jsx48("div", { className: `matchid-transaction-list`, children: items.map((item, index) => /* @__PURE__ */ jsx48(Item, { data: item }, index)) })
|
|
7554
7592
|
}
|
|
7555
7593
|
);
|
|
7556
7594
|
}
|
|
@@ -7604,6 +7642,7 @@ export {
|
|
|
7604
7642
|
Skeleton_default,
|
|
7605
7643
|
Tabs,
|
|
7606
7644
|
Lottie_default,
|
|
7645
|
+
Checkbox,
|
|
7607
7646
|
ui_exports,
|
|
7608
7647
|
ModalProvider,
|
|
7609
7648
|
useModal,
|
|
@@ -7624,4 +7663,4 @@ export {
|
|
|
7624
7663
|
MatchProvider,
|
|
7625
7664
|
useMatch
|
|
7626
7665
|
};
|
|
7627
|
-
//# sourceMappingURL=chunk-
|
|
7666
|
+
//# sourceMappingURL=chunk-YR46VC65.mjs.map
|