@mysten/dapp-kit 1.0.1 → 1.0.3

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/index.mjs CHANGED
@@ -922,7 +922,7 @@ import { useRef } from "react";
922
922
 
923
923
  // src/hooks/wallet/useAutoConnectWallet.ts
924
924
  import { useQuery as useQuery2 } from "@tanstack/react-query";
925
- import { useLayoutEffect, useState as useState3 } from "react";
925
+ import { useEffect, useLayoutEffect, useState as useState3 } from "react";
926
926
  function useAutoConnectWallet() {
927
927
  const { mutateAsync: connectWallet } = useConnectWallet();
928
928
  const autoConnectEnabled = useWalletStore((state) => state.autoConnectEnabled);
@@ -931,7 +931,8 @@ function useAutoConnectWallet() {
931
931
  const wallets = useWallets();
932
932
  const { isConnected } = useCurrentWallet();
933
933
  const [clientOnly, setClientOnly] = useState3(false);
934
- useLayoutEffect(() => {
934
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
935
+ useIsomorphicLayoutEffect(() => {
935
936
  setClientOnly(true);
936
937
  }, []);
937
938
  const { data, isError } = useQuery2({
@@ -995,9 +996,10 @@ function useAutoConnectWallet() {
995
996
 
996
997
  // src/hooks/wallet/useSlushWallet.ts
997
998
  import { registerSlushWallet } from "@mysten/slush-wallet";
998
- import { useLayoutEffect as useLayoutEffect2 } from "react";
999
+ import { useEffect as useEffect2, useLayoutEffect as useLayoutEffect2 } from "react";
999
1000
  function useSlushWallet(config) {
1000
- useLayoutEffect2(() => {
1001
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect2 : useEffect2;
1002
+ useIsomorphicLayoutEffect(() => {
1001
1003
  if (!config?.name) {
1002
1004
  return;
1003
1005
  }
@@ -1027,11 +1029,11 @@ import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
1027
1029
  import { Transaction } from "@mysten/sui/transactions";
1028
1030
  import { toBase64 } from "@mysten/sui/utils";
1029
1031
  import { getWallets as getWallets2, ReadonlyWalletAccount, SUI_CHAINS } from "@mysten/wallet-standard";
1030
- import { useEffect } from "react";
1032
+ import { useEffect as useEffect3 } from "react";
1031
1033
  var WALLET_NAME = "Unsafe Burner Wallet";
1032
1034
  function useUnsafeBurnerWallet(enabled) {
1033
1035
  const suiClient = useSuiClient();
1034
- useEffect(() => {
1036
+ useEffect3(() => {
1035
1037
  if (!enabled) {
1036
1038
  return;
1037
1039
  }
@@ -1194,11 +1196,11 @@ function registerUnsafeBurnerWallet(suiClient) {
1194
1196
  }
1195
1197
 
1196
1198
  // src/hooks/wallet/useWalletPropertiesChanged.ts
1197
- import { useEffect as useEffect2 } from "react";
1199
+ import { useEffect as useEffect4 } from "react";
1198
1200
  function useWalletPropertiesChanged() {
1199
1201
  const { currentWallet } = useCurrentWallet();
1200
1202
  const updateWalletAccounts = useWalletStore((state) => state.updateWalletAccounts);
1201
- useEffect2(() => {
1203
+ useEffect4(() => {
1202
1204
  const unsubscribeFromEvents = currentWallet?.features["standard:events"].on(
1203
1205
  "change",
1204
1206
  ({ accounts }) => {
@@ -1213,11 +1215,11 @@ function useWalletPropertiesChanged() {
1213
1215
 
1214
1216
  // src/hooks/wallet/useWalletsChanged.ts
1215
1217
  import { getWallets as getWallets3 } from "@mysten/wallet-standard";
1216
- import { useEffect as useEffect3 } from "react";
1218
+ import { useEffect as useEffect5 } from "react";
1217
1219
  function useWalletsChanged(preferredWallets, walletFilter) {
1218
1220
  const setWalletRegistered = useWalletStore((state) => state.setWalletRegistered);
1219
1221
  const setWalletUnregistered = useWalletStore((state) => state.setWalletUnregistered);
1220
- useEffect3(() => {
1222
+ useEffect5(() => {
1221
1223
  const walletsApi = getWallets3();
1222
1224
  setWalletRegistered(getRegisteredWallets(preferredWallets, walletFilter));
1223
1225
  const unsubscribeFromRegister = walletsApi.on("register", () => {