@matchain/matchid-sdk-react 0.1.51 → 0.1.53-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.
Files changed (64) hide show
  1. package/dist/assets/icon/index.d.mts +1 -1
  2. package/dist/assets/icon/index.d.ts +1 -1
  3. package/dist/{chunk-VIJ4FUT3.mjs → chunk-LRJDS2OK.mjs} +93 -91
  4. package/dist/chunk-LRJDS2OK.mjs.map +1 -0
  5. package/dist/{chunk-UXFJALFG.mjs → chunk-YQHI5BIZ.mjs} +2 -2
  6. package/dist/components/index.d.mts +3 -3
  7. package/dist/components/index.d.ts +3 -3
  8. package/dist/components/index.js +60 -56
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/components/index.mjs +1 -1
  11. package/dist/hooks/api/index.d.mts +2 -2
  12. package/dist/hooks/api/index.d.ts +2 -2
  13. package/dist/hooks/api/index.js +28 -25
  14. package/dist/hooks/api/index.js.map +1 -1
  15. package/dist/hooks/api/index.mjs +2 -2
  16. package/dist/hooks/index.d.mts +2 -2
  17. package/dist/hooks/index.d.ts +2 -2
  18. package/dist/hooks/index.js +20 -16
  19. package/dist/hooks/index.js.map +1 -1
  20. package/dist/hooks/index.mjs +1 -1
  21. package/dist/{index-XzSw1Bym.d.mts → index-0EM3dXJ4.d.mts} +2 -2
  22. package/dist/{index-k2Uf0F94.d.ts → index-BNNgBoTN.d.ts} +1 -1
  23. package/dist/{index-BUj9mOrS.d.ts → index-BlYHNOxm.d.ts} +1 -1
  24. package/dist/{index-DvM6x6e6.d.ts → index-BoIDCH41.d.ts} +1 -1
  25. package/dist/{index-B-QfwtE5.d.mts → index-Bsfb3Ysq.d.mts} +1 -1
  26. package/dist/{index-Bmir-Wor.d.mts → index-C29kl7io.d.mts} +1 -1
  27. package/dist/{index-X_fw5wX_.d.ts → index-C7InzeOC.d.ts} +1 -1
  28. package/dist/{index-B_o9HBS1.d.mts → index-CGx_yc95.d.mts} +1 -1
  29. package/dist/{index-DMUZQqNB.d.ts → index-CO1j3Cxc.d.ts} +2 -2
  30. package/dist/{index-BDoEk1EK.d.ts → index-Ce5JlNJv.d.ts} +2 -2
  31. package/dist/{index-D5OzNRfu.d.mts → index-CqO8nMTh.d.mts} +2 -2
  32. package/dist/{index-CDqIk5k2.d.mts → index-CteYYAoN.d.mts} +1 -1
  33. package/dist/index.css +1 -0
  34. package/dist/index.d.mts +7 -7
  35. package/dist/index.d.ts +7 -7
  36. package/dist/index.js +96 -94
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +8 -8
  39. package/dist/types/index.d.mts +1 -1
  40. package/dist/types/index.d.ts +1 -1
  41. package/dist/{types-Dd_ExpLx.d.mts → types-Cv5UhCIP.d.mts} +1 -1
  42. package/dist/{types-Dd_ExpLx.d.ts → types-Cv5UhCIP.d.ts} +1 -1
  43. package/dist/ui/index.d.mts +3 -3
  44. package/dist/ui/index.d.ts +3 -3
  45. package/example/dist/assets/TransportWebHID-BwG9Tbw2.js +1 -0
  46. package/example/dist/assets/bignumber-FiRdtNkj.js +10 -0
  47. package/example/dist/assets/ccip-CJyR03AW.js +1 -0
  48. package/example/dist/assets/draggabilly-1Sl0icBA.js +14 -0
  49. package/example/dist/assets/index-BAfSBdWW.js +1 -0
  50. package/example/dist/assets/index-CYk2C9XJ.js +1 -0
  51. package/example/dist/assets/index-CcgesoWE.js +179 -0
  52. package/example/dist/assets/index-D5RU9xxK.js +3 -0
  53. package/example/dist/assets/index-D8N4Z5B5.js +1677 -0
  54. package/example/dist/assets/index-DATAk5xI.js +569 -0
  55. package/example/dist/assets/index-DN1wW-Mo.js +3 -0
  56. package/example/dist/assets/index-DxxLiL3_.js +303 -0
  57. package/example/dist/assets/index-Gy3FXGhr.css +1 -0
  58. package/example/dist/assets/index-RIWy1Hg7.js +1 -0
  59. package/example/dist/assets/inherits_browser-BlmhoU4v.js +1 -0
  60. package/example/dist/assets/solanaEmbed.esm-CNS-QKE2.js +38 -0
  61. package/example/dist/index.html +14 -0
  62. package/package.json +1 -1
  63. package/dist/chunk-VIJ4FUT3.mjs.map +0 -1
  64. /package/dist/{chunk-UXFJALFG.mjs.map → chunk-YQHI5BIZ.mjs.map} +0 -0
