@dubsdotapp/expo 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +46 -30
- package/dist/index.d.ts +46 -30
- package/dist/index.js +54 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -189
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useArcadeBridge.ts +9 -4
- package/src/index.ts +1 -1
- package/src/ui/AuthGate.tsx +27 -0
- package/src/ui/ConnectWalletButton.tsx +74 -79
- package/src/ui/game/EnterArcadePoolSheet.tsx +3 -2
- package/src/ui/index.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -678,6 +678,14 @@ interface RegistrationScreenProps {
|
|
|
678
678
|
error: Error | null;
|
|
679
679
|
client: DubsClient;
|
|
680
680
|
}
|
|
681
|
+
interface ConnectWalletScreenProps$1 {
|
|
682
|
+
/** Call this to trigger the wallet connection flow */
|
|
683
|
+
onConnect: () => void;
|
|
684
|
+
/** True while the wallet is connecting/signing */
|
|
685
|
+
connecting: boolean;
|
|
686
|
+
/** Error from a failed connection attempt */
|
|
687
|
+
error: Error | null;
|
|
688
|
+
}
|
|
681
689
|
interface AuthGateProps {
|
|
682
690
|
children: React$1.ReactNode;
|
|
683
691
|
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
@@ -685,11 +693,17 @@ interface AuthGateProps {
|
|
|
685
693
|
renderLoading?: (status: AuthStatus) => React$1.ReactNode;
|
|
686
694
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
687
695
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
696
|
+
/**
|
|
697
|
+
* Render your own connect-wallet screen.
|
|
698
|
+
* Receives { onConnect, connecting, error }.
|
|
699
|
+
* If omitted, the default ConnectWalletScreen is shown.
|
|
700
|
+
*/
|
|
701
|
+
renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
|
|
688
702
|
appName?: string;
|
|
689
703
|
/** Override accent color for registration screens (from developer UI config) */
|
|
690
704
|
accentColor?: string;
|
|
691
705
|
}
|
|
692
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
706
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, renderConnectWallet, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
693
707
|
|
|
694
708
|
interface ConnectWalletScreenProps {
|
|
695
709
|
/** Called when the user taps Connect Wallet */
|
|
@@ -1169,40 +1183,42 @@ interface UseArcadeBridgeResult {
|
|
|
1169
1183
|
declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
|
|
1170
1184
|
|
|
1171
1185
|
interface ConnectWalletButtonProps {
|
|
1172
|
-
/**
|
|
1173
|
-
onConnect: () => void | Promise<void>;
|
|
1174
|
-
/** Show a loading spinner while connecting */
|
|
1175
|
-
connecting?: boolean;
|
|
1176
|
-
/** Error message to display below the button */
|
|
1177
|
-
error?: string | null;
|
|
1178
|
-
/** Override accent color (e.g. from developer UI config) */
|
|
1179
|
-
accentColor?: string;
|
|
1180
|
-
/** Override button label. Defaults to "Connect Wallet" */
|
|
1186
|
+
/** Button label. Defaults to "Connect Wallet" */
|
|
1181
1187
|
label?: string;
|
|
1182
|
-
/**
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
|
|
1188
|
+
/** Override accent/background color */
|
|
1189
|
+
accentColor?: string;
|
|
1190
|
+
/** Override text color. Defaults to #000 */
|
|
1191
|
+
textColor?: string;
|
|
1192
|
+
/** Override border radius */
|
|
1193
|
+
borderRadius?: number;
|
|
1194
|
+
/** Override padding vertical */
|
|
1195
|
+
paddingVertical?: number;
|
|
1196
|
+
/** Override font size */
|
|
1197
|
+
fontSize?: number;
|
|
1198
|
+
/** Full width. Defaults to true */
|
|
1199
|
+
fullWidth?: boolean;
|
|
1200
|
+
/** Called after authenticate() is triggered (not after it completes) */
|
|
1201
|
+
onPress?: () => void;
|
|
1186
1202
|
}
|
|
1187
1203
|
/**
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1204
|
+
* ConnectWalletButton
|
|
1205
|
+
*
|
|
1206
|
+
* A minimal, customisable button that fires useAuth().authenticate().
|
|
1207
|
+
* Use this when you want to own the connect-wallet screen UI (e.g. inside
|
|
1208
|
+
* your own onboarding) but still hand off the wallet picker, signing, and
|
|
1209
|
+
* registration flow to the SDK.
|
|
1191
1210
|
*
|
|
1192
|
-
*
|
|
1193
|
-
*
|
|
1211
|
+
* The SDK will handle everything after this tap:
|
|
1212
|
+
* wallet picker → sign message → (registration/avatar if new user) → authenticated
|
|
1194
1213
|
*
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
* )}
|
|
1202
|
-
* >
|
|
1203
|
-
* ```
|
|
1214
|
+
* Example:
|
|
1215
|
+
* <ConnectWalletButton
|
|
1216
|
+
* label="Let's go"
|
|
1217
|
+
* accentColor="#22C55E"
|
|
1218
|
+
* textColor="#000"
|
|
1219
|
+
* />
|
|
1204
1220
|
*/
|
|
1205
|
-
declare function ConnectWalletButton({
|
|
1221
|
+
declare function ConnectWalletButton({ label, accentColor, textColor, borderRadius, paddingVertical, fontSize, fullWidth, onPress, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
|
|
1206
1222
|
|
|
1207
1223
|
interface UserProfileCardProps {
|
|
1208
1224
|
walletAddress: string;
|
|
@@ -1428,4 +1444,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
1428
1444
|
*/
|
|
1429
1445
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1430
1446
|
|
|
1431
|
-
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
|
1447
|
+
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type ConnectWalletScreenProps$1 as AuthGateConnectWalletProps, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.d.ts
CHANGED
|
@@ -678,6 +678,14 @@ interface RegistrationScreenProps {
|
|
|
678
678
|
error: Error | null;
|
|
679
679
|
client: DubsClient;
|
|
680
680
|
}
|
|
681
|
+
interface ConnectWalletScreenProps$1 {
|
|
682
|
+
/** Call this to trigger the wallet connection flow */
|
|
683
|
+
onConnect: () => void;
|
|
684
|
+
/** True while the wallet is connecting/signing */
|
|
685
|
+
connecting: boolean;
|
|
686
|
+
/** Error from a failed connection attempt */
|
|
687
|
+
error: Error | null;
|
|
688
|
+
}
|
|
681
689
|
interface AuthGateProps {
|
|
682
690
|
children: React$1.ReactNode;
|
|
683
691
|
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
@@ -685,11 +693,17 @@ interface AuthGateProps {
|
|
|
685
693
|
renderLoading?: (status: AuthStatus) => React$1.ReactNode;
|
|
686
694
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
687
695
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
696
|
+
/**
|
|
697
|
+
* Render your own connect-wallet screen.
|
|
698
|
+
* Receives { onConnect, connecting, error }.
|
|
699
|
+
* If omitted, the default ConnectWalletScreen is shown.
|
|
700
|
+
*/
|
|
701
|
+
renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
|
|
688
702
|
appName?: string;
|
|
689
703
|
/** Override accent color for registration screens (from developer UI config) */
|
|
690
704
|
accentColor?: string;
|
|
691
705
|
}
|
|
692
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
706
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, renderConnectWallet, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
693
707
|
|
|
694
708
|
interface ConnectWalletScreenProps {
|
|
695
709
|
/** Called when the user taps Connect Wallet */
|
|
@@ -1169,40 +1183,42 @@ interface UseArcadeBridgeResult {
|
|
|
1169
1183
|
declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onPlayStarted, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
|
|
1170
1184
|
|
|
1171
1185
|
interface ConnectWalletButtonProps {
|
|
1172
|
-
/**
|
|
1173
|
-
onConnect: () => void | Promise<void>;
|
|
1174
|
-
/** Show a loading spinner while connecting */
|
|
1175
|
-
connecting?: boolean;
|
|
1176
|
-
/** Error message to display below the button */
|
|
1177
|
-
error?: string | null;
|
|
1178
|
-
/** Override accent color (e.g. from developer UI config) */
|
|
1179
|
-
accentColor?: string;
|
|
1180
|
-
/** Override button label. Defaults to "Connect Wallet" */
|
|
1186
|
+
/** Button label. Defaults to "Connect Wallet" */
|
|
1181
1187
|
label?: string;
|
|
1182
|
-
/**
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
|
|
1188
|
+
/** Override accent/background color */
|
|
1189
|
+
accentColor?: string;
|
|
1190
|
+
/** Override text color. Defaults to #000 */
|
|
1191
|
+
textColor?: string;
|
|
1192
|
+
/** Override border radius */
|
|
1193
|
+
borderRadius?: number;
|
|
1194
|
+
/** Override padding vertical */
|
|
1195
|
+
paddingVertical?: number;
|
|
1196
|
+
/** Override font size */
|
|
1197
|
+
fontSize?: number;
|
|
1198
|
+
/** Full width. Defaults to true */
|
|
1199
|
+
fullWidth?: boolean;
|
|
1200
|
+
/** Called after authenticate() is triggered (not after it completes) */
|
|
1201
|
+
onPress?: () => void;
|
|
1186
1202
|
}
|
|
1187
1203
|
/**
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1204
|
+
* ConnectWalletButton
|
|
1205
|
+
*
|
|
1206
|
+
* A minimal, customisable button that fires useAuth().authenticate().
|
|
1207
|
+
* Use this when you want to own the connect-wallet screen UI (e.g. inside
|
|
1208
|
+
* your own onboarding) but still hand off the wallet picker, signing, and
|
|
1209
|
+
* registration flow to the SDK.
|
|
1191
1210
|
*
|
|
1192
|
-
*
|
|
1193
|
-
*
|
|
1211
|
+
* The SDK will handle everything after this tap:
|
|
1212
|
+
* wallet picker → sign message → (registration/avatar if new user) → authenticated
|
|
1194
1213
|
*
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
* )}
|
|
1202
|
-
* >
|
|
1203
|
-
* ```
|
|
1214
|
+
* Example:
|
|
1215
|
+
* <ConnectWalletButton
|
|
1216
|
+
* label="Let's go"
|
|
1217
|
+
* accentColor="#22C55E"
|
|
1218
|
+
* textColor="#000"
|
|
1219
|
+
* />
|
|
1204
1220
|
*/
|
|
1205
|
-
declare function ConnectWalletButton({
|
|
1221
|
+
declare function ConnectWalletButton({ label, accentColor, textColor, borderRadius, paddingVertical, fontSize, fullWidth, onPress, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
|
|
1206
1222
|
|
|
1207
1223
|
interface UserProfileCardProps {
|
|
1208
1224
|
walletAddress: string;
|
|
@@ -1428,4 +1444,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
1428
1444
|
*/
|
|
1429
1445
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1430
1446
|
|
|
1431
|
-
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
|
1447
|
+
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolResult, type ArcadePoolStats, AuthGate, type ConnectWalletScreenProps$1 as AuthGateConnectWalletProps, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.js
CHANGED
|
@@ -2869,6 +2869,8 @@ function useArcadeBridge({
|
|
|
2869
2869
|
const webviewRef = (0, import_react22.useRef)(null);
|
|
2870
2870
|
const sessionTokenRef = (0, import_react22.useRef)(null);
|
|
2871
2871
|
const gameStartTimeRef = (0, import_react22.useRef)(0);
|
|
2872
|
+
const canPlayRef = (0, import_react22.useRef)(canPlay);
|
|
2873
|
+
canPlayRef.current = canPlay;
|
|
2872
2874
|
const [lastResult, setLastResult] = (0, import_react22.useState)(null);
|
|
2873
2875
|
const [bridgeLoading, setBridgeLoading] = (0, import_react22.useState)(false);
|
|
2874
2876
|
const injectSession = (0, import_react22.useCallback)((token, attemptNumber) => {
|
|
@@ -2905,10 +2907,10 @@ function useArcadeBridge({
|
|
|
2905
2907
|
} catch {
|
|
2906
2908
|
return;
|
|
2907
2909
|
}
|
|
2908
|
-
if (data.dubsArcade !== PROTOCOL_VERSION) return;
|
|
2910
|
+
if (data.dubsArcade !== void 0 && data.dubsArcade !== PROTOCOL_VERSION) return;
|
|
2909
2911
|
switch (data.type) {
|
|
2910
2912
|
case "TAP_PLAY": {
|
|
2911
|
-
if (
|
|
2913
|
+
if (canPlayRef.current) {
|
|
2912
2914
|
triggerPlay();
|
|
2913
2915
|
}
|
|
2914
2916
|
return;
|
|
@@ -2937,7 +2939,7 @@ function useArcadeBridge({
|
|
|
2937
2939
|
return;
|
|
2938
2940
|
}
|
|
2939
2941
|
},
|
|
2940
|
-
[
|
|
2942
|
+
[triggerPlay, submitScore, onScoreSubmitted, onError]
|
|
2941
2943
|
);
|
|
2942
2944
|
return { webviewRef, handleMessage, triggerPlay, lastResult, bridgeLoading };
|
|
2943
2945
|
}
|
|
@@ -3097,6 +3099,7 @@ function AuthGate({
|
|
|
3097
3099
|
renderLoading,
|
|
3098
3100
|
renderError,
|
|
3099
3101
|
renderRegistration,
|
|
3102
|
+
renderConnectWallet,
|
|
3100
3103
|
appName = "Dubs",
|
|
3101
3104
|
accentColor
|
|
3102
3105
|
}) {
|
|
@@ -3197,6 +3200,14 @@ function AuthGate({
|
|
|
3197
3200
|
if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderError(auth.error, retry) });
|
|
3198
3201
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
|
|
3199
3202
|
}
|
|
3203
|
+
if (auth.status === "idle") {
|
|
3204
|
+
const connectProps = {
|
|
3205
|
+
onConnect: auth.authenticate,
|
|
3206
|
+
connecting: false,
|
|
3207
|
+
error: null
|
|
3208
|
+
};
|
|
3209
|
+
if (renderConnectWallet) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderConnectWallet(connectProps) });
|
|
3210
|
+
}
|
|
3200
3211
|
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading(auth.status) });
|
|
3201
3212
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
3202
3213
|
}
|
|
@@ -3899,62 +3910,52 @@ function useAppConfig() {
|
|
|
3899
3910
|
var import_react_native9 = require("react-native");
|
|
3900
3911
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3901
3912
|
function ConnectWalletButton({
|
|
3902
|
-
onConnect,
|
|
3903
|
-
connecting = false,
|
|
3904
|
-
error = null,
|
|
3905
|
-
accentColor,
|
|
3906
3913
|
label = "Connect Wallet",
|
|
3907
|
-
|
|
3908
|
-
|
|
3914
|
+
accentColor,
|
|
3915
|
+
textColor = "#000000",
|
|
3916
|
+
borderRadius = 16,
|
|
3917
|
+
paddingVertical = 16,
|
|
3918
|
+
fontSize = 17,
|
|
3919
|
+
fullWidth = true,
|
|
3920
|
+
onPress
|
|
3909
3921
|
}) {
|
|
3910
3922
|
const t = useDubsTheme();
|
|
3923
|
+
const { authenticate, status } = useAuth();
|
|
3924
|
+
const connecting = status === "authenticating" || status === "signing" || status === "verifying";
|
|
3911
3925
|
const accent = accentColor || t.accent;
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3926
|
+
const handlePress = () => {
|
|
3927
|
+
onPress?.();
|
|
3928
|
+
authenticate();
|
|
3929
|
+
};
|
|
3930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3931
|
+
import_react_native9.TouchableOpacity,
|
|
3932
|
+
{
|
|
3933
|
+
onPress: handlePress,
|
|
3934
|
+
disabled: connecting,
|
|
3935
|
+
activeOpacity: 0.85,
|
|
3936
|
+
style: [
|
|
3937
|
+
styles3.btn,
|
|
3938
|
+
{
|
|
3939
|
+
backgroundColor: accent,
|
|
3940
|
+
borderRadius,
|
|
3941
|
+
paddingVertical,
|
|
3942
|
+
width: fullWidth ? "100%" : void 0,
|
|
3943
|
+
opacity: connecting ? 0.8 : 1
|
|
3944
|
+
}
|
|
3945
|
+
],
|
|
3946
|
+
children: connecting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.ActivityIndicator, { color: textColor, size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.label, { color: textColor, fontSize }], children: label })
|
|
3947
|
+
}
|
|
3948
|
+
);
|
|
3934
3949
|
}
|
|
3935
3950
|
var styles3 = import_react_native9.StyleSheet.create({
|
|
3936
|
-
|
|
3937
|
-
height: 56,
|
|
3938
|
-
borderRadius: 16,
|
|
3939
|
-
justifyContent: "center",
|
|
3951
|
+
btn: {
|
|
3940
3952
|
alignItems: "center",
|
|
3953
|
+
justifyContent: "center",
|
|
3941
3954
|
paddingHorizontal: 24
|
|
3942
3955
|
},
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
fontWeight: "700"
|
|
3947
|
-
},
|
|
3948
|
-
errorBox: {
|
|
3949
|
-
borderWidth: 1,
|
|
3950
|
-
borderRadius: 12,
|
|
3951
|
-
paddingHorizontal: 16,
|
|
3952
|
-
paddingVertical: 12,
|
|
3953
|
-
marginBottom: 12
|
|
3954
|
-
},
|
|
3955
|
-
errorText: {
|
|
3956
|
-
fontSize: 14,
|
|
3957
|
-
textAlign: "center"
|
|
3956
|
+
label: {
|
|
3957
|
+
fontWeight: "800",
|
|
3958
|
+
letterSpacing: -0.2
|
|
3958
3959
|
}
|
|
3959
3960
|
});
|
|
3960
3961
|
|
|
@@ -6199,9 +6200,10 @@ function EnterArcadePoolSheet({
|
|
|
6199
6200
|
}
|
|
6200
6201
|
}, [mutation.status, mutation.error]);
|
|
6201
6202
|
const buyInSol = (pool.buy_in_lamports / 1e9).toFixed(4);
|
|
6202
|
-
const totalPlayers = stats?.total_entries ??
|
|
6203
|
+
const totalPlayers = stats?.total_entries ?? 0;
|
|
6204
|
+
const totalBuyIns = pool.total_entries ?? totalPlayers;
|
|
6203
6205
|
const topScore = stats?.top_score ?? 0;
|
|
6204
|
-
const potSol = (pool.buy_in_lamports * Number(
|
|
6206
|
+
const potSol = (pool.buy_in_lamports * Number(totalBuyIns) / 1e9).toFixed(4);
|
|
6205
6207
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
6206
6208
|
const canJoin = !isMutating && mutation.status !== "success";
|
|
6207
6209
|
const handleJoin = (0, import_react36.useCallback)(async () => {
|