@matchain/matchid-sdk-react 0.1.48-alpha.5 → 0.1.48-alpha.7

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 (37) hide show
  1. package/dist/assets/icon/index.d.mts +5 -1
  2. package/dist/assets/icon/index.d.ts +5 -1
  3. package/dist/assets/icon/index.js +39 -0
  4. package/dist/assets/icon/index.js.map +1 -1
  5. package/dist/assets/icon/index.mjs +5 -1
  6. package/dist/{chunk-6GQ2H4L2.mjs → chunk-2CK7JQWH.mjs} +302 -174
  7. package/dist/chunk-2CK7JQWH.mjs.map +1 -0
  8. package/dist/{chunk-A5D3NKTK.mjs → chunk-7UTR37EJ.mjs} +39 -2
  9. package/dist/chunk-7UTR37EJ.mjs.map +1 -0
  10. package/dist/{chunk-LNSJ3ZXG.mjs → chunk-USKUYOYJ.mjs} +2 -2
  11. package/dist/{chunk-ZYDJICK4.mjs → chunk-YXPWZXPT.mjs} +2 -2
  12. package/dist/components/index.js +331 -324
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/components/index.mjs +3 -3
  15. package/dist/hooks/api/index.js +64 -57
  16. package/dist/hooks/api/index.js.map +1 -1
  17. package/dist/hooks/api/index.mjs +4 -4
  18. package/dist/hooks/index.d.mts +1 -1
  19. package/dist/hooks/index.d.ts +1 -1
  20. package/dist/hooks/index.js +213 -62
  21. package/dist/hooks/index.js.map +1 -1
  22. package/dist/hooks/index.mjs +5 -3
  23. package/dist/{index-TkB89QxX.d.ts → index-DaEFoDv_.d.ts} +8 -2
  24. package/dist/{index-DKyt0for.d.mts → index-DktvxNJc.d.mts} +8 -2
  25. package/dist/index.d.mts +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +495 -345
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +4 -4
  30. package/dist/ui/index.js +64 -58
  31. package/dist/ui/index.js.map +1 -1
  32. package/dist/ui/index.mjs +2 -2
  33. package/package.json +1 -1
  34. package/dist/chunk-6GQ2H4L2.mjs.map +0 -1
  35. package/dist/chunk-A5D3NKTK.mjs.map +0 -1
  36. /package/dist/{chunk-LNSJ3ZXG.mjs.map → chunk-USKUYOYJ.mjs.map} +0 -0
  37. /package/dist/{chunk-ZYDJICK4.mjs.map → chunk-YXPWZXPT.mjs.map} +0 -0
@@ -2,14 +2,14 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-ZYDJICK4.mjs";
5
+ } from "../../chunk-YXPWZXPT.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-6GQ2H4L2.mjs";
9
+ } from "../../chunk-2CK7JQWH.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
- import "../../chunk-LNSJ3ZXG.mjs";
12
- import "../../chunk-A5D3NKTK.mjs";
11
+ import "../../chunk-USKUYOYJ.mjs";
12
+ import "../../chunk-7UTR37EJ.mjs";
13
13
  import "../../chunk-J5LGTIGS.mjs";
