@dubsdotapp/expo 0.5.3 → 0.5.5

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 CHANGED
@@ -404,7 +404,9 @@ interface BuildArcadeEntryResult {
404
404
  transaction: string;
405
405
  poolId: string;
406
406
  amount: string;
407
- destination: string;
407
+ destination?: string;
408
+ gameId?: string;
409
+ gameAddress?: string;
408
410
  }
409
411
  interface EnterArcadePoolResult {
410
412
  poolId: string;
@@ -580,6 +582,8 @@ declare class DubsClient {
580
582
  enterArcadePool(poolId: number, params: {
581
583
  walletAddress: string;
582
584
  txSignature: string;
585
+ gameId?: string;
586
+ gameAddress?: string;
583
587
  }): Promise<ArcadeEntry>;
584
588
  startArcadeAttempt(poolId: number, walletAddress: string): Promise<StartAttemptResult>;
585
589
  submitArcadeScore(poolId: number, params: {
@@ -674,6 +678,14 @@ interface RegistrationScreenProps {
674
678
  error: Error | null;
675
679
  client: DubsClient;
676
680
  }
681
+ interface ConnectWalletScreenProps$1 {
682
+ /** Call this to trigger the wallet connection flow */
683
+ onConnect: () => void;
684
+ /** True while the wallet is connecting/signing */
685
+ connecting: boolean;
686
+ /** Error from a failed connection attempt */
687
+ error: Error | null;
688
+ }
677
689
  interface AuthGateProps {
678
690
  children: React$1.ReactNode;
679
691
  onSaveToken: (token: string | null) => void | Promise<void>;
@@ -681,11 +693,17 @@ interface AuthGateProps {
681
693
  renderLoading?: (status: AuthStatus) => React$1.ReactNode;
682
694
  renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
683
695
  renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
696
+ /**
697
+ * Render your own connect-wallet screen.
698
+ * Receives { onConnect, connecting, error }.
699
+ * If omitted, the default ConnectWalletScreen is shown.
700
+ */
701
+ renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
684
702
  appName?: string;
685
703
  /** Override accent color for registration screens (from developer UI config) */
686
704
  accentColor?: string;
687
705
  }
688
- declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
706
+ declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, renderConnectWallet, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
689
707
 
690
708
  interface ConnectWalletScreenProps {
691
709
  /** Called when the user taps Connect Wallet */
@@ -1165,40 +1183,42 @@ interface UseArcadeBridgeResult {
1165
1183
  declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1166
1184
 
1167
1185
  interface ConnectWalletButtonProps {
1168
- /** Called when the user taps the button */
1169
- onConnect: () => void | Promise<void>;
1170
- /** Show a loading spinner while connecting */
1171
- connecting?: boolean;
1172
- /** Error message to display below the button */
1173
- error?: string | null;
1174
- /** Override accent color (e.g. from developer UI config) */
1175
- accentColor?: string;
1176
- /** Override button label. Defaults to "Connect Wallet" */
1186
+ /** Button label. Defaults to "Connect Wallet" */
1177
1187
  label?: string;
1178
- /** Additional style applied to the outer container */
1179
- style?: ViewStyle;
1180
- /** Additional style applied to the button itself */
1181
- buttonStyle?: ViewStyle;
1188
+ /** Override accent/background color */
1189
+ accentColor?: string;
1190
+ /** Override text color. Defaults to #000 */
1191
+ textColor?: string;
1192
+ /** Override border radius */
1193
+ borderRadius?: number;
1194
+ /** Override padding vertical */
1195
+ paddingVertical?: number;
1196
+ /** Override font size */
1197
+ fontSize?: number;
1198
+ /** Full width. Defaults to true */
1199
+ fullWidth?: boolean;
1200
+ /** Called after authenticate() is triggered (not after it completes) */
1201
+ onPress?: () => void;
1182
1202
  }
1183
1203
  /**
1184
- * Drop-in wallet connect button that triggers the same MWA / Phantom
1185
- * connection flow as ConnectWalletScreen, but renders as a single button
1186
- * instead of a full-screen layout.
1204
+ * ConnectWalletButton
1205
+ *
1206
+ * A minimal, customisable button that fires useAuth().authenticate().
1207
+ * Use this when you want to own the connect-wallet screen UI (e.g. inside
1208
+ * your own onboarding) but still hand off the wallet picker, signing, and
1209
+ * registration flow to the SDK.
1187
1210
  *
1188
- * Use with `renderConnectScreen` on DubsProvider to embed the button
1189
- * inside your own custom onboarding or home screen:
1211
+ * The SDK will handle everything after this tap:
1212
+ * wallet picker sign message (registration/avatar if new user) → authenticated
1190
1213
  *
1191
- * ```tsx
1192
- * <DubsProvider
1193
- * renderConnectScreen={({ onConnect, connecting, error }) => (
1194
- * <MyScreen>
1195
- * <ConnectWalletButton onConnect={onConnect} connecting={connecting} error={error} />
1196
- * </MyScreen>
1197
- * )}
1198
- * >
1199
- * ```
1214
+ * Example:
1215
+ * <ConnectWalletButton
1216
+ * label="Let's go"
1217
+ * accentColor="#22C55E"
1218
+ * textColor="#000"
1219
+ * />
1200
1220
  */
1201
- declare function ConnectWalletButton({ onConnect, connecting, error, accentColor, label, style, buttonStyle, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
1221
+ declare function ConnectWalletButton({ label, accentColor, textColor, borderRadius, paddingVertical, fontSize, fullWidth, onPress, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
1202
1222
 
1203
1223
  interface UserProfileCardProps {
1204
1224
  walletAddress: string;
@@ -1424,4 +1444,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1424
1444
  */
1425
1445
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1426
1446
 
1427
- export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
1447
+ export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type ConnectWalletScreenProps$1 as AuthGateConnectWalletProps, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
package/dist/index.d.ts CHANGED
@@ -404,7 +404,9 @@ interface BuildArcadeEntryResult {
404
404
  transaction: string;
405
405
  poolId: string;
406
406
  amount: string;
407
- destination: string;
407
+ destination?: string;
408
+ gameId?: string;
409
+ gameAddress?: string;
408
410
  }
409
411
  interface EnterArcadePoolResult {
410
412
  poolId: string;
@@ -580,6 +582,8 @@ declare class DubsClient {
580
582
  enterArcadePool(poolId: number, params: {
581
583
  walletAddress: string;
582
584
  txSignature: string;
585
+ gameId?: string;
586
+ gameAddress?: string;
583
587
  }): Promise<ArcadeEntry>;
584
588
  startArcadeAttempt(poolId: number, walletAddress: string): Promise<StartAttemptResult>;
585
589
  submitArcadeScore(poolId: number, params: {
@@ -674,6 +678,14 @@ interface RegistrationScreenProps {
674
678
  error: Error | null;
675
679
  client: DubsClient;
676
680
  }
681
+ interface ConnectWalletScreenProps$1 {
682
+ /** Call this to trigger the wallet connection flow */
683
+ onConnect: () => void;
684
+ /** True while the wallet is connecting/signing */
685
+ connecting: boolean;
686
+ /** Error from a failed connection attempt */
687
+ error: Error | null;
688
+ }
677
689
  interface AuthGateProps {
678
690
  children: React$1.ReactNode;
679
691
  onSaveToken: (token: string | null) => void | Promise<void>;
@@ -681,11 +693,17 @@ interface AuthGateProps {
681
693
  renderLoading?: (status: AuthStatus) => React$1.ReactNode;
682
694
  renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
683
695
  renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
696
+ /**
697
+ * Render your own connect-wallet screen.
698
+ * Receives { onConnect, connecting, error }.
699
+ * If omitted, the default ConnectWalletScreen is shown.
700
+ */
701
+ renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
684
702
  appName?: string;
685
703
  /** Override accent color for registration screens (from developer UI config) */
686
704
  accentColor?: string;
687
705
  }
688
- declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
706
+ declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, renderConnectWallet, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
689
707
 
690
708
  interface ConnectWalletScreenProps {
691
709
  /** Called when the user taps Connect Wallet */
@@ -1165,40 +1183,42 @@ interface UseArcadeBridgeResult {
1165
1183
  declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1166
1184
 
1167
1185
  interface ConnectWalletButtonProps {
1168
- /** Called when the user taps the button */
1169
- onConnect: () => void | Promise<void>;
1170
- /** Show a loading spinner while connecting */
1171
- connecting?: boolean;
1172
- /** Error message to display below the button */
1173
- error?: string | null;
1174
- /** Override accent color (e.g. from developer UI config) */
1175
- accentColor?: string;
1176
- /** Override button label. Defaults to "Connect Wallet" */
1186
+ /** Button label. Defaults to "Connect Wallet" */
1177
1187
  label?: string;
1178
- /** Additional style applied to the outer container */
1179
- style?: ViewStyle;
1180
- /** Additional style applied to the button itself */
1181
- buttonStyle?: ViewStyle;
1188
+ /** Override accent/background color */
1189
+ accentColor?: string;
1190
+ /** Override text color. Defaults to #000 */
1191
+ textColor?: string;
1192
+ /** Override border radius */
1193
+ borderRadius?: number;
1194
+ /** Override padding vertical */
1195
+ paddingVertical?: number;
1196
+ /** Override font size */
1197
+ fontSize?: number;
1198
+ /** Full width. Defaults to true */
1199
+ fullWidth?: boolean;
1200
+ /** Called after authenticate() is triggered (not after it completes) */
1201
+ onPress?: () => void;
1182
1202
  }
1183
1203
  /**
1184
- * Drop-in wallet connect button that triggers the same MWA / Phantom
1185
- * connection flow as ConnectWalletScreen, but renders as a single button
1186
- * instead of a full-screen layout.
1204
+ * ConnectWalletButton
1205
+ *
1206
+ * A minimal, customisable button that fires useAuth().authenticate().
1207
+ * Use this when you want to own the connect-wallet screen UI (e.g. inside
1208
+ * your own onboarding) but still hand off the wallet picker, signing, and
1209
+ * registration flow to the SDK.
1187
1210
  *
1188
- * Use with `renderConnectScreen` on DubsProvider to embed the button
1189
- * inside your own custom onboarding or home screen:
1211
+ * The SDK will handle everything after this tap:
1212
+ * wallet picker sign message (registration/avatar if new user) → authenticated
1190
1213
  *
1191
- * ```tsx
1192
- * <DubsProvider
1193
- * renderConnectScreen={({ onConnect, connecting, error }) => (
1194
- * <MyScreen>
1195
- * <ConnectWalletButton onConnect={onConnect} connecting={connecting} error={error} />
1196
- * </MyScreen>
1197
- * )}
1198
- * >
1199
- * ```
1214
+ * Example:
1215
+ * <ConnectWalletButton
1216
+ * label="Let's go"
1217
+ * accentColor="#22C55E"
1218
+ * textColor="#000"
1219
+ * />
1200
1220
  */
1201
- declare function ConnectWalletButton({ onConnect, connecting, error, accentColor, label, style, buttonStyle, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
1221
+ declare function ConnectWalletButton({ label, accentColor, textColor, borderRadius, paddingVertical, fontSize, fullWidth, onPress, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
1202
1222
 
1203
1223
  interface UserProfileCardProps {
1204
1224
  walletAddress: string;
@@ -1424,4 +1444,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1424
1444
  */
1425
1445
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1426
1446
 
1427
- export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
1447
+ export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type ConnectWalletScreenProps$1 as AuthGateConnectWalletProps, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
package/dist/index.js CHANGED
@@ -624,7 +624,9 @@ var DubsClient = class {
624
624
  transaction: res.transaction,
625
625
  poolId: res.poolId,
626
626
  amount: res.amount,
627
- destination: res.destination
627
+ destination: res.destination,
628
+ gameId: res.gameId,
629
+ gameAddress: res.gameAddress
628
630
  };
629
631
  }
630
632
  async enterArcadePool(poolId, params) {
@@ -2784,7 +2786,9 @@ function useEnterArcadePool() {
2784
2786
  console.log("[useEnterArcadePool] Step 3: Confirming with backend...");
2785
2787
  const entry = await client.enterArcadePool(poolId, {
2786
2788
  walletAddress,
2787
- txSignature: signature
2789
+ txSignature: signature,
2790
+ gameId: buildResult.gameId,
2791
+ gameAddress: buildResult.gameAddress
2788
2792
  });
2789
2793
  console.log("[useEnterArcadePool] Step 3 done. Entry recorded.");
2790
2794
  const result = {
@@ -2865,6 +2869,8 @@ function useArcadeBridge({
2865
2869
  const webviewRef = (0, import_react22.useRef)(null);
2866
2870
  const sessionTokenRef = (0, import_react22.useRef)(null);
2867
2871
  const gameStartTimeRef = (0, import_react22.useRef)(0);
2872
+ const canPlayRef = (0, import_react22.useRef)(canPlay);
2873
+ canPlayRef.current = canPlay;
2868
2874
  const [lastResult, setLastResult] = (0, import_react22.useState)(null);
2869
2875
  const [bridgeLoading, setBridgeLoading] = (0, import_react22.useState)(false);
2870
2876
  const injectSession = (0, import_react22.useCallback)((token, attemptNumber) => {
@@ -2901,10 +2907,10 @@ function useArcadeBridge({
2901
2907
  } catch {
2902
2908
  return;
2903
2909
  }
2904
- if (data.dubsArcade !== PROTOCOL_VERSION) return;
2910
+ if (data.dubsArcade !== void 0 && data.dubsArcade !== PROTOCOL_VERSION) return;
2905
2911
  switch (data.type) {
2906
2912
  case "TAP_PLAY": {
2907
- if (canPlay) {
2913
+ if (canPlayRef.current) {
2908
2914
  triggerPlay();
2909
2915
  }
2910
2916
  return;
@@ -2933,7 +2939,7 @@ function useArcadeBridge({
2933
2939
  return;
2934
2940
  }
2935
2941
  },
2936
- [canPlay, triggerPlay, submitScore, onScoreSubmitted, onError]
2942
+ [triggerPlay, submitScore, onScoreSubmitted, onError]
2937
2943
  );
2938
2944
  return { webviewRef, handleMessage, triggerPlay, lastResult, bridgeLoading };
2939
2945
  }
@@ -3093,6 +3099,7 @@ function AuthGate({
3093
3099
  renderLoading,
3094
3100
  renderError,
3095
3101
  renderRegistration,
3102
+ renderConnectWallet,
3096
3103
  appName = "Dubs",
3097
3104
  accentColor
3098
3105
  }) {
@@ -3193,6 +3200,14 @@ function AuthGate({
3193
3200
  if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderError(auth.error, retry) });
3194
3201
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
3195
3202
  }
3203
+ if (auth.status === "idle") {
3204
+ const connectProps = {
3205
+ onConnect: auth.authenticate,
3206
+ connecting: false,
3207
+ error: null
3208
+ };
3209
+ if (renderConnectWallet) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderConnectWallet(connectProps) });
3210
+ }
3196
3211
  if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading(auth.status) });
3197
3212
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
3198
3213
  }
@@ -3895,62 +3910,52 @@ function useAppConfig() {
3895
3910
  var import_react_native9 = require("react-native");
3896
3911
  var import_jsx_runtime6 = require("react/jsx-runtime");
3897
3912
  function ConnectWalletButton({
3898
- onConnect,
3899
- connecting = false,
3900
- error = null,
3901
- accentColor,
3902
3913
  label = "Connect Wallet",
3903
- style,
3904
- buttonStyle
3914
+ accentColor,
3915
+ textColor = "#000000",
3916
+ borderRadius = 16,
3917
+ paddingVertical = 16,
3918
+ fontSize = 17,
3919
+ fullWidth = true,
3920
+ onPress
3905
3921
  }) {
3906
3922
  const t = useDubsTheme();
3923
+ const { authenticate, status } = useAuth();
3924
+ const connecting = status === "authenticating" || status === "signing" || status === "verifying";
3907
3925
  const accent = accentColor || t.accent;
3908
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style, children: [
3909
- error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3910
- import_react_native9.View,
3911
- {
3912
- style: [
3913
- styles3.errorBox,
3914
- { backgroundColor: t.errorBg, borderColor: t.errorBorder }
3915
- ],
3916
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.errorText, { color: t.errorText }], children: error })
3917
- }
3918
- ) : null,
3919
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3920
- import_react_native9.TouchableOpacity,
3921
- {
3922
- style: [styles3.button, { backgroundColor: accent }, buttonStyle],
3923
- onPress: onConnect,
3924
- disabled: connecting,
3925
- activeOpacity: 0.8,
3926
- children: connecting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: styles3.buttonText, children: label })
3927
- }
3928
- )
3929
- ] });
3926
+ const handlePress = () => {
3927
+ onPress?.();
3928
+ authenticate();
3929
+ };
3930
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3931
+ import_react_native9.TouchableOpacity,
3932
+ {
3933
+ onPress: handlePress,
3934
+ disabled: connecting,
3935
+ activeOpacity: 0.85,
3936
+ style: [
3937
+ styles3.btn,
3938
+ {
3939
+ backgroundColor: accent,
3940
+ borderRadius,
3941
+ paddingVertical,
3942
+ width: fullWidth ? "100%" : void 0,
3943
+ opacity: connecting ? 0.8 : 1
3944
+ }
3945
+ ],
3946
+ children: connecting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.ActivityIndicator, { color: textColor, size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.label, { color: textColor, fontSize }], children: label })
3947
+ }
3948
+ );
3930
3949
  }
3931
3950
  var styles3 = import_react_native9.StyleSheet.create({
3932
- button: {
3933
- height: 56,
3934
- borderRadius: 16,
3935
- justifyContent: "center",
3951
+ btn: {
3936
3952
  alignItems: "center",
3953
+ justifyContent: "center",
3937
3954
  paddingHorizontal: 24
3938
3955
  },
3939
- buttonText: {
3940
- color: "#FFFFFF",
3941
- fontSize: 18,
3942
- fontWeight: "700"
3943
- },
3944
- errorBox: {
3945
- borderWidth: 1,
3946
- borderRadius: 12,
3947
- paddingHorizontal: 16,
3948
- paddingVertical: 12,
3949
- marginBottom: 12
3950
- },
3951
- errorText: {
3952
- fontSize: 14,
3953
- textAlign: "center"
3956
+ label: {
3957
+ fontWeight: "800",
3958
+ letterSpacing: -0.2
3954
3959
  }
3955
3960
  });
3956
3961
 
@@ -6195,9 +6200,10 @@ function EnterArcadePoolSheet({
6195
6200
  }
6196
6201
  }, [mutation.status, mutation.error]);
6197
6202
  const buyInSol = (pool.buy_in_lamports / 1e9).toFixed(4);
6198
- const totalPlayers = stats?.total_entries ?? pool.total_entries ?? 0;
6203
+ const totalPlayers = stats?.total_entries ?? 0;
6204
+ const totalBuyIns = pool.total_entries ?? totalPlayers;
6199
6205
  const topScore = stats?.top_score ?? 0;
6200
- const potSol = (pool.buy_in_lamports * Number(totalPlayers) / 1e9).toFixed(4);
6206
+ const potSol = (pool.buy_in_lamports * Number(totalBuyIns) / 1e9).toFixed(4);
6201
6207
  const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
6202
6208
  const canJoin = !isMutating && mutation.status !== "success";
6203
6209
  const handleJoin = (0, import_react36.useCallback)(async () => {