@matchain/matchid-sdk-react 0.1.48-alpha.6 → 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 +4 -2
  2. package/dist/assets/icon/index.d.ts +4 -2
  3. package/dist/assets/icon/index.js +18 -2
  4. package/dist/assets/icon/index.js.map +1 -1
  5. package/dist/assets/icon/index.mjs +3 -1
  6. package/dist/{chunk-BPAPYY5P.mjs → chunk-2CK7JQWH.mjs} +243 -93
  7. package/dist/chunk-2CK7JQWH.mjs.map +1 -0
  8. package/dist/{chunk-YFJI4I5M.mjs → chunk-7UTR37EJ.mjs} +18 -3
  9. package/dist/chunk-7UTR37EJ.mjs.map +1 -0
  10. package/dist/{chunk-UHBVYFSP.mjs → chunk-USKUYOYJ.mjs} +2 -2
  11. package/dist/{chunk-55KYW35I.mjs → chunk-YXPWZXPT.mjs} +2 -2
  12. package/dist/components/index.js +312 -303
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/components/index.mjs +3 -3
  15. package/dist/hooks/api/index.js +62 -53
  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 +210 -57
  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 +475 -323
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +4 -4
  30. package/dist/ui/index.js +62 -59
  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-BPAPYY5P.mjs.map +0 -1
  35. package/dist/chunk-YFJI4I5M.mjs.map +0 -1
  36. /package/dist/{chunk-UHBVYFSP.mjs.map → chunk-USKUYOYJ.mjs.map} +0 -0
  37. /package/dist/{chunk-55KYW35I.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-55KYW35I.mjs";
5
+ } from "../../chunk-YXPWZXPT.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-BPAPYY5P.mjs";
9
+ } from "../../chunk-2CK7JQWH.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
- import "../../chunk-UHBVYFSP.mjs";
12
- import "../../chunk-YFJI4I5M.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,9 +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
 
482
- // src/assets/icon/InfoRoundIcon.tsx
483
+ // src/assets/icon/InfoLineIcon.tsx
483
484
  var import_jsx_runtime45 = require("react/jsx-runtime");
484
485
 
486
+ // src/assets/icon/InfoRoundIcon.tsx
487
+ var import_jsx_runtime46 = require("react/jsx-runtime");
488
+
485
489
  // src/hooks/useLayout.tsx
486
490
  var useLayout_exports = {};
