@dubsdotapp/expo 0.5.22 → 0.5.24
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 +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +76 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/hooks.ts +44 -0
- package/src/chat/index.ts +3 -0
- package/src/chat/provider.tsx +41 -8
- package/src/chat/socket.ts +3 -0
- package/src/chat/types.ts +10 -0
- package/src/client.ts +10 -0
- package/src/index.ts +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -750,6 +750,12 @@ declare class DubsClient {
|
|
|
750
750
|
getPendingFriendRequests(): Promise<{
|
|
751
751
|
requests: any[];
|
|
752
752
|
}>;
|
|
753
|
+
/** Get pending friend requests this user has sent (still awaiting response) */
|
|
754
|
+
getSentFriendRequests(): Promise<{
|
|
755
|
+
requests: any[];
|
|
756
|
+
}>;
|
|
757
|
+
/** Cancel a pending friend request the user previously sent */
|
|
758
|
+
cancelFriendRequest(requestId: number): Promise<void>;
|
|
753
759
|
/** Accept a friend request */
|
|
754
760
|
acceptFriendRequest(requestId: number): Promise<void>;
|
|
755
761
|
/** Reject a friend request */
|
|
@@ -1843,6 +1849,15 @@ interface FriendRequest {
|
|
|
1843
1849
|
fromWallet: string;
|
|
1844
1850
|
createdAt: string;
|
|
1845
1851
|
}
|
|
1852
|
+
/** A friend request the current user has SENT (still pending). */
|
|
1853
|
+
interface SentFriendRequest {
|
|
1854
|
+
id: number;
|
|
1855
|
+
toUserId: number;
|
|
1856
|
+
toUsername: string;
|
|
1857
|
+
toAvatar: string | null;
|
|
1858
|
+
toWallet: string;
|
|
1859
|
+
createdAt: string;
|
|
1860
|
+
}
|
|
1846
1861
|
interface OnlineUser {
|
|
1847
1862
|
walletAddress: string;
|
|
1848
1863
|
username: string;
|
|
@@ -1935,6 +1950,11 @@ interface ChatSocketListeners {
|
|
|
1935
1950
|
requestId: number;
|
|
1936
1951
|
declinedBy: number;
|
|
1937
1952
|
}) => void;
|
|
1953
|
+
/** Recipient-side: the original sender cancelled a pending friend request */
|
|
1954
|
+
onFriendRequestCancelled?: (data: {
|
|
1955
|
+
requestId: number;
|
|
1956
|
+
cancelledBy: number;
|
|
1957
|
+
}) => void;
|
|
1938
1958
|
onFriendRemoved?: (data: {
|
|
1939
1959
|
removedBy: number;
|
|
1940
1960
|
}) => void;
|
|
@@ -1991,16 +2011,20 @@ interface ChatContextValue {
|
|
|
1991
2011
|
conversations: Conversation[];
|
|
1992
2012
|
/** Friends list */
|
|
1993
2013
|
friends: FriendUser[];
|
|
1994
|
-
/** Pending friend requests */
|
|
2014
|
+
/** Pending friend requests (received) */
|
|
1995
2015
|
pendingRequests: FriendRequest[];
|
|
2016
|
+
/** Pending friend requests this user has sent (still awaiting response) */
|
|
2017
|
+
sentFriendRequests: SentFriendRequest[];
|
|
1996
2018
|
/** Reload messages from REST */
|
|
1997
2019
|
refreshMessages: () => Promise<void>;
|
|
1998
2020
|
/** Reload conversations from REST */
|
|
1999
2021
|
refreshConversations: () => Promise<void>;
|
|
2000
2022
|
/** Reload friends from REST */
|
|
2001
2023
|
refreshFriends: () => Promise<void>;
|
|
2002
|
-
/** Reload pending friend requests from REST */
|
|
2024
|
+
/** Reload pending friend requests (received) from REST */
|
|
2003
2025
|
refreshPendingRequests: () => Promise<void>;
|
|
2026
|
+
/** Reload pending friend requests (sent) from REST */
|
|
2027
|
+
refreshSentFriendRequests: () => Promise<void>;
|
|
2004
2028
|
}
|
|
2005
2029
|
interface ChatProviderProps {
|
|
2006
2030
|
children: React$1.ReactNode;
|
|
@@ -2071,6 +2095,17 @@ declare function useFriendRequests(): {
|
|
|
2071
2095
|
loading: boolean;
|
|
2072
2096
|
refetch: () => Promise<void>;
|
|
2073
2097
|
};
|
|
2098
|
+
/** Get pending friend requests this user has SENT (still awaiting response). */
|
|
2099
|
+
declare function useSentFriendRequests(): {
|
|
2100
|
+
requests: SentFriendRequest[];
|
|
2101
|
+
loading: boolean;
|
|
2102
|
+
refetch: () => Promise<void>;
|
|
2103
|
+
};
|
|
2104
|
+
/** Cancel a pending friend request the current user previously sent. */
|
|
2105
|
+
declare function useCancelFriendRequest(): {
|
|
2106
|
+
cancel: (requestId: number) => Promise<void>;
|
|
2107
|
+
loading: boolean;
|
|
2108
|
+
};
|
|
2074
2109
|
/** Search for users by username */
|
|
2075
2110
|
declare function useSearchUsers(): {
|
|
2076
2111
|
results: FriendUser[];
|
|
@@ -2105,4 +2140,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
2105
2140
|
*/
|
|
2106
2141
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
2107
2142
|
|
|
2108
|
-
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, 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, 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, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -750,6 +750,12 @@ declare class DubsClient {
|
|
|
750
750
|
getPendingFriendRequests(): Promise<{
|
|
751
751
|
requests: any[];
|
|
752
752
|
}>;
|
|
753
|
+
/** Get pending friend requests this user has sent (still awaiting response) */
|
|
754
|
+
getSentFriendRequests(): Promise<{
|
|
755
|
+
requests: any[];
|
|
756
|
+
}>;
|
|
757
|
+
/** Cancel a pending friend request the user previously sent */
|
|
758
|
+
cancelFriendRequest(requestId: number): Promise<void>;
|
|
753
759
|
/** Accept a friend request */
|
|
754
760
|
acceptFriendRequest(requestId: number): Promise<void>;
|
|
755
761
|
/** Reject a friend request */
|
|
@@ -1843,6 +1849,15 @@ interface FriendRequest {
|
|
|
1843
1849
|
fromWallet: string;
|
|
1844
1850
|
createdAt: string;
|
|
1845
1851
|
}
|
|
1852
|
+
/** A friend request the current user has SENT (still pending). */
|
|
1853
|
+
interface SentFriendRequest {
|
|
1854
|
+
id: number;
|
|
1855
|
+
toUserId: number;
|
|
1856
|
+
toUsername: string;
|
|
1857
|
+
toAvatar: string | null;
|
|
1858
|
+
toWallet: string;
|
|
1859
|
+
createdAt: string;
|
|
1860
|
+
}
|
|
1846
1861
|
interface OnlineUser {
|
|
1847
1862
|
walletAddress: string;
|
|
1848
1863
|
username: string;
|
|
@@ -1935,6 +1950,11 @@ interface ChatSocketListeners {
|
|
|
1935
1950
|
requestId: number;
|
|
1936
1951
|
declinedBy: number;
|
|
1937
1952
|
}) => void;
|
|
1953
|
+
/** Recipient-side: the original sender cancelled a pending friend request */
|
|
1954
|
+
onFriendRequestCancelled?: (data: {
|
|
1955
|
+
requestId: number;
|
|
1956
|
+
cancelledBy: number;
|
|
1957
|
+
}) => void;
|
|
1938
1958
|
onFriendRemoved?: (data: {
|
|
1939
1959
|
removedBy: number;
|
|
1940
1960
|
}) => void;
|
|
@@ -1991,16 +2011,20 @@ interface ChatContextValue {
|
|
|
1991
2011
|
conversations: Conversation[];
|
|
1992
2012
|
/** Friends list */
|
|
1993
2013
|
friends: FriendUser[];
|
|
1994
|
-
/** Pending friend requests */
|
|
2014
|
+
/** Pending friend requests (received) */
|
|
1995
2015
|
pendingRequests: FriendRequest[];
|
|
2016
|
+
/** Pending friend requests this user has sent (still awaiting response) */
|
|
2017
|
+
sentFriendRequests: SentFriendRequest[];
|
|
1996
2018
|
/** Reload messages from REST */
|
|
1997
2019
|
refreshMessages: () => Promise<void>;
|
|
1998
2020
|
/** Reload conversations from REST */
|
|
1999
2021
|
refreshConversations: () => Promise<void>;
|
|
2000
2022
|
/** Reload friends from REST */
|
|
2001
2023
|
refreshFriends: () => Promise<void>;
|
|
2002
|
-
/** Reload pending friend requests from REST */
|
|
2024
|
+
/** Reload pending friend requests (received) from REST */
|
|
2003
2025
|
refreshPendingRequests: () => Promise<void>;
|
|
2026
|
+
/** Reload pending friend requests (sent) from REST */
|
|
2027
|
+
refreshSentFriendRequests: () => Promise<void>;
|
|
2004
2028
|
}
|
|
2005
2029
|
interface ChatProviderProps {
|
|
2006
2030
|
children: React$1.ReactNode;
|
|
@@ -2071,6 +2095,17 @@ declare function useFriendRequests(): {
|
|
|
2071
2095
|
loading: boolean;
|
|
2072
2096
|
refetch: () => Promise<void>;
|
|
2073
2097
|
};
|
|
2098
|
+
/** Get pending friend requests this user has SENT (still awaiting response). */
|
|
2099
|
+
declare function useSentFriendRequests(): {
|
|
2100
|
+
requests: SentFriendRequest[];
|
|
2101
|
+
loading: boolean;
|
|
2102
|
+
refetch: () => Promise<void>;
|
|
2103
|
+
};
|
|
2104
|
+
/** Cancel a pending friend request the current user previously sent. */
|
|
2105
|
+
declare function useCancelFriendRequest(): {
|
|
2106
|
+
cancel: (requestId: number) => Promise<void>;
|
|
2107
|
+
loading: boolean;
|
|
2108
|
+
};
|
|
2074
2109
|
/** Search for users by username */
|
|
2075
2110
|
declare function useSearchUsers(): {
|
|
2076
2111
|
results: FriendUser[];
|
|
@@ -2105,4 +2140,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
2105
2140
|
*/
|
|
2106
2141
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
2107
2142
|
|
|
2108
|
-
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, 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, 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, useShorts, useUFCFightCard, useUFCFighterDetail, useUnreadCount };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,7 @@ __export(index_exports, {
|
|
|
78
78
|
useArcadePool: () => useArcadePool,
|
|
79
79
|
useArcadePools: () => useArcadePools,
|
|
80
80
|
useAuth: () => useAuth,
|
|
81
|
+
useCancelFriendRequest: () => useCancelFriendRequest,
|
|
81
82
|
useChatContext: () => useChatContext,
|
|
82
83
|
useChatMessages: () => useChatMessages,
|
|
83
84
|
useChatStatus: () => useChatStatus,
|
|
@@ -107,6 +108,7 @@ __export(index_exports, {
|
|
|
107
108
|
useSearchUsers: () => useSearchUsers,
|
|
108
109
|
useSendFriendRequest: () => useSendFriendRequest,
|
|
109
110
|
useSendMessage: () => useSendMessage,
|
|
111
|
+
useSentFriendRequests: () => useSentFriendRequests,
|
|
110
112
|
useShorts: () => useShorts,
|
|
111
113
|
useUFCFightCard: () => useUFCFightCard,
|
|
112
114
|
useUFCFighterDetail: () => useUFCFighterDetail,
|
|
@@ -828,6 +830,14 @@ var DubsClient = class {
|
|
|
828
830
|
async getPendingFriendRequests() {
|
|
829
831
|
return this.request("GET", "/social/friend-requests");
|
|
830
832
|
}
|
|
833
|
+
/** Get pending friend requests this user has sent (still awaiting response) */
|
|
834
|
+
async getSentFriendRequests() {
|
|
835
|
+
return this.request("GET", "/social/friend-requests/sent");
|
|
836
|
+
}
|
|
837
|
+
/** Cancel a pending friend request the user previously sent */
|
|
838
|
+
async cancelFriendRequest(requestId) {
|
|
839
|
+
await this.request("DELETE", `/social/friend-request/${requestId}`);
|
|
840
|
+
}
|
|
831
841
|
/** Accept a friend request */
|
|
832
842
|
async acceptFriendRequest(requestId) {
|
|
833
843
|
await this.request("POST", `/social/request/${requestId}/accept`);
|
|
@@ -8703,6 +8713,7 @@ var ChatSocket = class {
|
|
|
8703
8713
|
this.socket.on("dm:messages_read", (data) => this.listeners.onDMMessagesRead?.(data));
|
|
8704
8714
|
this.socket.on("friend_request_accepted", (data) => this.listeners.onFriendRequestAccepted?.(data));
|
|
8705
8715
|
this.socket.on("friend_request_declined", (data) => this.listeners.onFriendRequestDeclined?.(data));
|
|
8716
|
+
this.socket.on("friend_request_cancelled", (data) => this.listeners.onFriendRequestCancelled?.(data));
|
|
8706
8717
|
this.socket.on("friend_removed", (data) => this.listeners.onFriendRemoved?.(data));
|
|
8707
8718
|
this.socket.on("error", (err) => this.listeners.onError?.(err));
|
|
8708
8719
|
}
|
|
@@ -8769,6 +8780,7 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8769
8780
|
const [conversations, setConversations] = (0, import_react49.useState)([]);
|
|
8770
8781
|
const [friends, setFriends] = (0, import_react49.useState)([]);
|
|
8771
8782
|
const [pendingRequests, setPendingRequests] = (0, import_react49.useState)([]);
|
|
8783
|
+
const [sentFriendRequests, setSentFriendRequests] = (0, import_react49.useState)([]);
|
|
8772
8784
|
const refreshMessages = (0, import_react49.useCallback)(async () => {
|
|
8773
8785
|
try {
|
|
8774
8786
|
const res = await client.getChatMessages({ limit: 30 });
|
|
@@ -8798,6 +8810,13 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8798
8810
|
} catch (_) {
|
|
8799
8811
|
}
|
|
8800
8812
|
}, [client]);
|
|
8813
|
+
const refreshSentFriendRequests = (0, import_react49.useCallback)(async () => {
|
|
8814
|
+
try {
|
|
8815
|
+
const res = await client.getSentFriendRequests();
|
|
8816
|
+
setSentFriendRequests(res.requests);
|
|
8817
|
+
} catch (_) {
|
|
8818
|
+
}
|
|
8819
|
+
}, [client]);
|
|
8801
8820
|
(0, import_react49.useEffect)(() => {
|
|
8802
8821
|
const token = client.getToken();
|
|
8803
8822
|
if (!autoConnect || !token) return;
|
|
@@ -8823,9 +8842,18 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8823
8842
|
onNotification: (n) => {
|
|
8824
8843
|
setUnreadCount((prev) => prev + 1);
|
|
8825
8844
|
if (n.type === "friend_request") refreshPendingRequests();
|
|
8826
|
-
if (n.type === "friend_request_accepted")
|
|
8845
|
+
if (n.type === "friend_request_accepted") {
|
|
8846
|
+
refreshFriends();
|
|
8847
|
+
refreshSentFriendRequests();
|
|
8848
|
+
}
|
|
8849
|
+
if (n.type === "friend_request_declined") refreshSentFriendRequests();
|
|
8850
|
+
},
|
|
8851
|
+
onFriendRequestAccepted: () => {
|
|
8852
|
+
refreshFriends();
|
|
8853
|
+
refreshSentFriendRequests();
|
|
8827
8854
|
},
|
|
8828
|
-
|
|
8855
|
+
onFriendRequestDeclined: () => refreshSentFriendRequests(),
|
|
8856
|
+
onFriendRequestCancelled: () => refreshPendingRequests(),
|
|
8829
8857
|
onFriendRemoved: () => refreshFriends()
|
|
8830
8858
|
});
|
|
8831
8859
|
chatSocket.connect({ host, token });
|
|
@@ -8834,10 +8862,12 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8834
8862
|
});
|
|
8835
8863
|
refreshPendingRequests().catch(() => {
|
|
8836
8864
|
});
|
|
8865
|
+
refreshSentFriendRequests().catch(() => {
|
|
8866
|
+
});
|
|
8837
8867
|
return () => {
|
|
8838
8868
|
chatSocket.disconnect();
|
|
8839
8869
|
};
|
|
8840
|
-
}, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests]);
|
|
8870
|
+
}, [client, autoConnect, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
|
|
8841
8871
|
(0, import_react49.useEffect)(() => {
|
|
8842
8872
|
const handleAppState = (nextState) => {
|
|
8843
8873
|
if (nextState === "active") {
|
|
@@ -8851,11 +8881,19 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8851
8881
|
}
|
|
8852
8882
|
}
|
|
8853
8883
|
refreshMessages();
|
|
8884
|
+
refreshConversations().catch(() => {
|
|
8885
|
+
});
|
|
8886
|
+
refreshFriends().catch(() => {
|
|
8887
|
+
});
|
|
8888
|
+
refreshPendingRequests().catch(() => {
|
|
8889
|
+
});
|
|
8890
|
+
refreshSentFriendRequests().catch(() => {
|
|
8891
|
+
});
|
|
8854
8892
|
}
|
|
8855
8893
|
};
|
|
8856
8894
|
const sub = import_react_native29.AppState.addEventListener("change", handleAppState);
|
|
8857
8895
|
return () => sub.remove();
|
|
8858
|
-
}, [client, refreshMessages, refreshConversations]);
|
|
8896
|
+
}, [client, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]);
|
|
8859
8897
|
const value = (0, import_react49.useMemo)(
|
|
8860
8898
|
() => ({
|
|
8861
8899
|
socket: socketRef.current,
|
|
@@ -8867,12 +8905,14 @@ function ChatProvider({ children, autoConnect = true }) {
|
|
|
8867
8905
|
conversations,
|
|
8868
8906
|
friends,
|
|
8869
8907
|
pendingRequests,
|
|
8908
|
+
sentFriendRequests,
|
|
8870
8909
|
refreshMessages,
|
|
8871
8910
|
refreshConversations,
|
|
8872
8911
|
refreshFriends,
|
|
8873
|
-
refreshPendingRequests
|
|
8912
|
+
refreshPendingRequests,
|
|
8913
|
+
refreshSentFriendRequests
|
|
8874
8914
|
}),
|
|
8875
|
-
[status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests]
|
|
8915
|
+
[status, messages, onlineUsers, onlineCount, unreadCount, conversations, friends, pendingRequests, sentFriendRequests, refreshMessages, refreshConversations, refreshFriends, refreshPendingRequests, refreshSentFriendRequests]
|
|
8876
8916
|
);
|
|
8877
8917
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChatContext.Provider, { value, children });
|
|
8878
8918
|
}
|
|
@@ -9022,6 +9062,34 @@ function useFriendRequests() {
|
|
|
9022
9062
|
}, [refreshPendingRequests]);
|
|
9023
9063
|
return { requests: pendingRequests, loading, refetch };
|
|
9024
9064
|
}
|
|
9065
|
+
function useSentFriendRequests() {
|
|
9066
|
+
const { sentFriendRequests, refreshSentFriendRequests } = useChatContext();
|
|
9067
|
+
const [loading, setLoading] = (0, import_react50.useState)(false);
|
|
9068
|
+
const refetch = (0, import_react50.useCallback)(async () => {
|
|
9069
|
+
setLoading(true);
|
|
9070
|
+
await refreshSentFriendRequests();
|
|
9071
|
+
setLoading(false);
|
|
9072
|
+
}, [refreshSentFriendRequests]);
|
|
9073
|
+
return { requests: sentFriendRequests, loading, refetch };
|
|
9074
|
+
}
|
|
9075
|
+
function useCancelFriendRequest() {
|
|
9076
|
+
const { client } = useDubs();
|
|
9077
|
+
const { refreshSentFriendRequests } = useChatContext();
|
|
9078
|
+
const [loading, setLoading] = (0, import_react50.useState)(false);
|
|
9079
|
+
const cancel = (0, import_react50.useCallback)(
|
|
9080
|
+
async (requestId) => {
|
|
9081
|
+
setLoading(true);
|
|
9082
|
+
try {
|
|
9083
|
+
await client.cancelFriendRequest(requestId);
|
|
9084
|
+
await refreshSentFriendRequests();
|
|
9085
|
+
} finally {
|
|
9086
|
+
setLoading(false);
|
|
9087
|
+
}
|
|
9088
|
+
},
|
|
9089
|
+
[client, refreshSentFriendRequests]
|
|
9090
|
+
);
|
|
9091
|
+
return { cancel, loading };
|
|
9092
|
+
}
|
|
9025
9093
|
function useSearchUsers() {
|
|
9026
9094
|
const { client } = useDubs();
|
|
9027
9095
|
const [results, setResults] = (0, import_react50.useState)([]);
|
|
@@ -9140,6 +9208,7 @@ function useRespondToFriendRequest() {
|
|
|
9140
9208
|
useArcadePool,
|
|
9141
9209
|
useArcadePools,
|
|
9142
9210
|
useAuth,
|
|
9211
|
+
useCancelFriendRequest,
|
|
9143
9212
|
useChatContext,
|
|
9144
9213
|
useChatMessages,
|
|
9145
9214
|
useChatStatus,
|
|
@@ -9169,6 +9238,7 @@ function useRespondToFriendRequest() {
|
|
|
9169
9238
|
useSearchUsers,
|
|
9170
9239
|
useSendFriendRequest,
|
|
9171
9240
|
useSendMessage,
|
|
9241
|
+
useSentFriendRequests,
|
|
9172
9242
|
useShorts,
|
|
9173
9243
|
useUFCFightCard,
|
|
9174
9244
|
useUFCFighterDetail,
|