@dubsdotapp/expo 0.2.32 → 0.2.33
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 +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +16 -0
- package/src/hooks/useClaim.ts +12 -4
- package/src/index.ts +2 -0
- package/src/types.ts +15 -0
- package/src/ui/game/ClaimPrizeSheet.tsx +3 -1
package/dist/index.d.mts
CHANGED
|
@@ -160,6 +160,17 @@ interface BuildClaimResult {
|
|
|
160
160
|
gameAddress: string;
|
|
161
161
|
message: string;
|
|
162
162
|
}
|
|
163
|
+
interface ConfirmClaimParams {
|
|
164
|
+
playerWallet: string;
|
|
165
|
+
signature: string;
|
|
166
|
+
amountClaimed?: number;
|
|
167
|
+
}
|
|
168
|
+
interface ConfirmClaimResult {
|
|
169
|
+
gameId: string;
|
|
170
|
+
signature: string;
|
|
171
|
+
explorerUrl: string;
|
|
172
|
+
message: string;
|
|
173
|
+
}
|
|
163
174
|
interface GameMedia {
|
|
164
175
|
poster: string | null;
|
|
165
176
|
thumbnail: string | null;
|
|
@@ -361,6 +372,7 @@ declare class DubsClient {
|
|
|
361
372
|
createCustomGame(params: CreateCustomGameParams): Promise<CreateCustomGameResult>;
|
|
362
373
|
confirmCustomGame(params: ConfirmGameParams): Promise<ConfirmGameResult>;
|
|
363
374
|
buildClaimTransaction(params: BuildClaimParams): Promise<BuildClaimResult>;
|
|
375
|
+
confirmClaim(gameId: string, params: ConfirmClaimParams): Promise<ConfirmClaimResult>;
|
|
364
376
|
getGame(gameId: string): Promise<GameDetail>;
|
|
365
377
|
getLiveScore(gameId: string): Promise<LiveScore | null>;
|
|
366
378
|
getGames(params?: GetGamesParams): Promise<GameListItem[]>;
|
|
@@ -720,7 +732,9 @@ interface ClaimMutationResult {
|
|
|
720
732
|
explorerUrl: string;
|
|
721
733
|
}
|
|
722
734
|
declare function useClaim(): {
|
|
723
|
-
execute: (params: BuildClaimParams
|
|
735
|
+
execute: (params: BuildClaimParams & {
|
|
736
|
+
amountClaimed?: number;
|
|
737
|
+
}) => Promise<ClaimMutationResult>;
|
|
724
738
|
status: MutationStatus;
|
|
725
739
|
error: Error | null;
|
|
726
740
|
data: ClaimMutationResult | null;
|
|
@@ -939,4 +953,4 @@ declare function ClaimPrizeSheet({ visible, onDismiss, gameId, prizeAmount, onSu
|
|
|
939
953
|
*/
|
|
940
954
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
941
955
|
|
|
942
|
-
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, 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, 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 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, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
956
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ConfirmClaimParams, type ConfirmClaimResult, 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, 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 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, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.d.ts
CHANGED
|
@@ -160,6 +160,17 @@ interface BuildClaimResult {
|
|
|
160
160
|
gameAddress: string;
|
|
161
161
|
message: string;
|
|
162
162
|
}
|
|
163
|
+
interface ConfirmClaimParams {
|
|
164
|
+
playerWallet: string;
|
|
165
|
+
signature: string;
|
|
166
|
+
amountClaimed?: number;
|
|
167
|
+
}
|
|
168
|
+
interface ConfirmClaimResult {
|
|
169
|
+
gameId: string;
|
|
170
|
+
signature: string;
|
|
171
|
+
explorerUrl: string;
|
|
172
|
+
message: string;
|
|
173
|
+
}
|
|
163
174
|
interface GameMedia {
|
|
164
175
|
poster: string | null;
|
|
165
176
|
thumbnail: string | null;
|
|
@@ -361,6 +372,7 @@ declare class DubsClient {
|
|
|
361
372
|
createCustomGame(params: CreateCustomGameParams): Promise<CreateCustomGameResult>;
|
|
362
373
|
confirmCustomGame(params: ConfirmGameParams): Promise<ConfirmGameResult>;
|
|
363
374
|
buildClaimTransaction(params: BuildClaimParams): Promise<BuildClaimResult>;
|
|
375
|
+
confirmClaim(gameId: string, params: ConfirmClaimParams): Promise<ConfirmClaimResult>;
|
|
364
376
|
getGame(gameId: string): Promise<GameDetail>;
|
|
365
377
|
getLiveScore(gameId: string): Promise<LiveScore | null>;
|
|
366
378
|
getGames(params?: GetGamesParams): Promise<GameListItem[]>;
|
|
@@ -720,7 +732,9 @@ interface ClaimMutationResult {
|
|
|
720
732
|
explorerUrl: string;
|
|
721
733
|
}
|
|
722
734
|
declare function useClaim(): {
|
|
723
|
-
execute: (params: BuildClaimParams
|
|
735
|
+
execute: (params: BuildClaimParams & {
|
|
736
|
+
amountClaimed?: number;
|
|
737
|
+
}) => Promise<ClaimMutationResult>;
|
|
724
738
|
status: MutationStatus;
|
|
725
739
|
error: Error | null;
|
|
726
740
|
data: ClaimMutationResult | null;
|
|
@@ -939,4 +953,4 @@ declare function ClaimPrizeSheet({ visible, onDismiss, gameId, prizeAmount, onSu
|
|
|
939
953
|
*/
|
|
940
954
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
941
955
|
|
|
942
|
-
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, 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, 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 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, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
956
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ConfirmClaimParams, type ConfirmClaimResult, 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, 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 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, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.js
CHANGED
|
@@ -373,6 +373,19 @@ var DubsClient = class {
|
|
|
373
373
|
message: res.message
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
+
async confirmClaim(gameId, params) {
|
|
377
|
+
const res = await this.request(
|
|
378
|
+
"POST",
|
|
379
|
+
`/games/${encodeURIComponent(gameId)}/claim/confirm`,
|
|
380
|
+
params
|
|
381
|
+
);
|
|
382
|
+
return {
|
|
383
|
+
gameId: res.gameId,
|
|
384
|
+
signature: res.signature,
|
|
385
|
+
explorerUrl: res.explorerUrl,
|
|
386
|
+
message: res.message
|
|
387
|
+
};
|
|
388
|
+
}
|
|
376
389
|
// ── Game Queries ──
|
|
377
390
|
async getGame(gameId) {
|
|
378
391
|
const res = await this.request(
|
|
@@ -1846,11 +1859,18 @@ function useClaim() {
|
|
|
1846
1859
|
connection
|
|
1847
1860
|
);
|
|
1848
1861
|
console.log("[useClaim] Step 2 done. Signature:", signature);
|
|
1849
|
-
|
|
1862
|
+
setStatus("confirming");
|
|
1863
|
+
console.log("[useClaim] Step 3: Confirming claim...");
|
|
1864
|
+
const confirmResult = await client.confirmClaim(params.gameId, {
|
|
1865
|
+
playerWallet: params.playerWallet,
|
|
1866
|
+
signature,
|
|
1867
|
+
amountClaimed: params.amountClaimed
|
|
1868
|
+
});
|
|
1869
|
+
console.log("[useClaim] Step 3 done.");
|
|
1850
1870
|
const result = {
|
|
1851
1871
|
gameId: params.gameId,
|
|
1852
1872
|
signature,
|
|
1853
|
-
explorerUrl
|
|
1873
|
+
explorerUrl: confirmResult.explorerUrl
|
|
1854
1874
|
};
|
|
1855
1875
|
setData(result);
|
|
1856
1876
|
setStatus("success");
|
|
@@ -4220,6 +4240,7 @@ var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
|
4220
4240
|
var STATUS_LABELS4 = {
|
|
4221
4241
|
building: "Building transaction...",
|
|
4222
4242
|
signing: "Approve in wallet...",
|
|
4243
|
+
confirming: "Confirming...",
|
|
4223
4244
|
success: "Claimed!"
|
|
4224
4245
|
};
|
|
4225
4246
|
function ClaimPrizeSheet({
|
|
@@ -4287,11 +4308,12 @@ function ClaimPrizeSheet({
|
|
|
4287
4308
|
try {
|
|
4288
4309
|
await mutation.execute({
|
|
4289
4310
|
playerWallet: wallet.publicKey.toBase58(),
|
|
4290
|
-
gameId
|
|
4311
|
+
gameId,
|
|
4312
|
+
amountClaimed: prizeAmount
|
|
4291
4313
|
});
|
|
4292
4314
|
} catch {
|
|
4293
4315
|
}
|
|
4294
|
-
}, [wallet.publicKey, mutation.execute, gameId]);
|
|
4316
|
+
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
4295
4317
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
4296
4318
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4297
4319
|
import_react_native16.Modal,
|