@dubsdotapp/expo 0.5.24 → 0.5.26

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
@@ -554,6 +554,22 @@ interface UiConfig {
554
554
  ios: boolean;
555
555
  };
556
556
  }
557
+ type WhatsNewCategory = 'feature' | 'improvement' | 'bugfix' | 'announcement';
558
+ interface WhatsNewPost {
559
+ id: number;
560
+ title: string;
561
+ content: string;
562
+ gif_url: string | null;
563
+ category: WhatsNewCategory;
564
+ version: string | null;
565
+ is_pinned: boolean;
566
+ is_published: boolean;
567
+ /** Present when the post is fetched in an authenticated context. */
568
+ is_read?: boolean;
569
+ created_by: string;
570
+ created_at: string;
571
+ updated_at: string;
572
+ }
557
573
 
558
574
  interface DubsClientConfig {
559
575
  apiKey: string;
@@ -770,6 +786,24 @@ declare class DubsClient {
770
786
  getBlockedUsers(): Promise<{
771
787
  blocked: any[];
772
788
  }>;
789
+ /** List published What's New posts for this app, with is_read for the current user. */
790
+ getWhatsNewPosts(): Promise<{
791
+ posts: WhatsNewPost[];
792
+ }>;
793
+ /** Fetch a single What's New post by id. */
794
+ getWhatsNewPost(postId: number): Promise<{
795
+ post: WhatsNewPost;
796
+ }>;
797
+ /** Number of unread What's New posts for the current user (this app). */
798
+ getWhatsNewUnreadCount(): Promise<{
799
+ count: number;
800
+ }>;
801
+ /** Mark specific posts as read. */
802
+ markWhatsNewRead(postIds: number[]): Promise<void>;
803
+ /** Mark every unread post as read. */
804
+ markAllWhatsNewRead(): Promise<{
805
+ updated: number;
806
+ }>;
773
807
  /** Fetch the app's UI customization config (accent color, icon, tagline, environment) */
774
808
  getAppConfig(): Promise<UiConfig>;
775
809
  }
@@ -2025,6 +2059,12 @@ interface ChatContextValue {
2025
2059
  refreshPendingRequests: () => Promise<void>;
2026
2060
  /** Reload pending friend requests (sent) from REST */
2027
2061
  refreshSentFriendRequests: () => Promise<void>;
2062
+ /** What's New posts for this app */
2063
+ whatsNewPosts: WhatsNewPost[];
2064
+ /** Number of unread What's New posts */
2065
+ whatsNewUnreadCount: number;
2066
+ /** Reload What's New posts + unread count from REST */
2067
+ refreshWhatsNew: () => Promise<void>;
2028
2068
  }
2029
2069
  interface ChatProviderProps {
2030
2070
  children: React$1.ReactNode;
@@ -2124,6 +2164,20 @@ declare function useRespondToFriendRequest(): {
2124
2164
  reject: (requestId: number) => Promise<void>;
2125
2165
  loading: boolean;
2126
2166
  };
2167
+ /**
2168
+ * Read-only subscription to the calling app's What's New posts.
2169
+ *
2170
+ * Auto-refreshes via the chat socket when a new `whats_new` notification
2171
+ * arrives, so the unread badge / list update without manual refetch.
2172
+ */
2173
+ declare function useWhatsNew(): {
2174
+ posts: WhatsNewPost[];
2175
+ unreadCount: number;
2176
+ loading: boolean;
2177
+ refetch: () => Promise<void>;
2178
+ markRead: (postIds: number[]) => Promise<void>;
2179
+ markAllRead: () => Promise<void>;
2180
+ };
2127
2181
 
2128
2182
  /**
2129
2183
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
@@ -2140,4 +2194,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
2140
2194
  */
2141
2195
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
2142
2196
 
2143
- 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 BuildJackpotEnterResult, type ChatConnectionStatus, type ChatContextValue, type ChatMention, type ChatMessage, type ChatNotification, type ChatPayment, ChatProvider, type ChatProviderProps, ChatSocket, type ChatSocketConfig, type ChatSocketListeners, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, type ConfirmJackpotEnterResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type Conversation, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, CreateGameSheet, type CreateGameSheetProps, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, type DirectMessage, 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 EnterJackpotMutationResult, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type FriendRequest, type FriendUser, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type HighlightVideo, JackpotCard, type JackpotCardProps, type JackpotConfig, type JackpotEntry, type JackpotLastWinner, type JackpotRound, type JackpotRoundResult, JackpotSheet, type JackpotSheetProps, JackpotWidget, type JackpotWidgetProps, 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 OnlineUser, 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, type SendDMParams, type SendMessageParams, type SentFriendRequest, SettingsSheet, type SettingsSheetProps, type ShortVideo, SolSlider, type SolSliderProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type TypingEvent, 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, type UseJackpotHistoryResult, type UseJackpotResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useCancelFriendRequest, useChatContext, useChatMessages, useChatStatus, useClaim, useConversations, useCreateCustomGame, useCreateGame, useDirectMessages, useDubs, useDubsTheme, useEnterArcadePool, useEnterJackpot, useEvents, useFriendRequests, useFriends, useGame, useGames, useHasClaimed, useHighlights, useJackpot, useJackpotHistory, useJoinGame, useNetworkGames, useOnlineUsers, usePushNotifications, useRespondToFriendRequest, useSearchUsers, useSendFriendRequest, useSendMessage, useSentFriendRequests, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount };
2197
+ 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 BuildJackpotEnterResult, type ChatConnectionStatus, type ChatContextValue, type ChatMention, type ChatMessage, type ChatNotification, type ChatPayment, ChatProvider, type ChatProviderProps, ChatSocket, type ChatSocketConfig, type ChatSocketListeners, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, type ConfirmJackpotEnterResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type Conversation, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, CreateGameSheet, type CreateGameSheetProps, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, type DirectMessage, 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 EnterJackpotMutationResult, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type FriendRequest, type FriendUser, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type HighlightVideo, JackpotCard, type JackpotCardProps, type JackpotConfig, type JackpotEntry, type JackpotLastWinner, type JackpotRound, type JackpotRoundResult, JackpotSheet, type JackpotSheetProps, JackpotWidget, type JackpotWidgetProps, 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 OnlineUser, 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, type SendDMParams, type SendMessageParams, type SentFriendRequest, SettingsSheet, type SettingsSheetProps, type ShortVideo, SolSlider, type SolSliderProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type TypingEvent, 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, type UseJackpotHistoryResult, type UseJackpotResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, type WhatsNewCategory, type WhatsNewPost, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useCancelFriendRequest, useChatContext, useChatMessages, useChatStatus, useClaim, useConversations, useCreateCustomGame, useCreateGame, useDirectMessages, useDubs, useDubsTheme, useEnterArcadePool, useEnterJackpot, useEvents, useFriendRequests, useFriends, useGame, useGames, useHasClaimed, useHighlights, useJackpot, useJackpotHistory, useJoinGame, useNetworkGames, useOnlineUsers, usePushNotifications, useRespondToFriendRequest, useSearchUsers, useSendFriendRequest, useSendMessage, useSentFriendRequests, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount, useWhatsNew };
package/dist/index.d.ts CHANGED
@@ -554,6 +554,22 @@ interface UiConfig {
554
554
  ios: boolean;
555
555
  };
