@matchain/matchid-sdk-react 0.1.53-alpha.16 → 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-UOHVZWED.mjs → chunk-CNO5SYSQ.mjs} +38 -39
- 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 +99 -91
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/{index-Na2Ub13l.d.mts → index-B1T3lcwo.d.mts} +1 -1
- package/dist/{index-ChklXND5.d.ts → index-B6Tmp2HR.d.ts} +2 -2
- package/dist/{index-_9VVEy7O.d.ts → index-B6pp5UQe.d.ts} +1 -1
- package/dist/{index-B16U2SHA.d.ts → index-BR3CyOOn.d.ts} +3 -2
- package/dist/{index-B2DkI1ML.d.mts → index-BeTS09HM.d.mts} +1 -1
- package/dist/{index-nMzH5qxx.d.mts → index-BxHKPC5n.d.mts} +1 -1
- package/dist/{index-C7vPCjcT.d.mts → index-CA7lhjpa.d.mts} +2 -2
- package/dist/{index-jQp1rITQ.d.ts → index-CRoZ0p2b.d.ts} +2 -2
- package/dist/{index-zJQVg2B1.d.mts → index-CXPCmoIu.d.mts} +3 -2
- package/dist/{index-ByjogbBx.d.mts → index-Ce3oCu6-.d.mts} +1 -1
- package/dist/{index-BxWVN7HQ.d.mts → index-Ci_ub_5y.d.mts} +2 -2
- package/dist/{index-Dfckd7XV.d.ts → index-DKV8v6s_.d.ts} +1 -1
- package/dist/{index-CYXjMyV_.d.ts → index-Dnjr-WPp.d.ts} +1 -1
- package/dist/{index-jG0evmQL.d.ts → index-IHigYscw.d.ts} +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +134 -126
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-B5QEZ2fv.d.mts → types-mRkAnXBf.d.mts} +8 -1
- package/dist/{types-B5QEZ2fv.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-UOHVZWED.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
|
});
|
|
@@ -6823,7 +6742,7 @@ function ContactCard({
|
|
|
6823
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) }) })
|
|
6824
6743
|
] })
|
|
6825
6744
|
] }),
|
|
6826
|
-
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:
|
|
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() }) })
|
|
6827
6746
|
] });
|
|
6828
6747
|
}
|
|
6829
6748
|
function RequestAction({ data, onSuccess }) {
|
|
@@ -6878,6 +6797,7 @@ function ContactList({
|
|
|
6878
6797
|
}) {
|
|
6879
6798
|
const { loading, totalCount, data, onLoadMore } = contact_exports.useContactList(limit, type);
|
|
6880
6799
|
const [hiddenList, setHiddenList] = (0, import_react35.useState)([]);
|
|
6800
|
+
const { address } = useWallet();
|
|
6881
6801
|
(0, import_react35.useEffect)(() => {
|
|
6882
6802
|
setHiddenList([]);
|
|
6883
6803
|
}, [type]);
|
|
@@ -6897,6 +6817,9 @@ function ContactList({
|
|
|
6897
6817
|
}
|
|
6898
6818
|
const item = data[index];
|
|
6899
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
|
+
}
|
|
6900
6823
|
if (type == "Requests") {
|
|
6901
6824
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RequestAction, { data: item, onSuccess: (data2) => {
|
|
6902
6825
|
setHiddenList([...hiddenList, data2.limit_id || 0]);
|
|
@@ -6922,17 +6845,17 @@ function ContactList({
|
|
|
6922
6845
|
var import_react_qrcode = require("react-qrcode");
|
|
6923
6846
|
var import_react37 = require("react");
|
|
6924
6847
|
var import_react_query9 = require("@tanstack/react-query");
|
|
6925
|
-
var
|
|
6848
|
+
var import_viem13 = require("viem");
|
|
6926
6849
|
var import_react_intl21 = require("react-intl");
|
|
6927
6850
|
|
|
6928
6851
|
// src/components/ImportToken/index.tsx
|
|
6929
6852
|
var import_react36 = require("react");
|
|
6930
6853
|
var import_react_intl20 = require("react-intl");
|
|
6931
6854
|
var import_react_query8 = require("@tanstack/react-query");
|
|
6932
|
-
var
|
|
6855
|
+
var import_viem12 = require("viem");
|
|
6933
6856
|
|
|
6934
6857
|
// src/hooks/useIsContract.ts
|
|
6935
|
-
var
|
|
6858
|
+
var import_viem11 = require("viem");
|
|
6936
6859
|
var import_react_query7 = require("@tanstack/react-query");
|
|
6937
6860
|
function useIsContract({
|
|
6938
6861
|
address,
|
|
@@ -6944,9 +6867,9 @@ function useIsContract({
|
|
|
6944
6867
|
queryFn: async () => {
|
|
6945
6868
|
if (!chain) return false;
|
|
6946
6869
|
if (!address) return false;
|
|
6947
|
-
const publicClient = (0,
|
|
6870
|
+
const publicClient = (0, import_viem11.createPublicClient)({
|
|
6948
6871
|
chain,
|
|
6949
|
-
transport: (0,
|
|
6872
|
+
transport: (0, import_viem11.http)()
|
|
6950
6873
|
});
|
|
6951
6874
|
const res = await publicClient.getCode({ address });
|
|
6952
6875
|
return res !== null && res !== void 0;
|
|
@@ -6970,13 +6893,13 @@ function ImportToken({ close }) {
|
|
|
6970
6893
|
const calls = [
|
|
6971
6894
|
{
|
|
6972
6895
|
address,
|
|
6973
|
-
abi:
|
|
6896
|
+
abi: import_viem12.erc20Abi,
|
|
6974
6897
|
functionName: "symbol",
|
|
6975
6898
|
args: []
|
|
6976
6899
|
},
|
|
6977
6900
|
{
|
|
6978
6901
|
address,
|
|
6979
|
-
abi:
|
|
6902
|
+
abi: import_viem12.erc20Abi,
|
|
6980
6903
|
functionName: "decimals",
|
|
6981
6904
|
args: []
|
|
6982
6905
|
}
|
|
@@ -7062,7 +6985,7 @@ function ImportToken({ close }) {
|
|
|
7062
6985
|
}, [error, address, symbol, decimals]);
|
|
7063
6986
|
const isContractQuery = useIsContract({
|
|
7064
6987
|
//@ts-ignore
|
|
7065
|
-
chain: (0,
|
|
6988
|
+
chain: (0, import_viem12.defineChain)(chain),
|
|
7066
6989
|
address,
|
|
7067
6990
|
enabled: canImport
|
|
7068
6991
|
});
|
|
@@ -7266,13 +7189,13 @@ function useMatchWalletRecords() {
|
|
|
7266
7189
|
for (const contract of contractUnique) {
|
|
7267
7190
|
calls.push({
|
|
7268
7191
|
address: contract,
|
|
7269
|
-
abi:
|
|
7192
|
+
abi: import_viem13.erc20Abi,
|
|
7270
7193
|
functionName: "symbol",
|
|
7271
7194
|
args: []
|
|
7272
7195
|
});
|
|
7273
7196
|
calls.push({
|
|
7274
7197
|
address: contract,
|
|
7275
|
-
abi:
|
|
7198
|
+
abi: import_viem13.erc20Abi,
|
|
7276
7199
|
functionName: "decimals",
|
|
7277
7200
|
args: []
|
|
7278
7201
|
});
|
|
@@ -7434,7 +7357,7 @@ function useMatchWalletAssetList({
|
|
|
7434
7357
|
if (!erc20Tokens.length || !publicClient) return [];
|
|
7435
7358
|
const calls = erc20Tokens.map((token) => ({
|
|
7436
7359
|
address: token.address,
|
|
7437
|
-
abi:
|
|
7360
|
+
abi: import_viem13.erc20Abi,
|
|
7438
7361
|
functionName: "balanceOf",
|
|
7439
7362
|
args: [address]
|
|
7440
7363
|
}));
|
|
@@ -7465,11 +7388,11 @@ function useMatchWalletAssetList({
|
|
|
7465
7388
|
const assetAddress = asset.address.toLowerCase();
|
|
7466
7389
|
if (assetAddress === NATIVE_TOKEN_ADDRESS) {
|
|
7467
7390
|
balanceValue = nativeBalanceQuery.data?.toString() || "0";
|
|
7468
|
-
balance = nativeBalanceQuery.data ? Number((0,
|
|
7391
|
+
balance = nativeBalanceQuery.data ? Number((0, import_viem13.formatUnits)(nativeBalanceQuery.data, decimals)) : 0;
|
|
7469
7392
|
} else {
|
|
7470
7393
|
const index = erc20Tokens.findIndex((t) => t.address.toLowerCase() === assetAddress);
|
|
7471
7394
|
if (index !== -1 && erc20Balances[index] && erc20Balances[index].status === "success") {
|
|
7472
|
-
balance = Number((0,
|
|
7395
|
+
balance = Number((0, import_viem13.formatUnits)(erc20Balances[index].result, decimals));
|
|
7473
7396
|
balanceValue = erc20Balances[index].result?.toString() || "0";
|
|
7474
7397
|
}
|
|
7475
7398
|
}
|
|
@@ -7504,7 +7427,7 @@ function useMatchWalletAssetList({
|
|
|
7504
7427
|
// src/hooks/useReceipt.tsx
|
|
7505
7428
|
var import_react38 = require("react");
|
|
7506
7429
|
var import_react_query10 = require("@tanstack/react-query");
|
|
7507
|
-
var
|
|
7430
|
+
var import_viem14 = require("viem");
|
|
7508
7431
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
7509
7432
|
var MAX_CACHE_SIZE = 500;
|
|
7510
7433
|
var STORAGE_KEY = "match_receipt_logs";
|
|
@@ -7621,9 +7544,9 @@ function useReceipt2({
|
|
|
7621
7544
|
return cache.get(cacheKey);
|
|
7622
7545
|
}
|
|
7623
7546
|
try {
|
|
7624
|
-
const publicClient = (0,
|
|
7625
|
-
chain: (0,
|
|
7626
|
-
transport: (0,
|
|
7547
|
+
const publicClient = (0, import_viem14.createPublicClient)({
|
|
7548
|
+
chain: (0, import_viem14.defineChain)(chain),
|
|
7549
|
+
transport: (0, import_viem14.http)()
|
|
7627
7550
|
});
|
|
7628
7551
|
const receipt = await publicClient.getTransactionReceipt({ hash });
|
|
7629
7552
|
if (!receipt) {
|
|
@@ -7648,7 +7571,7 @@ function useReceipt2({
|
|
|
7648
7571
|
// src/hooks/useTransaction.tsx
|
|
7649
7572
|
var import_react39 = require("react");
|
|
7650
7573
|
var import_react_query11 = require("@tanstack/react-query");
|
|
7651
|
-
var
|
|
7574
|
+
var import_viem15 = require("viem");
|
|
7652
7575
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
7653
7576
|
var MAX_CACHE_SIZE2 = 500;
|
|
7654
7577
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
@@ -7765,9 +7688,9 @@ function useTransaction({
|
|
|
7765
7688
|
return cache.get(cacheKey);
|
|
7766
7689
|
}
|
|
7767
7690
|
try {
|
|
7768
|
-
const publicClient = (0,
|
|
7769
|
-
chain: (0,
|
|
7770
|
-
transport: (0,
|
|
7691
|
+
const publicClient = (0, import_viem15.createPublicClient)({
|
|
7692
|
+
chain: (0, import_viem15.defineChain)(chain),
|
|
7693
|
+
transport: (0, import_viem15.http)()
|
|
7771
7694
|
});
|
|
7772
7695
|
const transaction = await publicClient.getTransaction({ hash });
|
|
7773
7696
|
if (!transaction) {
|
|
@@ -9199,8 +9122,93 @@ var messages = {
|
|
|
9199
9122
|
};
|
|
9200
9123
|
|
|
9201
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");
|
|
9202
9193
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
9203
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
|
+
});
|
|
9204
9212
|
var MatchContext = (0, import_react43.createContext)(void 0);
|
|
9205
9213
|
var MatchProvider = ({
|
|
9206
9214
|
children,
|
|
@@ -9221,7 +9229,7 @@ var MatchProvider = ({
|
|
|
9221
9229
|
useWalletInit({
|
|
9222
9230
|
config: wallet
|
|
9223
9231
|
});
|
|
9224
|
-
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)(
|
|
9225
9233
|
MatchContext.Provider,
|
|
9226
9234
|
{
|
|
9227
9235
|
value: {
|
|
@@ -9234,7 +9242,7 @@ var MatchProvider = ({
|
|
|
9234
9242
|
},
|
|
9235
9243
|
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(context_default, { children })
|
|
9236
9244
|
}
|
|
9237
|
-
) }) });
|
|
9245
|
+
) }) }) }) });
|
|
9238
9246
|
};
|
|
9239
9247
|
var useMatch = () => {
|
|
9240
9248
|
const context = (0, import_react43.useContext)(MatchContext);
|