@matchain/matchid-sdk-react 0.1.55-alpha.11 → 0.1.55-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +20 -20
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +2 -2
- package/dist/assets/lottie.d.mts +1 -1
- package/dist/assets/lottie.d.ts +1 -1
- package/dist/chains.d.mts +1 -1
- package/dist/chains.d.ts +1 -1
- package/dist/{chunk-JTNCYI5F.mjs → chunk-25VAJMUX.mjs} +2 -2
- package/dist/{chunk-5WFY6MWJ.mjs → chunk-BB4OTBUS.mjs} +165 -155
- package/dist/chunk-BB4OTBUS.mjs.map +1 -0
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +172 -162
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1 -1
- package/dist/hooks.d.mts +4 -2
- package/dist/hooks.d.ts +4 -2
- package/dist/hooks.js +109 -104
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/icon.d.mts +2 -2
- package/dist/icon.d.ts +2 -2
- package/dist/{index-De5vVOFw.d.mts → index--EI6w9pi.d.mts} +1008 -1002
- package/dist/{index-Bx7ztInz.d.ts → index-4dZbgWG2.d.ts} +1 -1
- package/dist/{index-DXRGMAbv.d.mts → index-B50DU_xT.d.mts} +4 -4
- package/dist/{index-DXRGMAbv.d.ts → index-B50DU_xT.d.ts} +4 -4
- package/dist/{index-BTO2pJRz.d.ts → index-B80rDuha.d.ts} +1 -1
- package/dist/{index-DY5CjOq2.d.ts → index-BBghnVDr.d.ts} +1 -1
- package/dist/{index-DL0LMDQ0.d.mts → index-C14uKUDG.d.mts} +2 -2
- package/dist/{index-DysgDUCb.d.mts → index-CDTTHSh0.d.mts} +14 -14
- package/dist/{index-DysgDUCb.d.ts → index-CDTTHSh0.d.ts} +14 -14
- package/dist/{index-HYPgwvkU.d.mts → index-CHtFnnZk.d.mts} +1 -1
- package/dist/{index-ChUeWRxV.d.ts → index-Cl0JpAc1.d.ts} +1008 -1002
- package/dist/{index-CopoHLm5.d.ts → index-CwHXzvvB.d.ts} +1 -1
- package/dist/{index-8h2kA48e.d.ts → index-DGbpUvkd.d.ts} +2 -2
- package/dist/{index-B-u8_Lcy.d.ts → index-Dx4OFZhG.d.mts} +5 -6
- package/dist/{index-BW1GRpQ3.d.mts → index-FKxw4Vaa.d.mts} +1 -1
- package/dist/{index-D6wTVWuu.d.mts → index-QPdWAVPk.d.mts} +1 -1
- package/dist/{index-D2hhRO2j.d.mts → index-TjbO7d74.d.mts} +1 -1
- package/dist/{index-Ba8t2zs6.d.mts → index-hiCo96Vc.d.ts} +5 -6
- package/dist/index.d.mts +18 -17
- package/dist/index.d.ts +18 -17
- package/dist/index.js +121 -111
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{types-Ch54HuTY.d.mts → types-DEsY_CPH.d.mts} +1 -1
- package/dist/{types-Ch54HuTY.d.ts → types-DEsY_CPH.d.ts} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +14 -9
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-5WFY6MWJ.mjs.map +0 -1
- /package/dist/{chunk-JTNCYI5F.mjs.map → chunk-25VAJMUX.mjs.map} +0 -0
|
@@ -107,7 +107,7 @@ __export(components_exports, {
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
// src/components/EmailModal/index.tsx
|
|
110
|
-
import { useEffect as
|
|
110
|
+
import { useEffect as useEffect20, useState as useState20 } from "react";
|
|
111
111
|
|
|
112
112
|
// src/ui/Modal/index.tsx
|
|
113
113
|
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
@@ -943,11 +943,11 @@ var useStore_default = useStore;
|
|
|
943
943
|
// src/hooks/useWallet.tsx
|
|
944
944
|
import { toAccount } from "viem/accounts";
|
|
945
945
|
import { createWalletClient } from "viem";
|
|
946
|
-
import { useEffect as
|
|
946
|
+
import { useEffect as useEffect8, useMemo as useMemo3 } from "react";
|
|
947
947
|
import { encodeDeployData } from "viem";
|
|
948
948
|
|
|
949
949
|
// src/context/ModalContext.tsx
|
|
950
|
-
import React3, { useState as
|
|
950
|
+
import React3, { useState as useState8, useCallback, createContext, useContext } from "react";
|
|
951
951
|
import { createPortal } from "react-dom";
|
|
952
952
|
|
|
953
953
|
// src/ui/index.ts
|
|
@@ -960,7 +960,7 @@ __export(ui_exports, {
|
|
|
960
960
|
Field: () => Field,
|
|
961
961
|
HashPanel: () => HashPanel_default,
|
|
962
962
|
Input: () => Input,
|
|
963
|
-
Lottie: () =>
|
|
963
|
+
Lottie: () => Lottie_default,
|
|
964
964
|
Modal: () => Modal,
|
|
965
965
|
ModalDrawer: () => ModalDrawer,
|
|
966
966
|
ModalWithHeader: () => ModalWithHeader,
|
|
@@ -1141,7 +1141,7 @@ function HashPanel({
|
|
|
1141
1141
|
/* @__PURE__ */ jsx9("div", { className: `matchid-hashpanel-status`, style: {
|
|
1142
1142
|
color: statusValue.color
|
|
1143
1143
|
}, children: statusValue.text }),
|
|
1144
|
-
statusValue.lottie ? /* @__PURE__ */ jsx9(
|
|
1144
|
+
statusValue.lottie ? /* @__PURE__ */ jsx9(Lottie_default, { animationData: statusValue.lottie, style: {
|
|
1145
1145
|
width: "96px",
|
|
1146
1146
|
height: "96px"
|
|
1147
1147
|
} }) : /* @__PURE__ */ jsx9("img", { src: statusValue.icon, alt: statusValue.text, className: `matchid-hashpanel-img` }),
|
|
@@ -1298,20 +1298,25 @@ function Tabs(props) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
|
|
1300
1300
|
// src/ui/Lottie/index.tsx
|
|
1301
|
-
import
|
|
1301
|
+
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
1302
1302
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
}
|
|
1303
|
+
var LazyLottie = (props) => {
|
|
1304
|
+
const [LottieReact, setLottieReact] = useState7(null);
|
|
1305
|
+
useEffect7(() => {
|
|
1306
|
+
import("lottie-react").then((mod) => {
|
|
1307
|
+
setLottieReact(mod.default || mod);
|
|
1308
|
+
});
|
|
1309
|
+
}, []);
|
|
1310
|
+
if (!LottieReact) return /* @__PURE__ */ jsx16("div", { children: "Loading..." });
|
|
1311
|
+
return /* @__PURE__ */ jsx16(LottieReact, { loop: true, autoplay: true, ...props });
|
|
1312
|
+
};
|
|
1313
|
+
var Lottie_default = LazyLottie;
|
|
1309
1314
|
|
|
1310
1315
|
// src/context/ModalContext.tsx
|
|
1311
1316
|
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1312
1317
|
var ModalContext = createContext(null);
|
|
1313
1318
|
function ModalProvider({ children }) {
|
|
1314
|
-
const [modalState, setModalState] =
|
|
1319
|
+
const [modalState, setModalState] = useState8({
|
|
1315
1320
|
modals: [],
|
|
1316
1321
|
highestZIndex: 100
|
|
1317
1322
|
});
|
|
@@ -1496,7 +1501,7 @@ function useWallet() {
|
|
|
1496
1501
|
return void 0;
|
|
1497
1502
|
}
|
|
1498
1503
|
}, [address]);
|
|
1499
|
-
|
|
1504
|
+
useEffect8(() => {
|
|
1500
1505
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
1501
1506
|
}, [evmAccount]);
|
|
1502
1507
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -1639,14 +1644,14 @@ function useWallet() {
|
|
|
1639
1644
|
|
|
1640
1645
|
// src/hooks/useCopyClipboard.ts
|
|
1641
1646
|
import copy from "copy-to-clipboard";
|
|
1642
|
-
import { useCallback as useCallback2, useEffect as
|
|
1647
|
+
import { useCallback as useCallback2, useEffect as useEffect9, useState as useState10 } from "react";
|
|
1643
1648
|
function useCopyClipboard(timeout = 500) {
|
|
1644
|
-
const [isCopied, setIsCopied] =
|
|
1649
|
+
const [isCopied, setIsCopied] = useState10(false);
|
|
1645
1650
|
const staticCopy = useCallback2((text) => {
|
|
1646
1651
|
const didCopy = copy(text);
|
|
1647
1652
|
setIsCopied(didCopy);
|
|
1648
1653
|
}, []);
|
|
1649
|
-
|
|
1654
|
+
useEffect9(() => {
|
|
1650
1655
|
if (isCopied) {
|
|
1651
1656
|
const hide = setTimeout(() => {
|
|
1652
1657
|
setIsCopied(false);
|
|
@@ -1661,12 +1666,12 @@ function useCopyClipboard(timeout = 500) {
|
|
|
1661
1666
|
}
|
|
1662
1667
|
|
|
1663
1668
|
// src/context/ToastContext.tsx
|
|
1664
|
-
import { useState as
|
|
1669
|
+
import { useState as useState11, useCallback as useCallback3, createContext as createContext2, useContext as useContext2 } from "react";
|
|
1665
1670
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1666
1671
|
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1667
1672
|
var ToastContext = createContext2(null);
|
|
1668
1673
|
function ToastProvider({ children, zIndex = 299 }) {
|
|
1669
|
-
const [toasts, setToasts] =
|
|
1674
|
+
const [toasts, setToasts] = useState11([]);
|
|
1670
1675
|
const removeToast = useCallback3((id) => {
|
|
1671
1676
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
1672
1677
|
}, []);
|
|
@@ -1839,7 +1844,7 @@ function useWalletAssetListQuery({
|
|
|
1839
1844
|
}
|
|
1840
1845
|
|
|
1841
1846
|
// src/hooks/useMatchChain.tsx
|
|
1842
|
-
import { useMemo as useMemo4, useState as
|
|
1847
|
+
import { useMemo as useMemo4, useState as useState12 } from "react";
|
|
1843
1848
|
import { createPublicClient as createPublicClient3, formatUnits, http as http3, parseUnits } from "viem";
|
|
1844
1849
|
import { FormattedMessage as FormattedMessage2, useIntl as useIntl3 } from "react-intl";
|
|
1845
1850
|
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
@@ -1871,7 +1876,7 @@ function useMatchChain() {
|
|
|
1871
1876
|
close
|
|
1872
1877
|
}) {
|
|
1873
1878
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
1874
|
-
const [selectedChainId, setSelectedChainId] =
|
|
1879
|
+
const [selectedChainId, setSelectedChainId] = useState12(storeChainId2);
|
|
1875
1880
|
const isDownMd = useDownMd();
|
|
1876
1881
|
return /* @__PURE__ */ jsxs10("div", { className: `matchid-change-network-box`, children: [
|
|
1877
1882
|
/* @__PURE__ */ jsx20("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
|
|
@@ -1931,7 +1936,7 @@ function useMatchChain() {
|
|
|
1931
1936
|
|
|
1932
1937
|
// src/hooks/useMatchWallet.tsx
|
|
1933
1938
|
import { QRCode } from "react-qrcode";
|
|
1934
|
-
import { useEffect as
|
|
1939
|
+
import { useEffect as useEffect12, useMemo as useMemo6, useRef, useState as useState14 } from "react";
|
|
1935
1940
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
1936
1941
|
|
|
1937
1942
|
// src/config/index.tsx
|
|
@@ -2002,7 +2007,7 @@ var useContractStore_default = useContractStore;
|
|
|
2002
2007
|
import { FormattedMessage as FormattedMessage4, useIntl as useIntl5 } from "react-intl";
|
|
2003
2008
|
|
|
2004
2009
|
// src/components/ImportToken/index.tsx
|
|
2005
|
-
import { useEffect as
|
|
2010
|
+
import { useEffect as useEffect11, useMemo as useMemo5, useState as useState13 } from "react";
|
|
2006
2011
|
import { FormattedMessage as FormattedMessage3, useIntl as useIntl4 } from "react-intl";
|
|
2007
2012
|
import { useQueryClient } from "@tanstack/react-query";
|
|
2008
2013
|
import { defineChain, erc20Abi } from "viem";
|
|
@@ -2034,12 +2039,12 @@ function useIsContract({
|
|
|
2034
2039
|
// src/components/ImportToken/index.tsx
|
|
2035
2040
|
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2036
2041
|
function ImportToken({ close }) {
|
|
2037
|
-
const [status, setStatus] =
|
|
2042
|
+
const [status, setStatus] = useState13("");
|
|
2038
2043
|
const { token } = useUserInfo();
|
|
2039
|
-
const [address, setAddress] =
|
|
2040
|
-
const [symbol, setSymbol] =
|
|
2041
|
-
const [decimals, setDecimals] =
|
|
2042
|
-
const [error, setError] =
|
|
2044
|
+
const [address, setAddress] = useState13("");
|
|
2045
|
+
const [symbol, setSymbol] = useState13("");
|
|
2046
|
+
const [decimals, setDecimals] = useState13("");
|
|
2047
|
+
const [error, setError] = useState13({});
|
|
2043
2048
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
2044
2049
|
const getContractInfo = async () => {
|
|
2045
2050
|
if (!publicClient) return;
|
|
@@ -2073,7 +2078,7 @@ function ImportToken({ close }) {
|
|
|
2073
2078
|
}
|
|
2074
2079
|
};
|
|
2075
2080
|
const intl = useIntl4();
|
|
2076
|
-
|
|
2081
|
+
useEffect11(() => {
|
|
2077
2082
|
if (address.length === 42) {
|
|
2078
2083
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2079
2084
|
if (!reg.test(address)) {
|
|
@@ -2092,7 +2097,7 @@ function ImportToken({ close }) {
|
|
|
2092
2097
|
}
|
|
2093
2098
|
}
|
|
2094
2099
|
}, [address, publicClient]);
|
|
2095
|
-
const [loading, setLoading] =
|
|
2100
|
+
const [loading, setLoading] = useState13(false);
|
|
2096
2101
|
const toast = useToast();
|
|
2097
2102
|
const queryClient2 = useQueryClient();
|
|
2098
2103
|
const onImport = async () => {
|
|
@@ -2145,7 +2150,7 @@ function ImportToken({ close }) {
|
|
|
2145
2150
|
if (status == "success" || status == "fail") {
|
|
2146
2151
|
return /* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2147
2152
|
/* @__PURE__ */ jsxs11("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2148
|
-
/* @__PURE__ */ jsx21("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ jsx21(
|
|
2153
|
+
/* @__PURE__ */ jsx21("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ jsx21(Lottie_default, { animationData: status == "success" ? success_default : fail_default, style: {
|
|
2149
2154
|
width: "96px",
|
|
2150
2155
|
height: "96px"
|
|
2151
2156
|
} }) }),
|
|
@@ -2289,8 +2294,8 @@ function useMatchWallet() {
|
|
|
2289
2294
|
};
|
|
2290
2295
|
}
|
|
2291
2296
|
function useMatchWalletRecords() {
|
|
2292
|
-
const [hasMore, setHasMore] =
|
|
2293
|
-
const [items, setItems] =
|
|
2297
|
+
const [hasMore, setHasMore] = useState14(true);
|
|
2298
|
+
const [items, setItems] = useState14([]);
|
|
2294
2299
|
const { chainId, publicClient } = useMatchChain();
|
|
2295
2300
|
const { address } = useWallet();
|
|
2296
2301
|
const hasMoreRef = useRef(hasMore);
|
|
@@ -2321,7 +2326,7 @@ function useMatchWalletRecords() {
|
|
|
2321
2326
|
hasMoreRef.current = true;
|
|
2322
2327
|
fetchMoreData();
|
|
2323
2328
|
};
|
|
2324
|
-
|
|
2329
|
+
useEffect12(() => {
|
|
2325
2330
|
if (chainId && address) {
|
|
2326
2331
|
onInit();
|
|
2327
2332
|
}
|
|
@@ -2556,7 +2561,7 @@ function useMatchWalletAssetList({
|
|
|
2556
2561
|
return { ...asset, balance, value, balanceValue };
|
|
2557
2562
|
});
|
|
2558
2563
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
2559
|
-
|
|
2564
|
+
useEffect12(() => {
|
|
2560
2565
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
2561
2566
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
2562
2567
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -2581,14 +2586,14 @@ function useMatchWalletAssetList({
|
|
|
2581
2586
|
}
|
|
2582
2587
|
|
|
2583
2588
|
// src/hooks/useReceipt.tsx
|
|
2584
|
-
import { useState as
|
|
2589
|
+
import { useState as useState15, useCallback as useCallback4, useEffect as useEffect13 } from "react";
|
|
2585
2590
|
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
2586
2591
|
import { createPublicClient as createPublicClient5, defineChain as defineChain2, http as http5 } from "viem";
|
|
2587
2592
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
2588
2593
|
var MAX_CACHE_SIZE = 500;
|
|
2589
2594
|
var STORAGE_KEY = "match_receipt_logs";
|
|
2590
2595
|
function useReceiptCache() {
|
|
2591
|
-
const [cache, setCache] =
|
|
2596
|
+
const [cache, setCache] = useState15(/* @__PURE__ */ new Map());
|
|
2592
2597
|
const isLocalStorageAvailable = (() => {
|
|
2593
2598
|
try {
|
|
2594
2599
|
const testKey = "__test__";
|
|
@@ -2599,7 +2604,7 @@ function useReceiptCache() {
|
|
|
2599
2604
|
return false;
|
|
2600
2605
|
}
|
|
2601
2606
|
})();
|
|
2602
|
-
|
|
2607
|
+
useEffect13(() => {
|
|
2603
2608
|
if (isLocalStorageAvailable) {
|
|
2604
2609
|
try {
|
|
2605
2610
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -2690,7 +2695,7 @@ function useReceipt({
|
|
|
2690
2695
|
const { list } = useMatchChain();
|
|
2691
2696
|
const cache = useReceiptCache();
|
|
2692
2697
|
const chain = list?.find((item) => item.id === chainId);
|
|
2693
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
2698
|
+
const [shouldRefetch, setShouldRefetch] = useState15(true);
|
|
2694
2699
|
const query = useQuery5({
|
|
2695
2700
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
2696
2701
|
queryFn: async () => {
|
|
@@ -2716,7 +2721,7 @@ function useReceipt({
|
|
|
2716
2721
|
},
|
|
2717
2722
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2718
2723
|
});
|
|
2719
|
-
|
|
2724
|
+
useEffect13(() => {
|
|
2720
2725
|
if (query.data) {
|
|
2721
2726
|
setShouldRefetch(false);
|
|
2722
2727
|
}
|
|
@@ -2725,14 +2730,14 @@ function useReceipt({
|
|
|
2725
2730
|
}
|
|
2726
2731
|
|
|
2727
2732
|
// src/hooks/useTransaction.tsx
|
|
2728
|
-
import { useState as
|
|
2733
|
+
import { useState as useState16, useCallback as useCallback5, useEffect as useEffect14 } from "react";
|
|
2729
2734
|
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
2730
2735
|
import { createPublicClient as createPublicClient6, defineChain as defineChain3, http as http6 } from "viem";
|
|
2731
2736
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
2732
2737
|
var MAX_CACHE_SIZE2 = 500;
|
|
2733
2738
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
2734
2739
|
function useTransactionCache() {
|
|
2735
|
-
const [cache, setCache] =
|
|
2740
|
+
const [cache, setCache] = useState16(/* @__PURE__ */ new Map());
|
|
2736
2741
|
const isLocalStorageAvailable = (() => {
|
|
2737
2742
|
try {
|
|
2738
2743
|
const testKey = "__test__";
|
|
@@ -2743,7 +2748,7 @@ function useTransactionCache() {
|
|
|
2743
2748
|
return false;
|
|
2744
2749
|
}
|
|
2745
2750
|
})();
|
|
2746
|
-
|
|
2751
|
+
useEffect14(() => {
|
|
2747
2752
|
if (isLocalStorageAvailable) {
|
|
2748
2753
|
try {
|
|
2749
2754
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -2834,7 +2839,7 @@ function useTransaction({
|
|
|
2834
2839
|
const { list } = useMatchChain();
|
|
2835
2840
|
const cache = useTransactionCache();
|
|
2836
2841
|
const chain = list?.find((item) => item.id === chainId);
|
|
2837
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
2842
|
+
const [shouldRefetch, setShouldRefetch] = useState16(true);
|
|
2838
2843
|
const query = useQuery6({
|
|
2839
2844
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
2840
2845
|
queryFn: async () => {
|
|
@@ -2860,7 +2865,7 @@ function useTransaction({
|
|
|
2860
2865
|
},
|
|
2861
2866
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2862
2867
|
});
|
|
2863
|
-
|
|
2868
|
+
useEffect14(() => {
|
|
2864
2869
|
if (query.data) {
|
|
2865
2870
|
setShouldRefetch(false);
|
|
2866
2871
|
}
|
|
@@ -2954,7 +2959,7 @@ var useWalletModalStore = create5((set) => ({
|
|
|
2954
2959
|
}));
|
|
2955
2960
|
|
|
2956
2961
|
// src/components/CEXBindModal/index.tsx
|
|
2957
|
-
import { useEffect as
|
|
2962
|
+
import { useEffect as useEffect15, useMemo as useMemo7, useState as useState17 } from "react";
|
|
2958
2963
|
import { FormattedMessage as FormattedMessage5, useIntl as useIntl6 } from "react-intl";
|
|
2959
2964
|
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2960
2965
|
function CEXBindModal({
|
|
@@ -2965,16 +2970,16 @@ function CEXBindModal({
|
|
|
2965
2970
|
}) {
|
|
2966
2971
|
const intl = useIntl6();
|
|
2967
2972
|
const { events } = useMatch();
|
|
2968
|
-
const [APIPassphrase, setAPIPassphrase] =
|
|
2973
|
+
const [APIPassphrase, setAPIPassphrase] = useState17("");
|
|
2969
2974
|
const { refreshOverview } = useUserInfo();
|
|
2970
|
-
const [loading, setLoading] =
|
|
2971
|
-
const [key, setKey] =
|
|
2972
|
-
const [secret, setSecret] =
|
|
2973
|
-
const [error, setError] =
|
|
2975
|
+
const [loading, setLoading] = useState17(false);
|
|
2976
|
+
const [key, setKey] = useState17("");
|
|
2977
|
+
const [secret, setSecret] = useState17("");
|
|
2978
|
+
const [error, setError] = useState17("");
|
|
2974
2979
|
const needPassphrase = useMemo7(() => {
|
|
2975
2980
|
return ["bitget", "okx"].includes(type.toLowerCase());
|
|
2976
2981
|
}, [type]);
|
|
2977
|
-
|
|
2982
|
+
useEffect15(() => {
|
|
2978
2983
|
if (isOpen) {
|
|
2979
2984
|
setSecret("");
|
|
2980
2985
|
setKey("");
|
|
@@ -3174,7 +3179,7 @@ var Providers = ({ children }) => {
|
|
|
3174
3179
|
var context_default = Providers;
|
|
3175
3180
|
|
|
3176
3181
|
// src/hooks/useWalletInit.ts
|
|
3177
|
-
import { useEffect as
|
|
3182
|
+
import { useEffect as useEffect16, useRef as useRef2 } from "react";
|
|
3178
3183
|
|
|
3179
3184
|
// src/utils/wallet.ts
|
|
3180
3185
|
var sendMessage = ({ method, data, resolve, reject, timeout }) => {
|
|
@@ -3208,10 +3213,10 @@ function useWalletInit({
|
|
|
3208
3213
|
const { endpoints, token, setWallet, appid, refreshOverview } = useLocalStore_default();
|
|
3209
3214
|
const { setWalletReady, walletReady } = useStore_default();
|
|
3210
3215
|
const iframeReadyRef = useRef2(walletReady);
|
|
3211
|
-
|
|
3216
|
+
useEffect16(() => {
|
|
3212
3217
|
setWallet(config);
|
|
3213
3218
|
}, [config]);
|
|
3214
|
-
|
|
3219
|
+
useEffect16(() => {
|
|
3215
3220
|
matchlog_default.log("sdk.mpc.status", walletReady, iframeReadyRef.current);
|
|
3216
3221
|
iframeReadyRef.current = walletReady;
|
|
3217
3222
|
if (iframeReadyRef.current) {
|
|
@@ -3228,7 +3233,7 @@ function useWalletInit({
|
|
|
3228
3233
|
onReady();
|
|
3229
3234
|
}
|
|
3230
3235
|
}, [walletReady]);
|
|
3231
|
-
|
|
3236
|
+
useEffect16(() => {
|
|
3232
3237
|
if (!endpoints.auth || !appid || !token || !config) {
|
|
3233
3238
|
const existingIframe = getWalletIframe();
|
|
3234
3239
|
if (existingIframe) {
|
|
@@ -3328,7 +3333,7 @@ function useWalletInit({
|
|
|
3328
3333
|
}
|
|
3329
3334
|
}
|
|
3330
3335
|
}, [endpoints.auth, appid, token, config]);
|
|
3331
|
-
|
|
3336
|
+
useEffect16(() => {
|
|
3332
3337
|
const messageHandle = async (e) => {
|
|
3333
3338
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
3334
3339
|
return;
|
|
@@ -3409,7 +3414,7 @@ function useWalletInit({
|
|
|
3409
3414
|
}
|
|
3410
3415
|
|
|
3411
3416
|
// src/hooks/useInit.tsx
|
|
3412
|
-
import { useEffect as
|
|
3417
|
+
import { useEffect as useEffect17, useRef as useRef3 } from "react";
|
|
3413
3418
|
function useInit({
|
|
3414
3419
|
theme,
|
|
3415
3420
|
appid,
|
|
@@ -3434,19 +3439,19 @@ function useInit({
|
|
|
3434
3439
|
const matchToken = searchParams.get("matchToken");
|
|
3435
3440
|
const matchidt = searchParams.get("matchidt");
|
|
3436
3441
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
3437
|
-
|
|
3442
|
+
useEffect17(() => {
|
|
3438
3443
|
setTheme(theme);
|
|
3439
3444
|
}, [theme]);
|
|
3440
|
-
|
|
3445
|
+
useEffect17(() => {
|
|
3441
3446
|
setAppid(appid);
|
|
3442
3447
|
}, [appid]);
|
|
3443
|
-
|
|
3448
|
+
useEffect17(() => {
|
|
3444
3449
|
setEndpoints(realEndpoints);
|
|
3445
3450
|
}, [realEndpoints]);
|
|
3446
|
-
|
|
3451
|
+
useEffect17(() => {
|
|
3447
3452
|
setLocale(locale || "en");
|
|
3448
3453
|
}, [locale]);
|
|
3449
|
-
|
|
3454
|
+
useEffect17(() => {
|
|
3450
3455
|
if (matchToken) {
|
|
3451
3456
|
const tokenData = JSON.parse(atob(matchToken));
|
|
3452
3457
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -3457,7 +3462,7 @@ function useInit({
|
|
|
3457
3462
|
}
|
|
3458
3463
|
}
|
|
3459
3464
|
}, [matchToken]);
|
|
3460
|
-
|
|
3465
|
+
useEffect17(() => {
|
|
3461
3466
|
if (matchidt) {
|
|
3462
3467
|
const tokenData = decodeURIComponent(matchidt);
|
|
3463
3468
|
const data = JSON.parse(decodeBase64(tokenData));
|
|
@@ -3487,7 +3492,7 @@ function useInit({
|
|
|
3487
3492
|
}
|
|
3488
3493
|
}
|
|
3489
3494
|
}, [matchidt]);
|
|
3490
|
-
|
|
3495
|
+
useEffect17(() => {
|
|
3491
3496
|
const onLoginMessage = (event) => {
|
|
3492
3497
|
const res = event.data;
|
|
3493
3498
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -3524,7 +3529,7 @@ function useInit({
|
|
|
3524
3529
|
overviewLoadingRef.current = false;
|
|
3525
3530
|
}
|
|
3526
3531
|
};
|
|
3527
|
-
|
|
3532
|
+
useEffect17(() => {
|
|
3528
3533
|
if (token) {
|
|
3529
3534
|
loadOverview();
|
|
3530
3535
|
}
|
|
@@ -4733,18 +4738,18 @@ function useUserInfo() {
|
|
|
4733
4738
|
}
|
|
4734
4739
|
|
|
4735
4740
|
// src/components/EmailModal/StepVerify.tsx
|
|
4736
|
-
import { useEffect as
|
|
4741
|
+
import { useEffect as useEffect19, useMemo as useMemo9, useRef as useRef4, useState as useState19 } from "react";
|
|
4737
4742
|
import { FormattedMessage as FormattedMessage6, useIntl as useIntl7 } from "react-intl";
|
|
4738
4743
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4739
4744
|
function StepVerify(props) {
|
|
4740
4745
|
const intl = useIntl7();
|
|
4741
4746
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
4742
|
-
const [error, setError] =
|
|
4743
|
-
const [code, setCode] =
|
|
4744
|
-
const [sending, setSending] =
|
|
4745
|
-
const [submitting, setSubmitting] =
|
|
4747
|
+
const [error, setError] = useState19("");
|
|
4748
|
+
const [code, setCode] = useState19("");
|
|
4749
|
+
const [sending, setSending] = useState19(false);
|
|
4750
|
+
const [submitting, setSubmitting] = useState19(false);
|
|
4746
4751
|
const sendTimeRef = useRef4(0);
|
|
4747
|
-
const [sendBtnText, setSendBtnText] =
|
|
4752
|
+
const [sendBtnText, setSendBtnText] = useState19(intl.formatMessage({
|
|
4748
4753
|
id: "send"
|
|
4749
4754
|
}));
|
|
4750
4755
|
const intervalTime = EMAIL_INTERVAL;
|
|
@@ -4780,7 +4785,7 @@ function StepVerify(props) {
|
|
|
4780
4785
|
setSending(false);
|
|
4781
4786
|
}
|
|
4782
4787
|
};
|
|
4783
|
-
|
|
4788
|
+
useEffect19(() => {
|
|
4784
4789
|
onSend();
|
|
4785
4790
|
return () => {
|
|
4786
4791
|
if (intervalRef.current) {
|
|
@@ -4865,10 +4870,10 @@ function EmailModal({
|
|
|
4865
4870
|
onBack,
|
|
4866
4871
|
onLogin
|
|
4867
4872
|
}) {
|
|
4868
|
-
const [step, setStep] =
|
|
4869
|
-
const [emailVal, setEmailVal] =
|
|
4873
|
+
const [step, setStep] = useState20("input");
|
|
4874
|
+
const [emailVal, setEmailVal] = useState20("");
|
|
4870
4875
|
const intl = useIntl8();
|
|
4871
|
-
|
|
4876
|
+
useEffect20(() => {
|
|
4872
4877
|
if (!isOpen) {
|
|
4873
4878
|
setStep("input");
|
|
4874
4879
|
setEmailVal("");
|
|
@@ -4893,7 +4898,7 @@ function EmailModal({
|
|
|
4893
4898
|
}
|
|
4894
4899
|
|
|
4895
4900
|
// src/components/LoginBox/index.tsx
|
|
4896
|
-
import { useMemo as useMemo10, useState as
|
|
4901
|
+
import { useMemo as useMemo10, useState as useState21 } from "react";
|
|
4897
4902
|
import { FormattedMessage as FormattedMessage7, useIntl as useIntl9 } from "react-intl";
|
|
4898
4903
|
|
|
4899
4904
|
// src/hooks/useAppConfig.ts
|
|
@@ -5006,9 +5011,9 @@ function LoginBox({
|
|
|
5006
5011
|
walletMethods: walletMethodList
|
|
5007
5012
|
};
|
|
5008
5013
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
5009
|
-
const [emailOpen, setEmailOpen] =
|
|
5014
|
+
const [emailOpen, setEmailOpen] = useState21(false);
|
|
5010
5015
|
const { login } = useUserInfo();
|
|
5011
|
-
const [showWallet, setShowWallet] =
|
|
5016
|
+
const [showWallet, setShowWallet] = useState21(false);
|
|
5012
5017
|
const intl = useIntl9();
|
|
5013
5018
|
const isDownMd = useDownMd();
|
|
5014
5019
|
const methodMap = {
|
|
@@ -5156,7 +5161,7 @@ function LoginBox({
|
|
|
5156
5161
|
}
|
|
5157
5162
|
|
|
5158
5163
|
// src/components/LoginButton/index.tsx
|
|
5159
|
-
import { useState as
|
|
5164
|
+
import { useState as useState23 } from "react";
|
|
5160
5165
|
|
|
5161
5166
|
// src/components/LoginPanel/index.tsx
|
|
5162
5167
|
import { FormattedMessage as FormattedMessage8 } from "react-intl";
|
|
@@ -5199,7 +5204,7 @@ function LoginModal({
|
|
|
5199
5204
|
}
|
|
5200
5205
|
|
|
5201
5206
|
// src/components/UserPopover/index.tsx
|
|
5202
|
-
import { useState as
|
|
5207
|
+
import { useState as useState22 } from "react";
|
|
5203
5208
|
|
|
5204
5209
|
// src/assets/icon/ProfileIcon.tsx
|
|
5205
5210
|
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -5231,7 +5236,7 @@ import { FormattedMessage as FormattedMessage9, useIntl as useIntl10 } from "rea
|
|
|
5231
5236
|
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5232
5237
|
function UserContent() {
|
|
5233
5238
|
const { logout, address, username } = useUserInfo();
|
|
5234
|
-
const [logouting, setLogouting] =
|
|
5239
|
+
const [logouting, setLogouting] = useState22(false);
|
|
5235
5240
|
const onLogout = async () => {
|
|
5236
5241
|
if (logouting) return;
|
|
5237
5242
|
try {
|
|
@@ -5260,7 +5265,7 @@ function UserContent() {
|
|
|
5260
5265
|
const UserDivider = () => {
|
|
5261
5266
|
return /* @__PURE__ */ jsx34("div", { className: `matchid-user-popover-divider` });
|
|
5262
5267
|
};
|
|
5263
|
-
const [usernameOpen, setUsernameOpen] =
|
|
5268
|
+
const [usernameOpen, setUsernameOpen] = useState22(false);
|
|
5264
5269
|
const [copied, setCopied] = useCopyClipboard();
|
|
5265
5270
|
const intl = useIntl10();
|
|
5266
5271
|
return /* @__PURE__ */ jsxs19("div", { className: "matchid-user-popover-content", children: [
|
|
@@ -5306,7 +5311,7 @@ function LoginButton({
|
|
|
5306
5311
|
}) {
|
|
5307
5312
|
const intl = useIntl11();
|
|
5308
5313
|
const { isLogin, username } = useUserInfo();
|
|
5309
|
-
const [loginOpen, setLoginOpen] =
|
|
5314
|
+
const [loginOpen, setLoginOpen] = useState23(false);
|
|
5310
5315
|
if (!isLogin) {
|
|
5311
5316
|
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
5312
5317
|
/* @__PURE__ */ jsx35(
|
|
@@ -5334,7 +5339,7 @@ function LoginButton({
|
|
|
5334
5339
|
}
|
|
5335
5340
|
|
|
5336
5341
|
// src/components/UsernameModal/index.tsx
|
|
5337
|
-
import { useEffect as
|
|
5342
|
+
import { useEffect as useEffect21, useMemo as useMemo11, useState as useState24 } from "react";
|
|
5338
5343
|
import { FormattedMessage as FormattedMessage11, useIntl as useIntl12 } from "react-intl";
|
|
5339
5344
|
import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5340
5345
|
var ValidItem = ({
|
|
@@ -5355,10 +5360,10 @@ function UsernameModal({
|
|
|
5355
5360
|
}) {
|
|
5356
5361
|
const { username, refreshOverview } = useUserInfo();
|
|
5357
5362
|
const { isLogin } = useUserInfo();
|
|
5358
|
-
const [val, setVal] =
|
|
5359
|
-
const [error, setError] =
|
|
5363
|
+
const [val, setVal] = useState24(username);
|
|
5364
|
+
const [error, setError] = useState24("");
|
|
5360
5365
|
const isDownMd = useDownMd();
|
|
5361
|
-
|
|
5366
|
+
useEffect21(() => {
|
|
5362
5367
|
if (isOpen) {
|
|
5363
5368
|
setVal(username);
|
|
5364
5369
|
setError("");
|
|
@@ -5371,7 +5376,7 @@ function UsernameModal({
|
|
|
5371
5376
|
return val.length >= 2 && val.length <= 32;
|
|
5372
5377
|
}, [val]);
|
|
5373
5378
|
const isSafe = isValid && isLength;
|
|
5374
|
-
const [isSubmitting, setIsSubmitting] =
|
|
5379
|
+
const [isSubmitting, setIsSubmitting] = useState24(false);
|
|
5375
5380
|
const onSubmit = async () => {
|
|
5376
5381
|
if (isSubmitting) return;
|
|
5377
5382
|
try {
|
|
@@ -5434,11 +5439,11 @@ function UsernameModal({
|
|
|
5434
5439
|
}
|
|
5435
5440
|
|
|
5436
5441
|
// src/components/EVMModal/index.tsx
|
|
5437
|
-
import { useCallback as useCallback6, useEffect as
|
|
5442
|
+
import { useCallback as useCallback6, useEffect as useEffect23, useState as useState27 } from "react";
|
|
5438
5443
|
import { useIntl as useIntl13 } from "react-intl";
|
|
5439
5444
|
|
|
5440
5445
|
// src/components/WalletModalContent/index.tsx
|
|
5441
|
-
import { useMemo as useMemo12, useState as
|
|
5446
|
+
import { useMemo as useMemo12, useState as useState25 } from "react";
|
|
5442
5447
|
|
|
5443
5448
|
// src/assets/wallet.ts
|
|
5444
5449
|
var walletErrorImage = error_default;
|
|
@@ -5520,7 +5525,7 @@ function WalletModalContent({
|
|
|
5520
5525
|
}, [visible, connected, status, error, address]);
|
|
5521
5526
|
return /* @__PURE__ */ jsx37("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5522
5527
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5523
|
-
/* @__PURE__ */ jsx37(
|
|
5528
|
+
/* @__PURE__ */ jsx37(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5524
5529
|
width: 128,
|
|
5525
5530
|
height: 128
|
|
5526
5531
|
} }),
|
|
@@ -5540,7 +5545,7 @@ function WalletModalContent({
|
|
|
5540
5545
|
] }) });
|
|
5541
5546
|
}
|
|
5542
5547
|
function WalletModalContentV2(props) {
|
|
5543
|
-
const [submitting, setSubmitting] =
|
|
5548
|
+
const [submitting, setSubmitting] = useState25(false);
|
|
5544
5549
|
const pageData = useMemo12(() => {
|
|
5545
5550
|
const { status } = props;
|
|
5546
5551
|
if (status == "success") {
|
|
@@ -5604,7 +5609,7 @@ function WalletModalContentV2(props) {
|
|
|
5604
5609
|
}, [props, submitting]);
|
|
5605
5610
|
return /* @__PURE__ */ jsx37("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-box`, children: [
|
|
5606
5611
|
/* @__PURE__ */ jsxs22("div", { className: `matchid-wallet-content`, children: [
|
|
5607
|
-
/* @__PURE__ */ jsx37(
|
|
5612
|
+
/* @__PURE__ */ jsx37(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
5608
5613
|
width: 128,
|
|
5609
5614
|
height: 128
|
|
5610
5615
|
} }),
|
|
@@ -5629,14 +5634,14 @@ import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
|
5629
5634
|
import { useAccount, useChainId, useConfig, useDisconnect } from "wagmi";
|
|
5630
5635
|
|
|
5631
5636
|
// src/hooks/useWalletBox.ts
|
|
5632
|
-
import { useEffect as
|
|
5637
|
+
import { useEffect as useEffect22, useRef as useRef5, useState as useState26 } from "react";
|
|
5633
5638
|
function useWalletBox({
|
|
5634
5639
|
onInit
|
|
5635
5640
|
}) {
|
|
5636
|
-
const [status, setStateStatus] =
|
|
5637
|
-
const [error, setError] =
|
|
5641
|
+
const [status, setStateStatus] = useState26("start");
|
|
5642
|
+
const [error, setError] = useState26("");
|
|
5638
5643
|
const statusRef = useRef5(status);
|
|
5639
|
-
const [nonce, setNonce] =
|
|
5644
|
+
const [nonce, setNonce] = useState26();
|
|
5640
5645
|
const setStatus = (status2) => {
|
|
5641
5646
|
statusRef.current = status2;
|
|
5642
5647
|
setStateStatus(status2);
|
|
@@ -5645,7 +5650,7 @@ function useWalletBox({
|
|
|
5645
5650
|
setError("");
|
|
5646
5651
|
setNonce(null);
|
|
5647
5652
|
};
|
|
5648
|
-
|
|
5653
|
+
useEffect22(() => {
|
|
5649
5654
|
init();
|
|
5650
5655
|
onInit({
|
|
5651
5656
|
setStatus
|
|
@@ -5674,7 +5679,7 @@ import { useWalletClient } from "wagmi";
|
|
|
5674
5679
|
import { providers } from "ethers";
|
|
5675
5680
|
|
|
5676
5681
|
// node_modules/@wagmi/core/dist/esm/version.js
|
|
5677
|
-
var version = "2.16.
|
|
5682
|
+
var version = "2.16.5";
|
|
5678
5683
|
|
|
5679
5684
|
// node_modules/@wagmi/core/dist/esm/utils/getVersion.js
|
|
5680
5685
|
var getVersion2 = () => `@wagmi/core@${version}`;
|
|
@@ -5825,7 +5830,11 @@ async function getConnectorClient(config, parameters = {}) {
|
|
|
5825
5830
|
if (config.state.status === "reconnecting" && !connector2.getAccounts && !connector2.getChainId)
|
|
5826
5831
|
throw new ConnectorUnavailableReconnectingError({ connector: connector2 });
|
|
5827
5832
|
const [accounts, chainId2] = await Promise.all([
|
|
5828
|
-
connector2.getAccounts()
|
|
5833
|
+
connector2.getAccounts().catch((e) => {
|
|
5834
|
+
if (parameters.account === null)
|
|
5835
|
+
return [];
|
|
5836
|
+
throw e;
|
|
5837
|
+
}),
|
|
5829
5838
|
connector2.getChainId()
|
|
5830
5839
|
]);
|
|
5831
5840
|
connection = {
|
|
@@ -5848,7 +5857,8 @@ async function getConnectorClient(config, parameters = {}) {
|
|
|
5848
5857
|
if (connector.getClient)
|
|
5849
5858
|
return connector.getClient({ chainId });
|
|
5850
5859
|
const account = parseAccount(parameters.account ?? connection.accounts[0]);
|
|
5851
|
-
|
|
5860
|
+
if (account)
|
|
5861
|
+
account.address = getAddress(account.address);
|
|
5852
5862
|
if (parameters.account && !connection.accounts.some((x) => x.toLowerCase() === account.address.toLowerCase()))
|
|
5853
5863
|
throw new ConnectorAccountNotFoundError({
|
|
5854
5864
|
address: account.address,
|
|
@@ -5898,16 +5908,16 @@ function WalletContent({
|
|
|
5898
5908
|
const { disconnectAsync } = useDisconnect({ config });
|
|
5899
5909
|
const chainId = useChainId();
|
|
5900
5910
|
const { events, login } = useMatch();
|
|
5901
|
-
const [inited, setInited] =
|
|
5911
|
+
const [inited, setInited] = useState27(false);
|
|
5902
5912
|
const { status, setStatus, error, setError, statusRef, nonce, setNonce, init } = useWalletBox({
|
|
5903
5913
|
onInit: async ({ setStatus: setStatus2 }) => {
|
|
5904
5914
|
setStatus2("start");
|
|
5905
5915
|
}
|
|
5906
5916
|
});
|
|
5907
|
-
|
|
5917
|
+
useEffect23(() => {
|
|
5908
5918
|
matchlog_default.log(`status=${status}`, `connectModalOpen=${connectModalOpen}`, `address=${address}`, `isConnected=${isConnected}`);
|
|
5909
5919
|
}, [status, connectModalOpen, isConnected, address]);
|
|
5910
|
-
|
|
5920
|
+
useEffect23(() => {
|
|
5911
5921
|
if (connectModalOpen) {
|
|
5912
5922
|
setStatus("connecting");
|
|
5913
5923
|
return;
|
|
@@ -5920,7 +5930,7 @@ function WalletContent({
|
|
|
5920
5930
|
setStatus("start");
|
|
5921
5931
|
}
|
|
5922
5932
|
}, [connectModalOpen, address]);
|
|
5923
|
-
|
|
5933
|
+
useEffect23(() => {
|
|
5924
5934
|
if (openConnectModal && !isConnected && !inited) {
|
|
5925
5935
|
openConnectModal && openConnectModal();
|
|
5926
5936
|
setInited(true);
|
|
@@ -6003,7 +6013,7 @@ function WalletContent({
|
|
|
6003
6013
|
setError(error2.reason || error2.message);
|
|
6004
6014
|
}
|
|
6005
6015
|
}, [nonce, status, address]);
|
|
6006
|
-
|
|
6016
|
+
useEffect23(() => {
|
|
6007
6017
|
if (signature) {
|
|
6008
6018
|
signature();
|
|
6009
6019
|
}
|
|
@@ -6074,7 +6084,7 @@ function EVMModal(props) {
|
|
|
6074
6084
|
}
|
|
6075
6085
|
|
|
6076
6086
|
// src/components/TRONModal/index.tsx
|
|
6077
|
-
import React11, { useEffect as
|
|
6087
|
+
import React11, { useEffect as useEffect25, useMemo as useMemo14, useState as useState29 } from "react";
|
|
6078
6088
|
import { useIntl as useIntl14 } from "react-intl";
|
|
6079
6089
|
|
|
6080
6090
|
// src/lib/tron/TronLinkAdapter.ts
|
|
@@ -6108,7 +6118,7 @@ var TronLinkAdapter = class {
|
|
|
6108
6118
|
};
|
|
6109
6119
|
|
|
6110
6120
|
// src/hooks/useTRONWallet.ts
|
|
6111
|
-
import { useEffect as
|
|
6121
|
+
import { useEffect as useEffect24, useState as useState28 } from "react";
|
|
6112
6122
|
|
|
6113
6123
|
// src/lib/tron/BitgetAdapter.ts
|
|
6114
6124
|
var BitgetAdapter = class {
|
|
@@ -6153,9 +6163,9 @@ var OKXAdapter = class {
|
|
|
6153
6163
|
// src/hooks/useTRONWallet.ts
|
|
6154
6164
|
var useTRONWallet = () => {
|
|
6155
6165
|
const wallets = [new TronLinkAdapter(), new BitgetAdapter(), new OKXAdapter()];
|
|
6156
|
-
const [installedWallets, setInstalledWallets] =
|
|
6157
|
-
const [address, setAddress] =
|
|
6158
|
-
|
|
6166
|
+
const [installedWallets, setInstalledWallets] = useState28([]);
|
|
6167
|
+
const [address, setAddress] = useState28(null);
|
|
6168
|
+
useEffect24(() => {
|
|
6159
6169
|
const getInstalled = async () => {
|
|
6160
6170
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6161
6171
|
wallet: wallet2,
|
|
@@ -6165,11 +6175,11 @@ var useTRONWallet = () => {
|
|
|
6165
6175
|
};
|
|
6166
6176
|
getInstalled();
|
|
6167
6177
|
}, []);
|
|
6168
|
-
const [wallet, chooseWallet] =
|
|
6178
|
+
const [wallet, chooseWallet] = useState28(null);
|
|
6169
6179
|
const onConnect = async () => {
|
|
6170
6180
|
setAddress(await wallet.connect());
|
|
6171
6181
|
};
|
|
6172
|
-
|
|
6182
|
+
useEffect24(() => {
|
|
6173
6183
|
if (!wallet) {
|
|
6174
6184
|
setAddress(null);
|
|
6175
6185
|
}
|
|
@@ -6200,9 +6210,9 @@ function TRONConnectModal({
|
|
|
6200
6210
|
okx: /* @__PURE__ */ jsx39(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
6201
6211
|
};
|
|
6202
6212
|
const { events, login } = useMatch();
|
|
6203
|
-
const [status, setStatus] =
|
|
6213
|
+
const [status, setStatus] = useState29("");
|
|
6204
6214
|
const statusRef = React11.useRef(status);
|
|
6205
|
-
const [error, setError] =
|
|
6215
|
+
const [error, setError] = useState29("");
|
|
6206
6216
|
const connected = useMemo14(() => {
|
|
6207
6217
|
return !!address;
|
|
6208
6218
|
}, [address]);
|
|
@@ -6271,7 +6281,7 @@ function TRONConnectModal({
|
|
|
6271
6281
|
statusRef.current = "";
|
|
6272
6282
|
}
|
|
6273
6283
|
};
|
|
6274
|
-
|
|
6284
|
+
useEffect25(() => {
|
|
6275
6285
|
if (wallet) {
|
|
6276
6286
|
console.log("onConnect");
|
|
6277
6287
|
onConnect();
|
|
@@ -6279,12 +6289,12 @@ function TRONConnectModal({
|
|
|
6279
6289
|
setStatus("");
|
|
6280
6290
|
}
|
|
6281
6291
|
}, [wallet]);
|
|
6282
|
-
|
|
6292
|
+
useEffect25(() => {
|
|
6283
6293
|
if (address) {
|
|
6284
6294
|
toLoginInWallet();
|
|
6285
6295
|
}
|
|
6286
6296
|
}, [address]);
|
|
6287
|
-
|
|
6297
|
+
useEffect25(() => {
|
|
6288
6298
|
if (!props.isOpen) {
|
|
6289
6299
|
disconnect();
|
|
6290
6300
|
}
|
|
@@ -6342,7 +6352,7 @@ function TRONModal(props) {
|
|
|
6342
6352
|
}
|
|
6343
6353
|
|
|
6344
6354
|
// src/components/TONModal/index.tsx
|
|
6345
|
-
import React12, { useEffect as
|
|
6355
|
+
import React12, { useEffect as useEffect26, useState as useState30 } from "react";
|
|
6346
6356
|
import { useIntl as useIntl15 } from "react-intl";
|
|
6347
6357
|
import {
|
|
6348
6358
|
TonConnectUIProvider,
|
|
@@ -6357,15 +6367,15 @@ function WalletContent2({
|
|
|
6357
6367
|
type
|
|
6358
6368
|
}) {
|
|
6359
6369
|
const { events, login } = useMatch();
|
|
6360
|
-
const [connected, setConnected] =
|
|
6370
|
+
const [connected, setConnected] = useState30(false);
|
|
6361
6371
|
const wallet = useTonWallet();
|
|
6362
6372
|
const userFriendlyAddress = useTonAddress();
|
|
6363
6373
|
const [tonConnectUI] = useTonConnectUI();
|
|
6364
6374
|
const { state, open, close } = useTonConnectModal();
|
|
6365
|
-
const [status, setStatus] =
|
|
6375
|
+
const [status, setStatus] = useState30("");
|
|
6366
6376
|
const statusRef = React12.useRef(status);
|
|
6367
|
-
const [error, setError] =
|
|
6368
|
-
|
|
6377
|
+
const [error, setError] = useState30("");
|
|
6378
|
+
useEffect26(() => {
|
|
6369
6379
|
const init = async () => {
|
|
6370
6380
|
if (tonConnectUI.connected) {
|
|
6371
6381
|
await tonConnectUI.disconnect();
|
|
@@ -6438,7 +6448,7 @@ function WalletContent2({
|
|
|
6438
6448
|
}
|
|
6439
6449
|
});
|
|
6440
6450
|
}, []);
|
|
6441
|
-
|
|
6451
|
+
useEffect26(() => {
|
|
6442
6452
|
if (wallet) {
|
|
6443
6453
|
setConnected(true);
|
|
6444
6454
|
console.log("Wallet connected:", wallet);
|
|
@@ -6449,7 +6459,7 @@ function WalletContent2({
|
|
|
6449
6459
|
setStatus("");
|
|
6450
6460
|
}
|
|
6451
6461
|
}, [wallet]);
|
|
6452
|
-
|
|
6462
|
+
useEffect26(() => {
|
|
6453
6463
|
console.log({
|
|
6454
6464
|
state,
|
|
6455
6465
|
wallet
|
|
@@ -6529,7 +6539,7 @@ function TONModal(props) {
|
|
|
6529
6539
|
}
|
|
6530
6540
|
|
|
6531
6541
|
// src/components/BTCModal/index.tsx
|
|
6532
|
-
import React13, { useEffect as
|
|
6542
|
+
import React13, { useEffect as useEffect28, useMemo as useMemo15, useState as useState32 } from "react";
|
|
6533
6543
|
import { useIntl as useIntl16 } from "react-intl";
|
|
6534
6544
|
|
|
6535
6545
|
// src/lib/btc/UnisatAdapter.ts
|
|
@@ -6684,7 +6694,7 @@ var LeatherAdapter = class {
|
|
|
6684
6694
|
};
|
|
6685
6695
|
|
|
6686
6696
|
// src/hooks/useBTCWallet.ts
|
|
6687
|
-
import { useEffect as
|
|
6697
|
+
import { useEffect as useEffect27, useState as useState31 } from "react";
|
|
6688
6698
|
|
|
6689
6699
|
// src/lib/btc/PhantomAdapter.ts
|
|
6690
6700
|
var PhantomAdapter = class {
|
|
@@ -6722,9 +6732,9 @@ var PhantomAdapter = class {
|
|
|
6722
6732
|
// src/hooks/useBTCWallet.ts
|
|
6723
6733
|
var useBTCWallet = () => {
|
|
6724
6734
|
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter(), new PhantomAdapter()];
|
|
6725
|
-
const [installedWallets, setInstalledWallets] =
|
|
6726
|
-
const [address, setAddress] =
|
|
6727
|
-
|
|
6735
|
+
const [installedWallets, setInstalledWallets] = useState31([]);
|
|
6736
|
+
const [address, setAddress] = useState31(null);
|
|
6737
|
+
useEffect27(() => {
|
|
6728
6738
|
const getInstalled = async () => {
|
|
6729
6739
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
6730
6740
|
wallet: wallet2,
|
|
@@ -6734,11 +6744,11 @@ var useBTCWallet = () => {
|
|
|
6734
6744
|
};
|
|
6735
6745
|
getInstalled();
|
|
6736
6746
|
}, []);
|
|
6737
|
-
const [wallet, chooseWallet] =
|
|
6747
|
+
const [wallet, chooseWallet] = useState31(null);
|
|
6738
6748
|
const onConnect = async () => {
|
|
6739
6749
|
setAddress(await wallet.connect());
|
|
6740
6750
|
};
|
|
6741
|
-
|
|
6751
|
+
useEffect27(() => {
|
|
6742
6752
|
if (!wallet) {
|
|
6743
6753
|
setAddress(null);
|
|
6744
6754
|
}
|
|
@@ -6770,9 +6780,9 @@ function BTCConnectModal({
|
|
|
6770
6780
|
phantom: /* @__PURE__ */ jsx41(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
6771
6781
|
};
|
|
6772
6782
|
const { events, login } = useMatch();
|
|
6773
|
-
const [status, setStatus] =
|
|
6783
|
+
const [status, setStatus] = useState32("");
|
|
6774
6784
|
const statusRef = React13.useRef(status);
|
|
6775
|
-
const [error, setError] =
|
|
6785
|
+
const [error, setError] = useState32("");
|
|
6776
6786
|
const connected = useMemo15(() => {
|
|
6777
6787
|
return !!address;
|
|
6778
6788
|
}, [address]);
|
|
@@ -6837,7 +6847,7 @@ function BTCConnectModal({
|
|
|
6837
6847
|
statusRef.current = "";
|
|
6838
6848
|
}
|
|
6839
6849
|
};
|
|
6840
|
-
|
|
6850
|
+
useEffect28(() => {
|
|
6841
6851
|
if (wallet) {
|
|
6842
6852
|
console.log("onConnect");
|
|
6843
6853
|
try {
|
|
@@ -6850,12 +6860,12 @@ function BTCConnectModal({
|
|
|
6850
6860
|
setStatus("");
|
|
6851
6861
|
}
|
|
6852
6862
|
}, [wallet]);
|
|
6853
|
-
|
|
6863
|
+
useEffect28(() => {
|
|
6854
6864
|
if (address) {
|
|
6855
6865
|
toLoginInWallet();
|
|
6856
6866
|
}
|
|
6857
6867
|
}, [address]);
|
|
6858
|
-
|
|
6868
|
+
useEffect28(() => {
|
|
6859
6869
|
if (!props.isOpen) {
|
|
6860
6870
|
disconnect();
|
|
6861
6871
|
}
|
|
@@ -6964,11 +6974,11 @@ function WalletModal(props) {
|
|
|
6964
6974
|
}
|
|
6965
6975
|
|
|
6966
6976
|
// src/components/AlphaAvatar/index.tsx
|
|
6967
|
-
import { useEffect as
|
|
6977
|
+
import { useEffect as useEffect29, useState as useState33 } from "react";
|
|
6968
6978
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6969
6979
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
6970
|
-
const [avatar, setAvatar] =
|
|
6971
|
-
|
|
6980
|
+
const [avatar, setAvatar] = useState33(void 0);
|
|
6981
|
+
useEffect29(() => {
|
|
6972
6982
|
if (name) {
|
|
6973
6983
|
const char = name[0].toUpperCase();
|
|
6974
6984
|
setAvatar(char);
|
|
@@ -7065,7 +7075,7 @@ function WalletAsset({
|
|
|
7065
7075
|
}
|
|
7066
7076
|
|
|
7067
7077
|
// src/components/TokenSend/index.tsx
|
|
7068
|
-
import { useEffect as
|
|
7078
|
+
import { useEffect as useEffect30, useMemo as useMemo17, useState as useState34 } from "react";
|
|
7069
7079
|
import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, erc20Abi as erc20Abi3, http as http8, parseUnits as parseUnits2 } from "viem";
|
|
7070
7080
|
import { FormattedMessage as FormattedMessage12, useIntl as useIntl18 } from "react-intl";
|
|
7071
7081
|
import { jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -7113,11 +7123,11 @@ function TokenSend({
|
|
|
7113
7123
|
transport: http8()
|
|
7114
7124
|
});
|
|
7115
7125
|
}, [chain]);
|
|
7116
|
-
const [amount, setAmount] =
|
|
7117
|
-
const [address, setAddress] =
|
|
7118
|
-
const [loading, setLoading] =
|
|
7119
|
-
const [sending, setSending] =
|
|
7120
|
-
const [txError, setTxError] =
|
|
7126
|
+
const [amount, setAmount] = useState34("");
|
|
7127
|
+
const [address, setAddress] = useState34("");
|
|
7128
|
+
const [loading, setLoading] = useState34(false);
|
|
7129
|
+
const [sending, setSending] = useState34(false);
|
|
7130
|
+
const [txError, setTxError] = useState34("");
|
|
7121
7131
|
const transaction = useMemo17(() => {
|
|
7122
7132
|
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
7123
7133
|
if (!amount || !address || !reg.test(address)) {
|
|
@@ -7202,7 +7212,7 @@ function TokenSend({
|
|
|
7202
7212
|
}
|
|
7203
7213
|
onClose();
|
|
7204
7214
|
};
|
|
7205
|
-
|
|
7215
|
+
useEffect30(() => {
|
|
7206
7216
|
const receiveMessage = (event) => {
|
|
7207
7217
|
if (event.data) {
|
|
7208
7218
|
if (event.data.source == "match-wallet") {
|
|
@@ -7334,7 +7344,7 @@ function TokenDetail({
|
|
|
7334
7344
|
}
|
|
7335
7345
|
|
|
7336
7346
|
// src/components/TokenSendList/index.tsx
|
|
7337
|
-
import { useState as
|
|
7347
|
+
import { useState as useState35 } from "react";
|
|
7338
7348
|
import { FormattedMessage as FormattedMessage14 } from "react-intl";
|
|
7339
7349
|
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7340
7350
|
function TokenSendList({ close }) {
|
|
@@ -7344,7 +7354,7 @@ function TokenSendList({ close }) {
|
|
|
7344
7354
|
list: walletAssets.mergedAssets
|
|
7345
7355
|
});
|
|
7346
7356
|
const { list } = useMatchChain();
|
|
7347
|
-
const [checked, setChecked] =
|
|
7357
|
+
const [checked, setChecked] = useState35();
|
|
7348
7358
|
const modal = useModal();
|
|
7349
7359
|
const onNext = () => {
|
|
7350
7360
|
checked && modal.show((props) => {
|
|
@@ -7401,7 +7411,7 @@ function TokenSendList({ close }) {
|
|
|
7401
7411
|
|
|
7402
7412
|
// src/components/TransactionList/index.tsx
|
|
7403
7413
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
7404
|
-
import { useEffect as
|
|
7414
|
+
import { useEffect as useEffect31, useMemo as useMemo18, useState as useState36 } from "react";
|
|
7405
7415
|
import { decodeFunctionData, defineChain as defineChain5, formatUnits as formatUnits3 } from "viem";
|
|
7406
7416
|
import { erc20Abi as erc20Abi4 } from "viem";
|
|
7407
7417
|
import { FormattedMessage as FormattedMessage15 } from "react-intl";
|
|
@@ -7411,7 +7421,7 @@ var Item = ({ data }) => {
|
|
|
7411
7421
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
7412
7422
|
const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
|
|
7413
7423
|
const { contracts } = useContractStore_default();
|
|
7414
|
-
const [shouldRefetch, setShouldRefetch] =
|
|
7424
|
+
const [shouldRefetch, setShouldRefetch] = useState36(true);
|
|
7415
7425
|
const transferType = useMemo18(() => {
|
|
7416
7426
|
const methodId = data.input.substring(2, 10);
|
|
7417
7427
|
if (methodId == "095ea7b3") {
|
|
@@ -7480,7 +7490,7 @@ var Item = ({ data }) => {
|
|
|
7480
7490
|
}
|
|
7481
7491
|
return "loading";
|
|
7482
7492
|
}, [data.extra?.status, data.source, hashQuery.data]);
|
|
7483
|
-
|
|
7493
|
+
useEffect31(() => {
|
|
7484
7494
|
if (data.hash) {
|
|
7485
7495
|
setShouldRefetch(status == "loading");
|
|
7486
7496
|
}
|
|
@@ -7590,7 +7600,7 @@ export {
|
|
|
7590
7600
|
Radio,
|
|
7591
7601
|
Skeleton_default,
|
|
7592
7602
|
Tabs,
|
|
7593
|
-
|
|
7603
|
+
Lottie_default,
|
|
7594
7604
|
ui_exports,
|
|
7595
7605
|
ModalProvider,
|
|
7596
7606
|
useModal,
|
|
@@ -7611,4 +7621,4 @@ export {
|
|
|
7611
7621
|
MatchProvider,
|
|
7612
7622
|
useMatch
|
|
7613
7623
|
};
|
|
7614
|
-
//# sourceMappingURL=chunk-
|
|
7624
|
+
//# sourceMappingURL=chunk-BB4OTBUS.mjs.map
|