@@ -2,11 +2,11 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-UXFJALFG.mjs";
5
+ } from "../../chunk-YQHI5BIZ.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-VIJ4FUT3.mjs";
9
+ } from "../../chunk-LRJDS2OK.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
11
  import "../../chunk-HLUFAIFV.mjs";
12
12
  import "../../chunk-FB5MHLWX.mjs";
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, n as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, k as useMatchWalletAssetList, j as useMatchWalletAssets, h as useMatchWalletRecords, d as useModal, l as useReceipt, e as useToast, m as useTransaction, u as useUserInfo, b as useWallet } from '../index-B-QfwtE5.mjs';
2
- import '../types-Dd_ExpLx.mjs';
1
+ export { c as useCopyClipboard, n as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, k as useMatchWalletAssetList, j as useMatchWalletAssets, h as useMatchWalletRecords, d as useModal, l as useReceipt, e as useToast, m as useTransaction, u as useUserInfo, b as useWallet } from '../index-Bsfb3Ysq.mjs';
2
+ import '../types-Cv5UhCIP.mjs';
3
3
  import 'react';
4
4
  import '@tanstack/react-query/src/types';
5
5
  import 'viem';
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, n as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, k as useMatchWalletAssetList, j as useMatchWalletAssets, h as useMatchWalletRecords, d as useModal, l as useReceipt, e as useToast, m as useTransaction, u as useUserInfo, b as useWallet } from '../index-X_fw5wX_.js';
2
- import '../types-Dd_ExpLx.js';
1
+ export { c as useCopyClipboard, n as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, k as useMatchWalletAssetList, j as useMatchWalletAssets, h as useMatchWalletRecords, d as useModal, l as useReceipt, e as useToast, m as useTransaction, u as useUserInfo, b as useWallet } from '../index-C7InzeOC.js';
2
+ import '../types-Cv5UhCIP.js';
3
3
  import 'react';
4
4
  import '@tanstack/react-query/src/types';
5
5
  import 'viem';
@@ -1762,7 +1762,9 @@ var useStore = (0, import_zustand4.create)((set) => ({
1762
1762
  walletReady: false,
1763
1763
  setWalletReady: (inited) => set({ walletReady: inited }),
1764
1764
  tgAppAuthCode: "",
1765
- setTgAppAuthCode: (code) => set({ tgAppAuthCode: code })
1765
+ setTgAppAuthCode: (code) => set({ tgAppAuthCode: code }),
1766
+ emailLoginKey: "",
1767
+ setEmailLoginKey: (key) => set({ emailLoginKey: key })
1766
1768
  }));
1767
1769
  var useStore_default = useStore;
1768
1770
 
@@ -1834,7 +1836,7 @@ function useUserInfo() {
1834
1836
  locale,
1835
1837
  refreshOverview
1836
1838
  } = useLocalStore_default();
1837
- const { setTgAppAuthCode } = useStore_default();
1839
+ const { setTgAppAuthCode, emailLoginKey, setEmailLoginKey } = useStore_default();
1838
1840
  const { events, login } = useMatch();
1839
1841
  const { open: SOLOpen } = useSOLModalStore();
1840
1842
  const { open: TRONOpen } = useTRONModalStore();
@@ -1936,7 +1938,7 @@ function useUserInfo() {
1936
1938
  const getLoginEmailCode = async (email) => {
1937
1939
  const res = await getEmailCodeApi(email);
1938
1940
  if (isSuccess(res)) {
1939
- window.sessionStorage.setItem("loginkey", res.data.key);
1941
+ setEmailLoginKey(res.data.key);
1940
1942
  return res.data.key;
1941
1943
  }
1942
1944
  throw new Error(res.message);
@@ -1948,7 +1950,7 @@ function useUserInfo() {
1948
1950
  try {
1949
1951
  const obj = {
1950
1952
  email,
1951
- verification_key: window.sessionStorage.getItem("loginkey"),
1953
+ verification_key: emailLoginKey,
1952
1954
  verification_code: code
1953
1955
  };
1954
1956
  const res = await verifyEmailCodeApi(obj);
@@ -2460,10 +2462,12 @@ function useImportTokenListQuery({
2460
2462
  // src/hooks/useMatchChain.tsx
2461
2463
  var import_react36 = require("react");
2462
2464
  var import_viem8 = require("viem");
2465
+ var import_react_intl20 = require("react-intl");
2463
2466
  var import_jsx_runtime92 = require("react/jsx-runtime");
2464
2467
  function useMatchChain() {
2465
2468
  const chainListQuery = useChainListQuery();
2466
2469
  const modal = useModal();
2470
+ const intl = (0, import_react_intl20.useIntl)();
2467
2471
  const { chainId: storeChainId, setChainId } = useLocalStore_default();
2468
2472
  const chainId = (0, import_react36.useMemo)(() => {
2469
2473
  if (!chainListQuery.data || !chainListQuery.data.length) {
@@ -2511,12 +2515,12 @@ function useMatchChain() {
2511
2515
  /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
2512
2516
  setChainId2(selectedChainId || 0);
2513
2517
  close();
2514
- }, block: true, children: "Confirm" })
2518
+ }, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react_intl20.FormattedMessage, { id: "confirm" }) })
2515
2519
  ] });
2516
2520
  }
