@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.
- package/dist/{chunk-TSPOB4DT.mjs → chunk-2MJFQXBZ.mjs} +13 -12
- package/dist/chunk-2MJFQXBZ.mjs.map +1 -0
- package/dist/{chunk-EOT6XIVG.mjs → chunk-PWUDQPH3.mjs} +2 -2
- package/dist/components/index.js +12 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.js +5 -5
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +2 -2
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-TSPOB4DT.mjs.map +0 -1
- /package/dist/{chunk-EOT6XIVG.mjs.map → chunk-PWUDQPH3.mjs.map} +0 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useUserInfo,
|
|
12
12
|
verifyPohApi,
|
|
13
13
|
wallet_exports
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2MJFQXBZ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
__export
|
|
17
17
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -94,4 +94,4 @@ export {
|
|
|
94
94
|
user_exports,
|
|
95
95
|
api_exports
|
|
96
96
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-PWUDQPH3.mjs.map
|
package/dist/components/index.js
CHANGED
|
@@ -2639,11 +2639,11 @@ var persistedState3 = (0, import_middleware3.persist)(
|
|
|
2639
2639
|
(set, get) => ({
|
|
2640
2640
|
contracts: {},
|
|
2641
2641
|
getContract: (chainId, contractAddress) => {
|
|
2642
|
-
const key = `${chainId}-${contractAddress}`;
|
|
2642
|
+
const key = `${chainId}-${contractAddress.toLowerCase()}`;
|
|
2643
2643
|
return get().contracts[key];
|
|
2644
2644
|
},
|
|
2645
2645
|
setContractName: (chainId, contractAddress, name) => {
|
|
2646
|
-
const key = `${chainId}-${contractAddress}`;
|
|
2646
|
+
const key = `${chainId}-${contractAddress.toLowerCase()}`;
|
|
2647
2647
|
set((state) => {
|
|
2648
2648
|
const updatedContracts = {
|
|
2649
2649
|
...state.contracts,
|
|
@@ -2653,7 +2653,7 @@ var persistedState3 = (0, import_middleware3.persist)(
|
|
|
2653
2653
|
});
|
|
2654
2654
|
},
|
|
2655
2655
|
setContractSymbol: (chainId, contractAddress, symbol) => {
|
|
2656
|
-
const key = `${chainId}-${contractAddress}`;
|
|
2656
|
+
const key = `${chainId}-${contractAddress.toLowerCase()}`;
|
|
2657
2657
|
set((state) => {
|
|
2658
2658
|
const updatedContracts = {
|
|
2659
2659
|
...state.contracts,
|
|
@@ -2663,7 +2663,7 @@ var persistedState3 = (0, import_middleware3.persist)(
|
|
|
2663
2663
|
});
|
|
2664
2664
|
},
|
|
2665
2665
|
setContractDecimals: (chainId, contractAddress, decimals) => {
|
|
2666
|
-
const key = `${chainId}-${contractAddress}`;
|
|
2666
|
+
const key = `${chainId}-${contractAddress.toLowerCase()}`;
|
|
2667
2667
|
set((state) => {
|
|
2668
2668
|
const updatedContracts = {
|
|
2669
2669
|
...state.contracts,
|
|
@@ -2676,7 +2676,7 @@ var persistedState3 = (0, import_middleware3.persist)(
|
|
|
2676
2676
|
set((state) => {
|
|
2677
2677
|
const newContracts = { ...state.contracts };
|
|
2678
2678
|
data.forEach(({ chainId, contractAddress, info }) => {
|
|
2679
|
-
const key = `${chainId}-${contractAddress}`;
|
|
2679
|
+
const key = `${chainId}-${contractAddress.toLowerCase()}`;
|
|
2680
2680
|
newContracts[key] = { ...newContracts[key], ...info };
|
|
2681
2681
|
});
|
|
2682
2682
|
return { contracts: newContracts };
|
|
@@ -2865,7 +2865,7 @@ function useMatchWalletAssets({
|
|
|
2865
2865
|
list.unshift({
|
|
2866
2866
|
chain_id: chain?.id.toString() || "",
|
|
2867
2867
|
address: NATIVE_TOKEN_ADDRESS,
|
|
2868
|
-
decimals: 18,
|
|
2868
|
+
decimals: chain?.nativeCurrency.decimals || 18,
|
|
2869
2869
|
symbol: chain?.nativeCurrency.symbol,
|
|
2870
2870
|
name: chain?.nativeCurrency.name,
|
|
2871
2871
|
balance: 0,
|
|
@@ -5655,7 +5655,7 @@ var Item = ({ data }) => {
|
|
|
5655
5655
|
const { address } = useWallet();
|
|
5656
5656
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
5657
5657
|
const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
|
|
5658
|
-
const {
|
|
5658
|
+
const { contracts } = useContractStore_default();
|
|
5659
5659
|
const [shouldRefetch, setShouldRefetch] = (0, import_react40.useState)(true);
|
|
5660
5660
|
const transferType = (0, import_react40.useMemo)(() => {
|
|
5661
5661
|
const methodId = data.input.substring(2, 10);
|
|
@@ -5684,10 +5684,10 @@ var Item = ({ data }) => {
|
|
|
5684
5684
|
data: data.input
|
|
5685
5685
|
});
|
|
5686
5686
|
const value = decodeData.args[1];
|
|
5687
|
-
return (0, import_viem11.formatUnits)(value,
|
|
5687
|
+
return (0, import_viem11.formatUnits)(value, contracts[`${chainId}-${data.to}`]?.decimals || 18);
|
|
5688
5688
|
}
|
|
5689
5689
|
return chainFormatUnits(BigInt(data.value));
|
|
5690
|
-
}, [data.input, transferType, data.value,
|
|
5690
|
+
}, [data.input, transferType, data.value, contracts, chainId, data.to]);
|
|
5691
5691
|
const hashQuery = useHash({
|
|
5692
5692
|
hash: data.hash,
|
|
5693
5693
|
//@ts-ignore
|
|
@@ -5729,10 +5729,11 @@ var Item = ({ data }) => {
|
|
|
5729
5729
|
}, [status, data.hash]);
|
|
5730
5730
|
const symbol = (0, import_react40.useMemo)(() => {
|
|
5731
5731
|
if (transferType == "erc20_transfer") {
|
|
5732
|
-
|
|
5732
|
+
const contract = contracts[`${chainId}-${data.to}`];
|
|
5733
|
+
return contracts?.symbol || contracts?.name || "unknown";
|
|
5733
5734
|
}
|
|
5734
5735
|
return chain?.nativeCurrency.symbol || chain?.nativeCurrency.name;
|
|
5735
|
-
}, [transferType, chain,
|
|
5736
|
+
}, [transferType, chain, contracts, chainId, data.to]);
|
|
5736
5737
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
5737
5738
|
"a",
|
|
5738
5739
|
{
|