@matchain/matchid-sdk-react 0.1.56-alpha.15 → 0.1.56-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/api.d.mts +2 -2
  2. package/dist/api.d.ts +2 -2
  3. package/dist/api.js +152 -87
  4. package/dist/api.js.map +1 -1
  5. package/dist/api.mjs +4 -3
  6. package/dist/chains.mjs +2 -1
  7. package/dist/chunk-3CR66BEX.mjs +19 -0
  8. package/dist/chunk-3CR66BEX.mjs.map +1 -0
  9. package/dist/{chunk-FQ6PYZPD.mjs → chunk-7SUDHG7S.mjs} +1 -1
  10. package/dist/chunk-7SUDHG7S.mjs.map +1 -0
  11. package/dist/{chunk-HYQ3T6WW.mjs → chunk-JX73EY6V.mjs} +2 -14
  12. package/dist/chunk-JX73EY6V.mjs.map +1 -0
  13. package/dist/{chunk-A47WTLYD.mjs → chunk-ZLTIMO57.mjs} +375 -353
  14. package/dist/chunk-ZLTIMO57.mjs.map +1 -0
  15. package/dist/{chunk-FZHJNSAP.mjs → chunk-ZY7EVYXA.mjs} +2 -2
  16. package/dist/components.d.mts +3 -3
  17. package/dist/components.d.ts +3 -3
  18. package/dist/components.js +473 -401
  19. package/dist/components.js.map +1 -1
  20. package/dist/components.mjs +3 -2
  21. package/dist/hooks.d.mts +2 -2
  22. package/dist/hooks.d.ts +2 -2
  23. package/dist/hooks.js +172 -109
  24. package/dist/hooks.js.map +1 -1
  25. package/dist/hooks.mjs +3 -2
  26. package/dist/icon.d.mts +2 -2
  27. package/dist/icon.d.ts +2 -2
  28. package/dist/icon.js.map +1 -1
  29. package/dist/icon.mjs +1 -1
  30. package/dist/{index-DCyE39bg.d.mts → index-84CqVi2I.d.mts} +1 -1
  31. package/dist/{index-BINNnZNA.d.ts → index-B70k4Jpk.d.ts} +1 -2
  32. package/dist/{index-BIVGhRja.d.mts → index-BJJ0Gb6v.d.mts} +1 -2
  33. package/dist/{index-BXhXRggh.d.ts → index-BNqdFiOo.d.ts} +1 -1
  34. package/dist/{index-DGsB7f2H.d.ts → index-BctnHnJp.d.ts} +1 -1
  35. package/dist/{index-DuCefmJ0.d.mts → index-BqI0PEIi.d.mts} +1 -1
  36. package/dist/{index-DZpXCByF.d.ts → index-C2hr7zlN.d.ts} +5 -3
  37. package/dist/{index-CqHlL6ue.d.mts → index-CTHpnEoB.d.mts} +5 -3
  38. package/dist/{index-De8efmdb.d.mts → index-Car1jFyN.d.mts} +1 -1
  39. package/dist/{index-CpJtux-G.d.ts → index-CcVHENNv.d.ts} +1 -1
  40. package/dist/{index-DQYg6bEA.d.ts → index-Cqdz_5bE.d.ts} +2 -2
  41. package/dist/{index-m2bn_W3Y.d.ts → index-CvzpMw3N.d.ts} +1 -1
  42. package/dist/{index-CzCkxwOm.d.mts → index-DkijpM5Q.d.mts} +1 -1
  43. package/dist/{index-BLjGmf9p.d.mts → index-DxHhOW24.d.mts} +2 -2
  44. package/dist/index.css +1 -1
  45. package/dist/index.d.mts +42 -38
  46. package/dist/index.d.ts +42 -38
  47. package/dist/index.js +256 -236
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +5 -4
  50. package/dist/{types-C8FLH1yn.d.mts → types-BrVeC0c8.d.mts} +0 -1
  51. package/dist/{types-C8FLH1yn.d.ts → types-BrVeC0c8.d.ts} +0 -1
  52. package/dist/types.d.mts +1 -1
  53. package/dist/types.d.ts +1 -1
  54. package/dist/ui.d.mts +3 -3
  55. package/dist/ui.d.ts +3 -3
  56. package/dist/ui.js +144 -75
  57. package/dist/ui.js.map +1 -1
  58. package/dist/ui.mjs +3 -2
  59. package/example/package-lock.json +2965 -0
  60. package/example/package.json +2 -1
  61. package/example/src/App.tsx +2 -2
  62. package/example/src/config/index.ts +2 -2
  63. package/example/src/pages/Home.tsx +15 -15
  64. package/example/src/pages/Wallet/index.tsx +2 -4
  65. package/example/src/store/useLocalStore.ts +19 -19
  66. package/example/yarn.lock +559 -548
  67. package/package.json +4 -9
  68. package/dist/chunk-A47WTLYD.mjs.map +0 -1
  69. package/dist/chunk-FQ6PYZPD.mjs.map +0 -1
  70. package/dist/chunk-HYQ3T6WW.mjs.map +0 -1
  71. /package/dist/{chunk-FZHJNSAP.mjs.map → chunk-ZY7EVYXA.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -2173,7 +2173,7 @@ var useWalletModalStore = (0, import_zustand2.create)((set) => ({
2173
2173
  }));
2174
2174
  var useEmailModalStore = (0, import_zustand2.create)((set) => ({
2175
2175
  isOpen: false,
2176
- type: "login",
2176
+ type: "",
2177
2177
  open: (type) => set({ isOpen: true, type }),
2178
2178
  close: () => set({ isOpen: false })
2179
2179
  }));
@@ -2213,8 +2213,8 @@ function useUserInfo() {
2213
2213
  const { open: TONOpen } = useTONModalStore();
2214
2214
  const { open: BTCOpen } = useBTCModalStore();
2215
2215
  const { open: CEXBindOpen } = useCEXBindModalStore();
2216
- const { open: EmailOpen } = useEmailModalStore();
2217
2216
  const walletModalStore = useWalletModalStore();
2217
+ const emailModalStore = useEmailModalStore();
2218
2218
  const getRedirectUri = () => {
2219
2219
  return encodeURIComponent(window.location.href);
2220
2220
  };
@@ -2307,8 +2307,8 @@ function useUserInfo() {
2307
2307
  case "discord":
2308
2308
  case "github":
2309
2309
  case "linkedin":
2310
- case "kakao":
2311
2310
  case "facebook":
2311
+ case "kakao":
2312
2312
  return await loginByMethod(method);
2313
2313
  default:
2314
2314
  throw new Error("unsupported method");
@@ -2348,34 +2348,6 @@ function useUserInfo() {
2348
2348
  }
2349
2349
  return false;
2350
2350
  };
2351
- const bindByEmail = async ({
2352
- email,
2353
- code
2354
- }) => {
2355
- try {
2356
- const obj = {
2357
- email,
2358
- verification_key: emailLoginKey,
2359
- verification_code: code
2360
- };
2361
- const res = await verifyEmailCodeApi(obj);
2362
- if (res && res.data && isSuccess(res)) {
2363
- events.onBind && events.onBind({
2364
- type: "email"
2365
- });
2366
- eventManager_default.emit("onBind", {
2367
- type: "email"
2368
- });
2369
- return true;
2370
- } else {
2371
- throw new Error(res.message);
2372
- }
2373
- } catch (error) {
2374
- console.error("bindByEmail", error);
2375
- throw error;
2376
- }
2377
- return false;
2378
- };
2379
2351
  const bindWallet = async () => {
2380
2352
  if (!token) {
2381
2353
  throw new Error("You must login first");
@@ -2421,18 +2393,18 @@ function useUserInfo() {
2421
2393
  return TONOpen("bind");
2422
2394
  case "btc":
2423
2395
  return BTCOpen("bind");
2396
+ case "email":
2397
+ return emailModalStore.open("bind");
2424
2398
  case "telegram":
2425
2399
  return await bindTelegram();
2426
- case "email":
2427
- return EmailOpen("bind");
2428
2400
  case "twitter":
2429
2401
  case "google":
2430
2402
  case "discord":
2431
2403
  case "github":
2432
2404
  case "linkedin":
2433
2405
  case "facebook":
2434
- case "kakao":
2435
2406
  case "youtube":
2407
+ case "kakao":
2436
2408
  const link = `${endpoints.back}api/v1/auth/${method == "youtube" ? "google" : method}?appid=${appid}&provider=${method == "youtube" ? "google" : method}&redirect=${encodeURIComponent(endpoints.auth + "bind/" + method)}&authorization=${token.includes("Bearer ") ? token.split(" ")[1] : token}${method == "youtube" ? "&auth_type=youtube" : ""}`;
2437
2409
  matchlog_default.log("link", link);
2438
2410
  return window.open(
@@ -2447,6 +2419,31 @@ function useUserInfo() {
2447
2419
  const bindCex = (type) => {
2448
2420
  return CEXBindOpen(type);
2449
2421
  };
2422
+ const bindByEmail = async ({ email, code }) => {
2423
+ try {
2424
+ const obj = {
2425
+ email,
2426
+ verification_key: emailLoginKey,
2427
+ verification_code: code
2428
+ };
2429
+ const res = await verifyEmailCodeApi(obj);
2430
+ if (res && res.data && isSuccess(res)) {
2431
+ events.onBind && events.onBind({
2432
+ type: "email"
2433
+ });
2434
+ eventManager_default.emit("onBind", {
2435
+ type: "email"
2436
+ });
2437
+ return true;
2438
+ } else {
2439
+ throw new Error(res.message);
2440
+ }
2441
+ } catch (error) {
2442
+ console.error("bindByEmail", error);
2443
+ throw error;
2444
+ }
2445
+ return false;
2446
+ };
2450
2447
  const getAuthInfo = async (method) => {
2451
2448
  const element_id = "auth_iframe";
2452
2449
  if (document.getElementById(element_id)) {
@@ -2515,7 +2512,6 @@ function useUserInfo() {
2515
2512
  auth,
2516
2513
  login: loginMethod,
2517
2514
  bind,
2518
- getBindEmailCode: getLoginEmailCode,
2519
2515
  bindByEmail,
2520
2516
  getAuthInfo,
2521
2517
  invite
@@ -2860,7 +2856,7 @@ var import_react_intl2 = require("react-intl");
2860
2856
  var import_jsx_runtime64 = require("react/jsx-runtime");
2861
2857
  function StepVerify(props) {
2862
2858
  const intl = (0, import_react_intl2.useIntl)();
2863
- const { getLoginEmailCode, bindByEmail, loginByEmail } = useUserInfo();
2859
+ const { getLoginEmailCode, loginByEmail, bindByEmail } = useUserInfo();
2864
2860
  const [error, setError] = (0, import_react7.useState)("");
2865
2861
  const [code, setCode] = (0, import_react7.useState)("");
2866
2862
  const [sending, setSending] = (0, import_react7.useState)(false);
@@ -2985,11 +2981,11 @@ var import_react_intl3 = require("react-intl");
2985
2981
  var import_jsx_runtime65 = require("react/jsx-runtime");
2986
2982
  function EmailModal({
2987
2983
  isOpen = false,
2988
- type = "login",
2989
2984
  width = 480,
2990
2985
  onClose,
2991
2986
  onBack,
2992
- onLogin
2987
+ onLogin,
2988
+ type = "login"
2993
2989
  }) {
2994
2990
  const [step, setStep] = (0, import_react8.useState)("input");
2995
2991
  const [emailVal, setEmailVal] = (0, import_react8.useState)("");
@@ -3000,13 +2996,6 @@ function EmailModal({
3000
2996
  setEmailVal("");
3001
2997
  }
3002
2998
  }, [isOpen]);
3003
- const verifySuccess = () => {
3004
- if (onLogin) {
3005
- onLogin();
3006
- } else {
3007
- onClose && onClose();
3008
- }
3009
- };
3010
2999
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
3011
3000
  ModalWithHeader,
3012
3001
  {
@@ -3020,7 +3009,7 @@ function EmailModal({
3020
3009
  children: step === "input" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepEmail, { email: emailVal, onContinue: (email) => {
3021
3010
  setEmailVal(email);
3022
3011
  setStep("verify");
3023
- } }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepVerify, { email: emailVal, type, onSuccess: verifySuccess })
3012
+ } }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepVerify, { type, email: emailVal, onSuccess: onLogin })
3024
3013
  }
3025
3014
  );
3026
3015
  }
@@ -3149,7 +3138,7 @@ function LoginBox({
3149
3138
  }
3150
3139
  return p.toLowerCase();
3151
3140
  });
3152
- console.log("platform2", platform);
3141
+ console.log("platform", platform);
3153
3142
  const walletMethodList = WALLET_METHODS.filter((m) => platform.includes(m));
3154
3143
  let recommendMethodList = walletMethodList.length > 0 ? ["wallet"] : [];
3155
3144
  let methodList = [];
@@ -3170,7 +3159,7 @@ function LoginBox({
3170
3159
  walletMethods: walletMethodList
3171
3160
  };
3172
3161
  }, [config.platform, recommendMethods, methods, walletMethods]);
3173
- const { isOpen: emailIsOpen, open: emailOpen } = useEmailModalStore();
3162
+ const [emailOpen, setEmailOpen] = (0, import_react10.useState)(false);
3174
3163
  const { login } = useUserInfo();
3175
3164
  const [showWallet, setShowWallet] = (0, import_react10.useState)(false);
3176
3165
  const intl = (0, import_react_intl4.useIntl)();
@@ -3186,7 +3175,7 @@ function LoginBox({
3186
3175
  icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(EmailIcon, { size: isDownMd ? 36 : 40 }),
3187
3176
  name: intl.formatMessage({ id: "email" }),
3188
3177
  onClick: () => {
3189
- emailOpen("login");
3178
+ setEmailOpen(true);
3190
3179
  }
3191
3180
  },
3192
3181
  google: {
@@ -3236,116 +3225,130 @@ function LoginBox({
3236
3225
  }
3237
3226
  };
3238
3227
  const { walletMap } = useWalletConfig();
3239
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: (!inModal || !emailIsOpen) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-box", children: [
3240
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
3241
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3242
- RecommendItem,
3243
- {
3244
- icon: methodMap[m]?.icon,
3245
- name: methodMap[m]?.name,
3246
- onClick: methodMap[m]?.onClick,
3247
- showChildren: m == "wallet" && showWallet,
3248
- children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
3249
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
3250
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
3251
- const m2 = walletMap[n];
3252
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
3253
- "div",
3254
- {
3255
- className: "matchid-login-recommend-wallet-item",
3256
- onClick: () => {
3257
- login(m2.method);
3258
- },
3259
- children: [
3260
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-recommend-wallet-item-content", children: [
3261
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
3262
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3263
- "div",
3264
- {
3265
- className: "matchid-login-recommend-wallet-item-hover-icon",
3266
- children: m2.activeIcon
3267
- }
3268
- ),
3228
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
3229
+ (!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-box", children: [
3230
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
3231
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3232
+ RecommendItem,
3233
+ {
3234
+ icon: methodMap[m]?.icon,
3235
+ name: methodMap[m]?.name,
3236
+ onClick: methodMap[m]?.onClick,
3237
+ showChildren: m == "wallet" && showWallet,
3238
+ children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
3239
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
3240
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
3241
+ const m2 = walletMap[n];
3242
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
3243
+ "div",
3244
+ {
3245
+ className: "matchid-login-recommend-wallet-item",
3246
+ onClick: () => {
3247
+ login(m2.method);
3248
+ },
3249
+ children: [
3250
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-recommend-wallet-item-content", children: [
3251
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
3252
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3253
+ "div",
3254
+ {
3255
+ className: "matchid-login-recommend-wallet-item-hover-icon",
3256
+ children: m2.activeIcon
3257
+ }
3258
+ ),
3259
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3260
+ "span",
3261
+ {
3262
+ className: "matchid-login-recommend-wallet-item-name",
3263
+ children: m2.name
3264
+ }
3265
+ )
3266
+ ] }),
3269
3267
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3270
- "span",
3268
+ ArrowRightIcon,
3271
3269
  {
3272
- className: "matchid-login-recommend-wallet-item-name",
3273
- children: m2.name
3270
+ className: "matchid-login-recommend-wallet-item-arrow",
3271
+ size: 20,
3272
+ color: "var(--matchid-arrow-color)"
3274
3273
  }
3275
3274
  )
3276
- ] }),
3277
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3278
- ArrowRightIcon,
3279
- {
3280
- className: "matchid-login-recommend-wallet-item-arrow",
3281
- size: 20,
3282
- color: "var(--matchid-arrow-color)"
3283
- }
3284
- )
3285
- ]
3286
- },
3287
- m2.name
3288
- );
3289
- }) })
3290
- ] })
3291
- },
3292
- m
3293
- );
3294
- }) }),
3295
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-privacy-policy", children: [
3296
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3297
- import_react_intl4.FormattedMessage,
3298
- {
3299
- id: "loginAgreement",
3300
- values: {
3301
- termsLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3302
- "a",
3303
- {
3304
- href: TERMS_OF_SERVICE_URL,
3305
- target: "_blank",
3306
- rel: "noopener noreferrer",
3307
- className: "matchid-privacy-policy-content-link",
3308
- children: chunks
3309
- }
3310
- ),
3311
- privacyLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3312
- "a",
3313
- {
3314
- href: PRIVACY_POLICY_URL,
3315
- target: "_blank",
3316
- rel: "noopener noreferrer",
3317
- className: "matchid-privacy-policy-content-link",
3318
- children: chunks
3319
- }
3320
- )
3321
- }
3322
- }
3323
- ) }),
3324
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-privacy-policy-powered-by", children: [
3325
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_intl4.FormattedMessage, { id: "poweredBy" }),
3326
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MatchIdIcon_default, {})
3327
- ] })
3328
- ] }),
3329
- methodConfig.methods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-other", children: [
3330
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-other-line-box", children: [
3331
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-line" }),
3332
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_intl4.FormattedMessage, { id: "otherLoginMethods" }) }),
3333
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-line" })
3334
- ] }),
3335
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
3336
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3337
- "div",
3338
- {
3339
- className: "matchid-login-method-item",
3340
- onClick: methodMap[m]?.onClick,
3341
- title: methodMap[m]?.name,
3342
- children: methodMap[m]?.icon
3275
+ ]
3276
+ },
3277
+ m2.name
3278
+ );
3279
+ }) })
3280
+ ] })
3343
3281
  },
