@matchain/matchid-sdk-react 0.1.53-alpha.9 → 0.1.55-alpha.0
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 +5 -0
- package/dist/assets/icon/index.d.ts +5 -0
- package/dist/{chunk-X5HGL3ZX.mjs → chunk-36M5ROJI.mjs} +7238 -241
- package/dist/chunk-36M5ROJI.mjs.map +1 -0
- package/dist/chunk-N7NX7Q7M.mjs +97 -0
- package/dist/chunk-N7NX7Q7M.mjs.map +1 -0
- package/dist/components/index.d.mts +6 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +324 -658
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -15
- package/dist/config/chains/index.d.mts +2 -0
- package/dist/config/chains/index.d.ts +2 -0
- package/dist/hooks/api/index.d.mts +6 -0
- package/dist/hooks/api/index.d.ts +6 -0
- package/dist/hooks/api/index.js +443 -598
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +6 -7
- package/dist/hooks/index.d.mts +11 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.js +350 -357
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -5
- package/dist/index-6-oVBXRP.d.mts +66 -0
- package/dist/index-CBQXIlWu.d.mts +38 -0
- package/dist/index-CMH6Jesl.d.ts +66 -0
- package/dist/index-CNH7a3bx.d.ts +111 -0
- package/dist/index-CPPDmmz8.d.ts +3327 -0
- package/dist/index-CqKohtvj.d.mts +3327 -0
- package/dist/index-D0Psl8Ue.d.mts +203 -0
- package/dist/index-DXRGMAbv.d.mts +83 -0
- package/dist/index-DXRGMAbv.d.ts +83 -0
- package/dist/index-DbQn4z1l.d.ts +203 -0
- package/dist/index-Es7yJi7T.d.ts +79 -0
- package/dist/index-G15A08DI.d.mts +132 -0
- package/dist/index-MsSYZS38.d.mts +79 -0
- package/dist/index-Y5WRoqzn.d.ts +132 -0
- package/dist/index-a_Qt7NXk.d.mts +111 -0
- package/dist/index-agAVLGF5.d.ts +38 -0
- package/dist/index.css +44 -57
- package/dist/index.d.mts +787 -0
- package/dist/index.d.ts +787 -0
- package/dist/index.js +3881 -4043
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -10
- package/dist/request-B0CyrGFT.d.mts +15 -0
- package/dist/request-B0CyrGFT.d.ts +15 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types-CXzZS0eM.d.mts +424 -0
- package/dist/types-CXzZS0eM.d.ts +424 -0
- package/dist/ui/index.d.mts +7 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.js +920 -160
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +6 -1
- package/dist/utils/index.d.mts +28 -0
- package/dist/utils/index.d.ts +28 -0
- package/example/package.json +1 -0
- package/example/src/App.tsx +23 -27
- package/example/src/pages/Wallet/index.tsx +1 -1
- package/package.json +1 -1
- package/dist/chunk-NCVBLRAJ.mjs +0 -7275
- package/dist/chunk-NCVBLRAJ.mjs.map +0 -1
- package/dist/chunk-X5HGL3ZX.mjs.map +0 -1
- package/example/src/pages/Contact/index.tsx +0 -90
package/dist/hooks/index.js
CHANGED
|
@@ -356,10 +356,10 @@ var localStore = useLocalStore;
|
|
|
356
356
|
var useLocalStore_default = useLocalStore;
|
|
357
357
|
|
|
358
358
|
// src/hooks/useUserInfo.tsx
|
|
359
|
-
var
|
|
359
|
+
var import_react34 = require("react");
|
|
360
360
|
|
|
361
361
|
// src/MatchContext.tsx
|
|
362
|
-
var
|
|
362
|
+
var import_react33 = require("react");
|
|
363
363
|
|
|
364
364
|
// src/store/useModalStore.ts
|
|
365
365
|
var import_zustand2 = require("zustand");
|
|
@@ -691,7 +691,10 @@ var useWalletModalStore = (0, import_zustand2.create)((set) => ({
|
|
|
691
691
|
}));
|
|
692
692
|
|
|
693
693
|
// src/components/EmailModal/index.tsx
|
|
694
|
-
var
|
|
694
|
+
var import_react7 = require("react");
|
|
695
|
+
|
|
696
|
+
// src/ui/Modal/index.tsx
|
|
697
|
+
var import_react3 = require("react");
|
|
695
698
|
|
|
696
699
|
// src/ui/Overlay/index.tsx
|
|
697
700
|
var import_react2 = require("react");
|
|
@@ -724,6 +727,7 @@ function Overlay({
|
|
|
724
727
|
}
|
|
725
728
|
|
|
726
729
|
// src/ui/Modal/index.tsx
|
|
730
|
+
var import_react_intl = require("react-intl");
|
|
727
731
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
728
732
|
function Modal({
|
|
729
733
|
children,
|
|
@@ -762,7 +766,7 @@ function ModalWithHeader({
|
|
|
762
766
|
}
|
|
763
767
|
|
|
764
768
|
// src/components/EmailModal/StepEmail.tsx
|
|
765
|
-
var
|
|
769
|
+
var import_react5 = require("react");
|
|
766
770
|
|
|
767
771
|
// src/utils/index.tsx
|
|
768
772
|
var import_moment = __toESM(require("moment"));
|
|
@@ -862,7 +866,8 @@ function Button({
|
|
|
862
866
|
type = "button",
|
|
863
867
|
rounded = true,
|
|
864
868
|
className = "",
|
|
865
|
-
style = {}
|
|
869
|
+
style = {},
|
|
870
|
+
dataset = {}
|
|
866
871
|
}) {
|
|
867
872
|
const onAction = () => {
|
|
868
873
|
if (!disabled && !loading) {
|
|
@@ -879,13 +884,14 @@ function Button({
|
|
|
879
884
|
...style
|
|
880
885
|
},
|
|
881
886
|
onClick: onAction,
|
|
887
|
+
...dataset,
|
|
882
888
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LoadingIcon_default, { className: "matchid-btn-loading-icon", color: "var(--matchid-btn-loading-color)" }) : children
|
|
883
889
|
}
|
|
884
890
|
);
|
|
885
891
|
}
|
|
886
892
|
|
|
887
893
|
// src/ui/Input/index.tsx
|
|
888
|
-
var
|
|
894
|
+
var import_react4 = require("react");
|
|
889
895
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
890
896
|
function Input({
|
|
891
897
|
onChange,
|
|
@@ -894,7 +900,7 @@ function Input({
|
|
|
894
900
|
className = "",
|
|
895
901
|
...props
|
|
896
902
|
}) {
|
|
897
|
-
const [inputType, setInputType] = (0,
|
|
903
|
+
const [inputType, setInputType] = (0, import_react4.useState)(type);
|
|
898
904
|
const isDownMd = useDownMd();
|
|
899
905
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
900
906
|
"div",
|
|
@@ -943,30 +949,30 @@ function Field({
|
|
|
943
949
|
}
|
|
944
950
|
|
|
945
951
|
// src/components/EmailModal/StepEmail.tsx
|
|
946
|
-
var
|
|
952
|
+
var import_react_intl2 = require("react-intl");
|
|
947
953
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
948
954
|
|
|
949
955
|
// src/components/EmailModal/StepVerify.tsx
|
|
950
|
-
var
|
|
956
|
+
var import_react6 = require("react");
|
|
951
957
|
|
|
952
958
|
// src/config/index.tsx
|
|
953
959
|
var NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
954
960
|
|
|
955
961
|
// src/components/EmailModal/StepVerify.tsx
|
|
956
|
-
var
|
|
962
|
+
var import_react_intl3 = require("react-intl");
|
|
957
963
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
958
964
|
|
|
959
965
|
// src/components/EmailModal/index.tsx
|
|
960
|
-
var
|
|
966
|
+
var import_react_intl4 = require("react-intl");
|
|
961
967
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
962
968
|
|
|
963
969
|
// src/ui/Popover/index.tsx
|
|
964
|
-
var
|
|
970
|
+
var import_react8 = require("react");
|
|
965
971
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
966
972
|
|
|
967
973
|
// src/components/LoginBox/index.tsx
|
|
968
|
-
var
|
|
969
|
-
var
|
|
974
|
+
var import_react9 = require("react");
|
|
975
|
+
var import_react_intl5 = require("react-intl");
|
|
970
976
|
|
|
971
977
|
// src/hooks/useAppConfig.ts
|
|
972
978
|
var import_react_query = require("@tanstack/react-query");
|
|
@@ -975,32 +981,32 @@ var import_react_query = require("@tanstack/react-query");
|
|
|
975
981
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
976
982
|
|
|
977
983
|
// src/components/LoginButton/index.tsx
|
|
978
|
-
var
|
|
984
|
+
var import_react11 = require("react");
|
|
979
985
|
|
|
980
986
|
// src/components/LoginPanel/index.tsx
|
|
981
|
-
var
|
|
987
|
+
var import_react_intl6 = require("react-intl");
|
|
982
988
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
983
989
|
|
|
984
990
|
// src/components/LoginModal/index.tsx
|
|
985
991
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
986
992
|
|
|
987
993
|
// src/components/UserPopover/index.tsx
|
|
988
|
-
var
|
|
994
|
+
var import_react10 = require("react");
|
|
989
995
|
|
|
990
996
|
// src/assets/icon/ProfileIcon.tsx
|
|
991
997
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
992
998
|
|
|
993
999
|
// src/components/UserPopover/index.tsx
|
|
994
|
-
var
|
|
1000
|
+
var import_react_intl7 = require("react-intl");
|
|
995
1001
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
996
1002
|
|
|
997
1003
|
// src/components/LoginButton/index.tsx
|
|
998
|
-
var
|
|
1004
|
+
var import_react_intl8 = require("react-intl");
|
|
999
1005
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
1000
1006
|
|
|
1001
1007
|
// src/components/UsernameModal/index.tsx
|
|
1002
|
-
var
|
|
1003
|
-
var
|
|
1008
|
+
var import_react12 = require("react");
|
|
1009
|
+
var import_react_intl9 = require("react-intl");
|
|
1004
1010
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
1005
1011
|
|
|
1006
1012
|
// src/ui/Drawer/index.tsx
|
|
@@ -1030,7 +1036,7 @@ function Drawer({
|
|
|
1030
1036
|
}
|
|
1031
1037
|
|
|
1032
1038
|
// src/ui/HashPanel/index.tsx
|
|
1033
|
-
var
|
|
1039
|
+
var import_react13 = require("react");
|
|
1034
1040
|
|
|
1035
1041
|
// src/ui/ModalDrawer/index.tsx
|
|
1036
1042
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
@@ -1107,7 +1113,7 @@ function HashPanel({
|
|
|
1107
1113
|
onClose,
|
|
1108
1114
|
zIndex
|
|
1109
1115
|
}) {
|
|
1110
|
-
const [status, setStatus] = (0,
|
|
1116
|
+
const [status, setStatus] = (0, import_react13.useState)("confirm");
|
|
1111
1117
|
const statusMaps = {
|
|
1112
1118
|
"confirm": {
|
|
1113
1119
|
icon: confirm_default,
|
|
@@ -1131,8 +1137,8 @@ function HashPanel({
|
|
|
1131
1137
|
}
|
|
1132
1138
|
};
|
|
1133
1139
|
const statusValue = statusMaps[status];
|
|
1134
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
1135
|
-
(0,
|
|
1140
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react13.useState)(true);
|
|
1141
|
+
(0, import_react13.useEffect)(() => {
|
|
1136
1142
|
if (hash) {
|
|
1137
1143
|
setShouldRefetch(true);
|
|
1138
1144
|
setStatus("pending");
|
|
@@ -1145,7 +1151,7 @@ function HashPanel({
|
|
|
1145
1151
|
chain,
|
|
1146
1152
|
refetchInterval: shouldRefetch ? 3e3 : false
|
|
1147
1153
|
});
|
|
1148
|
-
(0,
|
|
1154
|
+
(0, import_react13.useEffect)(() => {
|
|
1149
1155
|
if (hashQuery.data == 1 || hashQuery.data == -1) {
|
|
1150
1156
|
setShouldRefetch(false);
|
|
1151
1157
|
}
|
|
@@ -1199,7 +1205,7 @@ function HashPanel_default(props) {
|
|
|
1199
1205
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
1200
1206
|
|
|
1201
1207
|
// src/ui/AlphaAvatar/index.tsx
|
|
1202
|
-
var
|
|
1208
|
+
var import_react14 = require("react");
|
|
1203
1209
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
1204
1210
|
function AlphaAvatar({
|
|
1205
1211
|
name,
|
|
@@ -1207,7 +1213,7 @@ function AlphaAvatar({
|
|
|
1207
1213
|
className = "",
|
|
1208
1214
|
style
|
|
1209
1215
|
}) {
|
|
1210
|
-
const avatar = (0,
|
|
1216
|
+
const avatar = (0, import_react14.useMemo)(() => {
|
|
1211
1217
|
if (name) {
|
|
1212
1218
|
const char = name[0].toUpperCase();
|
|
1213
1219
|
if (char.match(/[a-zA-Z0-9]/)) {
|
|
@@ -1254,7 +1260,7 @@ var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
|
1254
1260
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
1255
1261
|
|
|
1256
1262
|
// src/components/EVMModal/index.tsx
|
|
1257
|
-
var
|
|
1263
|
+
var import_react17 = require("react");
|
|
1258
1264
|
|
|
1259
1265
|
// src/hooks/eventManager.ts
|
|
1260
1266
|
var EventManager = class {
|
|
@@ -1285,85 +1291,21 @@ var eventManager = new EventManager();
|
|
|
1285
1291
|
var eventManager_default = eventManager;
|
|
1286
1292
|
|
|
1287
1293
|
// src/components/EVMModal/index.tsx
|
|
1288
|
-
var
|
|
1294
|
+
var import_react_intl10 = require("react-intl");
|
|
1289
1295
|
|
|
1290
1296
|
// src/components/WalletModalContent/index.tsx
|
|
1291
|
-
var
|
|
1297
|
+
var import_react15 = require("react");
|
|
1292
1298
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
1293
1299
|
|
|
1294
1300
|
// src/components/EVMModal/index.tsx
|
|
1295
|
-
var import_chains = require("wagmi/chains");
|
|
1296
1301
|
var import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
1297
1302
|
var import_wagmi2 = require("wagmi");
|
|
1298
|
-
var import_wallets = require("@rainbow-me/rainbowkit/wallets");
|
|
1299
|
-
|
|
1300
|
-
// src/config/chains/MatchMain.ts
|
|
1301
|
-
var import_viem2 = require("viem");
|
|
1302
|
-
var matchMain = /* @__PURE__ */ (0, import_viem2.defineChain)({
|
|
1303
|
-
//定义match链
|
|
1304
|
-
id: 698,
|
|
1305
|
-
name: "Matchain",
|
|
1306
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
1307
|
-
rpcUrls: {
|
|
1308
|
-
default: {
|
|
1309
|
-
http: ["https://rpc.matchain.io"]
|
|
1310
|
-
}
|
|
1311
|
-
},
|
|
1312
|
-
blockExplorers: {
|
|
1313
|
-
default: {
|
|
1314
|
-
name: "Matchscan",
|
|
1315
|
-
url: "https://matchscan.io/",
|
|
1316
|
-
apiUrl: "https://matchscan.io/api"
|
|
1317
|
-
}
|
|
1318
|
-
},
|
|
1319
|
-
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
1320
|
-
contracts: {
|
|
1321
|
-
multicall3: {
|
|
1322
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
// testnet: true,
|
|
1326
|
-
});
|
|
1327
|
-
|
|
1328
|
-
// src/config/chains/MatchTest.ts
|
|
1329
|
-
var import_viem3 = require("viem");
|
|
1330
|
-
var matchTest = /* @__PURE__ */ (0, import_viem3.defineChain)({
|
|
1331
|
-
//定义matchTest链
|
|
1332
|
-
id: 699,
|
|
1333
|
-
name: "MatchTest",
|
|
1334
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
1335
|
-
rpcUrls: {
|
|
1336
|
-
default: {
|
|
1337
|
-
http: ["https://testnet-rpc.matchain.io"]
|
|
1338
|
-
}
|
|
1339
|
-
},
|
|
1340
|
-
blockExplorers: {
|
|
1341
|
-
default: {
|
|
1342
|
-
name: "Matchscan",
|
|
1343
|
-
url: "https://testnet.matchscan.io/",
|
|
1344
|
-
apiUrl: "https://testnet.matchscan.io/api"
|
|
1345
|
-
}
|
|
1346
|
-
},
|
|
1347
|
-
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
1348
|
-
contracts: {
|
|
1349
|
-
multicall3: {
|
|
1350
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
1351
|
-
blockCreated: 751532
|
|
1352
|
-
},
|
|
1353
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
1354
|
-
ensUniversalResolver: {
|
|
1355
|
-
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
1356
|
-
blockCreated: 5317080
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
// testnet: true,
|
|
1360
|
-
});
|
|
1361
1303
|
|
|
1362
1304
|
// src/hooks/useWalletBox.ts
|
|
1363
|
-
var
|
|
1305
|
+
var import_react16 = require("react");
|
|
1364
1306
|
|
|
1365
1307
|
// src/hooks/useEthersSigner.ts
|
|
1366
|
-
var
|
|
1308
|
+
var React5 = __toESM(require("react"));
|
|
1367
1309
|
var import_wagmi = require("wagmi");
|
|
1368
1310
|
var import_ethers = require("ethers");
|
|
1369
1311
|
|
|
@@ -1371,64 +1313,47 @@ var import_ethers = require("ethers");
|
|
|
1371
1313
|
var import_siwe = require("siwe");
|
|
1372
1314
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
1373
1315
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
1374
|
-
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
1375
|
-
appName: "MatchID",
|
|
1376
|
-
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
1377
|
-
wallets: [
|
|
1378
|
-
{
|
|
1379
|
-
groupName: "Recommended",
|
|
1380
|
-
wallets: [
|
|
1381
|
-
import_wallets.metaMaskWallet,
|
|
1382
|
-
import_wallets.walletConnectWallet,
|
|
1383
|
-
import_wallets.okxWallet,
|
|
1384
|
-
import_wallets.bitgetWallet,
|
|
1385
|
-
import_wallets.injectedWallet
|
|
1386
|
-
]
|
|
1387
|
-
}
|
|
1388
|
-
],
|
|
1389
|
-
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
1390
|
-
});
|
|
1391
1316
|
|
|
1392
1317
|
// src/components/TRONModal/index.tsx
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1318
|
+
var import_react19 = __toESM(require("react"));
|
|
1319
|
+
var import_react_intl11 = require("react-intl");
|
|
1395
1320
|
|
|
1396
1321
|
// src/hooks/useTRONWallet.ts
|
|
1397
|
-
var
|
|
1322
|
+
var import_react18 = require("react");
|
|
1398
1323
|
|
|
1399
1324
|
// src/components/TRONModal/index.tsx
|
|
1400
1325
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
1401
1326
|
|
|
1402
1327
|
// src/components/TONModal/index.tsx
|
|
1403
|
-
var
|
|
1404
|
-
var
|
|
1328
|
+
var import_react20 = __toESM(require("react"));
|
|
1329
|
+
var import_react_intl12 = require("react-intl");
|
|
1405
1330
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
1406
1331
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
1407
1332
|
|
|
1408
1333
|
// src/components/BTCModal/index.tsx
|
|
1409
|
-
var
|
|
1410
|
-
var
|
|
1334
|
+
var import_react22 = __toESM(require("react"));
|
|
1335
|
+
var import_react_intl13 = require("react-intl");
|
|
1411
1336
|
|
|
1412
1337
|
// src/lib/btc/XverseAdapter.ts
|
|
1413
1338
|
var import_sats_connect = require("sats-connect");
|
|
1414
1339
|
|
|
1415
1340
|
// src/hooks/useBTCWallet.ts
|
|
1416
|
-
var
|
|
1341
|
+
var import_react21 = require("react");
|
|
1417
1342
|
|
|
1418
1343
|
// src/components/BTCModal/index.tsx
|
|
1419
1344
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
1420
1345
|
|
|
1421
1346
|
// src/components/WalletModal/index.tsx
|
|
1422
|
-
var
|
|
1423
|
-
var
|
|
1347
|
+
var import_react23 = require("react");
|
|
1348
|
+
var import_react_intl14 = require("react-intl");
|
|
1424
1349
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
1425
1350
|
|
|
1426
1351
|
// src/components/AlphaAvatar/index.tsx
|
|
1427
|
-
var
|
|
1352
|
+
var import_react24 = require("react");
|
|
1428
1353
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
1429
1354
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
1430
|
-
const [avatar, setAvatar] = (0,
|
|
1431
|
-
(0,
|
|
1355
|
+
const [avatar, setAvatar] = (0, import_react24.useState)(void 0);
|
|
1356
|
+
(0, import_react24.useEffect)(() => {
|
|
1432
1357
|
if (name) {
|
|
1433
1358
|
const char = name[0].toUpperCase();
|
|
1434
1359
|
setAvatar(char);
|
|
@@ -1445,9 +1370,9 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
1445
1370
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
1446
1371
|
|
|
1447
1372
|
// src/components/TokenSend/index.tsx
|
|
1448
|
-
var
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1373
|
+
var import_react25 = require("react");
|
|
1374
|
+
var import_viem2 = require("viem");
|
|
1375
|
+
var import_react_intl15 = require("react-intl");
|
|
1451
1376
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
1452
1377
|
function Input2({
|
|
1453
1378
|
onChange,
|
|
@@ -1480,36 +1405,36 @@ function TokenSend({
|
|
|
1480
1405
|
onBack
|
|
1481
1406
|
}) {
|
|
1482
1407
|
const { list: chainList } = useMatchChain();
|
|
1483
|
-
const intl = (0,
|
|
1408
|
+
const intl = (0, import_react_intl15.useIntl)();
|
|
1484
1409
|
const { createWalletClient: createWalletClient2 } = useWallet();
|
|
1485
1410
|
const isNative = token.address.toLowerCase() == NATIVE_TOKEN_ADDRESS;
|
|
1486
|
-
const chain = (0,
|
|
1411
|
+
const chain = (0, import_react25.useMemo)(() => {
|
|
1487
1412
|
return chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
1488
1413
|
}, [chainList, token.chain_id]);
|
|
1489
|
-
const walletClient = (0,
|
|
1414
|
+
const walletClient = (0, import_react25.useMemo)(() => {
|
|
1490
1415
|
return createWalletClient2({
|
|
1491
1416
|
// @ts-ignore
|
|
1492
|
-
chain: (0,
|
|
1493
|
-
transport: (0,
|
|
1417
|
+
chain: (0, import_viem2.defineChain)(chain),
|
|
1418
|
+
transport: (0, import_viem2.http)()
|
|
1494
1419
|
});
|
|
1495
1420
|
}, [chain]);
|
|
1496
|
-
const [amount, setAmount] = (0,
|
|
1497
|
-
const [address, setAddress] = (0,
|
|
1498
|
-
const [loading, setLoading] = (0,
|
|
1499
|
-
const [sending, setSending] = (0,
|
|
1500
|
-
const [txError, setTxError] = (0,
|
|
1501
|
-
const transaction = (0,
|
|
1421
|
+
const [amount, setAmount] = (0, import_react25.useState)("");
|
|
1422
|
+
const [address, setAddress] = (0, import_react25.useState)("");
|
|
1423
|
+
const [loading, setLoading] = (0, import_react25.useState)(false);
|
|
1424
|
+
const [sending, setSending] = (0, import_react25.useState)(false);
|
|
1425
|
+
const [txError, setTxError] = (0, import_react25.useState)("");
|
|
1426
|
+
const transaction = (0, import_react25.useMemo)(() => {
|
|
1502
1427
|
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
1503
1428
|
if (!amount || !address || !reg.test(address)) {
|
|
1504
1429
|
return;
|
|
1505
1430
|
}
|
|
1506
|
-
const viemChain = (0,
|
|
1431
|
+
const viemChain = (0, import_viem2.defineChain)(chain);
|
|
1507
1432
|
const to = isNative ? address : token.address;
|
|
1508
|
-
const value = isNative ? (0,
|
|
1509
|
-
const data = isNative ? "0x" : (0,
|
|
1510
|
-
abi:
|
|
1433
|
+
const value = isNative ? (0, import_viem2.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
|
|
1434
|
+
const data = isNative ? "0x" : (0, import_viem2.encodeFunctionData)({
|
|
1435
|
+
abi: import_viem2.erc20Abi,
|
|
1511
1436
|
functionName: "transfer",
|
|
1512
|
-
args: [address, (0,
|
|
1437
|
+
args: [address, (0, import_viem2.parseUnits)(amount, parseInt(token?.decimals || "18"))]
|
|
1513
1438
|
});
|
|
1514
1439
|
return {
|
|
1515
1440
|
to,
|
|
@@ -1529,7 +1454,7 @@ function TokenSend({
|
|
|
1529
1454
|
setLoading(false);
|
|
1530
1455
|
}
|
|
1531
1456
|
};
|
|
1532
|
-
const error = (0,
|
|
1457
|
+
const error = (0, import_react25.useMemo)(() => {
|
|
1533
1458
|
setTxError("");
|
|
1534
1459
|
let amountError = "";
|
|
1535
1460
|
let addressError = "";
|
|
@@ -1572,7 +1497,7 @@ function TokenSend({
|
|
|
1572
1497
|
setAmount(value);
|
|
1573
1498
|
}
|
|
1574
1499
|
};
|
|
1575
|
-
const canSend = (0,
|
|
1500
|
+
const canSend = (0, import_react25.useMemo)(() => {
|
|
1576
1501
|
return !error.amount && !error.address && amount && address;
|
|
1577
1502
|
}, [error]);
|
|
1578
1503
|
const onNext = async () => {
|
|
@@ -1582,7 +1507,7 @@ function TokenSend({
|
|
|
1582
1507
|
}
|
|
1583
1508
|
onClose();
|
|
1584
1509
|
};
|
|
1585
|
-
(0,
|
|
1510
|
+
(0, import_react25.useEffect)(() => {
|
|
1586
1511
|
const receiveMessage = (event) => {
|
|
1587
1512
|
if (event.data) {
|
|
1588
1513
|
if (event.data.source == "match-wallet") {
|
|
@@ -1598,11 +1523,11 @@ function TokenSend({
|
|
|
1598
1523
|
window.removeEventListener("message", receiveMessage);
|
|
1599
1524
|
};
|
|
1600
1525
|
}, []);
|
|
1601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "send" }), onBack, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-send-box`, children: [
|
|
1602
1527
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
1603
1528
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-content`, children: [
|
|
1604
1529
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-header`, children: [
|
|
1605
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "amount" }) }),
|
|
1606
1531
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-chain`, children: [
|
|
1607
1532
|
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1608
1533
|
"img",
|
|
@@ -1630,7 +1555,7 @@ function TokenSend({
|
|
|
1630
1555
|
),
|
|
1631
1556
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-footer`, children: [
|
|
1632
1557
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-title`, children: [
|
|
1633
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1558
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "balance" }),
|
|
1634
1559
|
":"
|
|
1635
1560
|
] }),
|
|
1636
1561
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
@@ -1638,7 +1563,7 @@ function TokenSend({
|
|
|
1638
1563
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
1639
1564
|
] }),
|
|
1640
1565
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-address-content`, children: [
|
|
1641
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "receiveTitle" }) }) }),
|
|
1642
1567
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1643
1568
|
Input2,
|
|
1644
1569
|
{
|
|
@@ -1664,19 +1589,19 @@ function TokenSend({
|
|
|
1664
1589
|
disabled: !canSend || !!txError,
|
|
1665
1590
|
onClick: onNext,
|
|
1666
1591
|
loading: loading || sending,
|
|
1667
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl15.FormattedMessage, { id: "next" })
|
|
1668
1593
|
}
|
|
1669
1594
|
)
|
|
1670
1595
|
] }) });
|
|
1671
1596
|
}
|
|
1672
1597
|
|
|
1673
1598
|
// src/components/TokenDetail/index.tsx
|
|
1674
|
-
var
|
|
1599
|
+
var import_react_intl16 = require("react-intl");
|
|
1675
1600
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
1676
1601
|
|
|
1677
1602
|
// src/components/TokenSendList/index.tsx
|
|
1678
|
-
var
|
|
1679
|
-
var
|
|
1603
|
+
var import_react26 = require("react");
|
|
1604
|
+
var import_react_intl17 = require("react-intl");
|
|
1680
1605
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
1681
1606
|
function TokenSendList({ close }) {
|
|
1682
1607
|
const isDownMd = useDownMd();
|
|
@@ -1685,7 +1610,7 @@ function TokenSendList({ close }) {
|
|
|
1685
1610
|
list: walletAssets.mergedAssets
|
|
1686
1611
|
});
|
|
1687
1612
|
const { list } = useMatchChain();
|
|
1688
|
-
const [checked, setChecked] = (0,
|
|
1613
|
+
const [checked, setChecked] = (0, import_react26.useState)();
|
|
1689
1614
|
const modal = useModal();
|
|
1690
1615
|
const onNext = () => {
|
|
1691
1616
|
checked && modal.show((props) => {
|
|
@@ -1736,15 +1661,15 @@ function TokenSendList({ close }) {
|
|
|
1736
1661
|
index
|
|
1737
1662
|
);
|
|
1738
1663
|
}) }),
|
|
1739
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_intl17.FormattedMessage, { id: "next" }) })
|
|
1740
1665
|
] });
|
|
1741
1666
|
}
|
|
1742
1667
|
|
|
1743
1668
|
// src/components/TransactionList/index.tsx
|
|
1744
1669
|
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
|
|
1745
|
-
var
|
|
1746
|
-
var
|
|
1747
|
-
var
|
|
1670
|
+
var import_react27 = require("react");
|
|
1671
|
+
var import_viem3 = require("viem");
|
|
1672
|
+
var import_viem4 = require("viem");
|
|
1748
1673
|
|
|
1749
1674
|
// src/store/useContractStore.ts
|
|
1750
1675
|
var import_zustand3 = require("zustand");
|
|
@@ -1803,88 +1728,16 @@ var useContractStore = (0, import_zustand3.create)((0, import_middleware2.devtoo
|
|
|
1803
1728
|
var useContractStore_default = useContractStore;
|
|
1804
1729
|
|
|
1805
1730
|
// src/components/TransactionList/index.tsx
|
|
1806
|
-
var import_react_intl17 = require("react-intl");
|
|
1807
|
-
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
1808
|
-
|
|
1809
|
-
// src/hooks/api/bind.ts
|
|
1810
|
-
var import_react_query3 = require("@tanstack/react-query");
|
|
1811
|
-
|
|
1812
|
-
// src/hooks/api/poh.ts
|
|
1813
|
-
var import_react_query4 = require("@tanstack/react-query");
|
|
1814
|
-
|
|
1815
|
-
// src/hooks/api/wallet.ts
|
|
1816
|
-
var import_react_query5 = require("@tanstack/react-query");
|
|
1817
|
-
function useChainListQuery(options) {
|
|
1818
|
-
const { isLogin, token } = useUserInfo();
|
|
1819
|
-
return (0, import_react_query5.useQuery)({
|
|
1820
|
-
queryKey: ["match-user-chain-list", token],
|
|
1821
|
-
queryFn: async () => {
|
|
1822
|
-
const res = await getUserChainListApi();
|
|
1823
|
-
if (!isSuccess(res)) {
|
|
1824
|
-
return [];
|
|
1825
|
-
}
|
|
1826
|
-
return res.data;
|
|
1827
|
-
},
|
|
1828
|
-
enabled: isLogin,
|
|
1829
|
-
...options
|
|
1830
|
-
});
|
|
1831
|
-
}
|
|
1832
|
-
function useAssetListQuery({
|
|
1833
|
-
chainId,
|
|
1834
|
-
...options
|
|
1835
|
-
}) {
|
|
1836
|
-
const { isLogin, token } = useUserInfo();
|
|
1837
|
-
return (0, import_react_query5.useQuery)({
|
|
1838
|
-
queryKey: ["match-user-asset-list", token, chainId],
|
|
1839
|
-
queryFn: async () => {
|
|
1840
|
-
const res = await getUserWalletAssetApi({ chain_id: chainId.toString() });
|
|
1841
|
-
if (!isSuccess(res)) {
|
|
1842
|
-
return [];
|
|
1843
|
-
}
|
|
1844
|
-
return res.data || [];
|
|
1845
|
-
},
|
|
1846
|
-
enabled: isLogin,
|
|
1847
|
-
...options
|
|
1848
|
-
});
|
|
1849
|
-
}
|
|
1850
|
-
var USER_IMPORT_TOKEN_LIST_KEY = "match-user-import-token-list";
|
|
1851
|
-
function useImportTokenListQuery({
|
|
1852
|
-
chainId,
|
|
1853
|
-
...options
|
|
1854
|
-
}) {
|
|
1855
|
-
const { isLogin, token } = useUserInfo();
|
|
1856
|
-
return (0, import_react_query5.useQuery)({
|
|
1857
|
-
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId],
|
|
1858
|
-
queryFn: async () => {
|
|
1859
|
-
const res = await getUserImportTokenListApi({ chain_id: chainId.toString() });
|
|
1860
|
-
if (!isSuccess(res)) {
|
|
1861
|
-
return [];
|
|
1862
|
-
}
|
|
1863
|
-
return res.data || [];
|
|
1864
|
-
},
|
|
1865
|
-
enabled: isLogin,
|
|
1866
|
-
...options
|
|
1867
|
-
});
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
// src/hooks/api/contact.ts
|
|
1871
|
-
var import_react_query6 = require("@tanstack/react-query");
|
|
1872
|
-
var import_last = __toESM(require("lodash/last"));
|
|
1873
|
-
var import_react27 = require("react");
|
|
1874
|
-
|
|
1875
|
-
// src/components/ContactList/index.tsx
|
|
1876
|
-
var import_react_virtuoso = require("react-virtuoso");
|
|
1877
|
-
var import_react28 = require("react");
|
|
1878
1731
|
var import_react_intl18 = require("react-intl");
|
|
1879
|
-
var
|
|
1732
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
1880
1733
|
|
|
1881
1734
|
// src/components/CEXBindModal/index.tsx
|
|
1882
|
-
var
|
|
1735
|
+
var import_react28 = require("react");
|
|
1883
1736
|
var import_react_intl19 = require("react-intl");
|
|
1884
|
-
var
|
|
1737
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
1885
1738
|
|
|
1886
1739
|
// src/context/BusinessProvider.tsx
|
|
1887
|
-
var
|
|
1740
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
1888
1741
|
|
|
1889
1742
|
// src/store/useStore.ts
|
|
1890
1743
|
var import_zustand4 = require("zustand");
|
|
@@ -1899,15 +1752,15 @@ var useStore = (0, import_zustand4.create)((set) => ({
|
|
|
1899
1752
|
var useStore_default = useStore;
|
|
1900
1753
|
|
|
1901
1754
|
// src/context/BusinessProvider.tsx
|
|
1902
|
-
var
|
|
1755
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
1903
1756
|
|
|
1904
1757
|
// src/context/ModalContext.tsx
|
|
1905
|
-
var
|
|
1758
|
+
var import_react29 = __toESM(require("react"));
|
|
1906
1759
|
var import_react_dom = require("react-dom");
|
|
1907
|
-
var
|
|
1908
|
-
var ModalContext = (0,
|
|
1760
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
1761
|
+
var ModalContext = (0, import_react29.createContext)(null);
|
|
1909
1762
|
function useModal() {
|
|
1910
|
-
const context = (0,
|
|
1763
|
+
const context = (0, import_react29.useContext)(ModalContext);
|
|
1911
1764
|
if (!context) {
|
|
1912
1765
|
throw new Error("useModal must be used within a ModalProvider");
|
|
1913
1766
|
}
|
|
@@ -1915,12 +1768,12 @@ function useModal() {
|
|
|
1915
1768
|
}
|
|
1916
1769
|
|
|
1917
1770
|
// src/context/ToastContext.tsx
|
|
1918
|
-
var
|
|
1771
|
+
var import_react30 = require("react");
|
|
1919
1772
|
var import_react_dom2 = require("react-dom");
|
|
1920
|
-
var
|
|
1921
|
-
var ToastContext = (0,
|
|
1773
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
1774
|
+
var ToastContext = (0, import_react30.createContext)(null);
|
|
1922
1775
|
function useToast() {
|
|
1923
|
-
const context = (0,
|
|
1776
|
+
const context = (0, import_react30.useContext)(ToastContext);
|
|
1924
1777
|
if (!context) {
|
|
1925
1778
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1926
1779
|
}
|
|
@@ -1928,23 +1781,108 @@ function useToast() {
|
|
|
1928
1781
|
}
|
|
1929
1782
|
|
|
1930
1783
|
// src/context/index.tsx
|
|
1931
|
-
var
|
|
1784
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
1932
1785
|
|
|
1933
1786
|
// src/hooks/useWalletInit.ts
|
|
1934
|
-
var
|
|
1787
|
+
var import_react31 = require("react");
|
|
1935
1788
|
var AppClientId = getAppClientId();
|
|
1936
1789
|
|
|
1937
1790
|
// src/hooks/useInit.tsx
|
|
1938
|
-
var
|
|
1791
|
+
var import_react32 = require("react");
|
|
1939
1792
|
|
|
1940
1793
|
// src/MatchContext.tsx
|
|
1941
|
-
var
|
|
1794
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
1942
1795
|
var import_react_intl20 = require("react-intl");
|
|
1943
|
-
var
|
|
1944
|
-
var
|
|
1945
|
-
var
|
|
1796
|
+
var import_rainbowkit2 = require("@rainbow-me/rainbowkit");
|
|
1797
|
+
var import_wallets = require("@rainbow-me/rainbowkit/wallets");
|
|
1798
|
+
var import_chains = require("wagmi/chains");
|
|
1799
|
+
|
|
1800
|
+
// src/config/chains/MatchMain.ts
|
|
1801
|
+
var import_viem5 = require("viem");
|
|
1802
|
+
var matchMain = /* @__PURE__ */ (0, import_viem5.defineChain)({
|
|
1803
|
+
//定义match链
|
|
1804
|
+
id: 698,
|
|
1805
|
+
name: "Matchain",
|
|
1806
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
1807
|
+
rpcUrls: {
|
|
1808
|
+
default: {
|
|
1809
|
+
http: ["https://rpc.matchain.io"]
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
blockExplorers: {
|
|
1813
|
+
default: {
|
|
1814
|
+
name: "Matchscan",
|
|
1815
|
+
url: "https://matchscan.io/",
|
|
1816
|
+
apiUrl: "https://matchscan.io/api"
|
|
1817
|
+
}
|
|
1818
|
+
},
|
|
1819
|
+
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
1820
|
+
contracts: {
|
|
1821
|
+
multicall3: {
|
|
1822
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
// testnet: true,
|
|
1826
|
+
});
|
|
1827
|
+
|
|
1828
|
+
// src/config/chains/MatchTest.ts
|
|
1829
|
+
var import_viem6 = require("viem");
|
|
1830
|
+
var matchTest = /* @__PURE__ */ (0, import_viem6.defineChain)({
|
|
1831
|
+
//定义matchTest链
|
|
1832
|
+
id: 699,
|
|
1833
|
+
name: "MatchTest",
|
|
1834
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
1835
|
+
rpcUrls: {
|
|
1836
|
+
default: {
|
|
1837
|
+
http: ["https://testnet-rpc.matchain.io"]
|
|
1838
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
blockExplorers: {
|
|
1841
|
+
default: {
|
|
1842
|
+
name: "Matchscan",
|
|
1843
|
+
url: "https://testnet.matchscan.io/",
|
|
1844
|
+
apiUrl: "https://testnet.matchscan.io/api"
|
|
1845
|
+
}
|
|
1846
|
+
},
|
|
1847
|
+
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
1848
|
+
contracts: {
|
|
1849
|
+
multicall3: {
|
|
1850
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
1851
|
+
blockCreated: 751532
|
|
1852
|
+
},
|
|
1853
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
1854
|
+
ensUniversalResolver: {
|
|
1855
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
1856
|
+
blockCreated: 5317080
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
// testnet: true,
|
|
1860
|
+
});
|
|
1861
|
+
|
|
1862
|
+
// src/MatchContext.tsx
|
|
1863
|
+
var import_wagmi3 = require("wagmi");
|
|
1864
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
1865
|
+
var queryClient = new import_react_query4.QueryClient();
|
|
1866
|
+
var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
1867
|
+
appName: "MatchID",
|
|
1868
|
+
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
1869
|
+
wallets: [
|
|
1870
|
+
{
|
|
1871
|
+
groupName: "Recommended",
|
|
1872
|
+
wallets: [
|
|
1873
|
+
import_wallets.metaMaskWallet,
|
|
1874
|
+
import_wallets.walletConnectWallet,
|
|
1875
|
+
import_wallets.okxWallet,
|
|
1876
|
+
import_wallets.bitgetWallet,
|
|
1877
|
+
import_wallets.injectedWallet
|
|
1878
|
+
]
|
|
1879
|
+
}
|
|
1880
|
+
],
|
|
1881
|
+
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
1882
|
+
});
|
|
1883
|
+
var MatchContext = (0, import_react33.createContext)(void 0);
|
|
1946
1884
|
var useMatch = () => {
|
|
1947
|
-
const context = (0,
|
|
1885
|
+
const context = (0, import_react33.useContext)(MatchContext);
|
|
1948
1886
|
if (context === void 0) {
|
|
1949
1887
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
1950
1888
|
}
|
|
@@ -1978,7 +1916,7 @@ function useUserInfo() {
|
|
|
1978
1916
|
const getRedirectUri = () => {
|
|
1979
1917
|
return encodeURIComponent(window.location.href);
|
|
1980
1918
|
};
|
|
1981
|
-
const isLogin = (0,
|
|
1919
|
+
const isLogin = (0, import_react34.useMemo)(() => !!token && !!overview, [token, overview]);
|
|
1982
1920
|
const logout = async () => {
|
|
1983
1921
|
try {
|
|
1984
1922
|
await toLogoutApi();
|
|
@@ -2249,9 +2187,9 @@ function useUserInfo() {
|
|
|
2249
2187
|
}
|
|
2250
2188
|
|
|
2251
2189
|
// src/hooks/useMatchEvents.ts
|
|
2252
|
-
var
|
|
2190
|
+
var import_react35 = require("react");
|
|
2253
2191
|
function useMatchEvents(handlers) {
|
|
2254
|
-
(0,
|
|
2192
|
+
(0, import_react35.useEffect)(() => {
|
|
2255
2193
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
2256
2194
|
if (handler2) {
|
|
2257
2195
|
eventManager_default.on(event, handler2);
|
|
@@ -2271,7 +2209,7 @@ function useMatchEvents(handlers) {
|
|
|
2271
2209
|
var import_viem7 = require("viem");
|
|
2272
2210
|
var import_accounts = require("viem/accounts");
|
|
2273
2211
|
var import_viem8 = require("viem");
|
|
2274
|
-
var
|
|
2212
|
+
var import_react36 = require("react");
|
|
2275
2213
|
var import_viem9 = require("viem");
|
|
2276
2214
|
|
|
2277
2215
|
// src/store/useTransactionStore.ts
|
|
@@ -2305,7 +2243,7 @@ var useTransactionStore = (0, import_zustand5.create)((0, import_middleware3.dev
|
|
|
2305
2243
|
var useTransactionStore_default = useTransactionStore;
|
|
2306
2244
|
|
|
2307
2245
|
// src/hooks/useWallet.tsx
|
|
2308
|
-
var
|
|
2246
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
2309
2247
|
var AppClientId2 = "react-sdk-" + getVersion();
|
|
2310
2248
|
function useWallet() {
|
|
2311
2249
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -2356,7 +2294,7 @@ function useWallet() {
|
|
|
2356
2294
|
throw error;
|
|
2357
2295
|
}
|
|
2358
2296
|
};
|
|
2359
|
-
const evmAccount = (0,
|
|
2297
|
+
const evmAccount = (0, import_react36.useMemo)(() => {
|
|
2360
2298
|
try {
|
|
2361
2299
|
return address ? (0, import_accounts.toAccount)({
|
|
2362
2300
|
address,
|
|
@@ -2395,7 +2333,7 @@ function useWallet() {
|
|
|
2395
2333
|
return void 0;
|
|
2396
2334
|
}
|
|
2397
2335
|
}, [address]);
|
|
2398
|
-
(0,
|
|
2336
|
+
(0, import_react36.useEffect)(() => {
|
|
2399
2337
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
2400
2338
|
}, [evmAccount]);
|
|
2401
2339
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -2478,7 +2416,7 @@ function useWallet() {
|
|
|
2478
2416
|
address: evmAccount.address
|
|
2479
2417
|
});
|
|
2480
2418
|
modal.show((props) => {
|
|
2481
|
-
return /* @__PURE__ */ (0,
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
2482
2420
|
});
|
|
2483
2421
|
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
2484
2422
|
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
@@ -2531,14 +2469,14 @@ function useWallet() {
|
|
|
2531
2469
|
|
|
2532
2470
|
// src/hooks/useCopyClipboard.ts
|
|
2533
2471
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
2534
|
-
var
|
|
2472
|
+
var import_react37 = require("react");
|
|
2535
2473
|
function useCopyClipboard(timeout = 500) {
|
|
2536
|
-
const [isCopied, setIsCopied] = (0,
|
|
2537
|
-
const staticCopy = (0,
|
|
2474
|
+
const [isCopied, setIsCopied] = (0, import_react37.useState)(false);
|
|
2475
|
+
const staticCopy = (0, import_react37.useCallback)((text) => {
|
|
2538
2476
|
const didCopy = (0, import_copy_to_clipboard.default)(text);
|
|
2539
2477
|
setIsCopied(didCopy);
|
|
2540
2478
|
}, []);
|
|
2541
|
-
(0,
|
|
2479
|
+
(0, import_react37.useEffect)(() => {
|
|
2542
2480
|
if (isCopied) {
|
|
2543
2481
|
const hide = setTimeout(() => {
|
|
2544
2482
|
setIsCopied(false);
|
|
@@ -2552,17 +2490,72 @@ function useCopyClipboard(timeout = 500) {
|
|
|
2552
2490
|
return [isCopied, staticCopy];
|
|
2553
2491
|
}
|
|
2554
2492
|
|
|
2493
|
+
// src/hooks/api/wallet.ts
|
|
2494
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
2495
|
+
function useChainListQuery(options) {
|
|
2496
|
+
const { isLogin, token } = useUserInfo();
|
|
2497
|
+
return (0, import_react_query5.useQuery)({
|
|
2498
|
+
queryKey: ["match-user-chain-list", token],
|
|
2499
|
+
queryFn: async () => {
|
|
2500
|
+
const res = await getUserChainListApi();
|
|
2501
|
+
if (!isSuccess(res)) {
|
|
2502
|
+
return [];
|
|
2503
|
+
}
|
|
2504
|
+
return res.data;
|
|
2505
|
+
},
|
|
2506
|
+
enabled: isLogin,
|
|
2507
|
+
...options
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
function useAssetListQuery({
|
|
2511
|
+
chainId,
|
|
2512
|
+
...options
|
|
2513
|
+
}) {
|
|
2514
|
+
const { isLogin, token } = useUserInfo();
|
|
2515
|
+
return (0, import_react_query5.useQuery)({
|
|
2516
|
+
queryKey: ["match-user-asset-list", token, chainId],
|
|
2517
|
+
queryFn: async () => {
|
|
2518
|
+
const res = await getUserWalletAssetApi({ chain_id: chainId.toString() });
|
|
2519
|
+
if (!isSuccess(res)) {
|
|
2520
|
+
return [];
|
|
2521
|
+
}
|
|
2522
|
+
return res.data || [];
|
|
2523
|
+
},
|
|
2524
|
+
enabled: isLogin,
|
|
2525
|
+
...options
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
var USER_IMPORT_TOKEN_LIST_KEY = "match-user-import-token-list";
|
|
2529
|
+
function useImportTokenListQuery({
|
|
2530
|
+
chainId,
|
|
2531
|
+
...options
|
|
2532
|
+
}) {
|
|
2533
|
+
const { isLogin, token } = useUserInfo();
|
|
2534
|
+
return (0, import_react_query5.useQuery)({
|
|
2535
|
+
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId],
|
|
2536
|
+
queryFn: async () => {
|
|
2537
|
+
const res = await getUserImportTokenListApi({ chain_id: chainId.toString() });
|
|
2538
|
+
if (!isSuccess(res)) {
|
|
2539
|
+
return [];
|
|
2540
|
+
}
|
|
2541
|
+
return res.data || [];
|
|
2542
|
+
},
|
|
2543
|
+
enabled: isLogin,
|
|
2544
|
+
...options
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2555
2548
|
// src/hooks/useMatchChain.tsx
|
|
2556
|
-
var
|
|
2549
|
+
var import_react38 = require("react");
|
|
2557
2550
|
var import_viem10 = require("viem");
|
|
2558
2551
|
var import_react_intl21 = require("react-intl");
|
|
2559
|
-
var
|
|
2552
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
2560
2553
|
function useMatchChain() {
|
|
2561
2554
|
const chainListQuery = useChainListQuery();
|
|
2562
2555
|
const modal = useModal();
|
|
2563
2556
|
const intl = (0, import_react_intl21.useIntl)();
|
|
2564
2557
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
2565
|
-
const chainId = (0,
|
|
2558
|
+
const chainId = (0, import_react38.useMemo)(() => {
|
|
2566
2559
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2567
2560
|
return null;
|
|
2568
2561
|
}
|
|
@@ -2571,7 +2564,7 @@ function useMatchChain() {
|
|
|
2571
2564
|
}
|
|
2572
2565
|
return chainListQuery.data[0].id;
|
|
2573
2566
|
}, [storeChainId, chainListQuery.data]);
|
|
2574
|
-
const chain = (0,
|
|
2567
|
+
const chain = (0, import_react38.useMemo)(() => {
|
|
2575
2568
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2576
2569
|
return null;
|
|
2577
2570
|
}
|
|
@@ -2585,30 +2578,30 @@ function useMatchChain() {
|
|
|
2585
2578
|
close
|
|
2586
2579
|
}) {
|
|
2587
2580
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
2588
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
2581
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react38.useState)(storeChainId2);
|
|
2589
2582
|
const isDownMd = useDownMd();
|
|
2590
|
-
return /* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2592
|
-
return /* @__PURE__ */ (0,
|
|
2583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-change-network-box`, children: [
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
|
|
2585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
2593
2586
|
"div",
|
|
2594
2587
|
{
|
|
2595
2588
|
onClick: () => setSelectedChainId(item.id),
|
|
2596
2589
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
2597
2590
|
children: [
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2591
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
2601
2594
|
] }),
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
2603
2596
|
]
|
|
2604
2597
|
},
|
|
2605
2598
|
index
|
|
2606
2599
|
);
|
|
2607
2600
|
}) }),
|
|
2608
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
2609
2602
|
setChainId2(selectedChainId || 0);
|
|
2610
2603
|
close();
|
|
2611
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
2604
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react_intl21.FormattedMessage, { id: "confirm" }) })
|
|
2612
2605
|
] });
|
|
2613
2606
|
}
|
|
2614
2607
|
const showChangeNetwork = () => {
|
|
@@ -2617,7 +2610,7 @@ function useMatchChain() {
|
|
|
2617
2610
|
content: ChangeNetwork
|
|
2618
2611
|
});
|
|
2619
2612
|
};
|
|
2620
|
-
const publicClient = (0,
|
|
2613
|
+
const publicClient = (0, import_react38.useMemo)(() => {
|
|
2621
2614
|
if (!chain) {
|
|
2622
2615
|
return null;
|
|
2623
2616
|
}
|
|
@@ -2645,26 +2638,26 @@ function useMatchChain() {
|
|
|
2645
2638
|
|
|
2646
2639
|
// src/hooks/useMatchWallet.tsx
|
|
2647
2640
|
var import_react_qrcode = require("react-qrcode");
|
|
2648
|
-
var
|
|
2649
|
-
var
|
|
2641
|
+
var import_react40 = require("react");
|
|
2642
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
2650
2643
|
var import_viem13 = require("viem");
|
|
2651
2644
|
var import_react_intl23 = require("react-intl");
|
|
2652
2645
|
|
|
2653
2646
|
// src/components/ImportToken/index.tsx
|
|
2654
|
-
var
|
|
2647
|
+
var import_react39 = require("react");
|
|
2655
2648
|
var import_react_intl22 = require("react-intl");
|
|
2656
|
-
var
|
|
2649
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
2657
2650
|
var import_viem12 = require("viem");
|
|
2658
2651
|
|
|
2659
2652
|
// src/hooks/useIsContract.ts
|
|
2660
2653
|
var import_viem11 = require("viem");
|
|
2661
|
-
var
|
|
2654
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
2662
2655
|
function useIsContract({
|
|
2663
2656
|
address,
|
|
2664
2657
|
chain,
|
|
2665
2658
|
enabled
|
|
2666
2659
|
}) {
|
|
2667
|
-
return (0,
|
|
2660
|
+
return (0, import_react_query6.useQuery)({
|
|
2668
2661
|
queryKey: ["is_contract", chain?.id, address],
|
|
2669
2662
|
queryFn: async () => {
|
|
2670
2663
|
if (!chain) return false;
|
|
@@ -2681,14 +2674,14 @@ function useIsContract({
|
|
|
2681
2674
|
}
|
|
2682
2675
|
|
|
2683
2676
|
// src/components/ImportToken/index.tsx
|
|
2684
|
-
var
|
|
2677
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
2685
2678
|
function ImportToken({ close }) {
|
|
2686
|
-
const [status, setStatus] = (0,
|
|
2679
|
+
const [status, setStatus] = (0, import_react39.useState)("");
|
|
2687
2680
|
const { token } = useUserInfo();
|
|
2688
|
-
const [address, setAddress] = (0,
|
|
2689
|
-
const [symbol, setSymbol] = (0,
|
|
2690
|
-
const [decimals, setDecimals] = (0,
|
|
2691
|
-
const [error, setError] = (0,
|
|
2681
|
+
const [address, setAddress] = (0, import_react39.useState)("");
|
|
2682
|
+
const [symbol, setSymbol] = (0, import_react39.useState)("");
|
|
2683
|
+
const [decimals, setDecimals] = (0, import_react39.useState)("");
|
|
2684
|
+
const [error, setError] = (0, import_react39.useState)({});
|
|
2692
2685
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
2693
2686
|
const getContractInfo = async () => {
|
|
2694
2687
|
if (!publicClient) return;
|
|
@@ -2722,7 +2715,7 @@ function ImportToken({ close }) {
|
|
|
2722
2715
|
}
|
|
2723
2716
|
};
|
|
2724
2717
|
const intl = (0, import_react_intl22.useIntl)();
|
|
2725
|
-
(0,
|
|
2718
|
+
(0, import_react39.useEffect)(() => {
|
|
2726
2719
|
if (address.length === 42) {
|
|
2727
2720
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2728
2721
|
if (!reg.test(address)) {
|
|
@@ -2741,9 +2734,9 @@ function ImportToken({ close }) {
|
|
|
2741
2734
|
}
|
|
2742
2735
|
}
|
|
2743
2736
|
}, [address, publicClient]);
|
|
2744
|
-
const [loading, setLoading] = (0,
|
|
2737
|
+
const [loading, setLoading] = (0, import_react39.useState)(false);
|
|
2745
2738
|
const toast = useToast();
|
|
2746
|
-
const queryClient2 = (0,
|
|
2739
|
+
const queryClient2 = (0, import_react_query7.useQueryClient)();
|
|
2747
2740
|
const onImport = async () => {
|
|
2748
2741
|
setLoading(true);
|
|
2749
2742
|
try {
|
|
@@ -2769,7 +2762,7 @@ function ImportToken({ close }) {
|
|
|
2769
2762
|
setLoading(false);
|
|
2770
2763
|
}
|
|
2771
2764
|
};
|
|
2772
|
-
const canImport = (0,
|
|
2765
|
+
const canImport = (0, import_react39.useMemo)(() => {
|
|
2773
2766
|
if (!address) {
|
|
2774
2767
|
return false;
|
|
2775
2768
|
}
|
|
@@ -2792,19 +2785,19 @@ function ImportToken({ close }) {
|
|
|
2792
2785
|
enabled: canImport
|
|
2793
2786
|
});
|
|
2794
2787
|
if (status == "success" || status == "fail") {
|
|
2795
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("img", { src: status == "success" ? success_default : fail_default, alt: status == "success" ? "success" : "fail", className: `matchid-import-token-result-img` }),
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "importFail" }) })
|
|
2799
2792
|
] }),
|
|
2800
|
-
status == "success" ? /* @__PURE__ */ (0,
|
|
2793
|
+
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "back" }) })
|
|
2801
2794
|
] });
|
|
2802
2795
|
}
|
|
2803
|
-
return /* @__PURE__ */ (0,
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-import-token`, children: [
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "matchid-import-token-form", children: [
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
2806
2799
|
id: "tokenSmartContract"
|
|
2807
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0,
|
|
2800
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
2808
2801
|
Input,
|
|
2809
2802
|
{
|
|
2810
2803
|
placeholder: intl.formatMessage({
|
|
@@ -2815,9 +2808,9 @@ function ImportToken({ close }) {
|
|
|
2815
2808
|
maxLength: 42
|
|
2816
2809
|
}
|
|
2817
2810
|
) }),
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
2819
2812
|
id: "tokenSymbol"
|
|
2820
|
-
}), error: error.symbol, children: /* @__PURE__ */ (0,
|
|
2813
|
+
}), error: error.symbol, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
2821
2814
|
Input,
|
|
2822
2815
|
{
|
|
2823
2816
|
placeholder: intl.formatMessage({
|
|
@@ -2828,9 +2821,9 @@ function ImportToken({ close }) {
|
|
|
2828
2821
|
maxLength: 16
|
|
2829
2822
|
}
|
|
2830
2823
|
) }),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2824
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Field, { label: intl.formatMessage({
|
|
2832
2825
|
id: "tokenDecimals"
|
|
2833
|
-
}), error: error.decimals, children: /* @__PURE__ */ (0,
|
|
2826
|
+
}), error: error.decimals, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
2834
2827
|
Input,
|
|
2835
2828
|
{
|
|
2836
2829
|
placeholder: intl.formatMessage({
|
|
@@ -2842,7 +2835,7 @@ function ImportToken({ close }) {
|
|
|
2842
2835
|
}
|
|
2843
2836
|
) })
|
|
2844
2837
|
] }),
|
|
2845
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
2846
2839
|
Button,
|
|
2847
2840
|
{
|
|
2848
2841
|
size: "lg",
|
|
@@ -2851,14 +2844,14 @@ function ImportToken({ close }) {
|
|
|
2851
2844
|
loading: loading || isContractQuery.isLoading,
|
|
2852
2845
|
disabled: !canImport || !isContractQuery.data,
|
|
2853
2846
|
highlight: true,
|
|
2854
|
-
children: /* @__PURE__ */ (0,
|
|
2847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "import" })
|
|
2855
2848
|
}
|
|
2856
2849
|
)
|
|
2857
2850
|
] });
|
|
2858
2851
|
}
|
|
2859
2852
|
|
|
2860
2853
|
// src/hooks/useMatchWallet.tsx
|
|
2861
|
-
var
|
|
2854
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
2862
2855
|
var ReceiveModal = () => {
|
|
2863
2856
|
const chain = useMatchChain();
|
|
2864
2857
|
const { address } = useWallet();
|
|
@@ -2872,10 +2865,10 @@ var ReceiveModal = () => {
|
|
|
2872
2865
|
}));
|
|
2873
2866
|
};
|
|
2874
2867
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2875
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
2868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-receive-modal`, children: [
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "matchid-receive-container", children: [
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl23.FormattedMessage, { id: "receiveQrcode" }) }),
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2879
2872
|
import_react_qrcode.QRCode,
|
|
2880
2873
|
{
|
|
2881
2874
|
margin: "0",
|
|
@@ -2883,7 +2876,7 @@ var ReceiveModal = () => {
|
|
|
2883
2876
|
value: address
|
|
2884
2877
|
}
|
|
2885
2878
|
) }),
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2887
2880
|
"a",
|
|
2888
2881
|
{
|
|
2889
2882
|
href: chainLink,
|
|
@@ -2893,7 +2886,7 @@ var ReceiveModal = () => {
|
|
|
2893
2886
|
}
|
|
2894
2887
|
)
|
|
2895
2888
|
] }),
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2897
2890
|
import_react_intl23.FormattedMessage,
|
|
2898
2891
|
{
|
|
2899
2892
|
id: "copyAddress"
|
|
@@ -2935,12 +2928,12 @@ function useMatchWallet() {
|
|
|
2935
2928
|
};
|
|
2936
2929
|
}
|
|
2937
2930
|
function useMatchWalletRecords() {
|
|
2938
|
-
const [hasMore, setHasMore] = (0,
|
|
2939
|
-
const [items, setItems] = (0,
|
|
2931
|
+
const [hasMore, setHasMore] = (0, import_react40.useState)(true);
|
|
2932
|
+
const [items, setItems] = (0, import_react40.useState)([]);
|
|
2940
2933
|
const { chainId, publicClient } = useMatchChain();
|
|
2941
2934
|
const { address } = useWallet();
|
|
2942
|
-
const hasMoreRef = (0,
|
|
2943
|
-
const nextPageParamsRef = (0,
|
|
2935
|
+
const hasMoreRef = (0, import_react40.useRef)(hasMore);
|
|
2936
|
+
const nextPageParamsRef = (0, import_react40.useRef)(void 0);
|
|
2944
2937
|
const { contracts, setContracts } = useContractStore_default();
|
|
2945
2938
|
const fetchMoreData = async () => {
|
|
2946
2939
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -2957,7 +2950,7 @@ function useMatchWalletRecords() {
|
|
|
2957
2950
|
}
|
|
2958
2951
|
hasMoreRef.current = res.data && res.data.transactions && res.data.transactions.length >= 50;
|
|
2959
2952
|
setHasMore(hasMoreRef.current);
|
|
2960
|
-
nextPageParamsRef.current = res.data
|
|
2953
|
+
nextPageParamsRef.current = res.data?.next_page_params;
|
|
2961
2954
|
}
|
|
2962
2955
|
};
|
|
2963
2956
|
const onInit = async () => {
|
|
@@ -2967,7 +2960,7 @@ function useMatchWalletRecords() {
|
|
|
2967
2960
|
hasMoreRef.current = true;
|
|
2968
2961
|
fetchMoreData();
|
|
2969
2962
|
};
|
|
2970
|
-
(0,
|
|
2963
|
+
(0, import_react40.useEffect)(() => {
|
|
2971
2964
|
if (chainId && address) {
|
|
2972
2965
|
onInit();
|
|
2973
2966
|
}
|
|
@@ -3023,7 +3016,7 @@ function useMatchWalletRecords() {
|
|
|
3023
3016
|
setContracts(contractMap);
|
|
3024
3017
|
}
|
|
3025
3018
|
};
|
|
3026
|
-
const list = (0,
|
|
3019
|
+
const list = (0, import_react40.useMemo)(() => {
|
|
3027
3020
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
3028
3021
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
3029
3022
|
removeList.forEach((item) => {
|
|
@@ -3065,7 +3058,7 @@ function useMatchWalletAssets({
|
|
|
3065
3058
|
chainId: chainId || 0,
|
|
3066
3059
|
...assetListOptions
|
|
3067
3060
|
});
|
|
3068
|
-
const mergedAssets = (0,
|
|
3061
|
+
const mergedAssets = (0, import_react40.useMemo)(() => {
|
|
3069
3062
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
3070
3063
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
3071
3064
|
...asset,
|
|
@@ -3133,7 +3126,7 @@ function useMatchWalletAssetList({
|
|
|
3133
3126
|
name: chain?.nativeCurrency.name,
|
|
3134
3127
|
balance: 0
|
|
3135
3128
|
};
|
|
3136
|
-
const nativeBalanceQuery = (0,
|
|
3129
|
+
const nativeBalanceQuery = (0, import_react_query8.useQuery)({
|
|
3137
3130
|
queryKey: ["nativeBalance", nativeToken?.chain_id],
|
|
3138
3131
|
queryFn: async () => {
|
|
3139
3132
|
if (!nativeToken || !publicClient) return null;
|
|
@@ -3152,8 +3145,8 @@ function useMatchWalletAssetList({
|
|
|
3152
3145
|
retry: 3
|
|
3153
3146
|
// Retry up to 3 times if failed
|
|
3154
3147
|
});
|
|
3155
|
-
const erc20Tokens = (0,
|
|
3156
|
-
const erc20BalanceQuery = (0,
|
|
3148
|
+
const erc20Tokens = (0, import_react40.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
3149
|
+
const erc20BalanceQuery = (0, import_react_query8.useQuery)({
|
|
3157
3150
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
3158
3151
|
queryFn: async () => {
|
|
3159
3152
|
if (!erc20Tokens.length || !publicClient) return [];
|
|
@@ -3180,7 +3173,7 @@ function useMatchWalletAssetList({
|
|
|
3180
3173
|
// Refresh every 15 seconds
|
|
3181
3174
|
retry: 3
|
|
3182
3175
|
});
|
|
3183
|
-
const enrichedAssets = (0,
|
|
3176
|
+
const enrichedAssets = (0, import_react40.useMemo)(() => {
|
|
3184
3177
|
if (!list) return [];
|
|
3185
3178
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
3186
3179
|
return list.map((asset) => {
|
|
@@ -3202,7 +3195,7 @@ function useMatchWalletAssetList({
|
|
|
3202
3195
|
return { ...asset, balance, value, balanceValue };
|
|
3203
3196
|
});
|
|
3204
3197
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
3205
|
-
(0,
|
|
3198
|
+
(0, import_react40.useEffect)(() => {
|
|
3206
3199
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
3207
3200
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
3208
3201
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -3227,14 +3220,14 @@ function useMatchWalletAssetList({
|
|
|
3227
3220
|
}
|
|
3228
3221
|
|
|
3229
3222
|
// src/hooks/useReceipt.tsx
|
|
3230
|
-
var
|
|
3231
|
-
var
|
|
3223
|
+
var import_react41 = require("react");
|
|
3224
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
3232
3225
|
var import_viem14 = require("viem");
|
|
3233
3226
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
3234
3227
|
var MAX_CACHE_SIZE = 500;
|
|
3235
3228
|
var STORAGE_KEY = "match_receipt_logs";
|
|
3236
3229
|
function useReceiptCache() {
|
|
3237
|
-
const [cache, setCache] = (0,
|
|
3230
|
+
const [cache, setCache] = (0, import_react41.useState)(/* @__PURE__ */ new Map());
|
|
3238
3231
|
const isLocalStorageAvailable = (() => {
|
|
3239
3232
|
try {
|
|
3240
3233
|
const testKey = "__test__";
|
|
@@ -3245,7 +3238,7 @@ function useReceiptCache() {
|
|
|
3245
3238
|
return false;
|
|
3246
3239
|
}
|
|
3247
3240
|
})();
|
|
3248
|
-
(0,
|
|
3241
|
+
(0, import_react41.useEffect)(() => {
|
|
3249
3242
|
if (isLocalStorageAvailable) {
|
|
3250
3243
|
try {
|
|
3251
3244
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3264,7 +3257,7 @@ function useReceiptCache() {
|
|
|
3264
3257
|
}
|
|
3265
3258
|
}
|
|
3266
3259
|
}, []);
|
|
3267
|
-
const updateLocalStorage = (0,
|
|
3260
|
+
const updateLocalStorage = (0, import_react41.useCallback)((updatedCache) => {
|
|
3268
3261
|
if (isLocalStorageAvailable) {
|
|
3269
3262
|
try {
|
|
3270
3263
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3281,7 +3274,7 @@ function useReceiptCache() {
|
|
|
3281
3274
|
}
|
|
3282
3275
|
}
|
|
3283
3276
|
}, []);
|
|
3284
|
-
const set = (0,
|
|
3277
|
+
const set = (0, import_react41.useCallback)((key, value) => {
|
|
3285
3278
|
const now = Date.now();
|
|
3286
3279
|
const newCache = new Map(cache);
|
|
3287
3280
|
newCache.forEach((entry, k) => {
|
|
@@ -3299,7 +3292,7 @@ function useReceiptCache() {
|
|
|
3299
3292
|
setCache(newCache);
|
|
3300
3293
|
updateLocalStorage(newCache);
|
|
3301
3294
|
}, [cache, updateLocalStorage]);
|
|
3302
|
-
const get = (0,
|
|
3295
|
+
const get = (0, import_react41.useCallback)((key) => {
|
|
3303
3296
|
const entry = cache.get(key);
|
|
3304
3297
|
if (entry) {
|
|
3305
3298
|
if (Date.now() - entry.timestamp > CACHE_TTL) {
|
|
@@ -3313,7 +3306,7 @@ function useReceiptCache() {
|
|
|
3313
3306
|
}
|
|
3314
3307
|
return void 0;
|
|
3315
3308
|
}, [cache, updateLocalStorage]);
|
|
3316
|
-
const del = (0,
|
|
3309
|
+
const del = (0, import_react41.useCallback)((key) => {
|
|
3317
3310
|
if (cache.has(key)) {
|
|
3318
3311
|
const newCache = new Map(cache);
|
|
3319
3312
|
newCache.delete(key);
|
|
@@ -3321,7 +3314,7 @@ function useReceiptCache() {
|
|
|
3321
3314
|
updateLocalStorage(newCache);
|
|
3322
3315
|
}
|
|
3323
3316
|
}, [cache, updateLocalStorage]);
|
|
3324
|
-
const clear = (0,
|
|
3317
|
+
const clear = (0, import_react41.useCallback)(() => {
|
|
3325
3318
|
setCache(/* @__PURE__ */ new Map());
|
|
3326
3319
|
if (isLocalStorageAvailable) {
|
|
3327
3320
|
localStorage.removeItem(STORAGE_KEY);
|
|
@@ -3336,8 +3329,8 @@ function useReceipt2({
|
|
|
3336
3329
|
const { list } = useMatchChain();
|
|
3337
3330
|
const cache = useReceiptCache();
|
|
3338
3331
|
const chain = list?.find((item) => item.id === chainId);
|
|
3339
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3340
|
-
const query = (0,
|
|
3332
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react41.useState)(true);
|
|
3333
|
+
const query = (0, import_react_query9.useQuery)({
|
|
3341
3334
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
3342
3335
|
queryFn: async () => {
|
|
3343
3336
|
if (!chain || !hash) return false;
|
|
@@ -3362,7 +3355,7 @@ function useReceipt2({
|
|
|
3362
3355
|
},
|
|
3363
3356
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3364
3357
|
});
|
|
3365
|
-
(0,
|
|
3358
|
+
(0, import_react41.useEffect)(() => {
|
|
3366
3359
|
if (query.data) {
|
|
3367
3360
|
setShouldRefetch(false);
|
|
3368
3361
|
}
|
|
@@ -3371,14 +3364,14 @@ function useReceipt2({
|
|
|
3371
3364
|
}
|
|
3372
3365
|
|
|
3373
3366
|
// src/hooks/useTransaction.tsx
|
|
3374
|
-
var
|
|
3375
|
-
var
|
|
3367
|
+
var import_react42 = require("react");
|
|
3368
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
3376
3369
|
var import_viem15 = require("viem");
|
|
3377
3370
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
3378
3371
|
var MAX_CACHE_SIZE2 = 500;
|
|
3379
3372
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
3380
3373
|
function useTransactionCache() {
|
|
3381
|
-
const [cache, setCache] = (0,
|
|
3374
|
+
const [cache, setCache] = (0, import_react42.useState)(/* @__PURE__ */ new Map());
|
|
3382
3375
|
const isLocalStorageAvailable = (() => {
|
|
3383
3376
|
try {
|
|
3384
3377
|
const testKey = "__test__";
|
|
@@ -3389,7 +3382,7 @@ function useTransactionCache() {
|
|
|
3389
3382
|
return false;
|
|
3390
3383
|
}
|
|
3391
3384
|
})();
|
|
3392
|
-
(0,
|
|
3385
|
+
(0, import_react42.useEffect)(() => {
|
|
3393
3386
|
if (isLocalStorageAvailable) {
|
|
3394
3387
|
try {
|
|
3395
3388
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3408,7 +3401,7 @@ function useTransactionCache() {
|
|
|
3408
3401
|
}
|
|
3409
3402
|
}
|
|
3410
3403
|
}, []);
|
|
3411
|
-
const updateLocalStorage = (0,
|
|
3404
|
+
const updateLocalStorage = (0, import_react42.useCallback)((updatedCache) => {
|
|
3412
3405
|
if (isLocalStorageAvailable) {
|
|
3413
3406
|
try {
|
|
3414
3407
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3425,7 +3418,7 @@ function useTransactionCache() {
|
|
|
3425
3418
|
}
|
|
3426
3419
|
}
|
|
3427
3420
|
}, []);
|
|
3428
|
-
const set = (0,
|
|
3421
|
+
const set = (0, import_react42.useCallback)((key, value) => {
|
|
3429
3422
|
const now = Date.now();
|
|
3430
3423
|
const newCache = new Map(cache);
|
|
3431
3424
|
newCache.forEach((entry, k) => {
|
|
@@ -3443,7 +3436,7 @@ function useTransactionCache() {
|
|
|
3443
3436
|
setCache(newCache);
|
|
3444
3437
|
updateLocalStorage(newCache);
|
|
3445
3438
|
}, [cache, updateLocalStorage]);
|
|
3446
|
-
const get = (0,
|
|
3439
|
+
const get = (0, import_react42.useCallback)((key) => {
|
|
3447
3440
|
const entry = cache.get(key);
|
|
3448
3441
|
if (entry) {
|
|
3449
3442
|
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
@@ -3457,7 +3450,7 @@ function useTransactionCache() {
|
|
|
3457
3450
|
}
|
|
3458
3451
|
return void 0;
|
|
3459
3452
|
}, [cache, updateLocalStorage]);
|
|
3460
|
-
const del = (0,
|
|
3453
|
+
const del = (0, import_react42.useCallback)((key) => {
|
|
3461
3454
|
if (cache.has(key)) {
|
|
3462
3455
|
const newCache = new Map(cache);
|
|
3463
3456
|
newCache.delete(key);
|
|
@@ -3465,7 +3458,7 @@ function useTransactionCache() {
|
|
|
3465
3458
|
updateLocalStorage(newCache);
|
|
3466
3459
|
}
|
|
3467
3460
|
}, [cache, updateLocalStorage]);
|
|
3468
|
-
const clear = (0,
|
|
3461
|
+
const clear = (0, import_react42.useCallback)(() => {
|
|
3469
3462
|
setCache(/* @__PURE__ */ new Map());
|
|
3470
3463
|
if (isLocalStorageAvailable) {
|
|
3471
3464
|
localStorage.removeItem(STORAGE_KEY2);
|
|
@@ -3480,8 +3473,8 @@ function useTransaction({
|
|
|
3480
3473
|
const { list } = useMatchChain();
|
|
3481
3474
|
const cache = useTransactionCache();
|
|
3482
3475
|
const chain = list?.find((item) => item.id === chainId);
|
|
3483
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3484
|
-
const query = (0,
|
|
3476
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react42.useState)(true);
|
|
3477
|
+
const query = (0, import_react_query10.useQuery)({
|
|
3485
3478
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
3486
3479
|
queryFn: async () => {
|
|
3487
3480
|
if (!chain || !hash) return false;
|
|
@@ -3506,7 +3499,7 @@ function useTransaction({
|
|
|
3506
3499
|
},
|
|
3507
3500
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3508
3501
|
});
|
|
3509
|
-
(0,
|
|
3502
|
+
(0, import_react42.useEffect)(() => {
|
|
3510
3503
|
if (query.data) {
|
|
3511
3504
|
setShouldRefetch(false);
|
|
3512
3505
|
}
|