@dubsdotapp/expo 0.5.1 → 0.5.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 CHANGED
@@ -473,6 +473,17 @@ interface SubmitScoreResult {
473
473
  livesUsed: number;
474
474
  isNewBest: boolean;
475
475
  }
476
+ interface ArcadePoolResult {
477
+ id: number;
478
+ pool_id: number;
479
+ entry_id: number;
480
+ wallet_address: string;
481
+ amount_lamports: string;
482
+ status: string;
483
+ username: string;
484
+ avatar: string | null;
485
+ best_score: number;
486
+ }
476
487
  interface UiConfig {
477
488
  accentColor?: string;
478
489
  appIcon?: string;
@@ -581,6 +592,7 @@ declare class DubsClient {
581
592
  limit?: number;
582
593
  offset?: number;
583
594
  }): Promise<ArcadeLeaderboardEntry[]>;
595
+ getArcadeResults(poolId: number): Promise<ArcadePoolResult[]>;
584
596
  getArcadeEntry(poolId: number, walletAddress: string): Promise<ArcadeEntry>;
585
597
  /** Fetch the app's UI customization config (accent color, icon, tagline, environment) */
586
598
  getAppConfig(): Promise<UiConfig>;
@@ -1128,6 +1140,8 @@ interface UseArcadeBridgeOptions {
1128
1140
  startAttempt: () => Promise<StartAttemptResult>;
1129
1141
  /** From useArcadeGame — submits a score for a completed life */
1130
1142
  submitScore: (sessionToken: string, score: number, durationMs?: number) => Promise<SubmitScoreResult>;
1143
+ /** Called when a new life starts (after startAttempt succeeds and session is injected) */
1144
+ onPlayStarted?: () => void;
1131
1145
  /** Called after a score is successfully submitted */
1132
1146
  onScoreSubmitted?: (result: SubmitScoreResult) => void;
1133
1147
  /** Called on any bridge error (network, invalid message, etc.) */
@@ -1148,7 +1162,7 @@ interface UseArcadeBridgeResult {
1148
1162
  /** True while a startAttempt or submitScore request is in flight */
1149
1163
  bridgeLoading: boolean;
1150
1164
  }
1151
- declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1165
+ declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1152
1166
 
1153
1167
  interface ConnectWalletButtonProps {
1154
1168
  /** Called when the user taps the button */
@@ -1410,4 +1424,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1410
1424
  */
1411
1425
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1412
1426
 
1413
- export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -473,6 +473,17 @@ interface SubmitScoreResult {
473
473
  livesUsed: number;
474
474
  isNewBest: boolean;
475
475
  }
476
+ interface ArcadePoolResult {
477
+ id: number;
478
+ pool_id: number;
479
+ entry_id: number;
480
+ wallet_address: string;
481
+ amount_lamports: string;
482
+ status: string;
483
+ username: string;
484
+ avatar: string | null;
485
+ best_score: number;
486
+ }
476
487
  interface UiConfig {
477
488
  accentColor?: string;
478
489
  appIcon?: string;
@@ -581,6 +592,7 @@ declare class DubsClient {
581
592
  limit?: number;
582
593
  offset?: number;
583
594
  }): Promise<ArcadeLeaderboardEntry[]>;
595
+ getArcadeResults(poolId: number): Promise<ArcadePoolResult[]>;
584
596
  getArcadeEntry(poolId: number, walletAddress: string): Promise<ArcadeEntry>;
585
597
  /** Fetch the app's UI customization config (accent color, icon, tagline, environment) */
586
598
  getAppConfig(): Promise<UiConfig>;
@@ -1128,6 +1140,8 @@ interface UseArcadeBridgeOptions {
1128
1140
  startAttempt: () => Promise<StartAttemptResult>;
1129
1141
  /** From useArcadeGame — submits a score for a completed life */
1130
1142
  submitScore: (sessionToken: string, score: number, durationMs?: number) => Promise<SubmitScoreResult>;
1143
+ /** Called when a new life starts (after startAttempt succeeds and session is injected) */
1144
+ onPlayStarted?: () => void;
1131
1145
  /** Called after a score is successfully submitted */
1132
1146
  onScoreSubmitted?: (result: SubmitScoreResult) => void;
1133
1147
  /** Called on any bridge error (network, invalid message, etc.) */
@@ -1148,7 +1162,7 @@ interface UseArcadeBridgeResult {
1148
1162
  /** True while a startAttempt or submitScore request is in flight */
1149
1163
  bridgeLoading: boolean;
1150
1164
  }
1151
- declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1165
+ declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
1152
1166
 
1153
1167
  interface ConnectWalletButtonProps {
1154
1168
  /** Called when the user taps the button */
@@ -1410,4 +1424,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1410
1424
  */
1411
1425
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1412
1426
 
1413
- export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, 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 };
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 };
package/dist/index.js CHANGED
@@ -662,6 +662,13 @@ var DubsClient = class {
662
662
  );
663
663
  return res.leaderboard;
664
664
  }
665
+ async getArcadeResults(poolId) {
666
+ const res = await this.request(
667
+ "GET",
668
+ `/arcade/pools/${poolId}/results`
669
+ );
670
+ return res.results;
671
+ }
665
672
  async getArcadeEntry(poolId, walletAddress) {
666
673
  const res = await this.request(
667
674
  "GET",
@@ -2851,6 +2858,7 @@ function useArcadeBridge({
2851
2858
  canPlay,
2852
2859
  startAttempt,
2853
2860
  submitScore,
2861
+ onPlayStarted,
2854
2862
  onScoreSubmitted,
2855
2863
  onError
2856
2864
  }) {
@@ -2877,13 +2885,14 @@ function useArcadeBridge({
2877
2885
  gameStartTimeRef.current = Date.now();
2878
2886
  setLastResult(null);
2879
2887
  injectSession(result.sessionToken, result.attemptNumber);
2888
+ onPlayStarted?.();
2880
2889
  } catch (err) {
2881
2890
  const e = err instanceof Error ? err : new Error(String(err));
2882
2891
  onError?.(e);
2883
2892
  } finally {
2884
2893
  setBridgeLoading(false);
2885
2894
  }
2886
- }, [canPlay, startAttempt, injectSession, onError]);
2895
+ }, [canPlay, startAttempt, injectSession, onPlayStarted, onError]);
2887
2896
  const handleMessage = (0, import_react22.useCallback)(
2888
2897
  async (event) => {
2889
2898
  let data;