3344
3282
  m
3345
3283
  );
3346
- }) })
3347
- ] })
3348
- ] }) });
3284
+ }) }),
3285
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-privacy-policy", children: [
3286
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3287
+ import_react_intl4.FormattedMessage,
3288
+ {
3289
+ id: "loginAgreement",
3290
+ values: {
3291
+ termsLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3292
+ "a",
3293
+ {
3294
+ href: TERMS_OF_SERVICE_URL,
3295
+ target: "_blank",
3296
+ rel: "noopener noreferrer",
3297
+ className: "matchid-privacy-policy-content-link",
3298
+ children: chunks
3299
+ }
3300
+ ),
3301
+ privacyLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3302
+ "a",
3303
+ {
3304
+ href: PRIVACY_POLICY_URL,
3305
+ target: "_blank",
3306
+ rel: "noopener noreferrer",
3307
+ className: "matchid-privacy-policy-content-link",
3308
+ children: chunks
3309
+ }
3310
+ )
3311
+ }
3312
+ }
3313
+ ) }),
3314
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-privacy-policy-powered-by", children: [
3315
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_intl4.FormattedMessage, { id: "poweredBy" }),
3316
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MatchIdIcon_default, {})
3317
+ ] })
3318
+ ] }),
3319
+ methodConfig.methods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-other", children: [
3320
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-other-line-box", children: [
3321
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-line" }),
3322
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_intl4.FormattedMessage, { id: "otherLoginMethods" }) }),
3323
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-other-line" })
3324
+ ] }),
3325
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
3326
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3327
+ "div",
3328
+ {
3329
+ className: "matchid-login-method-item",
3330
+ onClick: methodMap[m]?.onClick,
3331
+ title: methodMap[m]?.name,
3332
+ children: methodMap[m]?.icon
3333
+ },
3334
+ m
3335
+ );
3336
+ }) })
3337
+ ] })
3338
+ ] }),
3339
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3340
+ EmailModal,
3341
+ {
3342
+ isOpen: emailOpen,
3343
+ onClose: () => {
3344
+ setEmailOpen(false);
3345
+ },
3346
+ onBack: inModal ? () => {
3347
+ setEmailOpen(false);
3348
+ } : void 0
3349
+ }
3350
+ )
3351
+ ] });
3349
3352
  }
