@matchain/matchid-sdk-react 0.1.53-alpha.7 → 0.1.53-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icon/index.js +35 -0
- package/dist/assets/icon/index.js.map +1 -1
- package/dist/assets/icon/index.mjs +3 -1
- package/dist/{chunk-3USZ4ZZY.mjs → chunk-FKXS2XRG.mjs} +96 -2
- package/dist/chunk-FKXS2XRG.mjs.map +1 -0
- package/dist/{chunk-OCQ2AIM3.mjs → chunk-IZOOVZAD.mjs} +5 -5
- package/dist/chunk-IZOOVZAD.mjs.map +1 -0
- package/dist/{chunk-W7CCPGOT.mjs → chunk-NCVBLRAJ.mjs} +310 -123
- package/dist/chunk-NCVBLRAJ.mjs.map +1 -0
- package/dist/{chunk-AYMVU44P.mjs → chunk-X5HGL3ZX.mjs} +2 -2
- package/dist/components/index.js +625 -406
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +7 -5
- package/dist/hooks/api/index.js +209 -92
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +5 -5
- package/dist/hooks/index.js +274 -256
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.css +9 -1
- package/dist/index.js +835 -524
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -10
- package/dist/ui/index.js +68 -65
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +2 -2
- package/dist/utils/index.js +4 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/example/package.json +3 -1
- package/example/src/pages/Contact/index.tsx +89 -3
- package/package.json +1 -1
- package/dist/assets/icon/index.d.mts +0 -147
- package/dist/assets/icon/index.d.ts +0 -147
- package/dist/chunk-3USZ4ZZY.mjs.map +0 -1
- package/dist/chunk-OCQ2AIM3.mjs.map +0 -1
- package/dist/chunk-W7CCPGOT.mjs.map +0 -1
- package/dist/components/index.d.mts +0 -6
- package/dist/components/index.d.ts +0 -6
- package/dist/config/chains/index.d.mts +0 -2
- package/dist/config/chains/index.d.ts +0 -2
- package/dist/hooks/api/index.d.mts +0 -5
- package/dist/hooks/api/index.d.ts +0 -5
- package/dist/hooks/index.d.mts +0 -10
- package/dist/hooks/index.d.ts +0 -10
- package/dist/index-BIvPr81B.d.ts +0 -160
- package/dist/index-BXNFULAw.d.mts +0 -117
- package/dist/index-BkWS_v10.d.mts +0 -3324
- package/dist/index-C2-EMz0t.d.ts +0 -78
- package/dist/index-CZHjwqDb.d.ts +0 -26
- package/dist/index-DDCyj-Fl.d.ts +0 -117
- package/dist/index-DKFnMFMm.d.mts +0 -78
- package/dist/index-DXRGMAbv.d.mts +0 -83
- package/dist/index-DXRGMAbv.d.ts +0 -83
- package/dist/index-DYkN9eDY.d.mts +0 -26
- package/dist/index-TVbqpk9T.d.mts +0 -160
- package/dist/index-TsJwrYwh.d.mts +0 -67
- package/dist/index-tFT-63LO.d.ts +0 -3324
- package/dist/index-uhLehOUk.d.ts +0 -67
- package/dist/index.d.mts +0 -38
- package/dist/index.d.ts +0 -38
- package/dist/types/index.d.mts +0 -3
- package/dist/types/index.d.ts +0 -3
- package/dist/types-i_ugbm5B.d.mts +0 -429
- package/dist/types-i_ugbm5B.d.ts +0 -429
- package/dist/ui/index.d.mts +0 -7
- package/dist/ui/index.d.ts +0 -7
- package/dist/utils/index.d.mts +0 -28
- package/dist/utils/index.d.ts +0 -28
- /package/dist/{chunk-AYMVU44P.mjs.map → chunk-X5HGL3ZX.mjs.map} +0 -0
package/dist/hooks/index.js
CHANGED
|
@@ -293,6 +293,13 @@ var tgAppLoginInitApi = () => {
|
|
|
293
293
|
method: "GET"
|
|
294
294
|
});
|
|
295
295
|
};
|
|
296
|
+
var userInviteApi = (data) => {
|
|
297
|
+
return request_default({
|
|
298
|
+
url: `/api/v1/user/invite`,
|
|
299
|
+
method: "POST",
|
|
300
|
+
data
|
|
301
|
+
});
|
|
302
|
+
};
|
|
296
303
|
|
|
297
304
|
// src/store/useLocalStore.ts
|
|
298
305
|
var persistedState = (0, import_middleware.persist)(
|
|
@@ -349,10 +356,10 @@ var localStore = useLocalStore;
|
|
|
349
356
|
var useLocalStore_default = useLocalStore;
|
|
350
357
|
|
|
351
358
|
// src/hooks/useUserInfo.tsx
|
|
352
|
-
var
|
|
359
|
+
var import_react35 = require("react");
|
|
353
360
|
|
|
354
361
|
// src/MatchContext.tsx
|
|
355
|
-
var
|
|
362
|
+
var import_react34 = require("react");
|
|
356
363
|
|
|
357
364
|
// src/store/useModalStore.ts
|
|
358
365
|
var import_zustand2 = require("zustand");
|
|
@@ -617,6 +624,9 @@ var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
|
617
624
|
// src/assets/icon/PhantomIcon.tsx
|
|
618
625
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
619
626
|
|
|
627
|
+
// src/assets/icon/MoreIcon.tsx
|
|
628
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
629
|
+
|
|
620
630
|
// src/hooks/useLayout.tsx
|
|
621
631
|
var useLayout_exports = {};
|
|
622
632
|
__export(useLayout_exports, {
|
|
@@ -638,7 +648,7 @@ function useDownMd() {
|
|
|
638
648
|
}
|
|
639
649
|
|
|
640
650
|
// src/hooks/useConfig.tsx
|
|
641
|
-
var
|
|
651
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
642
652
|
var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
643
653
|
|
|
644
654
|
// src/store/useModalStore.ts
|
|
@@ -685,7 +695,7 @@ var import_react6 = require("react");
|
|
|
685
695
|
|
|
686
696
|
// src/ui/Overlay/index.tsx
|
|
687
697
|
var import_react2 = require("react");
|
|
688
|
-
var
|
|
698
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
689
699
|
function Overlay({
|
|
690
700
|
isOpen = false,
|
|
691
701
|
children,
|
|
@@ -701,7 +711,7 @@ function Overlay({
|
|
|
701
711
|
document.body.style.overflow = "";
|
|
702
712
|
};
|
|
703
713
|
}, [isOpen]);
|
|
704
|
-
return isOpen ? /* @__PURE__ */ (0,
|
|
714
|
+
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
705
715
|
"div",
|
|
706
716
|
{
|
|
707
717
|
className: "matchid-overlay",
|
|
@@ -710,11 +720,11 @@ function Overlay({
|
|
|
710
720
|
},
|
|
711
721
|
children
|
|
712
722
|
}
|
|
713
|
-
) : /* @__PURE__ */ (0,
|
|
723
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, {});
|
|
714
724
|
}
|
|
715
725
|
|
|
716
726
|
// src/ui/Modal/index.tsx
|
|
717
|
-
var
|
|
727
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
718
728
|
function Modal({
|
|
719
729
|
children,
|
|
720
730
|
isOpen,
|
|
@@ -722,10 +732,10 @@ function Modal({
|
|
|
722
732
|
zIndex = 100,
|
|
723
733
|
className = ""
|
|
724
734
|
}) {
|
|
725
|
-
return /* @__PURE__ */ (0,
|
|
735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Overlay, { isOpen, zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: `matchid-modal ${className}`, style: {
|
|
726
736
|
width
|
|
727
737
|
}, children: [
|
|
728
|
-
/* @__PURE__ */ (0,
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "matchid-modal-mobile-header" }),
|
|
729
739
|
children
|
|
730
740
|
] }) });
|
|
731
741
|
}
|
|
@@ -739,13 +749,13 @@ function ModalWithHeader({
|
|
|
739
749
|
...props
|
|
740
750
|
}) {
|
|
741
751
|
const isDownMd = useDownMd();
|
|
742
|
-
return /* @__PURE__ */ (0,
|
|
743
|
-
/* @__PURE__ */ (0,
|
|
744
|
-
/* @__PURE__ */ (0,
|
|
745
|
-
onBack && /* @__PURE__ */ (0,
|
|
746
|
-
/* @__PURE__ */ (0,
|
|
752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Modal, { ...props, children: [
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: `matchid-modal-header ${showBorder ? "matchid-modal-header-border" : ""}`, children: [
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "matchid-modal-header-content", children: [
|
|
755
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowLeftIcon, { height: isDownMd ? 20 : 25, width: isDownMd ? 20 : 24, className: "matchid-modal-header-back", onClick: onBack }),
|
|
756
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "matchid-modal-header-title", children: title })
|
|
747
757
|
] }),
|
|
748
|
-
onClose && /* @__PURE__ */ (0,
|
|
758
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CloseRoundIcon, { size: isDownMd ? 24 : 30, className: "matchid-modal-header-close", onClick: onClose })
|
|
749
759
|
] }),
|
|
750
760
|
children
|
|
751
761
|
] });
|
|
@@ -756,7 +766,7 @@ var import_react4 = require("react");
|
|
|
756
766
|
|
|
757
767
|
// src/utils/index.tsx
|
|
758
768
|
var import_moment = __toESM(require("moment"));
|
|
759
|
-
var
|
|
769
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
760
770
|
var getVersion = () => {
|
|
761
771
|
return "0.0.2";
|
|
762
772
|
};
|
|
@@ -788,10 +798,10 @@ var NumberFormatter = ({
|
|
|
788
798
|
const [intPart, decimalPart] = numberValue.toString().split(".");
|
|
789
799
|
const intFormat = separator ? intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : intPart;
|
|
790
800
|
if (Math.abs(parseFloat(numberValue)) >= 1) {
|
|
791
|
-
return /* @__PURE__ */ (0,
|
|
792
|
-
prefix && /* @__PURE__ */ (0,
|
|
793
|
-
/* @__PURE__ */ (0,
|
|
794
|
-
decimalPart ? /* @__PURE__ */ (0,
|
|
801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className, children: [
|
|
802
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: prefixClassName, children: prefix }),
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: intClassName, children: intFormat }),
|
|
804
|
+
decimalPart ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: decimalClassName, children: [
|
|
795
805
|
".",
|
|
796
806
|
decimalPart.substring(0, fixNum)
|
|
797
807
|
] }) : "",
|
|
@@ -808,30 +818,30 @@ var NumberFormatter = ({
|
|
|
808
818
|
}
|
|
809
819
|
}
|
|
810
820
|
if (zeroCount < tFixNum) {
|
|
811
|
-
return /* @__PURE__ */ (0,
|
|
812
|
-
prefix && /* @__PURE__ */ (0,
|
|
813
|
-
/* @__PURE__ */ (0,
|
|
814
|
-
/* @__PURE__ */ (0,
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className, children: [
|
|
822
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: prefixClassName, children: prefix }),
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: intClassName, children: intFormat }),
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: decimalClassName, children: [
|
|
815
825
|
".",
|
|
816
826
|
decimalPart.substring(0, tFixNum)
|
|
817
827
|
] }),
|
|
818
828
|
suffix
|
|
819
829
|
] });
|
|
820
830
|
}
|
|
821
|
-
return /* @__PURE__ */ (0,
|
|
822
|
-
prefix && /* @__PURE__ */ (0,
|
|
823
|
-
/* @__PURE__ */ (0,
|
|
824
|
-
/* @__PURE__ */ (0,
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className, children: [
|
|
832
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: prefixClassName, children: prefix }),
|
|
833
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: intClassName, children: intFormat }),
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: decimalClassName, children: [
|
|
825
835
|
".0",
|
|
826
|
-
/* @__PURE__ */ (0,
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("sub", { children: zeroCount }),
|
|
827
837
|
decimalPart?.substring(zeroCount, zeroCount + tFixNum - 2)
|
|
828
838
|
] }),
|
|
829
839
|
suffix
|
|
830
840
|
] });
|
|
831
841
|
}
|
|
832
|
-
return /* @__PURE__ */ (0,
|
|
833
|
-
prefix && /* @__PURE__ */ (0,
|
|
834
|
-
/* @__PURE__ */ (0,
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className, children: [
|
|
843
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: prefixClassName, children: prefix }),
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: intClassName, children: intPart }),
|
|
835
845
|
suffix
|
|
836
846
|
] });
|
|
837
847
|
};
|
|
@@ -840,7 +850,7 @@ var isInTgApp = () => {
|
|
|
840
850
|
};
|
|
841
851
|
|
|
842
852
|
// src/ui/Button/index.tsx
|
|
843
|
-
var
|
|
853
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
844
854
|
function Button({
|
|
845
855
|
size = "df",
|
|
846
856
|
disabled = false,
|
|
@@ -859,7 +869,7 @@ function Button({
|
|
|
859
869
|
onClick && onClick();
|
|
860
870
|
}
|
|
861
871
|
};
|
|
862
|
-
return /* @__PURE__ */ (0,
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
863
873
|
"button",
|
|
864
874
|
{
|
|
865
875
|
type,
|
|
@@ -869,14 +879,14 @@ function Button({
|
|
|
869
879
|
...style
|
|
870
880
|
},
|
|
871
881
|
onClick: onAction,
|
|
872
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
882
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LoadingIcon_default, { className: "matchid-btn-loading-icon", color: "var(--matchid-btn-loading-color)" }) : children
|
|
873
883
|
}
|
|
874
884
|
);
|
|
875
885
|
}
|
|
876
886
|
|
|
877
887
|
// src/ui/Input/index.tsx
|
|
878
888
|
var import_react3 = require("react");
|
|
879
|
-
var
|
|
889
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
880
890
|
function Input({
|
|
881
891
|
onChange,
|
|
882
892
|
type,
|
|
@@ -886,17 +896,17 @@ function Input({
|
|
|
886
896
|
}) {
|
|
887
897
|
const [inputType, setInputType] = (0, import_react3.useState)(type);
|
|
888
898
|
const isDownMd = useDownMd();
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
890
900
|
"div",
|
|
891
901
|
{
|
|
892
902
|
className: `matchid-input-box ${props.value && props.value.length > 0 ? "matchid-input-has-content" : ""} ${className}`,
|
|
893
903
|
children: [
|
|
894
|
-
/* @__PURE__ */ (0,
|
|
895
|
-
props.value && props.value.length > 0 && /* @__PURE__ */ (0,
|
|
904
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { type: inputType, onChange, ...props, className: "matchid-input-field" }),
|
|
905
|
+
props.value && props.value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "matchid-input-delete-icon", onClick: (e) => {
|
|
896
906
|
if (onChange) {
|
|
897
907
|
onChange({ target: { value: "" } });
|
|
898
908
|
}
|
|
899
|
-
}, children: /* @__PURE__ */ (0,
|
|
909
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
900
910
|
DeleteRoundIcon,
|
|
901
911
|
{
|
|
902
912
|
height: isDownMd ? 16 : 21,
|
|
@@ -904,9 +914,9 @@ function Input({
|
|
|
904
914
|
color: "var(--matchid-input-delete-icon-color)"
|
|
905
915
|
}
|
|
906
916
|
) }),
|
|
907
|
-
type === "password" && /* @__PURE__ */ (0,
|
|
917
|
+
type === "password" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "matchid-input-eye-icon", onClick: () => {
|
|
908
918
|
setInputType(inputType === "password" ? "text" : "password");
|
|
909
|
-
}, children: inputType === "password" ? /* @__PURE__ */ (0,
|
|
919
|
+
}, children: inputType === "password" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CloseEyeIcon, { size: isDownMd ? 16 : 20 }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OpenEyeIcon, { size: isDownMd ? 16 : 20 }) }),
|
|
910
920
|
after
|
|
911
921
|
]
|
|
912
922
|
}
|
|
@@ -914,7 +924,7 @@ function Input({
|
|
|
914
924
|
}
|
|
915
925
|
|
|
916
926
|
// src/ui/Field/index.tsx
|
|
917
|
-
var
|
|
927
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
918
928
|
function Field({
|
|
919
929
|
label,
|
|
920
930
|
children,
|
|
@@ -922,19 +932,19 @@ function Field({
|
|
|
922
932
|
required,
|
|
923
933
|
className = ""
|
|
924
934
|
}) {
|
|
925
|
-
return /* @__PURE__ */ (0,
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
927
|
-
required && /* @__PURE__ */ (0,
|
|
935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: `matchid-field-box ${className}`, children: [
|
|
936
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "matchid-field-label", children: [
|
|
937
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "matchid-field-required", children: "*" }),
|
|
928
938
|
label
|
|
929
939
|
] }),
|
|
930
940
|
children,
|
|
931
|
-
error && /* @__PURE__ */ (0,
|
|
941
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "matchid-field-error", children: error })
|
|
932
942
|
] });
|
|
933
943
|
}
|
|
934
944
|
|
|
935
945
|
// src/components/EmailModal/StepEmail.tsx
|
|
936
946
|
var import_react_intl = require("react-intl");
|
|
937
|
-
var
|
|
947
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
938
948
|
|
|
939
949
|
// src/components/EmailModal/StepVerify.tsx
|
|
940
950
|
var import_react5 = require("react");
|
|
@@ -944,15 +954,15 @@ var NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
|
944
954
|
|
|
945
955
|
// src/components/EmailModal/StepVerify.tsx
|
|
946
956
|
var import_react_intl2 = require("react-intl");
|
|
947
|
-
var
|
|
957
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
948
958
|
|
|
949
959
|
// src/components/EmailModal/index.tsx
|
|
950
960
|
var import_react_intl3 = require("react-intl");
|
|
951
|
-
var
|
|
961
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
952
962
|
|
|
953
963
|
// src/ui/Popover/index.tsx
|
|
954
964
|
var import_react7 = require("react");
|
|
955
|
-
var
|
|
965
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
956
966
|
|
|
957
967
|
// src/components/LoginBox/index.tsx
|
|
958
968
|
var import_react8 = require("react");
|
|
@@ -962,39 +972,39 @@ var import_react_intl4 = require("react-intl");
|
|
|
962
972
|
var import_react_query = require("@tanstack/react-query");
|
|
963
973
|
|
|
964
974
|
// src/components/LoginBox/index.tsx
|
|
965
|
-
var
|
|
975
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
966
976
|
|
|
967
977
|
// src/components/LoginButton/index.tsx
|
|
968
978
|
var import_react10 = require("react");
|
|
969
979
|
|
|
970
980
|
// src/components/LoginPanel/index.tsx
|
|
971
981
|
var import_react_intl5 = require("react-intl");
|
|
972
|
-
var
|
|
982
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
973
983
|
|
|
974
984
|
// src/components/LoginModal/index.tsx
|
|
975
|
-
var
|
|
985
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
976
986
|
|
|
977
987
|
// src/components/UserPopover/index.tsx
|
|
978
988
|
var import_react9 = require("react");
|
|
979
989
|
|
|
980
990
|
// src/assets/icon/ProfileIcon.tsx
|
|
981
|
-
var
|
|
991
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
982
992
|
|
|
983
993
|
// src/components/UserPopover/index.tsx
|
|
984
994
|
var import_react_intl6 = require("react-intl");
|
|
985
|
-
var
|
|
995
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
986
996
|
|
|
987
997
|
// src/components/LoginButton/index.tsx
|
|
988
998
|
var import_react_intl7 = require("react-intl");
|
|
989
|
-
var
|
|
999
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
990
1000
|
|
|
991
1001
|
// src/components/UsernameModal/index.tsx
|
|
992
1002
|
var import_react11 = require("react");
|
|
993
1003
|
var import_react_intl8 = require("react-intl");
|
|
994
|
-
var
|
|
1004
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
995
1005
|
|
|
996
1006
|
// src/ui/Drawer/index.tsx
|
|
997
|
-
var
|
|
1007
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
998
1008
|
function Drawer({
|
|
999
1009
|
children,
|
|
1000
1010
|
showClose = true,
|
|
@@ -1005,15 +1015,15 @@ function Drawer({
|
|
|
1005
1015
|
onBack
|
|
1006
1016
|
}) {
|
|
1007
1017
|
if (!isOpen) {
|
|
1008
|
-
return /* @__PURE__ */ (0,
|
|
1018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, {});
|
|
1009
1019
|
}
|
|
1010
|
-
return /* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
onBack && /* @__PURE__ */ (0,
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Overlay, { isOpen, zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "matchid-drawer", children: [
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `matchid-drawer-header matchid-flex`, children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `matchid-drawer-header-content matchid-flex`, children: [
|
|
1023
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ArrowLeftIcon, { height: 25, width: 24, className: "matchid-drawer-header-back", onClick: onBack }),
|
|
1014
1024
|
title
|
|
1015
1025
|
] }),
|
|
1016
|
-
showClose && /* @__PURE__ */ (0,
|
|
1026
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(CloseRoundIcon, { className: "matchid-drawer-header-close", onClick: onClose })
|
|
1017
1027
|
] }),
|
|
1018
1028
|
children
|
|
1019
1029
|
] }) });
|
|
@@ -1023,7 +1033,7 @@ function Drawer({
|
|
|
1023
1033
|
var import_react12 = require("react");
|
|
1024
1034
|
|
|
1025
1035
|
// src/ui/ModalDrawer/index.tsx
|
|
1026
|
-
var
|
|
1036
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
1027
1037
|
function ModalDrawer({
|
|
1028
1038
|
title,
|
|
1029
1039
|
drawerTitleVisible = true,
|
|
@@ -1031,9 +1041,9 @@ function ModalDrawer({
|
|
|
1031
1041
|
}) {
|
|
1032
1042
|
const isDownMd = useDownMd();
|
|
1033
1043
|
if (isDownMd) {
|
|
1034
|
-
return /* @__PURE__ */ (0,
|
|
1044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ModalWithHeader, { ...props, title });
|
|
1035
1045
|
}
|
|
1036
|
-
return /* @__PURE__ */ (0,
|
|
1046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Drawer, { ...props, title: drawerTitleVisible ? title : null });
|
|
1037
1047
|
}
|
|
1038
1048
|
|
|
1039
1049
|
// src/assets/img/confirm.gif
|
|
@@ -1089,7 +1099,7 @@ function useHash({
|
|
|
1089
1099
|
}
|
|
1090
1100
|
|
|
1091
1101
|
// src/ui/HashPanel/index.tsx
|
|
1092
|
-
var
|
|
1102
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
1093
1103
|
function HashPanel({
|
|
1094
1104
|
hash,
|
|
1095
1105
|
chain,
|
|
@@ -1148,14 +1158,14 @@ function HashPanel({
|
|
|
1148
1158
|
}
|
|
1149
1159
|
}, [hashQuery.data]);
|
|
1150
1160
|
const link = chain ? `${chain?.blockExplorers?.default.url}/tx/${hash}` : "";
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
1152
1162
|
ModalDrawer,
|
|
1153
1163
|
{
|
|
1154
1164
|
isOpen,
|
|
1155
1165
|
showClose: true,
|
|
1156
1166
|
onClose,
|
|
1157
1167
|
zIndex,
|
|
1158
|
-
title: /* @__PURE__ */ (0,
|
|
1168
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
1159
1169
|
"div",
|
|
1160
1170
|
{
|
|
1161
1171
|
className: "matchid-hashpanel-header",
|
|
@@ -1165,32 +1175,32 @@ function HashPanel({
|
|
|
1165
1175
|
children: statusValue.text
|
|
1166
1176
|
}
|
|
1167
1177
|
),
|
|
1168
|
-
children: /* @__PURE__ */ (0,
|
|
1169
|
-
/* @__PURE__ */ (0,
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "matchid-hashpanel-box", children: [
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "matchid-hashpanel-content", children: [
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: `matchid-hashpanel-status`, style: {
|
|
1171
1181
|
color: statusValue.color
|
|
1172
1182
|
}, children: statusValue.text }),
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1174
|
-
hash && /* @__PURE__ */ (0,
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("img", { src: statusValue.icon, alt: statusValue.text, className: `matchid-hashpanel-img` }),
|
|
1184
|
+
hash && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "matchid-hashpanel-hash", children: [
|
|
1175
1185
|
"Hash:",
|
|
1176
|
-
/* @__PURE__ */ (0,
|
|
1186
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("a", { href: link, target: "_blank", children: hash })
|
|
1177
1187
|
] })
|
|
1178
1188
|
] }),
|
|
1179
|
-
/* @__PURE__ */ (0,
|
|
1189
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { onClick: onClose, size: "lg", block: true, children: "Back" })
|
|
1180
1190
|
] })
|
|
1181
1191
|
}
|
|
1182
1192
|
);
|
|
1183
1193
|
}
|
|
1184
1194
|
function HashPanel_default(props) {
|
|
1185
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
1195
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(HashPanel, { ...props });
|
|
1186
1196
|
}
|
|
1187
1197
|
|
|
1188
1198
|
// src/ui/Switch/index.tsx
|
|
1189
|
-
var
|
|
1199
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
1190
1200
|
|
|
1191
1201
|
// src/ui/AlphaAvatar/index.tsx
|
|
1192
1202
|
var import_react13 = require("react");
|
|
1193
|
-
var
|
|
1203
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
1194
1204
|
function AlphaAvatar({
|
|
1195
1205
|
name,
|
|
1196
1206
|
size = "default",
|
|
@@ -1207,7 +1217,7 @@ function AlphaAvatar({
|
|
|
1207
1217
|
return "";
|
|
1208
1218
|
}, [name]);
|
|
1209
1219
|
const numberSize = typeof size === "number" ? size : size === "sm" ? 24 : size === "default" ? 40 : 64;
|
|
1210
|
-
return /* @__PURE__ */ (0,
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
1211
1221
|
width: numberSize,
|
|
1212
1222
|
height: numberSize,
|
|
1213
1223
|
fontSize: Math.ceil(numberSize / 2),
|
|
@@ -1216,7 +1226,7 @@ function AlphaAvatar({
|
|
|
1216
1226
|
}
|
|
1217
1227
|
|
|
1218
1228
|
// src/ui/Radio/index.tsx
|
|
1219
|
-
var
|
|
1229
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
1220
1230
|
function Radio({
|
|
1221
1231
|
checked = false,
|
|
1222
1232
|
onChange,
|
|
@@ -1225,23 +1235,23 @@ function Radio({
|
|
|
1225
1235
|
className = "",
|
|
1226
1236
|
style = {}
|
|
1227
1237
|
}) {
|
|
1228
|
-
return /* @__PURE__ */ (0,
|
|
1238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { onClick: onChange, className: `matchid-radio ${className} ${checked ? "matchid-radio-checked" : ""}`, style: {
|
|
1229
1239
|
width: size,
|
|
1230
1240
|
height: size,
|
|
1231
1241
|
...style,
|
|
1232
1242
|
// @ts-ignore
|
|
1233
1243
|
"--matchid-radio-checked": color
|
|
1234
|
-
}, children: checked && /* @__PURE__ */ (0,
|
|
1244
|
+
}, children: checked && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: `matchid-radio-content`, style: {
|
|
1235
1245
|
width: Math.floor(size * 0.7),
|
|
1236
1246
|
height: Math.floor(size * 0.7)
|
|
1237
1247
|
} }) });
|
|
1238
1248
|
}
|
|
1239
1249
|
|
|
1240
1250
|
// src/ui/Skeleton/index.tsx
|
|
1241
|
-
var
|
|
1251
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
1242
1252
|
|
|
1243
1253
|
// src/ui/Tabs/index.tsx
|
|
1244
|
-
var
|
|
1254
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
1245
1255
|
|
|
1246
1256
|
// src/components/EVMModal/index.tsx
|
|
1247
1257
|
var import_react16 = require("react");
|
|
@@ -1279,7 +1289,7 @@ var import_react_intl9 = require("react-intl");
|
|
|
1279
1289
|
|
|
1280
1290
|
// src/components/WalletModalContent/index.tsx
|
|
1281
1291
|
var import_react14 = require("react");
|
|
1282
|
-
var
|
|
1292
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
1283
1293
|
|
|
1284
1294
|
// src/components/EVMModal/index.tsx
|
|
1285
1295
|
var import_chains = require("wagmi/chains");
|
|
@@ -1360,7 +1370,7 @@ var import_ethers = require("ethers");
|
|
|
1360
1370
|
// src/components/EVMModal/index.tsx
|
|
1361
1371
|
var import_siwe = require("siwe");
|
|
1362
1372
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
1363
|
-
var
|
|
1373
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
1364
1374
|
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
1365
1375
|
appName: "MatchID",
|
|
1366
1376
|
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
@@ -1387,13 +1397,13 @@ var import_react_intl10 = require("react-intl");
|
|
|
1387
1397
|
var import_react17 = require("react");
|
|
1388
1398
|
|
|
1389
1399
|
// src/components/TRONModal/index.tsx
|
|
1390
|
-
var
|
|
1400
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
1391
1401
|
|
|
1392
1402
|
// src/components/TONModal/index.tsx
|
|
1393
1403
|
var import_react19 = __toESM(require("react"));
|
|
1394
1404
|
var import_react_intl11 = require("react-intl");
|
|
1395
1405
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
1396
|
-
var
|
|
1406
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
1397
1407
|
|
|
1398
1408
|
// src/components/BTCModal/index.tsx
|
|
1399
1409
|
var import_react21 = __toESM(require("react"));
|
|
@@ -1406,16 +1416,16 @@ var import_sats_connect = require("sats-connect");
|
|
|
1406
1416
|
var import_react20 = require("react");
|
|
1407
1417
|
|
|
1408
1418
|
// src/components/BTCModal/index.tsx
|
|
1409
|
-
var
|
|
1419
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
1410
1420
|
|
|
1411
1421
|
// src/components/WalletModal/index.tsx
|
|
1412
1422
|
var import_react22 = require("react");
|
|
1413
1423
|
var import_react_intl13 = require("react-intl");
|
|
1414
|
-
var
|
|
1424
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
1415
1425
|
|
|
1416
1426
|
// src/components/AlphaAvatar/index.tsx
|
|
1417
1427
|
var import_react23 = require("react");
|
|
1418
|
-
var
|
|
1428
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
1419
1429
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
1420
1430
|
const [avatar, setAvatar] = (0, import_react23.useState)(void 0);
|
|
1421
1431
|
(0, import_react23.useEffect)(() => {
|
|
@@ -1424,7 +1434,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
1424
1434
|
setAvatar(char);
|
|
1425
1435
|
}
|
|
1426
1436
|
}, [name]);
|
|
1427
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
1428
1438
|
width: size,
|
|
1429
1439
|
height: size,
|
|
1430
1440
|
fontSize: Math.ceil(size / 2)
|
|
@@ -1432,13 +1442,13 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
1432
1442
|
}
|
|
1433
1443
|
|
|
1434
1444
|
// src/components/WalletAsset/index.tsx
|
|
1435
|
-
var
|
|
1445
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
1436
1446
|
|
|
1437
1447
|
// src/components/TokenSend/index.tsx
|
|
1438
1448
|
var import_react24 = require("react");
|
|
1439
1449
|
var import_viem4 = require("viem");
|
|
1440
1450
|
var import_react_intl14 = require("react-intl");
|
|
1441
|
-
var
|
|
1451
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
1442
1452
|
function Input2({
|
|
1443
1453
|
onChange,
|
|
1444
1454
|
placeholder,
|
|
@@ -1448,8 +1458,8 @@ function Input2({
|
|
|
1448
1458
|
error,
|
|
1449
1459
|
size = "df"
|
|
1450
1460
|
}) {
|
|
1451
|
-
return /* @__PURE__ */ (0,
|
|
1452
|
-
/* @__PURE__ */ (0,
|
|
1461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1453
1463
|
"input",
|
|
1454
1464
|
{
|
|
1455
1465
|
placeholder,
|
|
@@ -1460,7 +1470,7 @@ function Input2({
|
|
|
1460
1470
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
1461
1471
|
}
|
|
1462
1472
|
),
|
|
1463
|
-
error && /* @__PURE__ */ (0,
|
|
1473
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-token-input-error-text", children: error })
|
|
1464
1474
|
] });
|
|
1465
1475
|
}
|
|
1466
1476
|
function TokenSend({
|
|
@@ -1588,24 +1598,24 @@ function TokenSend({
|
|
|
1588
1598
|
window.removeEventListener("message", receiveMessage);
|
|
1589
1599
|
};
|
|
1590
1600
|
}, []);
|
|
1591
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1597
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
1601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "send" }), onBack, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-send-box`, children: [
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-content`, children: [
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-header`, children: [
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "amount" }) }),
|
|
1606
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-chain`, children: [
|
|
1607
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1598
1608
|
"img",
|
|
1599
1609
|
{
|
|
1600
1610
|
src: token?.icon,
|
|
1601
1611
|
alt: token?.symbol,
|
|
1602
1612
|
className: `matchid-token-amount-chain-icon`
|
|
1603
1613
|
}
|
|
1604
|
-
) : /* @__PURE__ */ (0,
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1614
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: token?.symbol })
|
|
1606
1616
|
] })
|
|
1607
1617
|
] }),
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1618
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1609
1619
|
Input2,
|
|
1610
1620
|
{
|
|
1611
1621
|
type: "text",
|
|
@@ -1618,18 +1628,18 @@ function TokenSend({
|
|
|
1618
1628
|
error: error.amount || txError
|
|
1619
1629
|
}
|
|
1620
1630
|
),
|
|
1621
|
-
/* @__PURE__ */ (0,
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-footer`, children: [
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-amount-title`, children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "balance" }),
|
|
1624
1634
|
":"
|
|
1625
1635
|
] }),
|
|
1626
|
-
/* @__PURE__ */ (0,
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
1627
1637
|
] }),
|
|
1628
|
-
/* @__PURE__ */ (0,
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
1629
1639
|
] }),
|
|
1630
|
-
/* @__PURE__ */ (0,
|
|
1631
|
-
/* @__PURE__ */ (0,
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `matchid-token-address-content`, children: [
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "receiveTitle" }) }) }),
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1633
1643
|
Input2,
|
|
1634
1644
|
{
|
|
1635
1645
|
type: "text",
|
|
@@ -1645,7 +1655,7 @@ function TokenSend({
|
|
|
1645
1655
|
)
|
|
1646
1656
|
] })
|
|
1647
1657
|
] }),
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1649
1659
|
Button,
|
|
1650
1660
|
{
|
|
1651
1661
|
size: "lg",
|
|
@@ -1654,7 +1664,7 @@ function TokenSend({
|
|
|
1654
1664
|
disabled: !canSend || !!txError,
|
|
1655
1665
|
onClick: onNext,
|
|
1656
1666
|
loading: loading || sending,
|
|
1657
|
-
children: /* @__PURE__ */ (0,
|
|
1667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "next" })
|
|
1658
1668
|
}
|
|
1659
1669
|
)
|
|
1660
1670
|
] }) });
|
|
@@ -1662,12 +1672,12 @@ function TokenSend({
|
|
|
1662
1672
|
|
|
1663
1673
|
// src/components/TokenDetail/index.tsx
|
|
1664
1674
|
var import_react_intl15 = require("react-intl");
|
|
1665
|
-
var
|
|
1675
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
1666
1676
|
|
|
1667
1677
|
// src/components/TokenSendList/index.tsx
|
|
1668
1678
|
var import_react25 = require("react");
|
|
1669
1679
|
var import_react_intl16 = require("react-intl");
|
|
1670
|
-
var
|
|
1680
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
1671
1681
|
function TokenSendList({ close }) {
|
|
1672
1682
|
const isDownMd = useDownMd();
|
|
1673
1683
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -1679,16 +1689,16 @@ function TokenSendList({ close }) {
|
|
|
1679
1689
|
const modal = useModal();
|
|
1680
1690
|
const onNext = () => {
|
|
1681
1691
|
checked && modal.show((props) => {
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TokenSend, { onClose: () => {
|
|
1683
1693
|
props.close();
|
|
1684
1694
|
close();
|
|
1685
1695
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
1686
1696
|
});
|
|
1687
1697
|
};
|
|
1688
|
-
return /* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-list-box", children: [
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
1690
1700
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
1692
1702
|
"div",
|
|
1693
1703
|
{
|
|
1694
1704
|
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
@@ -1696,10 +1706,10 @@ function TokenSendList({ close }) {
|
|
|
1696
1706
|
setChecked(n);
|
|
1697
1707
|
},
|
|
1698
1708
|
children: [
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
/* @__PURE__ */ (0,
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1702
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-token-send-logo", children: [
|
|
1712
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
1703
1713
|
AlphaAvatar2,
|
|
1704
1714
|
{
|
|
1705
1715
|
className: `matchid-token-send-icon`,
|
|
@@ -1707,7 +1717,7 @@ function TokenSendList({ close }) {
|
|
|
1707
1717
|
name: n.symbol || n.name || ""
|
|
1708
1718
|
}
|
|
1709
1719
|
),
|
|
1710
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
1720
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
1711
1721
|
"img",
|
|
1712
1722
|
{
|
|
1713
1723
|
src: chain.iconUrl,
|
|
@@ -1716,9 +1726,9 @@ function TokenSendList({ close }) {
|
|
|
1716
1726
|
}
|
|
1717
1727
|
)
|
|
1718
1728
|
] }),
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1720
|
-
/* @__PURE__ */ (0,
|
|
1721
|
-
/* @__PURE__ */ (0,
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-token-send-info`, children: [
|
|
1730
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
1722
1732
|
] })
|
|
1723
1733
|
] })
|
|
1724
1734
|
]
|
|
@@ -1726,7 +1736,7 @@ function TokenSendList({ close }) {
|
|
|
1726
1736
|
index
|
|
1727
1737
|
);
|
|
1728
1738
|
}) }),
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_intl16.FormattedMessage, { id: "next" }) })
|
|
1730
1740
|
] });
|
|
1731
1741
|
}
|
|
1732
1742
|
|
|
@@ -1794,7 +1804,7 @@ var useContractStore_default = useContractStore;
|
|
|
1794
1804
|
|
|
1795
1805
|
// src/components/TransactionList/index.tsx
|
|
1796
1806
|
var import_react_intl17 = require("react-intl");
|
|
1797
|
-
var
|
|
1807
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
1798
1808
|
|
|
1799
1809
|
// src/hooks/api/bind.ts
|
|
1800
1810
|
var import_react_query3 = require("@tanstack/react-query");
|
|
@@ -1859,18 +1869,20 @@ function useImportTokenListQuery({
|
|
|
1859
1869
|
|
|
1860
1870
|
// src/hooks/api/contact.ts
|
|
1861
1871
|
var import_react_query6 = require("@tanstack/react-query");
|
|
1862
|
-
var import_uniqBy = __toESM(require("lodash/uniqBy"));
|
|
1863
1872
|
var import_last = __toESM(require("lodash/last"));
|
|
1873
|
+
var import_react27 = require("react");
|
|
1864
1874
|
|
|
1865
1875
|
// src/components/ContactList/index.tsx
|
|
1866
1876
|
var import_react_virtuoso = require("react-virtuoso");
|
|
1867
|
-
var
|
|
1868
|
-
|
|
1869
|
-
// src/components/CEXBindModal/index.tsx
|
|
1870
|
-
var import_react27 = require("react");
|
|
1877
|
+
var import_react28 = require("react");
|
|
1871
1878
|
var import_react_intl18 = require("react-intl");
|
|
1872
1879
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
1873
1880
|
|
|
1881
|
+
// src/components/CEXBindModal/index.tsx
|
|
1882
|
+
var import_react29 = require("react");
|
|
1883
|
+
var import_react_intl19 = require("react-intl");
|
|
1884
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
1885
|
+
|
|
1874
1886
|
// src/context/BusinessProvider.tsx
|
|
1875
1887
|
var import_react_query7 = require("@tanstack/react-query");
|
|
1876
1888
|
|
|
@@ -1887,15 +1899,15 @@ var useStore = (0, import_zustand4.create)((set) => ({
|
|
|
1887
1899
|
var useStore_default = useStore;
|
|
1888
1900
|
|
|
1889
1901
|
// src/context/BusinessProvider.tsx
|
|
1890
|
-
var
|
|
1902
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
1891
1903
|
|
|
1892
1904
|
// src/context/ModalContext.tsx
|
|
1893
|
-
var
|
|
1905
|
+
var import_react30 = require("react");
|
|
1894
1906
|
var import_react_dom = require("react-dom");
|
|
1895
|
-
var
|
|
1896
|
-
var ModalContext = (0,
|
|
1907
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
1908
|
+
var ModalContext = (0, import_react30.createContext)(null);
|
|
1897
1909
|
function useModal() {
|
|
1898
|
-
const context = (0,
|
|
1910
|
+
const context = (0, import_react30.useContext)(ModalContext);
|
|
1899
1911
|
if (!context) {
|
|
1900
1912
|
throw new Error("useModal must be used within a ModalProvider");
|
|
1901
1913
|
}
|
|
@@ -1903,12 +1915,12 @@ function useModal() {
|
|
|
1903
1915
|
}
|
|
1904
1916
|
|
|
1905
1917
|
// src/context/ToastContext.tsx
|
|
1906
|
-
var
|
|
1918
|
+
var import_react31 = require("react");
|
|
1907
1919
|
var import_react_dom2 = require("react-dom");
|
|
1908
|
-
var
|
|
1909
|
-
var ToastContext = (0,
|
|
1920
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
1921
|
+
var ToastContext = (0, import_react31.createContext)(null);
|
|
1910
1922
|
function useToast() {
|
|
1911
|
-
const context = (0,
|
|
1923
|
+
const context = (0, import_react31.useContext)(ToastContext);
|
|
1912
1924
|
if (!context) {
|
|
1913
1925
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1914
1926
|
}
|
|
@@ -1916,23 +1928,23 @@ function useToast() {
|
|
|
1916
1928
|
}
|
|
1917
1929
|
|
|
1918
1930
|
// src/context/index.tsx
|
|
1919
|
-
var
|
|
1931
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
1920
1932
|
|
|
1921
1933
|
// src/hooks/useWalletInit.ts
|
|
1922
|
-
var
|
|
1934
|
+
var import_react32 = require("react");
|
|
1923
1935
|
var AppClientId = getAppClientId();
|
|
1924
1936
|
|
|
1925
1937
|
// src/hooks/useInit.tsx
|
|
1926
|
-
var
|
|
1938
|
+
var import_react33 = require("react");
|
|
1927
1939
|
|
|
1928
1940
|
// src/MatchContext.tsx
|
|
1929
1941
|
var import_react_query8 = require("@tanstack/react-query");
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
1942
|
+
var import_react_intl20 = require("react-intl");
|
|
1943
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
1932
1944
|
var queryClient = new import_react_query8.QueryClient();
|
|
1933
|
-
var MatchContext = (0,
|
|
1945
|
+
var MatchContext = (0, import_react34.createContext)(void 0);
|
|
1934
1946
|
var useMatch = () => {
|
|
1935
|
-
const context = (0,
|
|
1947
|
+
const context = (0, import_react34.useContext)(MatchContext);
|
|
1936
1948
|
if (context === void 0) {
|
|
1937
1949
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
1938
1950
|
}
|
|
@@ -1966,7 +1978,7 @@ function useUserInfo() {
|
|
|
1966
1978
|
const getRedirectUri = () => {
|
|
1967
1979
|
return encodeURIComponent(window.location.href);
|
|
1968
1980
|
};
|
|
1969
|
-
const isLogin = (0,
|
|
1981
|
+
const isLogin = (0, import_react35.useMemo)(() => !!token && !!overview, [token, overview]);
|
|
1970
1982
|
const logout = async () => {
|
|
1971
1983
|
try {
|
|
1972
1984
|
await toLogoutApi();
|
|
@@ -2203,6 +2215,11 @@ function useUserInfo() {
|
|
|
2203
2215
|
window.addEventListener("message", authMessageHandle);
|
|
2204
2216
|
});
|
|
2205
2217
|
};
|
|
2218
|
+
const invite = async (invite_code) => {
|
|
2219
|
+
return await userInviteApi({
|
|
2220
|
+
invite_code
|
|
2221
|
+
});
|
|
2222
|
+
};
|
|
2206
2223
|
return {
|
|
2207
2224
|
loginByMethod,
|
|
2208
2225
|
loginByTelegram,
|
|
@@ -2226,14 +2243,15 @@ function useUserInfo() {
|
|
|
2226
2243
|
auth,
|
|
2227
2244
|
login: loginMethod,
|
|
2228
2245
|
bind,
|
|
2229
|
-
getAuthInfo
|
|
2246
|
+
getAuthInfo,
|
|
2247
|
+
invite
|
|
2230
2248
|
};
|
|
2231
2249
|
}
|
|
2232
2250
|
|
|
2233
2251
|
// src/hooks/useMatchEvents.ts
|
|
2234
|
-
var
|
|
2252
|
+
var import_react36 = require("react");
|
|
2235
2253
|
function useMatchEvents(handlers) {
|
|
2236
|
-
(0,
|
|
2254
|
+
(0, import_react36.useEffect)(() => {
|
|
2237
2255
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
2238
2256
|
if (handler2) {
|
|
2239
2257
|
eventManager_default.on(event, handler2);
|
|
@@ -2253,7 +2271,7 @@ function useMatchEvents(handlers) {
|
|
|
2253
2271
|
var import_viem7 = require("viem");
|
|
2254
2272
|
var import_accounts = require("viem/accounts");
|
|
2255
2273
|
var import_viem8 = require("viem");
|
|
2256
|
-
var
|
|
2274
|
+
var import_react37 = require("react");
|
|
2257
2275
|
var import_viem9 = require("viem");
|
|
2258
2276
|
|
|
2259
2277
|
// src/store/useTransactionStore.ts
|
|
@@ -2287,7 +2305,7 @@ var useTransactionStore = (0, import_zustand5.create)((0, import_middleware3.dev
|
|
|
2287
2305
|
var useTransactionStore_default = useTransactionStore;
|
|
2288
2306
|
|
|
2289
2307
|
// src/hooks/useWallet.tsx
|
|
2290
|
-
var
|
|
2308
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
2291
2309
|
var AppClientId2 = "react-sdk-" + getVersion();
|
|
2292
2310
|
function useWallet() {
|
|
2293
2311
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -2338,7 +2356,7 @@ function useWallet() {
|
|
|
2338
2356
|
throw error;
|
|
2339
2357
|
}
|
|
2340
2358
|
};
|
|
2341
|
-
const evmAccount = (0,
|
|
2359
|
+
const evmAccount = (0, import_react37.useMemo)(() => {
|
|
2342
2360
|
try {
|
|
2343
2361
|
return address ? (0, import_accounts.toAccount)({
|
|
2344
2362
|
address,
|
|
@@ -2377,7 +2395,7 @@ function useWallet() {
|
|
|
2377
2395
|
return void 0;
|
|
2378
2396
|
}
|
|
2379
2397
|
}, [address]);
|
|
2380
|
-
(0,
|
|
2398
|
+
(0, import_react37.useEffect)(() => {
|
|
2381
2399
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
2382
2400
|
}, [evmAccount]);
|
|
2383
2401
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -2460,7 +2478,7 @@ function useWallet() {
|
|
|
2460
2478
|
address: evmAccount.address
|
|
2461
2479
|
});
|
|
2462
2480
|
modal.show((props) => {
|
|
2463
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
2464
2482
|
});
|
|
2465
2483
|
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
2466
2484
|
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
@@ -2513,14 +2531,14 @@ function useWallet() {
|
|
|
2513
2531
|
|
|
2514
2532
|
// src/hooks/useCopyClipboard.ts
|
|
2515
2533
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
2516
|
-
var
|
|
2534
|
+
var import_react38 = require("react");
|
|
2517
2535
|
function useCopyClipboard(timeout = 500) {
|
|
2518
|
-
const [isCopied, setIsCopied] = (0,
|
|
2519
|
-
const staticCopy = (0,
|
|
2536
|
+
const [isCopied, setIsCopied] = (0, import_react38.useState)(false);
|
|
2537
|
+
const staticCopy = (0, import_react38.useCallback)((text) => {
|
|
2520
2538
|
const didCopy = (0, import_copy_to_clipboard.default)(text);
|
|
2521
2539
|
setIsCopied(didCopy);
|
|
2522
2540
|
}, []);
|
|
2523
|
-
(0,
|
|
2541
|
+
(0, import_react38.useEffect)(() => {
|
|
2524
2542
|
if (isCopied) {
|
|
2525
2543
|
const hide = setTimeout(() => {
|
|
2526
2544
|
setIsCopied(false);
|
|
@@ -2535,16 +2553,16 @@ function useCopyClipboard(timeout = 500) {
|
|
|
2535
2553
|
}
|
|
2536
2554
|
|
|
2537
2555
|
// src/hooks/useMatchChain.tsx
|
|
2538
|
-
var
|
|
2556
|
+
var import_react39 = require("react");
|
|
2539
2557
|
var import_viem10 = require("viem");
|
|
2540
|
-
var
|
|
2541
|
-
var
|
|
2558
|
+
var import_react_intl21 = require("react-intl");
|
|
2559
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
2542
2560
|
function useMatchChain() {
|
|
2543
2561
|
const chainListQuery = useChainListQuery();
|
|
2544
2562
|
const modal = useModal();
|
|
2545
|
-
const intl = (0,
|
|
2563
|
+
const intl = (0, import_react_intl21.useIntl)();
|
|
2546
2564
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
2547
|
-
const chainId = (0,
|
|
2565
|
+
const chainId = (0, import_react39.useMemo)(() => {
|
|
2548
2566
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2549
2567
|
return null;
|
|
2550
2568
|
}
|
|
@@ -2553,7 +2571,7 @@ function useMatchChain() {
|
|
|
2553
2571
|
}
|
|
2554
2572
|
return chainListQuery.data[0].id;
|
|
2555
2573
|
}, [storeChainId, chainListQuery.data]);
|
|
2556
|
-
const chain = (0,
|
|
2574
|
+
const chain = (0, import_react39.useMemo)(() => {
|
|
2557
2575
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2558
2576
|
return null;
|
|
2559
2577
|
}
|
|
@@ -2567,30 +2585,30 @@ function useMatchChain() {
|
|
|
2567
2585
|
close
|
|
2568
2586
|
}) {
|
|
2569
2587
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
2570
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
2588
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react39.useState)(storeChainId2);
|
|
2571
2589
|
const isDownMd = useDownMd();
|
|
2572
|
-
return /* @__PURE__ */ (0,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
return /* @__PURE__ */ (0,
|
|
2590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-change-network-box`, children: [
|
|
2591
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index) => {
|
|
2592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
2575
2593
|
"div",
|
|
2576
2594
|
{
|
|
2577
2595
|
onClick: () => setSelectedChainId(item.id),
|
|
2578
2596
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
2579
2597
|
children: [
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
2600
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
2583
2601
|
] }),
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
2585
2603
|
]
|
|
2586
2604
|
},
|
|
2587
2605
|
index
|
|
2588
2606
|
);
|
|
2589
2607
|
}) }),
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2608
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
2591
2609
|
setChainId2(selectedChainId || 0);
|
|
2592
2610
|
close();
|
|
2593
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
2611
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl21.FormattedMessage, { id: "confirm" }) })
|
|
2594
2612
|
] });
|
|
2595
2613
|
}
|
|
2596
2614
|
const showChangeNetwork = () => {
|
|
@@ -2599,7 +2617,7 @@ function useMatchChain() {
|
|
|
2599
2617
|
content: ChangeNetwork
|
|
2600
2618
|
});
|
|
2601
2619
|
};
|
|
2602
|
-
const publicClient = (0,
|
|
2620
|
+
const publicClient = (0, import_react39.useMemo)(() => {
|
|
2603
2621
|
if (!chain) {
|
|
2604
2622
|
return null;
|
|
2605
2623
|
}
|
|
@@ -2627,14 +2645,14 @@ function useMatchChain() {
|
|
|
2627
2645
|
|
|
2628
2646
|
// src/hooks/useMatchWallet.tsx
|
|
2629
2647
|
var import_react_qrcode = require("react-qrcode");
|
|
2630
|
-
var
|
|
2648
|
+
var import_react41 = require("react");
|
|
2631
2649
|
var import_react_query11 = require("@tanstack/react-query");
|
|
2632
2650
|
var import_viem13 = require("viem");
|
|
2633
|
-
var
|
|
2651
|
+
var import_react_intl23 = require("react-intl");
|
|
2634
2652
|
|
|
2635
2653
|
// src/components/ImportToken/index.tsx
|
|
2636
|
-
var
|
|
2637
|
-
var
|
|
2654
|
+
var import_react40 = require("react");
|
|
2655
|
+
var import_react_intl22 = require("react-intl");
|
|
2638
2656
|
var import_react_query10 = require("@tanstack/react-query");
|
|
2639
2657
|
var import_viem12 = require("viem");
|
|
2640
2658
|
|
|
@@ -2663,14 +2681,14 @@ function useIsContract({
|
|
|
2663
2681
|
}
|
|
2664
2682
|
|
|
2665
2683
|
// src/components/ImportToken/index.tsx
|
|
2666
|
-
var
|
|
2684
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
2667
2685
|
function ImportToken({ close }) {
|
|
2668
|
-
const [status, setStatus] = (0,
|
|
2686
|
+
const [status, setStatus] = (0, import_react40.useState)("");
|
|
2669
2687
|
const { token } = useUserInfo();
|
|
2670
|
-
const [address, setAddress] = (0,
|
|
2671
|
-
const [symbol, setSymbol] = (0,
|
|
2672
|
-
const [decimals, setDecimals] = (0,
|
|
2673
|
-
const [error, setError] = (0,
|
|
2688
|
+
const [address, setAddress] = (0, import_react40.useState)("");
|
|
2689
|
+
const [symbol, setSymbol] = (0, import_react40.useState)("");
|
|
2690
|
+
const [decimals, setDecimals] = (0, import_react40.useState)("");
|
|
2691
|
+
const [error, setError] = (0, import_react40.useState)({});
|
|
2674
2692
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
2675
2693
|
const getContractInfo = async () => {
|
|
2676
2694
|
if (!publicClient) return;
|
|
@@ -2703,8 +2721,8 @@ function ImportToken({ close }) {
|
|
|
2703
2721
|
});
|
|
2704
2722
|
}
|
|
2705
2723
|
};
|
|
2706
|
-
const intl = (0,
|
|
2707
|
-
(0,
|
|
2724
|
+
const intl = (0, import_react_intl22.useIntl)();
|
|
2725
|
+
(0, import_react40.useEffect)(() => {
|
|
2708
2726
|
if (address.length === 42) {
|
|
2709
2727
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2710
2728
|
if (!reg.test(address)) {
|
|
@@ -2723,7 +2741,7 @@ function ImportToken({ close }) {
|
|
|
2723
2741
|
}
|
|
2724
2742
|
}
|
|
2725
2743
|
}, [address, publicClient]);
|
|
2726
|
-
const [loading, setLoading] = (0,
|
|
2744
|
+
const [loading, setLoading] = (0, import_react40.useState)(false);
|
|
2727
2745
|
const toast = useToast();
|
|
2728
2746
|
const queryClient2 = (0, import_react_query10.useQueryClient)();
|
|
2729
2747
|
const onImport = async () => {
|
|
@@ -2751,7 +2769,7 @@ function ImportToken({ close }) {
|
|
|
2751
2769
|
setLoading(false);
|
|
2752
2770
|
}
|
|
2753
2771
|
};
|
|
2754
|
-
const canImport = (0,
|
|
2772
|
+
const canImport = (0, import_react40.useMemo)(() => {
|
|
2755
2773
|
if (!address) {
|
|
2756
2774
|
return false;
|
|
2757
2775
|
}
|
|
@@ -2774,19 +2792,19 @@ function ImportToken({ close }) {
|
|
|
2774
2792
|
enabled: canImport
|
|
2775
2793
|
});
|
|
2776
2794
|
if (status == "success" || status == "fail") {
|
|
2777
|
-
return /* @__PURE__ */ (0,
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("img", { src: status == "success" ? success_default : fail_default, alt: status == "success" ? "success" : "fail", className: `matchid-import-token-result-img` }),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "importFail" }) })
|
|
2781
2799
|
] }),
|
|
2782
|
-
status == "success" ? /* @__PURE__ */ (0,
|
|
2800
|
+
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "back" }) })
|
|
2783
2801
|
] });
|
|
2784
2802
|
}
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
-
/* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-import-token`, children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "matchid-import-token-form", children: [
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Field, { label: intl.formatMessage({
|
|
2788
2806
|
id: "tokenSmartContract"
|
|
2789
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0,
|
|
2807
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2790
2808
|
Input,
|
|
2791
2809
|
{
|
|
2792
2810
|
placeholder: intl.formatMessage({
|
|
@@ -2797,9 +2815,9 @@ function ImportToken({ close }) {
|
|
|
2797
2815
|
maxLength: 42
|
|
2798
2816
|
}
|
|
2799
2817
|
) }),
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Field, { label: intl.formatMessage({
|
|
2801
2819
|
id: "tokenSymbol"
|
|
2802
|
-
}), error: error.symbol, children: /* @__PURE__ */ (0,
|
|
2820
|
+
}), error: error.symbol, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2803
2821
|
Input,
|
|
2804
2822
|
{
|
|
2805
2823
|
placeholder: intl.formatMessage({
|
|
@@ -2810,9 +2828,9 @@ function ImportToken({ close }) {
|
|
|
2810
2828
|
maxLength: 16
|
|
2811
2829
|
}
|
|
2812
2830
|
) }),
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2831
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Field, { label: intl.formatMessage({
|
|
2814
2832
|
id: "tokenDecimals"
|
|
2815
|
-
}), error: error.decimals, children: /* @__PURE__ */ (0,
|
|
2833
|
+
}), error: error.decimals, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2816
2834
|
Input,
|
|
2817
2835
|
{
|
|
2818
2836
|
placeholder: intl.formatMessage({
|
|
@@ -2824,7 +2842,7 @@ function ImportToken({ close }) {
|
|
|
2824
2842
|
}
|
|
2825
2843
|
) })
|
|
2826
2844
|
] }),
|
|
2827
|
-
/* @__PURE__ */ (0,
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2828
2846
|
Button,
|
|
2829
2847
|
{
|
|
2830
2848
|
size: "lg",
|
|
@@ -2833,20 +2851,20 @@ function ImportToken({ close }) {
|
|
|
2833
2851
|
loading: loading || isContractQuery.isLoading,
|
|
2834
2852
|
disabled: !canImport || !isContractQuery.data,
|
|
2835
2853
|
highlight: true,
|
|
2836
|
-
children: /* @__PURE__ */ (0,
|
|
2854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "import" })
|
|
2837
2855
|
}
|
|
2838
2856
|
)
|
|
2839
2857
|
] });
|
|
2840
2858
|
}
|
|
2841
2859
|
|
|
2842
2860
|
// src/hooks/useMatchWallet.tsx
|
|
2843
|
-
var
|
|
2861
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
2844
2862
|
var ReceiveModal = () => {
|
|
2845
2863
|
const chain = useMatchChain();
|
|
2846
2864
|
const { address } = useWallet();
|
|
2847
2865
|
const [copied, setCopied] = useCopyClipboard();
|
|
2848
2866
|
const toast = useToast();
|
|
2849
|
-
const intl = (0,
|
|
2867
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
2850
2868
|
const onCopy = () => {
|
|
2851
2869
|
setCopied(address);
|
|
2852
2870
|
toast.success(intl.formatMessage({
|
|
@@ -2854,10 +2872,10 @@ var ReceiveModal = () => {
|
|
|
2854
2872
|
}));
|
|
2855
2873
|
};
|
|
2856
2874
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2857
|
-
return /* @__PURE__ */ (0,
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: `matchid-receive-modal`, children: [
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "matchid-receive-container", children: [
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react_intl23.FormattedMessage, { id: "receiveQrcode" }) }),
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
2861
2879
|
import_react_qrcode.QRCode,
|
|
2862
2880
|
{
|
|
2863
2881
|
margin: "0",
|
|
@@ -2865,7 +2883,7 @@ var ReceiveModal = () => {
|
|
|
2865
2883
|
value: address
|
|
2866
2884
|
}
|
|
2867
2885
|
) }),
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
2869
2887
|
"a",
|
|
2870
2888
|
{
|
|
2871
2889
|
href: chainLink,
|
|
@@ -2875,8 +2893,8 @@ var ReceiveModal = () => {
|
|
|
2875
2893
|
}
|
|
2876
2894
|
)
|
|
2877
2895
|
] }),
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
2879
|
-
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
2897
|
+
import_react_intl23.FormattedMessage,
|
|
2880
2898
|
{
|
|
2881
2899
|
id: "copyAddress"
|
|
2882
2900
|
}
|
|
@@ -2885,7 +2903,7 @@ var ReceiveModal = () => {
|
|
|
2885
2903
|
};
|
|
2886
2904
|
function useMatchWallet() {
|
|
2887
2905
|
const modal = useModal();
|
|
2888
|
-
const intl = (0,
|
|
2906
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
2889
2907
|
const showReceiveModal = () => {
|
|
2890
2908
|
modal.open({
|
|
2891
2909
|
title: intl.formatMessage({
|
|
@@ -2917,12 +2935,12 @@ function useMatchWallet() {
|
|
|
2917
2935
|
};
|
|
2918
2936
|
}
|
|
2919
2937
|
function useMatchWalletRecords() {
|
|
2920
|
-
const [hasMore, setHasMore] = (0,
|
|
2921
|
-
const [items, setItems] = (0,
|
|
2938
|
+
const [hasMore, setHasMore] = (0, import_react41.useState)(true);
|
|
2939
|
+
const [items, setItems] = (0, import_react41.useState)([]);
|
|
2922
2940
|
const { chainId, publicClient } = useMatchChain();
|
|
2923
2941
|
const { address } = useWallet();
|
|
2924
|
-
const hasMoreRef = (0,
|
|
2925
|
-
const nextPageParamsRef = (0,
|
|
2942
|
+
const hasMoreRef = (0, import_react41.useRef)(hasMore);
|
|
2943
|
+
const nextPageParamsRef = (0, import_react41.useRef)(void 0);
|
|
2926
2944
|
const { contracts, setContracts } = useContractStore_default();
|
|
2927
2945
|
const fetchMoreData = async () => {
|
|
2928
2946
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -2949,7 +2967,7 @@ function useMatchWalletRecords() {
|
|
|
2949
2967
|
hasMoreRef.current = true;
|
|
2950
2968
|
fetchMoreData();
|
|
2951
2969
|
};
|
|
2952
|
-
(0,
|
|
2970
|
+
(0, import_react41.useEffect)(() => {
|
|
2953
2971
|
if (chainId && address) {
|
|
2954
2972
|
onInit();
|
|
2955
2973
|
}
|
|
@@ -3005,7 +3023,7 @@ function useMatchWalletRecords() {
|
|
|
3005
3023
|
setContracts(contractMap);
|
|
3006
3024
|
}
|
|
3007
3025
|
};
|
|
3008
|
-
const list = (0,
|
|
3026
|
+
const list = (0, import_react41.useMemo)(() => {
|
|
3009
3027
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
3010
3028
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
3011
3029
|
removeList.forEach((item) => {
|
|
@@ -3047,7 +3065,7 @@ function useMatchWalletAssets({
|
|
|
3047
3065
|
chainId: chainId || 0,
|
|
3048
3066
|
...assetListOptions
|
|
3049
3067
|
});
|
|
3050
|
-
const mergedAssets = (0,
|
|
3068
|
+
const mergedAssets = (0, import_react41.useMemo)(() => {
|
|
3051
3069
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
3052
3070
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
3053
3071
|
...asset,
|
|
@@ -3134,7 +3152,7 @@ function useMatchWalletAssetList({
|
|
|
3134
3152
|
retry: 3
|
|
3135
3153
|
// Retry up to 3 times if failed
|
|
3136
3154
|
});
|
|
3137
|
-
const erc20Tokens = (0,
|
|
3155
|
+
const erc20Tokens = (0, import_react41.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
3138
3156
|
const erc20BalanceQuery = (0, import_react_query11.useQuery)({
|
|
3139
3157
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
3140
3158
|
queryFn: async () => {
|
|
@@ -3162,7 +3180,7 @@ function useMatchWalletAssetList({
|
|
|
3162
3180
|
// Refresh every 15 seconds
|
|
3163
3181
|
retry: 3
|
|
3164
3182
|
});
|
|
3165
|
-
const enrichedAssets = (0,
|
|
3183
|
+
const enrichedAssets = (0, import_react41.useMemo)(() => {
|
|
3166
3184
|
if (!list) return [];
|
|
3167
3185
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
3168
3186
|
return list.map((asset) => {
|
|
@@ -3184,7 +3202,7 @@ function useMatchWalletAssetList({
|
|
|
3184
3202
|
return { ...asset, balance, value, balanceValue };
|
|
3185
3203
|
});
|
|
3186
3204
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
3187
|
-
(0,
|
|
3205
|
+
(0, import_react41.useEffect)(() => {
|
|
3188
3206
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
3189
3207
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
3190
3208
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -3209,14 +3227,14 @@ function useMatchWalletAssetList({
|
|
|
3209
3227
|
}
|
|
3210
3228
|
|
|
3211
3229
|
// src/hooks/useReceipt.tsx
|
|
3212
|
-
var
|
|
3230
|
+
var import_react42 = require("react");
|
|
3213
3231
|
var import_react_query12 = require("@tanstack/react-query");
|
|
3214
3232
|
var import_viem14 = require("viem");
|
|
3215
3233
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
3216
3234
|
var MAX_CACHE_SIZE = 500;
|
|
3217
3235
|
var STORAGE_KEY = "match_receipt_logs";
|
|
3218
3236
|
function useReceiptCache() {
|
|
3219
|
-
const [cache, setCache] = (0,
|
|
3237
|
+
const [cache, setCache] = (0, import_react42.useState)(/* @__PURE__ */ new Map());
|
|
3220
3238
|
const isLocalStorageAvailable = (() => {
|
|
3221
3239
|
try {
|
|
3222
3240
|
const testKey = "__test__";
|
|
@@ -3227,7 +3245,7 @@ function useReceiptCache() {
|
|
|
3227
3245
|
return false;
|
|
3228
3246
|
}
|
|
3229
3247
|
})();
|
|
3230
|
-
(0,
|
|
3248
|
+
(0, import_react42.useEffect)(() => {
|
|
3231
3249
|
if (isLocalStorageAvailable) {
|
|
3232
3250
|
try {
|
|
3233
3251
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3246,7 +3264,7 @@ function useReceiptCache() {
|
|
|
3246
3264
|
}
|
|
3247
3265
|
}
|
|
3248
3266
|
}, []);
|
|
3249
|
-
const updateLocalStorage = (0,
|
|
3267
|
+
const updateLocalStorage = (0, import_react42.useCallback)((updatedCache) => {
|
|
3250
3268
|
if (isLocalStorageAvailable) {
|
|
3251
3269
|
try {
|
|
3252
3270
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3263,7 +3281,7 @@ function useReceiptCache() {
|
|
|
3263
3281
|
}
|
|
3264
3282
|
}
|
|
3265
3283
|
}, []);
|
|
3266
|
-
const set = (0,
|
|
3284
|
+
const set = (0, import_react42.useCallback)((key, value) => {
|
|
3267
3285
|
const now = Date.now();
|
|
3268
3286
|
const newCache = new Map(cache);
|
|
3269
3287
|
newCache.forEach((entry, k) => {
|
|
@@ -3281,7 +3299,7 @@ function useReceiptCache() {
|
|
|
3281
3299
|
setCache(newCache);
|
|
3282
3300
|
updateLocalStorage(newCache);
|
|
3283
3301
|
}, [cache, updateLocalStorage]);
|
|
3284
|
-
const get = (0,
|
|
3302
|
+
const get = (0, import_react42.useCallback)((key) => {
|
|
3285
3303
|
const entry = cache.get(key);
|
|
3286
3304
|
if (entry) {
|
|
3287
3305
|
if (Date.now() - entry.timestamp > CACHE_TTL) {
|
|
@@ -3295,7 +3313,7 @@ function useReceiptCache() {
|
|
|
3295
3313
|
}
|
|
3296
3314
|
return void 0;
|
|
3297
3315
|
}, [cache, updateLocalStorage]);
|
|
3298
|
-
const del = (0,
|
|
3316
|
+
const del = (0, import_react42.useCallback)((key) => {
|
|
3299
3317
|
if (cache.has(key)) {
|
|
3300
3318
|
const newCache = new Map(cache);
|
|
3301
3319
|
newCache.delete(key);
|
|
@@ -3303,7 +3321,7 @@ function useReceiptCache() {
|
|
|
3303
3321
|
updateLocalStorage(newCache);
|
|
3304
3322
|
}
|
|
3305
3323
|
}, [cache, updateLocalStorage]);
|
|
3306
|
-
const clear = (0,
|
|
3324
|
+
const clear = (0, import_react42.useCallback)(() => {
|
|
3307
3325
|
setCache(/* @__PURE__ */ new Map());
|
|
3308
3326
|
if (isLocalStorageAvailable) {
|
|
3309
3327
|
localStorage.removeItem(STORAGE_KEY);
|
|
@@ -3318,7 +3336,7 @@ function useReceipt2({
|
|
|
3318
3336
|
const { list } = useMatchChain();
|
|
3319
3337
|
const cache = useReceiptCache();
|
|
3320
3338
|
const chain = list?.find((item) => item.id === chainId);
|
|
3321
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3339
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react42.useState)(true);
|
|
3322
3340
|
const query = (0, import_react_query12.useQuery)({
|
|
3323
3341
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
3324
3342
|
queryFn: async () => {
|
|
@@ -3344,7 +3362,7 @@ function useReceipt2({
|
|
|
3344
3362
|
},
|
|
3345
3363
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3346
3364
|
});
|
|
3347
|
-
(0,
|
|
3365
|
+
(0, import_react42.useEffect)(() => {
|
|
3348
3366
|
if (query.data) {
|
|
3349
3367
|
setShouldRefetch(false);
|
|
3350
3368
|
}
|
|
@@ -3353,14 +3371,14 @@ function useReceipt2({
|
|
|
3353
3371
|
}
|
|
3354
3372
|
|
|
3355
3373
|
// src/hooks/useTransaction.tsx
|
|
3356
|
-
var
|
|
3374
|
+
var import_react43 = require("react");
|
|
3357
3375
|
var import_react_query13 = require("@tanstack/react-query");
|
|
3358
3376
|
var import_viem15 = require("viem");
|
|
3359
3377
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
3360
3378
|
var MAX_CACHE_SIZE2 = 500;
|
|
3361
3379
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
3362
3380
|
function useTransactionCache() {
|
|
3363
|
-
const [cache, setCache] = (0,
|
|
3381
|
+
const [cache, setCache] = (0, import_react43.useState)(/* @__PURE__ */ new Map());
|
|
3364
3382
|
const isLocalStorageAvailable = (() => {
|
|
3365
3383
|
try {
|
|
3366
3384
|
const testKey = "__test__";
|
|
@@ -3371,7 +3389,7 @@ function useTransactionCache() {
|
|
|
3371
3389
|
return false;
|
|
3372
3390
|
}
|
|
3373
3391
|
})();
|
|
3374
|
-
(0,
|
|
3392
|
+
(0, import_react43.useEffect)(() => {
|
|
3375
3393
|
if (isLocalStorageAvailable) {
|
|
3376
3394
|
try {
|
|
3377
3395
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3390,7 +3408,7 @@ function useTransactionCache() {
|
|
|
3390
3408
|
}
|
|
3391
3409
|
}
|
|
3392
3410
|
}, []);
|
|
3393
|
-
const updateLocalStorage = (0,
|
|
3411
|
+
const updateLocalStorage = (0, import_react43.useCallback)((updatedCache) => {
|
|
3394
3412
|
if (isLocalStorageAvailable) {
|
|
3395
3413
|
try {
|
|
3396
3414
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3407,7 +3425,7 @@ function useTransactionCache() {
|
|
|
3407
3425
|
}
|
|
3408
3426
|
}
|
|
3409
3427
|
}, []);
|
|
3410
|
-
const set = (0,
|
|
3428
|
+
const set = (0, import_react43.useCallback)((key, value) => {
|
|
3411
3429
|
const now = Date.now();
|
|
3412
3430
|
const newCache = new Map(cache);
|
|
3413
3431
|
newCache.forEach((entry, k) => {
|
|
@@ -3425,7 +3443,7 @@ function useTransactionCache() {
|
|
|
3425
3443
|
setCache(newCache);
|
|
3426
3444
|
updateLocalStorage(newCache);
|
|
3427
3445
|
}, [cache, updateLocalStorage]);
|
|
3428
|
-
const get = (0,
|
|
3446
|
+
const get = (0, import_react43.useCallback)((key) => {
|
|
3429
3447
|
const entry = cache.get(key);
|
|
3430
3448
|
if (entry) {
|
|
3431
3449
|
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
@@ -3439,7 +3457,7 @@ function useTransactionCache() {
|
|
|
3439
3457
|
}
|
|
3440
3458
|
return void 0;
|
|
3441
3459
|
}, [cache, updateLocalStorage]);
|
|
3442
|
-
const del = (0,
|
|
3460
|
+
const del = (0, import_react43.useCallback)((key) => {
|
|
3443
3461
|
if (cache.has(key)) {
|
|
3444
3462
|
const newCache = new Map(cache);
|
|
3445
3463
|
newCache.delete(key);
|
|
@@ -3447,7 +3465,7 @@ function useTransactionCache() {
|
|
|
3447
3465
|
updateLocalStorage(newCache);
|
|
3448
3466
|
}
|
|
3449
3467
|
}, [cache, updateLocalStorage]);
|
|
3450
|
-
const clear = (0,
|
|
3468
|
+
const clear = (0, import_react43.useCallback)(() => {
|
|
3451
3469
|
setCache(/* @__PURE__ */ new Map());
|
|
3452
3470
|
if (isLocalStorageAvailable) {
|
|
3453
3471
|
localStorage.removeItem(STORAGE_KEY2);
|
|
@@ -3462,7 +3480,7 @@ function useTransaction({
|
|
|
3462
3480
|
const { list } = useMatchChain();
|
|
3463
3481
|
const cache = useTransactionCache();
|
|
3464
3482
|
const chain = list?.find((item) => item.id === chainId);
|
|
3465
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3483
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react43.useState)(true);
|
|
3466
3484
|
const query = (0, import_react_query13.useQuery)({
|
|
3467
3485
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
3468
3486
|
queryFn: async () => {
|
|
@@ -3488,7 +3506,7 @@ function useTransaction({
|
|
|
3488
3506
|
},
|
|
3489
3507
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3490
3508
|
});
|
|
3491
|
-
(0,
|
|
3509
|
+
(0, import_react43.useEffect)(() => {
|
|
3492
3510
|
if (query.data) {
|
|
3493
3511
|
setShouldRefetch(false);
|
|
3494
3512
|
}
|