556
556
  }
557
+ type WhatsNewCategory = 'feature' | 'improvement' | 'bugfix' | 'announcement';
558
+ interface WhatsNewPost {
559
+ id: number;
560
+ title: string;
561
+ content: string;
562
+ gif_url: string | null;
563
+ category: WhatsNewCategory;
564
+ version: string | null;
565
+ is_pinned: boolean;
566
+ is_published: boolean;
567
+ /** Present when the post is fetched in an authenticated context. */
568
+ is_read?: boolean;
569
+ created_by: string;
570
+ created_at: string;
571
+ updated_at: string;
572
+ }
557
573
 
558
574
  interface DubsClientConfig {
559
575
  apiKey: string;
@@ -770,6 +786,24 @@ declare class DubsClient {
770
786
  getBlockedUsers(): Promise<{
771
787
  blocked: any[];
772
788
  }>;
789
+ /** List published What's New posts for this app, with is_read for the current user. */
790
+ getWhatsNewPosts(): Promise<{
791
+ posts: WhatsNewPost[];
792
+ }>;
793
+ /** Fetch a single What's New post by id. */
794
+ getWhatsNewPost(postId: number): Promise<{
795
+ post: WhatsNewPost;
796
+ }>;
797
+ /** Number of unread What's New posts for the current user (this app). */
798
+ getWhatsNewUnreadCount(): Promise<{
799
+ count: number;
800
+ }>;
801
+ /** Mark specific posts as read. */
802
+ markWhatsNewRead(postIds: number[]): Promise<void>;
803
+ /** Mark every unread post as read. */
804
+ markAllWhatsNewRead(): Promise<{
805
+ updated: number;
806
+ }>;
773
807
  /** Fetch the app's UI customization config (accent color, icon, tagline, environment) */
774
808
  getAppConfig(): Promise<UiConfig>;
775
809
  }
@@ -2025,6 +2059,12 @@ interface ChatContextValue {
2025
2059
  refreshPendingRequests: () => Promise<void>;
2026
2060
  /** Reload pending friend requests (sent) from REST */
2027
2061
  refreshSentFriendRequests: () => Promise<void>;
2062
+ /** What's New posts for this app */
2063
+ whatsNewPosts: WhatsNewPost[];
2064
+ /** Number of unread What's New posts */
2065
+ whatsNewUnreadCount: number;
2066
+ /** Reload What's New posts + unread count from REST */
2067
+ refreshWhatsNew: () => Promise<void>;
2028
2068
  }
2029
2069
  interface ChatProviderProps {
2030
2070
  children: React$1.ReactNode;
@@ -2124,6 +2164,20 @@ declare function useRespondToFriendRequest(): {
2124
2164
  reject: (requestId: number) => Promise<void>;
2125
2165
  loading: boolean;
2126
2166
  };
2167
+ /**
2168
+ * Read-only subscription to the calling app's What's New posts.
2169
+ *
2170
+ * Auto-refreshes via the chat socket when a new `whats_new` notification
2171
+ * arrives, so the unread badge / list update without manual refetch.
2172
+ */
2173
+ declare function useWhatsNew(): {
2174
+ posts: WhatsNewPost[];
2175
+ unreadCount: number;
2176
+ loading: boolean;
2177
+ refetch: () => Promise<void>;
2178
+ markRead: (postIds: number[]) => Promise<void>;
2179
+ markAllRead: () => Promise<void>;
2180
+ };
2127
2181
 
2128
2182
  /**
2129
2183
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
@@ -2140,4 +2194,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
2140
2194
  */
2141
2195
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
2142
2196
 
2143
- 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 BuildJackpotEnterResult, type ChatConnectionStatus, type ChatContextValue, type ChatMention, type ChatMessage, type ChatNotification, type ChatPayment, ChatProvider, type ChatProviderProps, ChatSocket, type ChatSocketConfig, type ChatSocketListeners, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, type ConfirmJackpotEnterResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type Conversation, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, CreateGameSheet, type CreateGameSheetProps, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, type DirectMessage, 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 EnterJackpotMutationResult, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type FriendRequest, type FriendUser, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type HighlightVideo, JackpotCard, type JackpotCardProps, type JackpotConfig, type JackpotEntry, type JackpotLastWinner, type JackpotRound, type JackpotRoundResult, JackpotSheet, type JackpotSheetProps, JackpotWidget, type JackpotWidgetProps, 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 OnlineUser, 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, type SendDMParams, type SendMessageParams, type SentFriendRequest, SettingsSheet, type SettingsSheetProps, type ShortVideo, SolSlider, type SolSliderProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type TypingEvent, 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, type UseJackpotHistoryResult, type UseJackpotResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useCancelFriendRequest, useChatContext, useChatMessages, useChatStatus, useClaim, useConversations, useCreateCustomGame, useCreateGame, useDirectMessages, useDubs, useDubsTheme, useEnterArcadePool, useEnterJackpot, useEvents, useFriendRequests, useFriends, useGame, useGames, useHasClaimed, useHighlights, useJackpot, useJackpotHistory, useJoinGame, useNetworkGames, useOnlineUsers, usePushNotifications, useRespondToFriendRequest, useSearchUsers, useSendFriendRequest, useSendMessage, useSentFriendRequests, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount };
2197
+ 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 BuildJackpotEnterResult, type ChatConnectionStatus, type ChatContextValue, type ChatMention, type ChatMessage, type ChatNotification, type ChatPayment, ChatProvider, type ChatProviderProps, ChatSocket, type ChatSocketConfig, type ChatSocketListeners, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, type ConfirmJackpotEnterResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type Conversation, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, CreateGameSheet, type CreateGameSheetProps, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, type DirectMessage, 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 EnterJackpotMutationResult, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type FriendRequest, type FriendUser, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type HighlightVideo, JackpotCard, type JackpotCardProps, type JackpotConfig, type JackpotEntry, type JackpotLastWinner, type JackpotRound, type JackpotRoundResult, JackpotSheet, type JackpotSheetProps, JackpotWidget, type JackpotWidgetProps, 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 OnlineUser, 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, type SendDMParams, type SendMessageParams, type SentFriendRequest, SettingsSheet, type SettingsSheetProps, type ShortVideo, SolSlider, type SolSliderProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type TypingEvent, 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, type UseJackpotHistoryResult, type UseJackpotResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, type WhatsNewCategory, type WhatsNewPost, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useCancelFriendRequest, useChatContext, useChatMessages, useChatStatus, useClaim, useConversations, useCreateCustomGame, useCreateGame, useDirectMessages, useDubs, useDubsTheme, useEnterArcadePool, useEnterJackpot, useEvents, useFriendRequests, useFriends, useGame, useGames, useHasClaimed, useHighlights, useJackpot, useJackpotHistory, useJoinGame, useNetworkGames, useOnlineUsers, usePushNotifications, useRespondToFriendRequest, useSearchUsers, useSendFriendRequest, useSendMessage, useSentFriendRequests, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount, useWhatsNew };
package/dist/index.js CHANGED
@@ -112,7 +112,8 @@ __export(index_exports, {
112
112
  useShorts: () => useShorts,
113
113
  useUFCFightCard: () => useUFCFightCard,
114
114
  useUFCFighterDetail: () => useUFCFighterDetail,
115
- useUnreadCount: () => useUnreadCount
115
+ useUnreadCount: () => useUnreadCount,
116
+ useWhatsNew: () => useWhatsNew
116
117
  });
