@matchain/matchid-sdk-react 0.1.8 → 0.1.9

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/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.tsx
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ Api: () => api_exports,
33
34
  Components: () => components_exports,
34
35
  Hooks: () => hooks_exports,
35
36
  MatchProvider: () => MatchProvider,
@@ -428,7 +429,7 @@ function ModalWithHeader({
428
429
  }
429
430
 
430
431
  // src/components/PasswordModal/index.tsx
431
- var import_react5 = require("react");
432
+ var import_react4 = require("react");
432
433
 
433
434
  // src/components/Input/index.tsx
434
435
  var import_react = require("react");
@@ -629,6 +630,20 @@ var getToken = () => {
629
630
  }
630
631
  };
631
632
 
633
+ // src/utils/matchlog.ts
634
+ var matchDevExists = () => localStorage.getItem("matchid-sdk-react-debug") !== null;
635
+ var handler = {
636
+ get(target, prop) {
637
+ if (matchDevExists() && typeof target[prop] === "function") {
638
+ return target[prop].bind(console);
639
+ }
640
+ return () => {
641
+ };
642
+ }
643
+ };
644
+ var matchlog = new Proxy(console, handler);
645
+ var matchlog_default = matchlog;
646
+
632
647
  // src/api/request.ts
633
648
  var SUCCESS_CODE = 0;
634
649
  var isSuccess = (res) => {
@@ -650,7 +665,7 @@ var request = async (config) => {
650
665
  instance.defaults.headers.common["Authorization"] = token;
651
666
  }
652
667
  const { data } = await instance.request(config);
653
- console.log("api", data);
668
+ matchlog_default.log("api", data);
654
669
  if (data.code == 401001) {
655
670
  localStore.getState().logout();
656
671
  throw new Error("Your session has expired, please log in again");
@@ -706,6 +721,72 @@ var setUserNameApi = (data) => {
706
721
  data
707
722
  });
708
723
  };
724
+ var getBindListApi = () => {
725
+ return request_default({
726
+ url: `/bind/list`,
727
+ method: "GET"
728
+ });
729
+ };
730
+ var getPohListApi = () => {
731
+ return request_default({
732
+ url: `/poh/list`,
733
+ method: "GET"
734
+ });
735
+ };
736
+ var getBindInfoApi = () => {
737
+ return request_default({
738
+ url: `/bind`,
739
+ method: "GET"
740
+ });
741
+ };
742
+ var bindCexApi = ({ cex, api_key, api_secret }) => {
743
+ return request_default({
744
+ url: `/cex/subscribe`,
745
+ method: "POST",
746
+ data: { cex, api_key, api_secret }
747
+ });
748
+ };
749
+ var unBindApi = ({ type }) => {
750
+ return request_default({
751
+ url: `/unbind`,
752
+ method: "POST",
753
+ data: { type }
754
+ });
755
+ };
756
+ var unBindWalletApi = ({ address }) => {
757
+ return request_default({
758
+ url: `/wallet/unbind`,
759
+ method: "POST",
760
+ data: { address }
761
+ });
762
+ };
763
+ var verifyPohApi = ({
764
+ taskId,
765
+ schemaId,
766
+ publicFields,
767
+ allocatorAddress,
768
+ publicFieldsHash,
769
+ allocatorSignature,
770
+ uHash,
771
+ validatorAddress,
772
+ validatorSignature
773
+ }) => {
774
+ return request_default({
775
+ url: `/poh/zkpass`,
776
+ method: "POST",
777
+ data: {
778
+ taskId,
779
+ schemaId,
780
+ publicFields,
781
+ allocatorAddress,
782
+ publicFieldsHash,
783
+ allocatorSignature,
784
+ uHash,
785
+ validatorAddress,
786
+ validatorSignature
787
+ }
788
+ });
789
+ };
709
790
 
710
791
  // src/hooks/eventManager.ts
