@use-glyph/sdk-react 0.4.1 → 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const NativeGlyphConnectButton: FC;
@@ -1,3 +1,8 @@
1
+ import { FC } from 'react';
1
2
  import { GlyphProviderOptions } from '../types';
2
- declare const _default: import('react').NamedExoticComponent<GlyphProviderOptions>;
3
- export default _default;
3
+ /**
4
+ * A react provider that provides the GlyphContext to its children.
5
+ *
6
+ * See more at: {@link https://docs.useglyph.io/reference/components/GlyphProvider/}
7
+ */
8
+ export declare const GlyphProvider: FC<GlyphProviderOptions>;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { GlyphProviderOptions } from '../../types';
3
- declare const EIP1193Strategy: FC<GlyphProviderOptions>;
2
+ import { BaseGlyphProviderOptionsWithSignature } from '../../types';
3
+ declare const EIP1193Strategy: FC<BaseGlyphProviderOptionsWithSignature>;
4
4
  export default EIP1193Strategy;
@@ -1,3 +1,3 @@
1
- import { GlyphProviderOptions } from '../../types';
2
- declare const _default: import('react').NamedExoticComponent<GlyphProviderOptions>;
1
+ import { BaseGlyphProviderOptions } from '../../types';
2
+ declare const _default: import('react').NamedExoticComponent<BaseGlyphProviderOptions>;
3
3
  export default _default;
@@ -30,9 +30,9 @@ export interface GlyphInterface {
30
30
  login: () => void;
31
31
  logout: () => void;
32
32
  /**
33
- * The base URL for the Glyph Widget API (optional, uses default if not provided)
33
+ * The base URL for the Glyph Widget API (optional, uses default DASHBOARD_BASE_URL from envs if not provided)
34
34
  */
35
- glyphUrl?: string;
35
+ glyphUrl: string;
36
36
  }
