@dubsdotapp/expo 0.2.19 → 0.2.21
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 +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +301 -272
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
- package/src/hooks/useAuth.ts +10 -3
- package/src/hooks/useClaim.ts +2 -1
- package/src/hooks/useCreateCustomGame.ts +2 -1
- package/src/hooks/useCreateGame.ts +2 -1
- package/src/hooks/useJoinGame.ts +2 -1
- package/src/index.ts +2 -0
- package/src/managed-wallet.tsx +14 -7
- package/src/types.ts +4 -0
- package/src/utils/device.ts +55 -0
- package/src/utils/transaction.ts +9 -2
- package/src/wallet/phantom-deeplink/phantom-deeplink-adapter.ts +0 -40
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,23 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
import { PublicKey, Transaction, Connection } from '@solana/web3.js';
|
|
4
4
|
|
|
5
|
+
interface DeviceInfo {
|
|
6
|
+
platform: string;
|
|
7
|
+
modelName: string | null;
|
|
8
|
+
brand: string | null;
|
|
9
|
+
manufacturer: string | null;
|
|
10
|
+
osName: string | null;
|
|
11
|
+
osVersion: string | null;
|
|
12
|
+
deviceType: number | null;
|
|
13
|
+
deviceName: string | null;
|
|
14
|
+
totalMemory: number | null;
|
|
15
|
+
modelId: string | null;
|
|
16
|
+
designName: string | null;
|
|
17
|
+
productName: string | null;
|
|
18
|
+
isDevice: boolean | null;
|
|
19
|
+
}
|
|
20
|
+
declare function getDeviceInfo(): Promise<DeviceInfo>;
|
|
21
|
+
|
|
5
22
|
interface Opponent {
|
|
6
23
|
name: string | null;
|
|
7
24
|
imageUrl: string | null;
|
|
@@ -237,10 +254,12 @@ interface NonceResult {
|
|
|
237
254
|
nonce: string;
|
|
238
255
|
message: string;
|
|
239
256
|
}
|
|
257
|
+
|
|
240
258
|
interface AuthenticateParams {
|
|
241
259
|
walletAddress: string;
|
|
242
260
|
signature: string;
|
|
243
261
|
nonce: string;
|
|
262
|
+
deviceInfo?: DeviceInfo;
|
|
244
263
|
}
|
|
245
264
|
interface AuthenticateResult {
|
|
246
265
|
needsRegistration: boolean;
|
|
@@ -254,6 +273,7 @@ interface RegisterParams {
|
|
|
254
273
|
username: string;
|
|
255
274
|
referralCode?: string;
|
|
256
275
|
avatarUrl?: string;
|
|
276
|
+
deviceInfo?: DeviceInfo;
|
|
257
277
|
}
|
|
258
278
|
interface RegisterResult {
|
|
259
279
|
user: DubsUser;
|
|
@@ -625,7 +645,6 @@ declare class PhantomDeeplinkAdapter implements WalletAdapter {
|
|
|
625
645
|
connect(): Promise<void>;
|
|
626
646
|
disconnect(): void;
|
|
627
647
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
628
|
-
signAndSendTransaction(transaction: Transaction): Promise<string>;
|
|
629
648
|
signMessage(message: Uint8Array): Promise<Uint8Array>;
|
|
630
649
|
/** Remove the Linking event listener. Call when the adapter is no longer needed. */
|
|
631
650
|
destroy(): void;
|
|
@@ -864,8 +883,10 @@ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers,
|
|
|
864
883
|
|
|
865
884
|
/**
|
|
866
885
|
* Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
|
|
886
|
+
* Prefers signAndSendTransaction if available (MWA), otherwise falls back to
|
|
887
|
+
* signTransaction + sendRawTransaction via RPC (Phantom deeplinks).
|
|
867
888
|
* Returns the transaction signature.
|
|
868
889
|
*/
|
|
869
|
-
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
|
|
890
|
+
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
870
891
|
|
|
871
|
-
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 CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, 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, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, 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, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
892
|
+
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 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 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, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, 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, getDeviceInfo, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,23 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
import { PublicKey, Transaction, Connection } from '@solana/web3.js';
|
|
4
4
|
|
|
5
|
+
interface DeviceInfo {
|
|
6
|
+
platform: string;
|
|
7
|
+
modelName: string | null;
|
|
8
|
+
brand: string | null;
|
|
9
|
+
manufacturer: string | null;
|
|
10
|
+
osName: string | null;
|
|
11
|
+
osVersion: string | null;
|
|
12
|
+
deviceType: number | null;
|
|
13
|
+
deviceName: string | null;
|
|
14
|
+
totalMemory: number | null;
|
|
15
|
+
modelId: string | null;
|
|
16
|
+
designName: string | null;
|
|
17
|
+
productName: string | null;
|
|
18
|
+
isDevice: boolean | null;
|
|
19
|
+
}
|
|
20
|
+
declare function getDeviceInfo(): Promise<DeviceInfo>;
|
|
21
|
+
|
|
5
22
|
interface Opponent {
|
|
6
23
|
name: string | null;
|
|
7
24
|
imageUrl: string | null;
|
|
@@ -237,10 +254,12 @@ interface NonceResult {
|
|
|
237
254
|
nonce: string;
|
|
238
255
|
message: string;
|
|
239
256
|
}
|
|
257
|
+
|
|
240
258
|
interface AuthenticateParams {
|
|
241
259
|
walletAddress: string;
|
|
242
260
|
signature: string;
|
|
243
261
|
nonce: string;
|
|
262
|
+
deviceInfo?: DeviceInfo;
|
|
244
263
|
}
|
|
245
264
|
interface AuthenticateResult {
|
|
246
265
|
needsRegistration: boolean;
|
|
@@ -254,6 +273,7 @@ interface RegisterParams {
|
|
|
254
273
|
username: string;
|
|
255
274
|
referralCode?: string;
|
|
256
275
|
avatarUrl?: string;
|
|
276
|
+
deviceInfo?: DeviceInfo;
|
|
257
277
|
}
|
|
258
278
|
interface RegisterResult {
|
|
259
279
|
user: DubsUser;
|
|
@@ -625,7 +645,6 @@ declare class PhantomDeeplinkAdapter implements WalletAdapter {
|
|
|
625
645
|
connect(): Promise<void>;
|
|
626
646
|
disconnect(): void;
|
|
627
647
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
628
|
-
signAndSendTransaction(transaction: Transaction): Promise<string>;
|
|
629
648
|
signMessage(message: Uint8Array): Promise<Uint8Array>;
|
|
630
649
|
/** Remove the Linking event listener. Call when the adapter is no longer needed. */
|
|
631
650
|
destroy(): void;
|
|
@@ -864,8 +883,10 @@ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers,
|
|
|
864
883
|
|
|
865
884
|
/**
|
|
866
885
|
* Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
|
|
886
|
+
* Prefers signAndSendTransaction if available (MWA), otherwise falls back to
|
|
887
|
+
* signTransaction + sendRawTransaction via RPC (Phantom deeplinks).
|
|
867
888
|
* Returns the transaction signature.
|
|
868
889
|
*/
|
|
869
|
-
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
|
|
890
|
+
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
870
891
|
|
|
871
|
-
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 CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, 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, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, 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, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
892
|
+
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 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 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, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, 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, getDeviceInfo, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|