711
792
  var EventManager = class {
@@ -787,7 +868,7 @@ function useUserInfo() {
787
868
  };
788
869
  const loginByMethod = (method) => {
789
870
  const link = `${endpoints.back}auth/${method}?appid=${appid}&provider=${method}&redirect=${encodeURIComponent(endpoints.login + "login/" + method)}&authorization=${(/* @__PURE__ */ new Date()).getTime()}`;
790
- console.log("link", link);
871
+ matchlog_default.log("link", link);
791
872
  const authWindow = window.open(
792
873
  link,
793
874
  // Replace with the actual authorization URL
@@ -903,24 +984,21 @@ function useUserInfo() {
903
984
  var import_react3 = require("react");
904
985
  function useMatchEvents(handlers) {
905
986
  (0, import_react3.useEffect)(() => {
906
- Object.entries(handlers).forEach(([event, handler]) => {
907
- if (handler) {
908
- eventManager_default.on(event, handler);
987
+ Object.entries(handlers).forEach(([event, handler2]) => {
988
+ if (handler2) {
989
+ eventManager_default.on(event, handler2);
909
990
  }
910
991
  });
911
992
  return () => {
912
- Object.entries(handlers).forEach(([event, handler]) => {
913
- if (handler) {
914
- eventManager_default.off(event, handler);
993
+ Object.entries(handlers).forEach(([event, handler2]) => {
994
+ if (handler2) {
995
+ eventManager_default.off(event, handler2);
915
996
  }
916
997
  });
917
998
  };
918
999
  }, [handlers]);
919
1000
  }
920
1001
 
921
- // src/hooks/useWallet.tsx
922
- var import_react4 = require("react");
923
-
924
1002
  // src/store/useStore.ts
925
1003
  var import_zustand2 = require("zustand");
926
1004
  var useStore = (0, import_zustand2.create)((set) => ({
@@ -974,7 +1052,7 @@ function useWallet() {
974
1052
  const signMessage = async (message, type) => {
975
1053
  return new Promise(async (resolve, reject) => {
976
1054
  const res = await isRecovered();
977
- console.log("isRecovered", res);
1055
+ matchlog_default.log("isRecovered", res);
978
1056
  const getSign = async () => {
979
1057
  try {
980
1058
  const recoverRes = await window.waitMatchUntilWalletMessage("signMessage", {
@@ -992,7 +1070,7 @@ function useWallet() {
992
1070
  setRecoveryModal({
993
1071
  open: true,
994
1072
  success: async () => {
995
- console.log("recover Success");
1073
+ matchlog_default.log("recover Success");
996
1074
  await getSign();
997
1075
  },
998
1076
  close: async () => {
@@ -1012,7 +1090,7 @@ function useWallet() {
1012
1090
  const signTransaction = async (transaction, type) => {
1013
1091
  return new Promise(async (resolve, reject) => {
1014
1092
  const res = await isRecovered();
1015
- console.log("isRecovered", res);
1093
+ matchlog_default.log("isRecovered", res);
1016
1094
  const getSign = async () => {
1017
1095
  try {
1018
1096
  const recoverRes = await window.waitMatchUntilWalletMessage("signTransaction", {
@@ -1030,7 +1108,7 @@ function useWallet() {
1030
1108
  setRecoveryModal({
1031
1109
  open: true,
1032
1110
  success: async () => {
1033
- console.log("recover Success");
1111
+ matchlog_default.log("recover Success");
1034
1112
  await getSign();
1035
1113
  },
1036
1114
  close: async () => {
@@ -1063,131 +1141,6 @@ function useWallet() {
1063
1141
  isRecovered
1064
1142
  };
1065
1143
  }
1066
- var useWalletInit = ({
1067
- refreshOverview
1068
- }) => {
1069
- const { env } = useLocalStore_default();
1070
- const getWalletIframe = () => {
1071
- return document.getElementById("match-wallet");
1072
- };
1073
- const [walletInited, setWalletInited] = (0, import_react4.useState)(false);
1074
- const { appid, token, overview } = useLocalStore_default();
1075
- const { initWallet, generateWallet } = useWallet();
1076
- (0, import_react4.useEffect)(() => {
1077
- if (env) {
1078
- if (!window.matchWalletMessageIdMap) {
1079
- window.matchWalletMessageIdMap = {};
1080
- }
1081
- const config = env_default[env];
1082
- const endpoints = config.endpoints;
1083
- const existingIframe = getWalletIframe();
1084
- if (!existingIframe) {
1085
- const iframe = document.createElement("iframe");
1086
- iframe.id = "match-wallet";
1087
- iframe.src = endpoints.login + "wallet";
1088
- iframe.style.display = "none";
1089
- iframe.style.width = "0";
1090
- iframe.style.height = "0";
1091
- iframe.onload = () => {
1092
- setWalletInited(true);
1093
- };
1094
- document.body.insertBefore(iframe, document.body.firstChild);
1095
- window.sendMatchWalletMessage = (method, data) => {
1096
- const messageId = Date.now().toString() + Math.random().toString().slice(6);
1097
- const message = {
1098
- method,
1099
- data,
1100
- messageId,
1101
- source: "matchid"
1102
- };
1103
- if (document.getElementById("match-wallet")) {
1104
- getWalletIframe()?.contentWindow?.postMessage(message, "*");
1105
- return messageId;
1106
- }
1107
- console.error("not found iframe");
1108
- return false;
1109
- };
1110
- window.waitMatchUntilWalletMessage = async (method, data, timeout = 5e3) => {
1111
- return new Promise((resolve, reject) => {
1112
- const messageId = window.sendMatchWalletMessage(method, data);
1113
- if (!messageId) {
1114
- console.error("Can't find wallet message");
1115
- reject(new Error("Can't find wallet message"));
1116
- return;
1117
- }
1118
- window.matchWalletMessageIdMap[messageId] = { resolve, reject };
1119
- window.matchWalletMessageIdMap[messageId].timeout = setTimeout(() => {
1120
- console.error("Get wallet result timeout", {
1121
- messageId,
1122
- method,
1123
- data
1124
- });
1125
- delete window.matchWalletMessageIdMap[messageId];
1126
- reject(new Error("Get wallet result timeout"));
1127
- }, timeout);
1128
- });
1129
- };
1130
- } else {
1131
- if (existingIframe.src !== endpoints.login + "wallet") {
1132
- existingIframe.src = endpoints.login + "wallet";
1133
- }
1134
- setWalletInited(true);
1135
- }
1136
- }
1137
- }, [env]);
1138
- (0, import_react4.useEffect)(() => {
1139
- const messageHandle = async (e) => {
1140
- const res = e.data;
1141
- if (res.source != "match-wallet") {
1142
- return;
1143
- }
1144
- const messageId = res.messageId;
1145
- if (messageId && window.matchWalletMessageIdMap[messageId]) {
1146
- const { resolve, reject, timeout } = window.matchWalletMessageIdMap[messageId];
1147
- delete window.matchWalletMessageIdMap[messageId];
1148
- clearTimeout(timeout);
1149
- if (res.status == "success") {
1150
- resolve(res.data);
1151
- } else {
1152
- console.error("qwe-waller-error", res);
1153
- reject(new Error(res.data.message));
1154
- }
1155
- }
1156
- };
1157
- window.addEventListener("message", messageHandle);
1158
- return () => {
1159
- window.removeEventListener("message", messageHandle);
1160
- };
1161
- }, []);
1162
- (0, import_react4.useEffect)(() => {
1163
- if (token && overview && overview.did && walletInited) {
1164
- const did = overview.did.split(":")[2];
1165
- const newUserInit = async () => {
1166
- await window.waitMatchUntilWalletMessage(
1167
- "initCore",
1168
- {
1169
- AppId: appid,
1170
- AppClientId,
1171
- UserId: did,
1172
- AccessToken: token,
1173
- Address: ""
1174
- }
1175
- );
1176
- };
1177
- if (!overview.address) {
1178
- newUserInit();
1179
- } else {
1180
- initWallet({
1181
- address: overview.address,
1182
- did
1183
- });
1184
- }
1185
- }
1186
- }, [overview, token, walletInited]);
1187
- return {
1188
- walletInited
1189
- };
1190
- };
1191
1144
 
1192
1145
  // src/components/PasswordModal/index.tsx
1193
1146
  var import_jsx_runtime24 = require("react/jsx-runtime");
@@ -1199,27 +1152,27 @@ function PasswordModal({
1199
1152
  }) {
1200
1153
  const { refreshOverview } = useUserInfo();
1201
1154
  const { isLogin, did } = useUserInfo();
1202
- const [password, setPassword] = (0, import_react5.useState)("");
1203
- const [rePassword, setRePassword] = (0, import_react5.useState)("");
1204
- const [error, setError] = (0, import_react5.useState)("");
1155
+ const [password, setPassword] = (0, import_react4.useState)("");
1156
+ const [rePassword, setRePassword] = (0, import_react4.useState)("");
1157
+ const [error, setError] = (0, import_react4.useState)("");
1205
1158
  const { generateWallet } = useWallet();
1206
- const passwordError = (0, import_react5.useMemo)(() => {
1159
+ const passwordError = (0, import_react4.useMemo)(() => {
1207
1160
  if (password.length < 6) return "Password must be at least 6 characters";
1208
1161
  return "";
1209
1162
  }, [password]);
1210
- const rePasswordError = (0, import_react5.useMemo)(() => {
1163
+ const rePasswordError = (0, import_react4.useMemo)(() => {
1211
1164
  if (rePassword != password) {
1212
1165
  return "The password you entered twice do not match";
1213
1166
  }
1214
1167
  return "";
1215
1168
  }, [rePassword, password]);
1216
- (0, import_react5.useEffect)(() => {
1169
+ (0, import_react4.useEffect)(() => {
1217
1170
  if (isOpen) {
1218
1171
  setPassword("");
1219
1172
  setRePassword("");
1220
1173
  }
1221
1174
  }, [isOpen]);
1222
- const [isSubmitting, setIsSubmitting] = (0, import_react5.useState)(false);
1175
+ const [isSubmitting, setIsSubmitting] = (0, import_react4.useState)(false);
1223
1176
  const onContinue = async () => {
1224
1177
  if (isSubmitting) return;
1225
1178
  try {
@@ -1279,7 +1232,7 @@ function PasswordModal({
1279
1232
  }
1280
1233
 
1281
1234
  // src/components/RecoveryModal/index.tsx
1282
- var import_react6 = require("react");
1235
+ var import_react5 = require("react");
1283
1236
  var import_jsx_runtime25 = require("react/jsx-runtime");
1284
1237
  function RecoveryModal({
1285
1238
  title,
@@ -1289,19 +1242,19 @@ function RecoveryModal({
1289
1242
  }) {
1290
1243
  const { refreshOverview } = useUserInfo();
1291
1244
  const { isLogin } = useUserInfo();
1292
- const [password, setPassword] = (0, import_react6.useState)("");
1245
+ const [password, setPassword] = (0, import_react5.useState)("");
1293
1246
  const { recoveryWallet } = useWallet();
1294
- const [error, setError] = (0, import_react6.useState)("");
1295
- const passwordError = (0, import_react6.useMemo)(() => {
1247
+ const [error, setError] = (0, import_react5.useState)("");
1248
+ const passwordError = (0, import_react5.useMemo)(() => {
1296
1249
  if (password.length < 6) return "Password must be at least 6 characters";
1297
1250
  return "";
1298
1251
  }, [password]);
1299
- (0, import_react6.useEffect)(() => {
1252
+ (0, import_react5.useEffect)(() => {
1300
1253
  if (isOpen) {
1301
1254
  setPassword("");
1302
1255
  }
1303
1256
  }, [isOpen]);
1304
- const [isSubmitting, setIsSubmitting] = (0, import_react6.useState)(false);
1257
+ const [isSubmitting, setIsSubmitting] = (0, import_react5.useState)(false);
1305
1258
  const onContinue = async () => {
1306
1259
  if (isSubmitting) return;
1307
1260
  try {
@@ -1375,6 +1328,144 @@ var Providers = ({ children }) => {
1375
1328
  };
1376
1329
  var context_default = Providers;
1377
1330
 
1331
+ // src/hooks/useWalletInit.ts
1332
+ var import_react6 = require("react");
1333
+ var AppClientId2 = "react-sdk-" + getVersion();
1334
+ function useWalletInit({
1335
+ refreshOverview
1336
+ }) {
1337
+ const { env } = useLocalStore_default();
1338
+ const getWalletIframe = () => {
1339
+ return document.getElementById("match-wallet");
1340
+ };
1341
+ const [walletInited, setWalletInited] = (0, import_react6.useState)(false);
1342
+ const { appid, token, overview } = useLocalStore_default();
1343
+ const { initWallet, generateWallet } = useWallet();
1344
+ (0, import_react6.useEffect)(() => {
1345
+ if (env) {
1346
+ if (!window.matchWalletMessageIdMap) {
1347
+ window.matchWalletMessageIdMap = {};
1348
+ }
1349
+ const config = env_default[env];
1350
+ const endpoints = config.endpoints;
1351
+ const existingIframe = getWalletIframe();
1352
+ if (!existingIframe) {
1353
+ const iframe = document.createElement("iframe");
1354
+ iframe.id = "match-wallet";
1355
+ iframe.src = endpoints.login + "wallet";
1356
+ iframe.style.display = "none";
1357
+ iframe.style.width = "0";
1358
+ iframe.style.height = "0";
1359
+ document.body.insertBefore(iframe, document.body.firstChild);
1360
+ window.sendMatchWalletMessage = (method, data) => {
1361
+ const messageId = Date.now().toString() + Math.random().toString().slice(6);
1362
+ const message = {
1363
+ method,
1364
+ data,
1365
+ messageId,
1366
+ source: "matchid"
1367
+ };
1368
+ if (document.getElementById("match-wallet")) {
1369
+ matchlog_default.log("matchid.sdk.sendMatchWalletMessage", message, endpoints.login);
1370
+ getWalletIframe()?.contentWindow?.postMessage(message, endpoints.login);
1371
+ return messageId;
1372
+ }
1373
+ console.error("not found iframe");
1374
+ return false;
1375
+ };
1376
+ window.waitMatchUntilWalletMessage = async (method, data, timeout = 1e4) => {
1377
+ return new Promise((resolve, reject) => {
1378
+ const messageId = window.sendMatchWalletMessage(method, data);
1379
+ if (!messageId) {
1380
+ console.error("Can't find wallet message");
1381
+ reject(new Error("Can't find wallet message"));
1382
+ return;
1383
+ }
1384
+ window.matchWalletMessageIdMap[messageId] = { resolve, reject };
1385
+ window.matchWalletMessageIdMap[messageId].timeout = setTimeout(() => {
1386
+ console.error("Get wallet result timeout", {
1387
+ messageId,
1388
+ method,
1389
+ data
1390
+ });
1391
+ delete window.matchWalletMessageIdMap[messageId];
1392
+ reject(new Error("Get wallet result timeout"));
1393
+ }, timeout);
1394
+ });
1395
+ };
1396
+ } else {
1397
+ if (existingIframe.src !== endpoints.login + "wallet") {
1398
+ setWalletInited(false);
1399
+ existingIframe.src = endpoints.login + "wallet";
1400
+ } else {
1401
+ setWalletInited(true);
1402
+ }
1403
+ }
1404
+ }
1405
+ }, [env]);
1406
+ (0, import_react6.useEffect)(() => {
1407
+ const messageHandle = async (e) => {
1408
+ if (e.origin !== env_default[env].endpoints.login.substring(0, env_default[env].endpoints.login.length - 1)) {
1409
+ return;
1410
+ }
1411
+ const res = e.data;
1412
+ if (res.source != "match-wallet") {
1413
+ return;
1414
+ }
1415
+ matchlog_default.log("sdk.wallet.receive", e);
1416
+ const messageId = res.messageId;
1417
+ if (messageId == "init") {
1418
+ matchlog_default.log("wallet init");
1419
+ setWalletInited(true);
1420
+ return;
1421
+ }
1422
+ if (messageId && window.matchWalletMessageIdMap[messageId]) {
1423
+ const { resolve, reject, timeout } = window.matchWalletMessageIdMap[messageId];
1424
+ delete window.matchWalletMessageIdMap[messageId];
1425
+ clearTimeout(timeout);
1426
+ if (res.status == "success") {
1427
+ resolve(res.data);
1428
+ } else {
1429
+ console.error("qwe-waller-error", res);
1430
+ reject(new Error(res.data.message));
1431
+ }
1432
+ }
1433
+ };
1434
+ window.addEventListener("message", messageHandle);
1435
+ return () => {
1436
+ window.removeEventListener("message", messageHandle);
1437
+ };
1438
+ }, []);
1439
+ (0, import_react6.useEffect)(() => {
1440
+ if (token && overview && overview.did && walletInited) {
1441
+ const did = overview.did.split(":")[2];
1442
+ const newUserInit = async () => {
1443
+ await window.waitMatchUntilWalletMessage(
1444
+ "initCore",
1445
+ {
1446
+ AppId: appid,
1447
+ AppClientId: AppClientId2,
1448
+ UserId: did,
1449
+ AccessToken: token,
1450
+ Address: ""
1451
+ }
1452
+ );
1453
+ };
1454
+ if (!overview.address) {
1455
+ newUserInit();
1456
+ } else {
1457
+ initWallet({
1458
+ address: overview.address,
1459
+ did
1460
+ });
1461
+ }
1462
+ }
1463
+ }, [overview, token, walletInited]);
1464
+ return {
1465
+ walletInited
1466
+ };
1467
+ }
1468
+
1378
1469
  // src/hooks/useInit.tsx
1379
1470
  var import_react7 = require("react");
1380
1471
  function useInit({
@@ -1438,7 +1529,7 @@ function useInit({
1438
1529
  };
1439
1530
  }, []);
1440
1531
  const loadOverview = async () => {
1441
- console.log("loadOverview");
1532
+ matchlog_default.log("loadOverview");
1442
1533
  if (overviewLoadingRef.current) {
1443
1534
  return;
1444
1535
  }
@@ -1484,7 +1575,9 @@ function useInit({
1484
1575
  }
1485
1576
 
1486
1577
  // src/MatchContext.tsx
1578
+ var import_react_query = require("@tanstack/react-query");
1487
1579
  var import_jsx_runtime28 = require("react/jsx-runtime");
1580
+ var queryClient = new import_react_query.QueryClient();
1488
1581
  var MatchContext = (0, import_react8.createContext)(void 0);
1489
1582
  var MatchProvider = ({ children, appid, env = "main", events, theme = "light" }) => {
1490
1583
  const { loadOverview, login, config, endpoints } = useInit({
@@ -1496,7 +1589,7 @@ var MatchProvider = ({ children, appid, env = "main", events, theme = "light" })
1496
1589
  useWalletInit({
1497
1590
  refreshOverview: loadOverview
1498
1591
  });
1499
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1592
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1500
1593
  MatchContext.Provider,
1501
1594
  {
1502
1595
  value: {
@@ -1509,7 +1602,7 @@ var MatchProvider = ({ children, appid, env = "main", events, theme = "light" })
1509
1602
  },
1510
1603
  children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(context_default, { children })
1511
1604
  }
1512
- );
1605
+ ) });
1513
1606
  };
1514
1607
  var useMatch = () => {
1515
1608
  const context = (0, import_react8.useContext)(MatchContext);
@@ -1980,8 +2073,71 @@ function UsernameModal({
1980
2073
  }, onClick: props.onClose, size: "lg", block: true, children: "Next Time" })
1981
2074
  ] }) });
1982
2075
  }
2076
+
2077
+ // src/hooks/api/index.ts
2078
+ var api_exports = {};
2079
+ __export(api_exports, {
2080
+ bind: () => bind_exports,
2081
+ poh: () => poh_exports
2082
+ });
2083
+
2084
+ // src/hooks/api/bind.ts
2085
+ var bind_exports = {};
2086
+ __export(bind_exports, {
2087
+ bindCexApi: () => bindCexApi,
2088
+ unBindApi: () => unBindApi,
2089
+ unBindWalletApi: () => unBindWalletApi,
2090
+ useBindInfo: () => useBindInfo,
2091
+ useBindList: () => useBindList
2092
+ });
2093
+ var import_react_query2 = require("@tanstack/react-query");
2094
+ function useBindList(options) {
2095
+ const { isLogin } = useUserInfo();
2096
+ return (0, import_react_query2.useQuery)({
2097
+ queryKey: ["bindList"],
2098
+ enabled: isLogin,
2099
+ queryFn: async () => {
2100
+ let res = await getBindListApi();
2101
+ return res.data;
2102
+ },
2103
+ ...options
2104
+ });
2105
+ }
2106
+ function useBindInfo(options) {
2107
+ const { isLogin } = useUserInfo();
2108
+ return (0, import_react_query2.useQuery)({
2109
+ queryKey: ["bindInfo"],
2110
+ enabled: isLogin,
2111
+ queryFn: async () => {
2112
+ let res = await getBindInfoApi();
2113
+ return res.data;
2114
+ },
2115
+ ...options
2116
+ });
2117
+ }
2118
+
2119
+ // src/hooks/api/poh.ts
2120
+ var poh_exports = {};
2121
+ __export(poh_exports, {
2122
+ usePohList: () => usePohList,
2123
+ verifyPohApi: () => verifyPohApi
2124
+ });
2125
+ var import_react_query3 = require("@tanstack/react-query");
2126
+ function usePohList(options) {
2127
+ const { isLogin } = useUserInfo();
2128
+ return (0, import_react_query3.useQuery)({
2129
+ queryKey: ["pohList"],
2130
+ enabled: isLogin,
2131
+ queryFn: async () => {
2132
+ let res = await getPohListApi();
2133
+ return res.data;
2134
+ },
2135
+ ...options
2136
+ });
2137
+ }
1983
2138
  // Annotate the CommonJS export names for ESM import in node:
1984
2139
  0 && (module.exports = {
2140
+ Api,
1985
2141
  Components,
1986
2142
  Hooks,
1987
2143
  MatchProvider,