37
37
  export interface GlyphHook extends GlyphInterface {
38
38
  /**
@@ -2,6 +2,11 @@ import { FUND_STATUS_API, FundQuoteDTO } from './useGlyphFundingApi';
2
2
  type INITIAL_FUND_STATUS = "STARTED";
3
3
  export type GLYPH_FUND_STATUS = INITIAL_FUND_STATUS | FUND_STATUS_API;
4
4
  export declare function useGlyphFunding(): {
5
+ userCurrency: string;
6
+ fundMinAmount: number;
7
+ fundMaxAmount: number;
8
+ fundIntermediaryToken: string | undefined;
9
+ fundIntermediaryChain: string | undefined;
5
10
  fundAmount: string;
6
11
  fundAmountError: string | null;
7
12
  fundDone: boolean;
@@ -10,6 +15,7 @@ export declare function useGlyphFunding(): {
10
15
  fundQuote: FundQuoteDTO | null;
11
16
  fundStatus: GLYPH_FUND_STATUS;
12
17
  isOnrampEnabled: boolean;
18
+ onramppDisabledError: string | null;
13
19
  quoteLoading: boolean;
14
20
  doFunding: (onSuccess: () => void, onError: (error: string) => void) => Promise<void>;
15
21
  setFundAmount: (val: React.SetStateAction<string>) => void;
@@ -1,11 +1,10 @@
1
1
  interface GlyphLogin {
2
- login: () => void;
3
- logout: () => void;
2
+ connect: () => void;
3
+ disconnect: () => void;
4
4
  }
5
5
  /**
6
6
  * Use the `useNativeGlyphConnection` hook to login with Glyph.
7
- * @param askForSignature - Whether to ask for a signature from the user. Pass true if you want to use the Glyph Widget or want the useGlyph hook to be ready for use. Defaults to true.
8
- * @returns The login and logout functions.
7
+ * @returns The connect and disconnect functions. Used to connect and disconnect from Glyph.
9
8
  */
10
- export declare const useNativeGlyphConnection: (askForSignature?: boolean) => GlyphLogin;
9
+ export declare const useNativeGlyphConnection: () => GlyphLogin;
11
10
  export {};
@@ -2,18 +2,19 @@ import { default as GlyphWidget } from './components/GlyphWidget';
2
2
  import { default as LoginButton } from './components/LoginButton';
3
3
  import { default as LogoutButton } from './components/LogoutButton';
4
4
  import { default as SignUpButton } from './components/SignUpButton';
5
- import { default as GlyphProvider } from './context/GlyphProvider';
5
+ import { GlyphProvider } from './context/GlyphProvider';
6
6
  export { useBalances } from './hooks/useBalances';
7
7
  export { useGlyph } from './hooks/useGlyph';
8
8
  export { useGlyphFunding, type GLYPH_FUND_STATUS } from './hooks/useGlyphFunding';
9
9
  export { useGlyphView } from './hooks/useGlyphView';
10
10
  export { glyphConnectorDetails } from './lib/constants';
11
- export { GlyphViewType as GlyphView, StrategyType } from './types';
11
+ export { GlyphViewType as GlyphView, StrategyType, WalletClientType } from './types';
12
12
  export { GlyphProvider, GlyphWidget, LoginButton, LogoutButton, SignUpButton };
13
- export { GlyphWalletProvider } from './lib/eip1193/GlyphWalletProvider';
13
+ export { NativeGlyphConnectButton } from './components/NativeGlyphConnectButton';
14
+ export { useNativeGlyphConnection } from './hooks/useNativeGlyphConnection';
14
15
  export { glyphWalletConnector } from './lib/eip1193/glyphWalletConnector';
16
+ export { GlyphWalletProvider } from './lib/eip1193/GlyphWalletProvider';
15
17
  export { glyphWalletRK, glyphWalletRKStaging } from './lib/eip1193/glyphWalletRK';
16
- export { useNativeGlyphConnection } from './hooks/useNativeGlyphConnection';
17
18
  export { GLYPH_ICON_URL, GLYPH_PRIVY_APP_ID, STAGING_GLYPH_PRIVY_APP_ID } from './lib/constants';
18
19
  export { GLYPH_APP_LOGIN_METHOD, GlyphPrivyProvider, STAGING_GLYPH_APP_LOGIN_METHOD } from './lib/privy/GlyphPrivyProvider';
19
20
  export { InjectWagmiConnector } from './lib/privy/InjectWagmiConnector';
@@ -35,6 +35,8 @@ export declare enum SendView {
35
35
  END = "send-end"
36
36
  }
37
37
  export declare const TOKEN_LOGOS: Record<string, React.FC<React.SVGProps<SVGSVGElement>>>;
38
+ export declare const TESTNET_CLASS = "gw-grayscale";
39
+ export declare const IS_TESTNET_CHAIN: Map<number, boolean>;
38
40
  export declare const glyphConnectorDetails: {
39
41
  readonly id: "io.useglyph.privy";
40
42
  readonly name: "Glyph";
@@ -1,6 +1,7 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
2
  import { default as React } from 'react';
3
3
  import { Chain, Transport } from 'viem';
4
+ import { BaseGlyphProviderOptionsWithSignature } from '../../types';
4
5
  /**
5
6
  * Configuration options for the GlyphWalletProvider.
6
7
  * @interface GlyphWalletProviderProps
@@ -9,19 +10,17 @@ import { Chain, Transport } from 'viem';
9
10
  * @property {QueryClient} queryClient - Optional query client to use, defaults to a standard query client.
10
11
  * @property {React.ReactNode} children - The children to render.
11
12
  */
12
- interface GlyphWalletProviderProps {
13
+ interface GlyphWalletProviderProps extends BaseGlyphProviderOptionsWithSignature {
13
14
  chains: [Chain, ...Chain[]];
14
15
  transports?: Record<number, Transport>;
15
16
  queryClient?: QueryClient;
16
17
  children: React.ReactNode;
17
- glyphUrl?: string;
18
- useStagingTenant?: boolean;
19
18
  ssr?: boolean;
20
19
  }
21
20
  /**
22
21
  * GlyphWalletProvider is a React provider that wraps the WagmiProvider and QueryClientProvider.
23
22
  * It provides the GlyphWalletContext to its children.
24
- * @example
23
+ *
25
24
  * ```tsx
26
25
  * import { GlyphWalletProvider } from '@use-glyph/sdk-react';
27
26
  *
@@ -34,7 +33,8 @@ interface GlyphWalletProviderProps {
34
33
  * );
35
34
  * };
36
35
  * ```
37
- * @param {GlyphWalletConfig} config - The configuration for the GlyphWalletProvider.
36
+ *
37
+ * See more at: {@link https://docs.useglyph.io/reference/components/GlyphWalletProvider/}
38
38
  */
39
- export declare const GlyphWalletProvider: ({ chains, transports, queryClient, children, glyphUrl, useStagingTenant, ssr }: GlyphWalletProviderProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const GlyphWalletProvider: ({ chains, transports, queryClient, children, ssr, ...glyphProviderOptions }: GlyphWalletProviderProps) => import("react/jsx-runtime").JSX.Element;
40
40
  export {};
@@ -7,5 +7,5 @@ type OpenPopupProps = {
7
7
  /**
8
8
  * Open a popup in the center of the screen with the specified size.
9
9
  */
10
- export declare function openPopup({ url, target, height, width }: OpenPopupProps): void;
10
+ export declare function openPopup({ url, target, height, width }: OpenPopupProps): Window | null;
11
11
  export {};