@dubsdotapp/expo 0.2.4 → 0.2.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 CHANGED
@@ -468,6 +468,7 @@ interface DubsContextValue {
468
468
  appName: string;
469
469
  network: DubsNetwork;
470
470
  disconnect: () => Promise<void>;
471
+ uiConfig: UiConfig;
471
472
  }
472
473
  interface DubsProviderProps {
473
474
  apiKey: string;
@@ -495,6 +496,7 @@ interface DubsProviderProps {
495
496
  }
496
497
  declare function DubsProvider({ apiKey, children, appName, network, wallet: externalWallet, tokenStorage, baseUrl: baseUrlOverride, rpcUrl: rpcUrlOverride, renderConnectScreen, renderLoading, renderError, renderRegistration, managed, }: DubsProviderProps): react_jsx_runtime.JSX.Element | null;
497
498
  declare function useDubs(): DubsContextValue;
499
+ declare function useAppConfig(): UiConfig;
498
500
 
499
501
  /** The `transact` function signature from @solana-mobile/mobile-wallet-adapter-protocol-web3js */
500
502
  type MwaTransactFn = (callback: (wallet: any) => Promise<any>) => Promise<any>;
@@ -753,4 +755,4 @@ declare function JoinGameButton({ game, walletAddress, selectedTeam, status, onJ
753
755
  */
754
756
  declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
755
757
 
756
- export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
758
+ export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
package/dist/index.d.ts CHANGED
@@ -468,6 +468,7 @@ interface DubsContextValue {
468
468
  appName: string;
469
469
  network: DubsNetwork;
470
470
  disconnect: () => Promise<void>;
471
+ uiConfig: UiConfig;
471
472
  }
472
473
  interface DubsProviderProps {
473
474
  apiKey: string;
@@ -495,6 +496,7 @@ interface DubsProviderProps {
495
496
  }
496
497
  declare function DubsProvider({ apiKey, children, appName, network, wallet: externalWallet, tokenStorage, baseUrl: baseUrlOverride, rpcUrl: rpcUrlOverride, renderConnectScreen, renderLoading, renderError, renderRegistration, managed, }: DubsProviderProps): react_jsx_runtime.JSX.Element | null;
497
498
  declare function useDubs(): DubsContextValue;
499
+ declare function useAppConfig(): UiConfig;
498
500
 
499
501
  /** The `transact` function signature from @solana-mobile/mobile-wallet-adapter-protocol-web3js */
500
502
  type MwaTransactFn = (callback: (wallet: any) => Promise<any>) => Promise<any>;
@@ -753,4 +755,4 @@ declare function JoinGameButton({ game, walletAddress, selectedTeam, status, onJ
753
755
  */
754
756
  declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
755
757
 
756
- export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
758
+ export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ __export(index_exports, {
52
52
  mergeTheme: () => mergeTheme,
53
53
  parseSolanaError: () => parseSolanaError,
54
54
  signAndSendBase64Transaction: () => signAndSendBase64Transaction,
55
+ useAppConfig: () => useAppConfig,
55
56
  useAuth: () => useAuth,
56
57
  useClaim: () => useClaim,
57
58
  useCreateGame: () => useCreateGame,
@@ -1404,7 +1405,7 @@ function AuthGate({
1404
1405
  );
1405
1406
  if (phase === "init") {
1406
1407
  if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: renderLoading("authenticating") });
1407
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultLoadingScreen, { status: "authenticating", appName });
1408
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultLoadingScreen, { status: "authenticating", appName, accentColor });
1408
1409
  }
1409
1410
  if (auth.status === "authenticated") {
1410
1411
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AuthContext.Provider, { value: auth, children });
@@ -1429,13 +1430,14 @@ function AuthGate({
1429
1430
  }
1430
1431
  if (auth.status === "error" && auth.error) {
1431
1432
  if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: renderError(auth.error, retry) });
1432
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName });
1433
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
1433
1434
  }
1434
1435
  if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: renderLoading(auth.status) });
1435
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultLoadingScreen, { status: auth.status, appName });
1436
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
1436
1437
  }
1437
- function DefaultLoadingScreen({ status, appName }) {
1438
+ function DefaultLoadingScreen({ status, appName, accentColor }) {
1438
1439
  const t = useDubsTheme();
1440
+ const accent = accentColor || t.accent;
1439
1441
  const statusText = {
1440
1442
  idle: "Initializing...",
1441
1443
  authenticating: "Connecting...",
@@ -1448,25 +1450,26 @@ function DefaultLoadingScreen({ status, appName }) {
1448
1450
  };
1449
1451
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: s.centerContent, children: [
1450
1452
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: s.brandingSection, children: [
1451
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.logoCircle, { backgroundColor: t.accent }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.logoText, children: "D" }) }),
1453
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.logoText, children: "D" }) }),
1452
1454
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.appNameText, { color: t.text }], children: appName })
1453
1455
  ] }),
