@matchain/matchid-sdk-react 0.1.48-alpha.24 → 0.1.48-alpha.26

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.
@@ -1310,11 +1310,11 @@ var persistedState3 = persist3(
1310
1310
  (set, get) => ({
1311
1311
  contracts: {},
1312
1312
  getContract: (chainId, contractAddress) => {
1313
- const key = `${chainId}-${contractAddress}`;
1313
+ const key = `${chainId}-${contractAddress.toLowerCase()}`;
1314
1314
  return get().contracts[key];
1315
1315
  },
1316
1316
  setContractName: (chainId, contractAddress, name) => {
1317
- const key = `${chainId}-${contractAddress}`;
1317
+ const key = `${chainId}-${contractAddress.toLowerCase()}`;
1318
1318
  set((state) => {
1319
1319
  const updatedContracts = {
1320
1320
  ...state.contracts,
@@ -1324,7 +1324,7 @@ var persistedState3 = persist3(
1324
1324
  });
1325
1325
  },
1326
1326
  setContractSymbol: (chainId, contractAddress, symbol) => {
1327
- const key = `${chainId}-${contractAddress}`;
1327
+ const key = `${chainId}-${contractAddress.toLowerCase()}`;
1328
1328
  set((state) => {
1329
1329
  const updatedContracts = {
1330
1330
  ...state.contracts,
@@ -1334,7 +1334,7 @@ var persistedState3 = persist3(
1334
1334
  });
1335
1335
  },
1336
1336
  setContractDecimals: (chainId, contractAddress, decimals) => {
1337
- const key = `${chainId}-${contractAddress}`;
1337
+ const key = `${chainId}-${contractAddress.toLowerCase()}`;
1338
1338
  set((state) => {
1339
1339
  const updatedContracts = {
1340
1340
  ...state.contracts,
@@ -1347,7 +1347,7 @@ var persistedState3 = persist3(
1347
1347
  set((state) => {
1348
1348
  const newContracts = { ...state.contracts };
1349
1349
  data.forEach(({ chainId, contractAddress, info }) => {
1350
- const key = `${chainId}-${contractAddress}`;
1350
+ const key = `${chainId}-${contractAddress.toLowerCase()}`;
1351
1351
  newContracts[key] = { ...newContracts[key], ...info };
1352
1352
  });
1353
1353
  return { contracts: newContracts };
@@ -1780,7 +1780,7 @@ function useMatchWalletAssets({
1780
1780
  list.unshift({
1781
1781
  chain_id: chain?.id.toString() || "",
1782
1782
  address: NATIVE_TOKEN_ADDRESS,
1783
- decimals: 18,
1783
+ decimals: chain?.nativeCurrency.decimals || 18,
1784
1784
  symbol: chain?.nativeCurrency.symbol,
1785
1785
  name: chain?.nativeCurrency.name,
1786
1786
  balance: 0,
@@ -6192,7 +6192,7 @@ var Item = ({ data }) => {
6192
6192
  const { address } = useWallet();
6193
6193
  const isOut = data.from.toLowerCase() == address.toLowerCase();
6194
6194
  const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
6195
- const { getContract } = useContractStore_default();
6195
+ const { contracts } = useContractStore_default();
6196
6196
  const [shouldRefetch, setShouldRefetch] = useState28(true);
6197
6197
  const transferType = useMemo16(() => {
6198
6198
  const methodId = data.input.substring(2, 10);
@@ -6221,10 +6221,10 @@ var Item = ({ data }) => {
6221
6221
  data: data.input
6222
6222
  });
6223
6223
  const value = decodeData.args[1];
6224
- return formatUnits3(value, getContract(chainId || 0, data.to)?.decimals || 18);
6224
+ return formatUnits3(value, contracts[`${chainId}-${data.to}`]?.decimals || 18);
6225
6225
  }
6226
6226
  return chainFormatUnits(BigInt(data.value));
6227
- }, [data.input, transferType, data.value, getContract, chainId, data.to]);
6227
+ }, [data.input, transferType, data.value, contracts, chainId, data.to]);
6228
6228
  const hashQuery = useHash({
6229
6229
  hash: data.hash,
6230
6230
  //@ts-ignore
@@ -6266,10 +6266,11 @@ var Item = ({ data }) => {
6266
6266
  }, [status, data.hash]);
6267
6267
  const symbol = useMemo16(() => {
6268
6268
  if (transferType == "erc20_transfer") {
6269
- return getContract(chainId || 0, data.to)?.symbol || getContract(chainId || 0, data.to)?.name || "unknown";
6269
+ const contract = contracts[`${chainId}-${data.to}`];
6270
+ return contracts?.symbol || contracts?.name || "unknown";
6270
6271
  }
6271
6272
  return chain?.nativeCurrency.symbol || chain?.nativeCurrency.name;
6272
- }, [transferType, chain, getContract, chainId, data.to]);
6273
+ }, [transferType, chain, contracts, chainId, data.to]);
6273
6274
  return /* @__PURE__ */ jsxs23(
6274
6275
  "a",
6275
6276
  {
@@ -6367,4 +6368,4 @@ export {
6367
6368
  MatchProvider,
6368
6369
  useMatch
6369
6370
  };
6370
- //# sourceMappingURL=chunk-TSPOB4DT.mjs.map
6371
+ //# sourceMappingURL=chunk-2MJFQXBZ.mjs.map