117
118
  module.exports = __toCommonJS(index_exports);
118
119
 
@@ -858,6 +859,27 @@ var DubsClient = class {
858
859
  async getBlockedUsers() {
859
860
  return this.request("GET", "/social/blocked");
860
861
  }
862
+ // ── What's New ──
863
+ /** List published What's New posts for this app, with is_read for the current user. */
864
+ async getWhatsNewPosts() {
865
+ return this.request("GET", "/whats-new/posts");
866
+ }
867
+ /** Fetch a single What's New post by id. */
868
+ async getWhatsNewPost(postId) {
869
+ return this.request("GET", `/whats-new/posts/${postId}`);
870
+ }
871
+ /** Number of unread What's New posts for the current user (this app). */
872
+ async getWhatsNewUnreadCount() {
873
+ return this.request("GET", "/whats-new/unread-count");
874
+ }
875
+ /** Mark specific posts as read. */
876
+ async markWhatsNewRead(postIds) {
877
+ await this.request("POST", "/whats-new/mark-read", { postIds });
878
+ }
879
+ /** Mark every unread post as read. */
880
+ async markAllWhatsNewRead() {
881
+ return this.request("POST", "/whats-new/mark-all-read");
882
+ }
861
883
  // ── App Config ──
862
884
  /** Fetch the app's UI customization config (accent color, icon, tagline, environment) */
863
885
  async getAppConfig() {
@@ -8781,6 +8803,8 @@ function ChatProvider({ children, autoConnect = true }) {
8781
8803
  const [friends, setFriends] = (0, import_react49.useState)([]);
8782
8804
  const [pendingRequests, setPendingRequests] = (0, import_react49.useState)([]);
8783
8805
  const [sentFriendRequests, setSentFriendRequests] = (0, import_react49.useState)([]);
8806
+ const [whatsNewPosts, setWhatsNewPosts] = (0, import_react49.useState)([]);
8807
+ const [whatsNewUnreadCount, setWhatsNewUnreadCount] = (0, import_react49.useState)(0);
8784
8808
  const refreshMessages = (0, import_react49.useCallback)(async () => {
8785
8809
  try {
8786
8810
  const res = await client.getChatMessages({ limit: 30 });
@@ -8817,6 +8841,15 @@ function ChatProvider({ children, autoConnect = true }) {
8817
8841
  } catch (_) {
8818
8842
  }
8819
8843
  }, [client]);
8844
+ const refreshWhatsNew = (0, import_react49.useCallback)(async () => {
8845
+ try {
8846
+ const res = await client.getWhatsNewPosts();
8847
+ setWhatsNewPosts(res.posts);
8848
+ const unread = res.posts.filter((p) => !p.is_read).length;
8849
+ setWhatsNewUnreadCount(unread);
8850
+ } catch (_) {
8851
+ }
8852
+ }, [client]);
8820
8853
  (0, import_react49.useEffect)(() => {
8821
8854
  const token = client.getToken();
8822
8855
  if (!autoConnect || !token) return;
@@ -8847,13 +8880,24 @@ function ChatProvider({ children, autoConnect = true }) {
8847
8880
  refreshSentFriendRequests();
8848
8881
  }
8849
8882
  if (n.type === "friend_request_declined") refreshSentFriendRequests();
8883
+ if (n.type === "whats_new") refreshWhatsNew();
8850
8884
  },
8885
+ // These events now fan out to BOTH parties (server emits to actor's
8886
+ // own room as well), so each handler refreshes every list that could
8887
+ // be affected — works whether this client is the actor or the target.
8851
8888
  onFriendRequestAccepted: () => {
8852
8889
  refreshFriends();
8890
+ refreshPendingRequests();
8891
+ refreshSentFriendRequests();
8892
+ },
8893
+ onFriendRequestDeclined: () => {
8894
+ refreshPendingRequests();
8895
+ refreshSentFriendRequests();
8896
+ },
8897
+ onFriendRequestCancelled: () => {
8898
+ refreshPendingRequests();
8853
8899
  refreshSentFriendRequests();
8854
8900
  },
8855
- onFriendRequestDeclined: () => refreshSentFriendRequests(),
8856
- onFriendRequestCancelled: () => refreshPendingRequests(),
8857
8901
  onFriendRemoved: () => refreshFriends()
8858
8902
  });
8859
8903
  chatSocket.connect({ host, token });
@@ -8864,10 +8908,12 @@ function ChatProvider({ children, autoConnect = true }) {
8864
8908
  });
8865
8909
  refreshSentFriendRequests().catch(() => {
8866
8910
  });
8911
+ refreshWhatsNew().catch(() => {
8912
+ });
8867
8913
  return () => {
8868
8914
  chatSocket.disconnect();
8869
8915
  };
8870
- }, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
8916
+ }, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]);
8871
8917
  (0, import_react49.useEffect)(() => {
8872
8918
  const handleAppState = (nextState) => {
8873
8919
  if (nextState === "active") {
@@ -8889,11 +8935,13 @@ function ChatProvider({ children, autoConnect = true }) {
8889
8935
  });
8890
8936
  refreshSentFriendRequests().catch(() => {
8891
8937
  });
8938
+ refreshWhatsNew().catch(() => {
8939
+ });
8892
8940
  }
8893
8941
  };
8894
8942
  const sub = import_react_native29.AppState.addEventListener("change", handleAppState);
8895
8943
  return () => sub.remove();
8896
- }, [client, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
8944
+ }, [client, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]);
8897
8945
  const value = (0, import_react49.useMemo)(
8898
8946
  () => ({
8899
8947
  socket: socketRef.current,
@@ -8906,13 +8954,16 @@ function ChatProvider({ children, autoConnect = true }) {
8906
8954
  friends,
8907
8955
  pendingRequests,
8908
8956
  sentFriendRequests,
8957
+ whatsNewPosts,
8958
+ whatsNewUnreadCount,
8909
8959
  refreshMessages,
8910
8960
  refreshConversations,
8911
8961
  refreshFriends,
8912
8962
  refreshPendingRequests,
8913
- refreshSentFriendRequests
8963
+ refreshSentFriendRequests,
8964
+ refreshWhatsNew
8914
8965
  }),
8915
- [status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, sentFriendRequests, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]
8966
+ [status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, sentFriendRequests, whatsNewPosts, whatsNewUnreadCount, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]
8916
8967
  );
8917
8968
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatContext.Provider, { value, children });
8918
8969
  }