2517
2521
  const showChangeNetwork = () => {
2518
2522
  modal.open({
2519
- title: "Change Network",
2523
+ title: intl.formatMessage({ id: "changeNetwork" }),
2520
2524
  content: ChangeNetwork
2521
2525
  });
2522
2526
  };
@@ -2551,11 +2555,11 @@ var import_react_qrcode = require("react-qrcode");
2551
2555
  var import_react38 = require("react");
2552
2556
  var import_react_query8 = require("@tanstack/react-query");
2553
2557
  var import_viem11 = require("viem");
2554
- var import_react_intl21 = require("react-intl");
2558
+ var import_react_intl22 = require("react-intl");
2555
2559
 
2556
2560
  // src/components/ImportToken/index.tsx
2557
2561
  var import_react37 = require("react");
2558
- var import_react_intl20 = require("react-intl");
2562
+ var import_react_intl21 = require("react-intl");
2559
2563
  var import_react_query7 = require("@tanstack/react-query");
2560
2564
  var import_viem10 = require("viem");
2561
2565
 
@@ -2624,7 +2628,7 @@ function ImportToken({ close }) {
2624
2628
  });
2625
2629
  }
2626
2630
  };
2627
- const intl = (0, import_react_intl20.useIntl)();
2631
+ const intl = (0, import_react_intl21.useIntl)();
2628
2632
  (0, import_react37.useEffect)(() => {
2629
2633
  if (address.length === 42) {
2630
2634
  const reg = /^0x[0-9a-fA-F]{40}$/;
@@ -2698,9 +2702,9 @@ function ImportToken({ close }) {
2698
2702
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
2699
2703
  /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
2700
2704
  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("img", { src: status == "success" ? success_default : fail_default, alt: status == "success" ? "success" : "fail", className: `matchid-import-token-result-img` }),
2701
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "importFail" }) })
2705
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "importFail" }) })
2702
2706
  ] }),
2703
- status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "back" }) })
2707
+ status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "back" }) })
2704
2708
  ] });
2705
2709
  }
2706
2710
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token`, children: [
@@ -2754,7 +2758,7 @@ function ImportToken({ close }) {
2754
2758
  loading: loading || isContractQuery.isLoading,
2755
2759
  disabled: !canImport || !isContractQuery.data,
2756
2760
  highlight: true,
2757
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "import" })
2761
+ children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "import" })
2758
2762
  }
2759
2763
  )
2760
2764
  ] });
@@ -2767,7 +2771,7 @@ var ReceiveModal = () => {
2767
2771
  const { address } = useWallet2();
2768
2772
  const [copied, setCopied] = useCopyClipboard();
2769
2773
  const toast = useToast();
2770
- const intl = (0, import_react_intl21.useIntl)();
2774
+ const intl = (0, import_react_intl22.useIntl)();
2771
2775
  const onCopy = () => {
2772
2776
  setCopied(address);
2773
2777
  toast.success(intl.formatMessage({
@@ -2777,7 +2781,7 @@ var ReceiveModal = () => {
2777
2781
  const chainLink = chain.explorerLink("address/" + address);
2778
2782
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-receive-modal`, children: [
2779
2783
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "matchid-receive-container", children: [
2780
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_intl21.FormattedMessage, { id: "receiveQrcode" }) }),
2784
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_intl22.FormattedMessage, { id: "receiveQrcode" }) }),
2781
2785
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
2782
2786
  import_react_qrcode.QRCode,
2783
2787
  {
@@ -2797,7 +2801,7 @@ var ReceiveModal = () => {
2797
2801
  )
2798
2802
  ] }),
2799
2803
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
2800
- import_react_intl21.FormattedMessage,
2804
+ import_react_intl22.FormattedMessage,
2801
2805
  {
2802
2806
  id: "copyAddress"
2803
2807
  }
@@ -2806,7 +2810,7 @@ var ReceiveModal = () => {
2806
2810
  };
2807
2811
  function useMatchWallet() {
2808
2812
  const modal = useModal();
2809
- const intl = (0, import_react_intl21.useIntl)();
2813
+ const intl = (0, import_react_intl22.useIntl)();
2810
2814
  const showReceiveModal = () => {
2811
2815
  modal.open({
2812
2816
  title: intl.formatMessage({