@matchain/matchid-sdk-react 0.1.53-alpha.6 → 0.1.53-alpha.8
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.d.mts +4 -146
- package/dist/assets/icon/index.d.ts +4 -146
- 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-Z7DMYFH5.mjs → chunk-QTUR37B2.mjs} +5729 -5364
- package/dist/chunk-QTUR37B2.mjs.map +1 -0
- package/dist/{chunk-V2S54LGG.mjs → chunk-X5HGL3ZX.mjs} +45 -3
- package/dist/chunk-X5HGL3ZX.mjs.map +1 -0
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +726 -360
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -5
- package/dist/hooks/api/index.d.mts +3 -2
- package/dist/hooks/api/index.d.ts +3 -2
- package/dist/hooks/api/index.js +249 -62
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +9 -9
- package/dist/hooks/index.d.mts +3 -2
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.js +359 -320
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/{index-W6yjuOKT.d.mts → index-BDffLLM_.d.mts} +29 -17
- package/dist/index-BVfCh4l-.d.mts +203 -0
- package/dist/{index-Bpd2gBNh.d.mts → index-BaFmUVw-.d.mts} +1 -1
- package/dist/{index-Dt92N6yZ.d.ts → index-BsX-ovIl.d.ts} +29 -17
- package/dist/{index-wqqEUufi.d.mts → index-C0UKUm0h.d.ts} +25 -5
- package/dist/{index-DaXXoRxr.d.ts → index-CQmN0dN4.d.ts} +1 -1
- package/dist/index-D3Kp05kW.d.ts +203 -0
- package/dist/{index-BaYTgL99.d.mts → index-D5WIVIkc.d.ts} +3 -2
- package/dist/{index-D_UNctDI.d.mts → index-D7S5DMUy.d.mts} +18 -5
- package/dist/{index-BhU3hF7y.d.ts → index-DC4F1u-w.d.mts} +25 -5
- package/dist/{index-C5StsjWY.d.ts → index-DQFQ39D9.d.ts} +18 -5
- package/dist/{index-mxbJ8CFx.d.mts → index-DjbH13zc.d.mts} +3 -1
- package/dist/{index-D1QeVZyN.d.ts → index-SOVt-ADK.d.mts} +3 -2
- package/dist/{index-CFqk8eNo.d.ts → index-zc2GEzJ9.d.ts} +3 -1
- package/dist/index.css +123 -15
- package/dist/index.d.mts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +1023 -564
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -12
- package/dist/request-B0CyrGFT.d.mts +15 -0
- package/dist/request-B0CyrGFT.d.ts +15 -0
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-Bx_FJ11s.d.mts → types-VrV1kYga.d.mts} +9 -1
- package/dist/{types-Bx_FJ11s.d.ts → types-VrV1kYga.d.ts} +9 -1
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +106 -61
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +8 -4
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- 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/App.tsx +30 -7
- package/example/src/pages/Contact/index.tsx +90 -0
- package/example/src/pages/UI/components/Tabs.tsx +18 -0
- package/example/src/pages/UI/index.tsx +2 -0
- package/package.json +4 -1
- package/dist/chunk-3USZ4ZZY.mjs.map +0 -1
- package/dist/chunk-OCQ2AIM3.mjs.map +0 -1
- package/dist/chunk-UDXKFDXO.mjs +0 -97
- package/dist/chunk-UDXKFDXO.mjs.map +0 -1
- package/dist/chunk-V2S54LGG.mjs.map +0 -1
- package/dist/chunk-Z7DMYFH5.mjs.map +0 -1
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,18 +1235,24 @@ 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
|
|
|
1250
|
+
// src/ui/Skeleton/index.tsx
|
|
1251
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
1252
|
+
|
|
1253
|
+
// src/ui/Tabs/index.tsx
|
|
1254
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
1255
|
+
|
|
1240
1256
|
// src/components/EVMModal/index.tsx
|
|
1241
1257
|
var import_react16 = require("react");
|
|
1242
1258
|
|
|
@@ -1273,7 +1289,7 @@ var import_react_intl9 = require("react-intl");
|
|
|
1273
1289
|
|
|
1274
1290
|
// src/components/WalletModalContent/index.tsx
|
|
1275
1291
|
var import_react14 = require("react");
|
|
1276
|
-
var
|
|
1292
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
1277
1293
|
|
|
1278
1294
|
// src/components/EVMModal/index.tsx
|
|
1279
1295
|
var import_chains = require("wagmi/chains");
|
|
@@ -1354,7 +1370,7 @@ var import_ethers = require("ethers");
|
|
|
1354
1370
|
// src/components/EVMModal/index.tsx
|
|
1355
1371
|
var import_siwe = require("siwe");
|
|
1356
1372
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
1357
|
-
var
|
|
1373
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
1358
1374
|
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
1359
1375
|
appName: "MatchID",
|
|
1360
1376
|
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
@@ -1381,13 +1397,13 @@ var import_react_intl10 = require("react-intl");
|
|
|
1381
1397
|
var import_react17 = require("react");
|
|
1382
1398
|
|
|
1383
1399
|
// src/components/TRONModal/index.tsx
|
|
1384
|
-
var
|
|
1400
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
1385
1401
|
|
|
1386
1402
|
// src/components/TONModal/index.tsx
|
|
1387
1403
|
var import_react19 = __toESM(require("react"));
|
|
1388
1404
|
var import_react_intl11 = require("react-intl");
|
|
1389
1405
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
1390
|
-
var
|
|
1406
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
1391
1407
|
|
|
1392
1408
|
// src/components/BTCModal/index.tsx
|
|
1393
1409
|
var import_react21 = __toESM(require("react"));
|
|
@@ -1400,16 +1416,16 @@ var import_sats_connect = require("sats-connect");
|
|
|
1400
1416
|
var import_react20 = require("react");
|
|
1401
1417
|
|
|
1402
1418
|
// src/components/BTCModal/index.tsx
|
|
1403
|
-
var
|
|
1419
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
1404
1420
|
|
|
1405
1421
|
// src/components/WalletModal/index.tsx
|
|
1406
1422
|
var import_react22 = require("react");
|
|
1407
1423
|
var import_react_intl13 = require("react-intl");
|
|
1408
|
-
var
|
|
1424
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
1409
1425
|
|
|
1410
1426
|
// src/components/AlphaAvatar/index.tsx
|
|
1411
1427
|
var import_react23 = require("react");
|
|
1412
|
-
var
|
|
1428
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
1413
1429
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
1414
1430
|
const [avatar, setAvatar] = (0, import_react23.useState)(void 0);
|
|
1415
1431
|
(0, import_react23.useEffect)(() => {
|
|
@@ -1418,7 +1434,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
1418
1434
|
setAvatar(char);
|
|
1419
1435
|
}
|
|
1420
1436
|
}, [name]);
|
|
1421
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
1422
1438
|
width: size,
|
|
1423
1439
|
height: size,
|
|
1424
1440
|
fontSize: Math.ceil(size / 2)
|
|
@@ -1426,13 +1442,13 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
1426
1442
|
}
|
|
1427
1443
|
|
|
1428
1444
|
// src/components/WalletAsset/index.tsx
|
|
1429
|
-
var
|
|
1445
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
1430
1446
|
|
|
1431
1447
|
// src/components/TokenSend/index.tsx
|
|
1432
1448
|
var import_react24 = require("react");
|
|
1433
1449
|
var import_viem4 = require("viem");
|
|
1434
1450
|
var import_react_intl14 = require("react-intl");
|
|
1435
|
-
var
|
|
1451
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
1436
1452
|
function Input2({
|
|
1437
1453
|
onChange,
|
|
1438
1454
|
placeholder,
|
|
@@ -1442,8 +1458,8 @@ function Input2({
|
|
|
1442
1458
|
error,
|
|
1443
1459
|
size = "df"
|
|
1444
1460
|
}) {
|
|
1445
|
-
return /* @__PURE__ */ (0,
|
|
1446
|
-
/* @__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)(
|
|
1447
1463
|
"input",
|
|
1448
1464
|
{
|
|
1449
1465
|
placeholder,
|
|
@@ -1454,7 +1470,7 @@ function Input2({
|
|
|
1454
1470
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
1455
1471
|
}
|
|
1456
1472
|
),
|
|
1457
|
-
error && /* @__PURE__ */ (0,
|
|
1473
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-token-input-error-text", children: error })
|
|
1458
1474
|
] });
|
|
1459
1475
|
}
|
|
1460
1476
|
function TokenSend({
|
|
@@ -1582,24 +1598,24 @@ function TokenSend({
|
|
|
1582
1598
|
window.removeEventListener("message", receiveMessage);
|
|
1583
1599
|
};
|
|
1584
1600
|
}, []);
|
|
1585
|
-
return /* @__PURE__ */ (0,
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1590
|
-
/* @__PURE__ */ (0,
|
|
1591
|
-
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)(
|
|
1592
1608
|
"img",
|
|
1593
1609
|
{
|
|
1594
1610
|
src: token?.icon,
|
|
1595
1611
|
alt: token?.symbol,
|
|
1596
1612
|
className: `matchid-token-amount-chain-icon`
|
|
1597
1613
|
}
|
|
1598
|
-
) : /* @__PURE__ */ (0,
|
|
1599
|
-
/* @__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 })
|
|
1600
1616
|
] })
|
|
1601
1617
|
] }),
|
|
1602
|
-
/* @__PURE__ */ (0,
|
|
1618
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1603
1619
|
Input2,
|
|
1604
1620
|
{
|
|
1605
1621
|
type: "text",
|
|
@@ -1612,18 +1628,18 @@ function TokenSend({
|
|
|
1612
1628
|
error: error.amount || txError
|
|
1613
1629
|
}
|
|
1614
1630
|
),
|
|
1615
|
-
/* @__PURE__ */ (0,
|
|
1616
|
-
/* @__PURE__ */ (0,
|
|
1617
|
-
/* @__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" }),
|
|
1618
1634
|
":"
|
|
1619
1635
|
] }),
|
|
1620
|
-
/* @__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 }) })
|
|
1621
1637
|
] }),
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
1623
1639
|
] }),
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1626
|
-
/* @__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)(
|
|
1627
1643
|
Input2,
|
|
1628
1644
|
{
|
|
1629
1645
|
type: "text",
|
|
@@ -1639,7 +1655,7 @@ function TokenSend({
|
|
|
1639
1655
|
)
|
|
1640
1656
|
] })
|
|
1641
1657
|
] }),
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
1643
1659
|
Button,
|
|
1644
1660
|
{
|
|
1645
1661
|
size: "lg",
|
|
@@ -1648,7 +1664,7 @@ function TokenSend({
|
|
|
1648
1664
|
disabled: !canSend || !!txError,
|
|
1649
1665
|
onClick: onNext,
|
|
1650
1666
|
loading: loading || sending,
|
|
1651
|
-
children: /* @__PURE__ */ (0,
|
|
1667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl14.FormattedMessage, { id: "next" })
|
|
1652
1668
|
}
|
|
1653
1669
|
)
|
|
1654
1670
|
] }) });
|
|
@@ -1656,12 +1672,12 @@ function TokenSend({
|
|
|
1656
1672
|
|
|
1657
1673
|
// src/components/TokenDetail/index.tsx
|
|
1658
1674
|
var import_react_intl15 = require("react-intl");
|
|
1659
|
-
var
|
|
1675
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
1660
1676
|
|
|
1661
1677
|
// src/components/TokenSendList/index.tsx
|
|
1662
1678
|
var import_react25 = require("react");
|
|
1663
1679
|
var import_react_intl16 = require("react-intl");
|
|
1664
|
-
var
|
|
1680
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
1665
1681
|
function TokenSendList({ close }) {
|
|
1666
1682
|
const isDownMd = useDownMd();
|
|
1667
1683
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -1673,16 +1689,16 @@ function TokenSendList({ close }) {
|
|
|
1673
1689
|
const modal = useModal();
|
|
1674
1690
|
const onNext = () => {
|
|
1675
1691
|
checked && modal.show((props) => {
|
|
1676
|
-
return /* @__PURE__ */ (0,
|
|
1692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TokenSend, { onClose: () => {
|
|
1677
1693
|
props.close();
|
|
1678
1694
|
close();
|
|
1679
1695
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
1680
1696
|
});
|
|
1681
1697
|
};
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1683
|
-
/* @__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) => {
|
|
1684
1700
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
1685
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
1686
1702
|
"div",
|
|
1687
1703
|
{
|
|
1688
1704
|
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
@@ -1690,10 +1706,10 @@ function TokenSendList({ close }) {
|
|
|
1690
1706
|
setChecked(n);
|
|
1691
1707
|
},
|
|
1692
1708
|
children: [
|
|
1693
|
-
/* @__PURE__ */ (0,
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1695
|
-
/* @__PURE__ */ (0,
|
|
1696
|
-
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)(
|
|
1697
1713
|
AlphaAvatar2,
|
|
1698
1714
|
{
|
|
1699
1715
|
className: `matchid-token-send-icon`,
|
|
@@ -1701,7 +1717,7 @@ function TokenSendList({ close }) {
|
|
|
1701
1717
|
name: n.symbol || n.name || ""
|
|
1702
1718
|
}
|
|
1703
1719
|
),
|
|
1704
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
1720
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
1705
1721
|
"img",
|
|
1706
1722
|
{
|
|
1707
1723
|
src: chain.iconUrl,
|
|
@@ -1710,9 +1726,9 @@ function TokenSendList({ close }) {
|
|
|
1710
1726
|
}
|
|
1711
1727
|
)
|
|
1712
1728
|
] }),
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1715
|
-
/* @__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 }) })
|
|
1716
1732
|
] })
|
|
1717
1733
|
] })
|
|
1718
1734
|
]
|
|
@@ -1720,7 +1736,7 @@ function TokenSendList({ close }) {
|
|
|
1720
1736
|
index
|
|
1721
1737
|
);
|
|
1722
1738
|
}) }),
|
|
1723
|
-
/* @__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" }) })
|
|
1724
1740
|
] });
|
|
1725
1741
|
}
|
|
1726
1742
|
|
|
@@ -1788,15 +1804,87 @@ var useContractStore_default = useContractStore;
|
|
|
1788
1804
|
|
|
1789
1805
|
// src/components/TransactionList/index.tsx
|
|
1790
1806
|
var import_react_intl17 = require("react-intl");
|
|
1791
|
-
var
|
|
1807
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
1792
1808
|
|
|
1793
|
-
// src/
|
|
1809
|
+
// src/hooks/api/bind.ts
|
|
1810
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
1811
|
+
|
|
1812
|
+
// src/hooks/api/poh.ts
|
|
1813
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
1814
|
+
|
|
1815
|
+
// src/hooks/api/wallet.ts
|
|
1816
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
1817
|
+
function useChainListQuery(options) {
|
|
1818
|
+
const { isLogin, token } = useUserInfo();
|
|
1819
|
+
return (0, import_react_query5.useQuery)({
|
|
1820
|
+
queryKey: ["match-user-chain-list", token],
|
|
1821
|
+
queryFn: async () => {
|
|
1822
|
+
const res = await getUserChainListApi();
|
|
1823
|
+
if (!isSuccess(res)) {
|
|
1824
|
+
return [];
|
|
1825
|
+
}
|
|
1826
|
+
return res.data;
|
|
1827
|
+
},
|
|
1828
|
+
enabled: isLogin,
|
|
1829
|
+
...options
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
function useAssetListQuery({
|
|
1833
|
+
chainId,
|
|
1834
|
+
...options
|
|
1835
|
+
}) {
|
|
1836
|
+
const { isLogin, token } = useUserInfo();
|
|
1837
|
+
return (0, import_react_query5.useQuery)({
|
|
1838
|
+
queryKey: ["match-user-asset-list", token, chainId],
|
|
1839
|
+
queryFn: async () => {
|
|
1840
|
+
const res = await getUserWalletAssetApi({ chain_id: chainId.toString() });
|
|
1841
|
+
if (!isSuccess(res)) {
|
|
1842
|
+
return [];
|
|
1843
|
+
}
|
|
1844
|
+
return res.data || [];
|
|
1845
|
+
},
|
|
1846
|
+
enabled: isLogin,
|
|
1847
|
+
...options
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
var USER_IMPORT_TOKEN_LIST_KEY = "match-user-import-token-list";
|
|
1851
|
+
function useImportTokenListQuery({
|
|
1852
|
+
chainId,
|
|
1853
|
+
...options
|
|
1854
|
+
}) {
|
|
1855
|
+
const { isLogin, token } = useUserInfo();
|
|
1856
|
+
return (0, import_react_query5.useQuery)({
|
|
1857
|
+
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId],
|
|
1858
|
+
queryFn: async () => {
|
|
1859
|
+
const res = await getUserImportTokenListApi({ chain_id: chainId.toString() });
|
|
1860
|
+
if (!isSuccess(res)) {
|
|
1861
|
+
return [];
|
|
1862
|
+
}
|
|
1863
|
+
return res.data || [];
|
|
1864
|
+
},
|
|
1865
|
+
enabled: isLogin,
|
|
1866
|
+
...options
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
// src/hooks/api/contact.ts
|
|
1871
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
1872
|
+
var import_last = __toESM(require("lodash/last"));
|
|
1794
1873
|
var import_react27 = require("react");
|
|
1874
|
+
|
|
1875
|
+
// src/components/ContactList/index.tsx
|
|
1876
|
+
var import_react_virtuoso = require("react-virtuoso");
|
|
1877
|
+
var import_react28 = require("react");
|
|
1795
1878
|
var import_react_intl18 = require("react-intl");
|
|
1796
|
-
var
|
|
1879
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
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");
|
|
1797
1885
|
|
|
1798
1886
|
// src/context/BusinessProvider.tsx
|
|
1799
|
-
var
|
|
1887
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
1800
1888
|
|
|
1801
1889
|
// src/store/useStore.ts
|
|
1802
1890
|
var import_zustand4 = require("zustand");
|
|
@@ -1811,15 +1899,15 @@ var useStore = (0, import_zustand4.create)((set) => ({
|
|
|
1811
1899
|
var useStore_default = useStore;
|
|
1812
1900
|
|
|
1813
1901
|
// src/context/BusinessProvider.tsx
|
|
1814
|
-
var
|
|
1902
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
1815
1903
|
|
|
1816
1904
|
// src/context/ModalContext.tsx
|
|
1817
|
-
var
|
|
1905
|
+
var import_react30 = require("react");
|
|
1818
1906
|
var import_react_dom = require("react-dom");
|
|
1819
|
-
var
|
|
1820
|
-
var ModalContext = (0,
|
|
1907
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
1908
|
+
var ModalContext = (0, import_react30.createContext)(null);
|
|
1821
1909
|
function useModal() {
|
|
1822
|
-
const context = (0,
|
|
1910
|
+
const context = (0, import_react30.useContext)(ModalContext);
|
|
1823
1911
|
if (!context) {
|
|
1824
1912
|
throw new Error("useModal must be used within a ModalProvider");
|
|
1825
1913
|
}
|
|
@@ -1827,12 +1915,12 @@ function useModal() {
|
|
|
1827
1915
|
}
|
|
1828
1916
|
|
|
1829
1917
|
// src/context/ToastContext.tsx
|
|
1830
|
-
var
|
|
1918
|
+
var import_react31 = require("react");
|
|
1831
1919
|
var import_react_dom2 = require("react-dom");
|
|
1832
|
-
var
|
|
1833
|
-
var ToastContext = (0,
|
|
1920
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
1921
|
+
var ToastContext = (0, import_react31.createContext)(null);
|
|
1834
1922
|
function useToast() {
|
|
1835
|
-
const context = (0,
|
|
1923
|
+
const context = (0, import_react31.useContext)(ToastContext);
|
|
1836
1924
|
if (!context) {
|
|
1837
1925
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1838
1926
|
}
|
|
@@ -1840,23 +1928,23 @@ function useToast() {
|
|
|
1840
1928
|
}
|
|
1841
1929
|
|
|
1842
1930
|
// src/context/index.tsx
|
|
1843
|
-
var
|
|
1931
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
1844
1932
|
|
|
1845
1933
|
// src/hooks/useWalletInit.ts
|
|
1846
|
-
var
|
|
1934
|
+
var import_react32 = require("react");
|
|
1847
1935
|
var AppClientId = getAppClientId();
|
|
1848
1936
|
|
|
1849
1937
|
// src/hooks/useInit.tsx
|
|
1850
|
-
var
|
|
1938
|
+
var import_react33 = require("react");
|
|
1851
1939
|
|
|
1852
1940
|
// src/MatchContext.tsx
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1856
|
-
var queryClient = new
|
|
1857
|
-
var MatchContext = (0,
|
|
1941
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
1942
|
+
var import_react_intl20 = require("react-intl");
|
|
1943
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
1944
|
+
var queryClient = new import_react_query8.QueryClient();
|
|
1945
|
+
var MatchContext = (0, import_react34.createContext)(void 0);
|
|
1858
1946
|
var useMatch = () => {
|
|
1859
|
-
const context = (0,
|
|
1947
|
+
const context = (0, import_react34.useContext)(MatchContext);
|
|
1860
1948
|
if (context === void 0) {
|
|
1861
1949
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
1862
1950
|
}
|
|
@@ -1890,7 +1978,7 @@ function useUserInfo() {
|
|
|
1890
1978
|
const getRedirectUri = () => {
|
|
1891
1979
|
return encodeURIComponent(window.location.href);
|
|
1892
1980
|
};
|
|
1893
|
-
const isLogin = (0,
|
|
1981
|
+
const isLogin = (0, import_react35.useMemo)(() => !!token && !!overview, [token, overview]);
|
|
1894
1982
|
const logout = async () => {
|
|
1895
1983
|
try {
|
|
1896
1984
|
await toLogoutApi();
|
|
@@ -2127,6 +2215,11 @@ function useUserInfo() {
|
|
|
2127
2215
|
window.addEventListener("message", authMessageHandle);
|
|
2128
2216
|
});
|
|
2129
2217
|
};
|
|
2218
|
+
const invite = async (invite_code) => {
|
|
2219
|
+
return await userInviteApi({
|
|
2220
|
+
invite_code
|
|
2221
|
+
});
|
|
2222
|
+
};
|
|
2130
2223
|
return {
|
|
2131
2224
|
loginByMethod,
|
|
2132
2225
|
loginByTelegram,
|
|
@@ -2150,14 +2243,15 @@ function useUserInfo() {
|
|
|
2150
2243
|
auth,
|
|
2151
2244
|
login: loginMethod,
|
|
2152
2245
|
bind,
|
|
2153
|
-
getAuthInfo
|
|
2246
|
+
getAuthInfo,
|
|
2247
|
+
invite
|
|
2154
2248
|
};
|
|
2155
2249
|
}
|
|
2156
2250
|
|
|
2157
2251
|
// src/hooks/useMatchEvents.ts
|
|
2158
|
-
var
|
|
2252
|
+
var import_react36 = require("react");
|
|
2159
2253
|
function useMatchEvents(handlers) {
|
|
2160
|
-
(0,
|
|
2254
|
+
(0, import_react36.useEffect)(() => {
|
|
2161
2255
|
Object.entries(handlers).forEach(([event, handler2]) => {
|
|
2162
2256
|
if (handler2) {
|
|
2163
2257
|
eventManager_default.on(event, handler2);
|
|
@@ -2177,7 +2271,7 @@ function useMatchEvents(handlers) {
|
|
|
2177
2271
|
var import_viem7 = require("viem");
|
|
2178
2272
|
var import_accounts = require("viem/accounts");
|
|
2179
2273
|
var import_viem8 = require("viem");
|
|
2180
|
-
var
|
|
2274
|
+
var import_react37 = require("react");
|
|
2181
2275
|
var import_viem9 = require("viem");
|
|
2182
2276
|
|
|
2183
2277
|
// src/store/useTransactionStore.ts
|
|
@@ -2211,7 +2305,7 @@ var useTransactionStore = (0, import_zustand5.create)((0, import_middleware3.dev
|
|
|
2211
2305
|
var useTransactionStore_default = useTransactionStore;
|
|
2212
2306
|
|
|
2213
2307
|
// src/hooks/useWallet.tsx
|
|
2214
|
-
var
|
|
2308
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
2215
2309
|
var AppClientId2 = "react-sdk-" + getVersion();
|
|
2216
2310
|
function useWallet() {
|
|
2217
2311
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -2262,7 +2356,7 @@ function useWallet() {
|
|
|
2262
2356
|
throw error;
|
|
2263
2357
|
}
|
|
2264
2358
|
};
|
|
2265
|
-
const evmAccount = (0,
|
|
2359
|
+
const evmAccount = (0, import_react37.useMemo)(() => {
|
|
2266
2360
|
try {
|
|
2267
2361
|
return address ? (0, import_accounts.toAccount)({
|
|
2268
2362
|
address,
|
|
@@ -2301,7 +2395,7 @@ function useWallet() {
|
|
|
2301
2395
|
return void 0;
|
|
2302
2396
|
}
|
|
2303
2397
|
}, [address]);
|
|
2304
|
-
(0,
|
|
2398
|
+
(0, import_react37.useEffect)(() => {
|
|
2305
2399
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
2306
2400
|
}, [evmAccount]);
|
|
2307
2401
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -2384,7 +2478,7 @@ function useWallet() {
|
|
|
2384
2478
|
address: evmAccount.address
|
|
2385
2479
|
});
|
|
2386
2480
|
modal.show((props) => {
|
|
2387
|
-
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 });
|
|
2388
2482
|
});
|
|
2389
2483
|
clearInterval(window.matchProvider.transactionMessageIntervalMap[transactionId].interval);
|
|
2390
2484
|
delete window.matchProvider.transactionMessageIntervalMap[transactionId];
|
|
@@ -2437,14 +2531,14 @@ function useWallet() {
|
|
|
2437
2531
|
|
|
2438
2532
|
// src/hooks/useCopyClipboard.ts
|
|
2439
2533
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
2440
|
-
var
|
|
2534
|
+
var import_react38 = require("react");
|
|
2441
2535
|
function useCopyClipboard(timeout = 500) {
|
|
2442
|
-
const [isCopied, setIsCopied] = (0,
|
|
2443
|
-
const staticCopy = (0,
|
|
2536
|
+
const [isCopied, setIsCopied] = (0, import_react38.useState)(false);
|
|
2537
|
+
const staticCopy = (0, import_react38.useCallback)((text) => {
|
|
2444
2538
|
const didCopy = (0, import_copy_to_clipboard.default)(text);
|
|
2445
2539
|
setIsCopied(didCopy);
|
|
2446
2540
|
}, []);
|
|
2447
|
-
(0,
|
|
2541
|
+
(0, import_react38.useEffect)(() => {
|
|
2448
2542
|
if (isCopied) {
|
|
2449
2543
|
const hide = setTimeout(() => {
|
|
2450
2544
|
setIsCopied(false);
|
|
@@ -2458,72 +2552,17 @@ function useCopyClipboard(timeout = 500) {
|
|
|
2458
2552
|
return [isCopied, staticCopy];
|
|
2459
2553
|
}
|
|
2460
2554
|
|
|
2461
|
-
// src/hooks/api/wallet.ts
|
|
2462
|
-
var import_react_query5 = require("@tanstack/react-query");
|
|
2463
|
-
function useChainListQuery(options) {
|
|
2464
|
-
const { isLogin, token } = useUserInfo();
|
|
2465
|
-
return (0, import_react_query5.useQuery)({
|
|
2466
|
-
queryKey: ["match-user-chain-list", token],
|
|
2467
|
-
queryFn: async () => {
|
|
2468
|
-
const res = await getUserChainListApi();
|
|
2469
|
-
if (!isSuccess(res)) {
|
|
2470
|
-
return [];
|
|
2471
|
-
}
|
|
2472
|
-
return res.data;
|
|
2473
|
-
},
|
|
2474
|
-
enabled: isLogin,
|
|
2475
|
-
...options
|
|
2476
|
-
});
|
|
2477
|
-
}
|
|
2478
|
-
function useAssetListQuery({
|
|
2479
|
-
chainId,
|
|
2480
|
-
...options
|
|
2481
|
-
}) {
|
|
2482
|
-
const { isLogin, token } = useUserInfo();
|
|
2483
|
-
return (0, import_react_query5.useQuery)({
|
|
2484
|
-
queryKey: ["match-user-asset-list", token, chainId],
|
|
2485
|
-
queryFn: async () => {
|
|
2486
|
-
const res = await getUserWalletAssetApi({ chain_id: chainId.toString() });
|
|
2487
|
-
if (!isSuccess(res)) {
|
|
2488
|
-
return [];
|
|
2489
|
-
}
|
|
2490
|
-
return res.data || [];
|
|
2491
|
-
},
|
|
2492
|
-
enabled: isLogin,
|
|
2493
|
-
...options
|
|
2494
|
-
});
|
|
2495
|
-
}
|
|
2496
|
-
var USER_IMPORT_TOKEN_LIST_KEY = "match-user-import-token-list";
|
|
2497
|
-
function useImportTokenListQuery({
|
|
2498
|
-
chainId,
|
|
2499
|
-
...options
|
|
2500
|
-
}) {
|
|
2501
|
-
const { isLogin, token } = useUserInfo();
|
|
2502
|
-
return (0, import_react_query5.useQuery)({
|
|
2503
|
-
queryKey: [USER_IMPORT_TOKEN_LIST_KEY, token, chainId],
|
|
2504
|
-
queryFn: async () => {
|
|
2505
|
-
const res = await getUserImportTokenListApi({ chain_id: chainId.toString() });
|
|
2506
|
-
if (!isSuccess(res)) {
|
|
2507
|
-
return [];
|
|
2508
|
-
}
|
|
2509
|
-
return res.data || [];
|
|
2510
|
-
},
|
|
2511
|
-
enabled: isLogin,
|
|
2512
|
-
...options
|
|
2513
|
-
});
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
2555
|
// src/hooks/useMatchChain.tsx
|
|
2517
|
-
var
|
|
2556
|
+
var import_react39 = require("react");
|
|
2518
2557
|
var import_viem10 = require("viem");
|
|
2519
|
-
var
|
|
2520
|
-
var
|
|
2558
|
+
var import_react_intl21 = require("react-intl");
|
|
2559
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
2521
2560
|
function useMatchChain() {
|
|
2522
2561
|
const chainListQuery = useChainListQuery();
|
|
2523
2562
|
const modal = useModal();
|
|
2524
|
-
const intl = (0,
|
|
2563
|
+
const intl = (0, import_react_intl21.useIntl)();
|
|
2525
2564
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
2526
|
-
const chainId = (0,
|
|
2565
|
+
const chainId = (0, import_react39.useMemo)(() => {
|
|
2527
2566
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2528
2567
|
return null;
|
|
2529
2568
|
}
|
|
@@ -2532,7 +2571,7 @@ function useMatchChain() {
|
|
|
2532
2571
|
}
|
|
2533
2572
|
return chainListQuery.data[0].id;
|
|
2534
2573
|
}, [storeChainId, chainListQuery.data]);
|
|
2535
|
-
const chain = (0,
|
|
2574
|
+
const chain = (0, import_react39.useMemo)(() => {
|
|
2536
2575
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
2537
2576
|
return null;
|
|
2538
2577
|
}
|
|
@@ -2546,30 +2585,30 @@ function useMatchChain() {
|
|
|
2546
2585
|
close
|
|
2547
2586
|
}) {
|
|
2548
2587
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
2549
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
2588
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react39.useState)(storeChainId2);
|
|
2550
2589
|
const isDownMd = useDownMd();
|
|
2551
|
-
return /* @__PURE__ */ (0,
|
|
2552
|
-
/* @__PURE__ */ (0,
|
|
2553
|
-
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)(
|
|
2554
2593
|
"div",
|
|
2555
2594
|
{
|
|
2556
2595
|
onClick: () => setSelectedChainId(item.id),
|
|
2557
2596
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
2558
2597
|
children: [
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2560
|
-
/* @__PURE__ */ (0,
|
|
2561
|
-
/* @__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 })
|
|
2562
2601
|
] }),
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
2564
2603
|
]
|
|
2565
2604
|
},
|
|
2566
2605
|
index
|
|
2567
2606
|
);
|
|
2568
2607
|
}) }),
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2608
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
2570
2609
|
setChainId2(selectedChainId || 0);
|
|
2571
2610
|
close();
|
|
2572
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
2611
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl21.FormattedMessage, { id: "confirm" }) })
|
|
2573
2612
|
] });
|
|
2574
2613
|
}
|
|
2575
2614
|
const showChangeNetwork = () => {
|
|
@@ -2578,7 +2617,7 @@ function useMatchChain() {
|
|
|
2578
2617
|
content: ChangeNetwork
|
|
2579
2618
|
});
|
|
2580
2619
|
};
|
|
2581
|
-
const publicClient = (0,
|
|
2620
|
+
const publicClient = (0, import_react39.useMemo)(() => {
|
|
2582
2621
|
if (!chain) {
|
|
2583
2622
|
return null;
|
|
2584
2623
|
}
|
|
@@ -2606,26 +2645,26 @@ function useMatchChain() {
|
|
|
2606
2645
|
|
|
2607
2646
|
// src/hooks/useMatchWallet.tsx
|
|
2608
2647
|
var import_react_qrcode = require("react-qrcode");
|
|
2609
|
-
var
|
|
2610
|
-
var
|
|
2648
|
+
var import_react41 = require("react");
|
|
2649
|
+
var import_react_query11 = require("@tanstack/react-query");
|
|
2611
2650
|
var import_viem13 = require("viem");
|
|
2612
|
-
var
|
|
2651
|
+
var import_react_intl23 = require("react-intl");
|
|
2613
2652
|
|
|
2614
2653
|
// src/components/ImportToken/index.tsx
|
|
2615
|
-
var
|
|
2616
|
-
var
|
|
2617
|
-
var
|
|
2654
|
+
var import_react40 = require("react");
|
|
2655
|
+
var import_react_intl22 = require("react-intl");
|
|
2656
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
2618
2657
|
var import_viem12 = require("viem");
|
|
2619
2658
|
|
|
2620
2659
|
// src/hooks/useIsContract.ts
|
|
2621
2660
|
var import_viem11 = require("viem");
|
|
2622
|
-
var
|
|
2661
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
2623
2662
|
function useIsContract({
|
|
2624
2663
|
address,
|
|
2625
2664
|
chain,
|
|
2626
2665
|
enabled
|
|
2627
2666
|
}) {
|
|
2628
|
-
return (0,
|
|
2667
|
+
return (0, import_react_query9.useQuery)({
|
|
2629
2668
|
queryKey: ["is_contract", chain?.id, address],
|
|
2630
2669
|
queryFn: async () => {
|
|
2631
2670
|
if (!chain) return false;
|
|
@@ -2642,14 +2681,14 @@ function useIsContract({
|
|
|
2642
2681
|
}
|
|
2643
2682
|
|
|
2644
2683
|
// src/components/ImportToken/index.tsx
|
|
2645
|
-
var
|
|
2684
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
2646
2685
|
function ImportToken({ close }) {
|
|
2647
|
-
const [status, setStatus] = (0,
|
|
2686
|
+
const [status, setStatus] = (0, import_react40.useState)("");
|
|
2648
2687
|
const { token } = useUserInfo();
|
|
2649
|
-
const [address, setAddress] = (0,
|
|
2650
|
-
const [symbol, setSymbol] = (0,
|
|
2651
|
-
const [decimals, setDecimals] = (0,
|
|
2652
|
-
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)({});
|
|
2653
2692
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
2654
2693
|
const getContractInfo = async () => {
|
|
2655
2694
|
if (!publicClient) return;
|
|
@@ -2682,8 +2721,8 @@ function ImportToken({ close }) {
|
|
|
2682
2721
|
});
|
|
2683
2722
|
}
|
|
2684
2723
|
};
|
|
2685
|
-
const intl = (0,
|
|
2686
|
-
(0,
|
|
2724
|
+
const intl = (0, import_react_intl22.useIntl)();
|
|
2725
|
+
(0, import_react40.useEffect)(() => {
|
|
2687
2726
|
if (address.length === 42) {
|
|
2688
2727
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
2689
2728
|
if (!reg.test(address)) {
|
|
@@ -2702,9 +2741,9 @@ function ImportToken({ close }) {
|
|
|
2702
2741
|
}
|
|
2703
2742
|
}
|
|
2704
2743
|
}, [address, publicClient]);
|
|
2705
|
-
const [loading, setLoading] = (0,
|
|
2744
|
+
const [loading, setLoading] = (0, import_react40.useState)(false);
|
|
2706
2745
|
const toast = useToast();
|
|
2707
|
-
const queryClient2 = (0,
|
|
2746
|
+
const queryClient2 = (0, import_react_query10.useQueryClient)();
|
|
2708
2747
|
const onImport = async () => {
|
|
2709
2748
|
setLoading(true);
|
|
2710
2749
|
try {
|
|
@@ -2730,7 +2769,7 @@ function ImportToken({ close }) {
|
|
|
2730
2769
|
setLoading(false);
|
|
2731
2770
|
}
|
|
2732
2771
|
};
|
|
2733
|
-
const canImport = (0,
|
|
2772
|
+
const canImport = (0, import_react40.useMemo)(() => {
|
|
2734
2773
|
if (!address) {
|
|
2735
2774
|
return false;
|
|
2736
2775
|
}
|
|
@@ -2753,19 +2792,19 @@ function ImportToken({ close }) {
|
|
|
2753
2792
|
enabled: canImport
|
|
2754
2793
|
});
|
|
2755
2794
|
if (status == "success" || status == "fail") {
|
|
2756
|
-
return /* @__PURE__ */ (0,
|
|
2757
|
-
/* @__PURE__ */ (0,
|
|
2758
|
-
/* @__PURE__ */ (0,
|
|
2759
|
-
/* @__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" }) })
|
|
2760
2799
|
] }),
|
|
2761
|
-
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" }) })
|
|
2762
2801
|
] });
|
|
2763
2802
|
}
|
|
2764
|
-
return /* @__PURE__ */ (0,
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2766
|
-
/* @__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({
|
|
2767
2806
|
id: "tokenSmartContract"
|
|
2768
|
-
}), 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)(
|
|
2769
2808
|
Input,
|
|
2770
2809
|
{
|
|
2771
2810
|
placeholder: intl.formatMessage({
|
|
@@ -2776,9 +2815,9 @@ function ImportToken({ close }) {
|
|
|
2776
2815
|
maxLength: 42
|
|
2777
2816
|
}
|
|
2778
2817
|
) }),
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Field, { label: intl.formatMessage({
|
|
2780
2819
|
id: "tokenSymbol"
|
|
2781
|
-
}), error: error.symbol, children: /* @__PURE__ */ (0,
|
|
2820
|
+
}), error: error.symbol, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2782
2821
|
Input,
|
|
2783
2822
|
{
|
|
2784
2823
|
placeholder: intl.formatMessage({
|
|
@@ -2789,9 +2828,9 @@ function ImportToken({ close }) {
|
|
|
2789
2828
|
maxLength: 16
|
|
2790
2829
|
}
|
|
2791
2830
|
) }),
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2831
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Field, { label: intl.formatMessage({
|
|
2793
2832
|
id: "tokenDecimals"
|
|
2794
|
-
}), error: error.decimals, children: /* @__PURE__ */ (0,
|
|
2833
|
+
}), error: error.decimals, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2795
2834
|
Input,
|
|
2796
2835
|
{
|
|
2797
2836
|
placeholder: intl.formatMessage({
|
|
@@ -2803,7 +2842,7 @@ function ImportToken({ close }) {
|
|
|
2803
2842
|
}
|
|
2804
2843
|
) })
|
|
2805
2844
|
] }),
|
|
2806
|
-
/* @__PURE__ */ (0,
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
2807
2846
|
Button,
|
|
2808
2847
|
{
|
|
2809
2848
|
size: "lg",
|
|
@@ -2812,20 +2851,20 @@ function ImportToken({ close }) {
|
|
|
2812
2851
|
loading: loading || isContractQuery.isLoading,
|
|
2813
2852
|
disabled: !canImport || !isContractQuery.data,
|
|
2814
2853
|
highlight: true,
|
|
2815
|
-
children: /* @__PURE__ */ (0,
|
|
2854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl22.FormattedMessage, { id: "import" })
|
|
2816
2855
|
}
|
|
2817
2856
|
)
|
|
2818
2857
|
] });
|
|
2819
2858
|
}
|
|
2820
2859
|
|
|
2821
2860
|
// src/hooks/useMatchWallet.tsx
|
|
2822
|
-
var
|
|
2861
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
2823
2862
|
var ReceiveModal = () => {
|
|
2824
2863
|
const chain = useMatchChain();
|
|
2825
2864
|
const { address } = useWallet();
|
|
2826
2865
|
const [copied, setCopied] = useCopyClipboard();
|
|
2827
2866
|
const toast = useToast();
|
|
2828
|
-
const intl = (0,
|
|
2867
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
2829
2868
|
const onCopy = () => {
|
|
2830
2869
|
setCopied(address);
|
|
2831
2870
|
toast.success(intl.formatMessage({
|
|
@@ -2833,10 +2872,10 @@ var ReceiveModal = () => {
|
|
|
2833
2872
|
}));
|
|
2834
2873
|
};
|
|
2835
2874
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2836
|
-
return /* @__PURE__ */ (0,
|
|
2837
|
-
/* @__PURE__ */ (0,
|
|
2838
|
-
/* @__PURE__ */ (0,
|
|
2839
|
-
/* @__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)(
|
|
2840
2879
|
import_react_qrcode.QRCode,
|
|
2841
2880
|
{
|
|
2842
2881
|
margin: "0",
|
|
@@ -2844,7 +2883,7 @@ var ReceiveModal = () => {
|
|
|
2844
2883
|
value: address
|
|
2845
2884
|
}
|
|
2846
2885
|
) }),
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
2848
2887
|
"a",
|
|
2849
2888
|
{
|
|
2850
2889
|
href: chainLink,
|
|
@@ -2854,8 +2893,8 @@ var ReceiveModal = () => {
|
|
|
2854
2893
|
}
|
|
2855
2894
|
)
|
|
2856
2895
|
] }),
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2858
|
-
|
|
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,
|
|
2859
2898
|
{
|
|
2860
2899
|
id: "copyAddress"
|
|
2861
2900
|
}
|
|
@@ -2864,7 +2903,7 @@ var ReceiveModal = () => {
|
|
|
2864
2903
|
};
|
|
2865
2904
|
function useMatchWallet() {
|
|
2866
2905
|
const modal = useModal();
|
|
2867
|
-
const intl = (0,
|
|
2906
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
2868
2907
|
const showReceiveModal = () => {
|
|
2869
2908
|
modal.open({
|
|
2870
2909
|
title: intl.formatMessage({
|
|
@@ -2896,12 +2935,12 @@ function useMatchWallet() {
|
|
|
2896
2935
|
};
|
|
2897
2936
|
}
|
|
2898
2937
|
function useMatchWalletRecords() {
|
|
2899
|
-
const [hasMore, setHasMore] = (0,
|
|
2900
|
-
const [items, setItems] = (0,
|
|
2938
|
+
const [hasMore, setHasMore] = (0, import_react41.useState)(true);
|
|
2939
|
+
const [items, setItems] = (0, import_react41.useState)([]);
|
|
2901
2940
|
const { chainId, publicClient } = useMatchChain();
|
|
2902
2941
|
const { address } = useWallet();
|
|
2903
|
-
const hasMoreRef = (0,
|
|
2904
|
-
const nextPageParamsRef = (0,
|
|
2942
|
+
const hasMoreRef = (0, import_react41.useRef)(hasMore);
|
|
2943
|
+
const nextPageParamsRef = (0, import_react41.useRef)(void 0);
|
|
2905
2944
|
const { contracts, setContracts } = useContractStore_default();
|
|
2906
2945
|
const fetchMoreData = async () => {
|
|
2907
2946
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -2928,7 +2967,7 @@ function useMatchWalletRecords() {
|
|
|
2928
2967
|
hasMoreRef.current = true;
|
|
2929
2968
|
fetchMoreData();
|
|
2930
2969
|
};
|
|
2931
|
-
(0,
|
|
2970
|
+
(0, import_react41.useEffect)(() => {
|
|
2932
2971
|
if (chainId && address) {
|
|
2933
2972
|
onInit();
|
|
2934
2973
|
}
|
|
@@ -2984,7 +3023,7 @@ function useMatchWalletRecords() {
|
|
|
2984
3023
|
setContracts(contractMap);
|
|
2985
3024
|
}
|
|
2986
3025
|
};
|
|
2987
|
-
const list = (0,
|
|
3026
|
+
const list = (0, import_react41.useMemo)(() => {
|
|
2988
3027
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
2989
3028
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
2990
3029
|
removeList.forEach((item) => {
|
|
@@ -3026,7 +3065,7 @@ function useMatchWalletAssets({
|
|
|
3026
3065
|
chainId: chainId || 0,
|
|
3027
3066
|
...assetListOptions
|
|
3028
3067
|
});
|
|
3029
|
-
const mergedAssets = (0,
|
|
3068
|
+
const mergedAssets = (0, import_react41.useMemo)(() => {
|
|
3030
3069
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
3031
3070
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
3032
3071
|
...asset,
|
|
@@ -3094,7 +3133,7 @@ function useMatchWalletAssetList({
|
|
|
3094
3133
|
name: chain?.nativeCurrency.name,
|
|
3095
3134
|
balance: 0
|
|
3096
3135
|
};
|
|
3097
|
-
const nativeBalanceQuery = (0,
|
|
3136
|
+
const nativeBalanceQuery = (0, import_react_query11.useQuery)({
|
|
3098
3137
|
queryKey: ["nativeBalance", nativeToken?.chain_id],
|
|
3099
3138
|
queryFn: async () => {
|
|
3100
3139
|
if (!nativeToken || !publicClient) return null;
|
|
@@ -3113,8 +3152,8 @@ function useMatchWalletAssetList({
|
|
|
3113
3152
|
retry: 3
|
|
3114
3153
|
// Retry up to 3 times if failed
|
|
3115
3154
|
});
|
|
3116
|
-
const erc20Tokens = (0,
|
|
3117
|
-
const erc20BalanceQuery = (0,
|
|
3155
|
+
const erc20Tokens = (0, import_react41.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
3156
|
+
const erc20BalanceQuery = (0, import_react_query11.useQuery)({
|
|
3118
3157
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
3119
3158
|
queryFn: async () => {
|
|
3120
3159
|
if (!erc20Tokens.length || !publicClient) return [];
|
|
@@ -3141,7 +3180,7 @@ function useMatchWalletAssetList({
|
|
|
3141
3180
|
// Refresh every 15 seconds
|
|
3142
3181
|
retry: 3
|
|
3143
3182
|
});
|
|
3144
|
-
const enrichedAssets = (0,
|
|
3183
|
+
const enrichedAssets = (0, import_react41.useMemo)(() => {
|
|
3145
3184
|
if (!list) return [];
|
|
3146
3185
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
3147
3186
|
return list.map((asset) => {
|
|
@@ -3163,7 +3202,7 @@ function useMatchWalletAssetList({
|
|
|
3163
3202
|
return { ...asset, balance, value, balanceValue };
|
|
3164
3203
|
});
|
|
3165
3204
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
3166
|
-
(0,
|
|
3205
|
+
(0, import_react41.useEffect)(() => {
|
|
3167
3206
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
3168
3207
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
3169
3208
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -3188,14 +3227,14 @@ function useMatchWalletAssetList({
|
|
|
3188
3227
|
}
|
|
3189
3228
|
|
|
3190
3229
|
// src/hooks/useReceipt.tsx
|
|
3191
|
-
var
|
|
3192
|
-
var
|
|
3230
|
+
var import_react42 = require("react");
|
|
3231
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
3193
3232
|
var import_viem14 = require("viem");
|
|
3194
3233
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
3195
3234
|
var MAX_CACHE_SIZE = 500;
|
|
3196
3235
|
var STORAGE_KEY = "match_receipt_logs";
|
|
3197
3236
|
function useReceiptCache() {
|
|
3198
|
-
const [cache, setCache] = (0,
|
|
3237
|
+
const [cache, setCache] = (0, import_react42.useState)(/* @__PURE__ */ new Map());
|
|
3199
3238
|
const isLocalStorageAvailable = (() => {
|
|
3200
3239
|
try {
|
|
3201
3240
|
const testKey = "__test__";
|
|
@@ -3206,7 +3245,7 @@ function useReceiptCache() {
|
|
|
3206
3245
|
return false;
|
|
3207
3246
|
}
|
|
3208
3247
|
})();
|
|
3209
|
-
(0,
|
|
3248
|
+
(0, import_react42.useEffect)(() => {
|
|
3210
3249
|
if (isLocalStorageAvailable) {
|
|
3211
3250
|
try {
|
|
3212
3251
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3225,7 +3264,7 @@ function useReceiptCache() {
|
|
|
3225
3264
|
}
|
|
3226
3265
|
}
|
|
3227
3266
|
}, []);
|
|
3228
|
-
const updateLocalStorage = (0,
|
|
3267
|
+
const updateLocalStorage = (0, import_react42.useCallback)((updatedCache) => {
|
|
3229
3268
|
if (isLocalStorageAvailable) {
|
|
3230
3269
|
try {
|
|
3231
3270
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -3242,7 +3281,7 @@ function useReceiptCache() {
|
|
|
3242
3281
|
}
|
|
3243
3282
|
}
|
|
3244
3283
|
}, []);
|
|
3245
|
-
const set = (0,
|
|
3284
|
+
const set = (0, import_react42.useCallback)((key, value) => {
|
|
3246
3285
|
const now = Date.now();
|
|
3247
3286
|
const newCache = new Map(cache);
|
|
3248
3287
|
newCache.forEach((entry, k) => {
|
|
@@ -3260,7 +3299,7 @@ function useReceiptCache() {
|
|
|
3260
3299
|
setCache(newCache);
|
|
3261
3300
|
updateLocalStorage(newCache);
|
|
3262
3301
|
}, [cache, updateLocalStorage]);
|
|
3263
|
-
const get = (0,
|
|
3302
|
+
const get = (0, import_react42.useCallback)((key) => {
|
|
3264
3303
|
const entry = cache.get(key);
|
|
3265
3304
|
if (entry) {
|
|
3266
3305
|
if (Date.now() - entry.timestamp > CACHE_TTL) {
|
|
@@ -3274,7 +3313,7 @@ function useReceiptCache() {
|
|
|
3274
3313
|
}
|
|
3275
3314
|
return void 0;
|
|
3276
3315
|
}, [cache, updateLocalStorage]);
|
|
3277
|
-
const del = (0,
|
|
3316
|
+
const del = (0, import_react42.useCallback)((key) => {
|
|
3278
3317
|
if (cache.has(key)) {
|
|
3279
3318
|
const newCache = new Map(cache);
|
|
3280
3319
|
newCache.delete(key);
|
|
@@ -3282,7 +3321,7 @@ function useReceiptCache() {
|
|
|
3282
3321
|
updateLocalStorage(newCache);
|
|
3283
3322
|
}
|
|
3284
3323
|
}, [cache, updateLocalStorage]);
|
|
3285
|
-
const clear = (0,
|
|
3324
|
+
const clear = (0, import_react42.useCallback)(() => {
|
|
3286
3325
|
setCache(/* @__PURE__ */ new Map());
|
|
3287
3326
|
if (isLocalStorageAvailable) {
|
|
3288
3327
|
localStorage.removeItem(STORAGE_KEY);
|
|
@@ -3297,8 +3336,8 @@ function useReceipt2({
|
|
|
3297
3336
|
const { list } = useMatchChain();
|
|
3298
3337
|
const cache = useReceiptCache();
|
|
3299
3338
|
const chain = list?.find((item) => item.id === chainId);
|
|
3300
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3301
|
-
const query = (0,
|
|
3339
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react42.useState)(true);
|
|
3340
|
+
const query = (0, import_react_query12.useQuery)({
|
|
3302
3341
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
3303
3342
|
queryFn: async () => {
|
|
3304
3343
|
if (!chain || !hash) return false;
|
|
@@ -3323,7 +3362,7 @@ function useReceipt2({
|
|
|
3323
3362
|
},
|
|
3324
3363
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3325
3364
|
});
|
|
3326
|
-
(0,
|
|
3365
|
+
(0, import_react42.useEffect)(() => {
|
|
3327
3366
|
if (query.data) {
|
|
3328
3367
|
setShouldRefetch(false);
|
|
3329
3368
|
}
|
|
@@ -3332,14 +3371,14 @@ function useReceipt2({
|
|
|
3332
3371
|
}
|
|
3333
3372
|
|
|
3334
3373
|
// src/hooks/useTransaction.tsx
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3374
|
+
var import_react43 = require("react");
|
|
3375
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
3337
3376
|
var import_viem15 = require("viem");
|
|
3338
3377
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
3339
3378
|
var MAX_CACHE_SIZE2 = 500;
|
|
3340
3379
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
3341
3380
|
function useTransactionCache() {
|
|
3342
|
-
const [cache, setCache] = (0,
|
|
3381
|
+
const [cache, setCache] = (0, import_react43.useState)(/* @__PURE__ */ new Map());
|
|
3343
3382
|
const isLocalStorageAvailable = (() => {
|
|
3344
3383
|
try {
|
|
3345
3384
|
const testKey = "__test__";
|
|
@@ -3350,7 +3389,7 @@ function useTransactionCache() {
|
|
|
3350
3389
|
return false;
|
|
3351
3390
|
}
|
|
3352
3391
|
})();
|
|
3353
|
-
(0,
|
|
3392
|
+
(0, import_react43.useEffect)(() => {
|
|
3354
3393
|
if (isLocalStorageAvailable) {
|
|
3355
3394
|
try {
|
|
3356
3395
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3369,7 +3408,7 @@ function useTransactionCache() {
|
|
|
3369
3408
|
}
|
|
3370
3409
|
}
|
|
3371
3410
|
}, []);
|
|
3372
|
-
const updateLocalStorage = (0,
|
|
3411
|
+
const updateLocalStorage = (0, import_react43.useCallback)((updatedCache) => {
|
|
3373
3412
|
if (isLocalStorageAvailable) {
|
|
3374
3413
|
try {
|
|
3375
3414
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -3386,7 +3425,7 @@ function useTransactionCache() {
|
|
|
3386
3425
|
}
|
|
3387
3426
|
}
|
|
3388
3427
|
}, []);
|
|
3389
|
-
const set = (0,
|
|
3428
|
+
const set = (0, import_react43.useCallback)((key, value) => {
|
|
3390
3429
|
const now = Date.now();
|
|
3391
3430
|
const newCache = new Map(cache);
|
|
3392
3431
|
newCache.forEach((entry, k) => {
|
|
@@ -3404,7 +3443,7 @@ function useTransactionCache() {
|
|
|
3404
3443
|
setCache(newCache);
|
|
3405
3444
|
updateLocalStorage(newCache);
|
|
3406
3445
|
}, [cache, updateLocalStorage]);
|
|
3407
|
-
const get = (0,
|
|
3446
|
+
const get = (0, import_react43.useCallback)((key) => {
|
|
3408
3447
|
const entry = cache.get(key);
|
|
3409
3448
|
if (entry) {
|
|
3410
3449
|
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
@@ -3418,7 +3457,7 @@ function useTransactionCache() {
|
|
|
3418
3457
|
}
|
|
3419
3458
|
return void 0;
|
|
3420
3459
|
}, [cache, updateLocalStorage]);
|
|
3421
|
-
const del = (0,
|
|
3460
|
+
const del = (0, import_react43.useCallback)((key) => {
|
|
3422
3461
|
if (cache.has(key)) {
|
|
3423
3462
|
const newCache = new Map(cache);
|
|
3424
3463
|
newCache.delete(key);
|
|
@@ -3426,7 +3465,7 @@ function useTransactionCache() {
|
|
|
3426
3465
|
updateLocalStorage(newCache);
|
|
3427
3466
|
}
|
|
3428
3467
|
}, [cache, updateLocalStorage]);
|
|
3429
|
-
const clear = (0,
|
|
3468
|
+
const clear = (0, import_react43.useCallback)(() => {
|
|
3430
3469
|
setCache(/* @__PURE__ */ new Map());
|
|
3431
3470
|
if (isLocalStorageAvailable) {
|
|
3432
3471
|
localStorage.removeItem(STORAGE_KEY2);
|
|
@@ -3441,8 +3480,8 @@ function useTransaction({
|
|
|
3441
3480
|
const { list } = useMatchChain();
|
|
3442
3481
|
const cache = useTransactionCache();
|
|
3443
3482
|
const chain = list?.find((item) => item.id === chainId);
|
|
3444
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
3445
|
-
const query = (0,
|
|
3483
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react43.useState)(true);
|
|
3484
|
+
const query = (0, import_react_query13.useQuery)({
|
|
3446
3485
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
3447
3486
|
queryFn: async () => {
|
|
3448
3487
|
if (!chain || !hash) return false;
|
|
@@ -3467,7 +3506,7 @@ function useTransaction({
|
|
|
3467
3506
|
},
|
|
3468
3507
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
3469
3508
|
});
|
|
3470
|
-
(0,
|
|
3509
|
+
(0, import_react43.useEffect)(() => {
|
|
3471
3510
|
if (query.data) {
|
|
3472
3511
|
setShouldRefetch(false);
|
|
3473
3512
|
}
|