@@ -9158,6 +9209,47 @@ function useRespondToFriendRequest() {
9158
9209
  );
9159
9210
  return { accept, reject, loading };
9160
9211
  }
9212
+ function useWhatsNew() {
9213
+ const { client } = useDubs();
9214
+ const { whatsNewPosts, whatsNewUnreadCount, refreshWhatsNew } = useChatContext();
9215
+ const [loading, setLoading] = (0, import_react50.useState)(false);
9216
+ const refetch = (0, import_react50.useCallback)(async () => {
9217
+ setLoading(true);
9218
+ try {
9219
+ await refreshWhatsNew();
9220
+ } finally {
9221
+ setLoading(false);
9222
+ }
9223
+ }, [refreshWhatsNew]);
9224
+ const markRead = (0, import_react50.useCallback)(
9225
+ async (postIds) => {
9226
+ if (postIds.length === 0) return;
9227
+ try {
9228
+ await client.markWhatsNewRead(postIds);
9229
+ await refreshWhatsNew();
9230
+ } catch (err) {
9231
+ console.error("[Dubs:useWhatsNew] markRead error:", err);
9232
+ }
9233
+ },
9234
+ [client, refreshWhatsNew]
9235
+ );
9236
+ const markAllRead = (0, import_react50.useCallback)(async () => {
9237
+ try {
9238
+ await client.markAllWhatsNewRead();
9239
+ await refreshWhatsNew();
9240
+ } catch (err) {
9241
+ console.error("[Dubs:useWhatsNew] markAllRead error:", err);
9242
+ }
9243
+ }, [client, refreshWhatsNew]);
9244
+ return {
9245
+ posts: whatsNewPosts,
9246
+ unreadCount: whatsNewUnreadCount,
9247
+ loading,
9248
+ refetch,
9249
+ markRead,
9250
+ markAllRead
9251
+ };
9252
+ }
9161
9253
  // Annotate the CommonJS export names for ESM import in node:
9162
9254
  0 && (module.exports = {
9163
9255
  ArcadeLeaderboardSheet,
@@ -9242,6 +9334,7 @@ function useRespondToFriendRequest() {
9242
9334
  useShorts,
9243
9335
  useUFCFightCard,
9244
9336
  useUFCFighterDetail,
9245
- useUnreadCount
9337
+ useUnreadCount,
9338
+ useWhatsNew
9246
9339
  });
9247
9340
  //# sourceMappingURL=index.js.map