@matchain/matchid-sdk-react 0.1.53-alpha.15 → 0.1.53-alpha.17
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 +2 -2
- package/dist/assets/icon/index.d.ts +2 -2
- package/dist/{chunk-BC4HS373.mjs → chunk-CNO5SYSQ.mjs} +123 -67
- package/dist/chunk-CNO5SYSQ.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 +102 -93
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +93 -89
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +3 -3
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +95 -91
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/{index-BVfCh4l-.d.mts → index-B1T3lcwo.d.mts} +1 -1
- package/dist/{index-BikcLg_6.d.ts → index-B6Tmp2HR.d.ts} +2 -2
- package/dist/{index-D3Kp05kW.d.ts → index-B6pp5UQe.d.ts} +1 -1
- package/dist/{index-D5WIVIkc.d.ts → index-BR3CyOOn.d.ts} +3 -2
- package/dist/{index-BrzFSkOe.d.mts → index-BeTS09HM.d.mts} +1 -1
- package/dist/{index-BaFmUVw-.d.mts → index-BxHKPC5n.d.mts} +1 -1
- package/dist/{index-DC4F1u-w.d.mts → index-CA7lhjpa.d.mts} +2 -2
- package/dist/{index-C0UKUm0h.d.ts → index-CRoZ0p2b.d.ts} +2 -2
- package/dist/{index-SOVt-ADK.d.mts → index-CXPCmoIu.d.mts} +3 -2
- package/dist/{index-Dus4QPjO.d.mts → index-Ce3oCu6-.d.mts} +1 -1
- package/dist/{index-CLYi12dP.d.mts → index-Ci_ub_5y.d.mts} +2 -2
- package/dist/{index-CQmN0dN4.d.ts → index-DKV8v6s_.d.ts} +1 -1
- package/dist/{index-BgdY5xdW.d.ts → index-Dnjr-WPp.d.ts} +1 -1
- package/dist/{index-D5yzH62h.d.ts → index-IHigYscw.d.ts} +1 -1
- package/dist/index.css +15 -7
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +201 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-VrV1kYga.d.mts → types-mRkAnXBf.d.mts} +8 -1
- package/dist/{types-VrV1kYga.d.ts → types-mRkAnXBf.d.ts} +8 -1
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunk-BC4HS373.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -4564,72 +4564,8 @@ function WalletModalContentV2(props) {
|
|
|
4564
4564
|
}
|
|
4565
4565
|
|
|
4566
4566
|
// src/components/EVMModal/index.tsx
|
|
4567
|
-
var import_chains = require("wagmi/chains");
|
|
4568
4567
|
var import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
4569
4568
|
var import_wagmi2 = require("wagmi");
|
|
4570
|
-
var import_wallets = require("@rainbow-me/rainbowkit/wallets");
|
|
4571
|
-
|
|
4572
|
-
// src/config/chains/MatchMain.ts
|
|
4573
|
-
var import_viem6 = require("viem");
|
|
4574
|
-
var matchMain = /* @__PURE__ */ (0, import_viem6.defineChain)({
|
|
4575
|
-
//定义match链
|
|
4576
|
-
id: 698,
|
|
4577
|
-
name: "Matchain",
|
|
4578
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
4579
|
-
rpcUrls: {
|
|
4580
|
-
default: {
|
|
4581
|
-
http: ["https://rpc.matchain.io"]
|
|
4582
|
-
}
|
|
4583
|
-
},
|
|
4584
|
-
blockExplorers: {
|
|
4585
|
-
default: {
|
|
4586
|
-
name: "Matchscan",
|
|
4587
|
-
url: "https://matchscan.io/",
|
|
4588
|
-
apiUrl: "https://matchscan.io/api"
|
|
4589
|
-
}
|
|
4590
|
-
},
|
|
4591
|
-
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
4592
|
-
contracts: {
|
|
4593
|
-
multicall3: {
|
|
4594
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
4595
|
-
}
|
|
4596
|
-
}
|
|
4597
|
-
// testnet: true,
|
|
4598
|
-
});
|
|
4599
|
-
|
|
4600
|
-
// src/config/chains/MatchTest.ts
|
|
4601
|
-
var import_viem7 = require("viem");
|
|
4602
|
-
var matchTest = /* @__PURE__ */ (0, import_viem7.defineChain)({
|
|
4603
|
-
//定义matchTest链
|
|
4604
|
-
id: 699,
|
|
4605
|
-
name: "MatchTest",
|
|
4606
|
-
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
4607
|
-
rpcUrls: {
|
|
4608
|
-
default: {
|
|
4609
|
-
http: ["https://testnet-rpc.matchain.io"]
|
|
4610
|
-
}
|
|
4611
|
-
},
|
|
4612
|
-
blockExplorers: {
|
|
4613
|
-
default: {
|
|
4614
|
-
name: "Matchscan",
|
|
4615
|
-
url: "https://testnet.matchscan.io/",
|
|
4616
|
-
apiUrl: "https://testnet.matchscan.io/api"
|
|
4617
|
-
}
|
|
4618
|
-
},
|
|
4619
|
-
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
4620
|
-
contracts: {
|
|
4621
|
-
multicall3: {
|
|
4622
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
4623
|
-
blockCreated: 751532
|
|
4624
|
-
},
|
|
4625
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
4626
|
-
ensUniversalResolver: {
|
|
4627
|
-
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
4628
|
-
blockCreated: 5317080
|
|
4629
|
-
}
|
|
4630
|
-
}
|
|
4631
|
-
// testnet: true,
|
|
4632
|
-
});
|
|
4633
4569
|
|
|
4634
4570
|
// src/hooks/useWalletBox.ts
|
|
4635
4571
|
var import_react22 = require("react");
|
|
@@ -4819,7 +4755,7 @@ var ConnectorUnavailableReconnectingError = class extends BaseError {
|
|
|
4819
4755
|
};
|
|
4820
4756
|
|
|
4821
4757
|
// node_modules/@wagmi/core/dist/esm/actions/getConnectorClient.js
|
|
4822
|
-
var
|
|
4758
|
+
var import_viem6 = require("viem");
|
|
4823
4759
|
var import_utils7 = require("viem/utils");
|
|
4824
4760
|
async function getConnectorClient(config, parameters = {}) {
|
|
4825
4761
|
let connection;
|
|
@@ -4859,16 +4795,16 @@ async function getConnectorClient(config, parameters = {}) {
|
|
|
4859
4795
|
});
|
|
4860
4796
|
const chain = config.chains.find((chain2) => chain2.id === chainId);
|
|
4861
4797
|
const provider = await connection.connector.getProvider({ chainId });
|
|
4862
|
-
return (0,
|
|
4798
|
+
return (0, import_viem6.createClient)({
|
|
4863
4799
|
account,
|
|
4864
4800
|
chain,
|
|
4865
4801
|
name: "Connector Client",
|
|
4866
|
-
transport: (opts) => (0,
|
|
4802
|
+
transport: (opts) => (0, import_viem6.custom)(provider)({ ...opts, retryCount: 0 })
|
|
4867
4803
|
});
|
|
4868
4804
|
}
|
|
4869
4805
|
|
|
4870
4806
|
// node_modules/@wagmi/core/dist/esm/exports/index.js
|
|
4871
|
-
var
|
|
4807
|
+
var import_viem7 = require("viem");
|
|
4872
4808
|
|
|
4873
4809
|
// src/hooks/useEthersSigner.ts
|
|
4874
4810
|
function clientToSigner(client) {
|
|
@@ -5060,23 +4996,6 @@ function WalletContent({
|
|
|
5060
4996
|
}
|
|
5061
4997
|
);
|
|
5062
4998
|
}
|
|
5063
|
-
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
5064
|
-
appName: "MatchID",
|
|
5065
|
-
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
5066
|
-
wallets: [
|
|
5067
|
-
{
|
|
5068
|
-
groupName: "Recommended",
|
|
5069
|
-
wallets: [
|
|
5070
|
-
import_wallets.metaMaskWallet,
|
|
5071
|
-
import_wallets.walletConnectWallet,
|
|
5072
|
-
import_wallets.okxWallet,
|
|
5073
|
-
import_wallets.bitgetWallet,
|
|
5074
|
-
import_wallets.injectedWallet
|
|
5075
|
-
]
|
|
5076
|
-
}
|
|
5077
|
-
],
|
|
5078
|
-
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
5079
|
-
});
|
|
5080
4999
|
function EVMConnectModal({
|
|
5081
5000
|
type = "login",
|
|
5082
5001
|
onSuccess,
|
|
@@ -5087,7 +5006,7 @@ function EVMConnectModal({
|
|
|
5087
5006
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5088
5007
|
}, {
|
|
5089
5008
|
name: "EVM"
|
|
5090
|
-
}), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5009
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WalletContent, { onSuccess, type }) });
|
|
5091
5010
|
}
|
|
5092
5011
|
function EVMModal(props) {
|
|
5093
5012
|
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(EVMConnectModal, { ...props });
|
|
@@ -6074,7 +5993,7 @@ function WalletAsset({
|
|
|
6074
5993
|
|
|
6075
5994
|
// src/components/TokenSend/index.tsx
|
|
6076
5995
|
var import_react31 = require("react");
|
|
6077
|
-
var
|
|
5996
|
+
var import_viem8 = require("viem");
|
|
6078
5997
|
var import_react_intl15 = require("react-intl");
|
|
6079
5998
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6080
5999
|
function Input2({
|
|
@@ -6117,8 +6036,8 @@ function TokenSend({
|
|
|
6117
6036
|
const walletClient = (0, import_react31.useMemo)(() => {
|
|
6118
6037
|
return createWalletClient2({
|
|
6119
6038
|
// @ts-ignore
|
|
6120
|
-
chain: (0,
|
|
6121
|
-
transport: (0,
|
|
6039
|
+
chain: (0, import_viem8.defineChain)(chain),
|
|
6040
|
+
transport: (0, import_viem8.http)()
|
|
6122
6041
|
});
|
|
6123
6042
|
}, [chain]);
|
|
6124
6043
|
const [amount, setAmount] = (0, import_react31.useState)("");
|
|
@@ -6131,13 +6050,13 @@ function TokenSend({
|
|
|
6131
6050
|
if (!amount || !address || !reg.test(address)) {
|
|
6132
6051
|
return;
|
|
6133
6052
|
}
|
|
6134
|
-
const viemChain = (0,
|
|
6053
|
+
const viemChain = (0, import_viem8.defineChain)(chain);
|
|
6135
6054
|
const to = isNative ? address : token.address;
|
|
6136
|
-
const value = isNative ? (0,
|
|
6137
|
-
const data = isNative ? "0x" : (0,
|
|
6138
|
-
abi:
|
|
6055
|
+
const value = isNative ? (0, import_viem8.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
|
|
6056
|
+
const data = isNative ? "0x" : (0, import_viem8.encodeFunctionData)({
|
|
6057
|
+
abi: import_viem8.erc20Abi,
|
|
6139
6058
|
functionName: "transfer",
|
|
6140
|
-
args: [address, (0,
|
|
6059
|
+
args: [address, (0, import_viem8.parseUnits)(amount, parseInt(token?.decimals || "18"))]
|
|
6141
6060
|
});
|
|
6142
6061
|
return {
|
|
6143
6062
|
to,
|
|
@@ -6410,8 +6329,8 @@ function TokenSendList({ close }) {
|
|
|
6410
6329
|
// src/components/TransactionList/index.tsx
|
|
6411
6330
|
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
|
|
6412
6331
|
var import_react33 = require("react");
|
|
6413
|
-
var
|
|
6414
|
-
var
|
|
6332
|
+
var import_viem9 = require("viem");
|
|
6333
|
+
var import_viem10 = require("viem");
|
|
6415
6334
|
|
|
6416
6335
|
// src/store/useContractStore.ts
|
|
6417
6336
|
var import_zustand5 = require("zustand");
|
|
@@ -6493,8 +6412,8 @@ var Item = ({ data }) => {
|
|
|
6493
6412
|
return data.from;
|
|
6494
6413
|
}
|
|
6495
6414
|
if (transferType == "erc20_transfer") {
|
|
6496
|
-
const decodeData = (0,
|
|
6497
|
-
abi:
|
|
6415
|
+
const decodeData = (0, import_viem9.decodeFunctionData)({
|
|
6416
|
+
abi: import_viem10.erc20Abi,
|
|
6498
6417
|
data: data.input
|
|
6499
6418
|
});
|
|
6500
6419
|
return decodeData.args[0];
|
|
@@ -6503,19 +6422,19 @@ var Item = ({ data }) => {
|
|
|
6503
6422
|
}, [data.input, transferType, data.to, isOut]);
|
|
6504
6423
|
const amount = (0, import_react33.useMemo)(() => {
|
|
6505
6424
|
if (transferType == "erc20_transfer") {
|
|
6506
|
-
const decodeData = (0,
|
|
6507
|
-
abi:
|
|
6425
|
+
const decodeData = (0, import_viem9.decodeFunctionData)({
|
|
6426
|
+
abi: import_viem10.erc20Abi,
|
|
6508
6427
|
data: data.input
|
|
6509
6428
|
});
|
|
6510
6429
|
const value = decodeData.args[1];
|
|
6511
|
-
return (0,
|
|
6430
|
+
return (0, import_viem9.formatUnits)(value, contracts[`${chainId}-${data.to.toLowerCase()}`]?.decimals || 18);
|
|
6512
6431
|
}
|
|
6513
6432
|
return chainFormatUnits(BigInt(data.value));
|
|
6514
6433
|
}, [data.input, transferType, data.value, contracts, chainId, data.to]);
|
|
6515
6434
|
const hashQuery = useHash({
|
|
6516
6435
|
hash: data.hash,
|
|
6517
6436
|
//@ts-ignore
|
|
6518
|
-
chain: (0,
|
|
6437
|
+
chain: (0, import_viem9.defineChain)(chain),
|
|
6519
6438
|
refetchInterval: shouldRefetch ? 3e3 : false,
|
|
6520
6439
|
enabled: shouldRefetch && data.source == "local"
|
|
6521
6440
|
});
|
|
@@ -6814,12 +6733,13 @@ function ContactCard({
|
|
|
6814
6733
|
data,
|
|
6815
6734
|
action
|
|
6816
6735
|
}) {
|
|
6736
|
+
const isDownMd = useDownMd();
|
|
6817
6737
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-flex matchid-contact-item", children: [
|
|
6818
6738
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-contact-item-content", children: [
|
|
6819
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 48, height: 48, radius: 100, loading, children: data?.avatar ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("img", { src: data?.avatar, className: "matchid-contact-item-avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(AlphaAvatar, { size: 48, name: data?.name || "MatchID" }) }),
|
|
6739
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: isDownMd ? 36 : 48, height: isDownMd ? 36 : 48, radius: 100, loading, children: data?.avatar ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("img", { src: data?.avatar, className: "matchid-contact-item-avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(AlphaAvatar, { size: isDownMd ? 36 : 48, name: data?.name || "MatchID" }) }),
|
|
6820
6740
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-contact-item-info", children: [
|
|
6821
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "matchid-contact-item-name", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 80, height: 20, loading, children: data?.name || "MatchID User" }) }),
|
|
6822
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "matchid-contact-item-address", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 80, height: 16, loading, children: truncateAddress(data?.address || "", 6, 6) }) })
|
|
6741
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "matchid-contact-item-name", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 80, height: isDownMd ? 16 : 20, loading, children: data?.name || "MatchID User" }) }),
|
|
6742
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "matchid-contact-item-address", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 80, height: isDownMd ? 12 : 16, loading, children: truncateAddress(data?.address || "", 6, 6) }) })
|
|
6823
6743
|
] })
|
|
6824
6744
|
] }),
|
|
6825
6745
|
action && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "matchid-contact-item-action", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Skeleton_default, { width: 20, height: 20, loading, children: action() }) })
|
|
@@ -6877,6 +6797,7 @@ function ContactList({
|
|
|
6877
6797
|
}) {
|
|
6878
6798
|
const { loading, totalCount, data, onLoadMore } = contact_exports.useContactList(limit, type);
|
|
6879
6799
|
const [hiddenList, setHiddenList] = (0, import_react35.useState)([]);
|
|
6800
|
+
const { address } = useWallet();
|
|
6880
6801
|
(0, import_react35.useEffect)(() => {
|
|
6881
6802
|
setHiddenList([]);
|
|
6882
6803
|
}, [type]);
|
|
@@ -6896,6 +6817,9 @@ function ContactList({
|
|
|
6896
6817
|
}
|
|
6897
6818
|
const item = data[index];
|
|
6898
6819
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ContactCard, { data: item, action: () => {
|
|
6820
|
+
if (address == item.address) {
|
|
6821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_jsx_runtime93.Fragment, {});
|
|
6822
|
+
}
|
|
6899
6823
|
if (type == "Requests") {
|
|
6900
6824
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RequestAction, { data: item, onSuccess: (data2) => {
|
|
6901
6825
|
setHiddenList([...hiddenList, data2.limit_id || 0]);
|
|
@@ -6921,17 +6845,17 @@ function ContactList({
|
|
|
6921
6845
|
var import_react_qrcode = require("react-qrcode");
|
|
6922
6846
|
var import_react37 = require("react");
|
|
6923
6847
|
var import_react_query9 = require("@tanstack/react-query");
|
|
6924
|
-
var
|
|
6848
|
+
var import_viem13 = require("viem");
|
|
6925
6849
|
var import_react_intl21 = require("react-intl");
|
|
6926
6850
|
|
|
6927
6851
|
// src/components/ImportToken/index.tsx
|
|
6928
6852
|
var import_react36 = require("react");
|
|
6929
6853
|
var import_react_intl20 = require("react-intl");
|
|
6930
6854
|
var import_react_query8 = require("@tanstack/react-query");
|
|
6931
|
-
var
|
|
6855
|
+
var import_viem12 = require("viem");
|
|
6932
6856
|
|
|
6933
6857
|
// src/hooks/useIsContract.ts
|
|
6934
|
-
var
|
|
6858
|
+
var import_viem11 = require("viem");
|
|
6935
6859
|
var import_react_query7 = require("@tanstack/react-query");
|
|
6936
6860
|
function useIsContract({
|
|
6937
6861
|
address,
|
|
@@ -6943,9 +6867,9 @@ function useIsContract({
|
|
|
6943
6867
|
queryFn: async () => {
|
|
6944
6868
|
if (!chain) return false;
|
|
6945
6869
|
if (!address) return false;
|
|
6946
|
-
const publicClient = (0,
|
|
6870
|
+
const publicClient = (0, import_viem11.createPublicClient)({
|
|
6947
6871
|
chain,
|
|
6948
|
-
transport: (0,
|
|
6872
|
+
transport: (0, import_viem11.http)()
|
|
6949
6873
|
});
|
|
6950
6874
|
const res = await publicClient.getCode({ address });
|
|
6951
6875
|
return res !== null && res !== void 0;
|
|
@@ -6969,13 +6893,13 @@ function ImportToken({ close }) {
|
|
|
6969
6893
|
const calls = [
|
|
6970
6894
|
{
|
|
6971
6895
|
address,
|
|
6972
|
-
abi:
|
|
6896
|
+
abi: import_viem12.erc20Abi,
|
|
6973
6897
|
functionName: "symbol",
|
|
6974
6898
|
args: []
|
|
6975
6899
|
},
|
|
6976
6900
|
{
|
|
6977
6901
|
address,
|
|
6978
|
-
abi:
|
|
6902
|
+
abi: import_viem12.erc20Abi,
|
|
6979
6903
|
functionName: "decimals",
|
|
6980
6904
|
args: []
|
|
6981
6905
|
}
|
|
@@ -7061,7 +6985,7 @@ function ImportToken({ close }) {
|
|
|
7061
6985
|
}, [error, address, symbol, decimals]);
|
|
7062
6986
|
const isContractQuery = useIsContract({
|
|
7063
6987
|
//@ts-ignore
|
|
7064
|
-
chain: (0,
|
|
6988
|
+
chain: (0, import_viem12.defineChain)(chain),
|
|
7065
6989
|
address,
|
|
7066
6990
|
enabled: canImport
|
|
7067
6991
|
});
|
|
@@ -7265,13 +7189,13 @@ function useMatchWalletRecords() {
|
|
|
7265
7189
|
for (const contract of contractUnique) {
|
|
7266
7190
|
calls.push({
|
|
7267
7191
|
address: contract,
|
|
7268
|
-
abi:
|
|
7192
|
+
abi: import_viem13.erc20Abi,
|
|
7269
7193
|
functionName: "symbol",
|
|
7270
7194
|
args: []
|
|
7271
7195
|
});
|
|
7272
7196
|
calls.push({
|
|
7273
7197
|
address: contract,
|
|
7274
|
-
abi:
|
|
7198
|
+
abi: import_viem13.erc20Abi,
|
|
7275
7199
|
functionName: "decimals",
|
|
7276
7200
|
args: []
|
|
7277
7201
|
});
|
|
@@ -7433,7 +7357,7 @@ function useMatchWalletAssetList({
|
|
|
7433
7357
|
if (!erc20Tokens.length || !publicClient) return [];
|
|
7434
7358
|
const calls = erc20Tokens.map((token) => ({
|
|
7435
7359
|
address: token.address,
|
|
7436
|
-
abi:
|
|
7360
|
+
abi: import_viem13.erc20Abi,
|
|
7437
7361
|
functionName: "balanceOf",
|
|
7438
7362
|
args: [address]
|
|
7439
7363
|
}));
|
|
@@ -7464,11 +7388,11 @@ function useMatchWalletAssetList({
|
|
|
7464
7388
|
const assetAddress = asset.address.toLowerCase();
|
|
7465
7389
|
if (assetAddress === NATIVE_TOKEN_ADDRESS) {
|
|
7466
7390
|
balanceValue = nativeBalanceQuery.data?.toString() || "0";
|
|
7467
|
-
balance = nativeBalanceQuery.data ? Number((0,
|
|
7391
|
+
balance = nativeBalanceQuery.data ? Number((0, import_viem13.formatUnits)(nativeBalanceQuery.data, decimals)) : 0;
|
|
7468
7392
|
} else {
|
|
7469
7393
|
const index = erc20Tokens.findIndex((t) => t.address.toLowerCase() === assetAddress);
|
|
7470
7394
|
if (index !== -1 && erc20Balances[index] && erc20Balances[index].status === "success") {
|
|
7471
|
-
balance = Number((0,
|
|
7395
|
+
balance = Number((0, import_viem13.formatUnits)(erc20Balances[index].result, decimals));
|
|
7472
7396
|
balanceValue = erc20Balances[index].result?.toString() || "0";
|
|
7473
7397
|
}
|
|
7474
7398
|
}
|
|
@@ -7503,7 +7427,7 @@ function useMatchWalletAssetList({
|
|
|
7503
7427
|
// src/hooks/useReceipt.tsx
|
|
7504
7428
|
var import_react38 = require("react");
|
|
7505
7429
|
var import_react_query10 = require("@tanstack/react-query");
|
|
7506
|
-
var
|
|
7430
|
+
var import_viem14 = require("viem");
|
|
7507
7431
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
7508
7432
|
var MAX_CACHE_SIZE = 500;
|
|
7509
7433
|
var STORAGE_KEY = "match_receipt_logs";
|
|
@@ -7620,9 +7544,9 @@ function useReceipt2({
|
|
|
7620
7544
|
return cache.get(cacheKey);
|
|
7621
7545
|
}
|
|
7622
7546
|
try {
|
|
7623
|
-
const publicClient = (0,
|
|
7624
|
-
chain: (0,
|
|
7625
|
-
transport: (0,
|
|
7547
|
+
const publicClient = (0, import_viem14.createPublicClient)({
|
|
7548
|
+
chain: (0, import_viem14.defineChain)(chain),
|
|
7549
|
+
transport: (0, import_viem14.http)()
|
|
7626
7550
|
});
|
|
7627
7551
|
const receipt = await publicClient.getTransactionReceipt({ hash });
|
|
7628
7552
|
if (!receipt) {
|
|
@@ -7647,7 +7571,7 @@ function useReceipt2({
|
|
|
7647
7571
|
// src/hooks/useTransaction.tsx
|
|
7648
7572
|
var import_react39 = require("react");
|
|
7649
7573
|
var import_react_query11 = require("@tanstack/react-query");
|
|
7650
|
-
var
|
|
7574
|
+
var import_viem15 = require("viem");
|
|
7651
7575
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
7652
7576
|
var MAX_CACHE_SIZE2 = 500;
|
|
7653
7577
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
@@ -7764,9 +7688,9 @@ function useTransaction({
|
|
|
7764
7688
|
return cache.get(cacheKey);
|
|
7765
7689
|
}
|
|
7766
7690
|
try {
|
|
7767
|
-
const publicClient = (0,
|
|
7768
|
-
chain: (0,
|
|
7769
|
-
transport: (0,
|
|
7691
|
+
const publicClient = (0, import_viem15.createPublicClient)({
|
|
7692
|
+
chain: (0, import_viem15.defineChain)(chain),
|
|
7693
|
+
transport: (0, import_viem15.http)()
|
|
7770
7694
|
});
|
|
7771
7695
|
const transaction = await publicClient.getTransaction({ hash });
|
|
7772
7696
|
if (!transaction) {
|
|
@@ -8558,7 +8482,14 @@ var zh_default = {
|
|
|
8558
8482
|
back: "\u8FD4\u56DE",
|
|
8559
8483
|
importSuccess: "\u6210\u529F\u5BFC\u5165\u4EE3\u5E01",
|
|
8560
8484
|
importFail: "\u5BFC\u5165\u4EE3\u5E01\u5931\u8D25",
|
|
8561
|
-
changeNetwork: "\u5207\u6362\u7F51\u7EDC"
|
|
8485
|
+
changeNetwork: "\u5207\u6362\u7F51\u7EDC",
|
|
8486
|
+
approveSuccess: "\u6388\u6743\u6210\u529F",
|
|
8487
|
+
Approve: "\u6388\u6743",
|
|
8488
|
+
noFriends: "\u6682\u65E0\u597D\u53CB",
|
|
8489
|
+
noRequests: "\u6682\u65E0\u8BF7\u6C42",
|
|
8490
|
+
noMore: "\u6CA1\u6709\u66F4\u591A",
|
|
8491
|
+
Remove: "\u79FB\u9664",
|
|
8492
|
+
removeSuccess: "\u79FB\u9664\u6210\u529F"
|
|
8562
8493
|
};
|
|
8563
8494
|
|
|
8564
8495
|
// src/i18n/tw.json
|
|
@@ -8639,7 +8570,14 @@ var tw_default = {
|
|
|
8639
8570
|
back: "\u8FD4\u56DE",
|
|
8640
8571
|
importSuccess: "\u6210\u529F\u532F\u5165\u4EE3\u5E63",
|
|
8641
8572
|
importFail: "\u532F\u5165\u4EE3\u5E63\u5931\u6557",
|
|
8642
|
-
changeNetwork: "\u5207\u63DB\u7DB2\u7D61"
|
|
8573
|
+
changeNetwork: "\u5207\u63DB\u7DB2\u7D61",
|
|
8574
|
+
approveSuccess: "\u6388\u6B0A\u6210\u529F",
|
|
8575
|
+
Approve: "\u6388\u6B0A",
|
|
8576
|
+
noFriends: "\u66AB\u7121\u597D\u53CB",
|
|
8577
|
+
noRequests: "\u66AB\u7121\u8ACB\u6C42",
|
|
8578
|
+
noMore: "\u6C92\u6709\u66F4\u591A",
|
|
8579
|
+
Remove: "\u79FB\u9664",
|
|
8580
|
+
removeSuccess: "\u79FB\u9664\u6210\u529F"
|
|
8643
8581
|
};
|
|
8644
8582
|
|
|
8645
8583
|
// src/i18n/fr.json
|
|
@@ -8720,7 +8658,14 @@ var fr_default = {
|
|
|
8720
8658
|
back: "Retour",
|
|
8721
8659
|
importSuccess: "Importation du jeton r\xE9ussie",
|
|
8722
8660
|
importFail: "\xC9chec de l'importation du jeton",
|
|
8723
|
-
changeNetwork: "Changer de r\xE9seau"
|
|
8661
|
+
changeNetwork: "Changer de r\xE9seau",
|
|
8662
|
+
approveSuccess: "Approbation r\xE9ussie",
|
|
8663
|
+
Approve: "Approuver",
|
|
8664
|
+
noFriends: "Pas encore d'amis",
|
|
8665
|
+
noRequests: "Pas encore de demandes",
|
|
8666
|
+
noMore: "Plus rien",
|
|
8667
|
+
Remove: "Supprimer",
|
|
8668
|
+
removeSuccess: "Suppression r\xE9ussie"
|
|
8724
8669
|
};
|
|
8725
8670
|
|
|
8726
8671
|
// src/i18n/ja.json
|
|
@@ -8801,7 +8746,14 @@ var ja_default = {
|
|
|
8801
8746
|
back: "\u623B\u308B",
|
|
8802
8747
|
importSuccess: "\u30C8\u30FC\u30AF\u30F3\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u6210\u529F\u3057\u307E\u3057\u305F",
|
|
8803
8748
|
importFail: "\u30C8\u30FC\u30AF\u30F3\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
8804
|
-
changeNetwork: "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u3092\u5909\u66F4"
|
|
8749
|
+
changeNetwork: "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u3092\u5909\u66F4",
|
|
8750
|
+
approveSuccess: "\u627F\u8A8D\u306B\u6210\u529F\u3057\u307E\u3057\u305F",
|
|
8751
|
+
Approve: "\u627F\u8A8D",
|
|
8752
|
+
noFriends: "\u307E\u3060\u53CB\u9054\u304C\u3044\u307E\u305B\u3093",
|
|
8753
|
+
noRequests: "\u307E\u3060\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
8754
|
+
noMore: "\u3053\u308C\u4EE5\u4E0A\u3042\u308A\u307E\u305B\u3093",
|
|
8755
|
+
Remove: "\u524A\u9664",
|
|
8756
|
+
removeSuccess: "\u524A\u9664\u306B\u6210\u529F\u3057\u307E\u3057\u305F"
|
|
8805
8757
|
};
|
|
8806
8758
|
|
|
8807
8759
|
// src/i18n/ko.json
|
|
@@ -8882,7 +8834,14 @@ var ko_default = {
|
|
|
8882
8834
|
back: "\uB4A4\uB85C",
|
|
8883
8835
|
importSuccess: "\uD1A0\uD070\uC744 \uC131\uACF5\uC801\uC73C\uB85C \uAC00\uC838\uC654\uC2B5\uB2C8\uB2E4",
|
|
8884
8836
|
importFail: "\uD1A0\uD070 \uAC00\uC838\uC624\uAE30\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4",
|
|
8885
|
-
changeNetwork: "\uB124\uD2B8\uC6CC\uD06C \uBCC0\uACBD"
|
|
8837
|
+
changeNetwork: "\uB124\uD2B8\uC6CC\uD06C \uBCC0\uACBD",
|
|
8838
|
+
approveSuccess: "\uC2B9\uC778 \uC131\uACF5",
|
|
8839
|
+
Approve: "\uC2B9\uC778",
|
|
8840
|
+
noFriends: "\uC544\uC9C1 \uCE5C\uAD6C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
8841
|
+
noRequests: "\uC544\uC9C1 \uC694\uCCAD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
8842
|
+
noMore: "\uB354 \uC774\uC0C1 \uC5C6\uC74C",
|
|
8843
|
+
Remove: "\uC0AD\uC81C",
|
|
8844
|
+
removeSuccess: "\uC0AD\uC81C \uC131\uACF5"
|
|
8886
8845
|
};
|
|
8887
8846
|
|
|
8888
8847
|
// src/i18n/vi.json
|
|
@@ -8963,7 +8922,14 @@ var vi_default = {
|
|
|
8963
8922
|
back: "Quay l\u1EA1i",
|
|
8964
8923
|
importSuccess: "Nh\u1EADp Token th\xE0nh c\xF4ng",
|
|
8965
8924
|
importFail: "Kh\xF4ng th\u1EC3 nh\u1EADp Token",
|
|
8966
|
-
changeNetwork: "Thay \u0111\u1ED5i m\u1EA1ng"
|
|
8925
|
+
changeNetwork: "Thay \u0111\u1ED5i m\u1EA1ng",
|
|
8926
|
+
approveSuccess: "Ph\xEA duy\u1EC7t th\xE0nh c\xF4ng",
|
|
8927
|
+
Approve: "Ph\xEA duy\u1EC7t",
|
|
8928
|
+
noFriends: "Ch\u01B0a c\xF3 b\u1EA1n b\xE8",
|
|
8929
|
+
noRequests: "Ch\u01B0a c\xF3 y\xEAu c\u1EA7u n\xE0o",
|
|
8930
|
+
noMore: "Kh\xF4ng c\xF2n n\u1EEFa",
|
|
8931
|
+
Remove: "X\xF3a",
|
|
8932
|
+
removeSuccess: "X\xF3a th\xE0nh c\xF4ng"
|
|
8967
8933
|
};
|
|
8968
8934
|
|
|
8969
8935
|
// src/i18n/es.json
|
|
@@ -9044,7 +9010,14 @@ var es_default = {
|
|
|
9044
9010
|
back: "Atr\xE1s",
|
|
9045
9011
|
importSuccess: "Token importado con \xE9xito",
|
|
9046
9012
|
importFail: "Error al importar el token",
|
|
9047
|
-
changeNetwork: "Cambiar red"
|
|
9013
|
+
changeNetwork: "Cambiar red",
|
|
9014
|
+
approveSuccess: "Autorizado con \xE9xito",
|
|
9015
|
+
Approve: "Autorizar",
|
|
9016
|
+
noFriends: "A\xFAn no hay amigos",
|
|
9017
|
+
noRequests: "A\xFAn no hay solicitudes",
|
|
9018
|
+
noMore: "No hay m\xE1s",
|
|
9019
|
+
Remove: "Eliminar",
|
|
9020
|
+
removeSuccess: "Eliminado con \xE9xito"
|
|
9048
9021
|
};
|
|
9049
9022
|
|
|
9050
9023
|
// src/i18n/pt.json
|
|
@@ -9125,7 +9098,14 @@ var pt_default = {
|
|
|
9125
9098
|
back: "Voltar",
|
|
9126
9099
|
importSuccess: "Token importado com sucesso",
|
|
9127
9100
|
importFail: "Falha ao importar o token",
|
|
9128
|
-
changeNetwork: "Alterar rede"
|
|
9101
|
+
changeNetwork: "Alterar rede",
|
|
9102
|
+
approveSuccess: "Aprova\xE7\xE3o bem-sucedida",
|
|
9103
|
+
Approve: "Aprovar",
|
|
9104
|
+
noFriends: "Ainda sem amigos",
|
|
9105
|
+
noRequests: "Ainda sem solicita\xE7\xF5es",
|
|
9106
|
+
noMore: "N\xE3o h\xE1 mais",
|
|
9107
|
+
Remove: "Remover",
|
|
9108
|
+
removeSuccess: "Removido com sucesso"
|
|
9129
9109
|
};
|
|
9130
9110
|
|
|
9131
9111
|
// src/i18n/index.ts
|
|
@@ -9142,8 +9122,93 @@ var messages = {
|
|
|
9142
9122
|
};
|
|
9143
9123
|
|
|
9144
9124
|
// src/MatchContext.tsx
|
|
9125
|
+
var import_rainbowkit2 = require("@rainbow-me/rainbowkit");
|
|
9126
|
+
var import_wallets = require("@rainbow-me/rainbowkit/wallets");
|
|
9127
|
+
var import_chains = require("wagmi/chains");
|
|
9128
|
+
|
|
9129
|
+
// src/config/chains/MatchMain.ts
|
|
9130
|
+
var import_viem16 = require("viem");
|
|
9131
|
+
var matchMain = /* @__PURE__ */ (0, import_viem16.defineChain)({
|
|
9132
|
+
//定义match链
|
|
9133
|
+
id: 698,
|
|
9134
|
+
name: "Matchain",
|
|
9135
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
9136
|
+
rpcUrls: {
|
|
9137
|
+
default: {
|
|
9138
|
+
http: ["https://rpc.matchain.io"]
|
|
9139
|
+
}
|
|
9140
|
+
},
|
|
9141
|
+
blockExplorers: {
|
|
9142
|
+
default: {
|
|
9143
|
+
name: "Matchscan",
|
|
9144
|
+
url: "https://matchscan.io/",
|
|
9145
|
+
apiUrl: "https://matchscan.io/api"
|
|
9146
|
+
}
|
|
9147
|
+
},
|
|
9148
|
+
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
9149
|
+
contracts: {
|
|
9150
|
+
multicall3: {
|
|
9151
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
9152
|
+
}
|
|
9153
|
+
}
|
|
9154
|
+
// testnet: true,
|
|
9155
|
+
});
|
|
9156
|
+
|
|
9157
|
+
// src/config/chains/MatchTest.ts
|
|
9158
|
+
var import_viem17 = require("viem");
|
|
9159
|
+
var matchTest = /* @__PURE__ */ (0, import_viem17.defineChain)({
|
|
9160
|
+
//定义matchTest链
|
|
9161
|
+
id: 699,
|
|
9162
|
+
name: "MatchTest",
|
|
9163
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
9164
|
+
rpcUrls: {
|
|
9165
|
+
default: {
|
|
9166
|
+
http: ["https://testnet-rpc.matchain.io"]
|
|
9167
|
+
}
|
|
9168
|
+
},
|
|
9169
|
+
blockExplorers: {
|
|
9170
|
+
default: {
|
|
9171
|
+
name: "Matchscan",
|
|
9172
|
+
url: "https://testnet.matchscan.io/",
|
|
9173
|
+
apiUrl: "https://testnet.matchscan.io/api"
|
|
9174
|
+
}
|
|
9175
|
+
},
|
|
9176
|
+
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
9177
|
+
contracts: {
|
|
9178
|
+
multicall3: {
|
|
9179
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
9180
|
+
blockCreated: 751532
|
|
9181
|
+
},
|
|
9182
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
9183
|
+
ensUniversalResolver: {
|
|
9184
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
9185
|
+
blockCreated: 5317080
|
|
9186
|
+
}
|
|
9187
|
+
}
|
|
9188
|
+
// testnet: true,
|
|
9189
|
+
});
|
|
9190
|
+
|
|
9191
|
+
// src/MatchContext.tsx
|
|
9192
|
+
var import_wagmi3 = require("wagmi");
|
|
9145
9193
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
9146
9194
|
var queryClient = new import_react_query13.QueryClient();
|
|
9195
|
+
var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
9196
|
+
appName: "MatchID",
|
|
9197
|
+
projectId: "9ac6ea7e07860f04616fb311b447dee9",
|
|
9198
|
+
wallets: [
|
|
9199
|
+
{
|
|
9200
|
+
groupName: "Recommended",
|
|
9201
|
+
wallets: [
|
|
9202
|
+
import_wallets.metaMaskWallet,
|
|
9203
|
+
import_wallets.walletConnectWallet,
|
|
9204
|
+
import_wallets.okxWallet,
|
|
9205
|
+
import_wallets.bitgetWallet,
|
|
9206
|
+
import_wallets.injectedWallet
|
|
9207
|
+
]
|
|
9208
|
+
}
|
|
9209
|
+
],
|
|
9210
|
+
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
9211
|
+
});
|
|
9147
9212
|
var MatchContext = (0, import_react43.createContext)(void 0);
|
|
9148
9213
|
var MatchProvider = ({
|
|
9149
9214
|
children,
|
|
@@ -9164,7 +9229,7 @@ var MatchProvider = ({
|
|
|
9164
9229
|
useWalletInit({
|
|
9165
9230
|
config: wallet
|
|
9166
9231
|
});
|
|
9167
|
-
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react_intl23.IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react_query13.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
9232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react_intl23.IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react_query13.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_rainbowkit2.RainbowKitProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
9168
9233
|
MatchContext.Provider,
|
|
9169
9234
|
{
|
|
9170
9235
|
value: {
|
|
@@ -9177,7 +9242,7 @@ var MatchProvider = ({
|
|
|
9177
9242
|
},
|
|
9178
9243
|
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(context_default, { children })
|
|
9179
9244
|
}
|
|
9180
|
-
) }) });
|
|
9245
|
+
) }) }) }) });
|
|
9181
9246
|
};
|
|
9182
9247
|
var useMatch = () => {
|
|
9183
9248
|
const context = (0, import_react43.useContext)(MatchContext);
|