487
491
  __export(useLayout_exports, {
@@ -503,7 +507,7 @@ function useDownMd() {
503
507
  }
504
508
 
505
509
  // src/hooks/useConfig.tsx
506
- var import_jsx_runtime46 = require("react/jsx-runtime");
510
+ var import_jsx_runtime47 = require("react/jsx-runtime");
507
511
  var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
508
512
 
509
513
  // src/store/useModalStore.ts
@@ -561,10 +565,10 @@ var import_react6 = require("react");
561
565
 
562
566
  // src/ui/Overlay/index.tsx
563
567
  var import_react2 = require("react");
564
- var import_jsx_runtime47 = require("react/jsx-runtime");
568
+ var import_jsx_runtime48 = require("react/jsx-runtime");
565
569
 
566
570
  // src/ui/Modal/index.tsx
567
- var import_jsx_runtime48 = require("react/jsx-runtime");
571
+ var import_jsx_runtime49 = require("react/jsx-runtime");
568
572
 
569
573
  // src/components/EmailModal/StepEmail.tsx
570
574
  var import_react4 = require("react");
@@ -581,7 +585,7 @@ function getAppClientId() {
581
585
  }
582
586
 
583
587
  // src/ui/Button/index.tsx
584
- var import_jsx_runtime49 = require("react/jsx-runtime");
588
+ var import_jsx_runtime50 = require("react/jsx-runtime");
585
589
  function Button({
586
590
  size = "df",
587
591
  disabled = false,
@@ -600,7 +604,7 @@ function Button({
600
604
  onClick && onClick();
601
605
  }
602
606
  };
603
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
607
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
604
608
  "button",
605
609
  {
606
610
  type,
@@ -610,34 +614,34 @@ function Button({
610
614
  ...style
611
615
  },
612
616
  onClick: onAction,
613
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime49.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
614
618
  }
615
619
  );
616
620
  }
617
621
 
618
622
  // src/ui/Input/index.tsx
619
623
  var import_react3 = require("react");
620
- var import_jsx_runtime50 = require("react/jsx-runtime");
624
+ var import_jsx_runtime51 = require("react/jsx-runtime");
621
625
 
622
626
  // src/ui/Field/index.tsx
623
- var import_jsx_runtime51 = require("react/jsx-runtime");
627
+ var import_jsx_runtime52 = require("react/jsx-runtime");
624
628
 
625
629
  // src/components/EmailModal/StepEmail.tsx
626
630
  var import_react_intl = require("react-intl");
627
- var import_jsx_runtime52 = require("react/jsx-runtime");
631
+ var import_jsx_runtime53 = require("react/jsx-runtime");
628
632
 
629
633
  // src/components/EmailModal/StepVerify.tsx
630
634
  var import_react5 = require("react");
631
635
  var import_react_intl2 = require("react-intl");
632
- var import_jsx_runtime53 = require("react/jsx-runtime");
636
+ var import_jsx_runtime54 = require("react/jsx-runtime");
633
637
 
634
638
  // src/components/EmailModal/index.tsx
635
639
  var import_react_intl3 = require("react-intl");
636
- var import_jsx_runtime54 = require("react/jsx-runtime");
640
+ var import_jsx_runtime55 = require("react/jsx-runtime");
637
641
 
638
642
  // src/ui/Popover/index.tsx
639
643
  var import_react7 = require("react");
640
- var import_jsx_runtime55 = require("react/jsx-runtime");
644
+ var import_jsx_runtime56 = require("react/jsx-runtime");
641
645
 
642
646
  // src/components/LoginBox/index.tsx
643
647
  var import_react8 = require("react");
@@ -647,36 +651,36 @@ var import_react_intl4 = require("react-intl");
647
651
  var import_react_query = require("@tanstack/react-query");
648
652
 
649
653
  // src/components/LoginBox/index.tsx
650
- var import_jsx_runtime56 = require("react/jsx-runtime");
654
+ var import_jsx_runtime57 = require("react/jsx-runtime");
651
655
 
652
656
  // src/components/LoginButton/index.tsx
653
657
  var import_react10 = require("react");
654
658
 
655
659
  // src/components/LoginPanel/index.tsx
656
660
  var import_react_intl5 = require("react-intl");
657
- var import_jsx_runtime57 = require("react/jsx-runtime");
661
+ var import_jsx_runtime58 = require("react/jsx-runtime");
658
662
 
659
663
  // src/components/LoginModal/index.tsx
660
- var import_jsx_runtime58 = require("react/jsx-runtime");
664
+ var import_jsx_runtime59 = require("react/jsx-runtime");
661
665
 
662
666
  // src/components/UserPopover/index.tsx
663
667
  var import_react9 = require("react");
664
668
 
665
669
  // src/assets/icon/ProfileIcon.tsx
666
- var import_jsx_runtime59 = require("react/jsx-runtime");
670
+ var import_jsx_runtime60 = require("react/jsx-runtime");
667
671
 
668
672
  // src/components/UserPopover/index.tsx
669
673
  var import_react_intl6 = require("react-intl");
670
- var import_jsx_runtime60 = require("react/jsx-runtime");
674
+ var import_jsx_runtime61 = require("react/jsx-runtime");
671
675
 
672
676
  // src/components/LoginButton/index.tsx
673
677
  var import_react_intl7 = require("react-intl");
674
- var import_jsx_runtime61 = require("react/jsx-runtime");
678
+ var import_jsx_runtime62 = require("react/jsx-runtime");
675
679
 
676
680
  // src/components/UsernameModal/index.tsx
677
681
  var import_react11 = require("react");
678
682
  var import_react_intl8 = require("react-intl");
679
- var import_jsx_runtime62 = require("react/jsx-runtime");
683
+ var import_jsx_runtime63 = require("react/jsx-runtime");
680
684
 
681
685
  // src/components/SOLModal/index.tsx
682
686
  var import_react13 = __toESM(require("react"));
@@ -729,10 +733,10 @@ var import_react_intl9 = require("react-intl");
729
733
 
730
734
  // src/components/WalletModalContent/index.tsx
731
735
  var import_react12 = require("react");
732
- var import_jsx_runtime63 = require("react/jsx-runtime");
736
+ var import_jsx_runtime64 = require("react/jsx-runtime");
733
737
 
734
738
  // src/components/SOLModal/index.tsx
735
- var import_jsx_runtime64 = require("react/jsx-runtime");
739
+ var import_jsx_runtime65 = require("react/jsx-runtime");
736
740
  var wallets = [
737
741
  new import_wallet_adapter_wallets.PhantomWalletAdapter(),
738
742
  new import_wallet_adapter_wallets.SolflareWalletAdapter(),
@@ -783,13 +787,13 @@ var import_react_intl10 = require("react-intl");
783
787
  var import_react14 = require("react");
784
788
 
785
789
  // src/components/TRONModal/index.tsx
786
- var import_jsx_runtime65 = require("react/jsx-runtime");
790
+ var import_jsx_runtime66 = require("react/jsx-runtime");
787
791
 
788
792
  // src/components/TONModal/index.tsx
789
793
  var import_react16 = __toESM(require("react"));
790
794
  var import_react_intl11 = require("react-intl");
791
795
  var import_ui_react = require("@tonconnect/ui-react");
792
- var import_jsx_runtime66 = require("react/jsx-runtime");
796
+ var import_jsx_runtime67 = require("react/jsx-runtime");
793
797
 
794
798
  // src/components/BTCModal/index.tsx
795
799
  var import_react18 = __toESM(require("react"));
@@ -802,17 +806,17 @@ var import_sats_connect = require("sats-connect");
802
806
  var import_react17 = require("react");
803
807
 
804
808
  // src/components/BTCModal/index.tsx
805
- var import_jsx_runtime67 = require("react/jsx-runtime");
809
+ var import_jsx_runtime68 = require("react/jsx-runtime");
806
810
 
807
811
  // src/components/WalletModal/index.tsx
808
812
  var import_react19 = require("react");
809
813
  var import_react_intl13 = require("react-intl");
810
- var import_jsx_runtime68 = require("react/jsx-runtime");
814
+ var import_jsx_runtime69 = require("react/jsx-runtime");
811
815
 
812
816
  // src/components/CEXBindModal/index.tsx
813
817
  var import_react20 = require("react");
814
818
  var import_react_intl14 = require("react-intl");
815
- var import_jsx_runtime69 = require("react/jsx-runtime");
819
+ var import_jsx_runtime70 = require("react/jsx-runtime");
816
820
 
817
821
  // src/ui/HashPanel/index.tsx
818
822
  var import_viem = require("viem");
@@ -820,30 +824,30 @@ var import_react21 = require("react");
820
824
  var import_react_query2 = require("@tanstack/react-query");
821
825
 
822
826
  // src/ui/Drawer/index.tsx
823
- var import_jsx_runtime70 = require("react/jsx-runtime");
827
+ var import_jsx_runtime71 = require("react/jsx-runtime");
824
828
 
825
829
  // src/ui/ModalDrawer/index.tsx
826
- var import_jsx_runtime71 = require("react/jsx-runtime");
830
+ var import_jsx_runtime72 = require("react/jsx-runtime");
827
831
 
828
832
  // src/ui/HashPanel/index.tsx
829
- var import_jsx_runtime72 = require("react/jsx-runtime");
833
+ var import_jsx_runtime73 = require("react/jsx-runtime");
830
834
 
831
835
  // src/context/BusinessProvider.tsx
832
- var import_jsx_runtime73 = require("react/jsx-runtime");
836
+ var import_jsx_runtime74 = require("react/jsx-runtime");
833
837
 
834
838
  // src/context/ModalContext.tsx
835
839
  var import_react23 = require("react");
836
840
  var import_react_dom = require("react-dom");
837
841
 
838
842
  // src/ui/Switch/index.tsx
839
- var import_jsx_runtime74 = require("react/jsx-runtime");
843
+ var import_jsx_runtime75 = require("react/jsx-runtime");
840
844
 
841
845
  // src/ui/AlphaAvatar/index.tsx
842
846
  var import_react22 = require("react");
843
- var import_jsx_runtime75 = require("react/jsx-runtime");
847
+ var import_jsx_runtime76 = require("react/jsx-runtime");
844
848
 
845
849
  // src/ui/Radio/index.tsx
846
- var import_jsx_runtime76 = require("react/jsx-runtime");
850
+ var import_jsx_runtime77 = require("react/jsx-runtime");
847
851
  function Radio({
848
852
  checked = false,
849
853
  onChange,
@@ -852,20 +856,20 @@ function Radio({
852
856
  className = "",
853
857
  style = {}
854
858
  }) {
855
- 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: {
856
860
  width: size,
857
861
  height: size,
858
862
  ...style,
859
863
  // @ts-ignore
860
864
  "--matchid-radio-checked": color
861
- }, 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: {
862
866
  width: Math.floor(size * 0.7),
863
867
  height: Math.floor(size * 0.7)
864
868
  } }) });
865
869
  }
866
870
 
867
871
  // src/context/ModalContext.tsx
868
- var import_jsx_runtime77 = require("react/jsx-runtime");
872
+ var import_jsx_runtime78 = require("react/jsx-runtime");
869
873
  var ModalContext = (0, import_react23.createContext)(null);
870
874
  function useModal() {
871
875
  const context = (0, import_react23.useContext)(ModalContext);
@@ -878,7 +882,7 @@ function useModal() {
878
882
  // src/context/ToastContext.tsx
879
883
  var import_react24 = require("react");
880
884
  var import_react_dom2 = require("react-dom");
881
- var import_jsx_runtime78 = require("react/jsx-runtime");
885
+ var import_jsx_runtime79 = require("react/jsx-runtime");
882
886
  var ToastContext = (0, import_react24.createContext)(null);
883
887
  function useToast() {
884
888
  const context = (0, import_react24.useContext)(ToastContext);
@@ -889,7 +893,7 @@ function useToast() {
889
893
  }
890
894
 
891
895
  // src/context/index.tsx
892
- var import_jsx_runtime79 = require("react/jsx-runtime");
896
+ var import_jsx_runtime80 = require("react/jsx-runtime");
893
897
 
894
898
  // src/hooks/useWalletInit.ts
895
899
  var import_react25 = require("react");
@@ -911,7 +915,7 @@ var import_react26 = require("react");
911
915
  // src/MatchContext.tsx
912
916
  var import_react_query3 = require("@tanstack/react-query");
913
917
  var import_react_intl15 = require("react-intl");
914
- var import_jsx_runtime80 = require("react/jsx-runtime");
918
+ var import_jsx_runtime81 = require("react/jsx-runtime");
915
919
  var queryClient = new import_react_query3.QueryClient();
916
920
  var MatchContext = (0, import_react27.createContext)(void 0);
917
921
  var useMatch = () => {
@@ -1448,7 +1452,7 @@ function useChainListQuery(options) {
1448
1452
 
1449
1453
  // src/hooks/useMatchChain.tsx
1450
1454
  var import_react32 = require("react");
1451
- var import_jsx_runtime81 = require("react/jsx-runtime");
1455
+ var import_jsx_runtime82 = require("react/jsx-runtime");
1452
1456
  function useMatchChain() {
1453
1457
  const chainListQuery = useChainListQuery();
1454
1458
  const modal = useModal();
@@ -1477,25 +1481,25 @@ function useMatchChain() {
1477
1481
  }) {
1478
1482
  const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
1479
1483
  const [selectedChainId, setSelectedChainId] = (0, import_react32.useState)(storeChainId2);
1480
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: `matchid-change-network-box`, children: [
1481
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
1482
- 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)(
1483
1487
  "div",
1484
1488
  {
1485
1489
  onClick: () => setSelectedChainId(item.id),
1486
1490
  className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
1487
1491
  children: [
1488
- /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
1489
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
1490
- /* @__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 })
1491
1495
  ] }),
1492
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Radio, { checked: selectedChainId === item.id })
1496
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Radio, { checked: selectedChainId === item.id })
1493
1497
  ]
1494
1498
  },
1495
1499
  index
1496
1500
  );
1497
1501
  }) }),
1498
- /* @__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: () => {
1499
1503
  setChainId2(selectedChainId || 0);
1500
1504
  close();
1501
1505
  }, block: true, children: "Confirm" })
@@ -1525,7 +1529,7 @@ var import_react33 = require("react");
1525
1529
  var address = "0x4143e29770fd63e24bb1f32d50bf8a590e34de4b";
1526
1530
 
1527
1531
  // src/hooks/useMatchWallet.tsx
1528
- var import_jsx_runtime82 = require("react/jsx-runtime");
1532
+ var import_jsx_runtime83 = require("react/jsx-runtime");
1529
1533
  function useMatchWallet() {
1530
1534
  const modal = useModal();
1531
1535
  const { address: address2 } = useWallet2();
@@ -1539,10 +1543,10 @@ function useMatchWallet() {
1539
1543
  const showReceiveModal = () => {
1540
1544
  const chainLink = chain.explorerLink("address/" + address2);
1541
1545
  const ReceiveModal = () => {
1542
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: `matchid-receive-modal`, children: [
1543
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "matchid-receive-container", children: [
1544
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: `matchid-receive-text`, children: "Receive by scanning the QR code" }),
1545
- /* @__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)(
1546
1550
  import_react_qrcode.QRCode,
1547
1551
  {
1548
1552
  margin: "0",
@@ -1550,7 +1554,7 @@ function useMatchWallet() {
1550
1554
  value: address2
1551
1555
  }
1552
1556
  ) }),
1553
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
1557
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
1554
1558
  "a",
1555
1559
  {
1556
1560
  href: chainLink,
@@ -1560,7 +1564,7 @@ function useMatchWallet() {
1560
1564
  }
1561
1565
  )
1562
1566
  ] }),
1563
- /* @__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" })
1564
1568
  ] });
1565
1569
  };
1566
1570
  modal.open({
@@ -1578,8 +1582,9 @@ function useMatchWalletRecords({
1578
1582
  const [hasMore, setHasMore] = (0, import_react33.useState)(true);
1579
1583
  const [items, setItems] = (0, import_react33.useState)([]);
1580
1584
  const { chainId } = useMatchChain();
1585
+ const hasMoreRef = (0, import_react33.useRef)(hasMore);
1581
1586
  const fetchMoreData = async () => {
1582
- if (!hasMore) {
1587
+ if (!hasMoreRef.current) {
1583
1588
  return;
1584
1589
  }
1585
1590
  const chainIdStr = chainId ? chainId.toString() : "";
@@ -1592,12 +1597,14 @@ function useMatchWalletRecords({
1592
1597
  if (res.data && res.data.transactions.length > 0) {
1593
1598
  setItems(items.concat(res.data.transactions));
1594
1599
  }
1600
+ hasMoreRef.current = res.data && res.data.transactions.length >= pageSize;
1595
1601
  setHasMore(res.data && res.data.transactions.length >= pageSize);
1596
1602
  }
1597
1603
  };
1598
1604
  const onInit = async () => {
1599
1605
  setItems([]);
1600
1606
  setHasMore(true);
1607
+ hasMoreRef.current = true;
1601
1608
  fetchMoreData();
1602
1609
  };
1603
1610
  (0, import_react33.useEffect)(() => {
@@ -1756,6 +1763,151 @@ function useReceipt({
1756
1763
  }, [query.data]);
1757
1764
  return query;
1758
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
+ }
1759
1911
  // Annotate the CommonJS export names for ESM import in node:
1760
1912
  0 && (module.exports = {
1761
1913
  useCopyClipboard,
@@ -1767,6 +1919,7 @@ function useReceipt({
1767
1919
  useModal,
1768
1920
  useReceipt,
1769
1921
  useToast,
1922
+ useTransaction,
1770
1923
  useUserInfo,
1771
1924
  useWallet
1772
1925
  });