@series-inc/venus-sdk 3.0.4 → 3.0.6
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/README.md +14 -979
- package/dist/{AdsApi-CNGRf6j0.d.mts → AdsApi-CIXV8I_p.d.mts} +389 -186
- package/dist/{AdsApi-CNGRf6j0.d.ts → AdsApi-CIXV8I_p.d.ts} +389 -186
- package/dist/{chunk-PXWCNWJ6.mjs → chunk-LBJFUHOH.mjs} +948 -1370
- package/dist/chunk-LBJFUHOH.mjs.map +1 -0
- package/dist/{chunk-W7IPHM67.mjs → chunk-MWUS3A7C.mjs} +3 -22
- package/dist/chunk-MWUS3A7C.mjs.map +1 -0
- package/dist/core-RDMPQV6U.mjs +3 -0
- package/dist/{core-R3FHW62G.mjs.map → core-RDMPQV6U.mjs.map} +1 -1
- package/dist/index.cjs +944 -1386
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +142 -79
- package/dist/index.d.ts +142 -79
- package/dist/index.mjs +2 -6
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +1010 -1717
- package/dist/venus-api/index.cjs.map +1 -1
- package/dist/venus-api/index.d.mts +2 -2
- package/dist/venus-api/index.d.ts +2 -2
- package/dist/venus-api/index.mjs +43 -308
- package/dist/venus-api/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-PXWCNWJ6.mjs.map +0 -1
- package/dist/chunk-W7IPHM67.mjs.map +0 -1
- package/dist/core-R3FHW62G.mjs +0 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnalyticsApi, R as RpcRequest, a as RpcResponse, b as RpcNotification, c as RpcClient, V as VenusAPI, H as Host, S as StorageApi, N as NavigationApi, Q as QuitOptions, d as NavigationStackInfo, P as PushAppOptions, e as NotificationsApi, f as ScheduleLocalNotification, g as ScheduleNotificationOptions, h as PopupsApi, i as ActionSheetItem, j as ShowActionSheetOptions, k as ShowAlertOptions, l as ShowConfirmOptions, m as ShowToastOptions, n as ShowInterstitialAdOptions, o as ShowRewardedAdOptions, p as ProfileApi, q as Profile, C as CdnApi, r as SubPath, F as FetchBlobOptions, T as TimeApi, s as ServerTimeData, G as GetFutureTimeOptions, t as AiApi, u as AiChatCompletionRequest, v as AiChatCompletionData, w as HapticsApi, x as HapticFeedbackStyle, y as FeaturesApi, E as Experiment, L as LifecycleApi, z as SleepCallback, B as Subscription, D as AwakeCallback, I as PauseCallback, J as ResumeCallback, K as QuitCallback, M as SimulationApi, O as
|
|
2
|
-
export {
|
|
1
|
+
import { A as AnalyticsApi, R as RpcRequest, a as RpcResponse, b as RpcNotification, c as RpcClient, V as VenusAPI, H as Host, S as StorageApi, N as NavigationApi, Q as QuitOptions, d as NavigationStackInfo, P as PushAppOptions, e as NotificationsApi, f as ScheduleLocalNotification, g as ScheduleNotificationOptions, h as PopupsApi, i as ActionSheetItem, j as ShowActionSheetOptions, k as ShowAlertOptions, l as ShowConfirmOptions, m as ShowToastOptions, n as ShowInterstitialAdOptions, o as ShowRewardedAdOptions, p as ProfileApi, q as Profile, C as CdnApi, r as SubPath, F as FetchBlobOptions, T as TimeApi, s as ServerTimeData, G as GetFutureTimeOptions, t as AiApi, u as AiChatCompletionRequest, v as AiChatCompletionData, w as HapticsApi, x as HapticFeedbackStyle, y as FeaturesApi, E as Experiment, L as LifecycleApi, z as SleepCallback, B as Subscription, D as AwakeCallback, I as PauseCallback, J as ResumeCallback, K as QuitCallback, M as SimulationApi, O as SimulationSlotValidationResult, U as SimulationSubscribeOptions, W as SimulationBatchOperation, X as SimulationBatchOperationsResult, Y as SimulationAvailableItem, Z as SimulationPowerPreview, _ as SimulationSlotMutationResult, $ as SimulationSlotContainer, a0 as SimulationAssignment, a1 as SimulationState, a2 as VenusSimulationConfig, a3 as ExecuteRecipeOptions, a4 as ExecuteRecipeResponse, a5 as CollectRecipeResult, a6 as GetActiveRunsOptions, a7 as SimulationRunSummary, a8 as ExecuteScopedRecipeOptions, a9 as ExecuteScopedRecipeResult, aa as GetAvailableRecipesOptions, ab as GetAvailableRecipesResult, ac as Recipe, ad as RecipeRequirementResult, ae as GetBatchRecipeRequirements, af as TriggerRecipeChainOptions, ag as RoomDataUpdate, ah as RoomMessageEvent, ai as ProposedMoveEvent, aj as VenusTransport, ak as RoomsApi, al as CreateRoomOptions, am as VenusRoom, an as JoinOrCreateRoomOptions, ao as JoinOrCreateResult, ap as ListRoomsOptions, aq as UpdateRoomDataOptions, ar as RoomMessageRequest, as as StartRoomGameOptions, at as ProposeMoveRequest, au as ProposeMoveResult, av as ValidateMoveVerdict, aw as ValidateMoveResult, ax as RoomSubscriptionOptions, ay as LoggingApi, az as IapApi, aA as SpendCurrencyOptions, aB as LoadEmbeddedAssetsResponse, aC as SharedAssetsApi, aD as LeaderboardApi, aE as ScoreToken, aF as SubmitScoreParams, aG as SubmitScoreResult, aH as GetPagedScoresOptions, aI as PagedScoresResponse, aJ as PlayerRankOptions, aK as PlayerRankResult, aL as GetPodiumScoresOptions, aM as PodiumScoresResponse, aN as PreloaderApi, aO as SocialApi, aP as ShareMetadata, aQ as ShareLinkResult, aR as SocialQRCodeOptions, aS as QRCodeResult, aT as Avatar3dApi, aU as AssetManifest, aV as Avatar3dConfig, aW as ShowEditorOptions, aX as Avatar3dEdits, aY as AdsApi, aZ as PostApi, a_ as InitializationOptions, a$ as InitializationContext, b0 as HudInsets } from './AdsApi-CIXV8I_p.mjs';
|
|
2
|
+
export { b1 as AiMessage, b2 as Asset, b3 as Category, bb as JoinRoomMatchCriteria, bq as LeaderboardAntiCheatConfig, bs as LeaderboardConfig, br as LeaderboardDisplaySettings, bt as LeaderboardEntry, bn as LeaderboardModeConfig, bp as LeaderboardPeriodConfig, bo as LeaderboardPeriodType, bm as LoadEmbeddedAssetsRequest, b4 as MockAvatarApi, b6 as NotificationTriggerInput, b9 as OnNotificationCallback, b7 as OnRequestCallback, b8 as OnResponseCallback, bu as PodiumScoresContext, be as RecipeInfo, bc as RoomMessageEventType, bl as RpcSharedAssetsApi, ba as RpcTransport, bi as SimulationBatchOperationAssign, bj as SimulationBatchOperationRemove, bk as SimulationBatchOperationResult, bf as SimulationPersonalState, bg as SimulationRoomActiveRecipe, bh as SimulationRoomState, b5 as TimeIntervalTriggerInput, bd as VenusRoomPayload, bv as createHost } from './AdsApi-CIXV8I_p.mjs';
|
|
3
3
|
|
|
4
4
|
declare class MockAnalyticsApi implements AnalyticsApi {
|
|
5
5
|
recordCustomEvent(eventName: string, payload: Record<string, any>): Promise<void>;
|
|
@@ -195,7 +195,8 @@ declare function initializeCdn(venusApi: VenusAPI, host: Host): void;
|
|
|
195
195
|
|
|
196
196
|
declare class HostTimeApi implements TimeApi {
|
|
197
197
|
private readonly rpcClient;
|
|
198
|
-
|
|
198
|
+
private readonly venusApi;
|
|
199
|
+
constructor(rpcClient: RpcClient, venusApi: VenusAPI);
|
|
199
200
|
requestTimeAsync(): Promise<ServerTimeData>;
|
|
200
201
|
formatTime(timestamp: number, options?: any): string;
|
|
201
202
|
formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
@@ -211,7 +212,6 @@ declare class MockTimeApi implements TimeApi {
|
|
|
211
212
|
formatTime(timestamp: number, options?: any): string;
|
|
212
213
|
getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
|
|
213
214
|
requestTimeAsync(): Promise<ServerTimeData>;
|
|
214
|
-
private getLocale;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
declare function initializeTime(venusApi: VenusAPI, host: Host): void;
|
|
@@ -293,69 +293,41 @@ declare function initializeLifecycleApi(venusApi: VenusAPI, host: Host): void;
|
|
|
293
293
|
declare class RpcSimulationApi implements SimulationApi {
|
|
294
294
|
private readonly rpcClient;
|
|
295
295
|
private _simulationConfig;
|
|
296
|
+
private readonly subscriptionCallbacks;
|
|
296
297
|
constructor(rpcClient: RpcClient);
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
298
|
+
isEnabled(): boolean;
|
|
299
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotValidationResult>;
|
|
300
|
+
subscribeAsync(options: SimulationSubscribeOptions): Promise<() => void>;
|
|
301
|
+
executeBatchOperationsAsync(operations: Array<SimulationBatchOperation>, validateOnly?: boolean): Promise<SimulationBatchOperationsResult>;
|
|
302
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<SimulationAvailableItem[]>;
|
|
303
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<SimulationPowerPreview>;
|
|
304
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotMutationResult>;
|
|
305
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<SimulationSlotMutationResult>;
|
|
306
|
+
getSlotContainersAsync(): Promise<SimulationSlotContainer[]>;
|
|
307
|
+
getSlotAssignmentsAsync(containerId: string): Promise<SimulationAssignment[]>;
|
|
308
|
+
getStateAsync(roomId?: string): Promise<SimulationState>;
|
|
307
309
|
getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
|
|
308
|
-
executeRecipeAsync(recipeId: string, inputs?:
|
|
309
|
-
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
310
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
311
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
|
|
312
|
-
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
313
|
-
getRecipeRequirementsAsync(recipe: Recipe): Promise<any>;
|
|
314
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
315
|
-
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
|
|
316
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
317
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
declare class MockSimulationApi implements SimulationApi {
|
|
321
|
-
private readonly mockSimulationConfigs;
|
|
322
|
-
private readonly mockSimulationStates;
|
|
323
|
-
private readonly mockActiveTimers;
|
|
324
|
-
private readonly appId;
|
|
325
|
-
private readonly providedSimulationConfig;
|
|
326
|
-
constructor(simulationConfig?: VenusSimulationConfig | null);
|
|
327
|
-
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
328
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
329
|
-
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
330
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
331
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
332
|
-
getSlotContainersAsync(): Promise<any>;
|
|
333
|
-
getSlotAssignmentsAsync(containerId: string): Promise<any>;
|
|
334
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
335
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
310
|
+
executeRecipeAsync(recipeId: string, inputs?: Record<string, unknown>, options?: ExecuteRecipeOptions): Promise<ExecuteRecipeResponse>;
|
|
336
311
|
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
337
|
-
|
|
338
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?:
|
|
339
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
312
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<SimulationRunSummary[]>;
|
|
313
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, unknown>, options?: ExecuteScopedRecipeOptions): Promise<ExecuteScopedRecipeResult>;
|
|
340
314
|
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
341
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
342
315
|
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
private
|
|
348
|
-
private
|
|
349
|
-
private createSeededRandom;
|
|
350
|
-
private applyEffects;
|
|
351
|
-
getConfigAsync(): Promise<any>;
|
|
352
|
-
getStateAsync(roomId?: string): Promise<any>;
|
|
353
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
354
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
316
|
+
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
317
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<ExecuteRecipeResponse>;
|
|
318
|
+
getEntityMetadataAsync(entityId: string): Promise<Record<string, unknown>>;
|
|
319
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<unknown>;
|
|
320
|
+
private handleSimulationUpdate;
|
|
321
|
+
private ensureValidSubscribeOptions;
|
|
355
322
|
}
|
|
356
323
|
|
|
357
324
|
declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
358
325
|
|
|
326
|
+
interface RoomNotificationSubscriptionState {
|
|
327
|
+
data: Record<string, Array<(event: RoomDataUpdate) => void>>;
|
|
328
|
+
messages: Record<string, Array<(event: RoomMessageEvent) => void>>;
|
|
329
|
+
gameEvents: Record<string, Array<(event: ProposedMoveEvent) => void>>;
|
|
330
|
+
}
|
|
359
331
|
/**
|
|
360
332
|
* Set up room notification listeners using the transport's onVenusMessage hook.
|
|
361
333
|
* This routes host-sent room notifications (H5_ROOM_DATA_UPDATED, etc.) to the
|
|
@@ -363,7 +335,34 @@ declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
|
363
335
|
* @param transport The Venus transport to listen for messages
|
|
364
336
|
* @param getSubscriptions Function to retrieve subscription state from RoomsApi
|
|
365
337
|
*/
|
|
366
|
-
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () =>
|
|
338
|
+
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () => RoomNotificationSubscriptionState): Subscription;
|
|
339
|
+
|
|
340
|
+
declare class RpcRoomsApi implements RoomsApi {
|
|
341
|
+
private readonly rpcClient;
|
|
342
|
+
private readonly subscriptions;
|
|
343
|
+
constructor(rpcClient: RpcClient);
|
|
344
|
+
/**
|
|
345
|
+
* Get the subscription state for external access (used by setupRoomNotifications)
|
|
346
|
+
*/
|
|
347
|
+
getSubscriptions(): RoomNotificationSubscriptionState;
|
|
348
|
+
/**
|
|
349
|
+
* Set up room notification routing from the transport
|
|
350
|
+
*/
|
|
351
|
+
setupNotifications(transport: VenusTransport): void;
|
|
352
|
+
createRoomAsync(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
353
|
+
joinOrCreateRoomAsync(options: JoinOrCreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
354
|
+
joinRoomByCodeAsync(roomCode: string): Promise<VenusRoom>;
|
|
355
|
+
getUserRoomsAsync(options?: ListRoomsOptions): Promise<VenusRoom[]>;
|
|
356
|
+
updateRoomDataAsync(room: VenusRoom, updates: Record<string, unknown>, options?: UpdateRoomDataOptions): Promise<void>;
|
|
357
|
+
getRoomDataAsync(room: VenusRoom): Promise<Record<string, unknown>>;
|
|
358
|
+
sendRoomMessageAsync(venusRoom: VenusRoom, request: RoomMessageRequest): Promise<string>;
|
|
359
|
+
leaveRoomAsync(room: VenusRoom): Promise<void>;
|
|
360
|
+
startRoomGameAsync(room: VenusRoom, options?: StartRoomGameOptions): Promise<void>;
|
|
361
|
+
proposeMoveAsync(room: VenusRoom, proposalPayload: ProposeMoveRequest): Promise<ProposeMoveResult>;
|
|
362
|
+
validateMoveAsync(_room: VenusRoom, moveId: string, verdict: ValidateMoveVerdict): Promise<ValidateMoveResult>;
|
|
363
|
+
subscribeAsync(room: VenusRoom, options?: RoomSubscriptionOptions): Promise<() => void>;
|
|
364
|
+
}
|
|
365
|
+
|
|
367
366
|
declare function initializeRoomsApi(venusApi: VenusAPI, host: Host): void;
|
|
368
367
|
|
|
369
368
|
declare class MockLoggingApi implements LoggingApi {
|
|
@@ -413,35 +412,96 @@ declare function initializeIap(venusApiInstance: VenusAPI, host: Host): void;
|
|
|
413
412
|
|
|
414
413
|
declare class RpcLeaderboardApi implements LeaderboardApi {
|
|
415
414
|
private readonly rpcClient;
|
|
415
|
+
/** Cache of score tokens for automatic hash computation */
|
|
416
|
+
private tokenCache;
|
|
416
417
|
constructor(rpcClient: RpcClient);
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
/**
|
|
419
|
+
* Create a score token for submitting a score.
|
|
420
|
+
* Token is cached for automatic hash computation if score sealing is enabled.
|
|
421
|
+
*
|
|
422
|
+
* @param mode - Optional game mode
|
|
423
|
+
* @returns Score token with sealing data if enabled
|
|
424
|
+
*/
|
|
425
|
+
createScoreToken(mode?: string): Promise<ScoreToken>;
|
|
426
|
+
/**
|
|
427
|
+
* Submit a score to the leaderboard.
|
|
428
|
+
* Automatically computes hash if score sealing is enabled and token was created via createScoreToken().
|
|
429
|
+
*
|
|
430
|
+
* @param params - Score submission parameters
|
|
431
|
+
* @returns Submission result with acceptance status and rank
|
|
432
|
+
* @throws Error if token not found in cache
|
|
433
|
+
*/
|
|
434
|
+
submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult>;
|
|
435
|
+
getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse>;
|
|
436
|
+
getMyRank(options?: PlayerRankOptions): Promise<PlayerRankResult>;
|
|
437
|
+
getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
|
|
422
438
|
}
|
|
423
439
|
|
|
424
440
|
declare class MockLeaderboardApi implements LeaderboardApi {
|
|
425
|
-
private
|
|
441
|
+
private tokens;
|
|
442
|
+
/** Cache of score tokens for automatic hash computation */
|
|
443
|
+
private tokenCache;
|
|
426
444
|
private entriesByMode;
|
|
427
|
-
private
|
|
428
|
-
private
|
|
445
|
+
private tokenCounter;
|
|
446
|
+
private enableScoreSealing;
|
|
447
|
+
private scoreSealingSecret;
|
|
429
448
|
constructor(options?: {
|
|
430
|
-
|
|
449
|
+
enableScoreSealing?: boolean;
|
|
450
|
+
scoreSealingSecret?: string;
|
|
431
451
|
});
|
|
452
|
+
/**
|
|
453
|
+
* Configure mock leaderboard settings
|
|
454
|
+
*
|
|
455
|
+
* @param options - Configuration options
|
|
456
|
+
*/
|
|
432
457
|
configure(options: {
|
|
433
|
-
|
|
458
|
+
enableScoreSealing?: boolean;
|
|
459
|
+
scoreSealingSecret?: string;
|
|
434
460
|
}): void;
|
|
435
461
|
private generateNonce;
|
|
436
462
|
private getModeKey;
|
|
437
463
|
private getEntriesForMode;
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
464
|
+
/**
|
|
465
|
+
* Create a mock score token for testing.
|
|
466
|
+
* Token is cached for automatic hash computation if score sealing is enabled.
|
|
467
|
+
*
|
|
468
|
+
* @param mode - Optional game mode
|
|
469
|
+
* @returns Score token with sealing data if enabled
|
|
470
|
+
*/
|
|
471
|
+
createScoreToken(mode?: string): Promise<ScoreToken>;
|
|
472
|
+
/**
|
|
473
|
+
* Submit a mock score to the leaderboard.
|
|
474
|
+
* Automatically computes hash if score sealing is enabled and token was created via createScoreToken().
|
|
475
|
+
*
|
|
476
|
+
* @param params - Score submission parameters
|
|
477
|
+
* @returns Submission result with acceptance status and rank
|
|
478
|
+
* @throws Error if token not found in cache or validation fails
|
|
479
|
+
*/
|
|
480
|
+
submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult>;
|
|
481
|
+
getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse>;
|
|
482
|
+
getMyRank(_options?: PlayerRankOptions): Promise<PlayerRankResult>;
|
|
483
|
+
getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
|
|
443
484
|
}
|
|
444
485
|
|
|
486
|
+
/**
|
|
487
|
+
* Hash algorithm used for score sealing
|
|
488
|
+
*/
|
|
489
|
+
declare const HASH_ALGORITHM_WEB_CRYPTO = "SHA-256";
|
|
490
|
+
declare const HASH_ALGORITHM_NODE = "sha256";
|
|
491
|
+
/**
|
|
492
|
+
* Compute HMAC-SHA256 hash for score sealing.
|
|
493
|
+
* Hash always includes: score, duration, token
|
|
494
|
+
* Matches server-side hash computation exactly.
|
|
495
|
+
*
|
|
496
|
+
* @param score - The score value
|
|
497
|
+
* @param duration - Duration in seconds
|
|
498
|
+
* @param token - Score token
|
|
499
|
+
* @param sealingNonce - One-time nonce for this submission
|
|
500
|
+
* @param sealingSecret - Secret key for HMAC
|
|
501
|
+
* @returns Hex-encoded hash string
|
|
502
|
+
*/
|
|
503
|
+
declare function computeScoreHash(score: number, duration: number, token: string, sealingNonce: string, sealingSecret: string): Promise<string>;
|
|
504
|
+
|
|
445
505
|
declare function initializeLeaderboard(venusApiInstance: VenusAPI, host: Host): void;
|
|
446
506
|
|
|
447
507
|
declare class MockPreloaderApi implements PreloaderApi {
|
|
@@ -619,11 +679,14 @@ declare enum VenusMessageId {
|
|
|
619
679
|
H5_SIMULATION_GET_AVAILABLE_ITEMS = "H5_SIMULATION_GET_AVAILABLE_ITEMS",
|
|
620
680
|
H5_SIMULATION_VALIDATE_ASSIGNMENT = "H5_SIMULATION_VALIDATE_ASSIGNMENT",
|
|
621
681
|
H5_SIMULATION_BATCH_OPERATIONS = "H5_SIMULATION_BATCH_OPERATIONS",
|
|
622
|
-
|
|
682
|
+
H5_SIMULATION_SUBSCRIBE = "H5_SIMULATION_SUBSCRIBE",
|
|
683
|
+
H5_SIMULATION_UNSUBSCRIBE = "H5_SIMULATION_UNSUBSCRIBE",
|
|
684
|
+
H5_SIMULATION_UPDATE = "H5_SIMULATION_UPDATE",
|
|
685
|
+
H5_LEADERBOARD_CREATE_SCORE_TOKEN = "H5_LEADERBOARD_CREATE_SCORE_TOKEN",
|
|
623
686
|
H5_LEADERBOARD_SUBMIT_SCORE = "H5_LEADERBOARD_SUBMIT_SCORE",
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
687
|
+
H5_LEADERBOARD_GET_PAGED_SCORES = "H5_LEADERBOARD_GET_PAGED_SCORES",
|
|
688
|
+
H5_LEADERBOARD_GET_PODIUM_SCORES = "H5_LEADERBOARD_GET_PODIUM_SCORES",
|
|
689
|
+
H5_LEADERBOARD_GET_MY_RANK = "H5_LEADERBOARD_GET_MY_RANK",
|
|
627
690
|
H5_ROOM_CREATE = "H5_ROOM_CREATE",
|
|
628
691
|
H5_ROOM_JOIN = "H5_ROOM_JOIN",
|
|
629
692
|
H5_ROOM_JOIN_OR_CREATE = "H5_ROOM_JOIN_OR_CREATE",
|
|
@@ -701,4 +764,4 @@ interface InitResponse {
|
|
|
701
764
|
launchParams?: Record<string, string>;
|
|
702
765
|
}
|
|
703
766
|
|
|
704
|
-
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, ExecuteRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions,
|
|
767
|
+
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, CreateRoomOptions, ExecuteRecipeOptions, ExecuteRecipeResponse, ExecuteScopedRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetPagedScoresOptions, GetPodiumScoresOptions, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostProfileApi, HostTimeApi, HudInsets, IapApi, type InitResponse, InitializationContext, InitializationOptions, JoinOrCreateResult, JoinOrCreateRoomOptions, LeaderboardApi, LifecycleApi, ListRoomsOptions, LoadEmbeddedAssetsResponse, LoggingApi, type MethodIds, MockAdsApi, MockAiApi, MockAnalyticsApi, MockCdnApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSocialApi, MockStorageApi, MockTimeApi, NavigationApi, NavigationStackInfo, type NotificationContent, NotificationsApi, PagedScoresResponse, PauseCallback, PlayerRankOptions, PlayerRankResult, PodiumScoresResponse, PopupsApi, PreloaderApi, ProfileApi, ProposeMoveRequest, ProposeMoveResult, ProposedMoveEvent, PushAppOptions, QRCodeResult, QuitCallback, QuitOptions, Recipe, RemoteHost, ResumeCallback, RoomDataUpdate, RoomMessageEvent, RoomMessageRequest, type RoomNotificationSubscriptionState, RoomSubscriptionOptions, RoomsApi, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, type RpcMessage, RpcNavigationApi, RpcNotification, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRequest, RpcResponse, RpcRoomsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, ScheduleLocalNotification, ScheduleNotificationOptions, ScoreToken, ServerTimeData, ShareLinkResult, ShareMetadata, SharedAssetsApi, ShowActionSheetOptions, ShowAlertOptions, ShowConfirmOptions, ShowEditorOptions, ShowInterstitialAdOptions, ShowRewardedAdOptions, ShowToastOptions, type ShowToastResponse, SimulationApi, SimulationAssignment, SimulationAvailableItem, SimulationBatchOperation, SimulationBatchOperationsResult, SimulationPowerPreview, SimulationRunSummary, SimulationSlotContainer, SimulationSlotMutationResult, SimulationSlotValidationResult, SimulationState, SleepCallback, SocialApi, SocialQRCodeOptions, SpendCurrencyOptions, StartRoomGameOptions, StorageApi, type StorageType, SubPath, SubmitScoreParams, SubmitScoreResult, Subscription, TimeApi, TriggerRecipeChainOptions, UpdateRoomDataOptions, ValidateMoveResult, ValidateMoveVerdict, VenusMessageId, VenusRoom, computeScoreHash, createMockStorageApi, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeTime, isPacificDaylightTime, setupRoomNotifications };
|