@matchain/matchid-sdk-react 0.1.55-alpha.15 → 0.1.55-alpha.17
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.js +30 -32
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +8 -9
- package/dist/assets/lottie.js +0 -1
- package/dist/assets/lottie.js.map +1 -1
- package/dist/assets/lottie.mjs +2 -3
- package/dist/chains.js +0 -1
- package/dist/chains.js.map +1 -1
- package/dist/chains.mjs +3 -4
- package/dist/{chunk-KZRLSMA4.mjs → chunk-3CR66BEX.mjs} +3 -4
- package/dist/{chunk-KZRLSMA4.mjs.map → chunk-3CR66BEX.mjs.map} +1 -1
- package/dist/{chunk-ULDTUWGQ.mjs → chunk-6PWLEXC3.mjs} +3 -4
- package/dist/{chunk-ULDTUWGQ.mjs.map → chunk-6PWLEXC3.mjs.map} +1 -1
- package/dist/{chunk-RFAPTFVE.mjs → chunk-FKXS2XRG.mjs} +2 -3
- package/dist/{chunk-RFAPTFVE.mjs.map → chunk-FKXS2XRG.mjs.map} +1 -1
- package/dist/{chunk-66QEWNJJ.mjs → chunk-HBOS3RBL.mjs} +3 -4
- package/dist/{chunk-66QEWNJJ.mjs.map → chunk-HBOS3RBL.mjs.map} +1 -1
- package/dist/{chunk-LA4YEM4O.mjs → chunk-IZOOVZAD.mjs} +1 -3
- package/dist/{chunk-LA4YEM4O.mjs.map → chunk-IZOOVZAD.mjs.map} +1 -1
- package/dist/chunk-J5LGTIGS.mjs +10 -0
- package/dist/{chunk-2E4Y2HA7.mjs → chunk-JX73EY6V.mjs} +1 -3
- package/dist/{chunk-2E4Y2HA7.mjs.map → chunk-JX73EY6V.mjs.map} +1 -1
- package/dist/{chunk-BWGTZNIT.mjs → chunk-PAXASLBR.mjs} +411 -414
- package/dist/chunk-PAXASLBR.mjs.map +1 -0
- package/dist/{chunk-K33FHUZM.mjs → chunk-UA6XHZHX.mjs} +1 -3
- package/dist/{chunk-K33FHUZM.mjs.map → chunk-UA6XHZHX.mjs.map} +1 -1
- package/dist/{chunk-ZC36JTEM.mjs → chunk-XR24AYII.mjs} +2 -3
- package/dist/{chunk-ZC36JTEM.mjs.map → chunk-XR24AYII.mjs.map} +1 -1
- package/dist/components.d.mts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +593 -17449
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +7 -8
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +316 -17172
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +7 -8
- package/dist/icon.d.mts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/icon.js +0 -1
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +2 -3
- package/dist/{index-QPdWAVPk.d.mts → index-BKSGbw7b.d.mts} +2 -2
- package/dist/{index-C14uKUDG.d.mts → index-BXbfmVoU.d.mts} +1 -1
- package/dist/{index-B80rDuha.d.ts → index-BtjgRcNJ.d.ts} +2 -2
- package/dist/{index-BBghnVDr.d.ts → index-C82WIWvx.d.ts} +4 -4
- package/dist/{index--EI6w9pi.d.mts → index-CHG4-0Z1.d.mts} +3 -3
- package/dist/{index-DGbpUvkd.d.ts → index-CsUEaGtM.d.ts} +1 -1
- package/dist/{index-Cl0JpAc1.d.ts → index-D1Ep9UMx.d.ts} +3 -3
- package/dist/{index-CHtFnnZk.d.mts → index-D7E317WV.d.mts} +4 -4
- package/dist/{index-hiCo96Vc.d.ts → index-DK7l3lsH.d.ts} +10 -7
- package/dist/{index-Dx4OFZhG.d.mts → index-YPRyEYt6.d.mts} +10 -7
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +409 -17265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -11
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/dist/types.mjs +3 -4
- package/dist/ui.d.mts +2 -3
- package/dist/ui.d.ts +2 -3
- package/dist/ui.js +74 -16930
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +7 -8
- package/dist/utils.js +0 -1
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +2 -3
- package/package.json +1 -1
- package/dist/chunk-BWGTZNIT.mjs.map +0 -1
- package/dist/chunk-VO2OJADI.mjs +0 -37
- package/dist/index.es-FMP4VX4N.mjs +0 -16847
- package/dist/index.es-FMP4VX4N.mjs.map +0 -1
- /package/dist/{chunk-VO2OJADI.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import {
|
|
3
2
|
matchMain,
|
|
4
3
|
matchTest
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JX73EY6V.mjs";
|
|
6
5
|
import {
|
|
7
6
|
NumberFormatter,
|
|
8
7
|
bytesToBase64,
|
|
@@ -16,7 +15,7 @@ import {
|
|
|
16
15
|
isValidEmail,
|
|
17
16
|
isValidUsername,
|
|
18
17
|
truncateAddress
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IZOOVZAD.mjs";
|
|
20
19
|
import {
|
|
21
20
|
ArrowDownIcon,
|
|
22
21
|
ArrowLeftIcon,
|
|
@@ -64,7 +63,7 @@ import {
|
|
|
64
63
|
XIcon,
|
|
65
64
|
XverseIcon,
|
|
66
65
|
YoutubeIcon
|
|
67
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-FKXS2XRG.mjs";
|
|
68
67
|
import {
|
|
69
68
|
confirm_default,
|
|
70
69
|
connecting_default,
|
|
@@ -73,10 +72,10 @@ import {
|
|
|
73
72
|
signing_default,
|
|
74
73
|
success_default,
|
|
75
74
|
wallet_default
|
|
76
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-XR24AYII.mjs";
|
|
77
76
|
import {
|
|
78
77
|
__export
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
80
79
|
|
|
81
80
|
// src/components/index.tsx
|
|
82
81
|
var components_exports = {};
|
|
@@ -107,7 +106,7 @@ __export(components_exports, {
|
|
|
107
106
|
});
|
|
108
107
|
|
|
109
108
|
// src/components/EmailModal/index.tsx
|
|
110
|
-
import { useEffect as
|
|
109
|
+
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
111
110
|
|
|
112
111
|
// src/ui/Modal/index.tsx
|
|
113
112
|
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
@@ -943,11 +942,11 @@ var useStore_default = useStore;
|
|
|
943
942
|
// src/hooks/useWallet.tsx
|
|
944
943
|
import { toAccount } from "viem/accounts";
|
|
945
944
|
import { createWalletClient } from "viem";
|
|
946
|
-
import { useEffect as
|
|
945
|
+
import { useEffect as useEffect7, useMemo as useMemo3 } from "react";
|
|
947
946
|
import { encodeDeployData } from "viem";
|
|
948
947
|
|
|
949
948
|
// src/context/ModalContext.tsx
|
|
950
|
-
import React3, { useState as
|
|
949
|
+
import React3, { useState as useState7, useCallback, createContext, useContext } from "react";
|
|
951
950
|
import { createPortal } from "react-dom";
|
|
952
951
|
|
|
953
952
|
// src/ui/index.ts
|
|
@@ -1298,25 +1297,23 @@ function Tabs(props) {
|
|
|
1298
1297
|
}
|
|
1299
1298
|
|
|
1300
1299
|
// src/ui/Lottie/index.tsx
|
|
1301
|
-
import {
|
|
1302
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1300
|
+
import { useLottie } from "lottie-react";
|
|
1303
1301
|
var LazyLottie = (props) => {
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
|
|
1311
|
-
return /* @__PURE__ */ jsx16(LottieReact, { loop: true, autoplay: true, ...props });
|
|
1302
|
+
const options = {
|
|
1303
|
+
animationData: props.animationData,
|
|
1304
|
+
loop: true,
|
|
1305
|
+
autoplay: true
|
|
1306
|
+
};
|
|
1307
|
+
const { View } = useLottie(options, props.style);
|
|
1308
|
+
return View;
|
|
1312
1309
|
};
|
|
1313
1310
|
var Lottie_default = LazyLottie;
|
|
1314
1311
|
|
|
1315
1312
|
// src/context/ModalContext.tsx
|
|
1316
|
-
import { jsx as
|
|
1313
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1317
1314
|
var ModalContext = createContext(null);
|
|
1318
1315
|
function ModalProvider({ children }) {
|
|
1319
|
-
const [modalState, setModalState] =
|
|
1316
|
+
const [modalState, setModalState] = useState7({
|
|
1320
1317
|
modals: [],
|
|
1321
1318
|
highestZIndex: 100
|
|
1322
1319
|
});
|
|
@@ -1355,7 +1352,7 @@ function ModalProvider({ children }) {
|
|
|
1355
1352
|
index: modalIndex,
|
|
1356
1353
|
zIndex: newZIndex,
|
|
1357
1354
|
close: () => closeModal(modalIndex),
|
|
1358
|
-
content: ({ close, zIndex }) => /* @__PURE__ */
|
|
1355
|
+
content: ({ close, zIndex }) => /* @__PURE__ */ jsx16(ModalDrawer, { showClose: true, isOpen: true, onClose: close, title: props.title, zIndex, onBack: props.onBack, children: /* @__PURE__ */ jsx16(props.content, { close, zIndex }) })
|
|
1359
1356
|
}],
|
|
1360
1357
|
highestZIndex: newZIndex
|
|
1361
1358
|
};
|
|
@@ -1411,7 +1408,7 @@ var useTransactionStore = create3(devtools2(persistedState2));
|
|
|
1411
1408
|
var useTransactionStore_default = useTransactionStore;
|
|
1412
1409
|
|
|
1413
1410
|
// src/hooks/useWallet.tsx
|
|
1414
|
-
import { jsx as
|
|
1411
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1415
1412
|
var AppClientId = "react-sdk-" + getVersion();
|
|
1416
1413
|
function useWallet() {
|
|
1417
1414
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -1501,7 +1498,7 @@ function useWallet() {
|
|
|
1501
1498
|
return void 0;
|
|
1502
1499
|
}
|
|
1503
1500
|
}, [address]);
|
|
1504
|
-
|
|
1501
|
+
useEffect7(() => {
|
|
1505
1502
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
1506
1503
|
}, [evmAccount]);
|
|
1507
1504
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -1585,12 +1582,12 @@ function useWallet() {
|
|
|
1585
1582
|
address: evmAccount.address
|
|
1586
1583
|
});
|
|
1587
1584
|
modal.show((props) => {
|
|
1588
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ jsx17(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
1589
1586
|
});
|
|
1590
1587
|
return txHash;
|
|
1591
1588
|
} catch (error) {
|
|
1592
1589
|
modal.show((props) => {
|
|
1593
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ jsx17(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, error: typeof error == "string" ? error : error.details || error.message, chain: _chain });
|
|
1594
1591
|
});
|
|
1595
1592
|
throw error;
|
|
1596
1593
|
}
|
|
@@ -1644,14 +1641,14 @@ function useWallet() {
|
|
|
1644
1641
|
|
|
1645
1642
|
// src/hooks/useCopyClipboard.ts
|
|
1646
1643
|
import copy from "copy-to-clipboard";
|
|
1647
|
-
import { useCallback as useCallback2, useEffect as
|
|
1644
|
+
import { useCallback as useCallback2, useEffect as useEffect8, useState as useState9 } from "react";
|
|
1648
1645
|
function useCopyClipboard(timeout = 500) {
|
|
1649
|
-
const [isCopied, setIsCopied] =
|
|
1646
|
+
const [isCopied, setIsCopied] = useState9(false);
|
|
1650
1647
|
const staticCopy = useCallback2((text) => {
|
|
1651
1648
|
const didCopy = copy(text);
|
|
1652
1649
|
setIsCopied(didCopy);
|
|
1653
1650
|
}, []);
|
|
1654
|
-
|
|
1651
|
+
useEffect8(() => {
|
|
1655
1652
|
if (isCopied) {
|
|
1656
1653
|
const hide = setTimeout(() => {
|
|
1657
1654
|
setIsCopied(false);
|
|
@@ -1666,12 +1663,12 @@ function useCopyClipboard(timeout = 500) {
|
|
|
1666
1663
|
}
|
|
1667
1664
|
|
|
1668
1665
|
// src/context/ToastContext.tsx
|
|
1669
|
-
import { useState as
|
|
1666
|
+
import { useState as useState10, useCallback as useCallback3, createContext as createContext2, useContext as useContext2 } from "react";
|
|
1670
1667
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1671
|
-
import { jsx as
|
|
1668
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1672
1669
|
var ToastContext = createContext2(null);
|
|
1673
1670
|
function ToastProvider({ children, zIndex = 299 }) {
|
|
1674
|
-
const [toasts, setToasts] =
|
|
1671
|
+
const [toasts, setToasts] = useState10([]);
|
|
1675
1672
|
const removeToast = useCallback3((id) => {
|
|
1676
1673
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
1677
1674
|
}, []);
|
|
@@ -1681,21 +1678,21 @@ function ToastProvider({ children, zIndex = 299 }) {
|
|
|
1681
1678
|
setTimeout(() => removeToast(id), timeout);
|
|
1682
1679
|
}, [removeToast]);
|
|
1683
1680
|
const success = useCallback3((text, timeout) => {
|
|
1684
|
-
show({ icon: /* @__PURE__ */
|
|
1681
|
+
show({ icon: /* @__PURE__ */ jsx18(CheckRoundIcon, { color: "#2FCC00", size: 24 }), text, timeout });
|
|
1685
1682
|
}, [show]);
|
|
1686
1683
|
const error = useCallback3((text, timeout) => {
|
|
1687
|
-
show({ icon: /* @__PURE__ */
|
|
1684
|
+
show({ icon: /* @__PURE__ */ jsx18(ErrorRoundIcon, { size: 24 }), text, timeout });
|
|
1688
1685
|
}, [show]);
|
|
1689
1686
|
const ToastComponent = createPortal2(
|
|
1690
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ jsx18("div", { className: "matchid-toast-box", style: {
|
|
1691
1688
|
zIndex
|
|
1692
1689
|
}, children: toasts.reverse().map(({ id, icon, text }) => /* @__PURE__ */ jsxs9(
|
|
1693
1690
|
"div",
|
|
1694
1691
|
{
|
|
1695
1692
|
className: "matchid-toast",
|
|
1696
1693
|
children: [
|
|
1697
|
-
icon && /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1694
|
+
icon && /* @__PURE__ */ jsx18("span", { children: icon }),
|
|
1695
|
+
/* @__PURE__ */ jsx18("span", { children: text })
|
|
1699
1696
|
]
|
|
1700
1697
|
},
|
|
1701
1698
|
id
|
|
@@ -1844,10 +1841,10 @@ function useWalletAssetListQuery({
|
|
|
1844
1841
|
}
|
|
1845
1842
|
|
|
1846
1843
|
// src/hooks/useMatchChain.tsx
|
|
1847
|
-
import { useMemo as useMemo4, useState as
|
|
1844
|
+
import { useMemo as useMemo4, useState as useState11 } from "react";
|
|
1848
1845
|
import { createPublicClient as createPublicClient3, formatUnits, http as http3, parseUnits } from "viem";
|
|
1849
1846
|
import { FormattedMessage as FormattedMessage2, useIntl as useIntl3 } from "react-intl";
|
|
1850
|
-
import { jsx as
|
|
1847
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1851
1848
|
function useMatchChain() {
|
|
1852
1849
|
const chainListQuery = useChainListQuery();
|
|
1853
1850
|
const modal = useModal();
|
|
@@ -1876,10 +1873,10 @@ function useMatchChain() {
|
|
|
1876
1873
|
close
|
|
1877
1874
|
}) {
|
|
1878
1875
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
1879
|
-
const [selectedChainId, setSelectedChainId] =
|
|
1876
|
+
const [selectedChainId, setSelectedChainId] = useState11(storeChainId2);
|
|
1880
1877
|
const isDownMd = useDownMd();
|
|
1881
1878
|
return /* @__PURE__ */ jsxs10("div", { className: `matchid-change-network-box`, children: [
|
|
1882
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx19("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
|
|
1883
1880
|
return /* @__PURE__ */ jsxs10(
|
|
1884
1881
|
"div",
|
|
1885
1882
|
{
|
|
@@ -1887,19 +1884,19 @@ function useMatchChain() {
|
|
|
1887
1884
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
1888
1885
|
children: [
|
|
1889
1886
|
/* @__PURE__ */ jsxs10("div", { className: `matchid-change-network-item-content`, children: [
|
|
1890
|
-
/* @__PURE__ */
|
|
1891
|
-
/* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ jsx19("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
1888
|
+
/* @__PURE__ */ jsx19("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
1892
1889
|
] }),
|
|
1893
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ jsx19(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
1894
1891
|
]
|
|
1895
1892
|
},
|
|
1896
1893
|
index
|
|
1897
1894
|
);
|
|
1898
1895
|
}) }),
|
|
1899
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ jsx19(Button, { size: "lg", highlight: true, onClick: () => {
|
|
1900
1897
|
setChainId2(selectedChainId || 0);
|
|
1901
1898
|
close();
|
|
1902
|
-
}, block: true, children: /* @__PURE__ */
|
|
1899
|
+
}, block: true, children: /* @__PURE__ */ jsx19(FormattedMessage2, { id: "confirm" }) })
|
|
1903
1900
|
] });
|
|
1904
1901
|
}
|
|
1905
1902
|
const showChangeNetwork = () => {
|
|
@@ -1936,7 +1933,7 @@ function useMatchChain() {
|
|
|
1936
1933
|
|
|
1937
1934
|
// src/hooks/useMatchWallet.tsx
|
|
1938
1935
|
import { QRCode } from "react-qrcode";
|
|
1939
|
-
import { useEffect as
|
|
1936
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useRef, useState as useState13 } from "react";
|
|
1940
1937
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
1941
1938
|
|
|
1942
1939
|
// src/config/index.tsx
|
|
@@ -2007,7 +2004,7 @@ var useContractStore_default = useContractStore;
|
|
|
2007
2004
|
import { FormattedMessage as FormattedMessage4, useIntl as useIntl5 } from "react-intl";
|
|
2008
2005
|
|
|
2009
2006
|
// src/components/ImportToken/index.tsx
|
|
2010
|
-
import { useEffect as
|
|
2007
|
+
import { useEffect as useEffect10, useMemo as useMemo5, useState as useState12 } from "react";
|
|
2011
2008
|
import { FormattedMessage as FormattedMessage3, useIntl as useIntl4 } from "react-intl";
|
|
2012
2009
|
import { useQueryClient } from "@tanstack/react-query";
|
|
2013
2010
|
import { defineChain, erc20Abi } from "viem";
|
|
@@ -2037,14 +2034,14 @@ function useIsContract({
|
|
|
2037
2034
|
}
|
|
2038
2035
|
|
|
2039
2036
|
// src/components/ImportToken/index.tsx
|
|
2040
|
-
import { jsx as
|
|
2037
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2041
2038
|
function ImportToken({ close }) {
|
|
2042
|
-
const [status, setStatus] =
|
|
2039
|
+
const [status, setStatus] = useState12("");
|
|
2043
2040
|
const { token } = useUserInfo();
|
|
2044
|
-
const [address, setAddress] =
|
|
2045
|
-
const [symbol, setSymbol] =
|
|
2046
|
-
const [decimals, setDecimals] =
|
|
2047
|
-
const [error, setError] =
|
|
2041
|
+
const [address, setAddress] = useState12("");
|
|
2042
|
+
const [symbol, setSymbol] = useState12("");
|
|
2043
|
+
const [decimals, setDecimals] = useState12("");
|
|
2044
|
+
const [error, setError] = useState12({});
|
|
2048
2045
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
2049
2046
|
const getContractInfo = async () => {
|
|
2050
2047
|
if (!publicClient) return;
|
|
@@ -2078,7 +2075,7 @@ function ImportToken({ close }) {
|
|
|
2078
2075
|
}
|
|
2079
2076
|
};
|
|
2080
2077
|
const intl = useIntl4();
|
|
2081
|
-
|
|
2078
|
+
useEffect10(() => {
|
|
2082
2079
|
if (address.length === 42) {
|
|
2083
2080
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2084
2081
|
if (!reg.test(address)) {
|
|
@@ -2097,7 +2094,7 @@ function ImportToken({ close }) {
|
|
|
2097
2094
|
}
|
|
2098
2095
|
}
|
|
2099
2096
|
}, [address, publicClient]);
|
|
2100
|
-
const [loading, setLoading] =
|
|
2097
|
+
const [loading, setLoading] = useState12(false);
|
|
2101
2098
|
const toast = useToast();
|
|
2102
2099
|
const queryClient2 = useQueryClient();
|
|
2103
2100
|
const onImport = async () => {
|
|
@@ -2150,20 +2147,20 @@ function ImportToken({ close }) {
|
|
|
2150
2147
|
if (status == "success" || status == "fail") {
|
|
2151
2148
|
return /* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2152
2149
|
/* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2153
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ jsx20("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ jsx20(Lottie_default, { animationData: status == "success" ? success_default : fail_default, style: {
|
|
2154
2151
|
width: "96px",
|
|
2155
2152
|
height: "96px"
|
|
2156
2153
|
} }) }),
|
|
2157
|
-
/* @__PURE__ */
|
|
2154
|
+
/* @__PURE__ */ jsx20("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ jsx20(FormattedMessage3, { id: "importSuccess" }) : /* @__PURE__ */ jsx20(FormattedMessage3, { id: "importFail" }) })
|
|
2158
2155
|
] }),
|
|
2159
|
-
status == "success" ? /* @__PURE__ */
|
|
2156
|
+
status == "success" ? /* @__PURE__ */ jsx20(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ jsx20(FormattedMessage3, { id: "close" }) }) : /* @__PURE__ */ jsx20(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ jsx20(FormattedMessage3, { id: "back" }) })
|
|
2160
2157
|
] });
|
|
2161
2158
|
}
|
|
2162
2159
|
return /* @__PURE__ */ jsxs11("div", { className: `matchid-import-token`, children: [
|
|
2163
2160
|
/* @__PURE__ */ jsxs11("div", { className: "matchid-import-token-form", children: [
|
|
2164
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ jsx20(Field, { label: intl.formatMessage({
|
|
2165
2162
|
id: "tokenSmartContract"
|
|
2166
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */
|
|
2163
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ jsx20(
|
|
2167
2164
|
Input,
|
|
2168
2165
|
{
|
|
2169
2166
|
placeholder: intl.formatMessage({
|
|
@@ -2174,9 +2171,9 @@ function ImportToken({ close }) {
|
|
|
2174
2171
|
maxLength: 42
|
|
2175
2172
|
}
|
|
2176
2173
|
) }),
|
|
2177
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ jsx20(Field, { label: intl.formatMessage({
|
|
2178
2175
|
id: "tokenSymbol"
|
|
2179
|
-
}), error: error.symbol, children: /* @__PURE__ */
|
|
2176
|
+
}), error: error.symbol, children: /* @__PURE__ */ jsx20(
|
|
2180
2177
|
Input,
|
|
2181
2178
|
{
|
|
2182
2179
|
placeholder: intl.formatMessage({
|
|
@@ -2187,9 +2184,9 @@ function ImportToken({ close }) {
|
|
|
2187
2184
|
maxLength: 16
|
|
2188
2185
|
}
|
|
2189
2186
|
) }),
|
|
2190
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsx20(Field, { label: intl.formatMessage({
|
|
2191
2188
|
id: "tokenDecimals"
|
|
2192
|
-
}), error: error.decimals, children: /* @__PURE__ */
|
|
2189
|
+
}), error: error.decimals, children: /* @__PURE__ */ jsx20(
|
|
2193
2190
|
Input,
|
|
2194
2191
|
{
|
|
2195
2192
|
placeholder: intl.formatMessage({
|
|
@@ -2201,7 +2198,7 @@ function ImportToken({ close }) {
|
|
|
2201
2198
|
}
|
|
2202
2199
|
) })
|
|
2203
2200
|
] }),
|
|
2204
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ jsx20(
|
|
2205
2202
|
Button,
|
|
2206
2203
|
{
|
|
2207
2204
|
size: "lg",
|
|
@@ -2210,14 +2207,14 @@ function ImportToken({ close }) {
|
|
|
2210
2207
|
loading: loading || isContractQuery.isLoading,
|
|
2211
2208
|
disabled: !canImport || !isContractQuery.data,
|
|
2212
2209
|
highlight: true,
|
|
2213
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ jsx20(FormattedMessage3, { id: "import" })
|
|
2214
2211
|
}
|
|
2215
2212
|
)
|
|
2216
2213
|
] });
|
|
2217
2214
|
}
|
|
2218
2215
|
|
|
2219
2216
|
// src/hooks/useMatchWallet.tsx
|
|
2220
|
-
import { jsx as
|
|
2217
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2221
2218
|
var ReceiveModal = () => {
|
|
2222
2219
|
const chain = useMatchChain();
|
|
2223
2220
|
const { address } = useWallet();
|
|
@@ -2233,8 +2230,8 @@ var ReceiveModal = () => {
|
|
|
2233
2230
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2234
2231
|
return /* @__PURE__ */ jsxs12("div", { className: `matchid-receive-modal`, children: [
|
|
2235
2232
|
/* @__PURE__ */ jsxs12("div", { className: "matchid-receive-container", children: [
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsx21("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ jsx21(FormattedMessage4, { id: "receiveQrcode" }) }),
|
|
2234
|
+
/* @__PURE__ */ jsx21("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ jsx21(
|
|
2238
2235
|
QRCode,
|
|
2239
2236
|
{
|
|
2240
2237
|
margin: "0",
|
|
@@ -2242,7 +2239,7 @@ var ReceiveModal = () => {
|
|
|
2242
2239
|
value: address
|
|
2243
2240
|
}
|
|
2244
2241
|
) }),
|
|
2245
|
-
/* @__PURE__ */
|
|
2242
|
+
/* @__PURE__ */ jsx21(
|
|
2246
2243
|
"a",
|
|
2247
2244
|
{
|
|
2248
2245
|
href: chainLink,
|
|
@@ -2252,7 +2249,7 @@ var ReceiveModal = () => {
|
|
|
2252
2249
|
}
|
|
2253
2250
|
)
|
|
2254
2251
|
] }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ jsx21(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ jsx21(
|
|
2256
2253
|
FormattedMessage4,
|
|
2257
2254
|
{
|
|
2258
2255
|
id: "copyAddress"
|
|
@@ -2294,8 +2291,8 @@ function useMatchWallet() {
|
|
|
2294
2291
|
};
|
|
2295
2292
|
}
|
|
2296
2293
|
function useMatchWalletRecords() {
|
|
2297
|
-
const [hasMore, setHasMore] =
|
|
2298
|
-
const [items, setItems] =
|
|
2294
|
+
const [hasMore, setHasMore] = useState13(true);
|
|
2295
|
+
const [items, setItems] = useState13([]);
|
|
2299
2296
|
const { chainId, publicClient } = useMatchChain();
|
|
2300
2297
|
const { address } = useWallet();
|
|
2301
2298
|
const hasMoreRef = useRef(hasMore);
|
|
@@ -2326,7 +2323,7 @@ function useMatchWalletRecords() {
|
|
|
2326
2323
|
hasMoreRef.current = true;
|
|
2327
2324
|
fetchMoreData();
|
|
2328
2325
|
};
|
|
2329
|
-
|
|
2326
|
+
useEffect11(() => {
|
|
2330
2327
|
if (chainId && address) {
|
|
2331
2328
|
onInit();
|
|
2332
2329
|
}
|
|
@@ -2561,7 +2558,7 @@ function useMatchWalletAssetList({
|
|
|
2561
2558
|
return { ...asset, balance, value, balanceValue };
|
|
2562
2559
|
});
|
|
2563
2560
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
2564
|
-
|
|
2561
|
+
useEffect11(() => {
|
|
2565
2562
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
2566
2563
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
2567
2564
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -2586,14 +2583,14 @@ function useMatchWalletAssetList({
|
|
|
2586
2583
|
}
|
|
2587
2584
|
|
|
2588
2585
|
// src/hooks/useReceipt.tsx
|
|
2589
|
-
import { useState as
|
|
2586
|
+
import { useState as useState14, useCallback as useCallback4, useEffect as useEffect12 } from "react";
|
|
2590
2587
|
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
2591
2588
|
import { createPublicClient as createPublicClient5, defineChain as defineChain2, http as http5 } from "viem";
|
|
2592
2589
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
2593
2590
|
var MAX_CACHE_SIZE = 500;
|
|
2594
2591
|
var STORAGE_KEY = "match_receipt_logs";
|
|
2595
2592
|
function useReceiptCache() {
|
|
2596
|
-
const [cache, setCache] =
|
|
2593
|
+
const [cache, setCache] = useState14(/* @__PURE__ */ new Map());
|
|
2597
2594
|
const isLocalStorageAvailable = (() => {
|
|
2598
2595
|
try {
|
|
2599
2596
|
const testKey = "__test__";
|
|
@@ -2604,7 +2601,7 @@ function useReceiptCache() {
|
|
|
2604
2601
|
return false;
|
|
2605
2602
|
}
|
|
2606
2603
|
})();
|
|
2607
|
-
|
|
2604
|
+
useEffect12(() => {
|
|
2608
2605
|
if (isLocalStorageAvailable) {
|
|
2609
2606
|
try {
|
|
2610
2607
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -2695,7 +2692,7 @@ function useReceipt({
|
|
|
2695
2692
|
const { list } = useMatchChain();
|
|
2696
2693
|
const cache = useReceiptCache();
|
|
2697
2694
|
const chain = list?.find((item) => item.id === chainId);
|
|
2698
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
2695
|
+
const [shouldRefetch, setShouldRefetch] = useState14(true);
|
|
2699
2696
|
const query = useQuery5({
|
|
2700
2697
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
2701
2698
|
queryFn: async () => {
|
|
@@ -2721,7 +2718,7 @@ function useReceipt({
|
|
|
2721
2718
|
},
|
|
2722
2719
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2723
2720
|
});
|
|
2724
|
-
|
|
2721
|
+
useEffect12(() => {
|
|
2725
2722
|
if (query.data) {
|
|
2726
2723
|
setShouldRefetch(false);
|
|
2727
2724
|
}
|
|
@@ -2730,14 +2727,14 @@ function useReceipt({
|
|
|
2730
2727
|
}
|
|
2731
2728
|
|
|
2732
2729
|
// src/hooks/useTransaction.tsx
|
|
2733
|
-
import { useState as
|
|
2730
|
+
import { useState as useState15, useCallback as useCallback5, useEffect as useEffect13 } from "react";
|
|
2734
2731
|
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
2735
2732
|
import { createPublicClient as createPublicClient6, defineChain as defineChain3, http as http6 } from "viem";
|
|
2736
2733
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
2737
2734
|
var MAX_CACHE_SIZE2 = 500;
|
|
2738
2735
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
2739
2736
|
function useTransactionCache() {
|
|
2740
|
-
const [cache, setCache] =
|
|
2737
|
+
const [cache, setCache] = useState15(/* @__PURE__ */ new Map());
|
|
2741
2738
|
const isLocalStorageAvailable = (() => {
|
|
2742
2739
|
try {
|
|
2743
2740
|
const testKey = "__test__";
|
|
@@ -2748,7 +2745,7 @@ function useTransactionCache() {
|
|
|
2748
2745
|
return false;
|
|
2749
2746
|
}
|
|
2750
2747
|
})();
|
|
2751
|
-
|
|
2748
|
+
useEffect13(() => {
|
|
2752
2749
|
if (isLocalStorageAvailable) {
|
|
2753
2750
|
try {
|
|
2754
2751
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -2839,7 +2836,7 @@ function useTransaction({
|
|
|
2839
2836
|
const { list } = useMatchChain();
|
|
2840
2837
|
const cache = useTransactionCache();
|
|
2841
2838
|
const chain = list?.find((item) => item.id === chainId);
|
|
2842
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
2839
|
+
const [shouldRefetch, setShouldRefetch] = useState15(true);
|
|
2843
2840
|
const query = useQuery6({
|
|
2844
2841
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
2845
2842
|
queryFn: async () => {
|
|
@@ -2865,7 +2862,7 @@ function useTransaction({
|
|
|
2865
2862
|
},
|
|
2866
2863
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2867
2864
|
});
|
|
2868
|
-
|
|
2865
|
+
useEffect13(() => {
|
|
2869
2866
|
if (query.data) {
|
|
2870
2867
|
setShouldRefetch(false);
|
|
2871
2868
|
}
|
|
@@ -2877,39 +2874,39 @@ function useTransaction({
|
|
|
2877
2874
|
import { create as create5 } from "zustand";
|
|
2878
2875
|
|
|
2879
2876
|
// src/hooks/useConfig.tsx
|
|
2880
|
-
import { jsx as
|
|
2877
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2881
2878
|
var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2882
2879
|
var WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2883
2880
|
function useWalletConfig() {
|
|
2884
2881
|
const isDownMd = useDownMd();
|
|
2885
2882
|
const walletMap = {
|
|
2886
2883
|
evm: {
|
|
2887
|
-
icon: /* @__PURE__ */
|
|
2888
|
-
activeIcon: /* @__PURE__ */
|
|
2884
|
+
icon: /* @__PURE__ */ jsx22(EVMDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2885
|
+
activeIcon: /* @__PURE__ */ jsx22(EVMLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2889
2886
|
name: "EVM",
|
|
2890
2887
|
method: "evm"
|
|
2891
2888
|
},
|
|
2892
2889
|
sol: {
|
|
2893
|
-
icon: /* @__PURE__ */
|
|
2894
|
-
activeIcon: /* @__PURE__ */
|
|
2890
|
+
icon: /* @__PURE__ */ jsx22(SOLDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2891
|
+
activeIcon: /* @__PURE__ */ jsx22(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2895
2892
|
name: "SOL",
|
|
2896
2893
|
method: "sol"
|
|
2897
2894
|
},
|
|
2898
2895
|
btc: {
|
|
2899
|
-
icon: /* @__PURE__ */
|
|
2900
|
-
activeIcon: /* @__PURE__ */
|
|
2896
|
+
icon: /* @__PURE__ */ jsx22(BTCDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2897
|
+
activeIcon: /* @__PURE__ */ jsx22(BTCLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2901
2898
|
name: "BTC",
|
|
2902
2899
|
method: "btc"
|
|
2903
2900
|
},
|
|
2904
2901
|
tron: {
|
|
2905
|
-
icon: /* @__PURE__ */
|
|
2906
|
-
activeIcon: /* @__PURE__ */
|
|
2902
|
+
icon: /* @__PURE__ */ jsx22(TRXDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2903
|
+
activeIcon: /* @__PURE__ */ jsx22(TRXLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2907
2904
|
name: "TRON",
|
|
2908
2905
|
method: "tron"
|
|
2909
2906
|
},
|
|
2910
2907
|
ton: {
|
|
2911
|
-
icon: /* @__PURE__ */
|
|
2912
|
-
activeIcon: /* @__PURE__ */
|
|
2908
|
+
icon: /* @__PURE__ */ jsx22(TonLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2909
|
+
activeIcon: /* @__PURE__ */ jsx22(TonLightIcon2, { size: isDownMd ? 36 : 40 }),
|
|
2913
2910
|
name: "TON",
|
|
2914
2911
|
method: "ton"
|
|
2915
2912
|
}
|
|
@@ -2959,9 +2956,9 @@ var useWalletModalStore = create5((set) => ({
|
|
|
2959
2956
|
}));
|
|
2960
2957
|
|
|
2961
2958
|
// src/components/CEXBindModal/index.tsx
|
|
2962
|
-
import { useEffect as
|
|
2959
|
+
import { useEffect as useEffect14, useMemo as useMemo7, useState as useState16 } from "react";
|
|
2963
2960
|
import { FormattedMessage as FormattedMessage5, useIntl as useIntl6 } from "react-intl";
|
|
2964
|
-
import { jsx as
|
|
2961
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2965
2962
|
function CEXBindModal({
|
|
2966
2963
|
onClose,
|
|
2967
2964
|
type,
|
|
@@ -2970,16 +2967,16 @@ function CEXBindModal({
|
|
|
2970
2967
|
}) {
|
|
2971
2968
|
const intl = useIntl6();
|
|
2972
2969
|
const { events } = useMatch();
|
|
2973
|
-
const [APIPassphrase, setAPIPassphrase] =
|
|
2970
|
+
const [APIPassphrase, setAPIPassphrase] = useState16("");
|
|
2974
2971
|
const { refreshOverview } = useUserInfo();
|
|
2975
|
-
const [loading, setLoading] =
|
|
2976
|
-
const [key, setKey] =
|
|
2977
|
-
const [secret, setSecret] =
|
|
2978
|
-
const [error, setError] =
|
|
2972
|
+
const [loading, setLoading] = useState16(false);
|
|
2973
|
+
const [key, setKey] = useState16("");
|
|
2974
|
+
const [secret, setSecret] = useState16("");
|
|
2975
|
+
const [error, setError] = useState16("");
|
|
2979
2976
|
const needPassphrase = useMemo7(() => {
|
|
2980
2977
|
return ["bitget", "okx"].includes(type.toLowerCase());
|
|
2981
2978
|
}, [type]);
|
|
2982
|
-
|
|
2979
|
+
useEffect14(() => {
|
|
2983
2980
|
if (isOpen) {
|
|
2984
2981
|
setSecret("");
|
|
2985
2982
|
setKey("");
|
|
@@ -3016,20 +3013,20 @@ function CEXBindModal({
|
|
|
3016
3013
|
setLoading(false);
|
|
3017
3014
|
}
|
|
3018
3015
|
};
|
|
3019
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ jsx23(ModalWithHeader, { showClose: true, isOpen, onClose, title: intl.formatMessage({
|
|
3020
3017
|
id: "CEXBindTitle"
|
|
3021
3018
|
}, {
|
|
3022
3019
|
type
|
|
3023
3020
|
}), ...props, children: /* @__PURE__ */ jsxs13("div", { className: "matchid-cex-modal", children: [
|
|
3024
3021
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
/* @__PURE__ */
|
|
3028
|
-
/* @__PURE__ */
|
|
3022
|
+
/* @__PURE__ */ jsx23("p", { children: /* @__PURE__ */ jsx23(FormattedMessage5, { id: "CEXBindAttention" }) }),
|
|
3023
|
+
/* @__PURE__ */ jsx23("p", { children: /* @__PURE__ */ jsx23(FormattedMessage5, { id: "CEXBindTips1" }) }),
|
|
3024
|
+
/* @__PURE__ */ jsx23("p", { children: /* @__PURE__ */ jsx23(FormattedMessage5, { id: "CEXBindTips2" }) }),
|
|
3025
|
+
/* @__PURE__ */ jsx23("p", { children: /* @__PURE__ */ jsx23(FormattedMessage5, { id: "CEXBindTips3" }) })
|
|
3029
3026
|
] }),
|
|
3030
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx23(Field, { label: intl.formatMessage({
|
|
3031
3028
|
id: "CEXBindApiKey"
|
|
3032
|
-
}), children: /* @__PURE__ */
|
|
3029
|
+
}), children: /* @__PURE__ */ jsx23(
|
|
3033
3030
|
Input,
|
|
3034
3031
|
{
|
|
3035
3032
|
value: key,
|
|
@@ -3037,9 +3034,9 @@ function CEXBindModal({
|
|
|
3037
3034
|
placeholder: "**** **** ****"
|
|
3038
3035
|
}
|
|
3039
3036
|
) }),
|
|
3040
|
-
/* @__PURE__ */
|
|
3037
|
+
/* @__PURE__ */ jsx23(Field, { label: intl.formatMessage({
|
|
3041
3038
|
id: "CEXBindApiSecretKey"
|
|
3042
|
-
}), error: !needPassphrase && error, children: /* @__PURE__ */
|
|
3039
|
+
}), error: !needPassphrase && error, children: /* @__PURE__ */ jsx23(
|
|
3043
3040
|
Input,
|
|
3044
3041
|
{
|
|
3045
3042
|
value: secret,
|
|
@@ -3047,9 +3044,9 @@ function CEXBindModal({
|
|
|
3047
3044
|
placeholder: "**** **** ****"
|
|
3048
3045
|
}
|
|
3049
3046
|
) }),
|
|
3050
|
-
needPassphrase && /* @__PURE__ */
|
|
3047
|
+
needPassphrase && /* @__PURE__ */ jsx23(Field, { error, label: intl.formatMessage({
|
|
3051
3048
|
id: "CEXBindApiPassphrase"
|
|
3052
|
-
}), children: /* @__PURE__ */
|
|
3049
|
+
}), children: /* @__PURE__ */ jsx23(
|
|
3053
3050
|
Input,
|
|
3054
3051
|
{
|
|
3055
3052
|
value: APIPassphrase,
|
|
@@ -3057,7 +3054,7 @@ function CEXBindModal({
|
|
|
3057
3054
|
placeholder: "**** **** ****"
|
|
3058
3055
|
}
|
|
3059
3056
|
) }),
|
|
3060
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsx23(
|
|
3061
3058
|
Button,
|
|
3062
3059
|
{
|
|
3063
3060
|
onClick: SubmitApi,
|
|
@@ -3065,7 +3062,7 @@ function CEXBindModal({
|
|
|
3065
3062
|
block: true,
|
|
3066
3063
|
loading,
|
|
3067
3064
|
disabled: !key || !secret,
|
|
3068
|
-
children: /* @__PURE__ */
|
|
3065
|
+
children: /* @__PURE__ */ jsx23(FormattedMessage5, { id: "continue" })
|
|
3069
3066
|
}
|
|
3070
3067
|
)
|
|
3071
3068
|
] }) });
|
|
@@ -3073,7 +3070,7 @@ function CEXBindModal({
|
|
|
3073
3070
|
|
|
3074
3071
|
// src/context/BusinessProvider.tsx
|
|
3075
3072
|
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
3076
|
-
import { Fragment as Fragment4, jsx as
|
|
3073
|
+
import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3077
3074
|
function BusinessProvider({ children }) {
|
|
3078
3075
|
const { overview, token } = useUserInfo();
|
|
3079
3076
|
const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
|
|
@@ -3108,7 +3105,7 @@ function BusinessProvider({ children }) {
|
|
|
3108
3105
|
refetchInterval: 1e3 * 5
|
|
3109
3106
|
});
|
|
3110
3107
|
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
3111
|
-
/* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ jsx24(
|
|
3112
3109
|
EVMModal,
|
|
3113
3110
|
{
|
|
3114
3111
|
isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
|
|
@@ -3118,7 +3115,7 @@ function BusinessProvider({ children }) {
|
|
|
3118
3115
|
zIndex: 199
|
|
3119
3116
|
}
|
|
3120
3117
|
),
|
|
3121
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsx24(
|
|
3122
3119
|
TRONModal,
|
|
3123
3120
|
{
|
|
3124
3121
|
isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
|
|
@@ -3128,7 +3125,7 @@ function BusinessProvider({ children }) {
|
|
|
3128
3125
|
zIndex: 199
|
|
3129
3126
|
}
|
|
3130
3127
|
),
|
|
3131
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ jsx24(
|
|
3132
3129
|
TONModal,
|
|
3133
3130
|
{
|
|
3134
3131
|
isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
|
|
@@ -3138,7 +3135,7 @@ function BusinessProvider({ children }) {
|
|
|
3138
3135
|
zIndex: 199
|
|
3139
3136
|
}
|
|
3140
3137
|
),
|
|
3141
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx24(
|
|
3142
3139
|
BTCModal,
|
|
3143
3140
|
{
|
|
3144
3141
|
isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
|
|
@@ -3148,7 +3145,7 @@ function BusinessProvider({ children }) {
|
|
|
3148
3145
|
zIndex: 199
|
|
3149
3146
|
}
|
|
3150
3147
|
),
|
|
3151
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ jsx24(
|
|
3152
3149
|
CEXBindModal,
|
|
3153
3150
|
{
|
|
3154
3151
|
isOpen: CEXIsOpen && (!!token && !!overview),
|
|
@@ -3157,7 +3154,7 @@ function BusinessProvider({ children }) {
|
|
|
3157
3154
|
zIndex: 199
|
|
3158
3155
|
}
|
|
3159
3156
|
),
|
|
3160
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsx24(
|
|
3161
3158
|
WalletModal,
|
|
3162
3159
|
{
|
|
3163
3160
|
isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
|
|
@@ -3172,14 +3169,14 @@ function BusinessProvider({ children }) {
|
|
|
3172
3169
|
}
|
|
3173
3170
|
|
|
3174
3171
|
// src/context/index.tsx
|
|
3175
|
-
import { jsx as
|
|
3172
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3176
3173
|
var Providers = ({ children }) => {
|
|
3177
|
-
return /* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsx25(ToastProvider, { children: /* @__PURE__ */ jsx25(ModalProvider, { children: /* @__PURE__ */ jsx25(BusinessProvider, { children }) }) });
|
|
3178
3175
|
};
|
|
3179
3176
|
var context_default = Providers;
|
|
3180
3177
|
|
|
3181
3178
|
// src/hooks/useWalletInit.ts
|
|
3182
|
-
import { useEffect as
|
|
3179
|
+
import { useEffect as useEffect15, useRef as useRef2 } from "react";
|
|
3183
3180
|
|
|
3184
3181
|
// src/utils/wallet.ts
|
|
3185
3182
|
var sendMessage = ({ method, data, resolve, reject, timeout }) => {
|
|
@@ -3213,10 +3210,10 @@ function useWalletInit({
|
|
|
3213
3210
|
const { endpoints, token, setWallet, appid, refreshOverview } = useLocalStore_default();
|
|
3214
3211
|
const { setWalletReady, walletReady } = useStore_default();
|
|
3215
3212
|
const iframeReadyRef = useRef2(walletReady);
|
|
3216
|
-
|
|
3213
|
+
useEffect15(() => {
|
|
3217
3214
|
setWallet(config);
|
|
3218
3215
|
}, [config]);
|
|
3219
|
-
|
|
3216
|
+
useEffect15(() => {
|
|
3220
3217
|
matchlog_default.log("sdk.mpc.status", walletReady, iframeReadyRef.current);
|
|
3221
3218
|
iframeReadyRef.current = walletReady;
|
|
3222
3219
|
if (iframeReadyRef.current) {
|
|
@@ -3233,7 +3230,7 @@ function useWalletInit({
|
|
|
3233
3230
|
onReady();
|
|
3234
3231
|
}
|
|
3235
3232
|
}, [walletReady]);
|
|
3236
|
-
|
|
3233
|
+
useEffect15(() => {
|
|
3237
3234
|
if (!endpoints.auth || !appid || !token || !config) {
|
|
3238
3235
|
const existingIframe = getWalletIframe();
|
|
3239
3236
|
if (existingIframe) {
|
|
@@ -3333,7 +3330,7 @@ function useWalletInit({
|
|
|
3333
3330
|
}
|
|
3334
3331
|
}
|
|
3335
3332
|
}, [endpoints.auth, appid, token, config]);
|
|
3336
|
-
|
|
3333
|
+
useEffect15(() => {
|
|
3337
3334
|
const messageHandle = async (e) => {
|
|
3338
3335
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
3339
3336
|
return;
|
|
@@ -3414,7 +3411,7 @@ function useWalletInit({
|
|
|
3414
3411
|
}
|
|
3415
3412
|
|
|
3416
3413
|
// src/hooks/useInit.tsx
|
|
3417
|
-
import { useEffect as
|
|
3414
|
+
import { useEffect as useEffect16, useRef as useRef3 } from "react";
|
|
3418
3415
|
function useInit({
|
|
3419
3416
|
theme,
|
|
3420
3417
|
appid,
|
|
@@ -3439,19 +3436,19 @@ function useInit({
|
|
|
3439
3436
|
const matchToken = searchParams.get("matchToken");
|
|
3440
3437
|
const matchidt = searchParams.get("matchidt");
|
|
3441
3438
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
3442
|
-
|
|
3439
|
+
useEffect16(() => {
|
|
3443
3440
|
setTheme(theme);
|
|
3444
3441
|
}, [theme]);
|
|
3445
|
-
|
|
3442
|
+
useEffect16(() => {
|
|
3446
3443
|
setAppid(appid);
|
|
3447
3444
|
}, [appid]);
|
|
3448
|
-
|
|
3445
|
+
useEffect16(() => {
|
|
3449
3446
|
setEndpoints(realEndpoints);
|
|
3450
3447
|
}, [realEndpoints]);
|
|
3451
|
-
|
|
3448
|
+
useEffect16(() => {
|
|
3452
3449
|
setLocale(locale || "en");
|
|
3453
3450
|
}, [locale]);
|
|
3454
|
-
|
|
3451
|
+
useEffect16(() => {
|
|
3455
3452
|
if (matchToken) {
|
|
3456
3453
|
const tokenData = JSON.parse(atob(matchToken));
|
|
3457
3454
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -3462,7 +3459,7 @@ function useInit({
|
|
|
3462
3459
|
}
|
|
3463
3460
|
}
|
|
3464
3461
|
}, [matchToken]);
|
|
3465
|
-
|
|
3462
|
+
useEffect16(() => {
|
|
3466
3463
|
if (matchidt) {
|
|
3467
3464
|
const tokenData = decodeURIComponent(matchidt);
|
|
3468
3465
|
const data = JSON.parse(decodeBase64(tokenData));
|
|
@@ -3492,7 +3489,7 @@ function useInit({
|
|
|
3492
3489
|
}
|
|
3493
3490
|
}
|
|
3494
3491
|
}, [matchidt]);
|
|
3495
|
-
|
|
3492
|
+
useEffect16(() => {
|
|
3496
3493
|
const onLoginMessage = (event) => {
|
|
3497
3494
|
const res = event.data;
|
|
3498
3495
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -3529,7 +3526,7 @@ function useInit({
|
|
|
3529
3526
|
overviewLoadingRef.current = false;
|
|
3530
3527
|
}
|
|
3531
3528
|
};
|
|
3532
|
-
|
|
3529
|
+
useEffect16(() => {
|
|
3533
3530
|
if (token) {
|
|
3534
3531
|
loadOverview();
|
|
3535
3532
|
}
|
|
@@ -4378,7 +4375,7 @@ import {
|
|
|
4378
4375
|
} from "@rainbow-me/rainbowkit/wallets";
|
|
4379
4376
|
import { arbitrum, base, bsc, mainnet, optimism, polygon } from "wagmi/chains";
|
|
4380
4377
|
import { WagmiProvider } from "wagmi";
|
|
4381
|
-
import { jsx as
|
|
4378
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4382
4379
|
var queryClient = new QueryClient();
|
|
4383
4380
|
var wagmiConfig = getDefaultConfig({
|
|
4384
4381
|
appName: "MatchID",
|
|
@@ -4417,7 +4414,7 @@ var MatchProvider = ({
|
|
|
4417
4414
|
useWalletInit({
|
|
4418
4415
|
config: wallet
|
|
4419
4416
|
});
|
|
4420
|
-
return /* @__PURE__ */
|
|
4417
|
+
return /* @__PURE__ */ jsx26(IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ jsx26(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx26(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx26(RainbowKitProvider, { children: /* @__PURE__ */ jsx26(
|
|
4421
4418
|
MatchContext.Provider,
|
|
4422
4419
|
{
|
|
4423
4420
|
value: {
|
|
@@ -4428,7 +4425,7 @@ var MatchProvider = ({
|
|
|
4428
4425
|
theme,
|
|
4429
4426
|
locale: realLocale
|
|
4430
4427
|
},
|
|
4431
|
-
children: /* @__PURE__ */
|
|
4428
|
+
children: /* @__PURE__ */ jsx26(context_default, { children })
|
|
4432
4429
|
}
|
|
4433
4430
|
) }) }) }) });
|
|
4434
4431
|
};
|
|
@@ -4738,18 +4735,18 @@ function useUserInfo() {
|
|
|
4738
4735
|
}
|
|
4739
4736
|
|
|
4740
4737
|
// src/components/EmailModal/StepVerify.tsx
|
|
4741
|
-
import { useEffect as
|
|
4738
|
+
import { useEffect as useEffect18, useMemo as useMemo9, useRef as useRef4, useState as useState18 } from "react";
|
|
4742
4739
|
import { FormattedMessage as FormattedMessage6, useIntl as useIntl7 } from "react-intl";
|
|
4743
|
-
import { jsx as
|
|
4740
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4744
4741
|
function StepVerify(props) {
|
|
4745
4742
|
const intl = useIntl7();
|
|
4746
4743
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
4747
|
-
const [error, setError] =
|
|
4748
|
-
const [code, setCode] =
|
|
4749
|
-
const [sending, setSending] =
|
|
4750
|
-
const [submitting, setSubmitting] =
|
|
4744
|
+
const [error, setError] = useState18("");
|
|
4745
|
+
const [code, setCode] = useState18("");
|
|
4746
|
+
const [sending, setSending] = useState18(false);
|
|
4747
|
+
const [submitting, setSubmitting] = useState18(false);
|
|
4751
4748
|
const sendTimeRef = useRef4(0);
|
|
4752
|
-
const [sendBtnText, setSendBtnText] =
|
|
4749
|
+
const [sendBtnText, setSendBtnText] = useState18(intl.formatMessage({
|
|
4753
4750
|
id: "send"
|
|
4754
4751
|
}));
|
|
4755
4752
|
const intervalTime = EMAIL_INTERVAL;
|
|
@@ -4785,7 +4782,7 @@ function StepVerify(props) {
|
|
|
4785
4782
|
setSending(false);
|
|
4786
4783
|
}
|
|
4787
4784
|
};
|
|
4788
|
-
|
|
4785
|
+
useEffect18(() => {
|
|
4789
4786
|
onSend();
|
|
4790
4787
|
return () => {
|
|
4791
4788
|
if (intervalRef.current) {
|
|
@@ -4819,15 +4816,15 @@ function StepVerify(props) {
|
|
|
4819
4816
|
};
|
|
4820
4817
|
return /* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-box", children: [
|
|
4821
4818
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header", children: [
|
|
4822
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsx27("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx27(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
4823
4820
|
/* @__PURE__ */ jsxs15("div", { className: "matchid-email-verify-header-content", children: [
|
|
4824
|
-
/* @__PURE__ */
|
|
4825
|
-
/* @__PURE__ */
|
|
4821
|
+
/* @__PURE__ */ jsx27("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
4822
|
+
/* @__PURE__ */ jsx27("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ jsx27(FormattedMessage6, { id: "sendEmailTips" }) })
|
|
4826
4823
|
] })
|
|
4827
4824
|
] }),
|
|
4828
|
-
/* @__PURE__ */
|
|
4825
|
+
/* @__PURE__ */ jsx27(Field, { label: intl.formatMessage({
|
|
4829
4826
|
id: "verificationCode"
|
|
4830
|
-
}), error, children: /* @__PURE__ */
|
|
4827
|
+
}), error, children: /* @__PURE__ */ jsx27(
|
|
4831
4828
|
Input,
|
|
4832
4829
|
{
|
|
4833
4830
|
placeholder: intl.formatMessage({
|
|
@@ -4837,7 +4834,7 @@ function StepVerify(props) {
|
|
|
4837
4834
|
maxLength: codeLength,
|
|
4838
4835
|
onChange: (e) => setCode(e.target.value),
|
|
4839
4836
|
value: code,
|
|
4840
|
-
after: /* @__PURE__ */
|
|
4837
|
+
after: /* @__PURE__ */ jsx27(
|
|
4841
4838
|
Button,
|
|
4842
4839
|
{
|
|
4843
4840
|
highlight: true,
|
|
@@ -4856,13 +4853,13 @@ function StepVerify(props) {
|
|
|
4856
4853
|
)
|
|
4857
4854
|
}
|
|
4858
4855
|
) }),
|
|
4859
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsx27(Button, { disabled: !canContinue, loading: submitting, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ jsx27(FormattedMessage6, { id: "continue" }) })
|
|
4860
4857
|
] });
|
|
4861
4858
|
}
|
|
4862
4859
|
|
|
4863
4860
|
// src/components/EmailModal/index.tsx
|
|
4864
4861
|
import { useIntl as useIntl8 } from "react-intl";
|
|
4865
|
-
import { jsx as
|
|
4862
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4866
4863
|
function EmailModal({
|
|
4867
4864
|
isOpen = false,
|
|
4868
4865
|
width = 480,
|
|
@@ -4870,16 +4867,16 @@ function EmailModal({
|
|
|
4870
4867
|
onBack,
|
|
4871
4868
|
onLogin
|
|
4872
4869
|
}) {
|
|
4873
|
-
const [step, setStep] =
|
|
4874
|
-
const [emailVal, setEmailVal] =
|
|
4870
|
+
const [step, setStep] = useState19("input");
|
|
4871
|
+
const [emailVal, setEmailVal] = useState19("");
|
|
4875
4872
|
const intl = useIntl8();
|
|
4876
|
-
|
|
4873
|
+
useEffect19(() => {
|
|
4877
4874
|
if (!isOpen) {
|
|
4878
4875
|
setStep("input");
|
|
4879
4876
|
setEmailVal("");
|
|
4880
4877
|
}
|
|
4881
4878
|
}, [isOpen]);
|
|
4882
|
-
return /* @__PURE__ */
|
|
4879
|
+
return /* @__PURE__ */ jsx28(
|
|
4883
4880
|
ModalWithHeader,
|
|
4884
4881
|
{
|
|
4885
4882
|
isOpen,
|
|
@@ -4889,16 +4886,16 @@ function EmailModal({
|
|
|
4889
4886
|
id: "email"
|
|
4890
4887
|
}),
|
|
4891
4888
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
4892
|
-
children: step === "input" ? /* @__PURE__ */
|
|
4889
|
+
children: step === "input" ? /* @__PURE__ */ jsx28(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
4893
4890
|
setEmailVal(email);
|
|
4894
4891
|
setStep("verify");
|
|
4895
|
-
} }) : /* @__PURE__ */
|
|
4892
|
+
} }) : /* @__PURE__ */ jsx28(StepVerify, { email: emailVal, onSuccess: onLogin })
|
|
4896
4893
|
}
|
|
4897
4894
|
);
|
|
4898
4895
|
}
|
|
4899
4896
|
|
|
4900
4897
|
// src/components/LoginBox/index.tsx
|
|
4901
|
-
import { useMemo as useMemo10, useState as
|
|
4898
|
+
import { useMemo as useMemo10, useState as useState20 } from "react";
|
|
4902
4899
|
import { FormattedMessage as FormattedMessage7, useIntl as useIntl9 } from "react-intl";
|
|
4903
4900
|
|
|
4904
4901
|
// src/hooks/useAppConfig.ts
|
|
@@ -4922,7 +4919,7 @@ function useAppConfig() {
|
|
|
4922
4919
|
}
|
|
4923
4920
|
|
|
4924
4921
|
// src/components/LoginBox/index.tsx
|
|
4925
|
-
import { Fragment as Fragment5, jsx as
|
|
4922
|
+
import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4926
4923
|
var RecommendItem = ({
|
|
4927
4924
|
icon,
|
|
4928
4925
|
name,
|
|
@@ -4934,17 +4931,17 @@ var RecommendItem = ({
|
|
|
4934
4931
|
return /* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method", children: [
|
|
4935
4932
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
4936
4933
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-method-content", children: [
|
|
4937
|
-
/* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
4935
|
+
/* @__PURE__ */ jsx29("span", { className: "matchid-login-recommend-method-name", children: name })
|
|
4939
4936
|
] }),
|
|
4940
|
-
footer ? footer : children ? /* @__PURE__ */
|
|
4937
|
+
footer ? footer : children ? /* @__PURE__ */ jsx29(
|
|
4941
4938
|
ArrowDownIcon,
|
|
4942
4939
|
{
|
|
4943
4940
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
4944
4941
|
size: 20,
|
|
4945
4942
|
color: "var(--matchid-arrow-color)"
|
|
4946
4943
|
}
|
|
4947
|
-
) : /* @__PURE__ */
|
|
4944
|
+
) : /* @__PURE__ */ jsx29(
|
|
4948
4945
|
ArrowRightIcon,
|
|
4949
4946
|
{
|
|
4950
4947
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -4953,7 +4950,7 @@ var RecommendItem = ({
|
|
|
4953
4950
|
}
|
|
4954
4951
|
)
|
|
4955
4952
|
] }),
|
|
4956
|
-
children && /* @__PURE__ */
|
|
4953
|
+
children && /* @__PURE__ */ jsx29(
|
|
4957
4954
|
"div",
|
|
4958
4955
|
{
|
|
4959
4956
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -5011,62 +5008,62 @@ function LoginBox({
|
|
|
5011
5008
|
walletMethods: walletMethodList
|
|
5012
5009
|
};
|
|
5013
5010
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
5014
|
-
const [emailOpen, setEmailOpen] =
|
|
5011
|
+
const [emailOpen, setEmailOpen] = useState20(false);
|
|
5015
5012
|
const { login } = useUserInfo();
|
|
5016
|
-
const [showWallet, setShowWallet] =
|
|
5013
|
+
const [showWallet, setShowWallet] = useState20(false);
|
|
5017
5014
|
const intl = useIntl9();
|
|
5018
5015
|
const isDownMd = useDownMd();
|
|
5019
5016
|
const methodMap = {
|
|
5020
5017
|
wallet: {
|
|
5021
|
-
icon: /* @__PURE__ */
|
|
5018
|
+
icon: /* @__PURE__ */ jsx29(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
5022
5019
|
name: intl.formatMessage({ id: "wallet" }),
|
|
5023
5020
|
onClick: () => setShowWallet(!showWallet),
|
|
5024
5021
|
type: "wallet"
|
|
5025
5022
|
},
|
|
5026
5023
|
email: {
|
|
5027
|
-
icon: /* @__PURE__ */
|
|
5024
|
+
icon: /* @__PURE__ */ jsx29(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
5028
5025
|
name: intl.formatMessage({ id: "email" }),
|
|
5029
5026
|
onClick: () => {
|
|
5030
5027
|
setEmailOpen(true);
|
|
5031
5028
|
}
|
|
5032
5029
|
},
|
|
5033
5030
|
google: {
|
|
5034
|
-
icon: /* @__PURE__ */
|
|
5031
|
+
icon: /* @__PURE__ */ jsx29(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
5035
5032
|
name: "Google",
|
|
5036
5033
|
onClick: () => login("google")
|
|
5037
5034
|
},
|
|
5038
5035
|
twitter: {
|
|
5039
|
-
icon: /* @__PURE__ */
|
|
5036
|
+
icon: /* @__PURE__ */ jsx29(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
5040
5037
|
name: "X",
|
|
5041
5038
|
onClick: () => login("twitter")
|
|
5042
5039
|
},
|
|
5043
5040
|
telegram: {
|
|
5044
|
-
icon: /* @__PURE__ */
|
|
5041
|
+
icon: /* @__PURE__ */ jsx29(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
5045
5042
|
name: "Telegram",
|
|
5046
5043
|
onClick: () => login("telegram")
|
|
5047
5044
|
},
|
|
5048
5045
|
github: {
|
|
5049
|
-
icon: /* @__PURE__ */
|
|
5046
|
+
icon: /* @__PURE__ */ jsx29(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
5050
5047
|
name: "Github",
|
|
5051
5048
|
onClick: () => login("github")
|
|
5052
5049
|
},
|
|
5053
5050
|
discord: {
|
|
5054
|
-
icon: /* @__PURE__ */
|
|
5051
|
+
icon: /* @__PURE__ */ jsx29(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
5055
5052
|
name: "Discord",
|
|
5056
5053
|
onClick: () => login("discord")
|
|
5057
5054
|
},
|
|
5058
5055
|
linkedin: {
|
|
5059
|
-
icon: /* @__PURE__ */
|
|
5056
|
+
icon: /* @__PURE__ */ jsx29(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
5060
5057
|
name: "LinkedIn",
|
|
5061
5058
|
onClick: () => login("linkedin")
|
|
5062
5059
|
},
|
|
5063
5060
|
facebook: {
|
|
5064
|
-
icon: /* @__PURE__ */
|
|
5061
|
+
icon: /* @__PURE__ */ jsx29(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
5065
5062
|
name: "Facebook",
|
|
5066
5063
|
onClick: () => login("facebook")
|
|
5067
5064
|
},
|
|
5068
5065
|
youtube: {
|
|
5069
|
-
icon: /* @__PURE__ */
|
|
5066
|
+
icon: /* @__PURE__ */ jsx29(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
5070
5067
|
name: "Youtube",
|
|
5071
5068
|
onClick: () => login("youtube")
|
|
5072
5069
|
}
|
|
@@ -5074,8 +5071,8 @@ function LoginBox({
|
|
|
5074
5071
|
const { walletMap } = useWalletConfig();
|
|
5075
5072
|
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5076
5073
|
(!inModal || !emailOpen) && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-box", children: [
|
|
5077
|
-
/* @__PURE__ */
|
|
5078
|
-
return /* @__PURE__ */
|
|
5074
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
5075
|
+
return /* @__PURE__ */ jsx29(
|
|
5079
5076
|
RecommendItem,
|
|
5080
5077
|
{
|
|
5081
5078
|
icon: methodMap[m]?.icon,
|
|
@@ -5083,8 +5080,8 @@ function LoginBox({
|
|
|
5083
5080
|
onClick: methodMap[m]?.onClick,
|
|
5084
5081
|
showChildren: m == "wallet" && showWallet,
|
|
5085
5082
|
children: m == "wallet" && /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5086
|
-
/* @__PURE__ */
|
|
5087
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
5084
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
5088
5085
|
const m2 = walletMap[n];
|
|
5089
5086
|
return /* @__PURE__ */ jsxs16(
|
|
5090
5087
|
"div",
|
|
@@ -5095,15 +5092,15 @@ function LoginBox({
|
|
|
5095
5092
|
},
|
|
5096
5093
|
children: [
|
|
5097
5094
|
/* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
5098
|
-
/* @__PURE__ */
|
|
5099
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
5096
|
+
/* @__PURE__ */ jsx29(
|
|
5100
5097
|
"div",
|
|
5101
5098
|
{
|
|
5102
5099
|
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
5103
5100
|
children: m2.activeIcon
|
|
5104
5101
|
}
|
|
5105
5102
|
),
|
|
5106
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx29(
|
|
5107
5104
|
"span",
|
|
5108
5105
|
{
|
|
5109
5106
|
className: "matchid-login-recommend-wallet-item-name",
|
|
@@ -5111,7 +5108,7 @@ function LoginBox({
|
|
|
5111
5108
|
}
|
|
5112
5109
|
)
|
|
5113
5110
|
] }),
|
|
5114
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ jsx29(
|
|
5115
5112
|
ArrowRightIcon,
|
|
5116
5113
|
{
|
|
5117
5114
|
className: "matchid-login-recommend-wallet-item-arrow",
|
|
@@ -5130,9 +5127,9 @@ function LoginBox({
|
|
|
5130
5127
|
);
|
|
5131
5128
|
}) }),
|
|
5132
5129
|
methodConfig.methods.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "matchid-login-other", children: [
|
|
5133
|
-
/* @__PURE__ */
|
|
5134
|
-
/* @__PURE__ */
|
|
5135
|
-
return /* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ jsx29(FormattedMessage7, { id: "otherLoginMethods" }) }),
|
|
5131
|
+
/* @__PURE__ */ jsx29("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
5132
|
+
return /* @__PURE__ */ jsx29(
|
|
5136
5133
|
"div",
|
|
5137
5134
|
{
|
|
5138
5135
|
className: "matchid-login-method-item",
|
|
@@ -5145,7 +5142,7 @@ function LoginBox({
|
|
|
5145
5142
|
}) })
|
|
5146
5143
|
] })
|
|
5147
5144
|
] }),
|
|
5148
|
-
/* @__PURE__ */
|
|
5145
|
+
/* @__PURE__ */ jsx29(
|
|
5149
5146
|
EmailModal,
|
|
5150
5147
|
{
|
|
5151
5148
|
isOpen: emailOpen,
|
|
@@ -5161,11 +5158,11 @@ function LoginBox({
|
|
|
5161
5158
|
}
|
|
5162
5159
|
|
|
5163
5160
|
// src/components/LoginButton/index.tsx
|
|
5164
|
-
import { useState as
|
|
5161
|
+
import { useState as useState22 } from "react";
|
|
5165
5162
|
|
|
5166
5163
|
// src/components/LoginPanel/index.tsx
|
|
5167
5164
|
import { FormattedMessage as FormattedMessage8 } from "react-intl";
|
|
5168
|
-
import { jsx as
|
|
5165
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5169
5166
|
function LoginPanel({
|
|
5170
5167
|
header,
|
|
5171
5168
|
onClose,
|
|
@@ -5175,42 +5172,42 @@ function LoginPanel({
|
|
|
5175
5172
|
return /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel", children: [
|
|
5176
5173
|
header ? header : /* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header", children: [
|
|
5177
5174
|
/* @__PURE__ */ jsxs17("div", { className: "matchid-login-panel-header-content", children: [
|
|
5178
|
-
/* @__PURE__ */
|
|
5179
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ jsx30(FormattedMessage8, { id: "loginTitle" }) }),
|
|
5176
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ jsx30(FormattedMessage8, { id: "loginTips" }) })
|
|
5180
5177
|
] }),
|
|
5181
|
-
onClose && /* @__PURE__ */
|
|
5178
|
+
onClose && /* @__PURE__ */ jsx30("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx30(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
5182
5179
|
] }),
|
|
5183
|
-
/* @__PURE__ */
|
|
5184
|
-
/* @__PURE__ */
|
|
5180
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-panel-divide" }),
|
|
5181
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ jsx30(LoginBox, { ...props }) })
|
|
5185
5182
|
] });
|
|
5186
5183
|
}
|
|
5187
5184
|
|
|
5188
5185
|
// src/components/LoginModal/index.tsx
|
|
5189
|
-
import { jsx as
|
|
5186
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
5190
5187
|
function LoginModal({
|
|
5191
5188
|
isOpen = false,
|
|
5192
5189
|
width = 480,
|
|
5193
5190
|
...props
|
|
5194
5191
|
}) {
|
|
5195
5192
|
const { isLogin } = useUserInfo();
|
|
5196
|
-
return /* @__PURE__ */
|
|
5193
|
+
return /* @__PURE__ */ jsx31(
|
|
5197
5194
|
Modal,
|
|
5198
5195
|
{
|
|
5199
5196
|
isOpen: isOpen && !isLogin,
|
|
5200
5197
|
width,
|
|
5201
|
-
children: /* @__PURE__ */
|
|
5198
|
+
children: /* @__PURE__ */ jsx31(LoginPanel, { ...props, inModal: true })
|
|
5202
5199
|
}
|
|
5203
5200
|
);
|
|
5204
5201
|
}
|
|
5205
5202
|
|
|
5206
5203
|
// src/components/UserPopover/index.tsx
|
|
5207
|
-
import { useState as
|
|
5204
|
+
import { useState as useState21 } from "react";
|
|
5208
5205
|
|
|
5209
5206
|
// src/assets/icon/ProfileIcon.tsx
|
|
5210
|
-
import { jsx as
|
|
5207
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5211
5208
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
5212
5209
|
return /* @__PURE__ */ jsxs18("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5213
|
-
/* @__PURE__ */
|
|
5210
|
+
/* @__PURE__ */ jsx32(
|
|
5214
5211
|
"path",
|
|
5215
5212
|
{
|
|
5216
5213
|
fillRule: "evenodd",
|
|
@@ -5219,7 +5216,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5219
5216
|
fill: color
|
|
5220
5217
|
}
|
|
5221
5218
|
),
|
|
5222
|
-
/* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ jsx32(
|
|
5223
5220
|
"path",
|
|
5224
5221
|
{
|
|
5225
5222
|
fillRule: "evenodd",
|
|
@@ -5233,10 +5230,10 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
5233
5230
|
|
|
5234
5231
|
// src/components/UserPopover/index.tsx
|
|
5235
5232
|
import { FormattedMessage as FormattedMessage9, useIntl as useIntl10 } from "react-intl";
|
|
5236
|
-
import { jsx as
|
|
5233
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5237
5234
|
function UserContent() {
|
|
5238
5235
|
const { logout, address, username } = useUserInfo();
|
|
5239
|
-
const [logouting, setLogouting] =
|
|
5236
|
+
const [logouting, setLogouting] = useState21(false);
|
|
5240
5237
|
const onLogout = async () => {
|
|
5241
5238
|
if (logouting) return;
|
|
5242
5239
|
try {
|
|
@@ -5257,31 +5254,31 @@ function UserContent() {
|
|
|
5257
5254
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
5258
5255
|
/* @__PURE__ */ jsxs19("div", { className: `matchid-user-popover-item-content`, children: [
|
|
5259
5256
|
icon,
|
|
5260
|
-
/* @__PURE__ */
|
|
5257
|
+
/* @__PURE__ */ jsx33("div", { className: "matchid-user-popover-item-text", children })
|
|
5261
5258
|
] }),
|
|
5262
5259
|
rightIcon
|
|
5263
5260
|
] });
|
|
5264
5261
|
};
|
|
5265
5262
|
const UserDivider = () => {
|
|
5266
|
-
return /* @__PURE__ */
|
|
5263
|
+
return /* @__PURE__ */ jsx33("div", { className: `matchid-user-popover-divider` });
|
|
5267
5264
|
};
|
|
5268
|
-
const [usernameOpen, setUsernameOpen] =
|
|
5265
|
+
const [usernameOpen, setUsernameOpen] = useState21(false);
|
|
5269
5266
|
const [copied, setCopied] = useCopyClipboard();
|
|
5270
5267
|
const intl = useIntl10();
|
|
5271
5268
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-content", children: [
|
|
5272
5269
|
/* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-list", children: [
|
|
5273
|
-
/* @__PURE__ */
|
|
5270
|
+
/* @__PURE__ */ jsx33(UserItem, { onClick: () => {
|
|
5274
5271
|
setCopied(address);
|
|
5275
|
-
}, icon: copied ? /* @__PURE__ */
|
|
5276
|
-
/* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */
|
|
5272
|
+
}, icon: copied ? /* @__PURE__ */ jsx33(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ jsx33(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx33(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
5273
|
+
/* @__PURE__ */ jsx33(UserDivider, {}),
|
|
5274
|
+
/* @__PURE__ */ jsx33(UserItem, { onClick: () => {
|
|
5278
5275
|
setUsernameOpen(true);
|
|
5279
|
-
}, icon: /* @__PURE__ */
|
|
5276
|
+
}, icon: /* @__PURE__ */ jsx33(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx33(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
5280
5277
|
id: "setUsername"
|
|
5281
5278
|
}) })
|
|
5282
5279
|
] }),
|
|
5283
|
-
/* @__PURE__ */
|
|
5284
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__PURE__ */ jsx33(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ jsx33(FormattedMessage9, { id: "disconnect" }) }),
|
|
5281
|
+
/* @__PURE__ */ jsx33(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
5285
5282
|
setUsernameOpen(false);
|
|
5286
5283
|
}, onSuccess: () => {
|
|
5287
5284
|
setUsernameOpen(false);
|
|
@@ -5292,12 +5289,12 @@ function UserPopover({
|
|
|
5292
5289
|
children,
|
|
5293
5290
|
...props
|
|
5294
5291
|
}) {
|
|
5295
|
-
return /* @__PURE__ */
|
|
5292
|
+
return /* @__PURE__ */ jsx33(Popover, { ...props, content: /* @__PURE__ */ jsx33(UserContent, {}), children });
|
|
5296
5293
|
}
|
|
5297
5294
|
|
|
5298
5295
|
// src/components/LoginButton/index.tsx
|
|
5299
5296
|
import { FormattedMessage as FormattedMessage10, useIntl as useIntl11 } from "react-intl";
|
|
5300
|
-
import { Fragment as Fragment6, jsx as
|
|
5297
|
+
import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5301
5298
|
function LoginButton({
|
|
5302
5299
|
loginRender,
|
|
5303
5300
|
methods,
|
|
@@ -5311,10 +5308,10 @@ function LoginButton({
|
|
|
5311
5308
|
}) {
|
|
5312
5309
|
const intl = useIntl11();
|
|
5313
5310
|
const { isLogin, username } = useUserInfo();
|
|
5314
|
-
const [loginOpen, setLoginOpen] =
|
|
5311
|
+
const [loginOpen, setLoginOpen] = useState22(false);
|
|
5315
5312
|
if (!isLogin) {
|
|
5316
5313
|
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
5317
|
-
/* @__PURE__ */
|
|
5314
|
+
/* @__PURE__ */ jsx34(
|
|
5318
5315
|
LoginModal,
|
|
5319
5316
|
{
|
|
5320
5317
|
methods,
|
|
@@ -5325,31 +5322,31 @@ function LoginButton({
|
|
|
5325
5322
|
}
|
|
5326
5323
|
),
|
|
5327
5324
|
/* @__PURE__ */ jsxs20(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
5328
|
-
/* @__PURE__ */
|
|
5329
|
-
/* @__PURE__ */
|
|
5325
|
+
/* @__PURE__ */ jsx34(UnLoginIcon_default, {}),
|
|
5326
|
+
/* @__PURE__ */ jsx34("span", { children: /* @__PURE__ */ jsx34(FormattedMessage10, { id: "login" }) })
|
|
5330
5327
|
] })
|
|
5331
5328
|
] });
|
|
5332
5329
|
}
|
|
5333
|
-
return loginRender ? /* @__PURE__ */
|
|
5334
|
-
/* @__PURE__ */
|
|
5335
|
-
/* @__PURE__ */
|
|
5330
|
+
return loginRender ? /* @__PURE__ */ jsx34(Fragment6, { children: loginRender }) : /* @__PURE__ */ jsx34(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ jsxs20(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
5331
|
+
/* @__PURE__ */ jsx34(LoginIcon_default, {}),
|
|
5332
|
+
/* @__PURE__ */ jsx34("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
5336
5333
|
id: "user"
|
|
5337
5334
|
}) })
|
|
5338
5335
|
] }) });
|
|
5339
5336
|
}
|
|
5340
5337
|
|
|
5341
5338
|
// src/components/UsernameModal/index.tsx
|
|
5342
|
-
import { useEffect as
|
|
5339
|
+
import { useEffect as useEffect20, useMemo as useMemo11, useState as useState23 } from "react";
|
|
5343
5340
|
import { FormattedMessage as FormattedMessage11, useIntl as useIntl12 } from "react-intl";
|
|
5344
|
-
import { jsx as
|
|
5341
|
+
import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5345
5342
|
var ValidItem = ({
|
|
5346
5343
|
success = false,
|
|
5347
5344
|
text
|
|
5348
5345
|
}) => {
|
|
5349
5346
|
const isDownMd = useDownMd();
|
|
5350
5347
|
return /* @__PURE__ */ jsxs21("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
5351
|
-
success ? /* @__PURE__ */
|
|
5352
|
-
/* @__PURE__ */
|
|
5348
|
+
success ? /* @__PURE__ */ jsx35(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx35(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
5349
|
+
/* @__PURE__ */ jsx35("span", { children: text })
|
|
5353
5350
|
] });
|
|
5354
5351
|
};
|
|
5355
5352
|
function UsernameModal({
|
|
@@ -5360,10 +5357,10 @@ function UsernameModal({
|
|
|
5360
5357
|
}) {
|
|
5361
5358
|
const { username, refreshOverview } = useUserInfo();
|
|
5362
5359
|
const { isLogin } = useUserInfo();
|
|
5363
|
-
const [val, setVal] =
|
|
5364
|
-
const [error, setError] =
|
|
5360
|
+
const [val, setVal] = useState23(username);
|
|
5361
|
+
const [error, setError] = useState23("");
|
|
5365
5362
|
const isDownMd = useDownMd();
|
|
5366
|
-
|
|
5363
|
+
useEffect20(() => {
|
|
5367
5364
|
if (isOpen) {
|
|
5368
5365
|
setVal(username);
|
|
5369
5366
|
setError("");
|
|
@@ -5376,7 +5373,7 @@ function UsernameModal({
|
|
|
5376
5373
|
return val.length >= 2 && val.length <= 32;
|
|
5377
5374
|
}, [val]);
|
|
5378
5375
|
const isSafe = isValid && isLength;
|
|
5379
|
-
const [isSubmitting, setIsSubmitting] =
|
|
5376
|
+
const [isSubmitting, setIsSubmitting] = useState23(false);
|
|
5380
5377
|
const onSubmit = async () => {
|
|
5381
5378
|
if (isSubmitting) return;
|
|
5382
5379
|
try {
|
|
@@ -5397,12 +5394,12 @@ function UsernameModal({
|
|
|
5397
5394
|
}
|
|
5398
5395
|
};
|
|
5399
5396
|
const intl = useIntl12();
|
|
5400
|
-
return /* @__PURE__ */
|
|
5397
|
+
return /* @__PURE__ */ jsx35(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
5401
5398
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
5402
5399
|
}), children: /* @__PURE__ */ jsxs21("div", { className: "matchid-username-box", children: [
|
|
5403
|
-
/* @__PURE__ */
|
|
5400
|
+
/* @__PURE__ */ jsx35(Field, { label: intl.formatMessage({
|
|
5404
5401
|
id: "username"
|
|
5405
|
-
}), error, children: /* @__PURE__ */
|
|
5402
|
+
}), error, children: /* @__PURE__ */ jsx35(
|
|
5406
5403
|
Input,
|
|
5407
5404
|
{
|
|
5408
5405
|
placeholder: intl.formatMessage({
|
|
@@ -5416,7 +5413,7 @@ function UsernameModal({
|
|
|
5416
5413
|
}
|
|
5417
5414
|
) }),
|
|
5418
5415
|
/* @__PURE__ */ jsxs21("div", { className: "matchid-valid", children: [
|
|
5419
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx35(
|
|
5420
5417
|
ValidItem,
|
|
5421
5418
|
{
|
|
5422
5419
|
success: isValid,
|
|
@@ -5425,25 +5422,25 @@ function UsernameModal({
|
|
|
5425
5422
|
})
|
|
5426
5423
|
}
|
|
5427
5424
|
),
|
|
5428
|
-
/* @__PURE__ */
|
|
5425
|
+
/* @__PURE__ */ jsx35(ValidItem, { success: isLength, text: intl.formatMessage({
|
|
5429
5426
|
id: "usernameLengthError"
|
|
5430
5427
|
}) })
|
|
5431
5428
|
] }),
|
|
5432
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ jsx35(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
5433
5430
|
marginTop: isDownMd ? "36px" : "64px"
|
|
5434
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */
|
|
5435
|
-
/* @__PURE__ */
|
|
5431
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx35(FormattedMessage11, { id: "confirm" }) }),
|
|
5432
|
+
/* @__PURE__ */ jsx35(Button, { style: {
|
|
5436
5433
|
marginTop: isDownMd ? "12px" : "24px"
|
|
5437
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */
|
|
5434
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx35(FormattedMessage11, { id: "cancel" }) })
|
|
5438
5435
|
] }) });
|
|
5439
5436
|
}
|
|
5440
5437
|
|
|
5441
5438
|
// src/components/EVMModal/index.tsx
|
|
5442
|
-
import { useCallback as useCallback6, useEffect as
|
|
5439
|
+
import { useCallback as useCallback6, useEffect as useEffect22, useState as useState26 } from "react";
|
|
5443
5440
|
import { useIntl as useIntl13 } from "react-intl";
|
|
5444
5441
|
|
|
5445
5442
|
// src/components/WalletModalContent/index.tsx
|
|
5446
|
-
import { useMemo as useMemo12, useState as
|
|
5443
|
+
import { useMemo as useMemo12, useState as useState24 } from "react";
|
|
5447
5444
|
|
|
5448
5445
|
// src/assets/wallet.ts
|
|
5449
5446
|
var walletErrorImage = error_default;
|
|
@@ -5453,7 +5450,7 @@ var walletConnectImage = wallet_default;
|
|
|
5453
5450
|
var walletSigningImage = signing_default;
|
|
5454
5451
|
|
|
5455
5452
|
// src/components/WalletModalContent/index.tsx
|
|
5456
|
-
import { jsx as
|
|
5453
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5457
5454
|
function WalletModalContent({
|
|
5458
5455
|
status,
|
|
5459
5456
|
error,
|
|
@@ -5523,15 +5520,15 @@ function WalletModalContent({
|
|
|
5523
5520
|
statusImage: walletConnectImage
|
|
5524
5521
|
};
|
|
5525
5522
|
}, [visible, connected, status, error, address]);
|
|
5526
|
-
return /* @__PURE__ */
|
|
5523
|
+
return /* @__PURE__ */ jsx36("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5527
5524
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5528
|
-
/* @__PURE__ */
|
|
5525
|
+
/* @__PURE__ */ jsx36(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5529
5526
|
width: 128,
|
|
5530
5527
|
height: 128
|
|
5531
5528
|
} }),
|
|
5532
|
-
/* @__PURE__ */
|
|
5529
|
+
/* @__PURE__ */ jsx36("div", { className: pageData.isError ? "matchid-error" : "", children: pageData.text })
|
|
5533
5530
|
] }),
|
|
5534
|
-
/* @__PURE__ */
|
|
5531
|
+
/* @__PURE__ */ jsx36(
|
|
5535
5532
|
Button,
|
|
5536
5533
|
{
|
|
5537
5534
|
block: true,
|
|
@@ -5545,7 +5542,7 @@ function WalletModalContent({
|
|
|
5545
5542
|
] }) });
|
|
5546
5543
|
}
|
|
5547
5544
|
function WalletModalContentV2(props) {
|
|
5548
|
-
const [submitting, setSubmitting] =
|
|
5545
|
+
const [submitting, setSubmitting] = useState24(false);
|
|
5549
5546
|
const pageData = useMemo12(() => {
|
|
5550
5547
|
const { status } = props;
|
|
5551
5548
|
if (status == "success") {
|
|
@@ -5607,15 +5604,15 @@ function WalletModalContentV2(props) {
|
|
|
5607
5604
|
statusImage: walletConnectImage
|
|
5608
5605
|
};
|
|
5609
5606
|
}, [props, submitting]);
|
|
5610
|
-
return /* @__PURE__ */
|
|
5607
|
+
return /* @__PURE__ */ jsx36("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5611
5608
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5612
|
-
/* @__PURE__ */
|
|
5609
|
+
/* @__PURE__ */ jsx36(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5613
5610
|
width: 128,
|
|
5614
5611
|
height: 128
|
|
5615
5612
|
} }),
|
|
5616
|
-
/* @__PURE__ */
|
|
5613
|
+
/* @__PURE__ */ jsx36("div", { className: props.status == "error" ? "matchid-error" : "", children: pageData.text })
|
|
5617
5614
|
] }),
|
|
5618
|
-
/* @__PURE__ */
|
|
5615
|
+
/* @__PURE__ */ jsx36(
|
|
5619
5616
|
Button,
|
|
5620
5617
|
{
|
|
5621
5618
|
block: true,
|
|
@@ -5634,14 +5631,14 @@ import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
|
5634
5631
|
import { useAccount, useChainId, useConfig, useDisconnect } from "wagmi";
|
|
5635
5632
|
|
|
5636
5633
|
// src/hooks/useWalletBox.ts
|
|
5637
|
-
import { useEffect as
|
|
5634
|
+
import { useEffect as useEffect21, useRef as useRef5, useState as useState25 } from "react";
|
|
5638
5635
|
function useWalletBox({
|
|
5639
5636
|
onInit
|
|
5640
5637
|
}) {
|
|
5641
|
-
const [status, setStateStatus] =
|
|
5642
|
-
const [error, setError] =
|
|
5638
|
+
const [status, setStateStatus] = useState25("start");
|
|
5639
|
+
const [error, setError] = useState25("");
|
|
5643
5640
|
const statusRef = useRef5(status);
|
|
5644
|
-
const [nonce, setNonce] =
|
|
5641
|
+
const [nonce, setNonce] = useState25();
|
|
5645
5642
|
const setStatus = (status2) => {
|
|
5646
5643
|
statusRef.current = status2;
|
|
5647
5644
|
setStateStatus(status2);
|
|
@@ -5650,7 +5647,7 @@ function useWalletBox({
|
|
|
5650
5647
|
setError("");
|
|
5651
5648
|
setNonce(null);
|
|
5652
5649
|
};
|
|
5653
|
-
|
|
5650
|
+
useEffect21(() => {
|
|
5654
5651
|
init();
|
|
5655
5652
|
onInit({
|
|
5656
5653
|
setStatus
|
|
@@ -5897,7 +5894,7 @@ async function getEthersSigner(config, { chainId } = {}) {
|
|
|
5897
5894
|
// src/components/EVMModal/index.tsx
|
|
5898
5895
|
import { SiweMessage } from "siwe";
|
|
5899
5896
|
import "@rainbow-me/rainbowkit/styles.css";
|
|
5900
|
-
import { jsx as
|
|
5897
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
5901
5898
|
function WalletContent({
|
|
5902
5899
|
onSuccess,
|
|
5903
5900
|
type
|
|
@@ -5908,16 +5905,16 @@ function WalletContent({
|
|
|
5908
5905
|
const { disconnectAsync } = useDisconnect({ config });
|
|
5909
5906
|
const chainId = useChainId();
|
|
5910
5907
|
const { events, login } = useMatch();
|
|
5911
|
-
const [inited, setInited] =
|
|
5908
|
+
const [inited, setInited] = useState26(false);
|
|
5912
5909
|
const { status, setStatus, error, setError, statusRef, nonce, setNonce, init } = useWalletBox({
|
|
5913
5910
|
onInit: async ({ setStatus: setStatus2 }) => {
|
|
5914
5911
|
setStatus2("start");
|
|
5915
5912
|
}
|
|
5916
5913
|
});
|
|
5917
|
-
|
|
5914
|
+
useEffect22(() => {
|
|
5918
5915
|
matchlog_default.log(`status=${status}`, `connectModalOpen=${connectModalOpen}`, `address=${address}`, `isConnected=${isConnected}`);
|
|
5919
5916
|
}, [status, connectModalOpen, isConnected, address]);
|
|
5920
|
-
|
|
5917
|
+
useEffect22(() => {
|
|
5921
5918
|
if (connectModalOpen) {
|
|
5922
5919
|
setStatus("connecting");
|
|
5923
5920
|
return;
|
|
@@ -5930,7 +5927,7 @@ function WalletContent({
|
|
|
5930
5927
|
setStatus("start");
|
|
5931
5928
|
}
|
|
5932
5929
|
}, [connectModalOpen, address]);
|
|
5933
|
-
|
|
5930
|
+
useEffect22(() => {
|
|
5934
5931
|
if (openConnectModal && !isConnected && !inited) {
|
|
5935
5932
|
openConnectModal && openConnectModal();
|
|
5936
5933
|
setInited(true);
|
|
@@ -6013,7 +6010,7 @@ function WalletContent({
|
|
|
6013
6010
|
setError(error2.reason || error2.message);
|
|
6014
6011
|
}
|
|
6015
6012
|
}, [nonce, status, address]);
|
|
6016
|
-
|
|
6013
|
+
useEffect22(() => {
|
|
6017
6014
|
if (signature) {
|
|
6018
6015
|
signature();
|
|
6019
6016
|
}
|
|
@@ -6055,7 +6052,7 @@ function WalletContent({
|
|
|
6055
6052
|
setNonce(void 0);
|
|
6056
6053
|
setStatus("start");
|
|
6057
6054
|
};
|
|
6058
|
-
return /* @__PURE__ */
|
|
6055
|
+
return /* @__PURE__ */ jsx37(
|
|
6059
6056
|
WalletModalContentV2,
|
|
6060
6057
|
{
|
|
6061
6058
|
status,
|
|
@@ -6073,18 +6070,18 @@ function EVMConnectModal({
|
|
|
6073
6070
|
...props
|
|
6074
6071
|
}) {
|
|
6075
6072
|
const intl = useIntl13();
|
|
6076
|
-
return /* @__PURE__ */
|
|
6073
|
+
return /* @__PURE__ */ jsx37(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6077
6074
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6078
6075
|
}, {
|
|
6079
6076
|
name: "EVM"
|
|
6080
|
-
}), children: /* @__PURE__ */
|
|
6077
|
+
}), children: /* @__PURE__ */ jsx37(WalletContent, { onSuccess, type }) });
|
|
6081
6078
|
}
|
|
6082
6079
|
function EVMModal(props) {
|
|
6083
|
-
return props.isOpen && /* @__PURE__ */
|
|
6080
|
+
return props.isOpen && /* @__PURE__ */ jsx37(EVMConnectModal, { ...props });
|
|
6084
6081
|
}
|
|
6085
6082
|
|
|
6086
6083
|
// src/components/TRONModal/index.tsx
|
|
6087
|
-
import React11, { useEffect as
|
|
6084
|
+
import React11, { useEffect as useEffect24, useMemo as useMemo14, useState as useState28 } from "react";
|
|
6088
6085
|
import { useIntl as useIntl14 } from "react-intl";
|
|
6089
6086
|
|
|
6090
6087
|
// src/lib/tron/TronLinkAdapter.ts
|
|
@@ -6118,7 +6115,7 @@ var TronLinkAdapter = class {
|
|
|
6118
6115
|
};
|
|
6119
6116
|
|
|
6120
6117
|
// src/hooks/useTRONWallet.ts
|
|
6121
|
-
import { useEffect as
|
|
6118
|
+
import { useEffect as useEffect23, useState as useState27 } from "react";
|
|
6122
6119
|
|
|
6123
6120
|
// src/lib/tron/BitgetAdapter.ts
|
|
6124
6121
|
var BitgetAdapter = class {
|
|
@@ -6163,9 +6160,9 @@ var OKXAdapter = class {
|
|
|
6163
6160
|
// src/hooks/useTRONWallet.ts
|
|
6164
6161
|
var useTRONWallet = () => {
|
|
6165
6162
|
const wallets = [new TronLinkAdapter(), new BitgetAdapter(), new OKXAdapter()];
|
|
6166
|
-
const [installedWallets, setInstalledWallets] =
|
|
6167
|
-
const [address, setAddress] =
|
|
6168
|
-
|
|
6163
|
+
const [installedWallets, setInstalledWallets] = useState27([]);
|
|
6164
|
+
const [address, setAddress] = useState27(null);
|
|
6165
|
+
useEffect23(() => {
|
|
6169
6166
|
const getInstalled = async () => {
|
|
6170
6167
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6171
6168
|
wallet: wallet2,
|
|
@@ -6175,11 +6172,11 @@ var useTRONWallet = () => {
|
|
|
6175
6172
|
};
|
|
6176
6173
|
getInstalled();
|
|
6177
6174
|
}, []);
|
|
6178
|
-
const [wallet, chooseWallet] =
|
|
6175
|
+
const [wallet, chooseWallet] = useState27(null);
|
|
6179
6176
|
const onConnect = async () => {
|
|
6180
6177
|
setAddress(await wallet.connect());
|
|
6181
6178
|
};
|
|
6182
|
-
|
|
6179
|
+
useEffect23(() => {
|
|
6183
6180
|
if (!wallet) {
|
|
6184
6181
|
setAddress(null);
|
|
6185
6182
|
}
|
|
@@ -6195,7 +6192,7 @@ var useTRONWallet = () => {
|
|
|
6195
6192
|
};
|
|
6196
6193
|
|
|
6197
6194
|
// src/components/TRONModal/index.tsx
|
|
6198
|
-
import { jsx as
|
|
6195
|
+
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6199
6196
|
function TRONConnectModal({
|
|
6200
6197
|
type = "login",
|
|
6201
6198
|
onSuccess,
|
|
@@ -6205,14 +6202,14 @@ function TRONConnectModal({
|
|
|
6205
6202
|
const intl = useIntl14();
|
|
6206
6203
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
6207
6204
|
const iconMaps = {
|
|
6208
|
-
tronlink: /* @__PURE__ */
|
|
6209
|
-
bitget: /* @__PURE__ */
|
|
6210
|
-
okx: /* @__PURE__ */
|
|
6205
|
+
tronlink: /* @__PURE__ */ jsx38(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
6206
|
+
bitget: /* @__PURE__ */ jsx38(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
6207
|
+
okx: /* @__PURE__ */ jsx38(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
6211
6208
|
};
|
|
6212
6209
|
const { events, login } = useMatch();
|
|
6213
|
-
const [status, setStatus] =
|
|
6210
|
+
const [status, setStatus] = useState28("");
|
|
6214
6211
|
const statusRef = React11.useRef(status);
|
|
6215
|
-
const [error, setError] =
|
|
6212
|
+
const [error, setError] = useState28("");
|
|
6216
6213
|
const connected = useMemo14(() => {
|
|
6217
6214
|
return !!address;
|
|
6218
6215
|
}, [address]);
|
|
@@ -6281,7 +6278,7 @@ function TRONConnectModal({
|
|
|
6281
6278
|
statusRef.current = "";
|
|
6282
6279
|
}
|
|
6283
6280
|
};
|
|
6284
|
-
|
|
6281
|
+
useEffect24(() => {
|
|
6285
6282
|
if (wallet) {
|
|
6286
6283
|
console.log("onConnect");
|
|
6287
6284
|
onConnect();
|
|
@@ -6289,21 +6286,21 @@ function TRONConnectModal({
|
|
|
6289
6286
|
setStatus("");
|
|
6290
6287
|
}
|
|
6291
6288
|
}, [wallet]);
|
|
6292
|
-
|
|
6289
|
+
useEffect24(() => {
|
|
6293
6290
|
if (address) {
|
|
6294
6291
|
toLoginInWallet();
|
|
6295
6292
|
}
|
|
6296
6293
|
}, [address]);
|
|
6297
|
-
|
|
6294
|
+
useEffect24(() => {
|
|
6298
6295
|
if (!props.isOpen) {
|
|
6299
6296
|
disconnect();
|
|
6300
6297
|
}
|
|
6301
6298
|
}, [props.isOpen]);
|
|
6302
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx38(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6303
6300
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6304
6301
|
}, {
|
|
6305
6302
|
name: "TRON"
|
|
6306
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
6303
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx38(
|
|
6307
6304
|
WalletModalContent,
|
|
6308
6305
|
{
|
|
6309
6306
|
error,
|
|
@@ -6316,9 +6313,9 @@ function TRONConnectModal({
|
|
|
6316
6313
|
setVisible: () => {
|
|
6317
6314
|
}
|
|
6318
6315
|
}
|
|
6319
|
-
) : /* @__PURE__ */
|
|
6316
|
+
) : /* @__PURE__ */ jsx38("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs23("div", { className: "matchid-login-recommend-list", children: [
|
|
6320
6317
|
installedWallets.map((wallet2) => {
|
|
6321
|
-
return /* @__PURE__ */
|
|
6318
|
+
return /* @__PURE__ */ jsx38(
|
|
6322
6319
|
RecommendItem,
|
|
6323
6320
|
{
|
|
6324
6321
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -6331,14 +6328,14 @@ function TRONConnectModal({
|
|
|
6331
6328
|
);
|
|
6332
6329
|
}),
|
|
6333
6330
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
6334
|
-
return /* @__PURE__ */
|
|
6331
|
+
return /* @__PURE__ */ jsx38(
|
|
6335
6332
|
RecommendItem,
|
|
6336
6333
|
{
|
|
6337
6334
|
icon: iconMaps[wallet2.walletKey],
|
|
6338
6335
|
name: wallet2.name,
|
|
6339
6336
|
onClick: () => {
|
|
6340
6337
|
},
|
|
6341
|
-
footer: /* @__PURE__ */
|
|
6338
|
+
footer: /* @__PURE__ */ jsx38(Button, { size: "sm", onClick: () => {
|
|
6342
6339
|
window.open(wallet2.website);
|
|
6343
6340
|
}, children: "Install" })
|
|
6344
6341
|
},
|
|
@@ -6348,11 +6345,11 @@ function TRONConnectModal({
|
|
|
6348
6345
|
] }) }) });
|
|
6349
6346
|
}
|
|
6350
6347
|
function TRONModal(props) {
|
|
6351
|
-
return props.isOpen && /* @__PURE__ */
|
|
6348
|
+
return props.isOpen && /* @__PURE__ */ jsx38(TRONConnectModal, { ...props, type: props.type });
|
|
6352
6349
|
}
|
|
6353
6350
|
|
|
6354
6351
|
// src/components/TONModal/index.tsx
|
|
6355
|
-
import React12, { useEffect as
|
|
6352
|
+
import React12, { useEffect as useEffect25, useState as useState29 } from "react";
|
|
6356
6353
|
import { useIntl as useIntl15 } from "react-intl";
|
|
6357
6354
|
import {
|
|
6358
6355
|
TonConnectUIProvider,
|
|
@@ -6361,21 +6358,21 @@ import {
|
|
|
6361
6358
|
useTonConnectUI,
|
|
6362
6359
|
useTonWallet
|
|
6363
6360
|
} from "@tonconnect/ui-react";
|
|
6364
|
-
import { jsx as
|
|
6361
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6365
6362
|
function WalletContent2({
|
|
6366
6363
|
onSuccess,
|
|
6367
6364
|
type
|
|
6368
6365
|
}) {
|
|
6369
6366
|
const { events, login } = useMatch();
|
|
6370
|
-
const [connected, setConnected] =
|
|
6367
|
+
const [connected, setConnected] = useState29(false);
|
|
6371
6368
|
const wallet = useTonWallet();
|
|
6372
6369
|
const userFriendlyAddress = useTonAddress();
|
|
6373
6370
|
const [tonConnectUI] = useTonConnectUI();
|
|
6374
6371
|
const { state, open, close } = useTonConnectModal();
|
|
6375
|
-
const [status, setStatus] =
|
|
6372
|
+
const [status, setStatus] = useState29("");
|
|
6376
6373
|
const statusRef = React12.useRef(status);
|
|
6377
|
-
const [error, setError] =
|
|
6378
|
-
|
|
6374
|
+
const [error, setError] = useState29("");
|
|
6375
|
+
useEffect25(() => {
|
|
6379
6376
|
const init = async () => {
|
|
6380
6377
|
if (tonConnectUI.connected) {
|
|
6381
6378
|
await tonConnectUI.disconnect();
|
|
@@ -6448,7 +6445,7 @@ function WalletContent2({
|
|
|
6448
6445
|
}
|
|
6449
6446
|
});
|
|
6450
6447
|
}, []);
|
|
6451
|
-
|
|
6448
|
+
useEffect25(() => {
|
|
6452
6449
|
if (wallet) {
|
|
6453
6450
|
setConnected(true);
|
|
6454
6451
|
console.log("Wallet connected:", wallet);
|
|
@@ -6459,7 +6456,7 @@ function WalletContent2({
|
|
|
6459
6456
|
setStatus("");
|
|
6460
6457
|
}
|
|
6461
6458
|
}, [wallet]);
|
|
6462
|
-
|
|
6459
|
+
useEffect25(() => {
|
|
6463
6460
|
console.log({
|
|
6464
6461
|
state,
|
|
6465
6462
|
wallet
|
|
@@ -6488,7 +6485,7 @@ function WalletContent2({
|
|
|
6488
6485
|
}
|
|
6489
6486
|
}
|
|
6490
6487
|
}, [state]);
|
|
6491
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ jsx39(
|
|
6492
6489
|
WalletModalContent,
|
|
6493
6490
|
{
|
|
6494
6491
|
connected,
|
|
@@ -6522,24 +6519,24 @@ function TONConnectModal({
|
|
|
6522
6519
|
const intl = useIntl15();
|
|
6523
6520
|
const { endpoints, appid } = useLocalStore_default();
|
|
6524
6521
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
6525
|
-
return /* @__PURE__ */
|
|
6522
|
+
return /* @__PURE__ */ jsx39(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6526
6523
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6527
6524
|
}, {
|
|
6528
6525
|
name: "TON"
|
|
6529
|
-
}), children: /* @__PURE__ */
|
|
6526
|
+
}), children: /* @__PURE__ */ jsx39(
|
|
6530
6527
|
TonConnectUIProvider,
|
|
6531
6528
|
{
|
|
6532
6529
|
manifestUrl,
|
|
6533
|
-
children: /* @__PURE__ */
|
|
6530
|
+
children: /* @__PURE__ */ jsx39(WalletContent2, { onSuccess, type })
|
|
6534
6531
|
}
|
|
6535
6532
|
) });
|
|
6536
6533
|
}
|
|
6537
6534
|
function TONModal(props) {
|
|
6538
|
-
return props.isOpen && /* @__PURE__ */
|
|
6535
|
+
return props.isOpen && /* @__PURE__ */ jsx39(TONConnectModal, { ...props });
|
|
6539
6536
|
}
|
|
6540
6537
|
|
|
6541
6538
|
// src/components/BTCModal/index.tsx
|
|
6542
|
-
import React13, { useEffect as
|
|
6539
|
+
import React13, { useEffect as useEffect27, useMemo as useMemo15, useState as useState31 } from "react";
|
|
6543
6540
|
import { useIntl as useIntl16 } from "react-intl";
|
|
6544
6541
|
|
|
6545
6542
|
// src/lib/btc/UnisatAdapter.ts
|
|
@@ -6694,7 +6691,7 @@ var LeatherAdapter = class {
|
|
|
6694
6691
|
};
|
|
6695
6692
|
|
|
6696
6693
|
// src/hooks/useBTCWallet.ts
|
|
6697
|
-
import { useEffect as
|
|
6694
|
+
import { useEffect as useEffect26, useState as useState30 } from "react";
|
|
6698
6695
|
|
|
6699
6696
|
// src/lib/btc/PhantomAdapter.ts
|
|
6700
6697
|
var PhantomAdapter = class {
|
|
@@ -6732,9 +6729,9 @@ var PhantomAdapter = class {
|
|
|
6732
6729
|
// src/hooks/useBTCWallet.ts
|
|
6733
6730
|
var useBTCWallet = () => {
|
|
6734
6731
|
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter(), new PhantomAdapter()];
|
|
6735
|
-
const [installedWallets, setInstalledWallets] =
|
|
6736
|
-
const [address, setAddress] =
|
|
6737
|
-
|
|
6732
|
+
const [installedWallets, setInstalledWallets] = useState30([]);
|
|
6733
|
+
const [address, setAddress] = useState30(null);
|
|
6734
|
+
useEffect26(() => {
|
|
6738
6735
|
const getInstalled = async () => {
|
|
6739
6736
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6740
6737
|
wallet: wallet2,
|
|
@@ -6744,11 +6741,11 @@ var useBTCWallet = () => {
|
|
|
6744
6741
|
};
|
|
6745
6742
|
getInstalled();
|
|
6746
6743
|
}, []);
|
|
6747
|
-
const [wallet, chooseWallet] =
|
|
6744
|
+
const [wallet, chooseWallet] = useState30(null);
|
|
6748
6745
|
const onConnect = async () => {
|
|
6749
6746
|
setAddress(await wallet.connect());
|
|
6750
6747
|
};
|
|
6751
|
-
|
|
6748
|
+
useEffect26(() => {
|
|
6752
6749
|
if (!wallet) {
|
|
6753
6750
|
setAddress(null);
|
|
6754
6751
|
}
|
|
@@ -6764,7 +6761,7 @@ var useBTCWallet = () => {
|
|
|
6764
6761
|
};
|
|
6765
6762
|
|
|
6766
6763
|
// src/components/BTCModal/index.tsx
|
|
6767
|
-
import { jsx as
|
|
6764
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6768
6765
|
function BTCConnectModal({
|
|
6769
6766
|
type = "login",
|
|
6770
6767
|
onSuccess,
|
|
@@ -6774,15 +6771,15 @@ function BTCConnectModal({
|
|
|
6774
6771
|
const intl = useIntl16();
|
|
6775
6772
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
6776
6773
|
const iconMaps = {
|
|
6777
|
-
leather: /* @__PURE__ */
|
|
6778
|
-
unisat: /* @__PURE__ */
|
|
6779
|
-
xverse: /* @__PURE__ */
|
|
6780
|
-
phantom: /* @__PURE__ */
|
|
6774
|
+
leather: /* @__PURE__ */ jsx40(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
6775
|
+
unisat: /* @__PURE__ */ jsx40(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
6776
|
+
xverse: /* @__PURE__ */ jsx40(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
6777
|
+
phantom: /* @__PURE__ */ jsx40(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
6781
6778
|
};
|
|
6782
6779
|
const { events, login } = useMatch();
|
|
6783
|
-
const [status, setStatus] =
|
|
6780
|
+
const [status, setStatus] = useState31("");
|
|
6784
6781
|
const statusRef = React13.useRef(status);
|
|
6785
|
-
const [error, setError] =
|
|
6782
|
+
const [error, setError] = useState31("");
|
|
6786
6783
|
const connected = useMemo15(() => {
|
|
6787
6784
|
return !!address;
|
|
6788
6785
|
}, [address]);
|
|
@@ -6847,7 +6844,7 @@ function BTCConnectModal({
|
|
|
6847
6844
|
statusRef.current = "";
|
|
6848
6845
|
}
|
|
6849
6846
|
};
|
|
6850
|
-
|
|
6847
|
+
useEffect27(() => {
|
|
6851
6848
|
if (wallet) {
|
|
6852
6849
|
console.log("onConnect");
|
|
6853
6850
|
try {
|
|
@@ -6860,12 +6857,12 @@ function BTCConnectModal({
|
|
|
6860
6857
|
setStatus("");
|
|
6861
6858
|
}
|
|
6862
6859
|
}, [wallet]);
|
|
6863
|
-
|
|
6860
|
+
useEffect27(() => {
|
|
6864
6861
|
if (address) {
|
|
6865
6862
|
toLoginInWallet();
|
|
6866
6863
|
}
|
|
6867
6864
|
}, [address]);
|
|
6868
|
-
|
|
6865
|
+
useEffect27(() => {
|
|
6869
6866
|
if (!props.isOpen) {
|
|
6870
6867
|
disconnect();
|
|
6871
6868
|
}
|
|
@@ -6877,11 +6874,11 @@ function BTCConnectModal({
|
|
|
6877
6874
|
statusRef.current = "";
|
|
6878
6875
|
setError("");
|
|
6879
6876
|
};
|
|
6880
|
-
return /* @__PURE__ */
|
|
6877
|
+
return /* @__PURE__ */ jsx40(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6881
6878
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6882
6879
|
}, {
|
|
6883
6880
|
name: "BTC"
|
|
6884
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */
|
|
6881
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ jsx40(
|
|
6885
6882
|
WalletModalContent,
|
|
6886
6883
|
{
|
|
6887
6884
|
error,
|
|
@@ -6894,9 +6891,9 @@ function BTCConnectModal({
|
|
|
6894
6891
|
setVisible: () => {
|
|
6895
6892
|
}
|
|
6896
6893
|
}
|
|
6897
|
-
) : /* @__PURE__ */
|
|
6894
|
+
) : /* @__PURE__ */ jsx40("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs24("div", { className: "matchid-login-recommend-list", children: [
|
|
6898
6895
|
installedWallets.map((wallet2) => {
|
|
6899
|
-
return /* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ jsx40(
|
|
6900
6897
|
RecommendItem,
|
|
6901
6898
|
{
|
|
6902
6899
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -6909,14 +6906,14 @@ function BTCConnectModal({
|
|
|
6909
6906
|
);
|
|
6910
6907
|
}),
|
|
6911
6908
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
6912
|
-
return /* @__PURE__ */
|
|
6909
|
+
return /* @__PURE__ */ jsx40(
|
|
6913
6910
|
RecommendItem,
|
|
6914
6911
|
{
|
|
6915
6912
|
icon: iconMaps[wallet2.walletKey],
|
|
6916
6913
|
name: wallet2.name,
|
|
6917
6914
|
onClick: () => {
|
|
6918
6915
|
},
|
|
6919
|
-
footer: /* @__PURE__ */
|
|
6916
|
+
footer: /* @__PURE__ */ jsx40(Button, { size: "sm", onClick: () => {
|
|
6920
6917
|
window.open(wallet2.website);
|
|
6921
6918
|
}, children: "Install" })
|
|
6922
6919
|
},
|
|
@@ -6926,13 +6923,13 @@ function BTCConnectModal({
|
|
|
6926
6923
|
] }) }) });
|
|
6927
6924
|
}
|
|
6928
6925
|
function BTCModal(props) {
|
|
6929
|
-
return props.isOpen && /* @__PURE__ */
|
|
6926
|
+
return props.isOpen && /* @__PURE__ */ jsx40(BTCConnectModal, { ...props });
|
|
6930
6927
|
}
|
|
6931
6928
|
|
|
6932
6929
|
// src/components/WalletModal/index.tsx
|
|
6933
6930
|
import { useMemo as useMemo16 } from "react";
|
|
6934
6931
|
import { useIntl as useIntl17 } from "react-intl";
|
|
6935
|
-
import { jsx as
|
|
6932
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
6936
6933
|
function WalletConnectModal({
|
|
6937
6934
|
type,
|
|
6938
6935
|
methods: _methods,
|
|
@@ -6950,13 +6947,13 @@ function WalletConnectModal({
|
|
|
6950
6947
|
const platform = config.platform.map((p) => p.toLowerCase());
|
|
6951
6948
|
return WALLET_METHODS.filter((m) => platform.includes(m));
|
|
6952
6949
|
}, [config.platform, _methods]);
|
|
6953
|
-
return /* @__PURE__ */
|
|
6950
|
+
return /* @__PURE__ */ jsx41(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
6954
6951
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
6955
6952
|
}, {
|
|
6956
6953
|
name: ""
|
|
6957
|
-
}), children: /* @__PURE__ */
|
|
6954
|
+
}), children: /* @__PURE__ */ jsx41("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsx41("div", { className: "matchid-login-recommend-list", children: methods.map((method, index) => {
|
|
6958
6955
|
const m = walletMap[method];
|
|
6959
|
-
return /* @__PURE__ */
|
|
6956
|
+
return /* @__PURE__ */ jsx41(
|
|
6960
6957
|
RecommendItem,
|
|
6961
6958
|
{
|
|
6962
6959
|
icon: m?.icon,
|
|
@@ -6970,21 +6967,21 @@ function WalletConnectModal({
|
|
|
6970
6967
|
}) }) }) });
|
|
6971
6968
|
}
|
|
6972
6969
|
function WalletModal(props) {
|
|
6973
|
-
return props.isOpen && /* @__PURE__ */
|
|
6970
|
+
return props.isOpen && /* @__PURE__ */ jsx41(WalletConnectModal, { ...props });
|
|
6974
6971
|
}
|
|
6975
6972
|
|
|
6976
6973
|
// src/components/AlphaAvatar/index.tsx
|
|
6977
|
-
import { useEffect as
|
|
6978
|
-
import { jsx as
|
|
6974
|
+
import { useEffect as useEffect28, useState as useState32 } from "react";
|
|
6975
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6979
6976
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
6980
|
-
const [avatar, setAvatar] =
|
|
6981
|
-
|
|
6977
|
+
const [avatar, setAvatar] = useState32(void 0);
|
|
6978
|
+
useEffect28(() => {
|
|
6982
6979
|
if (name) {
|
|
6983
6980
|
const char = name[0].toUpperCase();
|
|
6984
6981
|
setAvatar(char);
|
|
6985
6982
|
}
|
|
6986
6983
|
}, [name]);
|
|
6987
|
-
return /* @__PURE__ */
|
|
6984
|
+
return /* @__PURE__ */ jsx42("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
6988
6985
|
width: size,
|
|
6989
6986
|
height: size,
|
|
6990
6987
|
fontSize: Math.ceil(size / 2)
|
|
@@ -6992,7 +6989,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
6992
6989
|
}
|
|
6993
6990
|
|
|
6994
6991
|
// src/components/WalletAsset/index.tsx
|
|
6995
|
-
import { jsx as
|
|
6992
|
+
import { jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6996
6993
|
function WalletAsset({
|
|
6997
6994
|
onAssetClick,
|
|
6998
6995
|
matchWalletAssetsOptions
|
|
@@ -7002,7 +6999,7 @@ function WalletAsset({
|
|
|
7002
6999
|
list: walletAssets.mergedAssets
|
|
7003
7000
|
});
|
|
7004
7001
|
const { list } = useMatchChain();
|
|
7005
|
-
return /* @__PURE__ */
|
|
7002
|
+
return /* @__PURE__ */ jsx43("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7006
7003
|
const clickFunc = onAssetClick && onAssetClick(n);
|
|
7007
7004
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7008
7005
|
const getFooterColor = () => {
|
|
@@ -7021,7 +7018,7 @@ function WalletAsset({
|
|
|
7021
7018
|
cursor: clickFunc ? "pointer" : "default"
|
|
7022
7019
|
}, children: [
|
|
7023
7020
|
/* @__PURE__ */ jsxs25("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
7024
|
-
n.icon ? /* @__PURE__ */
|
|
7021
|
+
n.icon ? /* @__PURE__ */ jsx43("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ jsx43(
|
|
7025
7022
|
AlphaAvatar2,
|
|
7026
7023
|
{
|
|
7027
7024
|
className: `matchid-wallet-asset-icon`,
|
|
@@ -7029,12 +7026,12 @@ function WalletAsset({
|
|
|
7029
7026
|
name: n.symbol || n.name || ""
|
|
7030
7027
|
}
|
|
7031
7028
|
),
|
|
7032
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7029
|
+
chain?.iconUrl && /* @__PURE__ */ jsx43("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
7033
7030
|
] }),
|
|
7034
7031
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-info`, children: [
|
|
7035
|
-
/* @__PURE__ */
|
|
7032
|
+
/* @__PURE__ */ jsx43("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
7036
7033
|
"price" in n && /* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-content`, children: [
|
|
7037
|
-
/* @__PURE__ */
|
|
7034
|
+
/* @__PURE__ */ jsx43("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ jsx43(
|
|
7038
7035
|
NumberFormatter,
|
|
7039
7036
|
{
|
|
7040
7037
|
value: n.price,
|
|
@@ -7042,7 +7039,7 @@ function WalletAsset({
|
|
|
7042
7039
|
tFixNum: 2
|
|
7043
7040
|
}
|
|
7044
7041
|
) }),
|
|
7045
|
-
/* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ jsx43("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ jsx43(
|
|
7046
7043
|
NumberFormatter,
|
|
7047
7044
|
{
|
|
7048
7045
|
value: n.value,
|
|
@@ -7052,14 +7049,14 @@ function WalletAsset({
|
|
|
7052
7049
|
) })
|
|
7053
7050
|
] }),
|
|
7054
7051
|
/* @__PURE__ */ jsxs25("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
7055
|
-
/* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsx43("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ jsx43(
|
|
7056
7053
|
NumberFormatter,
|
|
7057
7054
|
{
|
|
7058
7055
|
value: n.balance,
|
|
7059
7056
|
tFixNum: 3
|
|
7060
7057
|
}
|
|
7061
7058
|
) }),
|
|
7062
|
-
"price_change_24h" in n && /* @__PURE__ */
|
|
7059
|
+
"price_change_24h" in n && /* @__PURE__ */ jsx43("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ jsx43(
|
|
7063
7060
|
NumberFormatter,
|
|
7064
7061
|
{
|
|
7065
7062
|
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
@@ -7075,10 +7072,10 @@ function WalletAsset({
|
|
|
7075
7072
|
}
|
|
7076
7073
|
|
|
7077
7074
|
// src/components/TokenSend/index.tsx
|
|
7078
|
-
import { useEffect as
|
|
7075
|
+
import { useEffect as useEffect29, useMemo as useMemo17, useState as useState33 } from "react";
|
|
7079
7076
|
import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, erc20Abi as erc20Abi3, http as http8, parseUnits as parseUnits2 } from "viem";
|
|
7080
7077
|
import { FormattedMessage as FormattedMessage12, useIntl as useIntl18 } from "react-intl";
|
|
7081
|
-
import { jsx as
|
|
7078
|
+
import { jsx as jsx44, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7082
7079
|
function Input2({
|
|
7083
7080
|
onChange,
|
|
7084
7081
|
placeholder,
|
|
@@ -7089,7 +7086,7 @@ function Input2({
|
|
|
7089
7086
|
size = "df"
|
|
7090
7087
|
}) {
|
|
7091
7088
|
return /* @__PURE__ */ jsxs26("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
7092
|
-
/* @__PURE__ */
|
|
7089
|
+
/* @__PURE__ */ jsx44(
|
|
7093
7090
|
"input",
|
|
7094
7091
|
{
|
|
7095
7092
|
placeholder,
|
|
@@ -7100,7 +7097,7 @@ function Input2({
|
|
|
7100
7097
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
7101
7098
|
}
|
|
7102
7099
|
),
|
|
7103
|
-
error && /* @__PURE__ */
|
|
7100
|
+
error && /* @__PURE__ */ jsx44("div", { className: "matchid-token-input-error-text", children: error })
|
|
7104
7101
|
] });
|
|
7105
7102
|
}
|
|
7106
7103
|
function TokenSend({
|
|
@@ -7123,11 +7120,11 @@ function TokenSend({
|
|
|
7123
7120
|
transport: http8()
|
|
7124
7121
|
});
|
|
7125
7122
|
}, [chain]);
|
|
7126
|
-
const [amount, setAmount] =
|
|
7127
|
-
const [address, setAddress] =
|
|
7128
|
-
const [loading, setLoading] =
|
|
7129
|
-
const [sending, setSending] =
|
|
7130
|
-
const [txError, setTxError] =
|
|
7123
|
+
const [amount, setAmount] = useState33("");
|
|
7124
|
+
const [address, setAddress] = useState33("");
|
|
7125
|
+
const [loading, setLoading] = useState33(false);
|
|
7126
|
+
const [sending, setSending] = useState33(false);
|
|
7127
|
+
const [txError, setTxError] = useState33("");
|
|
7131
7128
|
const transaction = useMemo17(() => {
|
|
7132
7129
|
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
7133
7130
|
if (!amount || !address || !reg.test(address)) {
|
|
@@ -7212,7 +7209,7 @@ function TokenSend({
|
|
|
7212
7209
|
}
|
|
7213
7210
|
onClose();
|
|
7214
7211
|
};
|
|
7215
|
-
|
|
7212
|
+
useEffect29(() => {
|
|
7216
7213
|
const receiveMessage = (event) => {
|
|
7217
7214
|
if (event.data) {
|
|
7218
7215
|
if (event.data.source == "match-wallet") {
|
|
@@ -7228,24 +7225,24 @@ function TokenSend({
|
|
|
7228
7225
|
window.removeEventListener("message", receiveMessage);
|
|
7229
7226
|
};
|
|
7230
7227
|
}, []);
|
|
7231
|
-
return /* @__PURE__ */
|
|
7228
|
+
return /* @__PURE__ */ jsx44(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ jsx44(FormattedMessage12, { id: "send" }), onBack, children: /* @__PURE__ */ jsxs26("div", { className: `matchid-token-send-box`, children: [
|
|
7232
7229
|
/* @__PURE__ */ jsxs26("div", { className: "matchid-token-send-content", children: [
|
|
7233
7230
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-content`, children: [
|
|
7234
7231
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-header`, children: [
|
|
7235
|
-
/* @__PURE__ */
|
|
7232
|
+
/* @__PURE__ */ jsx44("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ jsx44(FormattedMessage12, { id: "amount" }) }),
|
|
7236
7233
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-chain`, children: [
|
|
7237
|
-
token.icon ? /* @__PURE__ */
|
|
7234
|
+
token.icon ? /* @__PURE__ */ jsx44(
|
|
7238
7235
|
"img",
|
|
7239
7236
|
{
|
|
7240
7237
|
src: token?.icon,
|
|
7241
7238
|
alt: token?.symbol,
|
|
7242
7239
|
className: `matchid-token-amount-chain-icon`
|
|
7243
7240
|
}
|
|
7244
|
-
) : /* @__PURE__ */
|
|
7245
|
-
/* @__PURE__ */
|
|
7241
|
+
) : /* @__PURE__ */ jsx44(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
7242
|
+
/* @__PURE__ */ jsx44("span", { children: token?.symbol })
|
|
7246
7243
|
] })
|
|
7247
7244
|
] }),
|
|
7248
|
-
/* @__PURE__ */
|
|
7245
|
+
/* @__PURE__ */ jsx44(
|
|
7249
7246
|
Input2,
|
|
7250
7247
|
{
|
|
7251
7248
|
type: "text",
|
|
@@ -7260,16 +7257,16 @@ function TokenSend({
|
|
|
7260
7257
|
),
|
|
7261
7258
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-footer`, children: [
|
|
7262
7259
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-amount-title`, children: [
|
|
7263
|
-
/* @__PURE__ */
|
|
7260
|
+
/* @__PURE__ */ jsx44(FormattedMessage12, { id: "balance" }),
|
|
7264
7261
|
":"
|
|
7265
7262
|
] }),
|
|
7266
|
-
/* @__PURE__ */
|
|
7263
|
+
/* @__PURE__ */ jsx44("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ jsx44(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
7267
7264
|
] }),
|
|
7268
|
-
/* @__PURE__ */
|
|
7265
|
+
/* @__PURE__ */ jsx44(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
7269
7266
|
] }),
|
|
7270
7267
|
/* @__PURE__ */ jsxs26("div", { className: `matchid-token-address-content`, children: [
|
|
7271
|
-
/* @__PURE__ */
|
|
7272
|
-
/* @__PURE__ */
|
|
7268
|
+
/* @__PURE__ */ jsx44("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ jsx44("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ jsx44(FormattedMessage12, { id: "receiveTitle" }) }) }),
|
|
7269
|
+
/* @__PURE__ */ jsx44(
|
|
7273
7270
|
Input2,
|
|
7274
7271
|
{
|
|
7275
7272
|
type: "text",
|
|
@@ -7285,7 +7282,7 @@ function TokenSend({
|
|
|
7285
7282
|
)
|
|
7286
7283
|
] })
|
|
7287
7284
|
] }),
|
|
7288
|
-
/* @__PURE__ */
|
|
7285
|
+
/* @__PURE__ */ jsx44(
|
|
7289
7286
|
Button,
|
|
7290
7287
|
{
|
|
7291
7288
|
size: "lg",
|
|
@@ -7294,7 +7291,7 @@ function TokenSend({
|
|
|
7294
7291
|
disabled: !canSend || !!txError,
|
|
7295
7292
|
onClick: onNext,
|
|
7296
7293
|
loading: loading || sending,
|
|
7297
|
-
children: /* @__PURE__ */
|
|
7294
|
+
children: /* @__PURE__ */ jsx44(FormattedMessage12, { id: "next" })
|
|
7298
7295
|
}
|
|
7299
7296
|
)
|
|
7300
7297
|
] }) });
|
|
@@ -7302,7 +7299,7 @@ function TokenSend({
|
|
|
7302
7299
|
|
|
7303
7300
|
// src/components/TokenDetail/index.tsx
|
|
7304
7301
|
import { FormattedMessage as FormattedMessage13, useIntl as useIntl19 } from "react-intl";
|
|
7305
|
-
import { jsx as
|
|
7302
|
+
import { jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7306
7303
|
function TokenDetail({
|
|
7307
7304
|
onClose,
|
|
7308
7305
|
token
|
|
@@ -7312,41 +7309,41 @@ function TokenDetail({
|
|
|
7312
7309
|
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
7313
7310
|
const onSend = () => {
|
|
7314
7311
|
modal.show((props) => {
|
|
7315
|
-
return /* @__PURE__ */
|
|
7312
|
+
return /* @__PURE__ */ jsx45(TokenSend, { onClose: () => {
|
|
7316
7313
|
props.close();
|
|
7317
7314
|
onClose();
|
|
7318
7315
|
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
7319
7316
|
});
|
|
7320
7317
|
};
|
|
7321
7318
|
const intl = useIntl19();
|
|
7322
|
-
return /* @__PURE__ */
|
|
7319
|
+
return /* @__PURE__ */ jsx45(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
7323
7320
|
id: "tokenDetails"
|
|
7324
7321
|
}), onClose, children: /* @__PURE__ */ jsxs27("div", { className: `matchid-token-detail`, children: [
|
|
7325
7322
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-main`, children: [
|
|
7326
7323
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-info`, children: [
|
|
7327
7324
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-logo`, children: [
|
|
7328
|
-
token.icon ? /* @__PURE__ */
|
|
7329
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7325
|
+
token.icon ? /* @__PURE__ */ jsx45("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ jsx45(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
7326
|
+
chain?.iconUrl && /* @__PURE__ */ jsx45("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
7330
7327
|
] }),
|
|
7331
7328
|
/* @__PURE__ */ jsxs27("div", { className: `matchid-token-name`, children: [
|
|
7332
|
-
/* @__PURE__ */
|
|
7329
|
+
/* @__PURE__ */ jsx45(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
7333
7330
|
" ",
|
|
7334
7331
|
token.symbol
|
|
7335
7332
|
] })
|
|
7336
7333
|
] }),
|
|
7337
7334
|
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ jsxs27("div", { className: `matchid-token-contract`, children: [
|
|
7338
|
-
/* @__PURE__ */
|
|
7339
|
-
/* @__PURE__ */
|
|
7335
|
+
/* @__PURE__ */ jsx45("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
7336
|
+
/* @__PURE__ */ jsx45("div", { className: "matchid-token-contract-address", children: token.address })
|
|
7340
7337
|
] })
|
|
7341
7338
|
] }),
|
|
7342
|
-
/* @__PURE__ */
|
|
7339
|
+
/* @__PURE__ */ jsx45(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ jsx45(FormattedMessage13, { id: "send" }) })
|
|
7343
7340
|
] }) });
|
|
7344
7341
|
}
|
|
7345
7342
|
|
|
7346
7343
|
// src/components/TokenSendList/index.tsx
|
|
7347
|
-
import { useState as
|
|
7344
|
+
import { useState as useState34 } from "react";
|
|
7348
7345
|
import { FormattedMessage as FormattedMessage14 } from "react-intl";
|
|
7349
|
-
import { jsx as
|
|
7346
|
+
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7350
7347
|
function TokenSendList({ close }) {
|
|
7351
7348
|
const isDownMd = useDownMd();
|
|
7352
7349
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -7354,18 +7351,18 @@ function TokenSendList({ close }) {
|
|
|
7354
7351
|
list: walletAssets.mergedAssets
|
|
7355
7352
|
});
|
|
7356
7353
|
const { list } = useMatchChain();
|
|
7357
|
-
const [checked, setChecked] =
|
|
7354
|
+
const [checked, setChecked] = useState34();
|
|
7358
7355
|
const modal = useModal();
|
|
7359
7356
|
const onNext = () => {
|
|
7360
7357
|
checked && modal.show((props) => {
|
|
7361
|
-
return /* @__PURE__ */
|
|
7358
|
+
return /* @__PURE__ */ jsx46(TokenSend, { onClose: () => {
|
|
7362
7359
|
props.close();
|
|
7363
7360
|
close();
|
|
7364
7361
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
7365
7362
|
});
|
|
7366
7363
|
};
|
|
7367
7364
|
return /* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-list-box", children: [
|
|
7368
|
-
/* @__PURE__ */
|
|
7365
|
+
/* @__PURE__ */ jsx46("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
7369
7366
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
7370
7367
|
return /* @__PURE__ */ jsxs28(
|
|
7371
7368
|
"div",
|
|
@@ -7375,10 +7372,10 @@ function TokenSendList({ close }) {
|
|
|
7375
7372
|
setChecked(n);
|
|
7376
7373
|
},
|
|
7377
7374
|
children: [
|
|
7378
|
-
/* @__PURE__ */
|
|
7375
|
+
/* @__PURE__ */ jsx46(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
7379
7376
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-content", children: [
|
|
7380
7377
|
/* @__PURE__ */ jsxs28("div", { className: "matchid-token-send-logo", children: [
|
|
7381
|
-
n.icon ? /* @__PURE__ */
|
|
7378
|
+
n.icon ? /* @__PURE__ */ jsx46("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ jsx46(
|
|
7382
7379
|
AlphaAvatar2,
|
|
7383
7380
|
{
|
|
7384
7381
|
className: `matchid-token-send-icon`,
|
|
@@ -7386,7 +7383,7 @@ function TokenSendList({ close }) {
|
|
|
7386
7383
|
name: n.symbol || n.name || ""
|
|
7387
7384
|
}
|
|
7388
7385
|
),
|
|
7389
|
-
chain?.iconUrl && /* @__PURE__ */
|
|
7386
|
+
chain?.iconUrl && /* @__PURE__ */ jsx46(
|
|
7390
7387
|
"img",
|
|
7391
7388
|
{
|
|
7392
7389
|
src: chain.iconUrl,
|
|
@@ -7396,8 +7393,8 @@ function TokenSendList({ close }) {
|
|
|
7396
7393
|
)
|
|
7397
7394
|
] }),
|
|
7398
7395
|
/* @__PURE__ */ jsxs28("div", { className: `matchid-token-send-info`, children: [
|
|
7399
|
-
/* @__PURE__ */
|
|
7400
|
-
/* @__PURE__ */
|
|
7396
|
+
/* @__PURE__ */ jsx46("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
7397
|
+
/* @__PURE__ */ jsx46("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ jsx46(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
7401
7398
|
] })
|
|
7402
7399
|
] })
|
|
7403
7400
|
]
|
|
@@ -7405,23 +7402,23 @@ function TokenSendList({ close }) {
|
|
|
7405
7402
|
index
|
|
7406
7403
|
);
|
|
7407
7404
|
}) }),
|
|
7408
|
-
/* @__PURE__ */
|
|
7405
|
+
/* @__PURE__ */ jsx46(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ jsx46(FormattedMessage14, { id: "next" }) })
|
|
7409
7406
|
] });
|
|
7410
7407
|
}
|
|
7411
7408
|
|
|
7412
7409
|
// src/components/TransactionList/index.tsx
|
|
7413
7410
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
7414
|
-
import { useEffect as
|
|
7411
|
+
import { useEffect as useEffect30, useMemo as useMemo18, useState as useState35 } from "react";
|
|
7415
7412
|
import { decodeFunctionData, defineChain as defineChain5, formatUnits as formatUnits3 } from "viem";
|
|
7416
7413
|
import { erc20Abi as erc20Abi4 } from "viem";
|
|
7417
7414
|
import { FormattedMessage as FormattedMessage15 } from "react-intl";
|
|
7418
|
-
import { jsx as
|
|
7415
|
+
import { jsx as jsx47, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7419
7416
|
var Item = ({ data }) => {
|
|
7420
7417
|
const { address } = useWallet();
|
|
7421
7418
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
7422
7419
|
const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
|
|
7423
7420
|
const { contracts } = useContractStore_default();
|
|
7424
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
7421
|
+
const [shouldRefetch, setShouldRefetch] = useState35(true);
|
|
7425
7422
|
const transferType = useMemo18(() => {
|
|
7426
7423
|
const methodId = data.input.substring(2, 10);
|
|
7427
7424
|
if (methodId == "095ea7b3") {
|
|
@@ -7490,7 +7487,7 @@ var Item = ({ data }) => {
|
|
|
7490
7487
|
}
|
|
7491
7488
|
return "loading";
|
|
7492
7489
|
}, [data.extra?.status, data.source, hashQuery.data]);
|
|
7493
|
-
|
|
7490
|
+
useEffect30(() => {
|
|
7494
7491
|
if (data.hash) {
|
|
7495
7492
|
setShouldRefetch(status == "loading");
|
|
7496
7493
|
}
|
|
@@ -7510,10 +7507,10 @@ var Item = ({ data }) => {
|
|
|
7510
7507
|
className: `matchid-transaction-item`,
|
|
7511
7508
|
children: [
|
|
7512
7509
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transacton-item-container`, children: [
|
|
7513
|
-
/* @__PURE__ */
|
|
7510
|
+
/* @__PURE__ */ jsx47("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ jsx47(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
7514
7511
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-details`, children: [
|
|
7515
|
-
/* @__PURE__ */
|
|
7516
|
-
/* @__PURE__ */
|
|
7512
|
+
/* @__PURE__ */ jsx47("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
7513
|
+
/* @__PURE__ */ jsx47(
|
|
7517
7514
|
"div",
|
|
7518
7515
|
{
|
|
7519
7516
|
className: `matchid-transaction-item-timestamp`,
|
|
@@ -7523,10 +7520,10 @@ var Item = ({ data }) => {
|
|
|
7523
7520
|
] })
|
|
7524
7521
|
] }),
|
|
7525
7522
|
/* @__PURE__ */ jsxs29("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
7526
|
-
/* @__PURE__ */
|
|
7527
|
-
status == "loading" && /* @__PURE__ */
|
|
7528
|
-
status == "success" && /* @__PURE__ */
|
|
7529
|
-
status == "error" && /* @__PURE__ */
|
|
7523
|
+
/* @__PURE__ */ jsx47(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
7524
|
+
status == "loading" && /* @__PURE__ */ jsx47(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
7525
|
+
status == "success" && /* @__PURE__ */ jsx47(CheckRoundIcon, { size: 16 }),
|
|
7526
|
+
status == "error" && /* @__PURE__ */ jsx47(InfoRoundIcon, { size: 16 })
|
|
7530
7527
|
] })
|
|
7531
7528
|
]
|
|
7532
7529
|
}
|
|
@@ -7536,7 +7533,7 @@ function TransactionList({
|
|
|
7536
7533
|
scrollableTarget
|
|
7537
7534
|
}) {
|
|
7538
7535
|
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
7539
|
-
return /* @__PURE__ */
|
|
7536
|
+
return /* @__PURE__ */ jsx47(
|
|
7540
7537
|
InfiniteScroll,
|
|
7541
7538
|
{
|
|
7542
7539
|
scrollableTarget,
|
|
@@ -7544,11 +7541,11 @@ function TransactionList({
|
|
|
7544
7541
|
next: fetchMoreData,
|
|
7545
7542
|
hasMore,
|
|
7546
7543
|
loader: /* @__PURE__ */ jsxs29("div", { className: "matchid-list-nomore", children: [
|
|
7547
|
-
/* @__PURE__ */
|
|
7544
|
+
/* @__PURE__ */ jsx47(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
7548
7545
|
"Loading..."
|
|
7549
7546
|
] }),
|
|
7550
|
-
endMessage: items.length > 0 ? /* @__PURE__ */
|
|
7551
|
-
children: items.length == 0 && !hasMore ? /* @__PURE__ */
|
|
7547
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ jsx47("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx47(FormattedMessage15, { id: "noMoreRecords" }) }) : /* @__PURE__ */ jsx47("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ jsx47(FormattedMessage15, { id: "noRecords" }) }),
|
|
7548
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ jsx47("div", { className: "mt-[150px]" }) : /* @__PURE__ */ jsx47("div", { className: `matchid-transaction-list`, children: items.map((item, index) => /* @__PURE__ */ jsx47(Item, { data: item }, index)) })
|
|
7552
7549
|
}
|
|
7553
7550
|
);
|
|
7554
7551
|
}
|
|
@@ -7621,4 +7618,4 @@ export {
|
|
|
7621
7618
|
MatchProvider,
|
|
7622
7619
|
useMatch
|
|
7623
7620
|
};
|
|
7624
|
-
//# sourceMappingURL=chunk-
|
|
7621
|
+
//# sourceMappingURL=chunk-PAXASLBR.mjs.map
|