3350
3353
 
3351
3354
  // src/components/LoginButton/index.tsx
@@ -7798,7 +7801,24 @@ function CEXBindModal({
7798
7801
 
7799
7802
  // src/context/BusinessProvider.tsx
7800
7803
  var import_react_query9 = require("@tanstack/react-query");
7804
+
7805
+ // src/components/BindEmailModal/index.tsx
7801
7806
  var import_jsx_runtime102 = require("react/jsx-runtime");
7807
+ var BindEmailModal = ({ isOpen, onClose, onBack, onLogin }) => {
7808
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7809
+ EmailModal,
7810
+ {
7811
+ isOpen,
7812
+ onClose,
7813
+ onBack,
7814
+ onLogin
7815
+ }
7816
+ );
7817
+ };
7818
+ var BindEmailModal_default = BindEmailModal;
7819
+
7820
+ // src/context/BusinessProvider.tsx
7821
+ var import_jsx_runtime103 = require("react/jsx-runtime");
7802
7822
  function BusinessProvider({ children }) {
7803
7823
  const { overview, token } = useUserInfo();
7804
7824
  const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
@@ -7806,8 +7826,8 @@ function BusinessProvider({ children }) {
7806
7826
  const { type: TRONType, isOpen: TRONIsOpen, close: TRONClose } = useTRONModalStore();
7807
7827
  const { type: BTCType, isOpen: BTCIsOpen, close: BTCClose } = useBTCModalStore();
7808
7828
  const { type: CEXType, isOpen: CEXIsOpen, close: CEXClose } = useCEXBindModalStore();
7829
+ const { type: EmailType, isOpen: EmailIsOpen, close: EmailClose } = useEmailModalStore();
7809
7830
  const WalletModalStore = useWalletModalStore();
7810
- const EmailModalStore = useEmailModalStore();
7811
7831
  const { tgAppAuthCode, setTgAppAuthCode } = useStore_default();
7812
7832
  const { login } = useMatch();
7813
7833
  const walletModalClose = (func) => {
@@ -7833,8 +7853,8 @@ function BusinessProvider({ children }) {
7833
7853
  enabled: !!tgAppAuthCode,
7834
7854
  refetchInterval: 1e3 * 5
7835
7855
  });
7836
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
7837
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7856
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
7857
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7838
7858
  EVMModal,
7839
7859
  {
7840
7860
  isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
@@ -7844,7 +7864,7 @@ function BusinessProvider({ children }) {
7844
7864
  zIndex: 199
7845
7865
  }
7846
7866
  ),
7847
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7867
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7848
7868
  TRONModal,
7849
7869
  {
7850
7870
  isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
@@ -7854,7 +7874,7 @@ function BusinessProvider({ children }) {
7854
7874
  zIndex: 199
7855
7875
  }
7856
7876
  ),
7857
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7877
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7858
7878
  TONModal,
7859
7879
  {
7860
7880
  isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
@@ -7864,7 +7884,7 @@ function BusinessProvider({ children }) {
7864
7884
  zIndex: 199
7865
7885
  }
7866
7886
  ),
7867
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7887
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7868
7888
  BTCModal,
7869
7889
  {
7870
7890
  isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
@@ -7874,7 +7894,7 @@ function BusinessProvider({ children }) {
7874
7894
  zIndex: 199
7875
7895
  }
7876
7896
  ),
7877
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7897
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7878
7898
  CEXBindModal,
7879
7899
  {
7880
7900
  isOpen: CEXIsOpen && (!!token && !!overview),
@@ -7883,7 +7903,7 @@ function BusinessProvider({ children }) {
7883
7903
  zIndex: 199
7884
7904
  }
7885
7905
  ),
7886
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7906
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7887
7907
  WalletModal,
7888
7908
  {
7889
7909
  isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
@@ -7893,14 +7913,12 @@ function BusinessProvider({ children }) {
7893
7913
  zIndex: 150
7894
7914
  }
7895
7915
  ),
7896
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
7897
- EmailModal,
7916
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
7917
+ BindEmailModal_default,
7898
7918
  {
7899
- isOpen: EmailModalStore.isOpen && (EmailModalStore.type == "login" && !overview && !token || EmailModalStore.type == "bind" && !!token && !!overview),
7900
- onClose: EmailModalStore.close,
7901
- onLogin: EmailModalStore.close,
7902
- type: EmailModalStore.type,
7903
- zIndex: 199
7919
+ isOpen: EmailIsOpen && (EmailType == "bind" && !!token && !!overview),
7920
+ onClose: EmailClose,
7921
+ onLogin: EmailClose
7904
7922
  }
7905
7923
  ),
7906
7924
  children
@@ -7908,9 +7926,9 @@ function BusinessProvider({ children }) {
7908
7926
  }
7909
7927
 
7910
7928
  // src/context/index.tsx
7911
- var import_jsx_runtime103 = require("react/jsx-runtime");
7929
+ var import_jsx_runtime104 = require("react/jsx-runtime");
7912
7930
  var Providers = ({ children }) => {
7913
- return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(BusinessProvider, { children }) }) });
7931
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(BusinessProvider, { children }) }) });
7914
7932
  };
