@matchain/matchid-sdk-react 0.1.26-alpha.4 → 0.1.26-alpha.5
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/index.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +95 -775
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -1003
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -996,12 +996,6 @@ function firstUpperCase(str) {
|
|
|
996
996
|
|
|
997
997
|
// src/store/useModalStore.ts
|
|
998
998
|
import { create as create2 } from "zustand";
|
|
999
|
-
var useEVMModalStore = create2((set) => ({
|
|
1000
|
-
isOpen: false,
|
|
1001
|
-
type: "",
|
|
1002
|
-
open: (type) => set({ isOpen: true, type }),
|
|
1003
|
-
close: () => set({ isOpen: false })
|
|
1004
|
-
}));
|
|
1005
999
|
var useSOLModalStore = create2((set) => ({
|
|
1006
1000
|
isOpen: false,
|
|
1007
1001
|
type: "",
|
|
@@ -1023,7 +1017,6 @@ function useUserInfo() {
|
|
|
1023
1017
|
endpoints
|
|
1024
1018
|
} = useLocalStore_default();
|
|
1025
1019
|
const { events, login } = useMatch();
|
|
1026
|
-
const { open: EVMOpen } = useEVMModalStore();
|
|
1027
1020
|
const { open: SOLOpen } = useSOLModalStore();
|
|
1028
1021
|
const isLogin = useMemo(() => !!token, [token]);
|
|
1029
1022
|
const logout = async () => {
|
|
@@ -1053,7 +1046,7 @@ function useUserInfo() {
|
|
|
1053
1046
|
return loginByMethod("google");
|
|
1054
1047
|
};
|
|
1055
1048
|
const loginByWallet = async () => {
|
|
1056
|
-
return
|
|
1049
|
+
return window.open(`${endpoints.auth}login/wallet?appid=${appid}`);
|
|
1057
1050
|
};
|
|
1058
1051
|
const loginByTelegram = async () => {
|
|
1059
1052
|
return window.open(
|
|
@@ -1066,7 +1059,7 @@ function useUserInfo() {
|
|
|
1066
1059
|
const loginMethod = async (method) => {
|
|
1067
1060
|
switch (method) {
|
|
1068
1061
|
case "evm":
|
|
1069
|
-
return
|
|
1062
|
+
return window.open(`${endpoints.auth}login/wallet?appid=${appid}`);
|
|
1070
1063
|
case "sol":
|
|
1071
1064
|
return SOLOpen("login");
|
|
1072
1065
|
case "telegram":
|
|
@@ -1126,7 +1119,7 @@ function useUserInfo() {
|
|
|
1126
1119
|
if (!token) {
|
|
1127
1120
|
throw new Error("You must login first");
|
|
1128
1121
|
}
|
|
1129
|
-
return
|
|
1122
|
+
return window.open(`${endpoints.auth}bind/wallet?appid=${appid}&st=` + encodeURIComponent(encodeBase64(token)));
|
|
1130
1123
|
};
|
|
1131
1124
|
const bindTelegram = async () => {
|
|
1132
1125
|
if (!token) {
|
|
@@ -1152,7 +1145,7 @@ function useUserInfo() {
|
|
|
1152
1145
|
}
|
|
1153
1146
|
switch (method) {
|
|
1154
1147
|
case "evm":
|
|
1155
|
-
return
|
|
1148
|
+
return window.open(`${endpoints.auth}bind/wallet?appid=${appid}&st=` + encodeURIComponent(encodeBase64(token)));
|
|
1156
1149
|
case "sol":
|
|
1157
1150
|
return SOLOpen("bind");
|
|
1158
1151
|
case "telegram":
|
|
@@ -1543,235 +1536,13 @@ function RecoveryModal({
|
|
|
1543
1536
|
] }) });
|
|
1544
1537
|
}
|
|
1545
1538
|
|
|
1546
|
-
// src/components/
|
|
1547
|
-
import {
|
|
1548
|
-
import { useAccount, useAccountEffect, useChainId, useConfig, useDisconnect } from "wagmi";
|
|
1549
|
-
|
|
1550
|
-
// src/hooks/useEthersSigner.ts
|
|
1551
|
-
import * as React from "react";
|
|
1552
|
-
import { useWalletClient } from "wagmi";
|
|
1553
|
-
import { providers } from "ethers";
|
|
1554
|
-
|
|
1555
|
-
// node_modules/@wagmi/core/dist/esm/version.js
|
|
1556
|
-
var version = "2.16.3";
|
|
1557
|
-
|
|
1558
|
-
// node_modules/@wagmi/core/dist/esm/utils/getVersion.js
|
|
1559
|
-
var getVersion2 = () => `@wagmi/core@${version}`;
|
|
1560
|
-
|
|
1561
|
-
// node_modules/@wagmi/core/dist/esm/errors/base.js
|
|
1562
|
-
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
1563
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1564
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1565
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1566
|
-
};
|
|
1567
|
-
var _BaseError_instances;
|
|
1568
|
-
var _BaseError_walk;
|
|
1569
|
-
var BaseError = class _BaseError extends Error {
|
|
1570
|
-
get docsBaseUrl() {
|
|
1571
|
-
return "https://wagmi.sh/core";
|
|
1572
|
-
}
|
|
1573
|
-
get version() {
|
|
1574
|
-
return getVersion2();
|
|
1575
|
-
}
|
|
1576
|
-
constructor(shortMessage, options = {}) {
|
|
1577
|
-
super();
|
|
1578
|
-
_BaseError_instances.add(this);
|
|
1579
|
-
Object.defineProperty(this, "details", {
|
|
1580
|
-
enumerable: true,
|
|
1581
|
-
configurable: true,
|
|
1582
|
-
writable: true,
|
|
1583
|
-
value: void 0
|
|
1584
|
-
});
|
|
1585
|
-
Object.defineProperty(this, "docsPath", {
|
|
1586
|
-
enumerable: true,
|
|
1587
|
-
configurable: true,
|
|
1588
|
-
writable: true,
|
|
1589
|
-
value: void 0
|
|
1590
|
-
});
|
|
1591
|
-
Object.defineProperty(this, "metaMessages", {
|
|
1592
|
-
enumerable: true,
|
|
1593
|
-
configurable: true,
|
|
1594
|
-
writable: true,
|
|
1595
|
-
value: void 0
|
|
1596
|
-
});
|
|
1597
|
-
Object.defineProperty(this, "shortMessage", {
|
|
1598
|
-
enumerable: true,
|
|
1599
|
-
configurable: true,
|
|
1600
|
-
writable: true,
|
|
1601
|
-
value: void 0
|
|
1602
|
-
});
|
|
1603
|
-
Object.defineProperty(this, "name", {
|
|
1604
|
-
enumerable: true,
|
|
1605
|
-
configurable: true,
|
|
1606
|
-
writable: true,
|
|
1607
|
-
value: "WagmiCoreError"
|
|
1608
|
-
});
|
|
1609
|
-
const details = options.cause instanceof _BaseError ? options.cause.details : options.cause?.message ? options.cause.message : options.details;
|
|
1610
|
-
const docsPath = options.cause instanceof _BaseError ? options.cause.docsPath || options.docsPath : options.docsPath;
|
|
1611
|
-
this.message = [
|
|
1612
|
-
shortMessage || "An error occurred.",
|
|
1613
|
-
"",
|
|
1614
|
-
...options.metaMessages ? [...options.metaMessages, ""] : [],
|
|
1615
|
-
...docsPath ? [
|
|
1616
|
-
`Docs: ${this.docsBaseUrl}${docsPath}.html${options.docsSlug ? `#${options.docsSlug}` : ""}`
|
|
1617
|
-
] : [],
|
|
1618
|
-
...details ? [`Details: ${details}`] : [],
|
|
1619
|
-
`Version: ${this.version}`
|
|
1620
|
-
].join("\n");
|
|
1621
|
-
if (options.cause)
|
|
1622
|
-
this.cause = options.cause;
|
|
1623
|
-
this.details = details;
|
|
1624
|
-
this.docsPath = docsPath;
|
|
1625
|
-
this.metaMessages = options.metaMessages;
|
|
1626
|
-
this.shortMessage = shortMessage;
|
|
1627
|
-
}
|
|
1628
|
-
walk(fn) {
|
|
1629
|
-
return __classPrivateFieldGet(this, _BaseError_instances, "m", _BaseError_walk).call(this, this, fn);
|
|
1630
|
-
}
|
|
1631
|
-
};
|
|
1632
|
-
_BaseError_instances = /* @__PURE__ */ new WeakSet(), _BaseError_walk = function _BaseError_walk2(err, fn) {
|
|
1633
|
-
if (fn?.(err))
|
|
1634
|
-
return err;
|
|
1635
|
-
if (err.cause)
|
|
1636
|
-
return __classPrivateFieldGet(this, _BaseError_instances, "m", _BaseError_walk2).call(this, err.cause, fn);
|
|
1637
|
-
return err;
|
|
1638
|
-
};
|
|
1639
|
-
|
|
1640
|
-
// node_modules/@wagmi/core/dist/esm/errors/config.js
|
|
1641
|
-
var ConnectorNotConnectedError = class extends BaseError {
|
|
1642
|
-
constructor() {
|
|
1643
|
-
super("Connector not connected.");
|
|
1644
|
-
Object.defineProperty(this, "name", {
|
|
1645
|
-
enumerable: true,
|
|
1646
|
-
configurable: true,
|
|
1647
|
-
writable: true,
|
|
1648
|
-
value: "ConnectorNotConnectedError"
|
|
1649
|
-
});
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
var ConnectorAccountNotFoundError = class extends BaseError {
|
|
1653
|
-
constructor({ address, connector }) {
|
|
1654
|
-
super(`Account "${address}" not found for connector "${connector.name}".`);
|
|
1655
|
-
Object.defineProperty(this, "name", {
|
|
1656
|
-
enumerable: true,
|
|
1657
|
-
configurable: true,
|
|
1658
|
-
writable: true,
|
|
1659
|
-
value: "ConnectorAccountNotFoundError"
|
|
1660
|
-
});
|
|
1661
|
-
}
|
|
1662
|
-
};
|
|
1663
|
-
var ConnectorChainMismatchError = class extends BaseError {
|
|
1664
|
-
constructor({ connectionChainId, connectorChainId }) {
|
|
1665
|
-
super(`The current chain of the connector (id: ${connectorChainId}) does not match the connection's chain (id: ${connectionChainId}).`, {
|
|
1666
|
-
metaMessages: [
|
|
1667
|
-
`Current Chain ID: ${connectorChainId}`,
|
|
1668
|
-
`Expected Chain ID: ${connectionChainId}`
|
|
1669
|
-
]
|
|
1670
|
-
});
|
|
1671
|
-
Object.defineProperty(this, "name", {
|
|
1672
|
-
enumerable: true,
|
|
1673
|
-
configurable: true,
|
|
1674
|
-
writable: true,
|
|
1675
|
-
value: "ConnectorChainMismatchError"
|
|
1676
|
-
});
|
|
1677
|
-
}
|
|
1678
|
-
};
|
|
1679
|
-
var ConnectorUnavailableReconnectingError = class extends BaseError {
|
|
1680
|
-
constructor({ connector }) {
|
|
1681
|
-
super(`Connector "${connector.name}" unavailable while reconnecting.`, {
|
|
1682
|
-
details: [
|
|
1683
|
-
"During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.",
|
|
1684
|
-
"All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.",
|
|
1685
|
-
"This error commonly occurs for connectors that asynchronously inject after reconnection has already started."
|
|
1686
|
-
].join(" ")
|
|
1687
|
-
});
|
|
1688
|
-
Object.defineProperty(this, "name", {
|
|
1689
|
-
enumerable: true,
|
|
1690
|
-
configurable: true,
|
|
1691
|
-
writable: true,
|
|
1692
|
-
value: "ConnectorUnavailableReconnectingError"
|
|
1693
|
-
});
|
|
1694
|
-
}
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
// node_modules/@wagmi/core/dist/esm/actions/getConnectorClient.js
|
|
1698
|
-
import { createClient, custom } from "viem";
|
|
1699
|
-
import { getAddress, parseAccount } from "viem/utils";
|
|
1700
|
-
async function getConnectorClient(config, parameters = {}) {
|
|
1701
|
-
let connection;
|
|
1702
|
-
if (parameters.connector) {
|
|
1703
|
-
const { connector: connector2 } = parameters;
|
|
1704
|
-
if (config.state.status === "reconnecting" && !connector2.getAccounts && !connector2.getChainId)
|
|
1705
|
-
throw new ConnectorUnavailableReconnectingError({ connector: connector2 });
|
|
1706
|
-
const [accounts, chainId2] = await Promise.all([
|
|
1707
|
-
connector2.getAccounts(),
|
|
1708
|
-
connector2.getChainId()
|
|
1709
|
-
]);
|
|
1710
|
-
connection = {
|
|
1711
|
-
accounts,
|
|
1712
|
-
chainId: chainId2,
|
|
1713
|
-
connector: connector2
|
|
1714
|
-
};
|
|
1715
|
-
} else
|
|
1716
|
-
connection = config.state.connections.get(config.state.current);
|
|
1717
|
-
if (!connection)
|
|
1718
|
-
throw new ConnectorNotConnectedError();
|
|
1719
|
-
const chainId = parameters.chainId ?? connection.chainId;
|
|
1720
|
-
const connectorChainId = await connection.connector.getChainId();
|
|
1721
|
-
if (connectorChainId !== connection.chainId)
|
|
1722
|
-
throw new ConnectorChainMismatchError({
|
|
1723
|
-
connectionChainId: connection.chainId,
|
|
1724
|
-
connectorChainId
|
|
1725
|
-
});
|
|
1726
|
-
const connector = connection.connector;
|
|
1727
|
-
if (connector.getClient)
|
|
1728
|
-
return connector.getClient({ chainId });
|
|
1729
|
-
const account = parseAccount(parameters.account ?? connection.accounts[0]);
|
|
1730
|
-
account.address = getAddress(account.address);
|
|
1731
|
-
if (parameters.account && !connection.accounts.some((x) => x.toLowerCase() === account.address.toLowerCase()))
|
|
1732
|
-
throw new ConnectorAccountNotFoundError({
|
|
1733
|
-
address: account.address,
|
|
1734
|
-
connector
|
|
1735
|
-
});
|
|
1736
|
-
const chain = config.chains.find((chain2) => chain2.id === chainId);
|
|
1737
|
-
const provider = await connection.connector.getProvider({ chainId });
|
|
1738
|
-
return createClient({
|
|
1739
|
-
account,
|
|
1740
|
-
chain,
|
|
1741
|
-
name: "Connector Client",
|
|
1742
|
-
transport: (opts) => custom(provider)({ ...opts, retryCount: 0 })
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
// node_modules/@wagmi/core/dist/esm/exports/index.js
|
|
1747
|
-
import { custom as custom2, http, webSocket } from "viem";
|
|
1748
|
-
|
|
1749
|
-
// src/hooks/useEthersSigner.ts
|
|
1750
|
-
function clientToSigner(client) {
|
|
1751
|
-
const { account, chain, transport } = client;
|
|
1752
|
-
const network = {
|
|
1753
|
-
chainId: chain.id,
|
|
1754
|
-
name: chain.name,
|
|
1755
|
-
ensAddress: chain.contracts?.ensRegistry?.address
|
|
1756
|
-
};
|
|
1757
|
-
const provider = new providers.Web3Provider(transport, network);
|
|
1758
|
-
const signer = provider.getSigner(account.address);
|
|
1759
|
-
return signer;
|
|
1760
|
-
}
|
|
1761
|
-
async function getEthersSigner(config, { chainId } = {}) {
|
|
1762
|
-
const client = await getConnectorClient(config, { chainId });
|
|
1763
|
-
return clientToSigner(client);
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
// src/components/EVMModal/index.tsx
|
|
1767
|
-
import React4, { useEffect as useEffect10, useMemo as useMemo10, useState as useState14 } from "react";
|
|
1768
|
-
import { SiweMessage } from "siwe";
|
|
1539
|
+
// src/components/SOLModal/index.tsx
|
|
1540
|
+
import React2, { useEffect as useEffect9, useMemo as useMemo8, useState as useState13 } from "react";
|
|
1769
1541
|
|
|
1770
1542
|
// src/components/index.tsx
|
|
1771
1543
|
var components_exports = {};
|
|
1772
1544
|
__export(components_exports, {
|
|
1773
1545
|
Button: () => Button,
|
|
1774
|
-
EVMModal: () => EVMModal,
|
|
1775
1546
|
EmailModal: () => EmailModal,
|
|
1776
1547
|
Field: () => Field,
|
|
1777
1548
|
Input: () => Input,
|
|
@@ -1791,7 +1562,7 @@ __export(components_exports, {
|
|
|
1791
1562
|
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
1792
1563
|
|
|
1793
1564
|
// src/components/EmailModal/StepEmail.tsx
|
|
1794
|
-
import { useEffect as useEffect5, useMemo as
|
|
1565
|
+
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
1795
1566
|
import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1796
1567
|
function StepEmail(props) {
|
|
1797
1568
|
const [emailVal, setEmailVal] = useState5("");
|
|
@@ -1800,7 +1571,7 @@ function StepEmail(props) {
|
|
|
1800
1571
|
setEmailVal(props.email);
|
|
1801
1572
|
}
|
|
1802
1573
|
}, []);
|
|
1803
|
-
const canContinue =
|
|
1574
|
+
const canContinue = useMemo4(() => {
|
|
1804
1575
|
return isValidEmail(emailVal);
|
|
1805
1576
|
}, [emailVal]);
|
|
1806
1577
|
const onContinue = async () => {
|
|
@@ -1822,7 +1593,7 @@ function StepEmail(props) {
|
|
|
1822
1593
|
}
|
|
1823
1594
|
|
|
1824
1595
|
// src/components/EmailModal/StepVerify.tsx
|
|
1825
|
-
import { useEffect as useEffect6, useMemo as
|
|
1596
|
+
import { useEffect as useEffect6, useMemo as useMemo5, useRef, useState as useState6 } from "react";
|
|
1826
1597
|
|
|
1827
1598
|
// src/config/index.tsx
|
|
1828
1599
|
var EMAIL_INTERVAL = 60;
|
|
@@ -1874,7 +1645,7 @@ function StepVerify(props) {
|
|
|
1874
1645
|
}
|
|
1875
1646
|
};
|
|
1876
1647
|
}, []);
|
|
1877
|
-
const canContinue =
|
|
1648
|
+
const canContinue = useMemo5(() => {
|
|
1878
1649
|
return code.length === codeLength;
|
|
1879
1650
|
}, [code]);
|
|
1880
1651
|
const onContinue = async () => {
|
|
@@ -2001,7 +1772,7 @@ function Popover({
|
|
|
2001
1772
|
}
|
|
2002
1773
|
|
|
2003
1774
|
// src/components/LoginBox/index.tsx
|
|
2004
|
-
import { useMemo as
|
|
1775
|
+
import { useMemo as useMemo6, useState as useState9 } from "react";
|
|
2005
1776
|
|
|
2006
1777
|
// src/assets/icon/SOLIcon.tsx
|
|
2007
1778
|
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
@@ -2099,7 +1870,7 @@ function LoginBox({
|
|
|
2099
1870
|
"twitter"
|
|
2100
1871
|
// 'facebook',
|
|
2101
1872
|
];
|
|
2102
|
-
const methodList =
|
|
1873
|
+
const methodList = useMemo6(() => {
|
|
2103
1874
|
return methods || defaultMethods;
|
|
2104
1875
|
}, [methods]);
|
|
2105
1876
|
const LoginItem = ({
|
|
@@ -2354,7 +2125,7 @@ function LoginButton({
|
|
|
2354
2125
|
}
|
|
2355
2126
|
|
|
2356
2127
|
// src/components/UsernameModal/index.tsx
|
|
2357
|
-
import { useEffect as useEffect8, useMemo as
|
|
2128
|
+
import { useEffect as useEffect8, useMemo as useMemo7, useState as useState12 } from "react";
|
|
2358
2129
|
|
|
2359
2130
|
// src/assets/icon/InfoRoundIcon.tsx
|
|
2360
2131
|
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
@@ -2404,10 +2175,10 @@ function UsernameModal({
|
|
|
2404
2175
|
setError("");
|
|
2405
2176
|
}
|
|
2406
2177
|
}, [isOpen]);
|
|
2407
|
-
const isValid =
|
|
2178
|
+
const isValid = useMemo7(() => {
|
|
2408
2179
|
return isValidUsername(val);
|
|
2409
2180
|
}, [val]);
|
|
2410
|
-
const isLength =
|
|
2181
|
+
const isLength = useMemo7(() => {
|
|
2411
2182
|
return val.length >= 2 && val.length <= 32;
|
|
2412
2183
|
}, [val]);
|
|
2413
2184
|
const isSafe = isValid && isLength;
|
|
@@ -2463,7 +2234,6 @@ function UsernameModal({
|
|
|
2463
2234
|
}
|
|
2464
2235
|
|
|
2465
2236
|
// src/components/SOLModal/index.tsx
|
|
2466
|
-
import React3, { useEffect as useEffect9, useMemo as useMemo9, useState as useState13 } from "react";
|
|
2467
2237
|
import { clusterApiUrl } from "@solana/web3.js";
|
|
2468
2238
|
import { useWallet as useWallet2, WalletProvider, ConnectionProvider } from "@solana/wallet-adapter-react";
|
|
2469
2239
|
import { WalletModalProvider, useWalletModal } from "@solana/wallet-adapter-react-ui";
|
|
@@ -2532,7 +2302,7 @@ function WalletContent({
|
|
|
2532
2302
|
const wallet = useWallet2();
|
|
2533
2303
|
const { events, login } = useMatch();
|
|
2534
2304
|
const [status, setStatus] = useState13("");
|
|
2535
|
-
const statusRef =
|
|
2305
|
+
const statusRef = React2.useRef(status);
|
|
2536
2306
|
const [error, setError] = useState13("");
|
|
2537
2307
|
useEffect9(() => {
|
|
2538
2308
|
const init = async () => {
|
|
@@ -2602,7 +2372,7 @@ function WalletContent({
|
|
|
2602
2372
|
statusRef.current = "";
|
|
2603
2373
|
}
|
|
2604
2374
|
};
|
|
2605
|
-
const pageData =
|
|
2375
|
+
const pageData = useMemo8(() => {
|
|
2606
2376
|
if (status == "success") {
|
|
2607
2377
|
return {
|
|
2608
2378
|
btnText: "Disconnect Wallet",
|
|
@@ -2723,201 +2493,15 @@ function SOLModal({
|
|
|
2723
2493
|
return /* @__PURE__ */ jsx45(ModalWithHeader, { ...props, title: props.title || firstUpperCase(type + " SOL Wallet"), children: /* @__PURE__ */ jsx45(ConnectionProvider, { endpoint: clusterApiUrl("devnet"), children: /* @__PURE__ */ jsx45(WalletProvider, { wallets, autoConnect: true, children: /* @__PURE__ */ jsx45(WalletModalProvider, { children: /* @__PURE__ */ jsx45(WalletContent, { onSuccess, type }) }) }) }) });
|
|
2724
2494
|
}
|
|
2725
2495
|
|
|
2726
|
-
// src/components/EVMModal/index.tsx
|
|
2727
|
-
import "@rainbow-me/rainbowkit/styles.css";
|
|
2728
|
-
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2729
|
-
function WalletContent2({
|
|
2730
|
-
onSuccess,
|
|
2731
|
-
type
|
|
2732
|
-
}) {
|
|
2733
|
-
return /* @__PURE__ */ jsx46("div", {});
|
|
2734
|
-
const config = useConfig();
|
|
2735
|
-
const { openConnectModal, connectModalOpen } = useConnectModal();
|
|
2736
|
-
const { address } = useAccount();
|
|
2737
|
-
const { disconnect } = useDisconnect({ config });
|
|
2738
|
-
const chainId = useChainId();
|
|
2739
|
-
const { events, login } = useMatch();
|
|
2740
|
-
const [status, setStatus] = useState14("");
|
|
2741
|
-
const statusRef = React4.useRef(status);
|
|
2742
|
-
const [error, setError] = useState14("");
|
|
2743
|
-
useEffect10(() => {
|
|
2744
|
-
if (openConnectModal) {
|
|
2745
|
-
disconnect();
|
|
2746
|
-
openConnectModal && openConnectModal();
|
|
2747
|
-
}
|
|
2748
|
-
return () => {
|
|
2749
|
-
address && disconnect();
|
|
2750
|
-
};
|
|
2751
|
-
}, [openConnectModal]);
|
|
2752
|
-
useAccountEffect({
|
|
2753
|
-
onDisconnect() {
|
|
2754
|
-
matchlog_default.log("onDisconnect");
|
|
2755
|
-
setStatus("");
|
|
2756
|
-
statusRef.current = "";
|
|
2757
|
-
},
|
|
2758
|
-
onConnect(data) {
|
|
2759
|
-
matchlog_default.log("onConnect", data, status);
|
|
2760
|
-
setStatus("");
|
|
2761
|
-
statusRef.current = "";
|
|
2762
|
-
toLoginInWallet(data);
|
|
2763
|
-
}
|
|
2764
|
-
});
|
|
2765
|
-
const toLoginInWallet = async (data) => {
|
|
2766
|
-
if (statusRef.current) return;
|
|
2767
|
-
try {
|
|
2768
|
-
const signer = await getEthersSigner(config);
|
|
2769
|
-
if (!signer || !chainId || !data.address) return;
|
|
2770
|
-
setStatus("nonce");
|
|
2771
|
-
statusRef.current = "nonce";
|
|
2772
|
-
const res = type == "bind" ? await getWalletInitApi({ address: data.address }) : await getWalletNonceApi({ address: data.address });
|
|
2773
|
-
if (!isSuccess(res)) {
|
|
2774
|
-
throw new Error(res.message);
|
|
2775
|
-
}
|
|
2776
|
-
const domain = window.location.host;
|
|
2777
|
-
const origin = window.location.origin;
|
|
2778
|
-
const nonce = res.code >= 0 ? res.data.nonce : null;
|
|
2779
|
-
if (nonce) {
|
|
2780
|
-
setStatus("signer");
|
|
2781
|
-
statusRef.current = "signer";
|
|
2782
|
-
const params = {
|
|
2783
|
-
domain,
|
|
2784
|
-
address: data.address,
|
|
2785
|
-
statement: "By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",
|
|
2786
|
-
uri: origin,
|
|
2787
|
-
nonce,
|
|
2788
|
-
version: "1",
|
|
2789
|
-
chainId
|
|
2790
|
-
};
|
|
2791
|
-
const message = new SiweMessage({ ...params });
|
|
2792
|
-
const signature = await signer.signMessage(message.prepareMessage());
|
|
2793
|
-
let obj = {
|
|
2794
|
-
type: "EVM",
|
|
2795
|
-
address: data.address,
|
|
2796
|
-
signature,
|
|
2797
|
-
message: `${message.prepareMessage()}`,
|
|
2798
|
-
connector_type: data.connector.type || "",
|
|
2799
|
-
wallet_client_type: data.connector.name || ""
|
|
2800
|
-
};
|
|
2801
|
-
const res2 = type == "bind" ? await toBindWalletApi(obj) : await loginByWalletApi(obj);
|
|
2802
|
-
if (res2) {
|
|
2803
|
-
if (!isSuccess(res2)) {
|
|
2804
|
-
throw new Error(res2.message);
|
|
2805
|
-
}
|
|
2806
|
-
matchlog_default.log(res2);
|
|
2807
|
-
setStatus("success");
|
|
2808
|
-
statusRef.current = "success";
|
|
2809
|
-
if (type == "bind") {
|
|
2810
|
-
events.onBind && events.onBind({
|
|
2811
|
-
type: "evm"
|
|
2812
|
-
});
|
|
2813
|
-
eventManager_default.emit("onBind", {
|
|
2814
|
-
type: "evm"
|
|
2815
|
-
});
|
|
2816
|
-
} else {
|
|
2817
|
-
await login({
|
|
2818
|
-
mid: res2.data.mid,
|
|
2819
|
-
token: `${res2.data.token_type} ${res2.data.access_token}`
|
|
2820
|
-
});
|
|
2821
|
-
}
|
|
2822
|
-
onSuccess && onSuccess();
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
} catch (error2) {
|
|
2826
|
-
setStatus("error");
|
|
2827
|
-
setError(error2.message);
|
|
2828
|
-
statusRef.current = "";
|
|
2829
|
-
}
|
|
2830
|
-
};
|
|
2831
|
-
const pageData = useMemo10(() => {
|
|
2832
|
-
if (status == "success") {
|
|
2833
|
-
return {
|
|
2834
|
-
btnText: "Disconnect Wallet",
|
|
2835
|
-
btnClick: () => {
|
|
2836
|
-
disconnect();
|
|
2837
|
-
},
|
|
2838
|
-
text: "Wallet connection successful!",
|
|
2839
|
-
statusImage: walletConnectedImage
|
|
2840
|
-
};
|
|
2841
|
-
}
|
|
2842
|
-
if (status == "error") {
|
|
2843
|
-
return {
|
|
2844
|
-
text: error,
|
|
2845
|
-
btnText: "Reconnect Wallet",
|
|
2846
|
-
btnClick: async () => {
|
|
2847
|
-
setError("");
|
|
2848
|
-
disconnect();
|
|
2849
|
-
openConnectModal && openConnectModal();
|
|
2850
|
-
},
|
|
2851
|
-
statusImage: walletErrorImage,
|
|
2852
|
-
isError: true
|
|
2853
|
-
};
|
|
2854
|
-
}
|
|
2855
|
-
if (status == "nonce") {
|
|
2856
|
-
return {
|
|
2857
|
-
btnLoading: true,
|
|
2858
|
-
text: "Connecting",
|
|
2859
|
-
statusImage: walletConnectingImage
|
|
2860
|
-
};
|
|
2861
|
-
}
|
|
2862
|
-
if (status == "signer") {
|
|
2863
|
-
return {
|
|
2864
|
-
btnLoading: true,
|
|
2865
|
-
text: "Signing",
|
|
2866
|
-
statusImage: walletSigningImage
|
|
2867
|
-
};
|
|
2868
|
-
}
|
|
2869
|
-
if (connectModalOpen) {
|
|
2870
|
-
return {
|
|
2871
|
-
btnLoading: true,
|
|
2872
|
-
text: "Connecting",
|
|
2873
|
-
statusImage: walletConnectingImage
|
|
2874
|
-
};
|
|
2875
|
-
}
|
|
2876
|
-
return {
|
|
2877
|
-
btnText: "Connect Wallet",
|
|
2878
|
-
btnClick: () => {
|
|
2879
|
-
openConnectModal && openConnectModal();
|
|
2880
|
-
},
|
|
2881
|
-
text: "Please Connect your wallet",
|
|
2882
|
-
statusImage: walletConnectImage
|
|
2883
|
-
};
|
|
2884
|
-
}, [connectModalOpen, status, error, address]);
|
|
2885
|
-
return /* @__PURE__ */ jsx46("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ jsxs33("div", { className: `matchid-wallet-box`, children: [
|
|
2886
|
-
/* @__PURE__ */ jsxs33("div", { className: `matchid-wallet-content`, children: [
|
|
2887
|
-
/* @__PURE__ */ jsx46("img", { src: pageData.statusImage }),
|
|
2888
|
-
/* @__PURE__ */ jsx46("div", { className: pageData.isError ? "text-[#F7585E]" : "", children: pageData.text })
|
|
2889
|
-
] }),
|
|
2890
|
-
/* @__PURE__ */ jsx46(
|
|
2891
|
-
Button,
|
|
2892
|
-
{
|
|
2893
|
-
block: true,
|
|
2894
|
-
size: "lg",
|
|
2895
|
-
onClick: pageData.btnClick,
|
|
2896
|
-
loading: pageData.btnLoading,
|
|
2897
|
-
disabled: pageData.btnDisabled,
|
|
2898
|
-
children: pageData.btnText
|
|
2899
|
-
}
|
|
2900
|
-
)
|
|
2901
|
-
] }) });
|
|
2902
|
-
}
|
|
2903
|
-
function EVMModal({
|
|
2904
|
-
type = "login",
|
|
2905
|
-
onSuccess,
|
|
2906
|
-
...props
|
|
2907
|
-
}) {
|
|
2908
|
-
return /* @__PURE__ */ jsx46(ModalWithHeader, { ...props, title: props.title || firstUpperCase(type + " EVM Wallet"), children: /* @__PURE__ */ jsx46(WalletContent2, { onSuccess, type }) });
|
|
2909
|
-
}
|
|
2910
|
-
|
|
2911
2496
|
// src/context/BusinessProvider.tsx
|
|
2912
|
-
import { Fragment as Fragment4, jsx as
|
|
2497
|
+
import { Fragment as Fragment4, jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2913
2498
|
function BusinessProvider({ children }) {
|
|
2914
2499
|
const { overview, token } = useUserInfo();
|
|
2915
2500
|
const { recoveryModal } = useStore_default();
|
|
2916
|
-
const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
|
|
2917
2501
|
const { type: SOLType, isOpen: SOLIsOpen, close: SOLClose } = useSOLModalStore();
|
|
2918
|
-
return /* @__PURE__ */
|
|
2919
|
-
/* @__PURE__ */
|
|
2920
|
-
/* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
2503
|
+
/* @__PURE__ */ jsx46(PasswordModal, { isOpen: !!token && !!overview && !overview.address && !!overview.did, showClose: false }),
|
|
2504
|
+
/* @__PURE__ */ jsx46(
|
|
2921
2505
|
RecoveryModal,
|
|
2922
2506
|
{
|
|
2923
2507
|
isOpen: !!token && !!overview && !!overview.address && recoveryModal.open,
|
|
@@ -2925,17 +2509,7 @@ function BusinessProvider({ children }) {
|
|
|
2925
2509
|
onSuccess: recoveryModal.success
|
|
2926
2510
|
}
|
|
2927
2511
|
),
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
EVMModal,
|
|
2930
|
-
{
|
|
2931
|
-
isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
|
|
2932
|
-
onClose: EVMClose,
|
|
2933
|
-
type: EVMType,
|
|
2934
|
-
onSuccess: EVMClose,
|
|
2935
|
-
zIndex: 199
|
|
2936
|
-
}
|
|
2937
|
-
),
|
|
2938
|
-
/* @__PURE__ */ jsx47(
|
|
2512
|
+
/* @__PURE__ */ jsx46(
|
|
2939
2513
|
SOLModal,
|
|
2940
2514
|
{
|
|
2941
2515
|
isOpen: SOLIsOpen && (SOLType == "login" && !overview && !token || SOLType == "bind" && !!token && !!overview),
|
|
@@ -2950,17 +2524,17 @@ function BusinessProvider({ children }) {
|
|
|
2950
2524
|
}
|
|
2951
2525
|
|
|
2952
2526
|
// src/context/index.tsx
|
|
2953
|
-
import { jsx as
|
|
2527
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2954
2528
|
var Providers = ({ children }) => {
|
|
2955
2529
|
return (
|
|
2956
2530
|
// <MpcWalletProvider>
|
|
2957
|
-
/* @__PURE__ */
|
|
2531
|
+
/* @__PURE__ */ jsx47(BusinessProvider, { children })
|
|
2958
2532
|
);
|
|
2959
2533
|
};
|
|
2960
2534
|
var context_default = Providers;
|
|
2961
2535
|
|
|
2962
2536
|
// src/hooks/useWalletInit.ts
|
|
2963
|
-
import { useEffect as
|
|
2537
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
2964
2538
|
var AppClientId2 = "react-sdk-" + getVersion();
|
|
2965
2539
|
function useWalletInit({
|
|
2966
2540
|
refreshOverview
|
|
@@ -2969,10 +2543,10 @@ function useWalletInit({
|
|
|
2969
2543
|
const getWalletIframe = () => {
|
|
2970
2544
|
return document.getElementById("match-wallet");
|
|
2971
2545
|
};
|
|
2972
|
-
const [walletInited, setWalletInited] =
|
|
2546
|
+
const [walletInited, setWalletInited] = useState14(false);
|
|
2973
2547
|
const { appid, token, overview } = useLocalStore_default();
|
|
2974
2548
|
const { initWallet, generateWallet } = useWallet();
|
|
2975
|
-
|
|
2549
|
+
useEffect10(() => {
|
|
2976
2550
|
if (endpoints.auth) {
|
|
2977
2551
|
if (!window.matchWalletMessageIdMap) {
|
|
2978
2552
|
window.matchWalletMessageIdMap = {};
|
|
@@ -3030,7 +2604,7 @@ function useWalletInit({
|
|
|
3030
2604
|
}
|
|
3031
2605
|
}
|
|
3032
2606
|
}, [endpoints.auth]);
|
|
3033
|
-
|
|
2607
|
+
useEffect10(() => {
|
|
3034
2608
|
const messageHandle = async (e) => {
|
|
3035
2609
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
3036
2610
|
return;
|
|
@@ -3063,7 +2637,7 @@ function useWalletInit({
|
|
|
3063
2637
|
window.removeEventListener("message", messageHandle);
|
|
3064
2638
|
};
|
|
3065
2639
|
}, []);
|
|
3066
|
-
|
|
2640
|
+
useEffect10(() => {
|
|
3067
2641
|
if (token && overview && overview.did && walletInited) {
|
|
3068
2642
|
const did = overview.did.split(":")[2];
|
|
3069
2643
|
const newUserInit = async () => {
|
|
@@ -3094,7 +2668,7 @@ function useWalletInit({
|
|
|
3094
2668
|
}
|
|
3095
2669
|
|
|
3096
2670
|
// src/hooks/useInit.tsx
|
|
3097
|
-
import { useEffect as
|
|
2671
|
+
import { useEffect as useEffect11, useRef as useRef2 } from "react";
|
|
3098
2672
|
function useInit({
|
|
3099
2673
|
theme,
|
|
3100
2674
|
appid,
|
|
@@ -3114,16 +2688,16 @@ function useInit({
|
|
|
3114
2688
|
const searchParams = new URLSearchParams(window.location.search);
|
|
3115
2689
|
const matchToken = searchParams.get("matchToken");
|
|
3116
2690
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
3117
|
-
|
|
2691
|
+
useEffect11(() => {
|
|
3118
2692
|
setTheme(theme);
|
|
3119
2693
|
}, [theme]);
|
|
3120
|
-
|
|
2694
|
+
useEffect11(() => {
|
|
3121
2695
|
setAppid(appid);
|
|
3122
2696
|
}, [appid]);
|
|
3123
|
-
|
|
2697
|
+
useEffect11(() => {
|
|
3124
2698
|
setEndpoints(realEndpoints);
|
|
3125
2699
|
}, [realEndpoints]);
|
|
3126
|
-
|
|
2700
|
+
useEffect11(() => {
|
|
3127
2701
|
if (matchToken) {
|
|
3128
2702
|
const tokenData = JSON.parse(atob(matchToken));
|
|
3129
2703
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -3134,7 +2708,7 @@ function useInit({
|
|
|
3134
2708
|
}
|
|
3135
2709
|
}
|
|
3136
2710
|
}, [matchToken]);
|
|
3137
|
-
|
|
2711
|
+
useEffect11(() => {
|
|
3138
2712
|
const onLoginMessage = (event) => {
|
|
3139
2713
|
const res = event.data;
|
|
3140
2714
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -3170,7 +2744,7 @@ function useInit({
|
|
|
3170
2744
|
overviewLoadingRef.current = false;
|
|
3171
2745
|
}
|
|
3172
2746
|
};
|
|
3173
|
-
|
|
2747
|
+
useEffect11(() => {
|
|
3174
2748
|
if (token) {
|
|
3175
2749
|
loadOverview();
|
|
3176
2750
|
}
|
|
@@ -3201,544 +2775,7 @@ function useInit({
|
|
|
3201
2775
|
|
|
3202
2776
|
// src/MatchContext.tsx
|
|
3203
2777
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3204
|
-
import {
|
|
3205
|
-
|
|
3206
|
-
// src/config/chains/AllChains.ts
|
|
3207
|
-
import {
|
|
3208
|
-
acala,
|
|
3209
|
-
ancient8,
|
|
3210
|
-
ancient8Sepolia,
|
|
3211
|
-
anvil,
|
|
3212
|
-
apexTestnet,
|
|
3213
|
-
arbitrum,
|
|
3214
|
-
arbitrumGoerli,
|
|
3215
|
-
arbitrumNova,
|
|
3216
|
-
astar,
|
|
3217
|
-
arbitrumSepolia,
|
|
3218
|
-
aurora,
|
|
3219
|
-
auroraTestnet,
|
|
3220
|
-
auroria,
|
|
3221
|
-
avalanche,
|
|
3222
|
-
avalancheFuji,
|
|
3223
|
-
bahamut,
|
|
3224
|
-
base,
|
|
3225
|
-
baseGoerli,
|
|
3226
|
-
baseSepolia,
|
|
3227
|
-
bearNetworkChainMainnet,
|
|
3228
|
-
bearNetworkChainTestnet,
|
|
3229
|
-
berachainTestnet,
|
|
3230
|
-
bitTorrent,
|
|
3231
|
-
bitTorrentTestnet,
|
|
3232
|
-
blast,
|
|
3233
|
-
blastSepolia,
|
|
3234
|
-
boba,
|
|
3235
|
-
bronos,
|
|
3236
|
-
bronosTestnet,
|
|
3237
|
-
bsc,
|
|
3238
|
-
bscTestnet,
|
|
3239
|
-
bscGreenfield,
|
|
3240
|
-
bxn,
|
|
3241
|
-
bxnTestnet,
|
|
3242
|
-
canto,
|
|
3243
|
-
celo,
|
|
3244
|
-
celoAlfajores,
|
|
3245
|
-
chiliz,
|
|
3246
|
-
classic,
|
|
3247
|
-
confluxESpace,
|
|
3248
|
-
confluxESpaceTestnet,
|
|
3249
|
-
coreDao,
|
|
3250
|
-
cronos,
|
|
3251
|
-
cronosTestnet,
|
|
3252
|
-
crossbell,
|
|
3253
|
-
defichainEvm,
|
|
3254
|
-
defichainEvmTestnet,
|
|
3255
|
-
dfk,
|
|
3256
|
-
dogechain,
|
|
3257
|
-
edgeware,
|
|
3258
|
-
edgewareTestnet,
|
|
3259
|
-
eos,
|
|
3260
|
-
eosTestnet,
|
|
3261
|
-
etherlinkTestnet,
|
|
3262
|
-
evmos,
|
|
3263
|
-
evmosTestnet,
|
|
3264
|
-
ekta,
|
|
3265
|
-
ektaTestnet,
|
|
3266
|
-
fantom,
|
|
3267
|
-
fantomSonicTestnet,
|
|
3268
|
-
fantomTestnet,
|
|
3269
|
-
fibo,
|
|
3270
|
-
filecoin,
|
|
3271
|
-
filecoinCalibration,
|
|
3272
|
-
filecoinHyperspace,
|
|
3273
|
-
flare,
|
|
3274
|
-
flareTestnet,
|
|
3275
|
-
foundry,
|
|
3276
|
-
fraxtal,
|
|
3277
|
-
fraxtalTestnet,
|
|
3278
|
-
fuse,
|
|
3279
|
-
fuseSparknet,
|
|
3280
|
-
iotex,
|
|
3281
|
-
iotexTestnet,
|
|
3282
|
-
jbc,
|
|
3283
|
-
karura,
|
|
3284
|
-
gobi,
|
|
3285
|
-
goerli,
|
|
3286
|
-
gnosis,
|
|
3287
|
-
gnosisChiado,
|
|
3288
|
-
hardhat,
|
|
3289
|
-
harmonyOne,
|
|
3290
|
-
haqqMainnet,
|
|
3291
|
-
haqqTestedge2,
|
|
3292
|
-
hedera,
|
|
3293
|
-
hederaTestnet,
|
|
3294
|
-
hederaPreviewnet,
|
|
3295
|
-
holesky,
|
|
3296
|
-
kakarotSepolia,
|
|
3297
|
-
kava,
|
|
3298
|
-
kavaTestnet,
|
|
3299
|
-
kcc,
|
|
3300
|
-
klaytn,
|
|
3301
|
-
klaytnBaobab,
|
|
3302
|
-
kroma,
|
|
3303
|
-
kromaSepolia,
|
|
3304
|
-
lightlinkPegasus,
|
|
3305
|
-
lightlinkPhoenix,
|
|
3306
|
-
linea,
|
|
3307
|
-
lineaTestnet,
|
|
3308
|
-
liskSepolia,
|
|
3309
|
-
localhost,
|
|
3310
|
-
lukso,
|
|
3311
|
-
mainnet,
|
|
3312
|
-
mandala,
|
|
3313
|
-
manta,
|
|
3314
|
-
mantaTestnet,
|
|
3315
|
-
mantle,
|
|
3316
|
-
mantleTestnet,
|
|
3317
|
-
merlin,
|
|
3318
|
-
metachain,
|
|
3319
|
-
metachainIstanbul,
|
|
3320
|
-
meter,
|
|
3321
|
-
meterTestnet,
|
|
3322
|
-
metis,
|
|
3323
|
-
metisGoerli,
|
|
3324
|
-
mev,
|
|
3325
|
-
mevTestnet,
|
|
3326
|
-
mode,
|
|
3327
|
-
modeTestnet,
|
|
3328
|
-
moonbaseAlpha,
|
|
3329
|
-
moonbeam,
|
|
3330
|
-
moonbeamDev,
|
|
3331
|
-
moonriver,
|
|
3332
|
-
neonDevnet,
|
|
3333
|
-
neonMainnet,
|
|
3334
|
-
nexi,
|
|
3335
|
-
nexilix,
|
|
3336
|
-
oasys,
|
|
3337
|
-
oasisTestnet,
|
|
3338
|
-
okc,
|
|
3339
|
-
optimism,
|
|
3340
|
-
optimismGoerli,
|
|
3341
|
-
optimismSepolia,
|
|
3342
|
-
opBNB,
|
|
3343
|
-
opBNBTestnet,
|
|
3344
|
-
oortMainnetDev,
|
|
3345
|
-
palm,
|
|
3346
|
-
palmTestnet,
|
|
3347
|
-
pgn,
|
|
3348
|
-
pgnTestnet,
|
|
3349
|
-
phoenix,
|
|
3350
|
-
plinga,
|
|
3351
|
-
polygon,
|
|
3352
|
-
polygonAmoy,
|
|
3353
|
-
polygonMumbai,
|
|
3354
|
-
polygonZkEvmTestnet,
|
|
3355
|
-
polygonZkEvm,
|
|
3356
|
-
pulsechain,
|
|
3357
|
-
pulsechainV4,
|
|
3358
|
-
qMainnet,
|
|
3359
|
-
qTestnet,
|
|
3360
|
-
rollux,
|
|
3361
|
-
rolluxTestnet,
|
|
3362
|
-
ronin,
|
|
3363
|
-
rootstock,
|
|
3364
|
-
saigon,
|
|
3365
|
-
sapphire,
|
|
3366
|
-
sapphireTestnet,
|
|
3367
|
-
scroll,
|
|
3368
|
-
scrollSepolia,
|
|
3369
|
-
sepolia,
|
|
3370
|
-
shimmer,
|
|
3371
|
-
shimmerTestnet,
|
|
3372
|
-
skaleBlockBrawlers,
|
|
3373
|
-
skaleCalypso,
|
|
3374
|
-
skaleCalypsoTestnet,
|
|
3375
|
-
skaleCryptoBlades,
|
|
3376
|
-
skaleCryptoColosseum,
|
|
3377
|
-
skaleEuropa,
|
|
3378
|
-
skaleEuropaTestnet,
|
|
3379
|
-
skaleExorde,
|
|
3380
|
-
skaleHumanProtocol,
|
|
3381
|
-
skaleNebula,
|
|
3382
|
-
skaleNebulaTestnet,
|
|
3383
|
-
skaleRazor,
|
|
3384
|
-
skaleTitan,
|
|
3385
|
-
skaleTitanTestnet,
|
|
3386
|
-
songbird,
|
|
3387
|
-
songbirdTestnet,
|
|
3388
|
-
spicy,
|
|
3389
|
-
shardeumSphinx,
|
|
3390
|
-
shibarium,
|
|
3391
|
-
syscoin,
|
|
3392
|
-
syscoinTestnet,
|
|
3393
|
-
taraxa,
|
|
3394
|
-
taikoJolnir,
|
|
3395
|
-
taikoKatla,
|
|
3396
|
-
taikoTestnetSepolia,
|
|
3397
|
-
taraxaTestnet,
|
|
3398
|
-
telos,
|
|
3399
|
-
telosTestnet,
|
|
3400
|
-
tenet,
|
|
3401
|
-
thunderTestnet,
|
|
3402
|
-
vechain,
|
|
3403
|
-
wanchain,
|
|
3404
|
-
wanchainTestnet,
|
|
3405
|
-
wemix,
|
|
3406
|
-
wemixTestnet,
|
|
3407
|
-
x1Testnet,
|
|
3408
|
-
xdc,
|
|
3409
|
-
xdcTestnet,
|
|
3410
|
-
zhejiang,
|
|
3411
|
-
zkFair,
|
|
3412
|
-
zkFairTestnet,
|
|
3413
|
-
zkSync,
|
|
3414
|
-
zkSyncSepoliaTestnet,
|
|
3415
|
-
zetachain,
|
|
3416
|
-
zetachainAthensTestnet,
|
|
3417
|
-
zilliqa,
|
|
3418
|
-
zilliqaTestnet,
|
|
3419
|
-
zora,
|
|
3420
|
-
zoraSepolia,
|
|
3421
|
-
zoraTestnet
|
|
3422
|
-
} from "wagmi/chains";
|
|
3423
|
-
|
|
3424
|
-
// src/config/chains/MatchTest.ts
|
|
3425
|
-
import { defineChain } from "viem";
|
|
3426
|
-
var matchTest = /* @__PURE__ */ defineChain({
|
|
3427
|
-
//定义matchTest链
|
|
3428
|
-
id: 699,
|
|
3429
|
-
name: "MatchTest",
|
|
3430
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
3431
|
-
rpcUrls: {
|
|
3432
|
-
default: {
|
|
3433
|
-
http: ["https://testnet-rpc.matchain.io"]
|
|
3434
|
-
}
|
|
3435
|
-
},
|
|
3436
|
-
blockExplorers: {
|
|
3437
|
-
default: {
|
|
3438
|
-
name: "Matchscan",
|
|
3439
|
-
url: "https://testnet.matchscan.io/",
|
|
3440
|
-
apiUrl: "https://testnet.matchscan.io/api"
|
|
3441
|
-
}
|
|
3442
|
-
},
|
|
3443
|
-
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
3444
|
-
contracts: {
|
|
3445
|
-
multicall3: {
|
|
3446
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
3447
|
-
blockCreated: 751532
|
|
3448
|
-
},
|
|
3449
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
3450
|
-
ensUniversalResolver: {
|
|
3451
|
-
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
3452
|
-
blockCreated: 5317080
|
|
3453
|
-
}
|
|
3454
|
-
}
|
|
3455
|
-
// testnet: true,
|
|
3456
|
-
});
|
|
3457
|
-
|
|
3458
|
-
// src/config/chains/MatchMain.ts
|
|
3459
|
-
import { defineChain as defineChain2 } from "viem";
|
|
3460
|
-
var matchMain = /* @__PURE__ */ defineChain2({
|
|
3461
|
-
//定义match链
|
|
3462
|
-
id: 698,
|
|
3463
|
-
name: "Matchain",
|
|
3464
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
3465
|
-
rpcUrls: {
|
|
3466
|
-
default: {
|
|
3467
|
-
http: ["https://rpc.matchain.io"]
|
|
3468
|
-
}
|
|
3469
|
-
},
|
|
3470
|
-
blockExplorers: {
|
|
3471
|
-
default: {
|
|
3472
|
-
name: "Matchscan",
|
|
3473
|
-
url: "https://matchscan.io/",
|
|
3474
|
-
apiUrl: "https://matchscan.io/api"
|
|
3475
|
-
}
|
|
3476
|
-
},
|
|
3477
|
-
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
3478
|
-
contracts: {
|
|
3479
|
-
multicall3: {
|
|
3480
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
3481
|
-
}
|
|
3482
|
-
}
|
|
3483
|
-
// testnet: true,
|
|
3484
|
-
});
|
|
3485
|
-
|
|
3486
|
-
// src/config/chains/AllChains.ts
|
|
3487
|
-
var AllChains = [
|
|
3488
|
-
matchTest,
|
|
3489
|
-
matchMain,
|
|
3490
|
-
acala,
|
|
3491
|
-
ancient8,
|
|
3492
|
-
ancient8Sepolia,
|
|
3493
|
-
anvil,
|
|
3494
|
-
apexTestnet,
|
|
3495
|
-
arbitrum,
|
|
3496
|
-
arbitrumGoerli,
|
|
3497
|
-
arbitrumNova,
|
|
3498
|
-
astar,
|
|
3499
|
-
arbitrumSepolia,
|
|
3500
|
-
aurora,
|
|
3501
|
-
auroraTestnet,
|
|
3502
|
-
auroria,
|
|
3503
|
-
avalanche,
|
|
3504
|
-
avalancheFuji,
|
|
3505
|
-
bahamut,
|
|
3506
|
-
base,
|
|
3507
|
-
baseGoerli,
|
|
3508
|
-
baseSepolia,
|
|
3509
|
-
bearNetworkChainMainnet,
|
|
3510
|
-
bearNetworkChainTestnet,
|
|
3511
|
-
berachainTestnet,
|
|
3512
|
-
bitTorrent,
|
|
3513
|
-
bitTorrentTestnet,
|
|
3514
|
-
blast,
|
|
3515
|
-
blastSepolia,
|
|
3516
|
-
boba,
|
|
3517
|
-
bronos,
|
|
3518
|
-
bronosTestnet,
|
|
3519
|
-
bsc,
|
|
3520
|
-
bscTestnet,
|
|
3521
|
-
bscGreenfield,
|
|
3522
|
-
bxn,
|
|
3523
|
-
bxnTestnet,
|
|
3524
|
-
canto,
|
|
3525
|
-
celo,
|
|
3526
|
-
celoAlfajores,
|
|
3527
|
-
chiliz,
|
|
3528
|
-
classic,
|
|
3529
|
-
confluxESpace,
|
|
3530
|
-
confluxESpaceTestnet,
|
|
3531
|
-
coreDao,
|
|
3532
|
-
cronos,
|
|
3533
|
-
cronosTestnet,
|
|
3534
|
-
crossbell,
|
|
3535
|
-
defichainEvm,
|
|
3536
|
-
defichainEvmTestnet,
|
|
3537
|
-
dfk,
|
|
3538
|
-
dogechain,
|
|
3539
|
-
edgeware,
|
|
3540
|
-
edgewareTestnet,
|
|
3541
|
-
eos,
|
|
3542
|
-
eosTestnet,
|
|
3543
|
-
etherlinkTestnet,
|
|
3544
|
-
evmos,
|
|
3545
|
-
evmosTestnet,
|
|
3546
|
-
ekta,
|
|
3547
|
-
ektaTestnet,
|
|
3548
|
-
fantom,
|
|
3549
|
-
fantomSonicTestnet,
|
|
3550
|
-
fantomTestnet,
|
|
3551
|
-
fibo,
|
|
3552
|
-
filecoin,
|
|
3553
|
-
filecoinCalibration,
|
|
3554
|
-
filecoinHyperspace,
|
|
3555
|
-
flare,
|
|
3556
|
-
flareTestnet,
|
|
3557
|
-
foundry,
|
|
3558
|
-
fraxtal,
|
|
3559
|
-
fraxtalTestnet,
|
|
3560
|
-
fuse,
|
|
3561
|
-
fuseSparknet,
|
|
3562
|
-
iotex,
|
|
3563
|
-
iotexTestnet,
|
|
3564
|
-
jbc,
|
|
3565
|
-
karura,
|
|
3566
|
-
gobi,
|
|
3567
|
-
goerli,
|
|
3568
|
-
gnosis,
|
|
3569
|
-
gnosisChiado,
|
|
3570
|
-
hardhat,
|
|
3571
|
-
harmonyOne,
|
|
3572
|
-
haqqMainnet,
|
|
3573
|
-
haqqTestedge2,
|
|
3574
|
-
hedera,
|
|
3575
|
-
hederaTestnet,
|
|
3576
|
-
hederaPreviewnet,
|
|
3577
|
-
holesky,
|
|
3578
|
-
kakarotSepolia,
|
|
3579
|
-
kava,
|
|
3580
|
-
kavaTestnet,
|
|
3581
|
-
kcc,
|
|
3582
|
-
klaytn,
|
|
3583
|
-
klaytnBaobab,
|
|
3584
|
-
kroma,
|
|
3585
|
-
kromaSepolia,
|
|
3586
|
-
lightlinkPegasus,
|
|
3587
|
-
lightlinkPhoenix,
|
|
3588
|
-
linea,
|
|
3589
|
-
lineaTestnet,
|
|
3590
|
-
liskSepolia,
|
|
3591
|
-
localhost,
|
|
3592
|
-
lukso,
|
|
3593
|
-
mainnet,
|
|
3594
|
-
mandala,
|
|
3595
|
-
manta,
|
|
3596
|
-
mantaTestnet,
|
|
3597
|
-
mantle,
|
|
3598
|
-
mantleTestnet,
|
|
3599
|
-
merlin,
|
|
3600
|
-
metachain,
|
|
3601
|
-
metachainIstanbul,
|
|
3602
|
-
meter,
|
|
3603
|
-
meterTestnet,
|
|
3604
|
-
metis,
|
|
3605
|
-
metisGoerli,
|
|
3606
|
-
mev,
|
|
3607
|
-
mevTestnet,
|
|
3608
|
-
mode,
|
|
3609
|
-
modeTestnet,
|
|
3610
|
-
moonbaseAlpha,
|
|
3611
|
-
moonbeam,
|
|
3612
|
-
moonbeamDev,
|
|
3613
|
-
moonriver,
|
|
3614
|
-
neonDevnet,
|
|
3615
|
-
neonMainnet,
|
|
3616
|
-
nexi,
|
|
3617
|
-
nexilix,
|
|
3618
|
-
oasys,
|
|
3619
|
-
oasisTestnet,
|
|
3620
|
-
okc,
|
|
3621
|
-
optimism,
|
|
3622
|
-
optimismGoerli,
|
|
3623
|
-
optimismSepolia,
|
|
3624
|
-
opBNB,
|
|
3625
|
-
opBNBTestnet,
|
|
3626
|
-
oortMainnetDev,
|
|
3627
|
-
palm,
|
|
3628
|
-
palmTestnet,
|
|
3629
|
-
pgn,
|
|
3630
|
-
pgnTestnet,
|
|
3631
|
-
phoenix,
|
|
3632
|
-
plinga,
|
|
3633
|
-
polygon,
|
|
3634
|
-
polygonAmoy,
|
|
3635
|
-
polygonMumbai,
|
|
3636
|
-
polygonZkEvmTestnet,
|
|
3637
|
-
polygonZkEvm,
|
|
3638
|
-
pulsechain,
|
|
3639
|
-
pulsechainV4,
|
|
3640
|
-
qMainnet,
|
|
3641
|
-
qTestnet,
|
|
3642
|
-
rollux,
|
|
3643
|
-
rolluxTestnet,
|
|
3644
|
-
ronin,
|
|
3645
|
-
rootstock,
|
|
3646
|
-
saigon,
|
|
3647
|
-
sapphire,
|
|
3648
|
-
sapphireTestnet,
|
|
3649
|
-
scroll,
|
|
3650
|
-
scrollSepolia,
|
|
3651
|
-
sepolia,
|
|
3652
|
-
shimmer,
|
|
3653
|
-
shimmerTestnet,
|
|
3654
|
-
skaleBlockBrawlers,
|
|
3655
|
-
skaleCalypso,
|
|
3656
|
-
skaleCalypsoTestnet,
|
|
3657
|
-
skaleCryptoBlades,
|
|
3658
|
-
skaleCryptoColosseum,
|
|
3659
|
-
skaleEuropa,
|
|
3660
|
-
skaleEuropaTestnet,
|
|
3661
|
-
skaleExorde,
|
|
3662
|
-
skaleHumanProtocol,
|
|
3663
|
-
skaleNebula,
|
|
3664
|
-
skaleNebulaTestnet,
|
|
3665
|
-
skaleRazor,
|
|
3666
|
-
skaleTitan,
|
|
3667
|
-
skaleTitanTestnet,
|
|
3668
|
-
songbird,
|
|
3669
|
-
songbirdTestnet,
|
|
3670
|
-
spicy,
|
|
3671
|
-
shardeumSphinx,
|
|
3672
|
-
shibarium,
|
|
3673
|
-
syscoin,
|
|
3674
|
-
syscoinTestnet,
|
|
3675
|
-
taraxa,
|
|
3676
|
-
taikoJolnir,
|
|
3677
|
-
taikoKatla,
|
|
3678
|
-
taikoTestnetSepolia,
|
|
3679
|
-
taraxaTestnet,
|
|
3680
|
-
telos,
|
|
3681
|
-
telosTestnet,
|
|
3682
|
-
tenet,
|
|
3683
|
-
thunderTestnet,
|
|
3684
|
-
vechain,
|
|
3685
|
-
wanchain,
|
|
3686
|
-
wanchainTestnet,
|
|
3687
|
-
wemix,
|
|
3688
|
-
wemixTestnet,
|
|
3689
|
-
x1Testnet,
|
|
3690
|
-
xdc,
|
|
3691
|
-
xdcTestnet,
|
|
3692
|
-
zhejiang,
|
|
3693
|
-
zkFair,
|
|
3694
|
-
zkFairTestnet,
|
|
3695
|
-
zkSync,
|
|
3696
|
-
zkSyncSepoliaTestnet,
|
|
3697
|
-
zetachain,
|
|
3698
|
-
zetachainAthensTestnet,
|
|
3699
|
-
zilliqa,
|
|
3700
|
-
zilliqaTestnet,
|
|
3701
|
-
zora,
|
|
3702
|
-
zoraSepolia,
|
|
3703
|
-
zoraTestnet
|
|
3704
|
-
];
|
|
3705
|
-
var AllChains_default = AllChains;
|
|
3706
|
-
|
|
3707
|
-
// src/config/wagmi.ts
|
|
3708
|
-
import { http as http2 } from "wagmi";
|
|
3709
|
-
import { getDefaultConfig } from "@rainbow-me/rainbowkit";
|
|
3710
|
-
import {
|
|
3711
|
-
bitgetWallet,
|
|
3712
|
-
injectedWallet,
|
|
3713
|
-
metaMaskWallet,
|
|
3714
|
-
okxWallet,
|
|
3715
|
-
walletConnectWallet
|
|
3716
|
-
} from "@rainbow-me/rainbowkit/wallets";
|
|
3717
|
-
var transports = {};
|
|
3718
|
-
AllChains_default.forEach((chain) => {
|
|
3719
|
-
transports[chain.id] = http2();
|
|
3720
|
-
});
|
|
3721
|
-
var wagmiConfig = getDefaultConfig({
|
|
3722
|
-
appName: "MatchID",
|
|
3723
|
-
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
3724
|
-
wallets: [
|
|
3725
|
-
{
|
|
3726
|
-
groupName: "Recommended",
|
|
3727
|
-
wallets: [
|
|
3728
|
-
metaMaskWallet,
|
|
3729
|
-
walletConnectWallet,
|
|
3730
|
-
okxWallet,
|
|
3731
|
-
bitgetWallet,
|
|
3732
|
-
injectedWallet
|
|
3733
|
-
]
|
|
3734
|
-
}
|
|
3735
|
-
],
|
|
3736
|
-
chains: AllChains_default
|
|
3737
|
-
});
|
|
3738
|
-
|
|
3739
|
-
// src/MatchContext.tsx
|
|
3740
|
-
import { RainbowKitProvider } from "@rainbow-me/rainbowkit";
|
|
3741
|
-
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2778
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3742
2779
|
var queryClient = new QueryClient();
|
|
3743
2780
|
var MatchContext = createContext(void 0);
|
|
3744
2781
|
var MatchProvider = ({ children, appid, events, theme = "light", endpoints }) => {
|
|
@@ -3751,7 +2788,7 @@ var MatchProvider = ({ children, appid, events, theme = "light", endpoints }) =>
|
|
|
3751
2788
|
useWalletInit({
|
|
3752
2789
|
refreshOverview: loadOverview
|
|
3753
2790
|
});
|
|
3754
|
-
return /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ jsx48(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx48(
|
|
3755
2792
|
MatchContext.Provider,
|
|
3756
2793
|
{
|
|
3757
2794
|
value: {
|
|
@@ -3761,9 +2798,9 @@ var MatchProvider = ({ children, appid, events, theme = "light", endpoints }) =>
|
|
|
3761
2798
|
login,
|
|
3762
2799
|
theme
|
|
3763
2800
|
},
|
|
3764
|
-
children: /* @__PURE__ */
|
|
2801
|
+
children: /* @__PURE__ */ jsx48(context_default, { children })
|
|
3765
2802
|
}
|
|
3766
|
-
) })
|
|
2803
|
+
) });
|
|
3767
2804
|
};
|
|
3768
2805
|
var useMatch = () => {
|
|
3769
2806
|
const context = useContext(MatchContext);
|
|
@@ -3849,6 +2886,68 @@ __export(chains_exports, {
|
|
|
3849
2886
|
MatchMain: () => matchMain,
|
|
3850
2887
|
MatchTest: () => matchTest
|
|
3851
2888
|
});
|
|
2889
|
+
|
|
2890
|
+
// src/config/chains/MatchMain.ts
|
|
2891
|
+
import { defineChain } from "viem";
|
|
2892
|
+
var matchMain = /* @__PURE__ */ defineChain({
|
|
2893
|
+
//定义match链
|
|
2894
|
+
id: 698,
|
|
2895
|
+
name: "Matchain",
|
|
2896
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
2897
|
+
rpcUrls: {
|
|
2898
|
+
default: {
|
|
2899
|
+
http: ["https://rpc.matchain.io"]
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
blockExplorers: {
|
|
2903
|
+
default: {
|
|
2904
|
+
name: "Matchscan",
|
|
2905
|
+
url: "https://matchscan.io/",
|
|
2906
|
+
apiUrl: "https://matchscan.io/api"
|
|
2907
|
+
}
|
|
2908
|
+
},
|
|
2909
|
+
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
2910
|
+
contracts: {
|
|
2911
|
+
multicall3: {
|
|
2912
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
// testnet: true,
|
|
2916
|
+
});
|
|
2917
|
+
|
|
2918
|
+
// src/config/chains/MatchTest.ts
|
|
2919
|
+
import { defineChain as defineChain2 } from "viem";
|
|
2920
|
+
var matchTest = /* @__PURE__ */ defineChain2({
|
|
2921
|
+
//定义matchTest链
|
|
2922
|
+
id: 699,
|
|
2923
|
+
name: "MatchTest",
|
|
2924
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
2925
|
+
rpcUrls: {
|
|
2926
|
+
default: {
|
|
2927
|
+
http: ["https://testnet-rpc.matchain.io"]
|
|
2928
|
+
}
|
|
2929
|
+
},
|
|
2930
|
+
blockExplorers: {
|
|
2931
|
+
default: {
|
|
2932
|
+
name: "Matchscan",
|
|
2933
|
+
url: "https://testnet.matchscan.io/",
|
|
2934
|
+
apiUrl: "https://testnet.matchscan.io/api"
|
|
2935
|
+
}
|
|
2936
|
+
},
|
|
2937
|
+
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
2938
|
+
contracts: {
|
|
2939
|
+
multicall3: {
|
|
2940
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
2941
|
+
blockCreated: 751532
|
|
2942
|
+
},
|
|
2943
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
2944
|
+
ensUniversalResolver: {
|
|
2945
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
2946
|
+
blockCreated: 5317080
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
// testnet: true,
|
|
2950
|
+
});
|
|
3852
2951
|
export {
|
|
3853
2952
|
api_exports as Api,
|
|
3854
2953
|
chains_exports as Chains,
|