@pear-protocol/symmio-client 0.2.35 → 0.2.37

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.
@@ -728,7 +728,7 @@ function logSymmAuth(event, details) {
728
728
  if (typeof window === "undefined") {
729
729
  return;
730
730
  }
731
- console.debug("[symm-auth]", event, details ?? {});
731
+ console.log("[symm-auth]", event, details ?? {});
732
732
  }
733
733
  function extractSubaccountAddresses(summary) {
734
734
  const accounts = summary?.data?.accounts;
@@ -832,7 +832,23 @@ function useSymmAuth(params) {
832
832
  let cancelled = false;
833
833
  previousAddressRef.current = address;
834
834
  previousChainIdRef.current = chainId;
835
+ logSymmAuth("bootstrap:dependencies", {
836
+ address,
837
+ chainId,
838
+ hasWalletClient: !!walletClient,
839
+ hasSymmCoreClient: !!symmCoreClient,
840
+ hasRefreshAuth: !!refreshAuthRef.current,
841
+ addressChanged,
842
+ chainChanged,
843
+ previousAddress,
844
+ previousChainId
845
+ });
835
846
  if (!address) {
847
+ logSymmAuth("bootstrap:skip-no-address", {
848
+ chainId,
849
+ hasWalletClient: !!walletClient,
850
+ hasSymmCoreClient: !!symmCoreClient
851
+ });
836
852
  return;
837
853
  }
838
854
  const userAddress = address;
@@ -841,6 +857,13 @@ function useSymmAuth(params) {
841
857
  clearToken(previousAddress, previousChainId);
842
858
  }
843
859
  async function bootstrapAuth() {
860
+ logSymmAuth("bootstrap:run", {
861
+ userAddress,
862
+ chainId,
863
+ hasWalletClient: !!walletClient,
864
+ hasSymmCoreClient: !!symmCoreClient,
865
+ hasRefreshAuth: !!refreshAuthRef.current
866
+ });
844
867
  let targets = [userAddress];
845
868
  if (symmCoreClient) {
846
869
  try {
@@ -885,7 +908,7 @@ function useSymmAuth(params) {
885
908
  return () => {
886
909
  cancelled = true;
887
910
  };
888
- }, [address, walletClient, chainId]);
911
+ }, [address, walletClient, chainId, symmCoreClient]);
889
912
  return {
890
913
  accessToken: token,
891
914
  authToken: token,