7915
7933
  var context_default = Providers;
7916
7934
 
@@ -8384,7 +8402,7 @@ var en_default = {
8384
8402
  noMore: "No more",
8385
8403
  Remove: "Remove",
8386
8404
  removeSuccess: "Remove Successfully",
8387
- loginAgreement: "By logging in, you agree to our <termsLink>Terms of Service</termsLink> and <privacyLink>Privacy Policy</privacyLink>",
8405
+ loginAgreement: "By login, you agree to our <termsLink>Terms of Service</termsLink> and <privacyLink>Privacy Policy</privacyLink>",
8388
8406
  poweredBy: "Powered by"
8389
8407
  };
8390
8408
 
@@ -9125,8 +9143,72 @@ var messages = {
9125
9143
  var import_rainbowkit2 = require("@rainbow-me/rainbowkit");
9126
9144
  var import_wallets = require("@rainbow-me/rainbowkit/wallets");
9127
9145
  var import_chains = require("wagmi/chains");
9146
+
9147
+ // src/config/chains/MatchMain.ts
9148
+ var import_viem16 = require("viem");
9149
+ var matchMain = /* @__PURE__ */ (0, import_viem16.defineChain)({
9150
+ //定义match链
9151
+ id: 698,
9152
+ name: "Matchain",
9153
+ nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
9154
+ rpcUrls: {
9155
+ default: {
9156
+ http: ["https://rpc.matchain.io"]
9157
+ }
9158
+ },
9159
+ blockExplorers: {
9160
+ default: {
9161
+ name: "Matchscan",
9162
+ url: "https://matchscan.io/",
9163
+ apiUrl: "https://matchscan.io/api"
9164
+ }
9165
+ },
9166
+ iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
9167
+ contracts: {
9168
+ multicall3: {
9169
+ address: "0xca11bde05977b3631167028862be2a173976ca11"
9170
+ }
9171
+ }
9172
+ // testnet: true,
9173
+ });
9174
+
9175
+ // src/config/chains/MatchTest.ts
9176
+ var import_viem17 = require("viem");
9177
+ var matchTest = /* @__PURE__ */ (0, import_viem17.defineChain)({
9178
+ //定义matchTest链
9179
+ id: 699,
9180
+ name: "MatchTest",
9181
+ nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
9182
+ rpcUrls: {
9183
+ default: {
9184
+ http: ["https://testnet-rpc.matchain.io"]
9185
+ }
9186
+ },
9187
+ blockExplorers: {
9188
+ default: {
9189
+ name: "Matchscan",
9190
+ url: "https://testnet.matchscan.io/",
9191
+ apiUrl: "https://testnet.matchscan.io/api"
9192
+ }
9193
+ },
9194
+ iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
9195
+ contracts: {
9196
+ multicall3: {
9197
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
9198
+ blockCreated: 751532
9199
+ },
9200
+ ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
9201
+ ensUniversalResolver: {
9202
+ address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
9203
+ blockCreated: 5317080
9204
+ }
9205
+ }
9206
+ // testnet: true,
9207
+ });
9208
+
9209
+ // src/MatchContext.tsx
9128
9210
  var import_wagmi3 = require("wagmi");
9129
- var import_jsx_runtime104 = require("react/jsx-runtime");
9211
+ var import_jsx_runtime105 = require("react/jsx-runtime");
9130
9212
  var queryClient = new import_react_query10.QueryClient();
9131
9213
  var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
9132
9214
  appName: "MatchID",
@@ -9143,7 +9225,7 @@ var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
9143
9225
  ]