14
14
  export {
15
15
  bind_exports as bind,
@@ -1,4 +1,4 @@
1
- export { c as useCopyClipboard, k as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-DKyt0for.mjs';
1
+ export { c as useCopyClipboard, l as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, k as useTransaction, u as useUserInfo, b as useWallet } from '../index-DktvxNJc.mjs';
2
2
  import '../types-CHkU0WHZ.mjs';
3
3
  import 'react';
4
4
  import 'viem';
@@ -1,4 +1,4 @@
1
- export { c as useCopyClipboard, k as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-TkB89QxX.js';
1
+ export { c as useCopyClipboard, l as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, k as useTransaction, u as useUserInfo, b as useWallet } from '../index-DaEFoDv_.js';
2
2
  import '../types-CHkU0WHZ.js';
3
3
  import 'react';
4
4
  import 'viem';
@@ -39,6 +39,7 @@ __export(hooks_exports, {
39
39
  useModal: () => useModal,
40
40
  useReceipt: () => useReceipt,
41
41
  useToast: () => useToast,
42
+ useTransaction: () => useTransaction,
42
43
  useUserInfo: () => useUserInfo,
43
44
  useWallet: () => useWallet2
44
45
  });
@@ -479,6 +480,12 @@ var import_jsx_runtime43 = require("react/jsx-runtime");
479
480
  // src/assets/icon/ErrorRoundIcon.tsx
480
481
  var import_jsx_runtime44 = require("react/jsx-runtime");
481
482
 
483
+ // src/assets/icon/InfoLineIcon.tsx
484
+ var import_jsx_runtime45 = require("react/jsx-runtime");
485
+
486
+ // src/assets/icon/InfoRoundIcon.tsx
487
+ var import_jsx_runtime46 = require("react/jsx-runtime");
488
+
482
489
  // src/hooks/useLayout.tsx
483
490
  var useLayout_exports = {};
484
491
  __export(useLayout_exports, {
@@ -500,7 +507,7 @@ function useDownMd() {
500
507
  }
501
508
 
502
509
  // src/hooks/useConfig.tsx
503
- var import_jsx_runtime45 = require("react/jsx-runtime");
510
+ var import_jsx_runtime47 = require("react/jsx-runtime");
504
511
  var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
505
512
 
506
513
  // src/store/useModalStore.ts
@@ -558,10 +565,10 @@ var import_react6 = require("react");
558
565
 
559
566
  // src/ui/Overlay/index.tsx
560
567
  var import_react2 = require("react");
561
- var import_jsx_runtime46 = require("react/jsx-runtime");
568
+ var import_jsx_runtime48 = require("react/jsx-runtime");
562
569
 
563
570
  // src/ui/Modal/index.tsx
564
- var import_jsx_runtime47 = require("react/jsx-runtime");
571
+ var import_jsx_runtime49 = require("react/jsx-runtime");
565
572
 
566
573
  // src/components/EmailModal/StepEmail.tsx
567
574
  var import_react4 = require("react");
@@ -578,7 +585,7 @@ function getAppClientId() {
578
585
  }
579
586
 
580
587
  // src/ui/Button/index.tsx
581
- var import_jsx_runtime48 = require("react/jsx-runtime");
588
+ var import_jsx_runtime50 = require("react/jsx-runtime");
582
589
  function Button({
583
590
  size = "df",
584
591
  disabled = false,
@@ -597,7 +604,7 @@ function Button({
597
604
  onClick && onClick();
598
605
  }
599
606
  };
600
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
607
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
601
608
  "button",
602
609
  {
603
610
  type,
@@ -607,34 +614,34 @@ function Button({
607
614
  ...style
608
615
  },
609
616
  onClick: onAction,
610
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(LoadingIcon_default, { className: "matchid-btn-loading-icon", color: "var(--matchid-btn-loading-color)" }) : children
617
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(LoadingIcon_default, { className: "matchid-btn-loading-icon", color: "var(--matchid-btn-loading-color)" }) : children
611
618
  }
612
619
  );
613
620
  }
614
621
 
615
622
  // src/ui/Input/index.tsx
616
623
  var import_react3 = require("react");
617
- var import_jsx_runtime49 = require("react/jsx-runtime");
624
+ var import_jsx_runtime51 = require("react/jsx-runtime");
618
625
 
619
626
  // src/ui/Field/index.tsx
620
- var import_jsx_runtime50 = require("react/jsx-runtime");
627
+ var import_jsx_runtime52 = require("react/jsx-runtime");
621
628
 
622
629
  // src/components/EmailModal/StepEmail.tsx
623
630
  var import_react_intl = require("react-intl");
624
- var import_jsx_runtime51 = require("react/jsx-runtime");
631
+ var import_jsx_runtime53 = require("react/jsx-runtime");
625
632
 
626
633
  // src/components/EmailModal/StepVerify.tsx
627
634
  var import_react5 = require("react");
628
635
  var import_react_intl2 = require("react-intl");
629
- var import_jsx_runtime52 = require("react/jsx-runtime");
636
+ var import_jsx_runtime54 = require("react/jsx-runtime");
630
637
 
631
638
  // src/components/EmailModal/index.tsx
632
639
  var import_react_intl3 = require("react-intl");
633
- var import_jsx_runtime53 = require("react/jsx-runtime");
640
+ var import_jsx_runtime55 = require("react/jsx-runtime");
634
641
 
635
642
  // src/ui/Popover/index.tsx
636
643
  var import_react7 = require("react");
637
- var import_jsx_runtime54 = require("react/jsx-runtime");
644
+ var import_jsx_runtime56 = require("react/jsx-runtime");
638
645
 
639
646
  // src/components/LoginBox/index.tsx
640
647
  var import_react8 = require("react");
@@ -644,41 +651,36 @@ var import_react_intl4 = require("react-intl");
644
651
  var import_react_query = require("@tanstack/react-query");
645
652
 
646
653
  // src/components/LoginBox/index.tsx
647
- var import_jsx_runtime55 = require("react/jsx-runtime");
654
+ var import_jsx_runtime57 = require("react/jsx-runtime");
648
655
 
649
656
  // src/components/LoginButton/index.tsx
650
657
  var import_react10 = require("react");
651
658
 
652
659
  // src/components/LoginPanel/index.tsx
653
660
  var import_react_intl5 = require("react-intl");
654
- var import_jsx_runtime56 = require("react/jsx-runtime");
661
+ var import_jsx_runtime58 = require("react/jsx-runtime");
655
662
 
656
663
  // src/components/LoginModal/index.tsx
657
- var import_jsx_runtime57 = require("react/jsx-runtime");
664
+ var import_jsx_runtime59 = require("react/jsx-runtime");
658
665
 
659
666
  // src/components/UserPopover/index.tsx
660
667
  var import_react9 = require("react");
661
668
 
662
669
  // src/assets/icon/ProfileIcon.tsx
663
- var import_jsx_runtime58 = require("react/jsx-runtime");
670
+ var import_jsx_runtime60 = require("react/jsx-runtime");
664
671
 
665
672
  // src/components/UserPopover/index.tsx
666
673
  var import_react_intl6 = require("react-intl");
667
- var import_jsx_runtime59 = require("react/jsx-runtime");
674
+ var import_jsx_runtime61 = require("react/jsx-runtime");
668
675
 
669
676
  // src/components/LoginButton/index.tsx
670
677
  var import_react_intl7 = require("react-intl");
671
- var import_jsx_runtime60 = require("react/jsx-runtime");
678
+ var import_jsx_runtime62 = require("react/jsx-runtime");
672
679
 
673
680
  // src/components/UsernameModal/index.tsx
674
681
  var import_react11 = require("react");
675
-
676
- // src/assets/icon/InfoRoundIcon.tsx
677
- var import_jsx_runtime61 = require("react/jsx-runtime");
678
-
679
- // src/components/UsernameModal/index.tsx
680
682
  var import_react_intl8 = require("react-intl");
681
- var import_jsx_runtime62 = require("react/jsx-runtime");
683
+ var import_jsx_runtime63 = require("react/jsx-runtime");
682
684
 
683
685
  // src/components/SOLModal/index.tsx
684
686
  var import_react13 = __toESM(require("react"));
@@ -731,10 +733,10 @@ var import_react_intl9 = require("react-intl");
731
733
 
732
734
  // src/components/WalletModalContent/index.tsx
733
735
  var import_react12 = require("react");
734
- var import_jsx_runtime63 = require("react/jsx-runtime");
736
+ var import_jsx_runtime64 = require("react/jsx-runtime");
735
737
 
736
738
  // src/components/SOLModal/index.tsx
737
- var import_jsx_runtime64 = require("react/jsx-runtime");
739
+ var import_jsx_runtime65 = require("react/jsx-runtime");
738
740
  var wallets = [
739
741
  new import_wallet_adapter_wallets.PhantomWalletAdapter(),
740
742
  new import_wallet_adapter_wallets.SolflareWalletAdapter(),
@@ -785,13 +787,13 @@ var import_react_intl10 = require("react-intl");
785
787
  var import_react14 = require("react");
786
788
 
787
789
  // src/components/TRONModal/index.tsx
788
- var import_jsx_runtime65 = require("react/jsx-runtime");
790
+ var import_jsx_runtime66 = require("react/jsx-runtime");
789
791
 
790
792
  // src/components/TONModal/index.tsx
791
793
  var import_react16 = __toESM(require("react"));
792
794
  var import_react_intl11 = require("react-intl");
793
795
  var import_ui_react = require("@tonconnect/ui-react");
794
- var import_jsx_runtime66 = require("react/jsx-runtime");
796
+ var import_jsx_runtime67 = require("react/jsx-runtime");
795
797
 
796
798
  // src/components/BTCModal/index.tsx
797
799
  var import_react18 = __toESM(require("react"));
@@ -804,17 +806,17 @@ var import_sats_connect = require("sats-connect");
804
806
  var import_react17 = require("react");
805
807
 
806
808
  // src/components/BTCModal/index.tsx
807
- var import_jsx_runtime67 = require("react/jsx-runtime");
809
+ var import_jsx_runtime68 = require("react/jsx-runtime");
808
810
 
809
811
  // src/components/WalletModal/index.tsx
810
812
  var import_react19 = require("react");
811
813
  var import_react_intl13 = require("react-intl");
812
- var import_jsx_runtime68 = require("react/jsx-runtime");
814
+ var import_jsx_runtime69 = require("react/jsx-runtime");
813
815
 
814
816
  // src/components/CEXBindModal/index.tsx
815
817
  var import_react20 = require("react");
816
818
  var import_react_intl14 = require("react-intl");
817
- var import_jsx_runtime69 = require("react/jsx-runtime");
819
+ var import_jsx_runtime70 = require("react/jsx-runtime");
818
820
 
819
821
  // src/ui/HashPanel/index.tsx
820
822
  var import_viem = require("viem");
@@ -822,30 +824,30 @@ var import_react21 = require("react");
822
824
  var import_react_query2 = require("@tanstack/react-query");
823
825
 
824
826
  // src/ui/Drawer/index.tsx
825
- var import_jsx_runtime70 = require("react/jsx-runtime");
827
+ var import_jsx_runtime71 = require("react/jsx-runtime");
826
828
 
827
829
  // src/ui/ModalDrawer/index.tsx
828
- var import_jsx_runtime71 = require("react/jsx-runtime");
830
+ var import_jsx_runtime72 = require("react/jsx-runtime");
829
831
 
830
832
  // src/ui/HashPanel/index.tsx
831
- var import_jsx_runtime72 = require("react/jsx-runtime");
833
+ var import_jsx_runtime73 = require("react/jsx-runtime");
832
834
 
833
835
  // src/context/BusinessProvider.tsx
834
- var import_jsx_runtime73 = require("react/jsx-runtime");
836
+ var import_jsx_runtime74 = require("react/jsx-runtime");
835
837
 
836
838
  // src/context/ModalContext.tsx
837
839
  var import_react23 = require("react");
838
840
  var import_react_dom = require("react-dom");
839
841
 
840
842
  // src/ui/Switch/index.tsx
841
- var import_jsx_runtime74 = require("react/jsx-runtime");
843
+ var import_jsx_runtime75 = require("react/jsx-runtime");
842
844
 
843
845
  // src/ui/AlphaAvatar/index.tsx
844
846
  var import_react22 = require("react");
845
- var import_jsx_runtime75 = require("react/jsx-runtime");
847
+ var import_jsx_runtime76 = require("react/jsx-runtime");
846
848
 
847
849
  // src/ui/Radio/index.tsx
848
- var import_jsx_runtime76 = require("react/jsx-runtime");
850
+ var import_jsx_runtime77 = require("react/jsx-runtime");
849
851
  function Radio({
850
852
  checked = false,
851
853
  onChange,
@@ -854,20 +856,20 @@ function Radio({
854
856
  className = "",
855
857
  style = {}
856
858
  }) {
857
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { onClick: onChange, className: `matchid-radio ${className} ${checked ? "matchid-radio-checked" : ""}`, style: {
859
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { onClick: onChange, className: `matchid-radio ${className} ${checked ? "matchid-radio-checked" : ""}`, style: {
858
860
  width: size,
859
861
  height: size,
860
862
  ...style,
861
863
  // @ts-ignore
862
864
  "--matchid-radio-checked": color
863
- }, children: checked && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: `matchid-radio-content`, style: {
865
+ }, children: checked && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: `matchid-radio-content`, style: {
864
866
  width: Math.floor(size * 0.7),
865
867
  height: Math.floor(size * 0.7)
866
868
  } }) });
867
869
  }
868
870
 
869
871
  // src/context/ModalContext.tsx
870
- var import_jsx_runtime77 = require("react/jsx-runtime");
872
+ var import_jsx_runtime78 = require("react/jsx-runtime");
871
873
  var ModalContext = (0, import_react23.createContext)(null);
872
874
  function useModal() {
873
875
  const context = (0, import_react23.useContext)(ModalContext);
@@ -880,7 +882,7 @@ function useModal() {
880
882
  // src/context/ToastContext.tsx
881
883
  var import_react24 = require("react");
882
884
  var import_react_dom2 = require("react-dom");
883
- var import_jsx_runtime78 = require("react/jsx-runtime");
885
+ var import_jsx_runtime79 = require("react/jsx-runtime");
884
886
  var ToastContext = (0, import_react24.createContext)(null);
885
887
  function useToast() {
886
888
  const context = (0, import_react24.useContext)(ToastContext);
@@ -891,7 +893,7 @@ function useToast() {
891
893
  }
892
894
 
893
895
  // src/context/index.tsx
894
- var import_jsx_runtime79 = require("react/jsx-runtime");
896
+ var import_jsx_runtime80 = require("react/jsx-runtime");
895
897
 
896
898
  // src/hooks/useWalletInit.ts
897
899
  var import_react25 = require("react");
@@ -913,7 +915,7 @@ var import_react26 = require("react");
913
915
  // src/MatchContext.tsx
914
916
  var import_react_query3 = require("@tanstack/react-query");
915
917
  var import_react_intl15 = require("react-intl");
916
- var import_jsx_runtime80 = require("react/jsx-runtime");
918
+ var import_jsx_runtime81 = require("react/jsx-runtime");
917
919
  var queryClient = new import_react_query3.QueryClient();
918
920
  var MatchContext = (0, import_react27.createContext)(void 0);
919
921
  var useMatch = () => {
@@ -1450,7 +1452,7 @@ function useChainListQuery(options) {
1450
1452
 
1451
1453
  // src/hooks/useMatchChain.tsx
1452
1454
  var import_react32 = require("react");
1453
- var import_jsx_runtime81 = require("react/jsx-runtime");
1455
+ var import_jsx_runtime82 = require("react/jsx-runtime");
1454
1456
  function useMatchChain() {
1455
1457
  const chainListQuery = useChainListQuery();
1456
1458
  const modal = useModal();
@@ -1479,25 +1481,25 @@ function useMatchChain() {
1479
1481
  }) {
1480
1482
  const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
1481
1483
  const [selectedChainId, setSelectedChainId] = (0, import_react32.useState)(storeChainId2);
1482
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: `matchid-change-network-box`, children: [
1483
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
1484
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
1484
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `matchid-change-network-box`, children: [
1485
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
1486
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
1485
1487
  "div",
1486
1488
  {
1487
1489
  onClick: () => setSelectedChainId(item.id),
1488
1490
  className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
1489
1491
  children: [
1490
- /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
1491
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
1492
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
1492
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
1493
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
1494
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
1493
1495
  ] }),
1494
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Radio, { checked: selectedChainId === item.id })
1496
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Radio, { checked: selectedChainId === item.id })
1495
1497
  ]
1496
1498
  },
1497
1499
  index
1498
1500
  );
1499
1501
  }) }),
1500
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
1502
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
1501
1503
  setChainId2(selectedChainId || 0);
1502
1504
  close();
1503
1505
  }, block: true, children: "Confirm" })
@@ -1527,7 +1529,7 @@ var import_react33 = require("react");
1527
1529
  var address = "0x4143e29770fd63e24bb1f32d50bf8a590e34de4b";
1528
1530
 
1529
1531
  // src/hooks/useMatchWallet.tsx
1530
- var import_jsx_runtime82 = require("react/jsx-runtime");
1532
+ var import_jsx_runtime83 = require("react/jsx-runtime");
1531
1533
  function useMatchWallet() {
1532
1534
  const modal = useModal();
1533
1535
  const { address: address2 } = useWallet2();
@@ -1541,10 +1543,10 @@ function useMatchWallet() {
1541
1543
  const showReceiveModal = () => {
1542
1544
  const chainLink = chain.explorerLink("address/" + address2);
1543
1545
  const ReceiveModal = () => {
1544
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `matchid-receive-modal`, children: [
1545
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "matchid-receive-container", children: [
1546
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: `matchid-receive-text`, children: "Receive by scanning the QR code" }),
1547
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
1546
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: `matchid-receive-modal`, children: [
1547
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "matchid-receive-container", children: [
1548
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: `matchid-receive-text`, children: "Receive by scanning the QR code" }),
1549
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
1548
1550
  import_react_qrcode.QRCode,
1549
1551
  {
1550
1552
  margin: "0",
@@ -1552,7 +1554,7 @@ function useMatchWallet() {
1552
1554
  value: address2
1553
1555
  }
1554
1556
  ) }),
1555
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
1557
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
1556
1558
  "a",
1557
1559
  {
1558
1560
  href: chainLink,
@@ -1562,7 +1564,7 @@ function useMatchWallet() {
1562
1564
  }
1563
1565
  )
1564
1566
  ] }),
1565
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: "Copy Address" })
1567
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: "Copy Address" })
1566
1568
  ] });
