@use-glyph/sdk-react 2.2.8 → 2.2.9

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.
@@ -1,10 +1,11 @@
1
- import { Component, ComponentType, LazyExoticComponent } from 'react';
1
+ import { Component, ComponentType, LazyExoticComponent, ReactNode } from 'react';
2
2
  type Loader<P extends object> = () => Promise<{
3
3
  default: ComponentType<P>;
4
4
  }>;
5
5
  type Props<P extends object> = {
6
6
  loader: Loader<P>;
7
7
  componentProps: P;
8
+ fallback?: ReactNode;
8
9
  };
9
10
  type State<P extends object> = {
10
11
  failed: boolean;
@@ -0,0 +1,8 @@
1
+ type WidgetDataErrorProps = {
2
+ message: string;
3
+ onRetry: () => void | Promise<unknown>;
4
+ compact?: boolean;
5
+ };
6
+ export declare function WidgetLoadingShell(): import("react/jsx-runtime").JSX.Element;
7
+ export declare function WidgetDataError({ message, onRetry, compact }: WidgetDataErrorProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { INTERNAL_GRADIENT_TYPE } from '../../lib/constants';
2
+ export declare function preloadWallet(): void;
2
3
  export declare const Wallet: import('react').MemoExoticComponent<({ setGradientType }: {
3
4
  setGradientType: React.Dispatch<React.SetStateAction<INTERNAL_GRADIENT_TYPE | undefined>>;
4
5
  }) => import("react/jsx-runtime").JSX.Element>;
@@ -1,10 +1,13 @@
1
1
  import { GlyphWidgetBalances, GlyphWidgetUser } from '../types';
2
2
  interface GlyphUserDataContextType {
3
3
  user: GlyphWidgetUser | null;
4
+ isUserLoading: boolean;
5
+ isUserError: boolean;
4
6
  refreshUser: (force?: boolean) => Promise<void>;
5
7
  balances: GlyphWidgetBalances | null;
6
8
  hasBalances: boolean;
7
9
  isBalancesLoading: boolean;
10
+ isBalancesError: boolean;
8
11
  refreshBalances: (force?: boolean, cbs?: Record<string, (diffAmount: number) => void>) => Promise<void>;
9
12
  setFetchForAllNetworks: (value: boolean) => void;
10
13
  fetchForAllNetworks: boolean;
@@ -45,4 +45,5 @@ export declare function useActivity(pageSize?: number, filter?: {
45
45
  reset: () => Promise<void>;
46
46
  hasMore: boolean;
47
47
  isLoading: boolean;
48
+ isError: boolean;
48
49
  };
@@ -5,4 +5,5 @@ export declare function useBalances(): {
5
5
  fetchForAllNetworks: boolean;
6
6
  setFetchForAllNetworks: (value: boolean) => void;
7
7
  isBalancesLoading: boolean;
8
+ isBalancesError: boolean;
8
9
  };
@@ -42,6 +42,8 @@ export interface GlyphHook extends GlyphInterface {
42
42
  * The user object, or null if the user is not authenticated.
43
43
  */
44
44
  user: GlyphWidgetUser | null;
45
+ isUserLoading: boolean;
46
+ isUserError: boolean;
45
47
  refreshUser: (force?: boolean) => Promise<void>;
46
48
  /**
47
49
  * The symbol of the native token, or "APE" if not found.
@@ -56,6 +58,7 @@ export interface GlyphHook extends GlyphInterface {
56
58
  */
57
59
  hasBalances: boolean;
58
60
  isBalancesLoading: boolean;
61
+ isBalancesError: boolean;
59
62
  refreshBalances: (force?: boolean, cbs?: Record<string, (diffAmount: number) => void>) => Promise<void>;
60
63
  setFetchForAllNetworks: (value: boolean) => void;
61
64
  fetchForAllNetworks: boolean;
@@ -23,5 +23,5 @@ interface GlyphPrivyProviderProps extends Omit<PrivyProviderProps, "children" |
23
23
  useStagingTenant?: boolean;
24
24
  ssr?: boolean;
25
25
  }
26
- export declare const GlyphPrivyProvider: ({ queryClient, glyphUrl, useStagingTenant, ssr, onLogin, onLogout, rpcUrls, ...props }: GlyphPrivyProviderProps) => import("react/jsx-runtime").JSX.Element | null;
26
+ export declare const GlyphPrivyProvider: ({ queryClient, glyphUrl, useStagingTenant, ssr, onLogin, onLogout, rpcUrls, ...props }: GlyphPrivyProviderProps) => import("react/jsx-runtime.js").JSX.Element | null;
27
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-glyph/sdk-react",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "type": "module",
5
5
  "license": "GLYPH-1.0",
6
6
  "sideEffects": false,