9144
9226
  }
9145
9227
  ],
9146
- chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, import_chains.matchain, import_chains.matchainTestnet, import_chains.bsc]
9228
+ chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
9147
9229
  });
9148
9230
  var MatchContext = (0, import_react42.createContext)(void 0);
9149
9231
  var MatchProvider = ({
@@ -9165,7 +9247,7 @@ var MatchProvider = ({
9165
9247
  useWalletInit({
9166
9248
  config: wallet
9167
9249
  });
9168
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_query10.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
9250
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_react_intl23.IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_react_query10.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
9169
9251
  MatchContext.Provider,
9170
9252
  {
9171
9253
  value: {
@@ -9176,7 +9258,7 @@ var MatchProvider = ({
9176
9258
  theme,
9177
9259
  locale: realLocale
9178
9260
  },
9179
- children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(context_default, { children })
9261
+ children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(context_default, { children })
9180
9262
  }
9181
9263
  ) }) }) });
9182
9264
  };
@@ -9267,68 +9349,6 @@ __export(chains_exports, {
9267
9349
  MatchTest: () => matchTest
9268
9350
  });
9269
9351
 
9270
- // src/config/chains/MatchMain.ts
9271
- var import_viem16 = require("viem");
9272
- var matchMain = /* @__PURE__ */ (0, import_viem16.defineChain)({
9273
- //定义match链
9274
- id: 698,
9275
- name: "Matchain",
9276
- nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
9277
- rpcUrls: {
9278
- default: {
9279
- http: ["https://rpc.matchain.io"]
9280
- }
9281
- },
9282
- blockExplorers: {
9283
- default: {
9284
- name: "Matchscan",
9285
- url: "https://matchscan.io/",
9286
- apiUrl: "https://matchscan.io/api"
9287
- }
9288
- },
9289
- iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
9290
- contracts: {
9291
- multicall3: {
9292
- address: "0xca11bde05977b3631167028862be2a173976ca11"
9293
- }
9294
- }
9295
- // testnet: true,
9296
- });
9297
-
9298
- // src/config/chains/MatchTest.ts
9299
- var import_viem17 = require("viem");
9300
- var matchTest = /* @__PURE__ */ (0, import_viem17.defineChain)({
9301
- //定义matchTest链
9302
- id: 699,
9303
- name: "MatchTest",
9304
- nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
9305
- rpcUrls: {
9306
- default: {
9307
- http: ["https://testnet-rpc.matchain.io"]
9308
- }
9309
- },
9310
- blockExplorers: {
9311
- default: {
9312
- name: "Matchscan",
9313
- url: "https://testnet.matchscan.io/",
9314
- apiUrl: "https://testnet.matchscan.io/api"
9315
- }
9316
- },
9317
- iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
9318
- contracts: {
9319
- multicall3: {
9320
- address: "0xca11bde05977b3631167028862be2a173976ca11",
9321
- blockCreated: 751532
9322
- },
9323
- ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
9324
- ensUniversalResolver: {
9325
- address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
9326
- blockCreated: 5317080
9327
- }
9328
- }
9329
- // testnet: true,
9330
- });
9331
-
9332
9352
  // src/types/index.ts
9333
9353
  var types_exports = {};
9334
9354
  __export(types_exports, {