@matchain/matchid-sdk-react 0.1.48-alpha.23 → 0.1.48-alpha.25

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.
Files changed (47) hide show
  1. package/dist/assets/icon/index.d.mts +1 -1
  2. package/dist/assets/icon/index.d.ts +1 -1
  3. package/dist/{chunk-SB54XHCJ.mjs → chunk-MD3AVLZD.mjs} +2 -2
  4. package/dist/{chunk-FYW4P7HS.mjs → chunk-UR57LTMH.mjs} +26 -27
  5. package/dist/chunk-UR57LTMH.mjs.map +1 -0
  6. package/dist/components/index.d.mts +3 -3
  7. package/dist/components/index.d.ts +3 -3
  8. package/dist/components/index.js +14 -15
  9. package/dist/components/index.js.map +1 -1
  10. package/dist/components/index.mjs +2 -2
  11. package/dist/hooks/api/index.d.mts +2 -2
  12. package/dist/hooks/api/index.d.ts +2 -2
  13. package/dist/hooks/api/index.js +5 -5
  14. package/dist/hooks/api/index.js.map +1 -1
  15. package/dist/hooks/api/index.mjs +3 -3
  16. package/dist/hooks/index.d.mts +2 -2
  17. package/dist/hooks/index.d.ts +2 -2
  18. package/dist/hooks/index.js +9 -7
  19. package/dist/hooks/index.js.map +1 -1
  20. package/dist/hooks/index.mjs +2 -2
  21. package/dist/{index-Ca30Hgn7.d.mts → index-BMfaixEx.d.mts} +1 -1
  22. package/dist/{index-CN2jy6bb.d.ts → index-BMsj8hJv.d.ts} +2 -2
  23. package/dist/{index-BOsoQSmx.d.ts → index-BcEreCxd.d.ts} +1 -1
  24. package/dist/{index-BFSCCmlU.d.ts → index-Bpmrd7mh.d.ts} +1 -1
  25. package/dist/{index-DTYp8DRd.d.ts → index-Bvc8cjpN.d.ts} +2 -2
  26. package/dist/{index-Bk_dqXKp.d.mts → index-C9F6f2iz.d.mts} +2 -2
  27. package/dist/{index-B4gKj0ro.d.mts → index-C9qYyRgt.d.mts} +2 -2
  28. package/dist/{index-CdM22eod.d.mts → index-Cou96DpL.d.mts} +1 -1
  29. package/dist/{index-BHXlpUg5.d.ts → index-Cy3K-Yao.d.ts} +1 -1
  30. package/dist/{index-D3GBq1P1.d.mts → index-D4ju2J_e.d.mts} +1 -1
  31. package/dist/{index-BObJQar4.d.mts → index-DUHkH5t-.d.mts} +11 -1
  32. package/dist/{index-CSTyna62.d.ts → index-DcQm2dkr.d.ts} +11 -1
  33. package/dist/index.d.mts +7 -7
  34. package/dist/index.d.ts +7 -7
  35. package/dist/index.js +14 -15
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +9 -9
  38. package/dist/types/index.d.mts +1 -1
  39. package/dist/types/index.d.ts +1 -1
  40. package/dist/{types-Dc15ure7.d.mts → types-DzVVzMYU.d.mts} +1 -1
  41. package/dist/{types-Dc15ure7.d.ts → types-DzVVzMYU.d.ts} +1 -1
  42. package/dist/ui/index.d.mts +3 -3
  43. package/dist/ui/index.d.ts +3 -3
  44. package/example/src/pages/Wallet/components/MatchWallet.tsx +24 -2
  45. package/package.json +1 -1
  46. package/dist/chunk-FYW4P7HS.mjs.map +0 -1
  47. /package/dist/{chunk-SB54XHCJ.mjs.map → chunk-MD3AVLZD.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { w as IconProps$1 } from '../../types-Dc15ure7.mjs';
3
+ import { w as IconProps$1 } from '../../types-DzVVzMYU.mjs';
4
4
  import '@tanstack/react-query/src/types';
5
5
 
6
6
  declare function BackIcon({ color, size, className, style }: {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { w as IconProps$1 } from '../../types-Dc15ure7.js';
3
+ import { w as IconProps$1 } from '../../types-DzVVzMYU.js';
4
4
  import '@tanstack/react-query/src/types';
5
5
 
6
6
  declare function BackIcon({ color, size, className, style }: {
@@ -11,7 +11,7 @@ import {
11
11
  useUserInfo,
12
12
  verifyPohApi,
13
13
  wallet_exports
14
- } from "./chunk-FYW4P7HS.mjs";
14
+ } from "./chunk-UR57LTMH.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-SB54XHCJ.mjs.map
97
+ //# sourceMappingURL=chunk-MD3AVLZD.mjs.map
@@ -1,14 +1,3 @@
1
- import {
2
- NumberFormatter,
3
- encodeBase64,
4
- formatAddress,
5
- formatDate,
6
- getAppClientId,
7
- getVersion,
8
- isValidEmail,
9
- isValidUsername,
10
- truncateAddress
11
- } from "./chunk-5JHHHLG4.mjs";
12
1
  import {
13
2
  AlphaAvatar,
14
3
  Button,
@@ -28,6 +17,17 @@ import {
28
17
  useHash,
29
18
  useLayout_exports
30
19
  } from "./chunk-FB5MHLWX.mjs";
20
+ import {
21
+ NumberFormatter,
22
+ encodeBase64,
23
+ formatAddress,
24
+ formatDate,
25
+ getAppClientId,
26
+ getVersion,
27
+ isValidEmail,
28
+ isValidUsername,
29
+ truncateAddress
30
+ } from "./chunk-5JHHHLG4.mjs";
31
31
  import {
32
32
  ArrowDownIcon,
33
33
  ArrowRightIcon,
@@ -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,
@@ -1852,7 +1852,7 @@ function useMatchWalletAssetList({
1852
1852
  }
1853
1853
  return balances;
1854
1854
  },
1855
- enabled: erc20Tokens.length > 0 && !!publicClient,
1855
+ enabled: !!publicClient,
1856
1856
  refetchInterval: 15e3,
1857
1857
  // Refresh every 15 seconds
1858
1858
  retry: 3
@@ -1895,6 +1895,8 @@ function useMatchWalletAssetList({
1895
1895
  list: assets,
1896
1896
  isLoading: nativeBalanceQuery.isLoading || erc20BalanceQuery.isLoading,
1897
1897
  isFetched: nativeBalanceQuery.isFetched && erc20BalanceQuery.isFetched,
1898
+ nativeBalanceQuery,
1899
+ erc20BalanceQuery,
1898
1900
  nativeBalance: nativeBalanceQuery.data,
1899
1901
  erc20Balances: erc20BalanceQuery.data
1900
1902
  };
@@ -6188,7 +6190,7 @@ import { FormattedMessage as FormattedMessage14 } from "react-intl";
6188
6190
  import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
6189
6191
  var Item = ({ data }) => {
6190
6192
  const { address } = useWallet();
6191
- const isOut = data.from == address;
6193
+ const isOut = data.from.toLowerCase() == address.toLowerCase();
6192
6194
  const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
6193
6195
  const { getContract } = useContractStore_default();
6194
6196
  const [shouldRefetch, setShouldRefetch] = useState28(true);
@@ -6223,11 +6225,6 @@ var Item = ({ data }) => {
6223
6225
  }
6224
6226
  return chainFormatUnits(BigInt(data.value));
6225
6227
  }, [data.input, transferType, data.value, getContract, chainId, data.to]);
6226
- useEffect25(() => {
6227
- if (data.hash) {
6228
- setShouldRefetch(true);
6229
- }
6230
- }, [data.hash]);
6231
6228
  const hashQuery = useHash({
6232
6229
  hash: data.hash,
6233
6230
  //@ts-ignore
@@ -6263,8 +6260,10 @@ var Item = ({ data }) => {
6263
6260
  return "loading";
6264
6261
  }, [data.extra?.status, data.source, hashQuery.data]);
6265
6262
  useEffect25(() => {
6266
- setShouldRefetch(status == "loading");
6267
- }, [status]);
6263
+ if (data.hash) {
6264
+ setShouldRefetch(status == "loading");
6265
+ }
6266
+ }, [status, data.hash]);
6268
6267
  const symbol = useMemo16(() => {
6269
6268
  if (transferType == "erc20_transfer") {
6270
6269
  return getContract(chainId || 0, data.to)?.symbol || getContract(chainId || 0, data.to)?.name || "unknown";
@@ -6368,4 +6367,4 @@ export {
6368
6367
  MatchProvider,
6369
6368
  useMatch
6370
6369
  };
6371
- //# sourceMappingURL=chunk-FYW4P7HS.mjs.map
6370
+ //# sourceMappingURL=chunk-UR57LTMH.mjs.map