@dubsdotapp/expo 0.5.23 → 0.5.25
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 +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +97 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/hooks.ts +62 -0
- package/src/chat/index.ts +1 -0
- package/src/chat/provider.tsx +38 -4
- package/src/client.ts +28 -0
- package/src/index.ts +3 -0
- package/src/types.ts +20 -0
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,6 +8880,7 @@ 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
|
},
|
|
8851
8885
|
onFriendRequestAccepted: () => {
|
|
8852
8886
|
refreshFriends();
|
|
@@ -8864,10 +8898,12 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8864
8898
|
});
|
|
8865
8899
|
refreshSentFriendRequests().catch(() => {
|
|
8866
8900
|
});
|
|
8901
|
+
refreshWhatsNew().catch(() => {
|
|
8902
|
+
});
|
|
8867
8903
|
return () => {
|
|
8868
8904
|
chatSocket.disconnect();
|
|
8869
8905
|
};
|
|
8870
|
-
}, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
|
|
8906
|
+
}, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]);
|
|
8871
8907
|
(0, import_react49.useEffect)(() => {
|
|
8872
8908
|
const handleAppState = (nextState) => {
|
|
8873
8909
|
if (nextState === "active") {
|
|
@@ -8881,11 +8917,21 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8881
8917
|
}
|
|
8882
8918
|
}
|
|
8883
8919
|
refreshMessages();
|
|
8920
|
+
refreshConversations().catch(() => {
|
|
8921
|
+
});
|
|
8922
|
+
refreshFriends().catch(() => {
|
|
8923
|
+
});
|
|
8924
|
+
refreshPendingRequests().catch(() => {
|
|
8925
|
+
});
|
|
8926
|
+
refreshSentFriendRequests().catch(() => {
|
|
8927
|
+
});
|
|
8928
|
+
refreshWhatsNew().catch(() => {
|
|
8929
|
+
});
|
|
8884
8930
|
}
|
|
8885
8931
|
};
|
|
8886
8932
|
const sub = import_react_native29.AppState.addEventListener("change", handleAppState);
|
|
8887
8933
|
return () => sub.remove();
|
|
8888
|
-
}, [client, refreshMessages, refreshConversations]);
|
|
8934
|
+
}, [client, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]);
|
|
8889
8935
|
const value = (0, import_react49.useMemo)(
|
|
8890
8936
|
() => ({
|
|
8891
8937
|
socket: socketRef.current,
|
|
@@ -8898,13 +8944,16 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8898
8944
|
friends,
|
|
8899
8945
|
pendingRequests,
|
|
8900
8946
|
sentFriendRequests,
|
|
8947
|
+
whatsNewPosts,
|
|
8948
|
+
whatsNewUnreadCount,
|
|
8901
8949
|
refreshMessages,
|
|
8902
8950
|
refreshConversations,
|
|
8903
8951
|
refreshFriends,
|
|
8904
8952
|
refreshPendingRequests,
|
|
8905
|
-
refreshSentFriendRequests
|
|
8953
|
+
refreshSentFriendRequests,
|
|
8954
|
+
refreshWhatsNew
|
|
8906
8955
|
}),
|
|
8907
|
-
[status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, sentFriendRequests, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]
|
|
8956
|
+
[status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, sentFriendRequests, whatsNewPosts, whatsNewUnreadCount, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests, refreshWhatsNew]
|
|
8908
8957
|
);
|
|
8909
8958
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatContext.Provider, { value, children });
|
|
8910
8959
|
}
|
|
@@ -9150,6 +9199,47 @@ function useRespondToFriendRequest() {
|
|
|
9150
9199
|
);
|
|
9151
9200
|
return { accept, reject, loading };
|
|
9152
9201
|
}
|
|
9202
|
+
function useWhatsNew() {
|
|
9203
|
+
const { client } = useDubs();
|
|
9204
|
+
const { whatsNewPosts, whatsNewUnreadCount, refreshWhatsNew } = useChatContext();
|
|
9205
|
+
const [loading, setLoading] = (0, import_react50.useState)(false);
|
|
9206
|
+
const refetch = (0, import_react50.useCallback)(async () => {
|
|
9207
|
+
setLoading(true);
|
|
9208
|
+
try {
|
|
9209
|
+
await refreshWhatsNew();
|
|
9210
|
+
} finally {
|
|
9211
|
+
setLoading(false);
|
|
9212
|
+
}
|
|
9213
|
+
}, [refreshWhatsNew]);
|
|
9214
|
+
const markRead = (0, import_react50.useCallback)(
|
|
9215
|
+
async (postIds) => {
|
|
9216
|
+
if (postIds.length === 0) return;
|
|
9217
|
+
try {
|
|
9218
|
+
await client.markWhatsNewRead(postIds);
|
|
9219
|
+
await refreshWhatsNew();
|
|
9220
|
+
} catch (err) {
|
|
9221
|
+
console.error("[Dubs:useWhatsNew] markRead error:", err);
|
|
9222
|
+
}
|
|
9223
|
+
},
|
|
9224
|
+
[client, refreshWhatsNew]
|
|
9225
|
+
);
|
|
9226
|
+
const markAllRead = (0, import_react50.useCallback)(async () => {
|
|
9227
|
+
try {
|
|
9228
|
+
await client.markAllWhatsNewRead();
|
|
9229
|
+
await refreshWhatsNew();
|
|
9230
|
+
} catch (err) {
|
|
9231
|
+
console.error("[Dubs:useWhatsNew] markAllRead error:", err);
|
|
9232
|
+
}
|
|
9233
|
+
}, [client, refreshWhatsNew]);
|
|
9234
|
+
return {
|
|
9235
|
+
posts: whatsNewPosts,
|
|
9236
|
+
unreadCount: whatsNewUnreadCount,
|
|
9237
|
+
loading,
|
|
9238
|
+
refetch,
|
|
9239
|
+
markRead,
|
|
9240
|
+
markAllRead
|
|
9241
|
+
};
|
|
9242
|
+
}
|
|
9153
9243
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9154
9244
|
0 && (module.exports = {
|
|
9155
9245
|
ArcadeLeaderboardSheet,
|
|
@@ -9234,6 +9324,7 @@ function useRespondToFriendRequest() {
|
|
|
9234
9324
|
useShorts,
|
|
9235
9325
|
useUFCFightCard,
|
|
9236
9326
|
useUFCFighterDetail,
|
|
9237
|
-
useUnreadCount
|
|
9327
|
+
useUnreadCount,
|
|
9328
|
+
useWhatsNew
|
|
9238
9329
|
});
|
|
9239
9330
|
//# sourceMappingURL=index.js.map
|