1567
1569
  };
1568
1570
  modal.open({
@@ -1580,8 +1582,9 @@ function useMatchWalletRecords({
1580
1582
  const [hasMore, setHasMore] = (0, import_react33.useState)(true);
1581
1583
  const [items, setItems] = (0, import_react33.useState)([]);
1582
1584
  const { chainId } = useMatchChain();
1585
+ const hasMoreRef = (0, import_react33.useRef)(hasMore);
1583
1586
  const fetchMoreData = async () => {
1584
- if (!hasMore) {
1587
+ if (!hasMoreRef.current) {
1585
1588
  return;
1586
1589
  }
1587
1590
  const chainIdStr = chainId ? chainId.toString() : "";
@@ -1594,12 +1597,14 @@ function useMatchWalletRecords({
1594
1597
  if (res.data && res.data.transactions.length > 0) {
1595
1598
  setItems(items.concat(res.data.transactions));
1596
1599
  }
1600
+ hasMoreRef.current = res.data && res.data.transactions.length >= pageSize;
1597
1601
  setHasMore(res.data && res.data.transactions.length >= pageSize);
1598
1602
  }
1599
1603
  };
1600
1604
  const onInit = async () => {
1601
1605
  setItems([]);
1602
1606
  setHasMore(true);
1607
+ hasMoreRef.current = true;
1603
1608
  fetchMoreData();
1604
1609
  };
1605
1610
  (0, import_react33.useEffect)(() => {
@@ -1739,7 +1744,7 @@ function useReceipt({
1739
1744
  chain: (0, import_viem5.defineChain)(chain),
1740
1745
  transport: (0, import_viem5.http)()
1741
1746
  });
1742
- const receipt = await publicClient.getTransaction({ hash });
1747
+ const receipt = await publicClient.getTransactionReceipt({ hash });
1743
1748
  if (!receipt) {
1744
1749
  return false;
1745
1750
  }
@@ -1758,6 +1763,151 @@ function useReceipt({
1758
1763
  }, [query.data]);
1759
1764
  return query;
1760
1765
  }
1766
+
1767
+ // src/hooks/useTransaction.tsx
1768
+ var import_react35 = require("react");
1769
+ var import_react_query6 = require("@tanstack/react-query");
1770
+ var import_viem6 = require("viem");
1771
+ var CACHE_TTL2 = 86400 * 30 * 1e3;
1772
+ var MAX_CACHE_SIZE2 = 500;
1773
+ var STORAGE_KEY2 = "match_transaction_logs";
1774
+ function useTransactionCache() {
1775
+ const [cache, setCache] = (0, import_react35.useState)(/* @__PURE__ */ new Map());
1776
+ const isLocalStorageAvailable = (() => {
1777
+ try {
1778
+ const testKey = "__test__";
1779
+ localStorage.setItem(testKey, "1");
1780
+ localStorage.removeItem(testKey);
1781
+ return true;
1782
+ } catch (e) {
1783
+ return false;
1784
+ }
1785
+ })();
1786
+ (0, import_react35.useEffect)(() => {
1787
+ if (isLocalStorageAvailable) {
1788
+ try {
1789
+ const storedData = localStorage.getItem(STORAGE_KEY2);
1790
+ if (storedData) {
1791
+ try {
1792
+ const parsed = JSON.parse(storedData);
1793
+ const now = Date.now();
1794
+ const validEntries = Object.entries(parsed).filter(([_, entry]) => typeof entry === "object" && entry !== null && "timestamp" in entry && now - entry.timestamp <= CACHE_TTL2).map(([key, entry]) => [key, entry]);
1795
+ setCache(new Map(validEntries));
1796
+ } catch (e) {
1797
+ console.error("Failed to parse cache from localStorage:", e);
1798
+ }
1799
+ }
1800
+ } catch (e) {
1801
+ console.error("Failed to load cache from localStorage:", e);
1802
+ }
1803
+ }
1804
+ }, []);
1805
+ const updateLocalStorage = (0, import_react35.useCallback)((updatedCache) => {
1806
+ if (isLocalStorageAvailable) {
1807
+ try {
1808
+ const storedData = localStorage.getItem(STORAGE_KEY2);
1809
+ let parsed = {};
1810
+ if (storedData) {
1811
+ parsed = JSON.parse(storedData);
1812
+ }
1813
+ updatedCache.forEach((entry, key) => {
1814
+ parsed[key] = entry;
1815
+ });
1816
+ localStorage.setItem(STORAGE_KEY2, JSON.stringify(parsed));
1817
+ } catch (e) {
1818
+ console.error("Failed to update localStorage:", e);
1819
+ }
1820
+ }
1821
+ }, []);
1822
+ const set = (0, import_react35.useCallback)((key, value) => {
1823
+ const now = Date.now();
1824
+ const newCache = new Map(cache);
1825
+ newCache.forEach((entry, k) => {
1826
+ if (now - entry.timestamp > CACHE_TTL2) {
1827
+ newCache.delete(k);
1828
+ }
1829
+ });
1830
+ if (newCache.size >= MAX_CACHE_SIZE2) {
1831
+ const firstKey = newCache.keys().next().value;
1832
+ if (firstKey !== void 0) {
1833
+ newCache.delete(firstKey);
1834
+ }
1835
+ }
1836
+ newCache.set(key, { value, timestamp: now });
1837
+ setCache(newCache);
1838
+ updateLocalStorage(newCache);
1839
+ }, [cache, updateLocalStorage]);
1840
+ const get = (0, import_react35.useCallback)((key) => {
1841
+ const entry = cache.get(key);
1842
+ if (entry) {
1843
+ if (Date.now() - entry.timestamp > CACHE_TTL2) {
1844
+ const newCache = new Map(cache);
1845
+ newCache.delete(key);
1846
+ setCache(newCache);
1847
+ updateLocalStorage(newCache);
1848
+ return void 0;
1849
+ }
1850
+ return entry.value;
1851
+ }
1852
+ return void 0;
1853
+ }, [cache, updateLocalStorage]);
1854
+ const del = (0, import_react35.useCallback)((key) => {
1855
+ if (cache.has(key)) {
1856
+ const newCache = new Map(cache);
1857
+ newCache.delete(key);
1858
+ setCache(newCache);
1859
+ updateLocalStorage(newCache);
1860
+ }
1861
+ }, [cache, updateLocalStorage]);
1862
+ const clear = (0, import_react35.useCallback)(() => {
1863
+ setCache(/* @__PURE__ */ new Map());
1864
+ if (isLocalStorageAvailable) {
1865
+ localStorage.removeItem(STORAGE_KEY2);
1866
+ }
1867
+ }, [isLocalStorageAvailable]);
1868
+ return { set, get, del, clear };
1869
+ }
1870
+ function useTransaction({
1871
+ chainId,
1872
+ hash
1873
+ }) {
1874
+ const { list } = useMatchChain();
1875
+ const cache = useTransactionCache();
1876
+ const chain = list?.find((item) => item.id === chainId);
1877
+ const [shouldRefetch, setShouldRefetch] = (0, import_react35.useState)(true);
1878
+ const query = (0, import_react_query6.useQuery)({
1879
+ queryKey: ["match-tx-transaction", hash, chain],
1880
+ queryFn: async () => {
1881
+ if (!chain || !hash) return false;
1882
+ const cacheKey = `${chain.id}-${hash}`;
1883
+ if (cache.get(cacheKey)) {
1884
+ return cache.get(cacheKey);
1885
+ }
1886
+ try {
1887
+ const publicClient = (0, import_viem6.createPublicClient)({
1888
+ //@ts-ignore
1889
+ chain: (0, import_viem6.defineChain)(chain),
1890
+ transport: (0, import_viem6.http)()
1891
+ });
1892
+ const transaction = await publicClient.getTransaction({ hash });
1893
+ if (!transaction) {
1894
+ return false;
1895
+ }
1896
+ cache.set(cacheKey, transaction);
1897
+ return transaction;
1898
+ } catch (e) {
1899
+ return false;
1900
+ }
1901
+ },
1902
+ refetchInterval: shouldRefetch ? 1e4 : false
1903
+ });
1904
+ (0, import_react35.useEffect)(() => {
1905
+ if (query.data) {
1906
+ setShouldRefetch(false);
1907
+ }
1908
+ }, [query.data]);
1909
+ return query;
1910
+ }
1761
1911
  // Annotate the CommonJS export names for ESM import in node:
1762
1912
  0 && (module.exports = {
1763
1913
  useCopyClipboard,
@@ -1769,6 +1919,7 @@ function useReceipt({
1769
1919
  useModal,
1770
1920
  useReceipt,
1771
1921
  useToast,
1922
+ useTransaction,
1772
1923
  useUserInfo,
1773
1924
  useWallet
1774
1925
  });