@matchain/matchid-sdk-react 0.1.48-alpha.2 → 0.1.48-alpha.20
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/assets/icon/index.d.mts +12 -2
- package/dist/assets/icon/index.d.ts +12 -2
- package/dist/assets/icon/index.js +93 -2
- package/dist/assets/icon/index.js.map +1 -1
- package/dist/assets/icon/index.mjs +9 -1
- package/dist/{chunk-6HRRPZPM.mjs → chunk-3UVHHJP6.mjs} +2 -2
- package/dist/chunk-5JHHHLG4.mjs +136 -0
- package/dist/chunk-5JHHHLG4.mjs.map +1 -0
- package/dist/{chunk-A5D3NKTK.mjs → chunk-LHNKZISB.mjs} +91 -4
- package/dist/chunk-LHNKZISB.mjs.map +1 -0
- package/dist/{chunk-D6IUBR7S.mjs → chunk-WHZ3HI4R.mjs} +2197 -553
- package/dist/chunk-WHZ3HI4R.mjs.map +1 -0
- package/dist/{chunk-LNSJ3ZXG.mjs → chunk-WXPVHKGJ.mjs} +73 -42
- package/dist/chunk-WXPVHKGJ.mjs.map +1 -0
- package/dist/components/index.d.mts +4 -3
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.js +2283 -525
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +14 -3
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +375 -193
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +5 -4
- package/dist/hooks/index.d.mts +4 -2
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/index.js +1904 -227
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +12 -3
- package/dist/index-BMfaixEx.d.mts +66 -0
- package/dist/{index-DamklTOJ.d.mts → index-BMsj8hJv.d.ts} +4 -3
- package/dist/{index-CKiK4KHj.d.ts → index-BcEreCxd.d.ts} +1 -1
- package/dist/index-Bpmrd7mh.d.ts +66 -0
- package/dist/{index-CGs_yTFg.d.ts → index-Bvc8cjpN.d.ts} +34 -4
- package/dist/{index-C2-M-aBb.d.ts → index-C9F6f2iz.d.mts} +4 -3
- package/dist/{index-M7ZB3yR5.d.mts → index-C9qYyRgt.d.mts} +34 -4
- package/dist/index-CFKZWJVt.d.ts +3306 -0
- package/dist/{index-Bb7IkjUW.d.mts → index-Cou96DpL.d.mts} +1 -1
- package/dist/{index-BIgM4fy0.d.mts → index-Cy3K-Yao.d.ts} +31 -8
- package/dist/{index-BwD1ij0H.d.ts → index-D4ju2J_e.d.mts} +31 -8
- package/dist/index-Dhtyz0pT.d.mts +3306 -0
- package/dist/index.css +587 -6
- package/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +2855 -1015
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -10
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/{types-DQq17lf4.d.mts → types-DzVVzMYU.d.mts} +74 -36
- package/dist/{types-DQq17lf4.d.ts → types-DzVVzMYU.d.ts} +74 -36
- package/dist/ui/index.d.mts +4 -3
- package/dist/ui/index.d.ts +4 -3
- package/dist/ui/index.js +140 -95
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +2 -2
- package/dist/utils/index.d.mts +26 -0
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/index.js +181 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +30 -0
- package/dist/utils/index.mjs.map +1 -0
- package/example/src/pages/Wallet/components/MatchWallet.tsx +24 -10
- package/example/src/pages/Wallet/index.tsx +2 -1
- package/package.json +7 -1
- package/dist/chunk-A5D3NKTK.mjs.map +0 -1
- package/dist/chunk-D6IUBR7S.mjs.map +0 -1
- package/dist/chunk-LNSJ3ZXG.mjs.map +0 -1
- package/dist/index-BHVMQGZj.d.mts +0 -173
- package/dist/index-BVatQlwF.d.mts +0 -59
- package/dist/index-DgAnNnit.d.ts +0 -173
- package/dist/index-RfA22r-Z.d.ts +0 -59
- /package/dist/{chunk-6HRRPZPM.mjs.map → chunk-3UVHHJP6.mjs.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AlphaAvatar,
|
|
2
3
|
Button,
|
|
3
4
|
Field,
|
|
4
5
|
HashPanel_default,
|
|
@@ -11,11 +12,24 @@ import {
|
|
|
11
12
|
Radio,
|
|
12
13
|
matchlog_default,
|
|
13
14
|
useDownMd,
|
|
15
|
+
useHash,
|
|
14
16
|
useLayout_exports
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WXPVHKGJ.mjs";
|
|
18
|
+
import {
|
|
19
|
+
NumberFormatter,
|
|
20
|
+
encodeBase64,
|
|
21
|
+
formatAddress,
|
|
22
|
+
formatDate,
|
|
23
|
+
getAppClientId,
|
|
24
|
+
getVersion,
|
|
25
|
+
isValidEmail,
|
|
26
|
+
isValidUsername,
|
|
27
|
+
truncateAddress
|
|
28
|
+
} from "./chunk-5JHHHLG4.mjs";
|
|
16
29
|
import {
|
|
17
30
|
ArrowDownIcon,
|
|
18
31
|
ArrowRightIcon,
|
|
32
|
+
ArrowSendIcon,
|
|
19
33
|
BTCDarkIcon,
|
|
20
34
|
BTCLightIcon,
|
|
21
35
|
BitgetIcon,
|
|
@@ -32,8 +46,11 @@ import {
|
|
|
32
46
|
FacebookIcon,
|
|
33
47
|
GithubIcon,
|
|
34
48
|
GoogleIcon,
|
|
49
|
+
InfoLineIcon,
|
|
50
|
+
InfoRoundIcon,
|
|
35
51
|
LeatherIcon,
|
|
36
52
|
LinkedinIcon,
|
|
53
|
+
LoadingIcon_default,
|
|
37
54
|
LoginIcon_default,
|
|
38
55
|
OKXIcon,
|
|
39
56
|
SOLDarkIcon,
|
|
@@ -43,6 +60,7 @@ import {
|
|
|
43
60
|
TelegramIcon,
|
|
44
61
|
TonLightIcon,
|
|
45
62
|
TonLightIcon2,
|
|
63
|
+
TransferIcon,
|
|
46
64
|
TronLinkIcon,
|
|
47
65
|
UnLoginIcon_default,
|
|
48
66
|
UnisatIcon,
|
|
@@ -50,7 +68,7 @@ import {
|
|
|
50
68
|
XIcon,
|
|
51
69
|
XverseIcon,
|
|
52
70
|
YoutubeIcon
|
|
53
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-LHNKZISB.mjs";
|
|
54
72
|
import {
|
|
55
73
|
__export
|
|
56
74
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -74,42 +92,20 @@ __export(components_exports, {
|
|
|
74
92
|
SOLModal: () => SOLModal,
|
|
75
93
|
TONModal: () => TONModal,
|
|
76
94
|
TRONModal: () => TRONModal,
|
|
95
|
+
TokenDetail: () => TokenDetail,
|
|
96
|
+
TokenSend: () => TokenSend,
|
|
97
|
+
TokenSendList: () => TokenSendList,
|
|
98
|
+
TransactionList: () => TransactionList,
|
|
77
99
|
UsernameModal: () => UsernameModal,
|
|
100
|
+
WalletAsset: () => WalletAsset,
|
|
78
101
|
WalletModal: () => WalletModal
|
|
79
102
|
});
|
|
80
103
|
|
|
81
104
|
// src/components/EmailModal/index.tsx
|
|
82
|
-
import { useEffect as
|
|
105
|
+
import { useEffect as useEffect14, useState as useState13 } from "react";
|
|
83
106
|
|
|
84
107
|
// src/components/EmailModal/StepEmail.tsx
|
|
85
108
|
import { useEffect, useMemo, useState } from "react";
|
|
86
|
-
|
|
87
|
-
// src/utils/index.ts
|
|
88
|
-
var getVersion = () => {
|
|
89
|
-
return "0.0.2";
|
|
90
|
-
};
|
|
91
|
-
function encodeBase64(input) {
|
|
92
|
-
return btoa(unescape(encodeURIComponent(input)));
|
|
93
|
-
}
|
|
94
|
-
var isValidEmail = (email) => {
|
|
95
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
96
|
-
};
|
|
97
|
-
var isValidUsername = (username) => {
|
|
98
|
-
return /^[a-zA-Z0-9_-]+$/.test(username);
|
|
99
|
-
};
|
|
100
|
-
function truncateAddress(address2) {
|
|
101
|
-
if (address2.length <= 6) {
|
|
102
|
-
return address2;
|
|
103
|
-
}
|
|
104
|
-
const start = address2.slice(0, 4);
|
|
105
|
-
const end = address2.slice(-2);
|
|
106
|
-
return `${start}...${end}`;
|
|
107
|
-
}
|
|
108
|
-
function getAppClientId() {
|
|
109
|
-
return "react-sdk-" + getVersion();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// src/components/EmailModal/StepEmail.tsx
|
|
113
109
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
114
110
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
115
111
|
function StepEmail(props) {
|
|
@@ -370,11 +366,11 @@ var unBindApi = ({ type }) => {
|
|
|
370
366
|
data: { type }
|
|
371
367
|
});
|
|
372
368
|
};
|
|
373
|
-
var unBindWalletApi = ({ address
|
|
369
|
+
var unBindWalletApi = ({ address }) => {
|
|
374
370
|
return request_default({
|
|
375
371
|
url: `/api/v1/wallet/unbind`,
|
|
376
372
|
method: "POST",
|
|
377
|
-
data: { address
|
|
373
|
+
data: { address }
|
|
378
374
|
});
|
|
379
375
|
};
|
|
380
376
|
var verifyPohApi = ({
|
|
@@ -432,7 +428,7 @@ var getWalletNonceApi = (data) => {
|
|
|
432
428
|
};
|
|
433
429
|
var loginByWalletApi = ({
|
|
434
430
|
type,
|
|
435
|
-
address
|
|
431
|
+
address,
|
|
436
432
|
signature,
|
|
437
433
|
message,
|
|
438
434
|
connector_type,
|
|
@@ -441,7 +437,7 @@ var loginByWalletApi = ({
|
|
|
441
437
|
return request_default({
|
|
442
438
|
url: `/api/v1/login/wallet`,
|
|
443
439
|
method: "POST",
|
|
444
|
-
data: { type, address
|
|
440
|
+
data: { type, address, signature, message, connector_type, wallet_client_type }
|
|
445
441
|
});
|
|
446
442
|
};
|
|
447
443
|
var getWalletInitApi = (data) => {
|
|
@@ -453,7 +449,7 @@ var getWalletInitApi = (data) => {
|
|
|
453
449
|
};
|
|
454
450
|
var toBindWalletApi = ({
|
|
455
451
|
type,
|
|
456
|
-
address
|
|
452
|
+
address,
|
|
457
453
|
signature,
|
|
458
454
|
message,
|
|
459
455
|
connector_type,
|
|
@@ -462,7 +458,7 @@ var toBindWalletApi = ({
|
|
|
462
458
|
return request_default({
|
|
463
459
|
url: `/api/v1/wallet/bind`,
|
|
464
460
|
method: "POST",
|
|
465
|
-
data: { type, address
|
|
461
|
+
data: { type, address, signature, message, connector_type, wallet_client_type }
|
|
466
462
|
});
|
|
467
463
|
};
|
|
468
464
|
var getAppConfigApi = () => {
|
|
@@ -525,6 +521,13 @@ var getWalletChainListApi = () => {
|
|
|
525
521
|
method: "POST"
|
|
526
522
|
});
|
|
527
523
|
};
|
|
524
|
+
var getWalletNftListApi = (data) => {
|
|
525
|
+
return request_default({
|
|
526
|
+
url: `/api/v1/wallet/nfts`,
|
|
527
|
+
method: "POST",
|
|
528
|
+
data
|
|
529
|
+
});
|
|
530
|
+
};
|
|
528
531
|
|
|
529
532
|
// src/store/useLocalStore.ts
|
|
530
533
|
var persistedState = persist(
|
|
@@ -558,11 +561,11 @@ var persistedState = persist(
|
|
|
558
561
|
setToken: (token) => set({ token }),
|
|
559
562
|
setAppid: (appid) => set({ appid }),
|
|
560
563
|
setMid: (mid) => set({ mid }),
|
|
561
|
-
logout: () => set({ token: "", did: "", mid: "", address: "", overview: null }),
|
|
564
|
+
logout: () => set({ token: "", did: "", mid: "", address: "", overview: null, assets: [] }),
|
|
562
565
|
setTheme: (theme) => set({ theme }),
|
|
563
566
|
setEndpoints: (endpoints) => set({ endpoints }),
|
|
564
567
|
address: "",
|
|
565
|
-
setAddress: (
|
|
568
|
+
setAddress: (address) => set({ address }),
|
|
566
569
|
locale: "en",
|
|
567
570
|
setLocale: (locale) => set({ locale }),
|
|
568
571
|
wallet: {
|
|
@@ -570,7 +573,9 @@ var persistedState = persist(
|
|
|
570
573
|
},
|
|
571
574
|
setWallet: (wallet) => set({ wallet }),
|
|
572
575
|
chainId: 698,
|
|
573
|
-
setChainId: (chainId) => set({ chainId })
|
|
576
|
+
setChainId: (chainId) => set({ chainId }),
|
|
577
|
+
assets: [],
|
|
578
|
+
setAssets: (assets) => set({ assets })
|
|
574
579
|
}),
|
|
575
580
|
{ name: "match-local" }
|
|
576
581
|
);
|
|
@@ -592,9 +597,13 @@ __export(hooks_exports, {
|
|
|
592
597
|
useMatchChain: () => useMatchChain,
|
|
593
598
|
useMatchEvents: () => useMatchEvents,
|
|
594
599
|
useMatchWallet: () => useMatchWallet,
|
|
600
|
+
useMatchWalletAssetList: () => useMatchWalletAssetList,
|
|
601
|
+
useMatchWalletAssets: () => useMatchWalletAssets,
|
|
602
|
+
useMatchWalletRecords: () => useMatchWalletRecords,
|
|
595
603
|
useModal: () => useModal,
|
|
596
604
|
useReceipt: () => useReceipt,
|
|
597
605
|
useToast: () => useToast,
|
|
606
|
+
useTransaction: () => useTransaction,
|
|
598
607
|
useUserInfo: () => useUserInfo,
|
|
599
608
|
useWallet: () => useWallet
|
|
600
609
|
});
|
|
@@ -667,108 +676,113 @@ import { createWalletClient } from "viem";
|
|
|
667
676
|
import { useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
668
677
|
import { encodeDeployData } from "viem";
|
|
669
678
|
|
|
670
|
-
// src/
|
|
671
|
-
import {
|
|
679
|
+
// src/context/ModalContext.tsx
|
|
680
|
+
import { useState as useState2, useCallback, createContext, useContext } from "react";
|
|
681
|
+
import { createPortal } from "react-dom";
|
|
682
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
683
|
+
var ModalContext = createContext(null);
|
|
684
|
+
function ModalProvider({ children }) {
|
|
685
|
+
const [modalState, setModalState] = useState2({
|
|
686
|
+
modals: [],
|
|
687
|
+
highestZIndex: 100
|
|
688
|
+
});
|
|
689
|
+
const getNextIndex = useCallback(() => {
|
|
690
|
+
return Math.max(...modalState.modals.map((modal) => modal.index), 0) + 1 || 100;
|
|
691
|
+
}, [modalState]);
|
|
692
|
+
const closeModal = useCallback((index) => {
|
|
693
|
+
setModalState((prevState) => ({
|
|
694
|
+
modals: prevState.modals.filter((modal) => modal.index !== index),
|
|
695
|
+
highestZIndex: prevState.highestZIndex
|
|
696
|
+
}));
|
|
697
|
+
}, []);
|
|
698
|
+
const show = useCallback((content, index) => {
|
|
699
|
+
setModalState((prevState) => {
|
|
700
|
+
const modalIndex = index !== void 0 ? index : getNextIndex();
|
|
701
|
+
const newZIndex = prevState.highestZIndex + 1;
|
|
702
|
+
return {
|
|
703
|
+
modals: [...prevState.modals, {
|
|
704
|
+
visible: true,
|
|
705
|
+
index: modalIndex,
|
|
706
|
+
zIndex: newZIndex,
|
|
707
|
+
content: content({ close: () => closeModal(modalIndex), zIndex: newZIndex })
|
|
708
|
+
}],
|
|
709
|
+
highestZIndex: newZIndex
|
|
710
|
+
};
|
|
711
|
+
});
|
|
712
|
+
}, [getNextIndex, closeModal]);
|
|
713
|
+
const open = useCallback((props) => {
|
|
714
|
+
setModalState((prevState) => {
|
|
715
|
+
const modalIndex = props.index !== void 0 ? props.index : getNextIndex();
|
|
716
|
+
const newZIndex = prevState.highestZIndex + 1;
|
|
717
|
+
return {
|
|
718
|
+
modals: [...prevState.modals, {
|
|
719
|
+
visible: true,
|
|
720
|
+
index: modalIndex,
|
|
721
|
+
zIndex: newZIndex,
|
|
722
|
+
content: /* @__PURE__ */ jsx2(ModalDrawer, { showClose: true, isOpen: true, onClose: () => closeModal(modalIndex), title: props.title, zIndex: newZIndex, onBack: props.onBack, children: /* @__PURE__ */ jsx2(props.content, { close: () => closeModal(modalIndex), zIndex: newZIndex }) })
|
|
723
|
+
}],
|
|
724
|
+
highestZIndex: newZIndex
|
|
725
|
+
};
|
|
726
|
+
});
|
|
727
|
+
}, [getNextIndex, closeModal]);
|
|
728
|
+
const modalElements = modalState.modals.sort((a, b) => b.zIndex - a.zIndex).map(
|
|
729
|
+
(modal) => modal.visible ? createPortal(
|
|
730
|
+
modal.content,
|
|
731
|
+
document.body
|
|
732
|
+
) : null
|
|
733
|
+
);
|
|
734
|
+
return /* @__PURE__ */ jsxs2(ModalContext.Provider, { value: { show, open }, children: [
|
|
735
|
+
children,
|
|
736
|
+
modalElements
|
|
737
|
+
] });
|
|
738
|
+
}
|
|
739
|
+
function useModal() {
|
|
740
|
+
const context = useContext(ModalContext);
|
|
741
|
+
if (!context) {
|
|
742
|
+
throw new Error("useModal must be used within a ModalProvider");
|
|
743
|
+
}
|
|
744
|
+
return context;
|
|
745
|
+
}
|
|
672
746
|
|
|
673
|
-
// src/
|
|
674
|
-
import {
|
|
675
|
-
|
|
676
|
-
var
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
activeIcon: /* @__PURE__ */ jsx2(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
689
|
-
name: "SOL",
|
|
690
|
-
method: "sol"
|
|
691
|
-
},
|
|
692
|
-
btc: {
|
|
693
|
-
icon: /* @__PURE__ */ jsx2(BTCDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
694
|
-
activeIcon: /* @__PURE__ */ jsx2(BTCLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
695
|
-
name: "BTC",
|
|
696
|
-
method: "btc"
|
|
697
|
-
},
|
|
698
|
-
tron: {
|
|
699
|
-
icon: /* @__PURE__ */ jsx2(TRXDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
700
|
-
activeIcon: /* @__PURE__ */ jsx2(TRXLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
701
|
-
name: "TRON",
|
|
702
|
-
method: "tron"
|
|
747
|
+
// src/store/useTransactionStore.ts
|
|
748
|
+
import { create as create3 } from "zustand";
|
|
749
|
+
import { devtools as devtools2, persist as persist2 } from "zustand/middleware";
|
|
750
|
+
var persistedState2 = persist2(
|
|
751
|
+
(set, get) => ({
|
|
752
|
+
transactions: {},
|
|
753
|
+
getTransactions: (chainId, address) => get().transactions[`${chainId}-${address}`] || [],
|
|
754
|
+
addTransaction: (data) => {
|
|
755
|
+
set((state) => {
|
|
756
|
+
const updatedTransactions = {
|
|
757
|
+
...state.transactions,
|
|
758
|
+
[`${data.chainId}-${data.address}`]: [data.info, ...state.transactions[`${data.chainId}-${data.address}`] || []]
|
|
759
|
+
};
|
|
760
|
+
return { transactions: updatedTransactions };
|
|
761
|
+
});
|
|
703
762
|
},
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
763
|
+
removeTransaction: (data) => {
|
|
764
|
+
set((state) => {
|
|
765
|
+
const updatedTransactions = {
|
|
766
|
+
...state.transactions,
|
|
767
|
+
[`${data.chainId}-${data.address}`]: (state.transactions[`${data.chainId}-${data.address}`] || []).filter((tx) => tx.hash !== data.hash)
|
|
768
|
+
};
|
|
769
|
+
return { transactions: updatedTransactions };
|
|
770
|
+
});
|
|
709
771
|
}
|
|
710
|
-
};
|
|
711
|
-
return {
|
|
712
|
-
walletMap
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
// src/store/useModalStore.ts
|
|
717
|
-
var useSOLModalStore = create3((set) => ({
|
|
718
|
-
isOpen: false,
|
|
719
|
-
type: "",
|
|
720
|
-
open: (type) => set({ isOpen: true, type }),
|
|
721
|
-
close: () => set({ isOpen: false })
|
|
722
|
-
}));
|
|
723
|
-
var useTRONModalStore = create3((set) => ({
|
|
724
|
-
isOpen: false,
|
|
725
|
-
type: "",
|
|
726
|
-
open: (type) => set({ isOpen: true, type }),
|
|
727
|
-
close: () => set({ isOpen: false })
|
|
728
|
-
}));
|
|
729
|
-
var useTONModalStore = create3((set) => ({
|
|
730
|
-
isOpen: false,
|
|
731
|
-
type: "",
|
|
732
|
-
open: (type) => set({ isOpen: true, type }),
|
|
733
|
-
close: () => set({ isOpen: false })
|
|
734
|
-
}));
|
|
735
|
-
var useBTCModalStore = create3((set) => ({
|
|
736
|
-
isOpen: false,
|
|
737
|
-
type: "",
|
|
738
|
-
open: (type) => set({ isOpen: true, type }),
|
|
739
|
-
close: () => set({ isOpen: false })
|
|
740
|
-
}));
|
|
741
|
-
var useCEXBindModalStore = create3((set) => ({
|
|
742
|
-
type: "",
|
|
743
|
-
isOpen: false,
|
|
744
|
-
open: (type) => set({ isOpen: true, type }),
|
|
745
|
-
close: () => set({ isOpen: false })
|
|
746
|
-
}));
|
|
747
|
-
var useHashPanelStore = create3((set) => ({
|
|
748
|
-
isOpen: false,
|
|
749
|
-
hash: null,
|
|
750
|
-
chain: null,
|
|
751
|
-
open: (params) => set({
|
|
752
|
-
isOpen: true,
|
|
753
|
-
hash: params?.hash || null,
|
|
754
|
-
chain: params?.chain || null
|
|
755
772
|
}),
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
var
|
|
759
|
-
|
|
760
|
-
type: "",
|
|
761
|
-
methods: [],
|
|
762
|
-
open: (type, methods = DEFAULT_WALLET_METHODS) => set({ isOpen: true, type, methods }),
|
|
763
|
-
close: () => set({ isOpen: false })
|
|
764
|
-
}));
|
|
773
|
+
{ name: "match-transactions-local" }
|
|
774
|
+
);
|
|
775
|
+
var useTransactionStore = create3(devtools2(persistedState2));
|
|
776
|
+
var useTransactionStore_default = useTransactionStore;
|
|
765
777
|
|
|
766
778
|
// src/hooks/useWallet.tsx
|
|
779
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
767
780
|
var AppClientId = "react-sdk-" + getVersion();
|
|
768
781
|
function useWallet() {
|
|
769
|
-
const { address
|
|
782
|
+
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
770
783
|
const { walletReady } = useStore_default();
|
|
771
|
-
const
|
|
784
|
+
const modal = useModal();
|
|
785
|
+
const { addTransaction } = useTransactionStore_default();
|
|
772
786
|
const isRecovered = async () => {
|
|
773
787
|
const res = await window.matchProvider.waitUntilWalletMessage({
|
|
774
788
|
method: "isRecovered"
|
|
@@ -814,39 +828,44 @@ function useWallet() {
|
|
|
814
828
|
}
|
|
815
829
|
};
|
|
816
830
|
const evmAccount = useMemo2(() => {
|
|
817
|
-
|
|
818
|
-
address
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
chainType: "ethereum" /* Ethereum */,
|
|
833
|
-
chain: {
|
|
834
|
-
id: chain?.id || restTransaction.chainId,
|
|
835
|
-
name: chain?.name,
|
|
836
|
-
nativeCurrency: {
|
|
837
|
-
name: chain?.nativeCurrency?.name || "ETH",
|
|
838
|
-
symbol: chain?.nativeCurrency?.symbol || "ETH",
|
|
839
|
-
decimals: chain?.nativeCurrency?.decimals || 18
|
|
831
|
+
try {
|
|
832
|
+
return address ? toAccount({
|
|
833
|
+
address,
|
|
834
|
+
async signMessage({ message }) {
|
|
835
|
+
return await signMessage2({
|
|
836
|
+
message,
|
|
837
|
+
chainType: "ethereum" /* Ethereum */
|
|
838
|
+
});
|
|
839
|
+
},
|
|
840
|
+
async signTransaction(transaction, options) {
|
|
841
|
+
const { account, chain, ...restTransaction } = transaction;
|
|
842
|
+
console.log("qwe-sign-transaction", restTransaction, options);
|
|
843
|
+
return await signTransaction({
|
|
844
|
+
transaction: {
|
|
845
|
+
...restTransaction
|
|
840
846
|
},
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
847
|
+
chainType: "ethereum" /* Ethereum */,
|
|
848
|
+
chain: {
|
|
849
|
+
id: chain?.id || restTransaction.chainId,
|
|
850
|
+
name: chain?.name,
|
|
851
|
+
nativeCurrency: {
|
|
852
|
+
name: chain?.nativeCurrency?.name || "ETH",
|
|
853
|
+
symbol: chain?.nativeCurrency?.symbol || "ETH",
|
|
854
|
+
decimals: chain?.nativeCurrency?.decimals || 18
|
|
855
|
+
},
|
|
856
|
+
rpcUrls: chain?.rpcUrls
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
},
|
|
860
|
+
async signTypedData(typedData) {
|
|
861
|
+
return "0x";
|
|
862
|
+
}
|
|
863
|
+
}) : void 0;
|
|
864
|
+
} catch (error) {
|
|
865
|
+
console.error(`qwe-evm-account-error ${address}`, error);
|
|
866
|
+
return void 0;
|
|
867
|
+
}
|
|
868
|
+
}, [address]);
|
|
850
869
|
useEffect3(() => {
|
|
851
870
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
852
871
|
}, [evmAccount]);
|
|
@@ -912,13 +931,25 @@ function useWallet() {
|
|
|
912
931
|
prepareTransactionRequest
|
|
913
932
|
}
|
|
914
933
|
});
|
|
915
|
-
openHashPanel();
|
|
916
934
|
const txHash = await obj.sendRawTransaction({
|
|
917
935
|
serializedTransaction
|
|
918
936
|
});
|
|
919
|
-
|
|
937
|
+
addTransaction({
|
|
938
|
+
chainId,
|
|
920
939
|
hash: txHash,
|
|
921
|
-
|
|
940
|
+
info: {
|
|
941
|
+
from: evmAccount.address,
|
|
942
|
+
to: restTransaction.to,
|
|
943
|
+
value: (restTransaction.value || 0).toString(),
|
|
944
|
+
input: restTransaction.data,
|
|
945
|
+
timestamp: Math.floor(Date.now() / 1e3).toString(),
|
|
946
|
+
hash: txHash,
|
|
947
|
+
source: "local"
|
|
948
|
+
},
|
|
949
|
+
address: evmAccount.address
|
|
950
|
+
});
|
|
951
|
+
modal.show((props) => {
|
|
952
|
+
return /* @__PURE__ */ jsx3(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
922
953
|
});
|
|
923
954
|
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
924
955
|
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
@@ -939,7 +970,7 @@ function useWallet() {
|
|
|
939
970
|
});
|
|
940
971
|
};
|
|
941
972
|
const writeContract = async (parameters2) => {
|
|
942
|
-
const { abi, address:
|
|
973
|
+
const { abi, address: address2, args, dataSuffix, functionName, ...request3 } = parameters2;
|
|
943
974
|
const data = encodeFunctionData({
|
|
944
975
|
abi,
|
|
945
976
|
args,
|
|
@@ -947,7 +978,7 @@ function useWallet() {
|
|
|
947
978
|
});
|
|
948
979
|
return await sendTransaction({
|
|
949
980
|
data: `${data}${dataSuffix ? dataSuffix.replace("0x", "") : ""}`,
|
|
950
|
-
to:
|
|
981
|
+
to: address2,
|
|
951
982
|
...request3
|
|
952
983
|
});
|
|
953
984
|
};
|
|
@@ -961,7 +992,7 @@ function useWallet() {
|
|
|
961
992
|
return {
|
|
962
993
|
walletReady,
|
|
963
994
|
evmAccount,
|
|
964
|
-
address
|
|
995
|
+
address,
|
|
965
996
|
signMessage: signMessage2,
|
|
966
997
|
signTransaction,
|
|
967
998
|
isRecovered,
|
|
@@ -971,10 +1002,10 @@ function useWallet() {
|
|
|
971
1002
|
|
|
972
1003
|
// src/hooks/useCopyClipboard.ts
|
|
973
1004
|
import copy from "copy-to-clipboard";
|
|
974
|
-
import { useCallback, useEffect as useEffect4, useState as
|
|
1005
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useState as useState4 } from "react";
|
|
975
1006
|
function useCopyClipboard(timeout = 500) {
|
|
976
|
-
const [isCopied, setIsCopied] =
|
|
977
|
-
const staticCopy =
|
|
1007
|
+
const [isCopied, setIsCopied] = useState4(false);
|
|
1008
|
+
const staticCopy = useCallback2((text) => {
|
|
978
1009
|
const didCopy = copy(text);
|
|
979
1010
|
setIsCopied(didCopy);
|
|
980
1011
|
}, []);
|
|
@@ -992,48 +1023,6 @@ function useCopyClipboard(timeout = 500) {
|
|
|
992
1023
|
return [isCopied, staticCopy];
|
|
993
1024
|
}
|
|
994
1025
|
|
|
995
|
-
// src/context/ModalContext.tsx
|
|
996
|
-
import { useState as useState4, useCallback as useCallback2, createContext, useContext } from "react";
|
|
997
|
-
import { createPortal } from "react-dom";
|
|
998
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
999
|
-
var ModalContext = createContext(null);
|
|
1000
|
-
function ModalProvider({ children }) {
|
|
1001
|
-
const [showModalState, setShowModalState] = useState4({
|
|
1002
|
-
visible: false,
|
|
1003
|
-
content: null
|
|
1004
|
-
});
|
|
1005
|
-
const closeShowModal = useCallback2(() => {
|
|
1006
|
-
setShowModalState({ visible: false, content: null });
|
|
1007
|
-
}, []);
|
|
1008
|
-
const show = useCallback2((content) => {
|
|
1009
|
-
setShowModalState({
|
|
1010
|
-
visible: true,
|
|
1011
|
-
content: content({ close: closeShowModal })
|
|
1012
|
-
});
|
|
1013
|
-
}, [closeShowModal]);
|
|
1014
|
-
const open = useCallback2((props) => {
|
|
1015
|
-
setShowModalState({
|
|
1016
|
-
visible: true,
|
|
1017
|
-
content: /* @__PURE__ */ jsx3(ModalDrawer, { showClose: true, isOpen: true, onClose: closeShowModal, title: props.title, children: /* @__PURE__ */ jsx3(props.content, { close: closeShowModal }) })
|
|
1018
|
-
});
|
|
1019
|
-
}, [closeShowModal]);
|
|
1020
|
-
const ShowModalComponent = showModalState.visible ? createPortal(
|
|
1021
|
-
showModalState.content,
|
|
1022
|
-
document.body
|
|
1023
|
-
) : null;
|
|
1024
|
-
return /* @__PURE__ */ jsxs2(ModalContext.Provider, { value: { show, open }, children: [
|
|
1025
|
-
children,
|
|
1026
|
-
ShowModalComponent
|
|
1027
|
-
] });
|
|
1028
|
-
}
|
|
1029
|
-
function useModal() {
|
|
1030
|
-
const context = useContext(ModalContext);
|
|
1031
|
-
if (!context) {
|
|
1032
|
-
throw new Error("useModal must be used within a ModalProvider");
|
|
1033
|
-
}
|
|
1034
|
-
return context;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
1026
|
// src/context/ToastContext.tsx
|
|
1038
1027
|
import { useState as useState5, useCallback as useCallback3, createContext as createContext2, useContext as useContext2 } from "react";
|
|
1039
1028
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -1087,20 +1076,23 @@ function useToast() {
|
|
|
1087
1076
|
// src/hooks/api/wallet.ts
|
|
1088
1077
|
var wallet_exports = {};
|
|
1089
1078
|
__export(wallet_exports, {
|
|
1079
|
+
USER_IMPORT_TOKEN_LIST_KEY: () => USER_IMPORT_TOKEN_LIST_KEY,
|
|
1090
1080
|
getUserWalletTransactionsApi: () => getUserWalletTransactionsApi,
|
|
1091
1081
|
getWalletAssetListApi: () => getWalletAssetListApi,
|
|
1092
1082
|
getWalletListApi: () => getWalletListApi,
|
|
1093
1083
|
useAssetListQuery: () => useAssetListQuery,
|
|
1094
1084
|
useChainListQuery: () => useChainListQuery,
|
|
1095
1085
|
useImportTokenListQuery: () => useImportTokenListQuery,
|
|
1086
|
+
useWalletAssetListQuery: () => useWalletAssetListQuery,
|
|
1096
1087
|
useWalletChainListQuery: () => useWalletChainListQuery,
|
|
1088
|
+
useWalletNftListQuery: () => useWalletNftListQuery,
|
|
1097
1089
|
userImportTokenApi: () => userImportTokenApi
|
|
1098
1090
|
});
|
|
1099
1091
|
import { useQuery } from "@tanstack/react-query";
|
|
1100
1092
|
function useChainListQuery(options) {
|
|
1101
1093
|
const { isLogin, token } = useUserInfo();
|
|
1102
1094
|
return useQuery({
|
|
1103
|
-
queryKey: ["match-chain-list", token],
|
|
1095
|
+
queryKey: ["match-user-chain-list", token],
|
|
1104
1096
|
queryFn: async () => {
|
|
1105
1097
|
const res = await getUserChainListApi();
|
|
1106
1098
|
if (!isSuccess(res)) {
|
|
@@ -1118,7 +1110,7 @@ function useAssetListQuery({
|
|
|
1118
1110
|
}) {
|
|
1119
1111
|
const { isLogin, token } = useUserInfo();
|
|
1120
1112
|
return useQuery({
|
|
1121
|
-
queryKey: ["match-
|
|
1113
|
+
queryKey: ["match-user-asset-list", token, chainId],
|
|
1122
1114
|
queryFn: async () => {
|
|
1123
1115
|
const res = await getUserWalletAssetApi({ chain_id: chainId.toString() });
|
|
1124
1116
|
if (!isSuccess(res)) {
|
|
@@ -1130,13 +1122,14 @@ function useAssetListQuery({
|
|
|
1130
1122
|
...options
|
|
1131
1123
|
});
|
|
1132
1124
|
}
|
|
1125
|
+
var USER_IMPORT_TOKEN_LIST_KEY = "match-user-import-token-list";
|
|
1133
1126
|
function useImportTokenListQuery({
|
|
1134
1127
|
chainId,
|
|
1135
1128
|
...options
|
|
1136
1129
|
}) {
|
|
1137
1130
|
const { isLogin, token } = useUserInfo();
|
|
1138
1131
|
return useQuery({
|
|
1139
|
-
queryKey: [
|
|
1132
|
+
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId],
|
|
1140
1133
|
queryFn: async () => {
|
|
1141
1134
|
const res = await getUserImportTokenListApi({ chain_id: chainId.toString() });
|
|
1142
1135
|
if (!isSuccess(res)) {
|
|
@@ -1163,9 +1156,54 @@ function useWalletChainListQuery(options) {
|
|
|
1163
1156
|
...options
|
|
1164
1157
|
});
|
|
1165
1158
|
}
|
|
1159
|
+
function useWalletNftListQuery({
|
|
1160
|
+
chainId,
|
|
1161
|
+
address,
|
|
1162
|
+
...options
|
|
1163
|
+
}) {
|
|
1164
|
+
const { isLogin, token } = useUserInfo();
|
|
1165
|
+
return useQuery({
|
|
1166
|
+
queryKey: ["match-wallet-nft-list", token, chainId, address],
|
|
1167
|
+
queryFn: async () => {
|
|
1168
|
+
const res = await getWalletNftListApi({
|
|
1169
|
+
chain_id: chainId.toString(),
|
|
1170
|
+
address
|
|
1171
|
+
});
|
|
1172
|
+
if (!isSuccess(res)) {
|
|
1173
|
+
return [];
|
|
1174
|
+
}
|
|
1175
|
+
return res.data;
|
|
1176
|
+
},
|
|
1177
|
+
enabled: isLogin,
|
|
1178
|
+
...options
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
function useWalletAssetListQuery({
|
|
1182
|
+
chainId,
|
|
1183
|
+
address,
|
|
1184
|
+
...options
|
|
1185
|
+
}) {
|
|
1186
|
+
const { isLogin, token } = useUserInfo();
|
|
1187
|
+
return useQuery({
|
|
1188
|
+
queryKey: ["match-wallet-asset-list", token, chainId, address],
|
|
1189
|
+
queryFn: async () => {
|
|
1190
|
+
const res = await getWalletAssetListApi({
|
|
1191
|
+
chain_id: chainId,
|
|
1192
|
+
address
|
|
1193
|
+
});
|
|
1194
|
+
if (!isSuccess(res)) {
|
|
1195
|
+
return null;
|
|
1196
|
+
}
|
|
1197
|
+
return res.data;
|
|
1198
|
+
},
|
|
1199
|
+
enabled: isLogin,
|
|
1200
|
+
...options
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1166
1203
|
|
|
1167
1204
|
// src/hooks/useMatchChain.tsx
|
|
1168
1205
|
import { useMemo as useMemo3, useState as useState6 } from "react";
|
|
1206
|
+
import { createPublicClient as createPublicClient2, formatUnits, http as http2, parseUnits } from "viem";
|
|
1169
1207
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1170
1208
|
function useMatchChain() {
|
|
1171
1209
|
const chainListQuery = useChainListQuery();
|
|
@@ -1225,71 +1263,663 @@ function useMatchChain() {
|
|
|
1225
1263
|
content: ChangeNetwork
|
|
1226
1264
|
});
|
|
1227
1265
|
};
|
|
1266
|
+
const publicClient = useMemo3(() => {
|
|
1267
|
+
if (!chain) {
|
|
1268
|
+
return null;
|
|
1269
|
+
}
|
|
1270
|
+
return createPublicClient2({
|
|
1271
|
+
chain,
|
|
1272
|
+
transport: http2()
|
|
1273
|
+
});
|
|
1274
|
+
}, [chain]);
|
|
1228
1275
|
return {
|
|
1229
1276
|
list: chainListQuery.data,
|
|
1230
1277
|
chainId,
|
|
1231
1278
|
setChainId,
|
|
1232
1279
|
chain,
|
|
1233
1280
|
explorerLink,
|
|
1234
|
-
showChangeNetwork
|
|
1281
|
+
showChangeNetwork,
|
|
1282
|
+
publicClient,
|
|
1283
|
+
formatUnits: (value) => {
|
|
1284
|
+
return formatUnits(value, chain?.nativeCurrency.decimals || 18);
|
|
1285
|
+
},
|
|
1286
|
+
parseUnits: (value) => {
|
|
1287
|
+
return parseUnits(value, chain?.nativeCurrency.decimals || 18);
|
|
1288
|
+
}
|
|
1235
1289
|
};
|
|
1236
1290
|
}
|
|
1237
1291
|
|
|
1238
1292
|
// src/hooks/useMatchWallet.tsx
|
|
1239
1293
|
import { QRCode } from "react-qrcode";
|
|
1240
|
-
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
1294
|
+
import { useEffect as useEffect6, useMemo as useMemo4, useRef, useState as useState7 } from "react";
|
|
1295
|
+
import { useQuery as useQuery2, useQueryClient } from "@tanstack/react-query";
|
|
1296
|
+
|
|
1297
|
+
// src/config/index.tsx
|
|
1298
|
+
var EMAIL_INTERVAL = 60;
|
|
1299
|
+
var EMAIL_CODE_LENGTH = 6;
|
|
1300
|
+
var NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
1301
|
+
|
|
1302
|
+
// src/hooks/useMatchWallet.tsx
|
|
1303
|
+
import { erc20Abi, formatUnits as formatUnits2 } from "viem";
|
|
1304
|
+
|
|
1305
|
+
// src/store/useContractStore.ts
|
|
1306
|
+
import { create as create4 } from "zustand";
|
|
1307
|
+
import { devtools as devtools3, persist as persist3 } from "zustand/middleware";
|
|
1308
|
+
var persistedState3 = persist3(
|
|
1309
|
+
(set, get) => ({
|
|
1310
|
+
contracts: {},
|
|
1311
|
+
getContract: (chainId, contractAddress) => {
|
|
1312
|
+
const key = `${chainId}-${contractAddress}`;
|
|
1313
|
+
return get().contracts[key];
|
|
1314
|
+
},
|
|
1315
|
+
setContractName: (chainId, contractAddress, name) => {
|
|
1316
|
+
const key = `${chainId}-${contractAddress}`;
|
|
1317
|
+
set((state) => {
|
|
1318
|
+
const updatedContracts = {
|
|
1319
|
+
...state.contracts,
|
|
1320
|
+
[key]: { ...state.contracts[key], name }
|
|
1321
|
+
};
|
|
1322
|
+
return { contracts: updatedContracts };
|
|
1323
|
+
});
|
|
1324
|
+
},
|
|
1325
|
+
setContractSymbol: (chainId, contractAddress, symbol) => {
|
|
1326
|
+
const key = `${chainId}-${contractAddress}`;
|
|
1327
|
+
set((state) => {
|
|
1328
|
+
const updatedContracts = {
|
|
1329
|
+
...state.contracts,
|
|
1330
|
+
[key]: { ...state.contracts[key], symbol }
|
|
1331
|
+
};
|
|
1332
|
+
return { contracts: updatedContracts };
|
|
1333
|
+
});
|
|
1334
|
+
},
|
|
1335
|
+
setContractDecimals: (chainId, contractAddress, decimals) => {
|
|
1336
|
+
const key = `${chainId}-${contractAddress}`;
|
|
1337
|
+
set((state) => {
|
|
1338
|
+
const updatedContracts = {
|
|
1339
|
+
...state.contracts,
|
|
1340
|
+
[key]: { ...state.contracts[key], decimals }
|
|
1341
|
+
};
|
|
1342
|
+
return { contracts: updatedContracts };
|
|
1343
|
+
});
|
|
1344
|
+
},
|
|
1345
|
+
setContracts: (data) => {
|
|
1346
|
+
set((state) => {
|
|
1347
|
+
const newContracts = { ...state.contracts };
|
|
1348
|
+
data.forEach(({ chainId, contractAddress, info }) => {
|
|
1349
|
+
const key = `${chainId}-${contractAddress}`;
|
|
1350
|
+
newContracts[key] = { ...newContracts[key], ...info };
|
|
1351
|
+
});
|
|
1352
|
+
return { contracts: newContracts };
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
}),
|
|
1356
|
+
{ name: "match-contract-local" }
|
|
1357
|
+
);
|
|
1358
|
+
var useContractStore = create4(devtools3(persistedState3));
|
|
1359
|
+
var useContractStore_default = useContractStore;
|
|
1360
|
+
|
|
1361
|
+
// src/hooks/useMatchWallet.tsx
|
|
1362
|
+
import { FormattedMessage as FormattedMessage2, useIntl as useIntl2 } from "react-intl";
|
|
1241
1363
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1242
|
-
|
|
1243
|
-
const modal = useModal();
|
|
1244
|
-
const { address: address2 } = useWallet();
|
|
1364
|
+
var ReceiveModal = () => {
|
|
1245
1365
|
const chain = useMatchChain();
|
|
1366
|
+
const { address } = useWallet();
|
|
1246
1367
|
const [copied, setCopied] = useCopyClipboard();
|
|
1247
1368
|
const toast = useToast();
|
|
1369
|
+
const intl = useIntl2();
|
|
1248
1370
|
const onCopy = () => {
|
|
1249
|
-
setCopied(
|
|
1250
|
-
toast.success(
|
|
1371
|
+
setCopied(address);
|
|
1372
|
+
toast.success(intl.formatMessage({
|
|
1373
|
+
id: "copied"
|
|
1374
|
+
}));
|
|
1375
|
+
};
|
|
1376
|
+
const chainLink = chain.explorerLink("address/" + address);
|
|
1377
|
+
return /* @__PURE__ */ jsxs5("div", { className: `matchid-receive-modal`, children: [
|
|
1378
|
+
/* @__PURE__ */ jsxs5("div", { className: "matchid-receive-container", children: [
|
|
1379
|
+
/* @__PURE__ */ jsx6("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ jsx6(FormattedMessage2, { id: "receiveQrcode" }) }),
|
|
1380
|
+
/* @__PURE__ */ jsx6("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ jsx6(
|
|
1381
|
+
QRCode,
|
|
1382
|
+
{
|
|
1383
|
+
margin: "0",
|
|
1384
|
+
className: `matchid-qr-code`,
|
|
1385
|
+
value: address
|
|
1386
|
+
}
|
|
1387
|
+
) }),
|
|
1388
|
+
/* @__PURE__ */ jsx6(
|
|
1389
|
+
"a",
|
|
1390
|
+
{
|
|
1391
|
+
href: chainLink,
|
|
1392
|
+
target: "_blank",
|
|
1393
|
+
className: `matchid-receive-link`,
|
|
1394
|
+
children: address
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
] }),
|
|
1398
|
+
/* @__PURE__ */ jsx6(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ jsx6(
|
|
1399
|
+
FormattedMessage2,
|
|
1400
|
+
{
|
|
1401
|
+
id: "copyAddress"
|
|
1402
|
+
}
|
|
1403
|
+
) })
|
|
1404
|
+
] });
|
|
1405
|
+
};
|
|
1406
|
+
var ImportTokenModal = ({ close }) => {
|
|
1407
|
+
const { token } = useUserInfo();
|
|
1408
|
+
const [address, setAddress] = useState7("");
|
|
1409
|
+
const [symbol, setSymbol] = useState7("");
|
|
1410
|
+
const [decimals, setDecimals] = useState7("");
|
|
1411
|
+
const [error, setError] = useState7({});
|
|
1412
|
+
const { publicClient, chainId } = useMatchChain();
|
|
1413
|
+
const getContractInfo = async () => {
|
|
1414
|
+
if (!publicClient) return;
|
|
1415
|
+
const erc20Abi3 = [
|
|
1416
|
+
{
|
|
1417
|
+
name: "decimals",
|
|
1418
|
+
type: "function",
|
|
1419
|
+
stateMutability: "view",
|
|
1420
|
+
inputs: [],
|
|
1421
|
+
outputs: [{ name: "decimals", type: "uint8" }]
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
name: "symbol",
|
|
1425
|
+
type: "function",
|
|
1426
|
+
stateMutability: "view",
|
|
1427
|
+
inputs: [],
|
|
1428
|
+
outputs: [{ name: "symbol", type: "string" }]
|
|
1429
|
+
}
|
|
1430
|
+
];
|
|
1431
|
+
const calls = [
|
|
1432
|
+
{
|
|
1433
|
+
address,
|
|
1434
|
+
abi: erc20Abi3,
|
|
1435
|
+
functionName: "symbol",
|
|
1436
|
+
args: []
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
address,
|
|
1440
|
+
abi: erc20Abi3,
|
|
1441
|
+
functionName: "decimals",
|
|
1442
|
+
args: []
|
|
1443
|
+
}
|
|
1444
|
+
];
|
|
1445
|
+
try {
|
|
1446
|
+
const results = await publicClient.multicall({ contracts: calls });
|
|
1447
|
+
console.log("results", results);
|
|
1448
|
+
if (!symbol && results[0]?.status == "success") {
|
|
1449
|
+
setSymbol(results[0]?.result);
|
|
1450
|
+
}
|
|
1451
|
+
if (!decimals && results[1]?.status == "success") {
|
|
1452
|
+
setDecimals((results[1]?.result).toString());
|
|
1453
|
+
}
|
|
1454
|
+
} catch (error2) {
|
|
1455
|
+
setError({
|
|
1456
|
+
address: error2.message
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
const intl = useIntl2();
|
|
1461
|
+
useEffect6(() => {
|
|
1462
|
+
if (address.length === 42) {
|
|
1463
|
+
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
1464
|
+
if (!reg.test(address)) {
|
|
1465
|
+
setError({
|
|
1466
|
+
...error,
|
|
1467
|
+
address: intl.formatMessage({
|
|
1468
|
+
id: "tokenAddressError"
|
|
1469
|
+
})
|
|
1470
|
+
});
|
|
1471
|
+
} else {
|
|
1472
|
+
setError({
|
|
1473
|
+
...error,
|
|
1474
|
+
address: ""
|
|
1475
|
+
});
|
|
1476
|
+
publicClient && getContractInfo();
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}, [address, publicClient]);
|
|
1480
|
+
const [loading, setLoading] = useState7(false);
|
|
1481
|
+
const toast = useToast();
|
|
1482
|
+
const queryClient2 = useQueryClient();
|
|
1483
|
+
const onImport = async () => {
|
|
1484
|
+
setLoading(true);
|
|
1485
|
+
try {
|
|
1486
|
+
const res = await userImportTokenApi({
|
|
1487
|
+
chain_id: chainId?.toString() || "",
|
|
1488
|
+
symbol,
|
|
1489
|
+
address,
|
|
1490
|
+
decimals
|
|
1491
|
+
});
|
|
1492
|
+
if (isSuccess(res)) {
|
|
1493
|
+
toast.success(intl.formatMessage({
|
|
1494
|
+
id: "importSuccess"
|
|
1495
|
+
}));
|
|
1496
|
+
queryClient2.invalidateQueries({
|
|
1497
|
+
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId]
|
|
1498
|
+
});
|
|
1499
|
+
close();
|
|
1500
|
+
} else {
|
|
1501
|
+
toast.error(res.message);
|
|
1502
|
+
}
|
|
1503
|
+
} catch (error2) {
|
|
1504
|
+
toast.error(error2.message);
|
|
1505
|
+
} finally {
|
|
1506
|
+
setLoading(false);
|
|
1507
|
+
}
|
|
1251
1508
|
};
|
|
1509
|
+
const canImport = useMemo4(() => {
|
|
1510
|
+
if (!address) {
|
|
1511
|
+
return false;
|
|
1512
|
+
}
|
|
1513
|
+
if (!symbol) {
|
|
1514
|
+
return false;
|
|
1515
|
+
}
|
|
1516
|
+
if (decimals.length === 0) {
|
|
1517
|
+
return false;
|
|
1518
|
+
}
|
|
1519
|
+
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
1520
|
+
if (!reg.test(address)) {
|
|
1521
|
+
return false;
|
|
1522
|
+
}
|
|
1523
|
+
return true;
|
|
1524
|
+
}, [error, address, symbol, decimals]);
|
|
1525
|
+
return /* @__PURE__ */ jsxs5("div", { className: `matchid-import-token`, children: [
|
|
1526
|
+
/* @__PURE__ */ jsxs5("div", { className: "matchid-import-token-form", children: [
|
|
1527
|
+
/* @__PURE__ */ jsx6(Field, { label: intl.formatMessage({
|
|
1528
|
+
id: "tokenSmartContract"
|
|
1529
|
+
}), error: error.address, children: /* @__PURE__ */ jsx6(
|
|
1530
|
+
Input,
|
|
1531
|
+
{
|
|
1532
|
+
placeholder: intl.formatMessage({
|
|
1533
|
+
id: "tokenSmartContractPlaceholder"
|
|
1534
|
+
}),
|
|
1535
|
+
value: address,
|
|
1536
|
+
onChange: (e) => setAddress(e.target.value),
|
|
1537
|
+
maxLength: 42
|
|
1538
|
+
}
|
|
1539
|
+
) }),
|
|
1540
|
+
/* @__PURE__ */ jsx6(Field, { label: intl.formatMessage({
|
|
1541
|
+
id: "tokenSymbol"
|
|
1542
|
+
}), error: error.symbol, children: /* @__PURE__ */ jsx6(
|
|
1543
|
+
Input,
|
|
1544
|
+
{
|
|
1545
|
+
placeholder: intl.formatMessage({
|
|
1546
|
+
id: "tokenSymbolPlaceholder"
|
|
1547
|
+
}),
|
|
1548
|
+
value: symbol,
|
|
1549
|
+
onChange: (e) => setSymbol(e.target.value),
|
|
1550
|
+
maxLength: 16
|
|
1551
|
+
}
|
|
1552
|
+
) }),
|
|
1553
|
+
/* @__PURE__ */ jsx6(Field, { label: intl.formatMessage({
|
|
1554
|
+
id: "tokenDecimals"
|
|
1555
|
+
}), error: error.decimals, children: /* @__PURE__ */ jsx6(
|
|
1556
|
+
Input,
|
|
1557
|
+
{
|
|
1558
|
+
placeholder: intl.formatMessage({
|
|
1559
|
+
id: "tokenDecimalsPlaceholder"
|
|
1560
|
+
}),
|
|
1561
|
+
type: "number",
|
|
1562
|
+
value: decimals,
|
|
1563
|
+
onChange: (e) => setDecimals(e.target.value)
|
|
1564
|
+
}
|
|
1565
|
+
) })
|
|
1566
|
+
] }),
|
|
1567
|
+
/* @__PURE__ */ jsx6(
|
|
1568
|
+
Button,
|
|
1569
|
+
{
|
|
1570
|
+
size: "lg",
|
|
1571
|
+
onClick: onImport,
|
|
1572
|
+
block: true,
|
|
1573
|
+
loading,
|
|
1574
|
+
disabled: !canImport,
|
|
1575
|
+
highlight: true,
|
|
1576
|
+
children: /* @__PURE__ */ jsx6(FormattedMessage2, { id: "import" })
|
|
1577
|
+
}
|
|
1578
|
+
)
|
|
1579
|
+
] });
|
|
1580
|
+
};
|
|
1581
|
+
function useMatchWallet() {
|
|
1582
|
+
const modal = useModal();
|
|
1583
|
+
const intl = useIntl2();
|
|
1252
1584
|
const showReceiveModal = () => {
|
|
1253
|
-
const chainLink = chain.explorerLink("address/" + address2);
|
|
1254
|
-
const ReceiveModal = () => {
|
|
1255
|
-
return /* @__PURE__ */ jsxs5("div", { className: `matchid-receive-modal`, children: [
|
|
1256
|
-
/* @__PURE__ */ jsxs5("div", { className: "matchid-receive-container", children: [
|
|
1257
|
-
/* @__PURE__ */ jsx6("div", { className: `matchid-receive-text`, children: "Receive by scanning the QR code" }),
|
|
1258
|
-
/* @__PURE__ */ jsx6("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ jsx6(
|
|
1259
|
-
QRCode,
|
|
1260
|
-
{
|
|
1261
|
-
margin: "0",
|
|
1262
|
-
className: `matchid-qr-code`,
|
|
1263
|
-
value: address2
|
|
1264
|
-
}
|
|
1265
|
-
) }),
|
|
1266
|
-
/* @__PURE__ */ jsx6(
|
|
1267
|
-
"a",
|
|
1268
|
-
{
|
|
1269
|
-
href: chainLink,
|
|
1270
|
-
target: "_blank",
|
|
1271
|
-
className: `matchid-receive-link`,
|
|
1272
|
-
children: address2
|
|
1273
|
-
}
|
|
1274
|
-
)
|
|
1275
|
-
] }),
|
|
1276
|
-
/* @__PURE__ */ jsx6(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: "Copy Address" })
|
|
1277
|
-
] });
|
|
1278
|
-
};
|
|
1279
1585
|
modal.open({
|
|
1280
|
-
title:
|
|
1586
|
+
title: intl.formatMessage({
|
|
1587
|
+
id: "receive"
|
|
1588
|
+
}),
|
|
1281
1589
|
content: ReceiveModal
|
|
1282
1590
|
});
|
|
1283
1591
|
};
|
|
1592
|
+
const showImportTokenModal = () => {
|
|
1593
|
+
modal.open({
|
|
1594
|
+
title: intl.formatMessage({
|
|
1595
|
+
id: "Customized Token"
|
|
1596
|
+
}),
|
|
1597
|
+
content: ImportTokenModal
|
|
1598
|
+
});
|
|
1599
|
+
};
|
|
1600
|
+
const showSendListModal = () => {
|
|
1601
|
+
modal.open({
|
|
1602
|
+
title: intl.formatMessage({
|
|
1603
|
+
id: "send"
|
|
1604
|
+
}),
|
|
1605
|
+
content: TokenSendList
|
|
1606
|
+
});
|
|
1607
|
+
};
|
|
1608
|
+
return {
|
|
1609
|
+
showReceiveModal,
|
|
1610
|
+
showImportTokenModal,
|
|
1611
|
+
showSendListModal
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
function useMatchWalletRecords() {
|
|
1615
|
+
const [hasMore, setHasMore] = useState7(true);
|
|
1616
|
+
const [items, setItems] = useState7([]);
|
|
1617
|
+
const { chainId, publicClient } = useMatchChain();
|
|
1618
|
+
const { address } = useWallet();
|
|
1619
|
+
const hasMoreRef = useRef(hasMore);
|
|
1620
|
+
const nextPageParamsRef = useRef(void 0);
|
|
1621
|
+
const { getContract, setContracts } = useContractStore_default();
|
|
1622
|
+
const fetchMoreData = async () => {
|
|
1623
|
+
const chainIdStr = chainId ? chainId.toString() : "";
|
|
1624
|
+
if (!hasMoreRef.current || !chainIdStr) {
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
const res = await getUserWalletTransactionsApi({
|
|
1628
|
+
chain_id: chainIdStr,
|
|
1629
|
+
...nextPageParamsRef.current
|
|
1630
|
+
});
|
|
1631
|
+
if (isSuccess(res)) {
|
|
1632
|
+
if (res.data && res.data.transactions && res.data.transactions.length > 0) {
|
|
1633
|
+
const contractList = res.data.transactions.filter((item) => item.input.toLowerCase().substring(0, 10) == "0xa9059cbb").map((item) => item.to);
|
|
1634
|
+
const contractUnique = Array.from(new Set(contractList)).filter((item) => {
|
|
1635
|
+
const contract = getContract(chainId || 0, item);
|
|
1636
|
+
if (!contract) {
|
|
1637
|
+
return true;
|
|
1638
|
+
}
|
|
1639
|
+
if (!contract.symbol && !contract.name) {
|
|
1640
|
+
return true;
|
|
1641
|
+
}
|
|
1642
|
+
if (!contract.decimals) {
|
|
1643
|
+
return true;
|
|
1644
|
+
}
|
|
1645
|
+
return false;
|
|
1646
|
+
});
|
|
1647
|
+
const calls = [];
|
|
1648
|
+
for (const contract of contractUnique) {
|
|
1649
|
+
calls.push({
|
|
1650
|
+
address: contract,
|
|
1651
|
+
abi: erc20Abi,
|
|
1652
|
+
functionName: "symbol",
|
|
1653
|
+
args: []
|
|
1654
|
+
});
|
|
1655
|
+
calls.push({
|
|
1656
|
+
address: contract,
|
|
1657
|
+
abi: erc20Abi,
|
|
1658
|
+
functionName: "decimals",
|
|
1659
|
+
args: []
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
const results = await publicClient?.multicall({ contracts: calls });
|
|
1663
|
+
if (results) {
|
|
1664
|
+
console.log("contract results", calls, results);
|
|
1665
|
+
const contractMap = [];
|
|
1666
|
+
for (let i = 0; i < contractUnique.length; i++) {
|
|
1667
|
+
const info = {};
|
|
1668
|
+
if (results[i * 2].status == "success") {
|
|
1669
|
+
info.symbol = results[i * 2].result;
|
|
1670
|
+
}
|
|
1671
|
+
if (results[i * 2 + 1].status == "success") {
|
|
1672
|
+
info.decimals = results[i * 2 + 1].result;
|
|
1673
|
+
}
|
|
1674
|
+
contractMap.push({
|
|
1675
|
+
chainId: chainId || 0,
|
|
1676
|
+
contractAddress: contractUnique[i],
|
|
1677
|
+
info
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
setContracts(contractMap);
|
|
1681
|
+
}
|
|
1682
|
+
setItems(items.concat(res.data.transactions || []));
|
|
1683
|
+
}
|
|
1684
|
+
hasMoreRef.current = res.data && res.data.transactions && res.data.transactions.length >= 50;
|
|
1685
|
+
setHasMore(hasMoreRef.current);
|
|
1686
|
+
nextPageParamsRef.current = res.data.next_page_params;
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
const onInit = async () => {
|
|
1690
|
+
nextPageParamsRef.current = void 0;
|
|
1691
|
+
setItems([]);
|
|
1692
|
+
setHasMore(true);
|
|
1693
|
+
hasMoreRef.current = true;
|
|
1694
|
+
fetchMoreData();
|
|
1695
|
+
};
|
|
1696
|
+
useEffect6(() => {
|
|
1697
|
+
if (chainId && address) {
|
|
1698
|
+
onInit();
|
|
1699
|
+
}
|
|
1700
|
+
}, [chainId, address]);
|
|
1701
|
+
const { getTransactions, removeTransaction } = useTransactionStore_default();
|
|
1702
|
+
const localTransaction = useMemo4(() => {
|
|
1703
|
+
return getTransactions(chainId || 0, address) || [];
|
|
1704
|
+
}, [getTransactions, chainId]);
|
|
1705
|
+
useEffect6(() => {
|
|
1706
|
+
const removeList = localTransaction.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
1707
|
+
removeList.forEach((item) => {
|
|
1708
|
+
removeTransaction({
|
|
1709
|
+
chainId: chainId || 0,
|
|
1710
|
+
hash: item.hash,
|
|
1711
|
+
address
|
|
1712
|
+
});
|
|
1713
|
+
});
|
|
1714
|
+
}, [localTransaction, items]);
|
|
1715
|
+
return {
|
|
1716
|
+
items: [
|
|
1717
|
+
...getTransactions(chainId || 0, address) || [],
|
|
1718
|
+
...items
|
|
1719
|
+
].sort((a, b) => {
|
|
1720
|
+
const btimestamp = typeof b.timestamp === "string" ? parseInt(b.timestamp) : b.timestamp;
|
|
1721
|
+
const atimestamp = typeof a.timestamp === "string" ? parseInt(a.timestamp) : a.timestamp;
|
|
1722
|
+
return btimestamp - atimestamp;
|
|
1723
|
+
}),
|
|
1724
|
+
fetchMoreData,
|
|
1725
|
+
hasMore
|
|
1726
|
+
};
|
|
1727
|
+
}
|
|
1728
|
+
function useMatchWalletAssets({
|
|
1729
|
+
importTokenOptions,
|
|
1730
|
+
assetListOptions
|
|
1731
|
+
} = {}) {
|
|
1732
|
+
const { chainId, chain } = useMatchChain();
|
|
1733
|
+
const importTokenQuery = useImportTokenListQuery({
|
|
1734
|
+
chainId: chainId || 0,
|
|
1735
|
+
...importTokenOptions
|
|
1736
|
+
});
|
|
1737
|
+
const assetListQuery = useAssetListQuery({
|
|
1738
|
+
chainId: chainId || 0,
|
|
1739
|
+
...assetListOptions
|
|
1740
|
+
});
|
|
1741
|
+
const mergedAssets = useMemo4(() => {
|
|
1742
|
+
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
1743
|
+
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
1744
|
+
...asset,
|
|
1745
|
+
isAuto: true
|
|
1746
|
+
}));
|
|
1747
|
+
const importTokens = (importTokenQuery.data || []).map((token) => ({
|
|
1748
|
+
...token,
|
|
1749
|
+
isCustom: true
|
|
1750
|
+
}));
|
|
1751
|
+
const assetMap = /* @__PURE__ */ new Map();
|
|
1752
|
+
assetList.forEach((asset) => {
|
|
1753
|
+
const key = `${asset.chain_id}-${asset.address.toLowerCase()}`;
|
|
1754
|
+
assetMap.set(key, asset);
|
|
1755
|
+
});
|
|
1756
|
+
importTokens.forEach((token) => {
|
|
1757
|
+
const key = `${token.chain_id}-${token.address.toLowerCase()}`;
|
|
1758
|
+
if (assetMap.has(key)) {
|
|
1759
|
+
const existing = assetMap.get(key);
|
|
1760
|
+
assetMap.set(key, {
|
|
1761
|
+
...existing,
|
|
1762
|
+
symbol: token.symbol,
|
|
1763
|
+
decimals: token.decimals,
|
|
1764
|
+
isCustom: true,
|
|
1765
|
+
isAuto: existing.isAuto ?? false
|
|
1766
|
+
});
|
|
1767
|
+
} else {
|
|
1768
|
+
assetMap.set(key, token);
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
const list = Array.from(assetMap.values()).sort((a, b) => {
|
|
1772
|
+
return (b.isAuto ? 1 : 0) - (a.isAuto ? 1 : 0);
|
|
1773
|
+
});
|
|
1774
|
+
const nativeToken = list.find((asset) => asset.address.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase());
|
|
1775
|
+
if (!nativeToken) {
|
|
1776
|
+
list.unshift({
|
|
1777
|
+
chain_id: chain?.id.toString() || "",
|
|
1778
|
+
address: NATIVE_TOKEN_ADDRESS,
|
|
1779
|
+
decimals: 18,
|
|
1780
|
+
symbol: chain?.nativeCurrency.symbol,
|
|
1781
|
+
name: chain?.nativeCurrency.name,
|
|
1782
|
+
balance: 0,
|
|
1783
|
+
icon: chain?.nativeCurrency.icon
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
return list;
|
|
1787
|
+
}, [assetListQuery.data, importTokenQuery.data]);
|
|
1788
|
+
return {
|
|
1789
|
+
importTokenQuery,
|
|
1790
|
+
assetListQuery,
|
|
1791
|
+
mergedAssets
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
var MULTICALL_LIMIT = 100;
|
|
1795
|
+
function useMatchWalletAssetList({
|
|
1796
|
+
list
|
|
1797
|
+
}) {
|
|
1798
|
+
const { publicClient, chain } = useMatchChain();
|
|
1799
|
+
const { address } = useWallet();
|
|
1800
|
+
const { assets, setAssets } = useLocalStore_default();
|
|
1801
|
+
const nativeToken = list.find((asset) => asset.address.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase()) || {
|
|
1802
|
+
chain_id: chain?.id || "",
|
|
1803
|
+
address: NATIVE_TOKEN_ADDRESS,
|
|
1804
|
+
decimals: 18,
|
|
1805
|
+
symbol: chain?.nativeCurrency.symbol,
|
|
1806
|
+
name: chain?.nativeCurrency.name,
|
|
1807
|
+
balance: 0
|
|
1808
|
+
};
|
|
1809
|
+
const nativeBalanceQuery = useQuery2({
|
|
1810
|
+
queryKey: ["nativeBalance", nativeToken?.chain_id],
|
|
1811
|
+
queryFn: async () => {
|
|
1812
|
+
if (!nativeToken || !publicClient) return null;
|
|
1813
|
+
try {
|
|
1814
|
+
return await publicClient.getBalance({
|
|
1815
|
+
address
|
|
1816
|
+
});
|
|
1817
|
+
} catch (error) {
|
|
1818
|
+
console.error("Native Token Balance Error:", error);
|
|
1819
|
+
return null;
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
enabled: !!nativeToken && !!publicClient,
|
|
1823
|
+
refetchInterval: 15e3,
|
|
1824
|
+
// Refresh every 15 seconds
|
|
1825
|
+
retry: 3
|
|
1826
|
+
// Retry up to 3 times if failed
|
|
1827
|
+
});
|
|
1828
|
+
const erc20Tokens = useMemo4(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
1829
|
+
const erc20Abi3 = [
|
|
1830
|
+
{
|
|
1831
|
+
"constant": true,
|
|
1832
|
+
"inputs": [
|
|
1833
|
+
{
|
|
1834
|
+
"name": "_owner",
|
|
1835
|
+
"type": "address"
|
|
1836
|
+
}
|
|
1837
|
+
],
|
|
1838
|
+
"name": "balanceOf",
|
|
1839
|
+
"outputs": [
|
|
1840
|
+
{
|
|
1841
|
+
"name": "balance",
|
|
1842
|
+
"type": "uint256"
|
|
1843
|
+
}
|
|
1844
|
+
],
|
|
1845
|
+
"payable": false,
|
|
1846
|
+
"stateMutability": "view",
|
|
1847
|
+
"type": "function"
|
|
1848
|
+
}
|
|
1849
|
+
];
|
|
1850
|
+
const erc20BalanceQuery = useQuery2({
|
|
1851
|
+
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
1852
|
+
queryFn: async () => {
|
|
1853
|
+
if (!erc20Tokens.length || !publicClient) return [];
|
|
1854
|
+
const calls = erc20Tokens.map((token) => ({
|
|
1855
|
+
address: token.address,
|
|
1856
|
+
abi: erc20Abi3,
|
|
1857
|
+
functionName: "balanceOf",
|
|
1858
|
+
args: [address]
|
|
1859
|
+
}));
|
|
1860
|
+
let balances = [];
|
|
1861
|
+
for (let i = 0; i < calls.length; i += MULTICALL_LIMIT) {
|
|
1862
|
+
const batchCalls = calls.slice(i, i + MULTICALL_LIMIT);
|
|
1863
|
+
try {
|
|
1864
|
+
const results = await publicClient.multicall({ contracts: batchCalls });
|
|
1865
|
+
balances.push(...results);
|
|
1866
|
+
} catch (error) {
|
|
1867
|
+
console.error("MultiCall Error:", error);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
return balances;
|
|
1871
|
+
},
|
|
1872
|
+
enabled: erc20Tokens.length > 0 && !!publicClient,
|
|
1873
|
+
refetchInterval: 15e3,
|
|
1874
|
+
// Refresh every 15 seconds
|
|
1875
|
+
retry: 3
|
|
1876
|
+
});
|
|
1877
|
+
const enrichedAssets = useMemo4(() => {
|
|
1878
|
+
if (!list) return [];
|
|
1879
|
+
const erc20Balances = erc20BalanceQuery.data || [];
|
|
1880
|
+
return list.map((asset) => {
|
|
1881
|
+
let balanceValue = "0";
|
|
1882
|
+
let balance = 0;
|
|
1883
|
+
const decimals = typeof asset.decimals === "string" ? parseInt(asset.decimals) : asset.decimals;
|
|
1884
|
+
if (asset.address === NATIVE_TOKEN_ADDRESS) {
|
|
1885
|
+
balanceValue = nativeBalanceQuery.data?.toString() || "0";
|
|
1886
|
+
balance = nativeBalanceQuery.data ? Number(formatUnits2(nativeBalanceQuery.data, decimals)) : 0;
|
|
1887
|
+
} else {
|
|
1888
|
+
const index = erc20Tokens.findIndex((t) => t.address === asset.address);
|
|
1889
|
+
if (index !== -1 && erc20Balances[index] && erc20Balances[index].status === "success") {
|
|
1890
|
+
balance = Number(formatUnits2(erc20Balances[index].result, decimals));
|
|
1891
|
+
balanceValue = erc20Balances[index].result?.toString() || "0";
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
const value = asset.isAuto ? balance * (asset.price || 0) : 0;
|
|
1895
|
+
return { ...asset, balance, value, balanceValue };
|
|
1896
|
+
});
|
|
1897
|
+
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
1898
|
+
useEffect6(() => {
|
|
1899
|
+
const list2 = enrichedAssets.sort((a, b) => {
|
|
1900
|
+
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
1901
|
+
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
1902
|
+
if (a.isAuto && b.isAuto) return b.value - a.value;
|
|
1903
|
+
if (a.isAuto) return -1;
|
|
1904
|
+
if (b.isAuto) return 1;
|
|
1905
|
+
if (a.isCustom && !a.isAuto && a.balance > 0) return -1;
|
|
1906
|
+
if (b.isCustom && !b.isAuto && b.balance > 0) return 1;
|
|
1907
|
+
return 0;
|
|
1908
|
+
});
|
|
1909
|
+
setAssets(list2);
|
|
1910
|
+
}, [enrichedAssets]);
|
|
1284
1911
|
return {
|
|
1285
|
-
|
|
1912
|
+
list: assets,
|
|
1913
|
+
isLoading: nativeBalanceQuery.isLoading || erc20BalanceQuery.isLoading,
|
|
1914
|
+
nativeBalance: nativeBalanceQuery.data,
|
|
1915
|
+
erc20Balances: erc20BalanceQuery.data
|
|
1286
1916
|
};
|
|
1287
1917
|
}
|
|
1288
1918
|
|
|
1289
1919
|
// src/hooks/useReceipt.tsx
|
|
1290
1920
|
import { useState as useState8, useCallback as useCallback4, useEffect as useEffect7 } from "react";
|
|
1291
|
-
import { useQuery as
|
|
1292
|
-
import { createPublicClient, defineChain, http } from "viem";
|
|
1921
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
1922
|
+
import { createPublicClient as createPublicClient3, defineChain, http as http3 } from "viem";
|
|
1293
1923
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
1294
1924
|
var MAX_CACHE_SIZE = 500;
|
|
1295
1925
|
var STORAGE_KEY = "match_receipt_logs";
|
|
@@ -1397,7 +2027,7 @@ function useReceipt({
|
|
|
1397
2027
|
const cache = useReceiptCache();
|
|
1398
2028
|
const chain = list?.find((item) => item.id === chainId);
|
|
1399
2029
|
const [shouldRefetch, setShouldRefetch] = useState8(true);
|
|
1400
|
-
const query =
|
|
2030
|
+
const query = useQuery3({
|
|
1401
2031
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
1402
2032
|
queryFn: async () => {
|
|
1403
2033
|
if (!chain || !hash) return false;
|
|
@@ -1406,12 +2036,11 @@ function useReceipt({
|
|
|
1406
2036
|
return cache.get(cacheKey);
|
|
1407
2037
|
}
|
|
1408
2038
|
try {
|
|
1409
|
-
const publicClient =
|
|
1410
|
-
//@ts-ignore
|
|
2039
|
+
const publicClient = createPublicClient3({
|
|
1411
2040
|
chain: defineChain(chain),
|
|
1412
|
-
transport:
|
|
2041
|
+
transport: http3()
|
|
1413
2042
|
});
|
|
1414
|
-
const receipt = await publicClient.
|
|
2043
|
+
const receipt = await publicClient.getTransactionReceipt({ hash });
|
|
1415
2044
|
if (!receipt) {
|
|
1416
2045
|
return false;
|
|
1417
2046
|
}
|
|
@@ -1431,28 +2060,257 @@ function useReceipt({
|
|
|
1431
2060
|
return query;
|
|
1432
2061
|
}
|
|
1433
2062
|
|
|
2063
|
+
// src/hooks/useTransaction.tsx
|
|
2064
|
+
import { useState as useState9, useCallback as useCallback5, useEffect as useEffect8 } from "react";
|
|
2065
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
2066
|
+
import { createPublicClient as createPublicClient4, defineChain as defineChain2, http as http4 } from "viem";
|
|
2067
|
+
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
2068
|
+
var MAX_CACHE_SIZE2 = 500;
|
|
2069
|
+
var STORAGE_KEY2 = "match_transaction_logs";
|
|
2070
|
+
function useTransactionCache() {
|
|
2071
|
+
const [cache, setCache] = useState9(/* @__PURE__ */ new Map());
|
|
2072
|
+
const isLocalStorageAvailable = (() => {
|
|
2073
|
+
try {
|
|
2074
|
+
const testKey = "__test__";
|
|
2075
|
+
localStorage.setItem(testKey, "1");
|
|
2076
|
+
localStorage.removeItem(testKey);
|
|
2077
|
+
return true;
|
|
2078
|
+
} catch (e) {
|
|
2079
|
+
return false;
|
|
2080
|
+
}
|
|
2081
|
+
})();
|
|
2082
|
+
useEffect8(() => {
|
|
2083
|
+
if (isLocalStorageAvailable) {
|
|
2084
|
+
try {
|
|
2085
|
+
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
2086
|
+
if (storedData) {
|
|
2087
|
+
try {
|
|
2088
|
+
const parsed = JSON.parse(storedData);
|
|
2089
|
+
const now = Date.now();
|
|
2090
|
+
const validEntries = Object.entries(parsed).filter(([_, entry]) => typeof entry === "object" && entry !== null && "timestamp" in entry && now - entry.timestamp <= CACHE_TTL2).map(([key, entry]) => [key, entry]);
|
|
2091
|
+
setCache(new Map(validEntries));
|
|
2092
|
+
} catch (e) {
|
|
2093
|
+
console.error("Failed to parse cache from localStorage:", e);
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
} catch (e) {
|
|
2097
|
+
console.error("Failed to load cache from localStorage:", e);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
}, []);
|
|
2101
|
+
const updateLocalStorage = useCallback5((updatedCache) => {
|
|
2102
|
+
if (isLocalStorageAvailable) {
|
|
2103
|
+
try {
|
|
2104
|
+
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
2105
|
+
let parsed = {};
|
|
2106
|
+
if (storedData) {
|
|
2107
|
+
parsed = JSON.parse(storedData);
|
|
2108
|
+
}
|
|
2109
|
+
updatedCache.forEach((entry, key) => {
|
|
2110
|
+
parsed[key] = entry;
|
|
2111
|
+
});
|
|
2112
|
+
localStorage.setItem(STORAGE_KEY2, JSON.stringify(parsed));
|
|
2113
|
+
} catch (e) {
|
|
2114
|
+
console.error("Failed to update localStorage:", e);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}, []);
|
|
2118
|
+
const set = useCallback5((key, value) => {
|
|
2119
|
+
const now = Date.now();
|
|
2120
|
+
const newCache = new Map(cache);
|
|
2121
|
+
newCache.forEach((entry, k) => {
|
|
2122
|
+
if (now - entry.timestamp > CACHE_TTL2) {
|
|
2123
|
+
newCache.delete(k);
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
if (newCache.size >= MAX_CACHE_SIZE2) {
|
|
2127
|
+
const firstKey = newCache.keys().next().value;
|
|
2128
|
+
if (firstKey !== void 0) {
|
|
2129
|
+
newCache.delete(firstKey);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
newCache.set(key, { value, timestamp: now });
|
|
2133
|
+
setCache(newCache);
|
|
2134
|
+
updateLocalStorage(newCache);
|
|
2135
|
+
}, [cache, updateLocalStorage]);
|
|
2136
|
+
const get = useCallback5((key) => {
|
|
2137
|
+
const entry = cache.get(key);
|
|
2138
|
+
if (entry) {
|
|
2139
|
+
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
2140
|
+
const newCache = new Map(cache);
|
|
2141
|
+
newCache.delete(key);
|
|
2142
|
+
setCache(newCache);
|
|
2143
|
+
updateLocalStorage(newCache);
|
|
2144
|
+
return void 0;
|
|
2145
|
+
}
|
|
2146
|
+
return entry.value;
|
|
2147
|
+
}
|
|
2148
|
+
return void 0;
|
|
2149
|
+
}, [cache, updateLocalStorage]);
|
|
2150
|
+
const del = useCallback5((key) => {
|
|
2151
|
+
if (cache.has(key)) {
|
|
2152
|
+
const newCache = new Map(cache);
|
|
2153
|
+
newCache.delete(key);
|
|
2154
|
+
setCache(newCache);
|
|
2155
|
+
updateLocalStorage(newCache);
|
|
2156
|
+
}
|
|
2157
|
+
}, [cache, updateLocalStorage]);
|
|
2158
|
+
const clear = useCallback5(() => {
|
|
2159
|
+
setCache(/* @__PURE__ */ new Map());
|
|
2160
|
+
if (isLocalStorageAvailable) {
|
|
2161
|
+
localStorage.removeItem(STORAGE_KEY2);
|
|
2162
|
+
}
|
|
2163
|
+
}, [isLocalStorageAvailable]);
|
|
2164
|
+
return { set, get, del, clear };
|
|
2165
|
+
}
|
|
2166
|
+
function useTransaction({
|
|
2167
|
+
chainId,
|
|
2168
|
+
hash
|
|
2169
|
+
}) {
|
|
2170
|
+
const { list } = useMatchChain();
|
|
2171
|
+
const cache = useTransactionCache();
|
|
2172
|
+
const chain = list?.find((item) => item.id === chainId);
|
|
2173
|
+
const [shouldRefetch, setShouldRefetch] = useState9(true);
|
|
2174
|
+
const query = useQuery4({
|
|
2175
|
+
queryKey: ["match-tx-transaction", hash, chain],
|
|
2176
|
+
queryFn: async () => {
|
|
2177
|
+
if (!chain || !hash) return false;
|
|
2178
|
+
const cacheKey = `${chain.id}-${hash}`;
|
|
2179
|
+
if (cache.get(cacheKey)) {
|
|
2180
|
+
return cache.get(cacheKey);
|
|
2181
|
+
}
|
|
2182
|
+
try {
|
|
2183
|
+
const publicClient = createPublicClient4({
|
|
2184
|
+
chain: defineChain2(chain),
|
|
2185
|
+
transport: http4()
|
|
2186
|
+
});
|
|
2187
|
+
const transaction = await publicClient.getTransaction({ hash });
|
|
2188
|
+
if (!transaction) {
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
cache.set(cacheKey, transaction);
|
|
2192
|
+
return transaction;
|
|
2193
|
+
} catch (e) {
|
|
2194
|
+
return false;
|
|
2195
|
+
}
|
|
2196
|
+
},
|
|
2197
|
+
refetchInterval: shouldRefetch ? 1e4 : false
|
|
2198
|
+
});
|
|
2199
|
+
useEffect8(() => {
|
|
2200
|
+
if (query.data) {
|
|
2201
|
+
setShouldRefetch(false);
|
|
2202
|
+
}
|
|
2203
|
+
}, [query.data]);
|
|
2204
|
+
return query;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
// src/store/useModalStore.ts
|
|
2208
|
+
import { create as create5 } from "zustand";
|
|
2209
|
+
|
|
2210
|
+
// src/hooks/useConfig.tsx
|
|
2211
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2212
|
+
var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2213
|
+
var WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
2214
|
+
function useWalletConfig() {
|
|
2215
|
+
const isDownMd = useDownMd();
|
|
2216
|
+
const walletMap = {
|
|
2217
|
+
evm: {
|
|
2218
|
+
icon: /* @__PURE__ */ jsx7(EVMDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2219
|
+
activeIcon: /* @__PURE__ */ jsx7(EVMLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2220
|
+
name: "EVM",
|
|
2221
|
+
method: "evm"
|
|
2222
|
+
},
|
|
2223
|
+
sol: {
|
|
2224
|
+
icon: /* @__PURE__ */ jsx7(SOLDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2225
|
+
activeIcon: /* @__PURE__ */ jsx7(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2226
|
+
name: "SOL",
|
|
2227
|
+
method: "sol"
|
|
2228
|
+
},
|
|
2229
|
+
btc: {
|
|
2230
|
+
icon: /* @__PURE__ */ jsx7(BTCDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2231
|
+
activeIcon: /* @__PURE__ */ jsx7(BTCLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2232
|
+
name: "BTC",
|
|
2233
|
+
method: "btc"
|
|
2234
|
+
},
|
|
2235
|
+
tron: {
|
|
2236
|
+
icon: /* @__PURE__ */ jsx7(TRXDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
2237
|
+
activeIcon: /* @__PURE__ */ jsx7(TRXLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2238
|
+
name: "TRON",
|
|
2239
|
+
method: "tron"
|
|
2240
|
+
},
|
|
2241
|
+
ton: {
|
|
2242
|
+
icon: /* @__PURE__ */ jsx7(TonLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
2243
|
+
activeIcon: /* @__PURE__ */ jsx7(TonLightIcon2, { size: isDownMd ? 36 : 40 }),
|
|
2244
|
+
name: "TON",
|
|
2245
|
+
method: "ton"
|
|
2246
|
+
}
|
|
2247
|
+
};
|
|
2248
|
+
return {
|
|
2249
|
+
walletMap
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
// src/store/useModalStore.ts
|
|
2254
|
+
var useSOLModalStore = create5((set) => ({
|
|
2255
|
+
isOpen: false,
|
|
2256
|
+
type: "",
|
|
2257
|
+
open: (type) => set({ isOpen: true, type }),
|
|
2258
|
+
close: () => set({ isOpen: false })
|
|
2259
|
+
}));
|
|
2260
|
+
var useTRONModalStore = create5((set) => ({
|
|
2261
|
+
isOpen: false,
|
|
2262
|
+
type: "",
|
|
2263
|
+
open: (type) => set({ isOpen: true, type }),
|
|
2264
|
+
close: () => set({ isOpen: false })
|
|
2265
|
+
}));
|
|
2266
|
+
var useTONModalStore = create5((set) => ({
|
|
2267
|
+
isOpen: false,
|
|
2268
|
+
type: "",
|
|
2269
|
+
open: (type) => set({ isOpen: true, type }),
|
|
2270
|
+
close: () => set({ isOpen: false })
|
|
2271
|
+
}));
|
|
2272
|
+
var useBTCModalStore = create5((set) => ({
|
|
2273
|
+
isOpen: false,
|
|
2274
|
+
type: "",
|
|
2275
|
+
open: (type) => set({ isOpen: true, type }),
|
|
2276
|
+
close: () => set({ isOpen: false })
|
|
2277
|
+
}));
|
|
2278
|
+
var useCEXBindModalStore = create5((set) => ({
|
|
2279
|
+
type: "",
|
|
2280
|
+
isOpen: false,
|
|
2281
|
+
open: (type) => set({ isOpen: true, type }),
|
|
2282
|
+
close: () => set({ isOpen: false })
|
|
2283
|
+
}));
|
|
2284
|
+
var useWalletModalStore = create5((set) => ({
|
|
2285
|
+
isOpen: false,
|
|
2286
|
+
type: "",
|
|
2287
|
+
methods: [],
|
|
2288
|
+
open: (type, methods = DEFAULT_WALLET_METHODS) => set({ isOpen: true, type, methods }),
|
|
2289
|
+
close: () => set({ isOpen: false })
|
|
2290
|
+
}));
|
|
2291
|
+
|
|
1434
2292
|
// src/components/CEXBindModal/index.tsx
|
|
1435
|
-
import { useEffect as
|
|
1436
|
-
import { FormattedMessage as
|
|
1437
|
-
import { jsx as
|
|
2293
|
+
import { useEffect as useEffect9, useMemo as useMemo5, useState as useState10 } from "react";
|
|
2294
|
+
import { FormattedMessage as FormattedMessage3, useIntl as useIntl3 } from "react-intl";
|
|
2295
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1438
2296
|
function CEXBindModal({
|
|
1439
2297
|
onClose,
|
|
1440
2298
|
type,
|
|
1441
2299
|
isOpen = false,
|
|
1442
2300
|
...props
|
|
1443
2301
|
}) {
|
|
1444
|
-
const intl =
|
|
2302
|
+
const intl = useIntl3();
|
|
1445
2303
|
const { events } = useMatch();
|
|
1446
|
-
const [APIPassphrase, setAPIPassphrase] =
|
|
2304
|
+
const [APIPassphrase, setAPIPassphrase] = useState10("");
|
|
1447
2305
|
const { refreshOverview } = useUserInfo();
|
|
1448
|
-
const [loading, setLoading] =
|
|
1449
|
-
const [key, setKey] =
|
|
1450
|
-
const [secret, setSecret] =
|
|
1451
|
-
const [error, setError] =
|
|
2306
|
+
const [loading, setLoading] = useState10(false);
|
|
2307
|
+
const [key, setKey] = useState10("");
|
|
2308
|
+
const [secret, setSecret] = useState10("");
|
|
2309
|
+
const [error, setError] = useState10("");
|
|
1452
2310
|
const needPassphrase = useMemo5(() => {
|
|
1453
2311
|
return ["bitget", "okx"].includes(type.toLowerCase());
|
|
1454
2312
|
}, [type]);
|
|
1455
|
-
|
|
2313
|
+
useEffect9(() => {
|
|
1456
2314
|
if (isOpen) {
|
|
1457
2315
|
setSecret("");
|
|
1458
2316
|
setKey("");
|
|
@@ -1489,20 +2347,20 @@ function CEXBindModal({
|
|
|
1489
2347
|
setLoading(false);
|
|
1490
2348
|
}
|
|
1491
2349
|
};
|
|
1492
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx8(ModalWithHeader, { showClose: true, isOpen, onClose, title: intl.formatMessage({
|
|
1493
2351
|
id: "CEXBindTitle"
|
|
1494
2352
|
}, {
|
|
1495
2353
|
type
|
|
1496
2354
|
}), ...props, children: /* @__PURE__ */ jsxs6("div", { className: "matchid-cex-modal", children: [
|
|
1497
2355
|
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsx8("p", { children: /* @__PURE__ */ jsx8(FormattedMessage3, { id: "CEXBindAttention" }) }),
|
|
2357
|
+
/* @__PURE__ */ jsx8("p", { children: /* @__PURE__ */ jsx8(FormattedMessage3, { id: "CEXBindTips1" }) }),
|
|
2358
|
+
/* @__PURE__ */ jsx8("p", { children: /* @__PURE__ */ jsx8(FormattedMessage3, { id: "CEXBindTips2" }) }),
|
|
2359
|
+
/* @__PURE__ */ jsx8("p", { children: /* @__PURE__ */ jsx8(FormattedMessage3, { id: "CEXBindTips3" }) })
|
|
1502
2360
|
] }),
|
|
1503
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx8(Field, { label: intl.formatMessage({
|
|
1504
2362
|
id: "CEXBindApiKey"
|
|
1505
|
-
}), children: /* @__PURE__ */
|
|
2363
|
+
}), children: /* @__PURE__ */ jsx8(
|
|
1506
2364
|
Input,
|
|
1507
2365
|
{
|
|
1508
2366
|
value: key,
|
|
@@ -1510,9 +2368,9 @@ function CEXBindModal({
|
|
|
1510
2368
|
placeholder: "**** **** ****"
|
|
1511
2369
|
}
|
|
1512
2370
|
) }),
|
|
1513
|
-
/* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ jsx8(Field, { label: intl.formatMessage({
|
|
1514
2372
|
id: "CEXBindApiSecretKey"
|
|
1515
|
-
}), error: !needPassphrase && error, children: /* @__PURE__ */
|
|
2373
|
+
}), error: !needPassphrase && error, children: /* @__PURE__ */ jsx8(
|
|
1516
2374
|
Input,
|
|
1517
2375
|
{
|
|
1518
2376
|
value: secret,
|
|
@@ -1520,9 +2378,9 @@ function CEXBindModal({
|
|
|
1520
2378
|
placeholder: "**** **** ****"
|
|
1521
2379
|
}
|
|
1522
2380
|
) }),
|
|
1523
|
-
needPassphrase && /* @__PURE__ */
|
|
2381
|
+
needPassphrase && /* @__PURE__ */ jsx8(Field, { error, label: intl.formatMessage({
|
|
1524
2382
|
id: "CEXBindApiPassphrase"
|
|
1525
|
-
}), children: /* @__PURE__ */
|
|
2383
|
+
}), children: /* @__PURE__ */ jsx8(
|
|
1526
2384
|
Input,
|
|
1527
2385
|
{
|
|
1528
2386
|
value: APIPassphrase,
|
|
@@ -1530,7 +2388,7 @@ function CEXBindModal({
|
|
|
1530
2388
|
placeholder: "**** **** ****"
|
|
1531
2389
|
}
|
|
1532
2390
|
) }),
|
|
1533
|
-
/* @__PURE__ */
|
|
2391
|
+
/* @__PURE__ */ jsx8(
|
|
1534
2392
|
Button,
|
|
1535
2393
|
{
|
|
1536
2394
|
onClick: SubmitApi,
|
|
@@ -1538,14 +2396,14 @@ function CEXBindModal({
|
|
|
1538
2396
|
block: true,
|
|
1539
2397
|
loading,
|
|
1540
2398
|
disabled: !key || !secret,
|
|
1541
|
-
children: /* @__PURE__ */
|
|
2399
|
+
children: /* @__PURE__ */ jsx8(FormattedMessage3, { id: "continue" })
|
|
1542
2400
|
}
|
|
1543
2401
|
)
|
|
1544
2402
|
] }) });
|
|
1545
2403
|
}
|
|
1546
2404
|
|
|
1547
2405
|
// src/context/BusinessProvider.tsx
|
|
1548
|
-
import { Fragment, jsx as
|
|
2406
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1549
2407
|
function BusinessProvider({ children }) {
|
|
1550
2408
|
const { overview, token } = useUserInfo();
|
|
1551
2409
|
const { type: SOLType, isOpen: SOLIsOpen, close: SOLClose } = useSOLModalStore();
|
|
@@ -1554,13 +2412,12 @@ function BusinessProvider({ children }) {
|
|
|
1554
2412
|
const { type: BTCType, isOpen: BTCIsOpen, close: BTCClose } = useBTCModalStore();
|
|
1555
2413
|
const { type: CEXType, isOpen: CEXIsOpen, close: CEXClose } = useCEXBindModalStore();
|
|
1556
2414
|
const WalletModalStore = useWalletModalStore();
|
|
1557
|
-
const { close: HashPanelClose, ...hashPanelProps } = useHashPanelStore();
|
|
1558
2415
|
const walletModalClose = (func) => {
|
|
1559
2416
|
WalletModalStore.close();
|
|
1560
2417
|
func();
|
|
1561
2418
|
};
|
|
1562
2419
|
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1563
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ jsx9(
|
|
1564
2421
|
SOLModal,
|
|
1565
2422
|
{
|
|
1566
2423
|
isOpen: SOLIsOpen && (SOLType == "login" && !overview && !token || SOLType == "bind" && !!token && !!overview),
|
|
@@ -1570,7 +2427,7 @@ function BusinessProvider({ children }) {
|
|
|
1570
2427
|
zIndex: 199
|
|
1571
2428
|
}
|
|
1572
2429
|
),
|
|
1573
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ jsx9(
|
|
1574
2431
|
TRONModal,
|
|
1575
2432
|
{
|
|
1576
2433
|
isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
|
|
@@ -1580,7 +2437,7 @@ function BusinessProvider({ children }) {
|
|
|
1580
2437
|
zIndex: 199
|
|
1581
2438
|
}
|
|
1582
2439
|
),
|
|
1583
|
-
/* @__PURE__ */
|
|
2440
|
+
/* @__PURE__ */ jsx9(
|
|
1584
2441
|
TONModal,
|
|
1585
2442
|
{
|
|
1586
2443
|
isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
|
|
@@ -1590,7 +2447,7 @@ function BusinessProvider({ children }) {
|
|
|
1590
2447
|
zIndex: 199
|
|
1591
2448
|
}
|
|
1592
2449
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ jsx9(
|
|
1594
2451
|
BTCModal,
|
|
1595
2452
|
{
|
|
1596
2453
|
isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
|
|
@@ -1600,7 +2457,7 @@ function BusinessProvider({ children }) {
|
|
|
1600
2457
|
zIndex: 199
|
|
1601
2458
|
}
|
|
1602
2459
|
),
|
|
1603
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ jsx9(
|
|
1604
2461
|
CEXBindModal,
|
|
1605
2462
|
{
|
|
1606
2463
|
isOpen: CEXIsOpen && (!!token && !!overview),
|
|
@@ -1609,8 +2466,7 @@ function BusinessProvider({ children }) {
|
|
|
1609
2466
|
zIndex: 199
|
|
1610
2467
|
}
|
|
1611
2468
|
),
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */ jsx8(
|
|
2469
|
+
/* @__PURE__ */ jsx9(
|
|
1614
2470
|
WalletModal,
|
|
1615
2471
|
{
|
|
1616
2472
|
isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
|
|
@@ -1625,14 +2481,14 @@ function BusinessProvider({ children }) {
|
|
|
1625
2481
|
}
|
|
1626
2482
|
|
|
1627
2483
|
// src/context/index.tsx
|
|
1628
|
-
import { jsx as
|
|
2484
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1629
2485
|
var Providers = ({ children }) => {
|
|
1630
|
-
return /* @__PURE__ */
|
|
2486
|
+
return /* @__PURE__ */ jsx10(ToastProvider, { children: /* @__PURE__ */ jsx10(ModalProvider, { children: /* @__PURE__ */ jsx10(BusinessProvider, { children }) }) });
|
|
1631
2487
|
};
|
|
1632
2488
|
var context_default = Providers;
|
|
1633
2489
|
|
|
1634
2490
|
// src/hooks/useWalletInit.ts
|
|
1635
|
-
import { useEffect as
|
|
2491
|
+
import { useEffect as useEffect10, useRef as useRef2 } from "react";
|
|
1636
2492
|
|
|
1637
2493
|
// src/utils/wallet.ts
|
|
1638
2494
|
var sendMessage = ({ method, data, resolve, reject, timeout }) => {
|
|
@@ -1665,11 +2521,11 @@ function useWalletInit({
|
|
|
1665
2521
|
}) {
|
|
1666
2522
|
const { endpoints, token, overview, setWallet, wallet, appid, locale, refreshOverview } = useLocalStore_default();
|
|
1667
2523
|
const { setWalletReady, walletReady } = useStore_default();
|
|
1668
|
-
const iframeReadyRef =
|
|
1669
|
-
|
|
2524
|
+
const iframeReadyRef = useRef2(walletReady);
|
|
2525
|
+
useEffect10(() => {
|
|
1670
2526
|
setWallet(config);
|
|
1671
2527
|
}, [config]);
|
|
1672
|
-
|
|
2528
|
+
useEffect10(() => {
|
|
1673
2529
|
matchlog_default.log("sdk.mpc.status", walletReady, iframeReadyRef.current);
|
|
1674
2530
|
iframeReadyRef.current = walletReady;
|
|
1675
2531
|
if (iframeReadyRef.current) {
|
|
@@ -1686,7 +2542,7 @@ function useWalletInit({
|
|
|
1686
2542
|
onReady();
|
|
1687
2543
|
}
|
|
1688
2544
|
}, [walletReady]);
|
|
1689
|
-
|
|
2545
|
+
useEffect10(() => {
|
|
1690
2546
|
if (!endpoints.auth || !appid || !token || !config) {
|
|
1691
2547
|
const existingIframe = getWalletIframe();
|
|
1692
2548
|
if (existingIframe) {
|
|
@@ -1786,7 +2642,7 @@ function useWalletInit({
|
|
|
1786
2642
|
}
|
|
1787
2643
|
}
|
|
1788
2644
|
}, [endpoints.auth, appid, token, config]);
|
|
1789
|
-
|
|
2645
|
+
useEffect10(() => {
|
|
1790
2646
|
const messageHandle = async (e) => {
|
|
1791
2647
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
1792
2648
|
return;
|
|
@@ -1867,7 +2723,7 @@ function useWalletInit({
|
|
|
1867
2723
|
}
|
|
1868
2724
|
|
|
1869
2725
|
// src/hooks/useInit.tsx
|
|
1870
|
-
import { useEffect as
|
|
2726
|
+
import { useEffect as useEffect11, useRef as useRef3 } from "react";
|
|
1871
2727
|
function useInit({
|
|
1872
2728
|
theme,
|
|
1873
2729
|
appid,
|
|
@@ -1887,23 +2743,23 @@ function useInit({
|
|
|
1887
2743
|
locale: realLocale
|
|
1888
2744
|
} = useLocalStore_default();
|
|
1889
2745
|
const walletModalStore = useWalletModalStore();
|
|
1890
|
-
const overviewLoadingRef =
|
|
2746
|
+
const overviewLoadingRef = useRef3(false);
|
|
1891
2747
|
const searchParams = new URLSearchParams(window.location.search);
|
|
1892
2748
|
const matchToken = searchParams.get("matchToken");
|
|
1893
2749
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
1894
|
-
|
|
2750
|
+
useEffect11(() => {
|
|
1895
2751
|
setTheme(theme);
|
|
1896
2752
|
}, [theme]);
|
|
1897
|
-
|
|
2753
|
+
useEffect11(() => {
|
|
1898
2754
|
setAppid(appid);
|
|
1899
2755
|
}, [appid]);
|
|
1900
|
-
|
|
2756
|
+
useEffect11(() => {
|
|
1901
2757
|
setEndpoints(realEndpoints);
|
|
1902
2758
|
}, [realEndpoints]);
|
|
1903
|
-
|
|
2759
|
+
useEffect11(() => {
|
|
1904
2760
|
setLocale(locale || "en");
|
|
1905
2761
|
}, [locale]);
|
|
1906
|
-
|
|
2762
|
+
useEffect11(() => {
|
|
1907
2763
|
if (matchToken) {
|
|
1908
2764
|
const tokenData = JSON.parse(atob(matchToken));
|
|
1909
2765
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -1914,7 +2770,7 @@ function useInit({
|
|
|
1914
2770
|
}
|
|
1915
2771
|
}
|
|
1916
2772
|
}, [matchToken]);
|
|
1917
|
-
|
|
2773
|
+
useEffect11(() => {
|
|
1918
2774
|
const onLoginMessage = (event) => {
|
|
1919
2775
|
const res = event.data;
|
|
1920
2776
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -1951,7 +2807,7 @@ function useInit({
|
|
|
1951
2807
|
overviewLoadingRef.current = false;
|
|
1952
2808
|
}
|
|
1953
2809
|
};
|
|
1954
|
-
|
|
2810
|
+
useEffect11(() => {
|
|
1955
2811
|
if (token) {
|
|
1956
2812
|
loadOverview();
|
|
1957
2813
|
}
|
|
@@ -2034,7 +2890,30 @@ var en_default = {
|
|
|
2034
2890
|
CEXBindApiSecretKey: "API Secret Key",
|
|
2035
2891
|
CEXBindApiPassphrase: "API Passphrase",
|
|
2036
2892
|
cancel: "Cancel",
|
|
2037
|
-
walletLoading: "Wallet service is loading"
|
|
2893
|
+
walletLoading: "Wallet service is loading",
|
|
2894
|
+
tokenDetails: "Token Details",
|
|
2895
|
+
tokenAmountMin: "Amount must be greater than 0.",
|
|
2896
|
+
tokenAmountMax: "Insufficient balance.",
|
|
2897
|
+
tokenAddressError: "Invalid address.",
|
|
2898
|
+
amount: "Amount",
|
|
2899
|
+
amountPlaceholder: "Enter the Amount.",
|
|
2900
|
+
balance: "Balance",
|
|
2901
|
+
receiveTitle: "Received wallet address",
|
|
2902
|
+
receivePlaceholder: "Enter the Received wallet address.",
|
|
2903
|
+
next: "Next",
|
|
2904
|
+
copied: "Copied",
|
|
2905
|
+
receiveQrcode: "Receive by scanning the QR code",
|
|
2906
|
+
copyAddress: "Copy Address",
|
|
2907
|
+
importSuccess: "Imported successfully",
|
|
2908
|
+
tokenSmartContract: "Token Smart Contract",
|
|
2909
|
+
tokenSmartContractPlaceholder: "Enter the Token Smart Contract.",
|
|
2910
|
+
tokenSymbol: "Token Symbol",
|
|
2911
|
+
tokenSymbolPlaceholder: "Enter the Token Symbol.",
|
|
2912
|
+
tokenDecimals: "Decimals",
|
|
2913
|
+
tokenDecimalsPlaceholder: "Enter the Decimals.",
|
|
2914
|
+
import: "Import",
|
|
2915
|
+
receive: "Receive",
|
|
2916
|
+
customizedToken: "Customized Token"
|
|
2038
2917
|
};
|
|
2039
2918
|
|
|
2040
2919
|
// src/i18n/zh.json
|
|
@@ -2086,7 +2965,30 @@ var zh_default = {
|
|
|
2086
2965
|
CEXBindApiSecretKey: "API \u79D8\u94A5",
|
|
2087
2966
|
CEXBindApiPassphrase: "API \u5BC6\u7801\u77ED\u8BED",
|
|
2088
2967
|
cancel: "\u53D6\u6D88",
|
|
2089
|
-
walletLoading: "\u94B1\u5305\u670D\u52A1\u6B63\u5728\u52A0\u8F7D"
|
|
2968
|
+
walletLoading: "\u94B1\u5305\u670D\u52A1\u6B63\u5728\u52A0\u8F7D",
|
|
2969
|
+
tokenDetails: "\u4EE3\u5E01\u8BE6\u60C5",
|
|
2970
|
+
tokenAmountMin: "\u91D1\u989D\u5FC5\u987B\u5927\u4E8E 0\u3002",
|
|
2971
|
+
tokenAmountMax: "\u4F59\u989D\u4E0D\u8DB3\u3002",
|
|
2972
|
+
tokenAddressError: "\u65E0\u6548\u7684\u5730\u5740\u3002",
|
|
2973
|
+
amount: "\u91D1\u989D",
|
|
2974
|
+
amountPlaceholder: "\u8BF7\u8F93\u5165\u91D1\u989D\u3002",
|
|
2975
|
+
balance: "\u4F59\u989D",
|
|
2976
|
+
receiveTitle: "\u63A5\u6536\u94B1\u5305\u5730\u5740",
|
|
2977
|
+
receivePlaceholder: "\u8BF7\u8F93\u5165\u63A5\u6536\u94B1\u5305\u5730\u5740\u3002",
|
|
2978
|
+
next: "\u4E0B\u4E00\u6B65",
|
|
2979
|
+
copied: "\u5DF2\u590D\u5236",
|
|
2980
|
+
receiveQrcode: "\u626B\u63CF QR \u7801\u63A5\u6536",
|
|
2981
|
+
copyAddress: "\u590D\u5236\u5730\u5740",
|
|
2982
|
+
importSuccess: "\u5BFC\u5165\u6210\u529F",
|
|
2983
|
+
tokenSmartContract: "\u4EE3\u5E01\u667A\u80FD\u5408\u7EA6",
|
|
2984
|
+
tokenSmartContractPlaceholder: "\u8BF7\u8F93\u5165\u4EE3\u5E01\u667A\u80FD\u5408\u7EA6\u3002",
|
|
2985
|
+
tokenSymbol: "\u4EE3\u5E01\u7B26\u53F7",
|
|
2986
|
+
tokenSymbolPlaceholder: "\u8BF7\u8F93\u5165\u4EE3\u5E01\u7B26\u53F7\u3002",
|
|
2987
|
+
tokenDecimals: "\u5C0F\u6570\u4F4D\u6570",
|
|
2988
|
+
tokenDecimalsPlaceholder: "\u8BF7\u8F93\u5165\u5C0F\u6570\u4F4D\u6570\u3002",
|
|
2989
|
+
import: "\u5BFC\u5165",
|
|
2990
|
+
receive: "\u63A5\u6536",
|
|
2991
|
+
customizedToken: "\u81EA\u5B9A\u4E49\u4EE3\u5E01"
|
|
2090
2992
|
};
|
|
2091
2993
|
|
|
2092
2994
|
// src/i18n/tw.json
|
|
@@ -2138,7 +3040,30 @@ var tw_default = {
|
|
|
2138
3040
|
CEXBindApiSecretKey: "API \u5BC6\u9470",
|
|
2139
3041
|
CEXBindApiPassphrase: "API \u5BC6\u78BC\u77ED\u8A9E",
|
|
2140
3042
|
cancel: "\u53D6\u6D88",
|
|
2141
|
-
walletLoading: "\u9322\u5305\u670D\u52D9\u6B63\u5728\u52A0\u8F09"
|
|
3043
|
+
walletLoading: "\u9322\u5305\u670D\u52D9\u6B63\u5728\u52A0\u8F09",
|
|
3044
|
+
tokenDetails: "\u4EE3\u5E63\u8A73\u60C5",
|
|
3045
|
+
tokenAmountMin: "\u91D1\u984D\u5FC5\u9808\u5927\u65BC 0\u3002",
|
|
3046
|
+
tokenAmountMax: "\u9918\u984D\u4E0D\u8DB3\u3002",
|
|
3047
|
+
tokenAddressError: "\u7121\u6548\u7684\u5730\u5740\u3002",
|
|
3048
|
+
amount: "\u91D1\u984D",
|
|
3049
|
+
amountPlaceholder: "\u8ACB\u8F38\u5165\u91D1\u984D\u3002",
|
|
3050
|
+
balance: "\u9918\u984D",
|
|
3051
|
+
receiveTitle: "\u63A5\u6536\u9322\u5305\u5730\u5740",
|
|
3052
|
+
receivePlaceholder: "\u8ACB\u8F38\u5165\u63A5\u6536\u9322\u5305\u5730\u5740\u3002",
|
|
3053
|
+
next: "\u4E0B\u4E00\u6B65",
|
|
3054
|
+
copied: "\u5DF2\u8907\u88FD",
|
|
3055
|
+
receiveQrcode: "\u6383\u63CF QR \u78BC\u63A5\u6536",
|
|
3056
|
+
copyAddress: "\u8907\u88FD\u5730\u5740",
|
|
3057
|
+
importSuccess: "\u5C0E\u5165\u6210\u529F",
|
|
3058
|
+
tokenSmartContract: "\u4EE3\u5E63\u667A\u80FD\u5408\u7D04",
|
|
3059
|
+
tokenSmartContractPlaceholder: "\u8ACB\u8F38\u5165\u4EE3\u5E63\u667A\u80FD\u5408\u7D04\u3002",
|
|
3060
|
+
tokenSymbol: "\u4EE3\u5E63\u7B26\u865F",
|
|
3061
|
+
tokenSymbolPlaceholder: "\u8ACB\u8F38\u5165\u4EE3\u5E63\u7B26\u865F\u3002",
|
|
3062
|
+
tokenDecimals: "\u5C0F\u6578\u4F4D\u6578",
|
|
3063
|
+
tokenDecimalsPlaceholder: "\u8ACB\u8F38\u5165\u5C0F\u6578\u4F4D\u6578\u3002",
|
|
3064
|
+
import: "\u5C0E\u5165",
|
|
3065
|
+
receive: "\u63A5\u6536",
|
|
3066
|
+
customizedToken: "\u81EA\u5B9A\u7FA9\u4EE3\u5E63"
|
|
2142
3067
|
};
|
|
2143
3068
|
|
|
2144
3069
|
// src/i18n/fr.json
|
|
@@ -2190,7 +3115,30 @@ var fr_default = {
|
|
|
2190
3115
|
CEXBindApiSecretKey: "Cl\xE9 Secr\xE8te API",
|
|
2191
3116
|
CEXBindApiPassphrase: "Phrase secr\xE8te API",
|
|
2192
3117
|
cancel: "Annuler",
|
|
2193
|
-
walletLoading: "Le service de portefeuille est en cours de chargement"
|
|
3118
|
+
walletLoading: "Le service de portefeuille est en cours de chargement",
|
|
3119
|
+
tokenDetails: "D\xE9tails du Token",
|
|
3120
|
+
tokenAmountMin: "Le montant doit \xEAtre sup\xE9rieur \xE0 0.",
|
|
3121
|
+
tokenAmountMax: "Solde insuffisant.",
|
|
3122
|
+
tokenAddressError: "Adresse invalide.",
|
|
3123
|
+
amount: "Montant",
|
|
3124
|
+
amountPlaceholder: "Entrez le montant.",
|
|
3125
|
+
balance: "Solde",
|
|
3126
|
+
receiveTitle: "Adresse du portefeuille re\xE7u",
|
|
3127
|
+
receivePlaceholder: "Entrez l'adresse du portefeuille re\xE7u.",
|
|
3128
|
+
next: "Suivant",
|
|
3129
|
+
copied: "Copi\xE9",
|
|
3130
|
+
receiveQrcode: "Recevoir en scannant le code QR",
|
|
3131
|
+
copyAddress: "Copier l'adresse",
|
|
3132
|
+
importSuccess: "Import\xE9 avec succ\xE8s",
|
|
3133
|
+
tokenSmartContract: "Contrat intelligent du Token",
|
|
3134
|
+
tokenSmartContractPlaceholder: "Entrez le contrat intelligent du Token.",
|
|
3135
|
+
tokenSymbol: "Symbole du Token",
|
|
3136
|
+
tokenSymbolPlaceholder: "Entrez le symbole du Token.",
|
|
3137
|
+
tokenDecimals: "D\xE9cimales",
|
|
3138
|
+
tokenDecimalsPlaceholder: "Entrez les d\xE9cimales.",
|
|
3139
|
+
import: "Importer",
|
|
3140
|
+
receive: "Recevoir",
|
|
3141
|
+
customizedToken: "Token personnalis\xE9"
|
|
2194
3142
|
};
|
|
2195
3143
|
|
|
2196
3144
|
// src/i18n/ja.json
|
|
@@ -2242,7 +3190,30 @@ var ja_default = {
|
|
|
2242
3190
|
CEXBindApiSecretKey: "API \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8\u30AD\u30FC",
|
|
2243
3191
|
CEXBindApiPassphrase: "API \u30D1\u30B9\u30D5\u30EC\u30FC\u30BA",
|
|
2244
3192
|
cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
2245
|
-
walletLoading: "\u30A6\u30A9\u30EC\u30C3\u30C8\u30B5\u30FC\u30D3\u30B9\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059"
|
|
3193
|
+
walletLoading: "\u30A6\u30A9\u30EC\u30C3\u30C8\u30B5\u30FC\u30D3\u30B9\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059",
|
|
3194
|
+
tokenDetails: "\u30C8\u30FC\u30AF\u30F3\u306E\u8A73\u7D30",
|
|
3195
|
+
tokenAmountMin: "\u91D1\u984D\u306F0\u3088\u308A\u5927\u304D\u304F\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093\u3002",
|
|
3196
|
+
tokenAmountMax: "\u6B8B\u9AD8\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002",
|
|
3197
|
+
tokenAddressError: "\u7121\u52B9\u306A\u30A2\u30C9\u30EC\u30B9\u3067\u3059\u3002",
|
|
3198
|
+
amount: "\u91D1\u984D",
|
|
3199
|
+
amountPlaceholder: "\u91D1\u984D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
3200
|
+
balance: "\u6B8B\u9AD8",
|
|
3201
|
+
receiveTitle: "\u53D7\u53D6\u30A6\u30A9\u30EC\u30C3\u30C8\u30A2\u30C9\u30EC\u30B9",
|
|
3202
|
+
receivePlaceholder: "\u53D7\u53D6\u30A6\u30A9\u30EC\u30C3\u30C8\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
3203
|
+
next: "\u6B21\u3078",
|
|
3204
|
+
copied: "\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
|
|
3205
|
+
receiveQrcode: "QR\u30B3\u30FC\u30C9\u3092\u30B9\u30AD\u30E3\u30F3\u3057\u3066\u53D7\u3051\u53D6\u308B",
|
|
3206
|
+
copyAddress: "\u30A2\u30C9\u30EC\u30B9\u3092\u30B3\u30D4\u30FC",
|
|
3207
|
+
importSuccess: "\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u6210\u529F\u3057\u307E\u3057\u305F",
|
|
3208
|
+
tokenSmartContract: "\u30C8\u30FC\u30AF\u30F3\u306E\u30B9\u30DE\u30FC\u30C8\u30B3\u30F3\u30C8\u30E9\u30AF\u30C8",
|
|
3209
|
+
tokenSmartContractPlaceholder: "\u30C8\u30FC\u30AF\u30F3\u306E\u30B9\u30DE\u30FC\u30C8\u30B3\u30F3\u30C8\u30E9\u30AF\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
3210
|
+
tokenSymbol: "\u30C8\u30FC\u30AF\u30F3\u30B7\u30F3\u30DC\u30EB",
|
|
3211
|
+
tokenSymbolPlaceholder: "\u30C8\u30FC\u30AF\u30F3\u30B7\u30F3\u30DC\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
3212
|
+
tokenDecimals: "\u5C0F\u6570\u70B9",
|
|
3213
|
+
tokenDecimalsPlaceholder: "\u5C0F\u6570\u70B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
3214
|
+
import: "\u30A4\u30F3\u30DD\u30FC\u30C8",
|
|
3215
|
+
receive: "\u53D7\u3051\u53D6\u308B",
|
|
3216
|
+
customizedToken: "\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u30C8\u30FC\u30AF\u30F3"
|
|
2246
3217
|
};
|
|
2247
3218
|
|
|
2248
3219
|
// src/i18n/ko.json
|
|
@@ -2294,7 +3265,30 @@ var ko_default = {
|
|
|
2294
3265
|
CEXBindApiSecretKey: "API \uBE44\uBC00 \uD0A4",
|
|
2295
3266
|
CEXBindApiPassphrase: "API \uC554\uD638 \uAD6C\uBB38",
|
|
2296
3267
|
cancel: "\uCDE8\uC18C",
|
|
2297
|
-
walletLoading: "\uC9C0\uAC11 \uC11C\uBE44\uC2A4\uB97C \uBD88\uB7EC\uC624\uB294 \uC911"
|
|
3268
|
+
walletLoading: "\uC9C0\uAC11 \uC11C\uBE44\uC2A4\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
|
|
3269
|
+
tokenDetails: "\uD1A0\uD070 \uC0C1\uC138\uC815\uBCF4",
|
|
3270
|
+
tokenAmountMin: "\uAE08\uC561\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.",
|
|
3271
|
+
tokenAmountMax: "\uC794\uC561\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4.",
|
|
3272
|
+
tokenAddressError: "\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uC8FC\uC18C\uC785\uB2C8\uB2E4.",
|
|
3273
|
+
amount: "\uAE08\uC561",
|
|
3274
|
+
amountPlaceholder: "\uAE08\uC561\uC744 \uC785\uB825\uD558\uC138\uC694.",
|
|
3275
|
+
balance: "\uC794\uC561",
|
|
3276
|
+
receiveTitle: "\uC218\uC2E0 \uC9C0\uAC11 \uC8FC\uC18C",
|
|
3277
|
+
receivePlaceholder: "\uC218\uC2E0 \uC9C0\uAC11 \uC8FC\uC18C\uB97C \uC785\uB825\uD558\uC138\uC694.",
|
|
3278
|
+
next: "\uB2E4\uC74C",
|
|
3279
|
+
copied: "\uBCF5\uC0AC\uB428",
|
|
3280
|
+
receiveQrcode: "QR \uCF54\uB4DC\uB97C \uC2A4\uCE94\uD558\uC5EC \uBC1B\uAE30",
|
|
3281
|
+
copyAddress: "\uC8FC\uC18C \uBCF5\uC0AC",
|
|
3282
|
+
importSuccess: "\uC131\uACF5\uC801\uC73C\uB85C \uAC00\uC838\uC654\uC2B5\uB2C8\uB2E4.",
|
|
3283
|
+
tokenSmartContract: "\uD1A0\uD070 \uC2A4\uB9C8\uD2B8 \uCEE8\uD2B8\uB799\uD2B8",
|
|
3284
|
+
tokenSmartContractPlaceholder: "\uD1A0\uD070 \uC2A4\uB9C8\uD2B8 \uCEE8\uD2B8\uB799\uD2B8\uB97C \uC785\uB825\uD558\uC138\uC694.",
|
|
3285
|
+
tokenSymbol: "\uD1A0\uD070 \uC2EC\uBCFC",
|
|
3286
|
+
tokenSymbolPlaceholder: "\uD1A0\uD070 \uC2EC\uBCFC\uC744 \uC785\uB825\uD558\uC138\uC694.",
|
|
3287
|
+
tokenDecimals: "\uC18C\uC218\uC810 \uC790\uB9AC\uC218",
|
|
3288
|
+
tokenDecimalsPlaceholder: "\uC18C\uC218\uC810 \uC790\uB9AC\uC218\uB97C \uC785\uB825\uD558\uC138\uC694.",
|
|
3289
|
+
import: "\uAC00\uC838\uC624\uAE30",
|
|
3290
|
+
receive: "\uBC1B\uAE30",
|
|
3291
|
+
customizedToken: "\uB9DE\uCDA4\uD615 \uD1A0\uD070"
|
|
2298
3292
|
};
|
|
2299
3293
|
|
|
2300
3294
|
// src/i18n/vi.json
|
|
@@ -2346,7 +3340,30 @@ var vi_default = {
|
|
|
2346
3340
|
CEXBindApiSecretKey: "Kh\xF3a b\xED m\u1EADt API",
|
|
2347
3341
|
CEXBindApiPassphrase: "C\u1EE5m m\u1EADt kh\u1EA9u API",
|
|
2348
3342
|
cancel: "H\u1EE7y",
|
|
2349
|
-
walletLoading: "D\u1ECBch v\u1EE5 v\xED \u0111ang t\u1EA3i"
|
|
3343
|
+
walletLoading: "D\u1ECBch v\u1EE5 v\xED \u0111ang t\u1EA3i",
|
|
3344
|
+
tokenDetails: "Chi ti\u1EBFt Token",
|
|
3345
|
+
tokenAmountMin: "S\u1ED1 ti\u1EC1n ph\u1EA3i l\u1EDBn h\u01A1n 0.",
|
|
3346
|
+
tokenAmountMax: "S\u1ED1 d\u01B0 kh\xF4ng \u0111\u1EE7.",
|
|
3347
|
+
tokenAddressError: "\u0110\u1ECBa ch\u1EC9 kh\xF4ng h\u1EE3p l\u1EC7.",
|
|
3348
|
+
amount: "S\u1ED1 l\u01B0\u1EE3ng",
|
|
3349
|
+
amountPlaceholder: "Nh\u1EADp s\u1ED1 l\u01B0\u1EE3ng.",
|
|
3350
|
+
balance: "S\u1ED1 d\u01B0",
|
|
3351
|
+
receiveTitle: "\u0110\u1ECBa ch\u1EC9 v\xED nh\u1EADn",
|
|
3352
|
+
receivePlaceholder: "Nh\u1EADp \u0111\u1ECBa ch\u1EC9 v\xED nh\u1EADn.",
|
|
3353
|
+
next: "Ti\u1EBFp theo",
|
|
3354
|
+
copied: "\u0110\xE3 sao ch\xE9p",
|
|
3355
|
+
receiveQrcode: "Nh\u1EADn b\u1EB1ng c\xE1ch qu\xE9t m\xE3 QR",
|
|
3356
|
+
copyAddress: "Sao ch\xE9p \u0111\u1ECBa ch\u1EC9",
|
|
3357
|
+
importSuccess: "Nh\u1EADp th\xE0nh c\xF4ng",
|
|
3358
|
+
tokenSmartContract: "H\u1EE3p \u0111\u1ED3ng th\xF4ng minh Token",
|
|
3359
|
+
tokenSmartContractPlaceholder: "Nh\u1EADp h\u1EE3p \u0111\u1ED3ng th\xF4ng minh Token.",
|
|
3360
|
+
tokenSymbol: "K\xFD hi\u1EC7u Token",
|
|
3361
|
+
tokenSymbolPlaceholder: "Nh\u1EADp k\xFD hi\u1EC7u Token.",
|
|
3362
|
+
tokenDecimals: "S\u1ED1 th\u1EADp ph\xE2n",
|
|
3363
|
+
tokenDecimalsPlaceholder: "Nh\u1EADp s\u1ED1 th\u1EADp ph\xE2n.",
|
|
3364
|
+
import: "Nh\u1EADp",
|
|
3365
|
+
receive: "Nh\u1EADn",
|
|
3366
|
+
customizedToken: "Token t\xF9y ch\u1EC9nh"
|
|
2350
3367
|
};
|
|
2351
3368
|
|
|
2352
3369
|
// src/i18n/es.json
|
|
@@ -2398,7 +3415,30 @@ var es_default = {
|
|
|
2398
3415
|
CEXBindApiSecretKey: "Clave Secreta API",
|
|
2399
3416
|
CEXBindApiPassphrase: "Frase de contrase\xF1a API",
|
|
2400
3417
|
cancel: "Cancelar",
|
|
2401
|
-
walletLoading: "El servicio de cartera se est\xE1 cargando"
|
|
3418
|
+
walletLoading: "El servicio de cartera se est\xE1 cargando",
|
|
3419
|
+
tokenDetails: "Detalles del Token",
|
|
3420
|
+
tokenAmountMin: "La cantidad debe ser mayor que 0.",
|
|
3421
|
+
tokenAmountMax: "Saldo insuficiente.",
|
|
3422
|
+
tokenAddressError: "Direcci\xF3n no v\xE1lida.",
|
|
3423
|
+
amount: "Cantidad",
|
|
3424
|
+
amountPlaceholder: "Ingrese la cantidad.",
|
|
3425
|
+
balance: "Saldo",
|
|
3426
|
+
receiveTitle: "Direcci\xF3n de billetera recibida",
|
|
3427
|
+
receivePlaceholder: "Ingrese la direcci\xF3n de la billetera recibida.",
|
|
3428
|
+
next: "Siguiente",
|
|
3429
|
+
copied: "Copiado",
|
|
3430
|
+
receiveQrcode: "Recibir escaneando el c\xF3digo QR",
|
|
3431
|
+
copyAddress: "Copiar direcci\xF3n",
|
|
3432
|
+
importSuccess: "Importado con \xE9xito",
|
|
3433
|
+
tokenSmartContract: "Contrato inteligente del Token",
|
|
3434
|
+
tokenSmartContractPlaceholder: "Ingrese el contrato inteligente del Token.",
|
|
3435
|
+
tokenSymbol: "S\xEDmbolo del Token",
|
|
3436
|
+
tokenSymbolPlaceholder: "Ingrese el s\xEDmbolo del Token.",
|
|
3437
|
+
tokenDecimals: "Decimales",
|
|
3438
|
+
tokenDecimalsPlaceholder: "Ingrese los decimales.",
|
|
3439
|
+
import: "Importar",
|
|
3440
|
+
receive: "Recibir",
|
|
3441
|
+
customizedToken: "Token personalizado"
|
|
2402
3442
|
};
|
|
2403
3443
|
|
|
2404
3444
|
// src/i18n/pt.json
|
|
@@ -2450,7 +3490,30 @@ var pt_default = {
|
|
|
2450
3490
|
CEXBindApiSecretKey: "Chave Secreta API",
|
|
2451
3491
|
CEXBindApiPassphrase: "Senha de API",
|
|
2452
3492
|
cancel: "Cancelar",
|
|
2453
|
-
walletLoading: "O servi\xE7o de carteira est\xE1 carregando"
|
|
3493
|
+
walletLoading: "O servi\xE7o de carteira est\xE1 carregando",
|
|
3494
|
+
tokenDetails: "Detalhes do Token",
|
|
3495
|
+
tokenAmountMin: "O valor deve ser maior que 0.",
|
|
3496
|
+
tokenAmountMax: "Saldo insuficiente.",
|
|
3497
|
+
tokenAddressError: "Endere\xE7o inv\xE1lido.",
|
|
3498
|
+
amount: "Quantidade",
|
|
3499
|
+
amountPlaceholder: "Digite a quantidade.",
|
|
3500
|
+
balance: "Saldo",
|
|
3501
|
+
receiveTitle: "Endere\xE7o da carteira recebida",
|
|
3502
|
+
receivePlaceholder: "Digite o endere\xE7o da carteira recebida.",
|
|
3503
|
+
next: "Pr\xF3ximo",
|
|
3504
|
+
copied: "Copiado",
|
|
3505
|
+
receiveQrcode: "Receber escaneando o c\xF3digo QR",
|
|
3506
|
+
copyAddress: "Copiar endere\xE7o",
|
|
3507
|
+
importSuccess: "Importado com sucesso",
|
|
3508
|
+
tokenSmartContract: "Contrato inteligente do Token",
|
|
3509
|
+
tokenSmartContractPlaceholder: "Digite o contrato inteligente do Token.",
|
|
3510
|
+
tokenSymbol: "S\xEDmbolo do Token",
|
|
3511
|
+
tokenSymbolPlaceholder: "Digite o s\xEDmbolo do Token.",
|
|
3512
|
+
tokenDecimals: "Decimais",
|
|
3513
|
+
tokenDecimalsPlaceholder: "Digite os decimais.",
|
|
3514
|
+
import: "Importar",
|
|
3515
|
+
receive: "Receber",
|
|
3516
|
+
customizedToken: "Token personalizado"
|
|
2454
3517
|
};
|
|
2455
3518
|
|
|
2456
3519
|
// src/i18n/index.ts
|
|
@@ -2467,7 +3530,7 @@ var messages = {
|
|
|
2467
3530
|
};
|
|
2468
3531
|
|
|
2469
3532
|
// src/MatchContext.tsx
|
|
2470
|
-
import { jsx as
|
|
3533
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2471
3534
|
var queryClient = new QueryClient();
|
|
2472
3535
|
var MatchContext = createContext3(void 0);
|
|
2473
3536
|
var MatchProvider = ({
|
|
@@ -2489,7 +3552,7 @@ var MatchProvider = ({
|
|
|
2489
3552
|
useWalletInit({
|
|
2490
3553
|
config: wallet
|
|
2491
3554
|
});
|
|
2492
|
-
return /* @__PURE__ */
|
|
3555
|
+
return /* @__PURE__ */ jsx11(IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ jsx11(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx11(
|
|
2493
3556
|
MatchContext.Provider,
|
|
2494
3557
|
{
|
|
2495
3558
|
value: {
|
|
@@ -2500,7 +3563,7 @@ var MatchProvider = ({
|
|
|
2500
3563
|
theme,
|
|
2501
3564
|
locale: realLocale
|
|
2502
3565
|
},
|
|
2503
|
-
children: /* @__PURE__ */
|
|
3566
|
+
children: /* @__PURE__ */ jsx11(context_default, { children })
|
|
2504
3567
|
}
|
|
2505
3568
|
) }) });
|
|
2506
3569
|
};
|
|
@@ -2522,7 +3585,7 @@ function useUserInfo() {
|
|
|
2522
3585
|
logout: logoutStore,
|
|
2523
3586
|
setOverview,
|
|
2524
3587
|
overview,
|
|
2525
|
-
address
|
|
3588
|
+
address,
|
|
2526
3589
|
endpoints,
|
|
2527
3590
|
locale,
|
|
2528
3591
|
refreshOverview
|
|
@@ -2750,7 +3813,7 @@ function useUserInfo() {
|
|
|
2750
3813
|
token,
|
|
2751
3814
|
mid,
|
|
2752
3815
|
did,
|
|
2753
|
-
address
|
|
3816
|
+
address,
|
|
2754
3817
|
isLogin,
|
|
2755
3818
|
logout,
|
|
2756
3819
|
getLoginEmailCode,
|
|
@@ -2766,29 +3829,23 @@ function useUserInfo() {
|
|
|
2766
3829
|
}
|
|
2767
3830
|
|
|
2768
3831
|
// src/components/EmailModal/StepVerify.tsx
|
|
2769
|
-
import { useEffect as
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
var EMAIL_INTERVAL = 60;
|
|
2773
|
-
var EMAIL_CODE_LENGTH = 6;
|
|
2774
|
-
|
|
2775
|
-
// src/components/EmailModal/StepVerify.tsx
|
|
2776
|
-
import { FormattedMessage as FormattedMessage3, useIntl as useIntl3 } from "react-intl";
|
|
2777
|
-
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3832
|
+
import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef4, useState as useState12 } from "react";
|
|
3833
|
+
import { FormattedMessage as FormattedMessage4, useIntl as useIntl4 } from "react-intl";
|
|
3834
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2778
3835
|
function StepVerify(props) {
|
|
2779
|
-
const intl =
|
|
3836
|
+
const intl = useIntl4();
|
|
2780
3837
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
2781
|
-
const [error, setError] =
|
|
2782
|
-
const [code, setCode] =
|
|
2783
|
-
const [sending, setSending] =
|
|
2784
|
-
const [submitting, setSubmitting] =
|
|
2785
|
-
const sendTimeRef =
|
|
2786
|
-
const [sendBtnText, setSendBtnText] =
|
|
3838
|
+
const [error, setError] = useState12("");
|
|
3839
|
+
const [code, setCode] = useState12("");
|
|
3840
|
+
const [sending, setSending] = useState12(false);
|
|
3841
|
+
const [submitting, setSubmitting] = useState12(false);
|
|
3842
|
+
const sendTimeRef = useRef4(0);
|
|
3843
|
+
const [sendBtnText, setSendBtnText] = useState12(intl.formatMessage({
|
|
2787
3844
|
id: "send"
|
|
2788
3845
|
}));
|
|
2789
3846
|
const intervalTime = EMAIL_INTERVAL;
|
|
2790
3847
|
const codeLength = EMAIL_CODE_LENGTH;
|
|
2791
|
-
const intervalRef =
|
|
3848
|
+
const intervalRef = useRef4(null);
|
|
2792
3849
|
const isDownMd = useDownMd();
|
|
2793
3850
|
const onSend = async () => {
|
|
2794
3851
|
if (sendTimeRef.current > 0) {
|
|
@@ -2819,7 +3876,7 @@ function StepVerify(props) {
|
|
|
2819
3876
|
setSending(false);
|
|
2820
3877
|
}
|
|
2821
3878
|
};
|
|
2822
|
-
|
|
3879
|
+
useEffect13(() => {
|
|
2823
3880
|
onSend();
|
|
2824
3881
|
return () => {
|
|
2825
3882
|
if (intervalRef.current) {
|
|
@@ -2853,15 +3910,15 @@ function StepVerify(props) {
|
|
|
2853
3910
|
};
|
|
2854
3911
|
return /* @__PURE__ */ jsxs8("div", { className: "matchid-email-verify-box", children: [
|
|
2855
3912
|
/* @__PURE__ */ jsxs8("div", { className: "matchid-email-verify-header", children: [
|
|
2856
|
-
/* @__PURE__ */
|
|
3913
|
+
/* @__PURE__ */ jsx12("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ jsx12(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
2857
3914
|
/* @__PURE__ */ jsxs8("div", { className: "matchid-email-verify-header-content", children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
3915
|
+
/* @__PURE__ */ jsx12("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
3916
|
+
/* @__PURE__ */ jsx12("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ jsx12(FormattedMessage4, { id: "sendEmailTips" }) })
|
|
2860
3917
|
] })
|
|
2861
3918
|
] }),
|
|
2862
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ jsx12(Field, { label: intl.formatMessage({
|
|
2863
3920
|
id: "verificationCode"
|
|
2864
|
-
}), error, children: /* @__PURE__ */
|
|
3921
|
+
}), error, children: /* @__PURE__ */ jsx12(
|
|
2865
3922
|
Input,
|
|
2866
3923
|
{
|
|
2867
3924
|
placeholder: intl.formatMessage({
|
|
@@ -2871,7 +3928,7 @@ function StepVerify(props) {
|
|
|
2871
3928
|
maxLength: codeLength,
|
|
2872
3929
|
onChange: (e) => setCode(e.target.value),
|
|
2873
3930
|
value: code,
|
|
2874
|
-
after: /* @__PURE__ */
|
|
3931
|
+
after: /* @__PURE__ */ jsx12(
|
|
2875
3932
|
Button,
|
|
2876
3933
|
{
|
|
2877
3934
|
highlight: true,
|
|
@@ -2890,13 +3947,13 @@ function StepVerify(props) {
|
|
|
2890
3947
|
)
|
|
2891
3948
|
}
|
|
2892
3949
|
) }),
|
|
2893
|
-
/* @__PURE__ */
|
|
3950
|
+
/* @__PURE__ */ jsx12(Button, { disabled: !canContinue, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ jsx12(FormattedMessage4, { id: "continue" }) })
|
|
2894
3951
|
] });
|
|
2895
3952
|
}
|
|
2896
3953
|
|
|
2897
3954
|
// src/components/EmailModal/index.tsx
|
|
2898
|
-
import { useIntl as
|
|
2899
|
-
import { jsx as
|
|
3955
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
3956
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2900
3957
|
function EmailModal({
|
|
2901
3958
|
isOpen = false,
|
|
2902
3959
|
width = 480,
|
|
@@ -2904,16 +3961,16 @@ function EmailModal({
|
|
|
2904
3961
|
onBack,
|
|
2905
3962
|
onLogin
|
|
2906
3963
|
}) {
|
|
2907
|
-
const [step, setStep] =
|
|
2908
|
-
const [emailVal, setEmailVal] =
|
|
2909
|
-
const intl =
|
|
2910
|
-
|
|
3964
|
+
const [step, setStep] = useState13("input");
|
|
3965
|
+
const [emailVal, setEmailVal] = useState13("");
|
|
3966
|
+
const intl = useIntl5();
|
|
3967
|
+
useEffect14(() => {
|
|
2911
3968
|
if (!isOpen) {
|
|
2912
3969
|
setStep("input");
|
|
2913
3970
|
setEmailVal("");
|
|
2914
3971
|
}
|
|
2915
3972
|
}, [isOpen]);
|
|
2916
|
-
return /* @__PURE__ */
|
|
3973
|
+
return /* @__PURE__ */ jsx13(
|
|
2917
3974
|
ModalWithHeader,
|
|
2918
3975
|
{
|
|
2919
3976
|
isOpen,
|
|
@@ -2923,22 +3980,22 @@ function EmailModal({
|
|
|
2923
3980
|
id: "email"
|
|
2924
3981
|
}),
|
|
2925
3982
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
2926
|
-
children: step === "input" ? /* @__PURE__ */
|
|
3983
|
+
children: step === "input" ? /* @__PURE__ */ jsx13(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
2927
3984
|
setEmailVal(email);
|
|
2928
3985
|
setStep("verify");
|
|
2929
|
-
} }) : /* @__PURE__ */
|
|
3986
|
+
} }) : /* @__PURE__ */ jsx13(StepVerify, { email: emailVal, onSuccess: onLogin })
|
|
2930
3987
|
}
|
|
2931
3988
|
);
|
|
2932
3989
|
}
|
|
2933
3990
|
|
|
2934
3991
|
// src/components/LoginBox/index.tsx
|
|
2935
|
-
import { useMemo as useMemo8, useState as
|
|
2936
|
-
import { FormattedMessage as
|
|
3992
|
+
import { useMemo as useMemo8, useState as useState14 } from "react";
|
|
3993
|
+
import { FormattedMessage as FormattedMessage5, useIntl as useIntl6 } from "react-intl";
|
|
2937
3994
|
|
|
2938
3995
|
// src/hooks/useAppConfig.ts
|
|
2939
|
-
import { useQuery as
|
|
3996
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
2940
3997
|
function useAppConfig() {
|
|
2941
|
-
const query =
|
|
3998
|
+
const query = useQuery5({
|
|
2942
3999
|
queryKey: ["appConfig"],
|
|
2943
4000
|
queryFn: async () => {
|
|
2944
4001
|
const res = await getAppConfigApi();
|
|
@@ -2956,7 +4013,7 @@ function useAppConfig() {
|
|
|
2956
4013
|
}
|
|
2957
4014
|
|
|
2958
4015
|
// src/components/LoginBox/index.tsx
|
|
2959
|
-
import { Fragment as Fragment2, jsx as
|
|
4016
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2960
4017
|
var RecommendItem = ({
|
|
2961
4018
|
icon,
|
|
2962
4019
|
name,
|
|
@@ -2968,17 +4025,17 @@ var RecommendItem = ({
|
|
|
2968
4025
|
return /* @__PURE__ */ jsxs9("div", { className: "matchid-login-recommend-method", children: [
|
|
2969
4026
|
/* @__PURE__ */ jsxs9("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
2970
4027
|
/* @__PURE__ */ jsxs9("div", { className: "matchid-login-recommend-method-content", children: [
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
4028
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
4029
|
+
/* @__PURE__ */ jsx14("span", { className: "matchid-login-recommend-method-name", children: name })
|
|
2973
4030
|
] }),
|
|
2974
|
-
footer ? footer : children ? /* @__PURE__ */
|
|
4031
|
+
footer ? footer : children ? /* @__PURE__ */ jsx14(
|
|
2975
4032
|
ArrowDownIcon,
|
|
2976
4033
|
{
|
|
2977
4034
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
2978
4035
|
size: 20,
|
|
2979
4036
|
color: "var(--matchid-arrow-color)"
|
|
2980
4037
|
}
|
|
2981
|
-
) : /* @__PURE__ */
|
|
4038
|
+
) : /* @__PURE__ */ jsx14(
|
|
2982
4039
|
ArrowRightIcon,
|
|
2983
4040
|
{
|
|
2984
4041
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -2987,7 +4044,7 @@ var RecommendItem = ({
|
|
|
2987
4044
|
}
|
|
2988
4045
|
)
|
|
2989
4046
|
] }),
|
|
2990
|
-
children && /* @__PURE__ */
|
|
4047
|
+
children && /* @__PURE__ */ jsx14(
|
|
2991
4048
|
"div",
|
|
2992
4049
|
{
|
|
2993
4050
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -3045,62 +4102,62 @@ function LoginBox({
|
|
|
3045
4102
|
walletMethods: walletMethodList
|
|
3046
4103
|
};
|
|
3047
4104
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
3048
|
-
const [emailOpen, setEmailOpen] =
|
|
4105
|
+
const [emailOpen, setEmailOpen] = useState14(false);
|
|
3049
4106
|
const { login } = useUserInfo();
|
|
3050
|
-
const [showWallet, setShowWallet] =
|
|
3051
|
-
const intl =
|
|
4107
|
+
const [showWallet, setShowWallet] = useState14(false);
|
|
4108
|
+
const intl = useIntl6();
|
|
3052
4109
|
const isDownMd = useDownMd();
|
|
3053
4110
|
const methodMap = {
|
|
3054
4111
|
wallet: {
|
|
3055
|
-
icon: /* @__PURE__ */
|
|
4112
|
+
icon: /* @__PURE__ */ jsx14(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
3056
4113
|
name: intl.formatMessage({ id: "wallet" }),
|
|
3057
4114
|
onClick: () => setShowWallet(!showWallet),
|
|
3058
4115
|
type: "wallet"
|
|
3059
4116
|
},
|
|
3060
4117
|
email: {
|
|
3061
|
-
icon: /* @__PURE__ */
|
|
4118
|
+
icon: /* @__PURE__ */ jsx14(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
3062
4119
|
name: intl.formatMessage({ id: "email" }),
|
|
3063
4120
|
onClick: () => {
|
|
3064
4121
|
setEmailOpen(true);
|
|
3065
4122
|
}
|
|
3066
4123
|
},
|
|
3067
4124
|
google: {
|
|
3068
|
-
icon: /* @__PURE__ */
|
|
4125
|
+
icon: /* @__PURE__ */ jsx14(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
3069
4126
|
name: "Google",
|
|
3070
4127
|
onClick: () => login("google")
|
|
3071
4128
|
},
|
|
3072
4129
|
twitter: {
|
|
3073
|
-
icon: /* @__PURE__ */
|
|
4130
|
+
icon: /* @__PURE__ */ jsx14(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
3074
4131
|
name: "X",
|
|
3075
4132
|
onClick: () => login("twitter")
|
|
3076
4133
|
},
|
|
3077
4134
|
telegram: {
|
|
3078
|
-
icon: /* @__PURE__ */
|
|
4135
|
+
icon: /* @__PURE__ */ jsx14(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
3079
4136
|
name: "Telegram",
|
|
3080
4137
|
onClick: () => login("telegram")
|
|
3081
4138
|
},
|
|
3082
4139
|
github: {
|
|
3083
|
-
icon: /* @__PURE__ */
|
|
4140
|
+
icon: /* @__PURE__ */ jsx14(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
3084
4141
|
name: "Github",
|
|
3085
4142
|
onClick: () => login("github")
|
|
3086
4143
|
},
|
|
3087
4144
|
discord: {
|
|
3088
|
-
icon: /* @__PURE__ */
|
|
4145
|
+
icon: /* @__PURE__ */ jsx14(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
3089
4146
|
name: "Discord",
|
|
3090
4147
|
onClick: () => login("discord")
|
|
3091
4148
|
},
|
|
3092
4149
|
linkedin: {
|
|
3093
|
-
icon: /* @__PURE__ */
|
|
4150
|
+
icon: /* @__PURE__ */ jsx14(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
3094
4151
|
name: "LinkedIn",
|
|
3095
4152
|
onClick: () => login("linkedin")
|
|
3096
4153
|
},
|
|
3097
4154
|
facebook: {
|
|
3098
|
-
icon: /* @__PURE__ */
|
|
4155
|
+
icon: /* @__PURE__ */ jsx14(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
3099
4156
|
name: "Facebook",
|
|
3100
4157
|
onClick: () => login("facebook")
|
|
3101
4158
|
},
|
|
3102
4159
|
youtube: {
|
|
3103
|
-
icon: /* @__PURE__ */
|
|
4160
|
+
icon: /* @__PURE__ */ jsx14(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
3104
4161
|
name: "Youtube",
|
|
3105
4162
|
onClick: () => login("youtube")
|
|
3106
4163
|
}
|
|
@@ -3108,8 +4165,8 @@ function LoginBox({
|
|
|
3108
4165
|
const { walletMap } = useWalletConfig();
|
|
3109
4166
|
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
3110
4167
|
(!inModal || !emailOpen) && /* @__PURE__ */ jsxs9("div", { className: "matchid-login-box", children: [
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
return /* @__PURE__ */
|
|
4168
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
4169
|
+
return /* @__PURE__ */ jsx14(
|
|
3113
4170
|
RecommendItem,
|
|
3114
4171
|
{
|
|
3115
4172
|
icon: methodMap[m]?.icon,
|
|
@@ -3117,8 +4174,8 @@ function LoginBox({
|
|
|
3117
4174
|
onClick: methodMap[m]?.onClick,
|
|
3118
4175
|
showChildren: m == "wallet" && showWallet,
|
|
3119
4176
|
children: m == "wallet" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
4177
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
4178
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
3122
4179
|
const m2 = walletMap[n];
|
|
3123
4180
|
return /* @__PURE__ */ jsxs9(
|
|
3124
4181
|
"div",
|
|
@@ -3129,15 +4186,15 @@ function LoginBox({
|
|
|
3129
4186
|
},
|
|
3130
4187
|
children: [
|
|
3131
4188
|
/* @__PURE__ */ jsxs9("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
4190
|
+
/* @__PURE__ */ jsx14(
|
|
3134
4191
|
"div",
|
|
3135
4192
|
{
|
|
3136
4193
|
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
3137
4194
|
children: m2.activeIcon
|
|
3138
4195
|
}
|
|
3139
4196
|
),
|
|
3140
|
-
/* @__PURE__ */
|
|
4197
|
+
/* @__PURE__ */ jsx14(
|
|
3141
4198
|
"span",
|
|
3142
4199
|
{
|
|
3143
4200
|
className: "matchid-login-recommend-wallet-item-name",
|
|
@@ -3145,7 +4202,7 @@ function LoginBox({
|
|
|
3145
4202
|
}
|
|
3146
4203
|
)
|
|
3147
4204
|
] }),
|
|
3148
|
-
/* @__PURE__ */
|
|
4205
|
+
/* @__PURE__ */ jsx14(
|
|
3149
4206
|
ArrowRightIcon,
|
|
3150
4207
|
{
|
|
3151
4208
|
className: "matchid-login-recommend-wallet-item-arrow",
|
|
@@ -3164,9 +4221,9 @@ function LoginBox({
|
|
|
3164
4221
|
);
|
|
3165
4222
|
}) }),
|
|
3166
4223
|
methodConfig.methods.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "matchid-login-other", children: [
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
return /* @__PURE__ */
|
|
4224
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ jsx14(FormattedMessage5, { id: "otherLoginMethods" }) }),
|
|
4225
|
+
/* @__PURE__ */ jsx14("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
4226
|
+
return /* @__PURE__ */ jsx14(
|
|
3170
4227
|
"div",
|
|
3171
4228
|
{
|
|
3172
4229
|
className: "matchid-login-method-item",
|
|
@@ -3179,7 +4236,7 @@ function LoginBox({
|
|
|
3179
4236
|
}) })
|
|
3180
4237
|
] })
|
|
3181
4238
|
] }),
|
|
3182
|
-
/* @__PURE__ */
|
|
4239
|
+
/* @__PURE__ */ jsx14(
|
|
3183
4240
|
EmailModal,
|
|
3184
4241
|
{
|
|
3185
4242
|
isOpen: emailOpen,
|
|
@@ -3195,11 +4252,11 @@ function LoginBox({
|
|
|
3195
4252
|
}
|
|
3196
4253
|
|
|
3197
4254
|
// src/components/LoginButton/index.tsx
|
|
3198
|
-
import { useState as
|
|
4255
|
+
import { useState as useState16 } from "react";
|
|
3199
4256
|
|
|
3200
4257
|
// src/components/LoginPanel/index.tsx
|
|
3201
|
-
import { FormattedMessage as
|
|
3202
|
-
import { jsx as
|
|
4258
|
+
import { FormattedMessage as FormattedMessage6 } from "react-intl";
|
|
4259
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3203
4260
|
function LoginPanel({
|
|
3204
4261
|
header,
|
|
3205
4262
|
onClose,
|
|
@@ -3209,42 +4266,42 @@ function LoginPanel({
|
|
|
3209
4266
|
return /* @__PURE__ */ jsxs10("div", { className: "matchid-login-panel", children: [
|
|
3210
4267
|
header ? header : /* @__PURE__ */ jsxs10("div", { className: "matchid-login-panel-header", children: [
|
|
3211
4268
|
/* @__PURE__ */ jsxs10("div", { className: "matchid-login-panel-header-content", children: [
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
4269
|
+
/* @__PURE__ */ jsx15("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ jsx15(FormattedMessage6, { id: "loginTitle" }) }),
|
|
4270
|
+
/* @__PURE__ */ jsx15("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ jsx15(FormattedMessage6, { id: "loginTips" }) })
|
|
3214
4271
|
] }),
|
|
3215
|
-
onClose && /* @__PURE__ */
|
|
4272
|
+
onClose && /* @__PURE__ */ jsx15("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ jsx15(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
3216
4273
|
] }),
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ jsx15("div", { className: "matchid-login-panel-divide" }),
|
|
4275
|
+
/* @__PURE__ */ jsx15("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ jsx15(LoginBox, { ...props }) })
|
|
3219
4276
|
] });
|
|
3220
4277
|
}
|
|
3221
4278
|
|
|
3222
4279
|
// src/components/LoginModal/index.tsx
|
|
3223
|
-
import { jsx as
|
|
4280
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3224
4281
|
function LoginModal({
|
|
3225
4282
|
isOpen = false,
|
|
3226
4283
|
width = 480,
|
|
3227
4284
|
...props
|
|
3228
4285
|
}) {
|
|
3229
4286
|
const { isLogin } = useUserInfo();
|
|
3230
|
-
return /* @__PURE__ */
|
|
4287
|
+
return /* @__PURE__ */ jsx16(
|
|
3231
4288
|
Modal,
|
|
3232
4289
|
{
|
|
3233
4290
|
isOpen: isOpen && !isLogin,
|
|
3234
4291
|
width,
|
|
3235
|
-
children: /* @__PURE__ */
|
|
4292
|
+
children: /* @__PURE__ */ jsx16(LoginPanel, { ...props, inModal: true })
|
|
3236
4293
|
}
|
|
3237
4294
|
);
|
|
3238
4295
|
}
|
|
3239
4296
|
|
|
3240
4297
|
// src/components/UserPopover/index.tsx
|
|
3241
|
-
import { useState as
|
|
4298
|
+
import { useState as useState15 } from "react";
|
|
3242
4299
|
|
|
3243
4300
|
// src/assets/icon/ProfileIcon.tsx
|
|
3244
|
-
import { jsx as
|
|
4301
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3245
4302
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
3246
4303
|
return /* @__PURE__ */ jsxs11("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
3247
|
-
/* @__PURE__ */
|
|
4304
|
+
/* @__PURE__ */ jsx17(
|
|
3248
4305
|
"path",
|
|
3249
4306
|
{
|
|
3250
4307
|
fillRule: "evenodd",
|
|
@@ -3253,7 +4310,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
3253
4310
|
fill: color
|
|
3254
4311
|
}
|
|
3255
4312
|
),
|
|
3256
|
-
/* @__PURE__ */
|
|
4313
|
+
/* @__PURE__ */ jsx17(
|
|
3257
4314
|
"path",
|
|
3258
4315
|
{
|
|
3259
4316
|
fillRule: "evenodd",
|
|
@@ -3266,11 +4323,11 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
3266
4323
|
}
|
|
3267
4324
|
|
|
3268
4325
|
// src/components/UserPopover/index.tsx
|
|
3269
|
-
import { FormattedMessage as
|
|
3270
|
-
import { jsx as
|
|
4326
|
+
import { FormattedMessage as FormattedMessage7, useIntl as useIntl7 } from "react-intl";
|
|
4327
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3271
4328
|
function UserContent() {
|
|
3272
|
-
const { logout, address
|
|
3273
|
-
const [logouting, setLogouting] =
|
|
4329
|
+
const { logout, address, username } = useUserInfo();
|
|
4330
|
+
const [logouting, setLogouting] = useState15(false);
|
|
3274
4331
|
const onLogout = async () => {
|
|
3275
4332
|
if (logouting) return;
|
|
3276
4333
|
try {
|
|
@@ -3291,31 +4348,31 @@ function UserContent() {
|
|
|
3291
4348
|
return /* @__PURE__ */ jsxs12("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
3292
4349
|
/* @__PURE__ */ jsxs12("div", { className: `matchid-user-popover-item-content`, children: [
|
|
3293
4350
|
icon,
|
|
3294
|
-
/* @__PURE__ */
|
|
4351
|
+
/* @__PURE__ */ jsx18("div", { className: "matchid-user-popover-item-text", children })
|
|
3295
4352
|
] }),
|
|
3296
4353
|
rightIcon
|
|
3297
4354
|
] });
|
|
3298
4355
|
};
|
|
3299
4356
|
const UserDivider = () => {
|
|
3300
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx18("div", { className: `matchid-user-popover-divider` });
|
|
3301
4358
|
};
|
|
3302
|
-
const [usernameOpen, setUsernameOpen] =
|
|
4359
|
+
const [usernameOpen, setUsernameOpen] = useState15(false);
|
|
3303
4360
|
const [copied, setCopied] = useCopyClipboard();
|
|
3304
|
-
const intl =
|
|
4361
|
+
const intl = useIntl7();
|
|
3305
4362
|
return /* @__PURE__ */ jsxs12("div", { className: "matchid-user-popover-content", children: [
|
|
3306
4363
|
/* @__PURE__ */ jsxs12("div", { className: "matchid-user-popover-list", children: [
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
setCopied(
|
|
3309
|
-
}, icon: copied ? /* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
4364
|
+
/* @__PURE__ */ jsx18(UserItem, { onClick: () => {
|
|
4365
|
+
setCopied(address);
|
|
4366
|
+
}, icon: copied ? /* @__PURE__ */ jsx18(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ jsx18(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx18(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
4367
|
+
/* @__PURE__ */ jsx18(UserDivider, {}),
|
|
4368
|
+
/* @__PURE__ */ jsx18(UserItem, { onClick: () => {
|
|
3312
4369
|
setUsernameOpen(true);
|
|
3313
|
-
}, icon: /* @__PURE__ */
|
|
4370
|
+
}, icon: /* @__PURE__ */ jsx18(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ jsx18(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
3314
4371
|
id: "setUsername"
|
|
3315
4372
|
}) })
|
|
3316
4373
|
] }),
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ jsx18(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ jsx18(FormattedMessage7, { id: "disconnect" }) }),
|
|
4375
|
+
/* @__PURE__ */ jsx18(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
3319
4376
|
setUsernameOpen(false);
|
|
3320
4377
|
}, onSuccess: () => {
|
|
3321
4378
|
setUsernameOpen(false);
|
|
@@ -3326,12 +4383,12 @@ function UserPopover({
|
|
|
3326
4383
|
children,
|
|
3327
4384
|
...props
|
|
3328
4385
|
}) {
|
|
3329
|
-
return /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ jsx18(Popover, { ...props, content: /* @__PURE__ */ jsx18(UserContent, {}), children });
|
|
3330
4387
|
}
|
|
3331
4388
|
|
|
3332
4389
|
// src/components/LoginButton/index.tsx
|
|
3333
|
-
import { FormattedMessage as
|
|
3334
|
-
import { Fragment as Fragment3, jsx as
|
|
4390
|
+
import { FormattedMessage as FormattedMessage8, useIntl as useIntl8 } from "react-intl";
|
|
4391
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3335
4392
|
function LoginButton({
|
|
3336
4393
|
loginRender,
|
|
3337
4394
|
methods,
|
|
@@ -3343,12 +4400,12 @@ function LoginButton({
|
|
|
3343
4400
|
walletMethods,
|
|
3344
4401
|
...props
|
|
3345
4402
|
}) {
|
|
3346
|
-
const intl =
|
|
4403
|
+
const intl = useIntl8();
|
|
3347
4404
|
const { isLogin, username } = useUserInfo();
|
|
3348
|
-
const [loginOpen, setLoginOpen] =
|
|
4405
|
+
const [loginOpen, setLoginOpen] = useState16(false);
|
|
3349
4406
|
if (!isLogin) {
|
|
3350
4407
|
return /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
3351
|
-
/* @__PURE__ */
|
|
4408
|
+
/* @__PURE__ */ jsx19(
|
|
3352
4409
|
LoginModal,
|
|
3353
4410
|
{
|
|
3354
4411
|
methods,
|
|
@@ -3359,53 +4416,30 @@ function LoginButton({
|
|
|
3359
4416
|
}
|
|
3360
4417
|
),
|
|
3361
4418
|
/* @__PURE__ */ jsxs13(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
3362
|
-
/* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx19(UnLoginIcon_default, {}),
|
|
4420
|
+
/* @__PURE__ */ jsx19("span", { children: /* @__PURE__ */ jsx19(FormattedMessage8, { id: "login" }) })
|
|
3364
4421
|
] })
|
|
3365
4422
|
] });
|
|
3366
4423
|
}
|
|
3367
|
-
return loginRender ? /* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3369
|
-
/* @__PURE__ */
|
|
4424
|
+
return loginRender ? /* @__PURE__ */ jsx19(Fragment3, { children: loginRender }) : /* @__PURE__ */ jsx19(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ jsxs13(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
4425
|
+
/* @__PURE__ */ jsx19(LoginIcon_default, {}),
|
|
4426
|
+
/* @__PURE__ */ jsx19("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
3370
4427
|
id: "user"
|
|
3371
4428
|
}) })
|
|
3372
4429
|
] }) });
|
|
3373
4430
|
}
|
|
3374
4431
|
|
|
3375
4432
|
// src/components/UsernameModal/index.tsx
|
|
3376
|
-
import { useEffect as
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3380
|
-
function InfoRoundIcon({
|
|
3381
|
-
size,
|
|
3382
|
-
color = "#6E6E6E",
|
|
3383
|
-
...props
|
|
3384
|
-
}) {
|
|
3385
|
-
return /* @__PURE__ */ jsxs14("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
3386
|
-
/* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_418_7746)", children: /* @__PURE__ */ jsx19(
|
|
3387
|
-
"path",
|
|
3388
|
-
{
|
|
3389
|
-
fillRule: "evenodd",
|
|
3390
|
-
clipRule: "evenodd",
|
|
3391
|
-
d: "M7.99984 0.666504C3.94975 0.666504 0.666504 3.94975 0.666504 7.99984C0.666504 12.0499 3.94975 15.3332 7.99984 15.3332C12.0499 15.3332 15.3332 12.0499 15.3332 7.99984C15.3332 3.94975 12.0499 0.666504 7.99984 0.666504ZM1.99984 7.99984C1.99984 4.68613 4.68613 1.99984 7.99984 1.99984C11.3135 1.99984 13.9998 4.68613 13.9998 7.99984C13.9998 11.3135 11.3135 13.9998 7.99984 13.9998C4.68613 13.9998 1.99984 11.3135 1.99984 7.99984ZM8.6665 7.33317C8.6665 6.96498 8.36803 6.6665 7.99984 6.6665C7.63165 6.6665 7.33317 6.96498 7.33317 7.33317V11.3332C7.33317 11.7014 7.63165 11.9998 7.99984 11.9998C8.36803 11.9998 8.6665 11.7014 8.6665 11.3332V7.33317ZM7.99984 5.33317C8.36803 5.33317 8.6665 5.03469 8.6665 4.6665C8.6665 4.29831 8.36803 3.99984 7.99984 3.99984C7.63165 3.99984 7.33317 4.29831 7.33317 4.6665C7.33317 5.03469 7.63165 5.33317 7.99984 5.33317Z",
|
|
3392
|
-
fill: color
|
|
3393
|
-
}
|
|
3394
|
-
) }),
|
|
3395
|
-
/* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("clipPath", { id: "clip0_418_7746", children: /* @__PURE__ */ jsx19("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
3396
|
-
] });
|
|
3397
|
-
}
|
|
3398
|
-
|
|
3399
|
-
// src/components/UsernameModal/index.tsx
|
|
3400
|
-
import { FormattedMessage as FormattedMessage8, useIntl as useIntl8 } from "react-intl";
|
|
3401
|
-
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4433
|
+
import { useEffect as useEffect15, useMemo as useMemo9, useState as useState17 } from "react";
|
|
4434
|
+
import { FormattedMessage as FormattedMessage9, useIntl as useIntl9 } from "react-intl";
|
|
4435
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3402
4436
|
var ValidItem = ({
|
|
3403
4437
|
success = false,
|
|
3404
4438
|
text
|
|
3405
4439
|
}) => {
|
|
3406
4440
|
const isDownMd = useDownMd();
|
|
3407
|
-
return /* @__PURE__ */
|
|
3408
|
-
success ? /* @__PURE__ */ jsx20(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx20(
|
|
4441
|
+
return /* @__PURE__ */ jsxs14("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
4442
|
+
success ? /* @__PURE__ */ jsx20(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ jsx20(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
3409
4443
|
/* @__PURE__ */ jsx20("span", { children: text })
|
|
3410
4444
|
] });
|
|
3411
4445
|
};
|
|
@@ -3417,10 +4451,10 @@ function UsernameModal({
|
|
|
3417
4451
|
}) {
|
|
3418
4452
|
const { username, refreshOverview } = useUserInfo();
|
|
3419
4453
|
const { isLogin } = useUserInfo();
|
|
3420
|
-
const [val, setVal] =
|
|
3421
|
-
const [error, setError] =
|
|
4454
|
+
const [val, setVal] = useState17(username);
|
|
4455
|
+
const [error, setError] = useState17("");
|
|
3422
4456
|
const isDownMd = useDownMd();
|
|
3423
|
-
|
|
4457
|
+
useEffect15(() => {
|
|
3424
4458
|
if (isOpen) {
|
|
3425
4459
|
setVal(username);
|
|
3426
4460
|
setError("");
|
|
@@ -3433,7 +4467,7 @@ function UsernameModal({
|
|
|
3433
4467
|
return val.length >= 2 && val.length <= 32;
|
|
3434
4468
|
}, [val]);
|
|
3435
4469
|
const isSafe = isValid && isLength;
|
|
3436
|
-
const [isSubmitting, setIsSubmitting] =
|
|
4470
|
+
const [isSubmitting, setIsSubmitting] = useState17(false);
|
|
3437
4471
|
const onSubmit = async () => {
|
|
3438
4472
|
if (isSubmitting) return;
|
|
3439
4473
|
try {
|
|
@@ -3453,10 +4487,10 @@ function UsernameModal({
|
|
|
3453
4487
|
setIsSubmitting(false);
|
|
3454
4488
|
}
|
|
3455
4489
|
};
|
|
3456
|
-
const intl =
|
|
4490
|
+
const intl = useIntl9();
|
|
3457
4491
|
return /* @__PURE__ */ jsx20(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
3458
4492
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
3459
|
-
}), children: /* @__PURE__ */
|
|
4493
|
+
}), children: /* @__PURE__ */ jsxs14("div", { className: "matchid-username-box", children: [
|
|
3460
4494
|
/* @__PURE__ */ jsx20(Field, { label: intl.formatMessage({
|
|
3461
4495
|
id: "username"
|
|
3462
4496
|
}), error, children: /* @__PURE__ */ jsx20(
|
|
@@ -3472,7 +4506,7 @@ function UsernameModal({
|
|
|
3472
4506
|
value: val
|
|
3473
4507
|
}
|
|
3474
4508
|
) }),
|
|
3475
|
-
/* @__PURE__ */
|
|
4509
|
+
/* @__PURE__ */ jsxs14("div", { className: "matchid-valid", children: [
|
|
3476
4510
|
/* @__PURE__ */ jsx20(
|
|
3477
4511
|
ValidItem,
|
|
3478
4512
|
{
|
|
@@ -3488,15 +4522,15 @@ function UsernameModal({
|
|
|
3488
4522
|
] }),
|
|
3489
4523
|
/* @__PURE__ */ jsx20(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
3490
4524
|
marginTop: isDownMd ? "36px" : "64px"
|
|
3491
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx20(
|
|
4525
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ jsx20(FormattedMessage9, { id: "confirm" }) }),
|
|
3492
4526
|
/* @__PURE__ */ jsx20(Button, { style: {
|
|
3493
4527
|
marginTop: isDownMd ? "12px" : "24px"
|
|
3494
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx20(
|
|
4528
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ jsx20(FormattedMessage9, { id: "cancel" }) })
|
|
3495
4529
|
] }) });
|
|
3496
4530
|
}
|
|
3497
4531
|
|
|
3498
4532
|
// src/components/SOLModal/index.tsx
|
|
3499
|
-
import React7, { useEffect as
|
|
4533
|
+
import React7, { useEffect as useEffect16, useState as useState18 } from "react";
|
|
3500
4534
|
import { clusterApiUrl } from "@solana/web3.js";
|
|
3501
4535
|
import { useWallet as useWallet2, WalletProvider, ConnectionProvider } from "@solana/wallet-adapter-react";
|
|
3502
4536
|
import { WalletModalProvider, useWalletModal } from "@solana/wallet-adapter-react-ui";
|
|
@@ -3547,7 +4581,7 @@ import {
|
|
|
3547
4581
|
XDEFIWalletAdapter
|
|
3548
4582
|
} from "@solana/wallet-adapter-wallets";
|
|
3549
4583
|
import "@solana/wallet-adapter-react-ui/styles.css";
|
|
3550
|
-
import { useIntl as
|
|
4584
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
3551
4585
|
|
|
3552
4586
|
// src/components/WalletModalContent/index.tsx
|
|
3553
4587
|
import { useMemo as useMemo10 } from "react";
|
|
@@ -3560,7 +4594,7 @@ var walletConnectImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEA
|
|
|
3560
4594
|
var walletSigningImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAABAsUlEQVR4Xu19CXQUx7X2vCUveS/vJdgx+yaJHQwI8G4wzWIbG2LLNrbxPgnY7CC0SyNpJBAIECAZAbLB8gAyKGGxiFnkGJwmz47xsU0mvyEWoGW0D0jgSeK88L84/7l/fS2V3GrNaDRCEiPpfud8p3qqu6tnpvt+favqVpXJxGAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYbYvCwkKlpKREvXDhglpQUKCKz+qlS5e0z8j3N5aXl6tXrlwJMf4OBoPRDD777LPg7Ozs0MOHD1NiYiLNnTuX7rzrDho5ejj179+f+vbt69ccNGgQBQQE0LBhw2jUqFE0ZswYun3sGBo3cQxNmDiexk+8XaTBIh1LwYLfbY/vcvsnTpyofUbqjXfeeSdNnjyZHnnkEXrxxRcpKSmJfvnLX9KuXbtCz5w5ozgcjmDjs8LoQlBVNcBqtZrFjbfjIYAR/fCHP6Qf/OAH9C//8i/0z//8zw2p3P6nf/qnhtRfKH4K00B534z5kvr/71//9V/p3/7t36hHjx6aeM6cOZPWr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3928giY3D4CeRsFg3jwa701LKO+7Mb85wvjhKRw6dEi9dOkSv/39DZ9++mlGUlKStsqMsc5ufGgkPQmAu4dLn+fpGGbXJDwODAvOysrq0LUJGT4A/bH5+flJcXFxWiuuSXcDjYatZ3NdiO7orjz9tZhdg3g5oLoBbxFrG+zbt88unq8AE8P/gTaBB6Y+QP/5Xz/UbqbRYJldj7jPraGnc9G1jHal6OhotPjbTYzOhUPvHlLnL/iZFg2IBh/jA+PpwTHul3MMGvObY2vaCHw9R3ZVGfObI85pzW9pzTnGPG9szTltRf39R5UQ3cqPPvqotlApRnhyi38nBKK6RH3N/M4776CbjyZMmEB9+/bVBnfIh83kRvkl5cPRUQbQXFuEJ/p6HX8WgNb8/rYiro0uXSwzh1GkmzIyKDs721xQUKB890QxOiUqKyuDEeCTkpISumvXLlq1ahU99NBDdP/99xNi/DFqcNiwYcxOSNw7EEFecNcR4+ErMcz7hRde0Gb22bNnz+nU1FRF/egjxfgcMboYzp8/H/zll1+qvz9/Xj3/1VfqVwYWFRWhu0e9cOGCto20sLBQo3gz8P4ust/Bk3kwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDAaDwWAwGAwGg8FgMBgMBoPBYDAYDN/x/wHjsXZ4EUApzgAAAABJRU5ErkJggg==";
|
|
3561
4595
|
|
|
3562
4596
|
// src/components/WalletModalContent/index.tsx
|
|
3563
|
-
import { jsx as jsx21, jsxs as
|
|
4597
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3564
4598
|
function WalletModalContent({
|
|
3565
4599
|
status,
|
|
3566
4600
|
error,
|
|
@@ -3568,7 +4602,7 @@ function WalletModalContent({
|
|
|
3568
4602
|
setError,
|
|
3569
4603
|
setVisible,
|
|
3570
4604
|
visible,
|
|
3571
|
-
address
|
|
4605
|
+
address,
|
|
3572
4606
|
connected
|
|
3573
4607
|
}) {
|
|
3574
4608
|
const pageData = useMemo10(() => {
|
|
@@ -3629,9 +4663,9 @@ function WalletModalContent({
|
|
|
3629
4663
|
text: "Please Connect your wallet",
|
|
3630
4664
|
statusImage: walletConnectImage
|
|
3631
4665
|
};
|
|
3632
|
-
}, [visible, connected, status, error,
|
|
3633
|
-
return /* @__PURE__ */ jsx21("div", { className: "matchid-wallet-container", children: /* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
4666
|
+
}, [visible, connected, status, error, address]);
|
|
4667
|
+
return /* @__PURE__ */ jsx21("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs15("div", { className: `matchid-wallet-box`, children: [
|
|
4668
|
+
/* @__PURE__ */ jsxs15("div", { className: `matchid-wallet-content`, children: [
|
|
3635
4669
|
/* @__PURE__ */ jsx21("img", { src: pageData.statusImage }),
|
|
3636
4670
|
/* @__PURE__ */ jsx21("div", { className: pageData.isError ? "text-[#F7585E]" : "", children: pageData.text })
|
|
3637
4671
|
] }),
|
|
@@ -3658,17 +4692,17 @@ function WalletContent({
|
|
|
3658
4692
|
const { setVisible, visible } = useWalletModal();
|
|
3659
4693
|
const wallet = useWallet2();
|
|
3660
4694
|
const { events, login } = useMatch();
|
|
3661
|
-
const [status, setStatus] =
|
|
4695
|
+
const [status, setStatus] = useState18("");
|
|
3662
4696
|
const statusRef = React7.useRef(status);
|
|
3663
|
-
const [error, setError] =
|
|
3664
|
-
|
|
4697
|
+
const [error, setError] = useState18("");
|
|
4698
|
+
useEffect16(() => {
|
|
3665
4699
|
const init = async () => {
|
|
3666
4700
|
await wallet.disconnect();
|
|
3667
4701
|
setVisible(true);
|
|
3668
4702
|
};
|
|
3669
4703
|
init();
|
|
3670
4704
|
}, []);
|
|
3671
|
-
|
|
4705
|
+
useEffect16(() => {
|
|
3672
4706
|
if (wallet.connected) {
|
|
3673
4707
|
console.log("wallet.connected", wallet.connected);
|
|
3674
4708
|
toLoginInWallet();
|
|
@@ -3676,14 +4710,14 @@ function WalletContent({
|
|
|
3676
4710
|
}, [wallet.connected]);
|
|
3677
4711
|
const toLoginInWallet = async () => {
|
|
3678
4712
|
if (statusRef.current) return;
|
|
3679
|
-
const
|
|
4713
|
+
const address = wallet.publicKey?.toBase58() || "";
|
|
3680
4714
|
try {
|
|
3681
4715
|
setStatus("nonce");
|
|
3682
4716
|
statusRef.current = "nonce";
|
|
3683
4717
|
const res = type == "bind" ? await getWalletInitApi({
|
|
3684
|
-
address
|
|
4718
|
+
address,
|
|
3685
4719
|
type: "SOL"
|
|
3686
|
-
}) : await getWalletNonceApi({ address
|
|
4720
|
+
}) : await getWalletNonceApi({ address, type: "SOL" });
|
|
3687
4721
|
if (!isSuccess(res)) {
|
|
3688
4722
|
throw new Error(res.message);
|
|
3689
4723
|
}
|
|
@@ -3696,7 +4730,7 @@ function WalletContent({
|
|
|
3696
4730
|
const signedMessage = await wallet.signMessage(encodedMessage);
|
|
3697
4731
|
let obj = {
|
|
3698
4732
|
type: "SOL",
|
|
3699
|
-
address
|
|
4733
|
+
address,
|
|
3700
4734
|
signature: Buffer.from(signedMessage).toString("base64"),
|
|
3701
4735
|
message,
|
|
3702
4736
|
connector_type: "SOL",
|
|
@@ -3792,7 +4826,7 @@ function SOLConnectModal({
|
|
|
3792
4826
|
onSuccess,
|
|
3793
4827
|
...props
|
|
3794
4828
|
}) {
|
|
3795
|
-
const intl =
|
|
4829
|
+
const intl = useIntl10();
|
|
3796
4830
|
return /* @__PURE__ */ jsx22(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
3797
4831
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
3798
4832
|
}, {
|
|
@@ -3804,8 +4838,8 @@ function SOLModal(props) {
|
|
|
3804
4838
|
}
|
|
3805
4839
|
|
|
3806
4840
|
// src/components/TRONModal/index.tsx
|
|
3807
|
-
import React8, { useEffect as
|
|
3808
|
-
import { useIntl as
|
|
4841
|
+
import React8, { useEffect as useEffect18, useMemo as useMemo11, useState as useState20 } from "react";
|
|
4842
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
3809
4843
|
|
|
3810
4844
|
// src/lib/tron/TronLinkAdapter.ts
|
|
3811
4845
|
var TronLinkAdapter = class {
|
|
@@ -3838,7 +4872,7 @@ var TronLinkAdapter = class {
|
|
|
3838
4872
|
};
|
|
3839
4873
|
|
|
3840
4874
|
// src/hooks/useTRONWallet.ts
|
|
3841
|
-
import { useEffect as
|
|
4875
|
+
import { useEffect as useEffect17, useState as useState19 } from "react";
|
|
3842
4876
|
|
|
3843
4877
|
// src/lib/tron/BitgetAdapter.ts
|
|
3844
4878
|
var BitgetAdapter = class {
|
|
@@ -3883,9 +4917,9 @@ var OKXAdapter = class {
|
|
|
3883
4917
|
// src/hooks/useTRONWallet.ts
|
|
3884
4918
|
var useTRONWallet = () => {
|
|
3885
4919
|
const wallets2 = [new TronLinkAdapter(), new BitgetAdapter(), new OKXAdapter()];
|
|
3886
|
-
const [installedWallets, setInstalledWallets] =
|
|
3887
|
-
const [
|
|
3888
|
-
|
|
4920
|
+
const [installedWallets, setInstalledWallets] = useState19([]);
|
|
4921
|
+
const [address, setAddress] = useState19(null);
|
|
4922
|
+
useEffect17(() => {
|
|
3889
4923
|
const getInstalled = async () => {
|
|
3890
4924
|
const installed = await Promise.all(wallets2.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
3891
4925
|
wallet: wallet2,
|
|
@@ -3895,11 +4929,11 @@ var useTRONWallet = () => {
|
|
|
3895
4929
|
};
|
|
3896
4930
|
getInstalled();
|
|
3897
4931
|
}, []);
|
|
3898
|
-
const [wallet, chooseWallet] =
|
|
4932
|
+
const [wallet, chooseWallet] = useState19(null);
|
|
3899
4933
|
const onConnect = async () => {
|
|
3900
4934
|
setAddress(await wallet.connect());
|
|
3901
4935
|
};
|
|
3902
|
-
|
|
4936
|
+
useEffect17(() => {
|
|
3903
4937
|
if (!wallet) {
|
|
3904
4938
|
setAddress(null);
|
|
3905
4939
|
}
|
|
@@ -3909,33 +4943,33 @@ var useTRONWallet = () => {
|
|
|
3909
4943
|
wallets: wallets2,
|
|
3910
4944
|
chooseWallet,
|
|
3911
4945
|
wallet,
|
|
3912
|
-
address
|
|
4946
|
+
address,
|
|
3913
4947
|
onConnect
|
|
3914
4948
|
};
|
|
3915
4949
|
};
|
|
3916
4950
|
|
|
3917
4951
|
// src/components/TRONModal/index.tsx
|
|
3918
|
-
import { jsx as jsx23, jsxs as
|
|
4952
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3919
4953
|
function TRONConnectModal({
|
|
3920
4954
|
type = "login",
|
|
3921
4955
|
onSuccess,
|
|
3922
4956
|
...props
|
|
3923
4957
|
}) {
|
|
3924
4958
|
const isDownMd = useDownMd();
|
|
3925
|
-
const intl =
|
|
3926
|
-
const { wallets: wallets2, installedWallets, chooseWallet, wallet, address
|
|
4959
|
+
const intl = useIntl11();
|
|
4960
|
+
const { wallets: wallets2, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
3927
4961
|
const iconMaps = {
|
|
3928
4962
|
tronlink: /* @__PURE__ */ jsx23(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
3929
4963
|
bitget: /* @__PURE__ */ jsx23(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
3930
4964
|
okx: /* @__PURE__ */ jsx23(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
3931
4965
|
};
|
|
3932
4966
|
const { events, login } = useMatch();
|
|
3933
|
-
const [status, setStatus] =
|
|
4967
|
+
const [status, setStatus] = useState20("");
|
|
3934
4968
|
const statusRef = React8.useRef(status);
|
|
3935
|
-
const [error, setError] =
|
|
4969
|
+
const [error, setError] = useState20("");
|
|
3936
4970
|
const connected = useMemo11(() => {
|
|
3937
|
-
return !!
|
|
3938
|
-
}, [
|
|
4971
|
+
return !!address;
|
|
4972
|
+
}, [address]);
|
|
3939
4973
|
const disconnect = async () => {
|
|
3940
4974
|
setStatus("");
|
|
3941
4975
|
chooseWallet(null);
|
|
@@ -3949,11 +4983,11 @@ function TRONConnectModal({
|
|
|
3949
4983
|
setError("");
|
|
3950
4984
|
};
|
|
3951
4985
|
const toLoginInWallet = async () => {
|
|
3952
|
-
if (statusRef.current || !
|
|
4986
|
+
if (statusRef.current || !address || !wallet) return;
|
|
3953
4987
|
try {
|
|
3954
4988
|
setStatus("nonce");
|
|
3955
4989
|
statusRef.current = "nonce";
|
|
3956
|
-
const res = type == "bind" ? await getWalletInitApi({ address
|
|
4990
|
+
const res = type == "bind" ? await getWalletInitApi({ address, type: "TRON" }) : await getWalletNonceApi({ address, type: "TRON" });
|
|
3957
4991
|
if (!isSuccess(res)) {
|
|
3958
4992
|
throw new Error(res.message);
|
|
3959
4993
|
}
|
|
@@ -3965,7 +4999,7 @@ function TRONConnectModal({
|
|
|
3965
4999
|
const signedMessage = await wallet.signMessage(message);
|
|
3966
5000
|
let obj = {
|
|
3967
5001
|
type: "TRON",
|
|
3968
|
-
address
|
|
5002
|
+
address,
|
|
3969
5003
|
signature: signedMessage,
|
|
3970
5004
|
message,
|
|
3971
5005
|
connector_type: "TRON",
|
|
@@ -4001,7 +5035,7 @@ function TRONConnectModal({
|
|
|
4001
5035
|
statusRef.current = "";
|
|
4002
5036
|
}
|
|
4003
5037
|
};
|
|
4004
|
-
|
|
5038
|
+
useEffect18(() => {
|
|
4005
5039
|
if (wallet) {
|
|
4006
5040
|
console.log("onConnect");
|
|
4007
5041
|
onConnect();
|
|
@@ -4009,12 +5043,12 @@ function TRONConnectModal({
|
|
|
4009
5043
|
setStatus("");
|
|
4010
5044
|
}
|
|
4011
5045
|
}, [wallet]);
|
|
4012
|
-
|
|
4013
|
-
if (
|
|
5046
|
+
useEffect18(() => {
|
|
5047
|
+
if (address) {
|
|
4014
5048
|
toLoginInWallet();
|
|
4015
5049
|
}
|
|
4016
|
-
}, [
|
|
4017
|
-
|
|
5050
|
+
}, [address]);
|
|
5051
|
+
useEffect18(() => {
|
|
4018
5052
|
if (!props.isOpen) {
|
|
4019
5053
|
disconnect();
|
|
4020
5054
|
}
|
|
@@ -4030,13 +5064,13 @@ function TRONConnectModal({
|
|
|
4030
5064
|
setError,
|
|
4031
5065
|
status,
|
|
4032
5066
|
disconnect,
|
|
4033
|
-
address:
|
|
5067
|
+
address: address || "",
|
|
4034
5068
|
connected,
|
|
4035
5069
|
visible: true,
|
|
4036
5070
|
setVisible: () => {
|
|
4037
5071
|
}
|
|
4038
5072
|
}
|
|
4039
|
-
) : /* @__PURE__ */ jsx23("div", { className: "matchid-login-box", children: /* @__PURE__ */
|
|
5073
|
+
) : /* @__PURE__ */ jsx23("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs16("div", { className: "matchid-login-recommend-list", children: [
|
|
4040
5074
|
installedWallets.map((wallet2) => {
|
|
4041
5075
|
return /* @__PURE__ */ jsx23(
|
|
4042
5076
|
RecommendItem,
|
|
@@ -4072,8 +5106,8 @@ function TRONModal(props) {
|
|
|
4072
5106
|
}
|
|
4073
5107
|
|
|
4074
5108
|
// src/components/TONModal/index.tsx
|
|
4075
|
-
import React9, { useEffect as
|
|
4076
|
-
import { useIntl as
|
|
5109
|
+
import React9, { useEffect as useEffect19, useState as useState21 } from "react";
|
|
5110
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
4077
5111
|
import {
|
|
4078
5112
|
TonConnectUIProvider,
|
|
4079
5113
|
useTonAddress,
|
|
@@ -4087,15 +5121,15 @@ function WalletContent2({
|
|
|
4087
5121
|
type
|
|
4088
5122
|
}) {
|
|
4089
5123
|
const { events, login } = useMatch();
|
|
4090
|
-
const [connected, setConnected] =
|
|
5124
|
+
const [connected, setConnected] = useState21(false);
|
|
4091
5125
|
const wallet = useTonWallet();
|
|
4092
5126
|
const userFriendlyAddress = useTonAddress();
|
|
4093
5127
|
const [tonConnectUI] = useTonConnectUI();
|
|
4094
5128
|
const { state, open, close } = useTonConnectModal();
|
|
4095
|
-
const [status, setStatus] =
|
|
5129
|
+
const [status, setStatus] = useState21("");
|
|
4096
5130
|
const statusRef = React9.useRef(status);
|
|
4097
|
-
const [error, setError] =
|
|
4098
|
-
|
|
5131
|
+
const [error, setError] = useState21("");
|
|
5132
|
+
useEffect19(() => {
|
|
4099
5133
|
const init = async () => {
|
|
4100
5134
|
if (wallet) {
|
|
4101
5135
|
await tonConnectUI.disconnect();
|
|
@@ -4168,7 +5202,7 @@ function WalletContent2({
|
|
|
4168
5202
|
}
|
|
4169
5203
|
});
|
|
4170
5204
|
}, []);
|
|
4171
|
-
|
|
5205
|
+
useEffect19(() => {
|
|
4172
5206
|
if (wallet) {
|
|
4173
5207
|
setConnected(true);
|
|
4174
5208
|
console.log("Wallet connected:", wallet);
|
|
@@ -4179,7 +5213,7 @@ function WalletContent2({
|
|
|
4179
5213
|
setStatus("");
|
|
4180
5214
|
}
|
|
4181
5215
|
}, [wallet]);
|
|
4182
|
-
|
|
5216
|
+
useEffect19(() => {
|
|
4183
5217
|
console.log({
|
|
4184
5218
|
state,
|
|
4185
5219
|
wallet
|
|
@@ -4239,7 +5273,7 @@ function TONConnectModal({
|
|
|
4239
5273
|
onSuccess,
|
|
4240
5274
|
...props
|
|
4241
5275
|
}) {
|
|
4242
|
-
const intl =
|
|
5276
|
+
const intl = useIntl12();
|
|
4243
5277
|
const { endpoints, appid } = useLocalStore_default();
|
|
4244
5278
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
4245
5279
|
return /* @__PURE__ */ jsx24(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
@@ -4259,8 +5293,8 @@ function TONModal(props) {
|
|
|
4259
5293
|
}
|
|
4260
5294
|
|
|
4261
5295
|
// src/components/BTCModal/index.tsx
|
|
4262
|
-
import React10, { useEffect as
|
|
4263
|
-
import { useIntl as
|
|
5296
|
+
import React10, { useEffect as useEffect21, useMemo as useMemo12, useState as useState23 } from "react";
|
|
5297
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
4264
5298
|
|
|
4265
5299
|
// src/lib/btc/UnisatAdapter.ts
|
|
4266
5300
|
var UnisatAdapter = class {
|
|
@@ -4351,7 +5385,7 @@ var XverseAdapter = class {
|
|
|
4351
5385
|
matchlog_default.log("getAccounts ~ response:", response);
|
|
4352
5386
|
if (response.status === "success") {
|
|
4353
5387
|
const ordinalsAddressItem = response.result.find(
|
|
4354
|
-
(
|
|
5388
|
+
(address) => address.purpose === AddressPurpose.Ordinals
|
|
4355
5389
|
);
|
|
4356
5390
|
this.address = ordinalsAddressItem?.address || "";
|
|
4357
5391
|
return ordinalsAddressItem?.address || "";
|
|
@@ -4414,12 +5448,12 @@ var LeatherAdapter = class {
|
|
|
4414
5448
|
};
|
|
4415
5449
|
|
|
4416
5450
|
// src/hooks/useBTCWallet.ts
|
|
4417
|
-
import { useEffect as
|
|
5451
|
+
import { useEffect as useEffect20, useState as useState22 } from "react";
|
|
4418
5452
|
var useBTCWallet = () => {
|
|
4419
5453
|
const wallets2 = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter()];
|
|
4420
|
-
const [installedWallets, setInstalledWallets] =
|
|
4421
|
-
const [
|
|
4422
|
-
|
|
5454
|
+
const [installedWallets, setInstalledWallets] = useState22([]);
|
|
5455
|
+
const [address, setAddress] = useState22(null);
|
|
5456
|
+
useEffect20(() => {
|
|
4423
5457
|
const getInstalled = async () => {
|
|
4424
5458
|
const installed = await Promise.all(wallets2.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
4425
5459
|
wallet: wallet2,
|
|
@@ -4429,11 +5463,11 @@ var useBTCWallet = () => {
|
|
|
4429
5463
|
};
|
|
4430
5464
|
getInstalled();
|
|
4431
5465
|
}, []);
|
|
4432
|
-
const [wallet, chooseWallet] =
|
|
5466
|
+
const [wallet, chooseWallet] = useState22(null);
|
|
4433
5467
|
const onConnect = async () => {
|
|
4434
5468
|
setAddress(await wallet.connect());
|
|
4435
5469
|
};
|
|
4436
|
-
|
|
5470
|
+
useEffect20(() => {
|
|
4437
5471
|
if (!wallet) {
|
|
4438
5472
|
setAddress(null);
|
|
4439
5473
|
}
|
|
@@ -4443,33 +5477,33 @@ var useBTCWallet = () => {
|
|
|
4443
5477
|
wallets: wallets2,
|
|
4444
5478
|
chooseWallet,
|
|
4445
5479
|
wallet,
|
|
4446
|
-
address
|
|
5480
|
+
address,
|
|
4447
5481
|
onConnect
|
|
4448
5482
|
};
|
|
4449
5483
|
};
|
|
4450
5484
|
|
|
4451
5485
|
// src/components/BTCModal/index.tsx
|
|
4452
|
-
import { jsx as jsx25, jsxs as
|
|
5486
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4453
5487
|
function BTCConnectModal({
|
|
4454
5488
|
type = "login",
|
|
4455
5489
|
onSuccess,
|
|
4456
5490
|
...props
|
|
4457
5491
|
}) {
|
|
4458
5492
|
const isDownMd = useDownMd();
|
|
4459
|
-
const intl =
|
|
4460
|
-
const { wallets: wallets2, installedWallets, chooseWallet, wallet, address
|
|
5493
|
+
const intl = useIntl13();
|
|
5494
|
+
const { wallets: wallets2, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
4461
5495
|
const iconMaps = {
|
|
4462
5496
|
leather: /* @__PURE__ */ jsx25(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
4463
5497
|
unisat: /* @__PURE__ */ jsx25(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
4464
5498
|
xverse: /* @__PURE__ */ jsx25(XverseIcon, { size: isDownMd ? 36 : 40 })
|
|
4465
5499
|
};
|
|
4466
5500
|
const { events, login } = useMatch();
|
|
4467
|
-
const [status, setStatus] =
|
|
5501
|
+
const [status, setStatus] = useState23("");
|
|
4468
5502
|
const statusRef = React10.useRef(status);
|
|
4469
|
-
const [error, setError] =
|
|
5503
|
+
const [error, setError] = useState23("");
|
|
4470
5504
|
const connected = useMemo12(() => {
|
|
4471
|
-
return !!
|
|
4472
|
-
}, [
|
|
5505
|
+
return !!address;
|
|
5506
|
+
}, [address]);
|
|
4473
5507
|
const disconnect = async () => {
|
|
4474
5508
|
wallet && wallet.disconnet && wallet.disconnet();
|
|
4475
5509
|
setStatus("");
|
|
@@ -4478,11 +5512,11 @@ function BTCConnectModal({
|
|
|
4478
5512
|
setError("");
|
|
4479
5513
|
};
|
|
4480
5514
|
const toLoginInWallet = async () => {
|
|
4481
|
-
if (statusRef.current || !
|
|
5515
|
+
if (statusRef.current || !address || !wallet) return;
|
|
4482
5516
|
try {
|
|
4483
5517
|
setStatus("nonce");
|
|
4484
5518
|
statusRef.current = "nonce";
|
|
4485
|
-
const res = type == "bind" ? await getWalletInitApi({ address
|
|
5519
|
+
const res = type == "bind" ? await getWalletInitApi({ address, type: "BTC" }) : await getWalletNonceApi({ address, type: "BTC" });
|
|
4486
5520
|
if (!isSuccess(res)) {
|
|
4487
5521
|
throw new Error(res.message);
|
|
4488
5522
|
}
|
|
@@ -4494,7 +5528,7 @@ function BTCConnectModal({
|
|
|
4494
5528
|
const signedMessage = await wallet.signMessage(message);
|
|
4495
5529
|
let obj = {
|
|
4496
5530
|
type: "BTC",
|
|
4497
|
-
address
|
|
5531
|
+
address,
|
|
4498
5532
|
signature: signedMessage,
|
|
4499
5533
|
message,
|
|
4500
5534
|
connector_type: "BTC",
|
|
@@ -4531,7 +5565,7 @@ function BTCConnectModal({
|
|
|
4531
5565
|
statusRef.current = "";
|
|
4532
5566
|
}
|
|
4533
5567
|
};
|
|
4534
|
-
|
|
5568
|
+
useEffect21(() => {
|
|
4535
5569
|
if (wallet) {
|
|
4536
5570
|
console.log("onConnect");
|
|
4537
5571
|
try {
|
|
@@ -4544,12 +5578,12 @@ function BTCConnectModal({
|
|
|
4544
5578
|
setStatus("");
|
|
4545
5579
|
}
|
|
4546
5580
|
}, [wallet]);
|
|
4547
|
-
|
|
4548
|
-
if (
|
|
5581
|
+
useEffect21(() => {
|
|
5582
|
+
if (address) {
|
|
4549
5583
|
toLoginInWallet();
|
|
4550
5584
|
}
|
|
4551
|
-
}, [
|
|
4552
|
-
|
|
5585
|
+
}, [address]);
|
|
5586
|
+
useEffect21(() => {
|
|
4553
5587
|
if (!props.isOpen) {
|
|
4554
5588
|
disconnect();
|
|
4555
5589
|
}
|
|
@@ -4572,13 +5606,13 @@ function BTCConnectModal({
|
|
|
4572
5606
|
setError,
|
|
4573
5607
|
status,
|
|
4574
5608
|
disconnect,
|
|
4575
|
-
address:
|
|
5609
|
+
address: address || "",
|
|
4576
5610
|
connected,
|
|
4577
5611
|
visible: true,
|
|
4578
5612
|
setVisible: () => {
|
|
4579
5613
|
}
|
|
4580
5614
|
}
|
|
4581
|
-
) : /* @__PURE__ */ jsx25("div", { className: "matchid-login-box", children: /* @__PURE__ */
|
|
5615
|
+
) : /* @__PURE__ */ jsx25("div", { className: "matchid-login-box", children: /* @__PURE__ */ jsxs17("div", { className: "matchid-login-recommend-list", children: [
|
|
4582
5616
|
installedWallets.map((wallet2) => {
|
|
4583
5617
|
return /* @__PURE__ */ jsx25(
|
|
4584
5618
|
RecommendItem,
|
|
@@ -4615,14 +5649,14 @@ function BTCModal(props) {
|
|
|
4615
5649
|
|
|
4616
5650
|
// src/components/WalletModal/index.tsx
|
|
4617
5651
|
import { useMemo as useMemo13 } from "react";
|
|
4618
|
-
import { useIntl as
|
|
5652
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
4619
5653
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4620
5654
|
function WalletConnectModal({
|
|
4621
5655
|
type,
|
|
4622
5656
|
methods: _methods,
|
|
4623
5657
|
...props
|
|
4624
5658
|
}) {
|
|
4625
|
-
const intl =
|
|
5659
|
+
const intl = useIntl14();
|
|
4626
5660
|
const { walletMap } = useWalletConfig();
|
|
4627
5661
|
const { bind, login } = useUserInfo();
|
|
4628
5662
|
const config = useAppConfig();
|
|
@@ -4657,6 +5691,607 @@ function WalletModal(props) {
|
|
|
4657
5691
|
return props.isOpen && /* @__PURE__ */ jsx26(WalletConnectModal, { ...props });
|
|
4658
5692
|
}
|
|
4659
5693
|
|
|
5694
|
+
// src/components/AlphaAvatar/index.tsx
|
|
5695
|
+
import { useEffect as useEffect22, useState as useState24 } from "react";
|
|
5696
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5697
|
+
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
5698
|
+
const [avatar, setAvatar] = useState24(void 0);
|
|
5699
|
+
useEffect22(() => {
|
|
5700
|
+
if (name) {
|
|
5701
|
+
const char = name[0].toUpperCase();
|
|
5702
|
+
setAvatar(char);
|
|
5703
|
+
}
|
|
5704
|
+
}, [name]);
|
|
5705
|
+
return /* @__PURE__ */ jsx27("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
5706
|
+
width: size,
|
|
5707
|
+
height: size,
|
|
5708
|
+
fontSize: Math.ceil(size / 2)
|
|
5709
|
+
}, children: avatar });
|
|
5710
|
+
}
|
|
5711
|
+
|
|
5712
|
+
// src/components/WalletAsset/index.tsx
|
|
5713
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5714
|
+
function WalletAsset({
|
|
5715
|
+
onAssetClick,
|
|
5716
|
+
matchWalletAssetsOptions
|
|
5717
|
+
}) {
|
|
5718
|
+
const walletAssets = useMatchWalletAssets(matchWalletAssetsOptions);
|
|
5719
|
+
const matchWalletAssetList = useMatchWalletAssetList({
|
|
5720
|
+
list: walletAssets.mergedAssets
|
|
5721
|
+
});
|
|
5722
|
+
const { list } = useMatchChain();
|
|
5723
|
+
return /* @__PURE__ */ jsx28("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
5724
|
+
const clickFunc = onAssetClick && onAssetClick(n);
|
|
5725
|
+
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
5726
|
+
const getFooterColor = () => {
|
|
5727
|
+
if (!n.price_change_24h) {
|
|
5728
|
+
return "";
|
|
5729
|
+
}
|
|
5730
|
+
if (n.price_change_24h > 0) {
|
|
5731
|
+
return "matchid-wallet-asset-up";
|
|
5732
|
+
}
|
|
5733
|
+
if (n.price_change_24h < 0) {
|
|
5734
|
+
return "matchid-wallet-asset-down";
|
|
5735
|
+
}
|
|
5736
|
+
return "";
|
|
5737
|
+
};
|
|
5738
|
+
return /* @__PURE__ */ jsxs18("div", { className: `matchid-wallet-asset-item`, onClick: clickFunc, style: {
|
|
5739
|
+
cursor: clickFunc ? "pointer" : "default"
|
|
5740
|
+
}, children: [
|
|
5741
|
+
/* @__PURE__ */ jsxs18("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
5742
|
+
n.icon ? /* @__PURE__ */ jsx28("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ jsx28(
|
|
5743
|
+
AlphaAvatar2,
|
|
5744
|
+
{
|
|
5745
|
+
className: `matchid-wallet-asset-icon`,
|
|
5746
|
+
size: 40,
|
|
5747
|
+
name: n.symbol || n.name || ""
|
|
5748
|
+
}
|
|
5749
|
+
),
|
|
5750
|
+
chain?.iconUrl && /* @__PURE__ */ jsx28("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
5751
|
+
] }),
|
|
5752
|
+
/* @__PURE__ */ jsxs18("div", { className: `matchid-wallet-asset-info`, children: [
|
|
5753
|
+
/* @__PURE__ */ jsx28("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
5754
|
+
"price" in n && /* @__PURE__ */ jsxs18("div", { className: `matchid-wallet-asset-content`, children: [
|
|
5755
|
+
/* @__PURE__ */ jsx28("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ jsx28(
|
|
5756
|
+
NumberFormatter,
|
|
5757
|
+
{
|
|
5758
|
+
value: n.price,
|
|
5759
|
+
prefix: "$ ",
|
|
5760
|
+
tFixNum: 2
|
|
5761
|
+
}
|
|
5762
|
+
) }),
|
|
5763
|
+
/* @__PURE__ */ jsx28("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ jsx28(
|
|
5764
|
+
NumberFormatter,
|
|
5765
|
+
{
|
|
5766
|
+
value: n.value,
|
|
5767
|
+
prefix: "$ ",
|
|
5768
|
+
tFixNum: 2
|
|
5769
|
+
}
|
|
5770
|
+
) })
|
|
5771
|
+
] }),
|
|
5772
|
+
/* @__PURE__ */ jsxs18("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
5773
|
+
/* @__PURE__ */ jsx28("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ jsx28(
|
|
5774
|
+
NumberFormatter,
|
|
5775
|
+
{
|
|
5776
|
+
value: n.balance,
|
|
5777
|
+
tFixNum: 3
|
|
5778
|
+
}
|
|
5779
|
+
) }),
|
|
5780
|
+
"price_change_24h" in n && /* @__PURE__ */ jsx28("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ jsx28(
|
|
5781
|
+
NumberFormatter,
|
|
5782
|
+
{
|
|
5783
|
+
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
5784
|
+
value: Math.abs(n.price_change_24h || 0),
|
|
5785
|
+
suffix: "%",
|
|
5786
|
+
tFixNum: 3
|
|
5787
|
+
}
|
|
5788
|
+
) })
|
|
5789
|
+
] })
|
|
5790
|
+
] })
|
|
5791
|
+
] }, index);
|
|
5792
|
+
}) });
|
|
5793
|
+
}
|
|
5794
|
+
|
|
5795
|
+
// src/components/TokenSend/index.tsx
|
|
5796
|
+
import { useEffect as useEffect23, useMemo as useMemo14, useState as useState25 } from "react";
|
|
5797
|
+
import { defineChain as defineChain3, encodeFunctionData as encodeFunctionData2, http as http5, parseUnits as parseUnits2 } from "viem";
|
|
5798
|
+
import { FormattedMessage as FormattedMessage10, useIntl as useIntl15 } from "react-intl";
|
|
5799
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5800
|
+
function Input2({
|
|
5801
|
+
onChange,
|
|
5802
|
+
placeholder,
|
|
5803
|
+
value,
|
|
5804
|
+
maxLength,
|
|
5805
|
+
type,
|
|
5806
|
+
error,
|
|
5807
|
+
size = "df"
|
|
5808
|
+
}) {
|
|
5809
|
+
return /* @__PURE__ */ jsxs19("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
5810
|
+
/* @__PURE__ */ jsx29(
|
|
5811
|
+
"input",
|
|
5812
|
+
{
|
|
5813
|
+
placeholder,
|
|
5814
|
+
onChange,
|
|
5815
|
+
maxLength,
|
|
5816
|
+
type,
|
|
5817
|
+
value,
|
|
5818
|
+
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
5819
|
+
}
|
|
5820
|
+
),
|
|
5821
|
+
error && /* @__PURE__ */ jsx29("div", { className: "matchid-token-input-error-text", children: error })
|
|
5822
|
+
] });
|
|
5823
|
+
}
|
|
5824
|
+
function TokenSend({
|
|
5825
|
+
onClose,
|
|
5826
|
+
zIndex,
|
|
5827
|
+
token,
|
|
5828
|
+
onBack
|
|
5829
|
+
}) {
|
|
5830
|
+
const { list: chainList } = useMatchChain();
|
|
5831
|
+
const intl = useIntl15();
|
|
5832
|
+
const { createWalletClient: createWalletClient2 } = useWallet();
|
|
5833
|
+
const isNative = token.address.toLowerCase() == NATIVE_TOKEN_ADDRESS;
|
|
5834
|
+
const chain = useMemo14(() => {
|
|
5835
|
+
return chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
5836
|
+
}, [chainList, token.chain_id]);
|
|
5837
|
+
const walletClient = useMemo14(() => {
|
|
5838
|
+
return createWalletClient2({
|
|
5839
|
+
// @ts-ignore
|
|
5840
|
+
chain: defineChain3(chain),
|
|
5841
|
+
transport: http5()
|
|
5842
|
+
});
|
|
5843
|
+
}, [chain]);
|
|
5844
|
+
const [amount, setAmount] = useState25("");
|
|
5845
|
+
const [address, setAddress] = useState25("");
|
|
5846
|
+
const [loading, setLoading] = useState25(false);
|
|
5847
|
+
const [sending, setSending] = useState25(false);
|
|
5848
|
+
const [txError, setTxError] = useState25("");
|
|
5849
|
+
const transaction = useMemo14(() => {
|
|
5850
|
+
if (!amount || !address) {
|
|
5851
|
+
return;
|
|
5852
|
+
}
|
|
5853
|
+
const abi = [
|
|
5854
|
+
{
|
|
5855
|
+
"constant": false,
|
|
5856
|
+
"inputs": [
|
|
5857
|
+
{
|
|
5858
|
+
"name": "_to",
|
|
5859
|
+
"type": "address"
|
|
5860
|
+
},
|
|
5861
|
+
{
|
|
5862
|
+
"name": "_value",
|
|
5863
|
+
"type": "uint256"
|
|
5864
|
+
}
|
|
5865
|
+
],
|
|
5866
|
+
"name": "transfer",
|
|
5867
|
+
"outputs": [
|
|
5868
|
+
{
|
|
5869
|
+
"name": "",
|
|
5870
|
+
"type": "bool"
|
|
5871
|
+
}
|
|
5872
|
+
],
|
|
5873
|
+
"payable": false,
|
|
5874
|
+
"stateMutability": "nonpayable",
|
|
5875
|
+
"type": "function"
|
|
5876
|
+
}
|
|
5877
|
+
];
|
|
5878
|
+
const viemChain = defineChain3(chain);
|
|
5879
|
+
const to = isNative ? address : token.address;
|
|
5880
|
+
const value = isNative ? parseUnits2(amount, parseInt(token?.decimals || "18")) : BigInt(0);
|
|
5881
|
+
const data = isNative ? "0x" : encodeFunctionData2({
|
|
5882
|
+
abi,
|
|
5883
|
+
functionName: "transfer",
|
|
5884
|
+
args: [address, parseUnits2(amount, parseInt(token?.decimals || "18"))]
|
|
5885
|
+
});
|
|
5886
|
+
return {
|
|
5887
|
+
to,
|
|
5888
|
+
value,
|
|
5889
|
+
data,
|
|
5890
|
+
chain: viemChain
|
|
5891
|
+
};
|
|
5892
|
+
}, [amount, address]);
|
|
5893
|
+
const onCal = async () => {
|
|
5894
|
+
try {
|
|
5895
|
+
setLoading(true);
|
|
5896
|
+
await walletClient?.prepareTransactionRequest(transaction);
|
|
5897
|
+
} catch (error2) {
|
|
5898
|
+
console.error(error2);
|
|
5899
|
+
setTxError(error2.details || error2.message);
|
|
5900
|
+
} finally {
|
|
5901
|
+
setLoading(false);
|
|
5902
|
+
}
|
|
5903
|
+
};
|
|
5904
|
+
const error = useMemo14(() => {
|
|
5905
|
+
setTxError("");
|
|
5906
|
+
let amountError = "";
|
|
5907
|
+
let addressError = "";
|
|
5908
|
+
if (amount) {
|
|
5909
|
+
if (parseFloat(amount) <= 0) {
|
|
5910
|
+
amountError = intl.formatMessage({
|
|
5911
|
+
id: "tokenAmountMin"
|
|
5912
|
+
});
|
|
5913
|
+
} else if ("balance" in token && parseFloat(amount) > (token.balance || 0)) {
|
|
5914
|
+
amountError = intl.formatMessage({
|
|
5915
|
+
id: "tokenAmountMax"
|
|
5916
|
+
});
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5919
|
+
if (address) {
|
|
5920
|
+
if (address.length < 42) {
|
|
5921
|
+
addressError = intl.formatMessage({
|
|
5922
|
+
id: "tokenAddressError"
|
|
5923
|
+
});
|
|
5924
|
+
} else {
|
|
5925
|
+
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
5926
|
+
if (!reg.test(address)) {
|
|
5927
|
+
addressError = intl.formatMessage({
|
|
5928
|
+
id: "tokenAddressError"
|
|
5929
|
+
});
|
|
5930
|
+
}
|
|
5931
|
+
}
|
|
5932
|
+
}
|
|
5933
|
+
if (amount && address && !amountError && !addressError && walletClient) {
|
|
5934
|
+
onCal();
|
|
5935
|
+
}
|
|
5936
|
+
return {
|
|
5937
|
+
amount: amountError,
|
|
5938
|
+
address: addressError
|
|
5939
|
+
};
|
|
5940
|
+
}, [amount, token, chain, address, walletClient]);
|
|
5941
|
+
const onChangeAmount = (e) => {
|
|
5942
|
+
const value = e.target.value;
|
|
5943
|
+
if (value.match(/^\d*\.?\d*$/)) {
|
|
5944
|
+
setAmount(value);
|
|
5945
|
+
}
|
|
5946
|
+
};
|
|
5947
|
+
const canSend = useMemo14(() => {
|
|
5948
|
+
return !error.amount && !error.address && amount && address;
|
|
5949
|
+
}, [error]);
|
|
5950
|
+
const onNext = async () => {
|
|
5951
|
+
setSending(true);
|
|
5952
|
+
if (transaction) {
|
|
5953
|
+
await walletClient?.sendTransaction(transaction);
|
|
5954
|
+
}
|
|
5955
|
+
onClose();
|
|
5956
|
+
};
|
|
5957
|
+
useEffect23(() => {
|
|
5958
|
+
const receiveMessage = (event) => {
|
|
5959
|
+
if (event.data) {
|
|
5960
|
+
if (event.data.source == "match-wallet") {
|
|
5961
|
+
if (event.data.method == "sendTransaction" && event.data.messageId == "openIframe") {
|
|
5962
|
+
onBack();
|
|
5963
|
+
setSending(false);
|
|
5964
|
+
}
|
|
5965
|
+
}
|
|
5966
|
+
}
|
|
5967
|
+
};
|
|
5968
|
+
window.addEventListener("message", receiveMessage);
|
|
5969
|
+
return () => {
|
|
5970
|
+
window.removeEventListener("message", receiveMessage);
|
|
5971
|
+
};
|
|
5972
|
+
}, []);
|
|
5973
|
+
return /* @__PURE__ */ jsx29(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ jsx29(FormattedMessage10, { id: "send" }), onBack, children: /* @__PURE__ */ jsxs19("div", { className: `matchid-token-send-box`, children: [
|
|
5974
|
+
/* @__PURE__ */ jsxs19("div", { className: "matchid-token-send-content", children: [
|
|
5975
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-amount-content`, children: [
|
|
5976
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-amount-header`, children: [
|
|
5977
|
+
/* @__PURE__ */ jsx29("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ jsx29(FormattedMessage10, { id: "amount" }) }),
|
|
5978
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-amount-chain`, children: [
|
|
5979
|
+
token.icon ? /* @__PURE__ */ jsx29(
|
|
5980
|
+
"img",
|
|
5981
|
+
{
|
|
5982
|
+
src: token?.icon,
|
|
5983
|
+
alt: token?.symbol,
|
|
5984
|
+
className: `matchid-token-amount-chain-icon`
|
|
5985
|
+
}
|
|
5986
|
+
) : /* @__PURE__ */ jsx29(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
5987
|
+
/* @__PURE__ */ jsx29("span", { children: token?.symbol })
|
|
5988
|
+
] })
|
|
5989
|
+
] }),
|
|
5990
|
+
/* @__PURE__ */ jsx29(
|
|
5991
|
+
Input2,
|
|
5992
|
+
{
|
|
5993
|
+
type: "text",
|
|
5994
|
+
onChange: onChangeAmount,
|
|
5995
|
+
placeholder: intl.formatMessage({
|
|
5996
|
+
id: "amountPlaceholder"
|
|
5997
|
+
}),
|
|
5998
|
+
value: amount,
|
|
5999
|
+
maxLength: 40,
|
|
6000
|
+
error: error.amount || txError
|
|
6001
|
+
}
|
|
6002
|
+
),
|
|
6003
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-amount-footer`, children: [
|
|
6004
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-amount-title`, children: [
|
|
6005
|
+
/* @__PURE__ */ jsx29(FormattedMessage10, { id: "balance" }),
|
|
6006
|
+
":"
|
|
6007
|
+
] }),
|
|
6008
|
+
/* @__PURE__ */ jsx29("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ jsx29(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
6009
|
+
] }),
|
|
6010
|
+
/* @__PURE__ */ jsx29(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
6011
|
+
] }),
|
|
6012
|
+
/* @__PURE__ */ jsxs19("div", { className: `matchid-token-address-content`, children: [
|
|
6013
|
+
/* @__PURE__ */ jsx29("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ jsx29("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ jsx29(FormattedMessage10, { id: "receiveTitle" }) }) }),
|
|
6014
|
+
/* @__PURE__ */ jsx29(
|
|
6015
|
+
Input2,
|
|
6016
|
+
{
|
|
6017
|
+
type: "text",
|
|
6018
|
+
size: "sm",
|
|
6019
|
+
onChange: (e) => setAddress(e.target.value),
|
|
6020
|
+
placeholder: intl.formatMessage({
|
|
6021
|
+
id: "receivePlaceholder"
|
|
6022
|
+
}),
|
|
6023
|
+
value: address,
|
|
6024
|
+
maxLength: 42,
|
|
6025
|
+
error: error.address
|
|
6026
|
+
}
|
|
6027
|
+
)
|
|
6028
|
+
] })
|
|
6029
|
+
] }),
|
|
6030
|
+
/* @__PURE__ */ jsx29(
|
|
6031
|
+
Button,
|
|
6032
|
+
{
|
|
6033
|
+
size: "lg",
|
|
6034
|
+
block: true,
|
|
6035
|
+
highlight: true,
|
|
6036
|
+
disabled: !canSend || !!txError,
|
|
6037
|
+
onClick: onNext,
|
|
6038
|
+
loading: loading || sending,
|
|
6039
|
+
children: /* @__PURE__ */ jsx29(FormattedMessage10, { id: "next" })
|
|
6040
|
+
}
|
|
6041
|
+
)
|
|
6042
|
+
] }) });
|
|
6043
|
+
}
|
|
6044
|
+
|
|
6045
|
+
// src/components/TokenDetail/index.tsx
|
|
6046
|
+
import { FormattedMessage as FormattedMessage11, useIntl as useIntl16 } from "react-intl";
|
|
6047
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6048
|
+
function TokenDetail({
|
|
6049
|
+
onClose,
|
|
6050
|
+
token
|
|
6051
|
+
}) {
|
|
6052
|
+
const { list: chainList } = useMatchChain();
|
|
6053
|
+
const modal = useModal();
|
|
6054
|
+
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
6055
|
+
const onSend = () => {
|
|
6056
|
+
modal.show((props) => {
|
|
6057
|
+
return /* @__PURE__ */ jsx30(TokenSend, { onClose: () => {
|
|
6058
|
+
props.close();
|
|
6059
|
+
onClose();
|
|
6060
|
+
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
6061
|
+
});
|
|
6062
|
+
};
|
|
6063
|
+
const intl = useIntl16();
|
|
6064
|
+
return /* @__PURE__ */ jsx30(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
6065
|
+
id: "tokenDetails"
|
|
6066
|
+
}), onClose, children: /* @__PURE__ */ jsxs20("div", { className: `matchid-token-detail`, children: [
|
|
6067
|
+
/* @__PURE__ */ jsxs20("div", { className: `matchid-token-main`, children: [
|
|
6068
|
+
/* @__PURE__ */ jsxs20("div", { className: `matchid-token-info`, children: [
|
|
6069
|
+
/* @__PURE__ */ jsxs20("div", { className: `matchid-token-logo`, children: [
|
|
6070
|
+
token.icon ? /* @__PURE__ */ jsx30("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ jsx30(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
6071
|
+
chain?.iconUrl && /* @__PURE__ */ jsx30("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
6072
|
+
] }),
|
|
6073
|
+
/* @__PURE__ */ jsxs20("div", { className: `matchid-token-name`, children: [
|
|
6074
|
+
/* @__PURE__ */ jsx30(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
6075
|
+
" ",
|
|
6076
|
+
token.symbol
|
|
6077
|
+
] })
|
|
6078
|
+
] }),
|
|
6079
|
+
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ jsxs20("div", { className: `matchid-token-contract`, children: [
|
|
6080
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
6081
|
+
/* @__PURE__ */ jsx30("div", { className: "matchid-token-contract-address", children: token.address })
|
|
6082
|
+
] })
|
|
6083
|
+
] }),
|
|
6084
|
+
/* @__PURE__ */ jsx30(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ jsx30(FormattedMessage11, { id: "send" }) })
|
|
6085
|
+
] }) });
|
|
6086
|
+
}
|
|
6087
|
+
|
|
6088
|
+
// src/components/TokenSendList/index.tsx
|
|
6089
|
+
import { useState as useState26 } from "react";
|
|
6090
|
+
import { FormattedMessage as FormattedMessage12 } from "react-intl";
|
|
6091
|
+
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6092
|
+
function TokenSendList({ close }) {
|
|
6093
|
+
const walletAssets = useMatchWalletAssets();
|
|
6094
|
+
const matchWalletAssetList = useMatchWalletAssetList({
|
|
6095
|
+
list: walletAssets.mergedAssets
|
|
6096
|
+
});
|
|
6097
|
+
const { list } = useMatchChain();
|
|
6098
|
+
const [checked, setChecked] = useState26();
|
|
6099
|
+
const modal = useModal();
|
|
6100
|
+
const onNext = () => {
|
|
6101
|
+
checked && modal.show((props) => {
|
|
6102
|
+
return /* @__PURE__ */ jsx31(TokenSend, { onClose: () => {
|
|
6103
|
+
props.close();
|
|
6104
|
+
close();
|
|
6105
|
+
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
6106
|
+
});
|
|
6107
|
+
};
|
|
6108
|
+
return /* @__PURE__ */ jsxs21("div", { className: "matchid-token-send-list-box", children: [
|
|
6109
|
+
/* @__PURE__ */ jsx31("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
6110
|
+
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
6111
|
+
return /* @__PURE__ */ jsxs21(
|
|
6112
|
+
"div",
|
|
6113
|
+
{
|
|
6114
|
+
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
6115
|
+
onClick: () => {
|
|
6116
|
+
setChecked(n);
|
|
6117
|
+
},
|
|
6118
|
+
children: [
|
|
6119
|
+
/* @__PURE__ */ jsx31(Radio, { checked: checked?.address == n.address }),
|
|
6120
|
+
/* @__PURE__ */ jsxs21("div", { className: "matchid-token-send-content", children: [
|
|
6121
|
+
/* @__PURE__ */ jsxs21("div", { className: "matchid-token-send-logo", children: [
|
|
6122
|
+
n.icon ? /* @__PURE__ */ jsx31("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ jsx31(
|
|
6123
|
+
AlphaAvatar2,
|
|
6124
|
+
{
|
|
6125
|
+
className: `matchid-token-send-icon`,
|
|
6126
|
+
size: 40,
|
|
6127
|
+
name: n.symbol || n.name || ""
|
|
6128
|
+
}
|
|
6129
|
+
),
|
|
6130
|
+
chain?.iconUrl && /* @__PURE__ */ jsx31(
|
|
6131
|
+
"img",
|
|
6132
|
+
{
|
|
6133
|
+
src: chain.iconUrl,
|
|
6134
|
+
alt: chain.name,
|
|
6135
|
+
className: `matchid-token-send-chain`
|
|
6136
|
+
}
|
|
6137
|
+
)
|
|
6138
|
+
] }),
|
|
6139
|
+
/* @__PURE__ */ jsxs21("div", { className: `matchid-token-send-info`, children: [
|
|
6140
|
+
/* @__PURE__ */ jsx31("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
6141
|
+
/* @__PURE__ */ jsx31("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ jsx31(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
6142
|
+
] })
|
|
6143
|
+
] })
|
|
6144
|
+
]
|
|
6145
|
+
},
|
|
6146
|
+
index
|
|
6147
|
+
);
|
|
6148
|
+
}) }),
|
|
6149
|
+
/* @__PURE__ */ jsx31(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ jsx31(FormattedMessage12, { id: "next" }) })
|
|
6150
|
+
] });
|
|
6151
|
+
}
|
|
6152
|
+
|
|
6153
|
+
// src/components/TransactionList/index.tsx
|
|
6154
|
+
import InfiniteScroll from "react-infinite-scroll-component";
|
|
6155
|
+
import { useEffect as useEffect24, useMemo as useMemo15, useState as useState27 } from "react";
|
|
6156
|
+
import { decodeFunctionData, defineChain as defineChain4, formatUnits as formatUnits3 } from "viem";
|
|
6157
|
+
import { erc20Abi as erc20Abi2 } from "viem";
|
|
6158
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6159
|
+
var Item = ({ data }) => {
|
|
6160
|
+
const { address } = useWallet();
|
|
6161
|
+
const isOut = data.from == address;
|
|
6162
|
+
const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
|
|
6163
|
+
const { getContract } = useContractStore_default();
|
|
6164
|
+
const [shouldRefetch, setShouldRefetch] = useState27(true);
|
|
6165
|
+
const transferType = useMemo15(() => {
|
|
6166
|
+
const methodId = data.input.substring(2, 10);
|
|
6167
|
+
if (methodId == "095ea7b3") {
|
|
6168
|
+
return "erc20_approve";
|
|
6169
|
+
}
|
|
6170
|
+
if (methodId == "a9059cbb") {
|
|
6171
|
+
return "erc20_transfer";
|
|
6172
|
+
}
|
|
6173
|
+
return "unknown";
|
|
6174
|
+
}, [data.input]);
|
|
6175
|
+
const to = useMemo15(() => {
|
|
6176
|
+
if (transferType == "erc20_transfer") {
|
|
6177
|
+
const decodeData = decodeFunctionData({
|
|
6178
|
+
abi: erc20Abi2,
|
|
6179
|
+
data: data.input
|
|
6180
|
+
});
|
|
6181
|
+
return decodeData.args[0];
|
|
6182
|
+
}
|
|
6183
|
+
return data.to;
|
|
6184
|
+
}, [data.input, transferType, data.to]);
|
|
6185
|
+
const amount = useMemo15(() => {
|
|
6186
|
+
if (transferType == "erc20_transfer") {
|
|
6187
|
+
const decodeData = decodeFunctionData({
|
|
6188
|
+
abi: erc20Abi2,
|
|
6189
|
+
data: data.input
|
|
6190
|
+
});
|
|
6191
|
+
const value = decodeData.args[1];
|
|
6192
|
+
return formatUnits3(value, getContract(chainId || 0, data.to)?.decimals || 18);
|
|
6193
|
+
}
|
|
6194
|
+
return chainFormatUnits(BigInt(data.value));
|
|
6195
|
+
}, [data.input, transferType, data.value, getContract, chainId, data.to]);
|
|
6196
|
+
useEffect24(() => {
|
|
6197
|
+
if (data.hash) {
|
|
6198
|
+
setShouldRefetch(true);
|
|
6199
|
+
}
|
|
6200
|
+
}, [data.hash]);
|
|
6201
|
+
const hashQuery = useHash({
|
|
6202
|
+
hash: data.hash,
|
|
6203
|
+
//@ts-ignore
|
|
6204
|
+
chain: defineChain4(chain),
|
|
6205
|
+
refetchInterval: shouldRefetch ? 3e3 : false,
|
|
6206
|
+
enabled: shouldRefetch
|
|
6207
|
+
});
|
|
6208
|
+
const status = useMemo15(() => {
|
|
6209
|
+
if (data.source == "matchain") {
|
|
6210
|
+
switch (data.extra.status) {
|
|
6211
|
+
case "ok":
|
|
6212
|
+
return "success";
|
|
6213
|
+
case "error":
|
|
6214
|
+
return "error";
|
|
6215
|
+
}
|
|
6216
|
+
} else if (data.source == "auto") {
|
|
6217
|
+
if (data.extra.receipt_status == 1) {
|
|
6218
|
+
return "success";
|
|
6219
|
+
} else {
|
|
6220
|
+
return "error";
|
|
6221
|
+
}
|
|
6222
|
+
} else {
|
|
6223
|
+
if (hashQuery.data == 1) {
|
|
6224
|
+
return "success";
|
|
6225
|
+
}
|
|
6226
|
+
if (hashQuery.data == -1) {
|
|
6227
|
+
return "error";
|
|
6228
|
+
}
|
|
6229
|
+
if (Date.now() / 1e3 - parseInt(data.timestamp) > 3600) {
|
|
6230
|
+
return "error";
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
return "loading";
|
|
6234
|
+
}, [data.extra?.status, data.source, hashQuery.data]);
|
|
6235
|
+
useEffect24(() => {
|
|
6236
|
+
setShouldRefetch(status == "loading");
|
|
6237
|
+
}, [status]);
|
|
6238
|
+
const symbol = useMemo15(() => {
|
|
6239
|
+
if (transferType == "erc20_transfer") {
|
|
6240
|
+
return getContract(chainId || 0, data.to)?.symbol || getContract(chainId || 0, data.to)?.name || "unknown";
|
|
6241
|
+
}
|
|
6242
|
+
return chain?.nativeCurrency.symbol || chain?.nativeCurrency.name;
|
|
6243
|
+
}, [transferType, chain, getContract, chainId, data.to]);
|
|
6244
|
+
return /* @__PURE__ */ jsxs22(
|
|
6245
|
+
"a",
|
|
6246
|
+
{
|
|
6247
|
+
href: explorerLink(`tx/${data.hash}`),
|
|
6248
|
+
target: "_blank",
|
|
6249
|
+
className: `matchid-transaction-item`,
|
|
6250
|
+
children: [
|
|
6251
|
+
/* @__PURE__ */ jsxs22("div", { className: `matchid-transacton-item-container`, children: [
|
|
6252
|
+
/* @__PURE__ */ jsx32("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ jsx32(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
6253
|
+
/* @__PURE__ */ jsxs22("div", { className: `matchid-transaction-item-details`, children: [
|
|
6254
|
+
/* @__PURE__ */ jsx32("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
6255
|
+
/* @__PURE__ */ jsx32(
|
|
6256
|
+
"div",
|
|
6257
|
+
{
|
|
6258
|
+
className: `matchid-transaction-item-timestamp`,
|
|
6259
|
+
children: formatDate(data.timestamp, "MM/DD HH:mm:ss")
|
|
6260
|
+
}
|
|
6261
|
+
)
|
|
6262
|
+
] })
|
|
6263
|
+
] }),
|
|
6264
|
+
/* @__PURE__ */ jsxs22("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
6265
|
+
/* @__PURE__ */ jsx32(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
6266
|
+
status == "loading" && /* @__PURE__ */ jsx32(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
6267
|
+
status == "success" && /* @__PURE__ */ jsx32(CheckRoundIcon, { size: 16 }),
|
|
6268
|
+
status == "error" && /* @__PURE__ */ jsx32(InfoRoundIcon, { size: 16 })
|
|
6269
|
+
] })
|
|
6270
|
+
]
|
|
6271
|
+
}
|
|
6272
|
+
);
|
|
6273
|
+
};
|
|
6274
|
+
function TransactionList({
|
|
6275
|
+
scrollableTarget
|
|
6276
|
+
}) {
|
|
6277
|
+
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
6278
|
+
return /* @__PURE__ */ jsx32(
|
|
6279
|
+
InfiniteScroll,
|
|
6280
|
+
{
|
|
6281
|
+
scrollableTarget,
|
|
6282
|
+
dataLength: items.length,
|
|
6283
|
+
next: fetchMoreData,
|
|
6284
|
+
hasMore,
|
|
6285
|
+
loader: /* @__PURE__ */ jsxs22("div", { className: "matchid-list-nomore", children: [
|
|
6286
|
+
/* @__PURE__ */ jsx32(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
6287
|
+
"Loading..."
|
|
6288
|
+
] }),
|
|
6289
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ jsx32("div", { className: `matchid-list-nomore`, children: "There is no more Records here!" }) : /* @__PURE__ */ jsx32("div", { className: `matchid-list-nomore`, children: "No Records here!" }),
|
|
6290
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ jsx32("div", { className: "mt-[150px]" }) : /* @__PURE__ */ jsx32("div", { className: `matchid-transaction-list`, children: items.map((item, index) => /* @__PURE__ */ jsx32(Item, { data: item }, index)) })
|
|
6291
|
+
}
|
|
6292
|
+
);
|
|
6293
|
+
}
|
|
6294
|
+
|
|
4660
6295
|
export {
|
|
4661
6296
|
isSuccess,
|
|
4662
6297
|
getBindListApi,
|
|
@@ -4670,9 +6305,9 @@ export {
|
|
|
4670
6305
|
mintPassportNftApi,
|
|
4671
6306
|
useUserInfo,
|
|
4672
6307
|
useMatchEvents,
|
|
6308
|
+
useModal,
|
|
4673
6309
|
useWallet,
|
|
4674
6310
|
useCopyClipboard,
|
|
4675
|
-
useModal,
|
|
4676
6311
|
useToast,
|
|
4677
6312
|
wallet_exports,
|
|
4678
6313
|
useMatchChain,
|
|
@@ -4687,11 +6322,20 @@ export {
|
|
|
4687
6322
|
TONModal,
|
|
4688
6323
|
BTCModal,
|
|
4689
6324
|
WalletModal,
|
|
6325
|
+
WalletAsset,
|
|
6326
|
+
TokenSend,
|
|
6327
|
+
TokenDetail,
|
|
6328
|
+
TokenSendList,
|
|
6329
|
+
TransactionList,
|
|
4690
6330
|
components_exports,
|
|
4691
6331
|
useMatchWallet,
|
|
6332
|
+
useMatchWalletRecords,
|
|
6333
|
+
useMatchWalletAssets,
|
|
6334
|
+
useMatchWalletAssetList,
|
|
4692
6335
|
useReceipt,
|
|
6336
|
+
useTransaction,
|
|
4693
6337
|
hooks_exports,
|
|
4694
6338
|
MatchProvider,
|
|
4695
6339
|
useMatch
|
|
4696
6340
|
};
|
|
4697
|
-
//# sourceMappingURL=chunk-
|
|
6341
|
+
//# sourceMappingURL=chunk-WHZ3HI4R.mjs.map
|