@dubsdotapp/expo 0.1.1 → 0.1.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.d.mts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +551 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useAuth.ts +3 -2
- package/src/index.ts +2 -2
- package/src/types.ts +1 -0
- package/src/ui/AuthGate.tsx +616 -0
- package/src/ui/index.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -232,6 +232,7 @@ interface RegisterParams {
|
|
|
232
232
|
nonce: string;
|
|
233
233
|
username: string;
|
|
234
234
|
referralCode?: string;
|
|
235
|
+
avatarUrl?: string;
|
|
235
236
|
}
|
|
236
237
|
interface RegisterResult {
|
|
237
238
|
user: DubsUser;
|
|
@@ -499,7 +500,7 @@ interface UseAuthResult {
|
|
|
499
500
|
* Register a new user after authenticate() returned needsRegistration.
|
|
500
501
|
* Reuses the nonce+signature from authenticate() — no second signing prompt.
|
|
501
502
|
*/
|
|
502
|
-
register: (username: string, referralCode?: string) => Promise<void>;
|
|
503
|
+
register: (username: string, referralCode?: string, avatarUrl?: string) => Promise<void>;
|
|
503
504
|
/** Log out and clear state */
|
|
504
505
|
logout: () => Promise<void>;
|
|
505
506
|
/**
|
|
@@ -512,6 +513,23 @@ interface UseAuthResult {
|
|
|
512
513
|
}
|
|
513
514
|
declare function useAuth(): UseAuthResult;
|
|
514
515
|
|
|
516
|
+
interface RegistrationScreenProps {
|
|
517
|
+
onRegister: (username: string, referralCode?: string, avatarUrl?: string) => void;
|
|
518
|
+
registering: boolean;
|
|
519
|
+
error: Error | null;
|
|
520
|
+
client: DubsClient;
|
|
521
|
+
}
|
|
522
|
+
interface AuthGateProps {
|
|
523
|
+
children: React.ReactNode;
|
|
524
|
+
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
525
|
+
onLoadToken: () => string | null | Promise<string | null>;
|
|
526
|
+
renderLoading?: (status: AuthStatus) => React.ReactNode;
|
|
527
|
+
renderError?: (error: Error, retry: () => void) => React.ReactNode;
|
|
528
|
+
renderRegistration?: (props: RegistrationScreenProps) => React.ReactNode;
|
|
529
|
+
appName?: string;
|
|
530
|
+
}
|
|
531
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
515
533
|
interface ConnectWalletScreenProps {
|
|
516
534
|
/** Called when the user taps Connect Wallet */
|
|
517
535
|
onConnect: () => void | Promise<void>;
|
|
@@ -574,4 +592,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
574
592
|
*/
|
|
575
593
|
declare function pollTransactionConfirmation(signature: string, connection: Connection, commitment?: TransactionConfirmationStatus, timeout?: number, interval?: number): Promise<void>;
|
|
576
594
|
|
|
577
|
-
export { type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
595
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.d.ts
CHANGED
|
@@ -232,6 +232,7 @@ interface RegisterParams {
|
|
|
232
232
|
nonce: string;
|
|
233
233
|
username: string;
|
|
234
234
|
referralCode?: string;
|
|
235
|
+
avatarUrl?: string;
|
|
235
236
|
}
|
|
236
237
|
interface RegisterResult {
|
|
237
238
|
user: DubsUser;
|
|
@@ -499,7 +500,7 @@ interface UseAuthResult {
|
|
|
499
500
|
* Register a new user after authenticate() returned needsRegistration.
|
|
500
501
|
* Reuses the nonce+signature from authenticate() — no second signing prompt.
|
|
501
502
|
*/
|
|
502
|
-
register: (username: string, referralCode?: string) => Promise<void>;
|
|
503
|
+
register: (username: string, referralCode?: string, avatarUrl?: string) => Promise<void>;
|
|
503
504
|
/** Log out and clear state */
|
|
504
505
|
logout: () => Promise<void>;
|
|
505
506
|
/**
|
|
@@ -512,6 +513,23 @@ interface UseAuthResult {
|
|
|
512
513
|
}
|
|
513
514
|
declare function useAuth(): UseAuthResult;
|
|
514
515
|
|
|
516
|
+
interface RegistrationScreenProps {
|
|
517
|
+
onRegister: (username: string, referralCode?: string, avatarUrl?: string) => void;
|
|
518
|
+
registering: boolean;
|
|
519
|
+
error: Error | null;
|
|
520
|
+
client: DubsClient;
|
|
521
|
+
}
|
|
522
|
+
interface AuthGateProps {
|
|
523
|
+
children: React.ReactNode;
|
|
524
|
+
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
525
|
+
onLoadToken: () => string | null | Promise<string | null>;
|
|
526
|
+
renderLoading?: (status: AuthStatus) => React.ReactNode;
|
|
527
|
+
renderError?: (error: Error, retry: () => void) => React.ReactNode;
|
|
528
|
+
renderRegistration?: (props: RegistrationScreenProps) => React.ReactNode;
|
|
529
|
+
appName?: string;
|
|
530
|
+
}
|
|
531
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
515
533
|
interface ConnectWalletScreenProps {
|
|
516
534
|
/** Called when the user taps Connect Wallet */
|
|
517
535
|
onConnect: () => void | Promise<void>;
|
|
@@ -574,4 +592,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
574
592
|
*/
|
|
575
593
|
declare function pollTransactionConfirmation(signature: string, connection: Connection, commitment?: TransactionConfirmationStatus, timeout?: number, interval?: number): Promise<void>;
|
|
576
594
|
|
|
577
|
-
export { type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
595
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|