@matchain/matchid-sdk-react 0.1.52 → 0.1.53-alpha.1
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/{chunk-OL4R4SZU.mjs → chunk-2DVC6WCN.mjs} +105 -92
- package/dist/chunk-2DVC6WCN.mjs.map +1 -0
- package/dist/{chunk-KJQKG6RI.mjs → chunk-6QTW3KXN.mjs} +2 -2
- package/dist/components/index.js +61 -57
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/api/index.js +29 -26
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +3 -3
- package/dist/hooks/index.js +21 -17
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.css +18 -5
- package/dist/index.js +97 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/example/dist/assets/TransportWebHID-BEu7tC0r.js +1 -0
- package/example/dist/assets/bignumber-iG7K-qxw.js +10 -0
- package/example/dist/assets/ccip-a6wQ1Vcb.js +1 -0
- package/example/dist/assets/draggabilly-CRYR_S0q.js +14 -0
- package/example/dist/assets/index--dp9m9Ep.js +1 -0
- package/example/dist/assets/index-BDTHolFv.js +569 -0
- package/example/dist/assets/index-BZl59qLb.js +179 -0
- package/example/dist/assets/index-BmMbYNHO.js +303 -0
- package/example/dist/assets/index-C7cxVRDF.js +1677 -0
- package/example/dist/assets/index-CJk171Yb.js +1 -0
- package/example/dist/assets/index-CQiBesAa.js +3 -0
- package/example/dist/assets/index-D62loNA9.js +3 -0
- package/example/dist/assets/index-DqyX3FG6.js +1 -0
- package/example/dist/assets/index-Gy3FXGhr.css +1 -0
- package/example/dist/assets/inherits_browser-BlmhoU4v.js +1 -0
- package/example/dist/assets/solanaEmbed.esm-Djn-u4Vn.js +38 -0
- package/example/dist/index.html +14 -0
- package/example/package.json +2 -1
- package/example/src/App.tsx +18 -5
- package/example/src/store/useLocalStore.ts +9 -0
- package/package.json +1 -1
- package/dist/chunk-OL4R4SZU.mjs.map +0 -1
- /package/dist/{chunk-KJQKG6RI.mjs.map → chunk-6QTW3KXN.mjs.map} +0 -0
package/dist/hooks/api/index.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
bind_exports,
|
|
3
3
|
poh_exports,
|
|
4
4
|
user_exports
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-6QTW3KXN.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isSuccess,
|
|
8
8
|
wallet_exports
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2DVC6WCN.mjs";
|
|
10
10
|
import "../../chunk-UA6XHZHX.mjs";
|
|
11
|
-
import "../../chunk-FB5MHLWX.mjs";
|
|
12
11
|
import "../../chunk-HLUFAIFV.mjs";
|
|
12
|
+
import "../../chunk-FB5MHLWX.mjs";
|
|
13
13
|
import "../../chunk-LHNKZISB.mjs";
|
|
14
14
|
import "../../chunk-J5LGTIGS.mjs";
|
|
15
15
|
export {
|
package/dist/hooks/index.js
CHANGED
|
@@ -1762,7 +1762,9 @@ var useStore = (0, import_zustand4.create)((set) => ({
|
|
|
1762
1762
|
walletReady: false,
|
|
1763
1763
|
setWalletReady: (inited) => set({ walletReady: inited }),
|
|
1764
1764
|
tgAppAuthCode: "",
|
|
1765
|
-
setTgAppAuthCode: (code) => set({ tgAppAuthCode: code })
|
|
1765
|
+
setTgAppAuthCode: (code) => set({ tgAppAuthCode: code }),
|
|
1766
|
+
emailLoginKey: "",
|
|
1767
|
+
setEmailLoginKey: (key) => set({ emailLoginKey: key })
|
|
1766
1768
|
}));
|
|
1767
1769
|
var useStore_default = useStore;
|
|
1768
1770
|
|
|
@@ -1834,7 +1836,7 @@ function useUserInfo() {
|
|
|
1834
1836
|
locale,
|
|
1835
1837
|
refreshOverview
|
|
1836
1838
|
} = useLocalStore_default();
|
|
1837
|
-
const { setTgAppAuthCode } = useStore_default();
|
|
1839
|
+
const { setTgAppAuthCode, emailLoginKey, setEmailLoginKey } = useStore_default();
|
|
1838
1840
|
const { events, login } = useMatch();
|
|
1839
1841
|
const { open: SOLOpen } = useSOLModalStore();
|
|
1840
1842
|
const { open: TRONOpen } = useTRONModalStore();
|
|
@@ -1912,7 +1914,7 @@ function useUserInfo() {
|
|
|
1912
1914
|
case "evm":
|
|
1913
1915
|
return window.open(`${endpoints.auth}login/wallet?appid=${appid}&locale=${locale}`);
|
|
1914
1916
|
case "sol":
|
|
1915
|
-
return
|
|
1917
|
+
return window.open(`${endpoints.auth}login/sol?appid=${appid}&locale=${locale}`);
|
|
1916
1918
|
case "tron":
|
|
1917
1919
|
return TRONOpen("login");
|
|
1918
1920
|
case "ton":
|
|
@@ -1936,7 +1938,7 @@ function useUserInfo() {
|
|
|
1936
1938
|
const getLoginEmailCode = async (email) => {
|
|
1937
1939
|
const res = await getEmailCodeApi(email);
|
|
1938
1940
|
if (isSuccess(res)) {
|
|
1939
|
-
|
|
1941
|
+
setEmailLoginKey(res.data.key);
|
|
1940
1942
|
return res.data.key;
|
|
1941
1943
|
}
|
|
1942
1944
|
throw new Error(res.message);
|
|
@@ -1948,7 +1950,7 @@ function useUserInfo() {
|
|
|
1948
1950
|
try {
|
|
1949
1951
|
const obj = {
|
|
1950
1952
|
email,
|
|
1951
|
-
verification_key:
|
|
1953
|
+
verification_key: emailLoginKey,
|
|
1952
1954
|
verification_code: code
|
|
1953
1955
|
};
|
|
1954
1956
|
const res = await verifyEmailCodeApi(obj);
|
|
@@ -2460,10 +2462,12 @@ function useImportTokenListQuery({
|
|
|
2460
2462
|
// src/hooks/useMatchChain.tsx
|
|
2461
2463
|
var import_react36 = require("react");
|
|
2462
2464
|
var import_viem8 = require("viem");
|
|
2465
|
+
var import_react_intl20 = require("react-intl");
|
|
2463
2466
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
2464
2467
|
function useMatchChain() {
|
|
2465
2468
|
const chainListQuery = useChainListQuery();
|
|
2466
2469
|
const modal = useModal();
|
|
2470
|
+
const intl = (0, import_react_intl20.useIntl)();
|
|
2467
2471
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
2468
2472
|
const chainId = (0, import_react36.useMemo)(() => {
|
|
2469
2473
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
@@ -2511,12 +2515,12 @@ function useMatchChain() {
|
|
|
2511
2515
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
2512
2516
|
setChainId2(selectedChainId || 0);
|
|
2513
2517
|
close();
|
|
2514
|
-
}, block: true, children: "
|
|
2518
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react_intl20.FormattedMessage, { id: "confirm" }) })
|
|
2515
2519
|
] });
|
|
2516
2520
|
}
|
|
2517
2521
|
const showChangeNetwork = () => {
|
|
2518
2522
|
modal.open({
|
|
2519
|
-
title: "
|
|
2523
|
+
title: intl.formatMessage({ id: "changeNetwork" }),
|
|
2520
2524
|
content: ChangeNetwork
|
|
2521
2525
|
});
|
|
2522
2526
|
};
|
|
@@ -2551,11 +2555,11 @@ var import_react_qrcode = require("react-qrcode");
|
|
|
2551
2555
|
var import_react38 = require("react");
|
|
2552
2556
|
var import_react_query8 = require("@tanstack/react-query");
|
|
2553
2557
|
var import_viem11 = require("viem");
|
|
2554
|
-
var
|
|
2558
|
+
var import_react_intl22 = require("react-intl");
|
|
2555
2559
|
|
|
2556
2560
|
// src/components/ImportToken/index.tsx
|
|
2557
2561
|
var import_react37 = require("react");
|
|
2558
|
-
var
|
|
2562
|
+
var import_react_intl21 = require("react-intl");
|
|
2559
2563
|
var import_react_query7 = require("@tanstack/react-query");
|
|
2560
2564
|
var import_viem10 = require("viem");
|
|
2561
2565
|
|
|
@@ -2624,7 +2628,7 @@ function ImportToken({ close }) {
|
|
|
2624
2628
|
});
|
|
2625
2629
|
}
|
|
2626
2630
|
};
|
|
2627
|
-
const intl = (0,
|
|
2631
|
+
const intl = (0, import_react_intl21.useIntl)();
|
|
2628
2632
|
(0, import_react37.useEffect)(() => {
|
|
2629
2633
|
if (address.length === 42) {
|
|
2630
2634
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
@@ -2698,9 +2702,9 @@ function ImportToken({ close }) {
|
|
|
2698
2702
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
2699
2703
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
2700
2704
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("img", { src: status == "success" ? success_default : fail_default, alt: status == "success" ? "success" : "fail", className: `matchid-import-token-result-img` }),
|
|
2701
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "importFail" }) })
|
|
2702
2706
|
] }),
|
|
2703
|
-
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
2707
|
+
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "back" }) })
|
|
2704
2708
|
] });
|
|
2705
2709
|
}
|
|
2706
2710
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token`, children: [
|
|
@@ -2754,7 +2758,7 @@ function ImportToken({ close }) {
|
|
|
2754
2758
|
loading: loading || isContractQuery.isLoading,
|
|
2755
2759
|
disabled: !canImport || !isContractQuery.data,
|
|
2756
2760
|
highlight: true,
|
|
2757
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
2761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl21.FormattedMessage, { id: "import" })
|
|
2758
2762
|
}
|
|
2759
2763
|
)
|
|
2760
2764
|
] });
|
|
@@ -2767,7 +2771,7 @@ var ReceiveModal = () => {
|
|
|
2767
2771
|
const { address } = useWallet2();
|
|
2768
2772
|
const [copied, setCopied] = useCopyClipboard();
|
|
2769
2773
|
const toast = useToast();
|
|
2770
|
-
const intl = (0,
|
|
2774
|
+
const intl = (0, import_react_intl22.useIntl)();
|
|
2771
2775
|
const onCopy = () => {
|
|
2772
2776
|
setCopied(address);
|
|
2773
2777
|
toast.success(intl.formatMessage({
|
|
@@ -2777,7 +2781,7 @@ var ReceiveModal = () => {
|
|
|
2777
2781
|
const chainLink = chain.explorerLink("address/" + address);
|
|
2778
2782
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-receive-modal`, children: [
|
|
2779
2783
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "matchid-receive-container", children: [
|
|
2780
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_intl22.FormattedMessage, { id: "receiveQrcode" }) }),
|
|
2781
2785
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
2782
2786
|
import_react_qrcode.QRCode,
|
|
2783
2787
|
{
|
|
@@ -2797,7 +2801,7 @@ var ReceiveModal = () => {
|
|
|
2797
2801
|
)
|
|
2798
2802
|
] }),
|
|
2799
2803
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
2800
|
-
|
|
2804
|
+
import_react_intl22.FormattedMessage,
|
|
2801
2805
|
{
|
|
2802
2806
|
id: "copyAddress"
|
|
2803
2807
|
}
|
|
@@ -2806,7 +2810,7 @@ var ReceiveModal = () => {
|
|
|
2806
2810
|
};
|
|
2807
2811
|
function useMatchWallet() {
|
|
2808
2812
|
const modal = useModal();
|
|
2809
|
-
const intl = (0,
|
|
2813
|
+
const intl = (0, import_react_intl22.useIntl)();
|
|
2810
2814
|
const showReceiveModal = () => {
|
|
2811
2815
|
modal.open({
|
|
2812
2816
|
title: intl.formatMessage({
|