1454
1456
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: s.loadingSection, children: [
1455
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.ActivityIndicator, { size: "large", color: t.accent }),
1457
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.ActivityIndicator, { size: "large", color: accent }),
1456
1458
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.statusText, { color: t.textMuted }], children: statusText[status] || "Loading..." })
1457
1459
  ] })
1458
1460
  ] }) });
1459
1461
  }
1460
- function DefaultErrorScreen({ error, onRetry, appName }) {
1462
+ function DefaultErrorScreen({ error, onRetry, appName, accentColor }) {
1461
1463
  const t = useDubsTheme();
1464
+ const accent = accentColor || t.accent;
1462
1465
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: s.spreadContent, children: [
1463
1466
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: s.brandingSection, children: [
1464
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.logoCircle, { backgroundColor: t.accent }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.logoText, children: "D" }) }),
1467
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.logoText, children: "D" }) }),
1465
1468
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.appNameText, { color: t.text }], children: appName })
1466
1469
  ] }),
1467
1470
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: { gap: 16 }, children: [
1468
1471
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.errorText, { color: t.errorText }], children: error.message }) }),
1469
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.TouchableOpacity, { style: [s.primaryBtn, { backgroundColor: t.accent }], onPress: onRetry, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.primaryBtnText, children: "Try Again" }) })
1472
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.TouchableOpacity, { style: [s.primaryBtn, { backgroundColor: accent }], onPress: onRetry, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.primaryBtnText, children: "Try Again" }) })
1470
1473
  ] })
1471
1474
  ] }) });
1472
1475
  }
@@ -1880,6 +1883,7 @@ function DubsProvider({
1880
1883
  renderError,
1881
1884
  renderRegistration,
1882
1885
  accentColor: uiConfig.accentColor,
1886
+ uiConfig,
1883
1887
  children
1884
1888
  }
1885
1889
  );
@@ -1907,6 +1911,7 @@ function DubsProvider({
1907
1911
  renderError,
1908
1912
  renderRegistration,
1909
1913
  accentColor: uiConfig.accentColor,
1914
+ uiConfig,
1910
1915
  children
1911
1916
  }
1912
1917
  )
@@ -1924,6 +1929,7 @@ function ManagedInner({
1924
1929
  renderError,
1925
1930
  renderRegistration,
1926
1931
  accentColor,
1932
+ uiConfig,
1927
1933
  children
1928
1934
  }) {
1929
1935
  const managedDisconnect = useDisconnect();
@@ -1932,8 +1938,8 @@ function ManagedInner({
1932
1938
  await managedDisconnect?.();
1933
1939
  }, [client, managedDisconnect]);
1934
1940
  const value = (0, import_react12.useMemo)(
1935
- () => ({ client, wallet, connection, appName, network, disconnect }),
1936
- [client, wallet, connection, appName, network, disconnect]
1941
+ () => ({ client, wallet, connection, appName, network, disconnect, uiConfig }),
1942
+ [client, wallet, connection, appName, network, disconnect, uiConfig]
1937
1943
  );
1938
1944
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DubsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1939
1945
  AuthGate,
@@ -1964,6 +1970,7 @@ function ExternalWalletProvider({
1964
1970
  renderError,
1965
1971
  renderRegistration,
1966
1972
  accentColor,
1973
+ uiConfig,
1967
1974
  children
1968
1975
  }) {
1969
1976
  const disconnect = (0, import_react12.useCallback)(async () => {
@@ -1973,8 +1980,8 @@ function ExternalWalletProvider({
1973
1980
  await wallet.disconnect?.();
1974
1981
  }, [client, storage, wallet]);
1975
1982
  const value = (0, import_react12.useMemo)(
1976
- () => ({ client, wallet, connection, appName, network, disconnect }),
1977
- [client, wallet, connection, appName, network, disconnect]
1983
+ () => ({ client, wallet, connection, appName, network, disconnect, uiConfig }),
1984
+ [client, wallet, connection, appName, network, disconnect, uiConfig]
1978
1985
  );
1979
1986
  if (!managed) {
1980
1987
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DubsContext.Provider, { value, children });
@@ -2003,6 +2010,10 @@ function useDubs() {
2003
2010
  }
2004
2011
  return ctx;
2005
2012
  }
2013
+ function useAppConfig() {
2014
+ const ctx = (0, import_react12.useContext)(DubsContext);
2015
+ return ctx?.uiConfig || {};
2016
+ }
2006
2017
 
2007
2018
  // src/ui/UserProfileCard.tsx
2008
2019
  var import_react13 = require("react");
@@ -2710,6 +2721,7 @@ var styles8 = import_react_native10.StyleSheet.create({
2710
2721
  mergeTheme,
2711
2722
  parseSolanaError,
2712
2723
  signAndSendBase64Transaction,
2724
+ useAppConfig,
2713
2725
  useAuth,
2714
2726
  useClaim,
2715
2727
  useCreateGame,