@series-inc/venus-sdk 3.1.2 → 3.2.0
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/{AdsApi-CNGRf6j0.d.mts → AdsApi-DFutZ7_q.d.mts} +501 -293
- package/dist/{AdsApi-CNGRf6j0.d.ts → AdsApi-DFutZ7_q.d.ts} +501 -293
- package/dist/{chunk-PXWCNWJ6.mjs → chunk-AGXMORDL.mjs} +1442 -1586
- package/dist/chunk-AGXMORDL.mjs.map +1 -0
- package/dist/chunk-NSSMTXJJ.mjs +7 -0
- package/dist/chunk-NSSMTXJJ.mjs.map +1 -0
- package/dist/{chunk-W7IPHM67.mjs → chunk-QABXMFND.mjs} +3 -26
- package/dist/chunk-QABXMFND.mjs.map +1 -0
- package/dist/chunk-UXY5CKKG.mjs +12 -0
- package/dist/chunk-UXY5CKKG.mjs.map +1 -0
- package/dist/core-62LWDHN7.mjs +4 -0
- package/dist/{core-R3FHW62G.mjs.map → core-62LWDHN7.mjs.map} +1 -1
- package/dist/index.cjs +1461 -1585
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +280 -92
- package/dist/index.d.ts +280 -92
- package/dist/index.mjs +4 -6
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +1557 -2020
- 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 +92 -391
- package/dist/venus-api/index.mjs.map +1 -1
- package/dist/vite/index.cjs +534 -0
- package/dist/vite/index.cjs.map +1 -0
- package/dist/vite/index.mjs +527 -0
- package/dist/vite/index.mjs.map +1 -0
- package/dist/webview/index.cjs +15 -0
- package/dist/webview/index.cjs.map +1 -0
- package/dist/webview/index.d.mts +15 -0
- package/dist/webview/index.d.ts +15 -0
- package/dist/webview/index.mjs +4 -0
- package/dist/webview/index.mjs.map +1 -0
- 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
|
@@ -56,7 +56,6 @@ declare class RpcClient {
|
|
|
56
56
|
private addPendingCall;
|
|
57
57
|
private removePendingCall;
|
|
58
58
|
private getPendingCall;
|
|
59
|
-
private generateId;
|
|
60
59
|
private handleRpcResponse;
|
|
61
60
|
private handleRpcNotification;
|
|
62
61
|
}
|
|
@@ -162,6 +161,80 @@ interface ProfileApi {
|
|
|
162
161
|
getCurrentProfile(): Profile;
|
|
163
162
|
}
|
|
164
163
|
|
|
164
|
+
interface DeviceInfo {
|
|
165
|
+
readonly screenSize: {
|
|
166
|
+
readonly width: number;
|
|
167
|
+
readonly height: number;
|
|
168
|
+
};
|
|
169
|
+
readonly viewportSize: {
|
|
170
|
+
readonly width: number;
|
|
171
|
+
readonly height: number;
|
|
172
|
+
};
|
|
173
|
+
readonly orientation: string;
|
|
174
|
+
readonly pixelRatio: number;
|
|
175
|
+
readonly fontScale: number;
|
|
176
|
+
readonly deviceType: string;
|
|
177
|
+
readonly hapticsEnabled: boolean;
|
|
178
|
+
readonly haptics: {
|
|
179
|
+
readonly supported: boolean;
|
|
180
|
+
readonly enabled: boolean;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
interface DeviceApi {
|
|
184
|
+
getDevice(): DeviceInfo;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface EnvironmentInfo {
|
|
188
|
+
readonly isDevelopment: boolean;
|
|
189
|
+
readonly platform: string;
|
|
190
|
+
readonly platformVersion: string;
|
|
191
|
+
readonly browserInfo?: {
|
|
192
|
+
readonly browser: string;
|
|
193
|
+
readonly userAgent: string;
|
|
194
|
+
readonly isMobile: boolean;
|
|
195
|
+
readonly isTablet: boolean;
|
|
196
|
+
readonly language: string;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
interface EnvironmentApi {
|
|
200
|
+
getEnvironment(): EnvironmentInfo;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* System API provides access to device and environment information.
|
|
205
|
+
* This is a unified namespace for system-level configuration data.
|
|
206
|
+
*/
|
|
207
|
+
interface SystemApi {
|
|
208
|
+
/**
|
|
209
|
+
* Get device information (screen size, orientation, capabilities, etc.)
|
|
210
|
+
* @throws Error if called before VenusAPI.initializeAsync() completes
|
|
211
|
+
*/
|
|
212
|
+
getDevice(): DeviceInfo;
|
|
213
|
+
/**
|
|
214
|
+
* Get environment information (platform, browser, development mode, etc.)
|
|
215
|
+
* @throws Error if called before VenusAPI.initializeAsync() completes
|
|
216
|
+
*/
|
|
217
|
+
getEnvironment(): EnvironmentInfo;
|
|
218
|
+
/**
|
|
219
|
+
* Get safe area insets (padding to avoid device notches and host UI).
|
|
220
|
+
* This includes the toolbar/feedHeader height plus device safe areas.
|
|
221
|
+
* Safe area is static - it's set once during initialization and doesn't change.
|
|
222
|
+
* @returns SafeArea with top, right, bottom, left padding values in pixels
|
|
223
|
+
* @throws Error if called before VenusAPI.initializeAsync() completes
|
|
224
|
+
*/
|
|
225
|
+
getSafeArea(): SafeArea;
|
|
226
|
+
/**
|
|
227
|
+
* Check if running on mobile device
|
|
228
|
+
* @returns true if on mobile device (iOS, Android, or mobile browser)
|
|
229
|
+
*/
|
|
230
|
+
isMobile(): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Check if running on web platform
|
|
233
|
+
* @returns true if on web platform
|
|
234
|
+
*/
|
|
235
|
+
isWeb(): boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
165
238
|
type SubPath = string;
|
|
166
239
|
interface FetchBlobOptions {
|
|
167
240
|
timeout?: number;
|
|
@@ -200,32 +273,6 @@ interface TimeApi {
|
|
|
200
273
|
getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
|
|
201
274
|
}
|
|
202
275
|
|
|
203
|
-
interface PostInfo {
|
|
204
|
-
isLiked: boolean;
|
|
205
|
-
isFollowing: boolean;
|
|
206
|
-
likesCount: number;
|
|
207
|
-
commentsCount: number;
|
|
208
|
-
}
|
|
209
|
-
interface ToggleLikeResult {
|
|
210
|
-
isLiked: boolean;
|
|
211
|
-
likesCount: number;
|
|
212
|
-
action: 'liked' | 'unliked';
|
|
213
|
-
}
|
|
214
|
-
interface ToggleFollowResult {
|
|
215
|
-
isFollowing: boolean;
|
|
216
|
-
action: 'followed' | 'unfollowed';
|
|
217
|
-
}
|
|
218
|
-
interface OpenCommentsResult {
|
|
219
|
-
opened: boolean;
|
|
220
|
-
commentsCount: number;
|
|
221
|
-
}
|
|
222
|
-
interface PostApi {
|
|
223
|
-
getPostInfo(): Promise<PostInfo>;
|
|
224
|
-
toggleLikeAsync(): Promise<ToggleLikeResult>;
|
|
225
|
-
openCommentsAsync(): Promise<OpenCommentsResult>;
|
|
226
|
-
toggleFollowAsync(): Promise<ToggleFollowResult>;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
276
|
interface AiMessage {
|
|
230
277
|
/**
|
|
231
278
|
* Depends on the model you are using. Most common is user, system, and assistant.
|
|
@@ -392,12 +439,12 @@ interface Recipe {
|
|
|
392
439
|
}
|
|
393
440
|
interface TriggerRecipeChainOptions {
|
|
394
441
|
roomId?: string;
|
|
395
|
-
context?:
|
|
442
|
+
context?: Record<string, unknown>;
|
|
396
443
|
}
|
|
397
444
|
interface CollectRecipeResult {
|
|
398
445
|
success: boolean;
|
|
399
446
|
runId: string;
|
|
400
|
-
rewards:
|
|
447
|
+
rewards: Record<string, unknown>;
|
|
401
448
|
message: string;
|
|
402
449
|
}
|
|
403
450
|
interface ExecuteScopedRecipeResult {
|
|
@@ -417,28 +464,265 @@ interface GetBatchRecipeRequirements {
|
|
|
417
464
|
success: boolean;
|
|
418
465
|
results: RecipeRequirementResult[];
|
|
419
466
|
}
|
|
467
|
+
interface SimulationPersonalState {
|
|
468
|
+
inventory: Record<string, number | string>;
|
|
469
|
+
activeRuns: SimulationRunSummary[];
|
|
470
|
+
disabledRecipes: string[];
|
|
471
|
+
}
|
|
472
|
+
interface SimulationRoomActiveRecipe {
|
|
473
|
+
recipeId: string;
|
|
474
|
+
scope: 'room' | 'actor';
|
|
475
|
+
startedAt: number;
|
|
476
|
+
expiresAt: number;
|
|
477
|
+
commitmentEndsAt?: number;
|
|
478
|
+
}
|
|
479
|
+
interface SimulationRoomState {
|
|
480
|
+
activeRecipes: Record<string, SimulationRoomActiveRecipe>;
|
|
481
|
+
sharedAssets: Record<string, number | string>;
|
|
482
|
+
actors: Array<Record<string, unknown>>;
|
|
483
|
+
activeRuns: SimulationRunSummary[];
|
|
484
|
+
}
|
|
485
|
+
type SimulationState = SimulationPersonalState | SimulationRoomState;
|
|
486
|
+
interface SimulationSlotContainer {
|
|
487
|
+
entityId: string;
|
|
488
|
+
slots: Record<string, unknown>;
|
|
489
|
+
isOwned: boolean;
|
|
490
|
+
powerCalculationRecipe?: string;
|
|
491
|
+
}
|
|
492
|
+
interface SimulationAvailableItem {
|
|
493
|
+
entityId: string;
|
|
494
|
+
quantity: number;
|
|
495
|
+
metadata: Record<string, unknown>;
|
|
496
|
+
tags: string[];
|
|
497
|
+
isCompatible: boolean;
|
|
498
|
+
}
|
|
499
|
+
interface SimulationSlotValidationResult {
|
|
500
|
+
valid: boolean;
|
|
501
|
+
error?: string;
|
|
502
|
+
}
|
|
503
|
+
interface SimulationAssignment {
|
|
504
|
+
id: string;
|
|
505
|
+
containerId: string;
|
|
506
|
+
slotId: string;
|
|
507
|
+
itemId: string | null;
|
|
508
|
+
profileId: string;
|
|
509
|
+
appId: string;
|
|
510
|
+
createdAt: number;
|
|
511
|
+
metadata?: Record<string, unknown>;
|
|
512
|
+
}
|
|
513
|
+
interface SimulationSlotMutationResult {
|
|
514
|
+
success: boolean;
|
|
515
|
+
error?: string;
|
|
516
|
+
association?: SimulationAssignment;
|
|
517
|
+
}
|
|
518
|
+
interface SimulationBatchOperationAssign {
|
|
519
|
+
type: 'assign';
|
|
520
|
+
containerId: string;
|
|
521
|
+
slotId: string;
|
|
522
|
+
itemId: string;
|
|
523
|
+
}
|
|
524
|
+
interface SimulationBatchOperationRemove {
|
|
525
|
+
type: 'remove';
|
|
526
|
+
containerId: string;
|
|
527
|
+
slotId: string;
|
|
528
|
+
itemId?: string;
|
|
529
|
+
}
|
|
530
|
+
type SimulationBatchOperation = SimulationBatchOperationAssign | SimulationBatchOperationRemove;
|
|
531
|
+
interface SimulationBatchOperationResult {
|
|
532
|
+
success: boolean;
|
|
533
|
+
error?: string;
|
|
534
|
+
association?: SimulationAssignment;
|
|
535
|
+
operation: SimulationBatchOperation;
|
|
536
|
+
}
|
|
537
|
+
interface SimulationBatchOperationsResult {
|
|
538
|
+
success: boolean;
|
|
539
|
+
results: SimulationBatchOperationResult[];
|
|
540
|
+
affectedContainers: string[];
|
|
541
|
+
}
|
|
542
|
+
interface SimulationPowerPreview {
|
|
543
|
+
currentPower: number;
|
|
544
|
+
previewPower: number;
|
|
545
|
+
powerDelta: number;
|
|
546
|
+
breakdown: Record<string, number>;
|
|
547
|
+
}
|
|
548
|
+
interface ExecuteRecipeResponse {
|
|
549
|
+
success: boolean;
|
|
550
|
+
status?: string;
|
|
551
|
+
runId?: string;
|
|
552
|
+
expiresAt?: string;
|
|
553
|
+
queuePosition?: number;
|
|
554
|
+
outputs?: Record<string, number | string>;
|
|
555
|
+
data?: Record<string, unknown>;
|
|
556
|
+
message?: string;
|
|
557
|
+
amountRequested?: number;
|
|
558
|
+
amountFulfilled?: number;
|
|
559
|
+
partialSuccess?: boolean;
|
|
560
|
+
}
|
|
420
561
|
interface SimulationApi {
|
|
421
|
-
|
|
562
|
+
isEnabled(): boolean;
|
|
563
|
+
getStateAsync(roomId?: string): Promise<SimulationState>;
|
|
422
564
|
getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
|
|
423
|
-
executeRecipeAsync(recipeId: string, inputs?:
|
|
424
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<
|
|
565
|
+
executeRecipeAsync(recipeId: string, inputs?: Record<string, unknown>, options?: ExecuteRecipeOptions): Promise<ExecuteRecipeResponse>;
|
|
566
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<SimulationRunSummary[]>;
|
|
425
567
|
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
426
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?:
|
|
427
|
-
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<
|
|
568
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, unknown>, options?: ExecuteScopedRecipeOptions): Promise<ExecuteScopedRecipeResult>;
|
|
569
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<ExecuteRecipeResponse>;
|
|
428
570
|
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
429
571
|
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
430
572
|
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
431
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<
|
|
432
|
-
getEntityMetadataAsync(entityId: string): Promise<
|
|
433
|
-
getSlotContainersAsync(): Promise<
|
|
434
|
-
getSlotAssignmentsAsync(containerId: string): Promise<
|
|
435
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<
|
|
436
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<
|
|
437
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<
|
|
438
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<
|
|
439
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<
|
|
440
|
-
executeBatchOperationsAsync(operations: Array<
|
|
441
|
-
|
|
573
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<unknown>;
|
|
574
|
+
getEntityMetadataAsync(entityId: string): Promise<Record<string, unknown>>;
|
|
575
|
+
getSlotContainersAsync(): Promise<SimulationSlotContainer[]>;
|
|
576
|
+
getSlotAssignmentsAsync(containerId: string): Promise<SimulationAssignment[]>;
|
|
577
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotMutationResult>;
|
|
578
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<SimulationSlotMutationResult>;
|
|
579
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<SimulationAvailableItem[]>;
|
|
580
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<SimulationPowerPreview>;
|
|
581
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotValidationResult>;
|
|
582
|
+
executeBatchOperationsAsync(operations: Array<SimulationBatchOperation>, validateOnly?: boolean): Promise<SimulationBatchOperationsResult>;
|
|
583
|
+
subscribeAsync(options: SimulationSubscribeOptions): Promise<() => void>;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
interface VenusRoomPayload extends Record<string, unknown> {
|
|
587
|
+
id: string;
|
|
588
|
+
name?: string;
|
|
589
|
+
currentPlayers?: string[];
|
|
590
|
+
maxPlayers?: number;
|
|
591
|
+
gameType?: string;
|
|
592
|
+
appId?: string;
|
|
593
|
+
type?: string;
|
|
594
|
+
createdBy?: string;
|
|
595
|
+
createdAt?: number;
|
|
596
|
+
updatedAt?: number;
|
|
597
|
+
isPrivate?: boolean;
|
|
598
|
+
status?: string;
|
|
599
|
+
customMetadata?: Record<string, unknown>;
|
|
600
|
+
admins?: string[];
|
|
601
|
+
roomCode?: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
data?: Record<string, unknown>;
|
|
604
|
+
version?: string;
|
|
605
|
+
}
|
|
606
|
+
declare class VenusRoom {
|
|
607
|
+
readonly id: string;
|
|
608
|
+
name?: string;
|
|
609
|
+
players: string[];
|
|
610
|
+
maxPlayers?: number;
|
|
611
|
+
gameType?: string;
|
|
612
|
+
appId?: string;
|
|
613
|
+
type?: string;
|
|
614
|
+
createdBy?: string;
|
|
615
|
+
createdAt?: number;
|
|
616
|
+
updatedAt?: number;
|
|
617
|
+
isPrivate?: boolean;
|
|
618
|
+
status?: string;
|
|
619
|
+
customMetadata: Record<string, unknown>;
|
|
620
|
+
admins: string[];
|
|
621
|
+
roomCode?: string;
|
|
622
|
+
description?: string;
|
|
623
|
+
data: Record<string, unknown>;
|
|
624
|
+
version?: string;
|
|
625
|
+
constructor(roomData: VenusRoomPayload);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
interface CreateRoomOptions {
|
|
629
|
+
maxPlayers?: number;
|
|
630
|
+
gameType?: string;
|
|
631
|
+
isPrivate?: boolean;
|
|
632
|
+
roomCode?: string;
|
|
633
|
+
name?: string;
|
|
634
|
+
description?: string;
|
|
635
|
+
customMetadata?: Record<string, unknown>;
|
|
636
|
+
data?: Record<string, unknown>;
|
|
637
|
+
}
|
|
638
|
+
interface JoinRoomMatchCriteria {
|
|
639
|
+
isPrivate?: boolean;
|
|
640
|
+
hasSpace?: boolean;
|
|
641
|
+
gameType?: string;
|
|
642
|
+
[key: string]: unknown;
|
|
643
|
+
}
|
|
644
|
+
interface JoinOrCreateRoomOptions {
|
|
645
|
+
matchCriteria?: JoinRoomMatchCriteria;
|
|
646
|
+
createOptions: CreateRoomOptions;
|
|
647
|
+
}
|
|
648
|
+
interface JoinOrCreateResult {
|
|
649
|
+
action: 'created' | 'joined';
|
|
650
|
+
room: VenusRoom;
|
|
651
|
+
playersJoined: number;
|
|
652
|
+
}
|
|
653
|
+
interface ListRoomsOptions {
|
|
654
|
+
includeArchived?: boolean;
|
|
655
|
+
}
|
|
656
|
+
interface RoomDataUpdate {
|
|
657
|
+
type: 'H5_ROOM_DATA_UPDATED';
|
|
658
|
+
roomId: string;
|
|
659
|
+
roomData: Record<string, unknown>;
|
|
660
|
+
timestamp?: number;
|
|
661
|
+
}
|
|
662
|
+
type RoomMessageEventType = 'H5_ROOM_MESSAGE_RECEIVED' | 'H5_ROOM_MESSAGE_UPDATED' | 'H5_ROOM_MESSAGE_DELETED';
|
|
663
|
+
interface RoomMessageEvent {
|
|
664
|
+
type: RoomMessageEventType;
|
|
665
|
+
roomId: string;
|
|
666
|
+
message: Record<string, unknown>;
|
|
667
|
+
timestamp?: number;
|
|
668
|
+
}
|
|
669
|
+
interface ProposedMoveEvent {
|
|
670
|
+
type: 'app:h5:proposedMoveValidationUpdated';
|
|
671
|
+
roomId: string;
|
|
672
|
+
proposedMoveData: Record<string, unknown>;
|
|
673
|
+
proposedMoveId?: string;
|
|
674
|
+
changeType?: string;
|
|
675
|
+
timestamp?: number;
|
|
676
|
+
}
|
|
677
|
+
interface RoomSubscriptionOptions {
|
|
678
|
+
onData?: (event: RoomDataUpdate) => void;
|
|
679
|
+
onMessages?: (event: RoomMessageEvent) => void;
|
|
680
|
+
onGameEvents?: (event: ProposedMoveEvent) => void;
|
|
681
|
+
}
|
|
682
|
+
interface ProposeMoveRequest {
|
|
683
|
+
gameSpecificState: Record<string, unknown>;
|
|
684
|
+
moveType: string;
|
|
685
|
+
clientContext?: Record<string, unknown>;
|
|
686
|
+
clientProposalId?: string;
|
|
687
|
+
}
|
|
688
|
+
interface ProposeMoveResult {
|
|
689
|
+
proposedMoveId: string;
|
|
690
|
+
}
|
|
691
|
+
interface ValidateMoveVerdict {
|
|
692
|
+
isValid: boolean;
|
|
693
|
+
reason?: string | null;
|
|
694
|
+
validatorId?: string | null;
|
|
695
|
+
}
|
|
696
|
+
interface ValidateMoveResult {
|
|
697
|
+
success: boolean;
|
|
698
|
+
moveId: string;
|
|
699
|
+
isValid: boolean;
|
|
700
|
+
reason?: string | null;
|
|
701
|
+
}
|
|
702
|
+
interface UpdateRoomDataOptions {
|
|
703
|
+
merge?: boolean;
|
|
704
|
+
}
|
|
705
|
+
interface RoomMessageRequest {
|
|
706
|
+
message: Record<string, unknown>;
|
|
707
|
+
metadata?: Record<string, unknown>;
|
|
708
|
+
}
|
|
709
|
+
interface StartRoomGameOptions {
|
|
710
|
+
gameConfig?: Record<string, unknown>;
|
|
711
|
+
turnOrder?: string[] | null;
|
|
712
|
+
}
|
|
713
|
+
interface RoomsApi {
|
|
714
|
+
createRoomAsync(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
715
|
+
joinOrCreateRoomAsync(options: JoinOrCreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
716
|
+
joinRoomByCodeAsync(roomCode: string): Promise<VenusRoom>;
|
|
717
|
+
getUserRoomsAsync(options?: ListRoomsOptions): Promise<VenusRoom[]>;
|
|
718
|
+
subscribeAsync(room: VenusRoom, options?: RoomSubscriptionOptions): Promise<() => void>;
|
|
719
|
+
updateRoomDataAsync(room: VenusRoom, updates: Record<string, unknown>, options?: UpdateRoomDataOptions): Promise<void>;
|
|
720
|
+
getRoomDataAsync(room: VenusRoom): Promise<Record<string, unknown>>;
|
|
721
|
+
sendRoomMessageAsync(room: VenusRoom, message: RoomMessageRequest): Promise<string>;
|
|
722
|
+
leaveRoomAsync(room: VenusRoom): Promise<void>;
|
|
723
|
+
startRoomGameAsync(room: VenusRoom, options?: StartRoomGameOptions): Promise<void>;
|
|
724
|
+
proposeMoveAsync(room: VenusRoom, request: ProposeMoveRequest): Promise<ProposeMoveResult>;
|
|
725
|
+
validateMoveAsync(room: VenusRoom, moveId: string, verdict: ValidateMoveVerdict): Promise<ValidateMoveResult>;
|
|
442
726
|
}
|
|
443
727
|
|
|
444
728
|
interface VenusMessage {
|
|
@@ -529,99 +813,22 @@ declare class VenusTransport implements RpcTransport {
|
|
|
529
813
|
private notifyVenusMessageReceived;
|
|
530
814
|
}
|
|
531
815
|
|
|
532
|
-
declare class VenusRoom {
|
|
533
|
-
readonly id: string;
|
|
534
|
-
name: string;
|
|
535
|
-
players: any[];
|
|
536
|
-
maxPlayers: number;
|
|
537
|
-
gameType: string;
|
|
538
|
-
appId: string;
|
|
539
|
-
type: any;
|
|
540
|
-
createdBy: string;
|
|
541
|
-
createdAt: number;
|
|
542
|
-
updatedAt: number;
|
|
543
|
-
isPrivate: boolean;
|
|
544
|
-
currentPlayers: string[];
|
|
545
|
-
status: any;
|
|
546
|
-
customMetadata: Record<string, any>;
|
|
547
|
-
admins: string[];
|
|
548
|
-
roomCode: string;
|
|
549
|
-
description: string;
|
|
550
|
-
data: Record<string, any>;
|
|
551
|
-
version: string;
|
|
552
|
-
private _subscriptions;
|
|
553
|
-
constructor(roomData: any);
|
|
554
|
-
private updateFromRoomData;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
interface CreateRoomOptions {
|
|
558
|
-
maxPlayers?: number;
|
|
559
|
-
gameType?: string;
|
|
560
|
-
isPrivate?: boolean;
|
|
561
|
-
roomCode?: string;
|
|
562
|
-
name?: string;
|
|
563
|
-
description?: string;
|
|
564
|
-
customMetadata?: Record<string, any>;
|
|
565
|
-
}
|
|
566
|
-
interface JoinOrCreateResult {
|
|
567
|
-
action: 'created' | 'joined';
|
|
568
|
-
room: VenusRoom;
|
|
569
|
-
playersJoined: number;
|
|
570
|
-
}
|
|
571
|
-
interface RoomSubscriptionOptions {
|
|
572
|
-
onData?: (roomData: any) => void;
|
|
573
|
-
onMessages?: (messagePayload: any) => void;
|
|
574
|
-
onMoves?: (movePayload: any) => void;
|
|
575
|
-
onGameEvents?: (eventPayload: any) => void;
|
|
576
|
-
}
|
|
577
|
-
interface ProposeMovePayload {
|
|
578
|
-
gameSpecificState: any;
|
|
579
|
-
moveType: string;
|
|
580
|
-
clientContext?: Record<string, any>;
|
|
581
|
-
clientProposalId?: string;
|
|
582
|
-
}
|
|
583
|
-
interface ProposeMoveResult {
|
|
584
|
-
proposedMoveId: string;
|
|
585
|
-
}
|
|
586
|
-
interface ValidateMoveResult {
|
|
587
|
-
success: boolean;
|
|
588
|
-
moveId: string;
|
|
589
|
-
isValid: boolean;
|
|
590
|
-
reason?: string | null;
|
|
591
|
-
}
|
|
592
|
-
interface RoomsApi {
|
|
593
|
-
createRoom(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
594
|
-
joinOrCreateRoom(options: CreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
595
|
-
joinRoomByCode?(roomCode: string): Promise<VenusRoom>;
|
|
596
|
-
getUserRooms?(includeArchived?: boolean): Promise<VenusRoom[]>;
|
|
597
|
-
subscribe?(room: VenusRoom, options: RoomSubscriptionOptions): (() => void) | {
|
|
598
|
-
unsubscribe(): void;
|
|
599
|
-
};
|
|
600
|
-
updateData?(room: VenusRoom, updates: Record<string, any>, merge?: boolean): Promise<any>;
|
|
601
|
-
getData?(room: VenusRoom): Promise<any>;
|
|
602
|
-
sendMessage?(room: VenusRoom, messageData: any): Promise<string>;
|
|
603
|
-
leave?(room: VenusRoom): Promise<any>;
|
|
604
|
-
startGame?(room: VenusRoom, gameConfig?: Record<string, any>, turnOrder?: string[] | null): Promise<any>;
|
|
605
|
-
proposeMove?(room: VenusRoom, proposalPayload: ProposeMovePayload): Promise<ProposeMoveResult>;
|
|
606
|
-
validateMove?(room: VenusRoom, moveId: string, isValid: boolean, reason?: string | null, validatorId?: string | null): Promise<ValidateMoveResult>;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
816
|
interface LoggingApi {
|
|
610
817
|
logDebug(message: string, ...args: any[]): void;
|
|
611
818
|
logError(message: string, ...args: any[]): void;
|
|
612
819
|
}
|
|
613
820
|
|
|
614
821
|
interface SharedAssetsApi {
|
|
615
|
-
|
|
616
|
-
|
|
822
|
+
loadAssetsBundle(game: string, bundleKey: string): Promise<ArrayBuffer>;
|
|
823
|
+
loadLibraryCode(libraryKey: string): Promise<string>;
|
|
617
824
|
}
|
|
618
825
|
|
|
619
826
|
declare class RpcSharedAssetsApi implements SharedAssetsApi {
|
|
620
827
|
private readonly venusApi;
|
|
621
828
|
private readonly rpcClient;
|
|
622
829
|
constructor(rpcClient: RpcClient, venusApi: VenusAPI);
|
|
623
|
-
|
|
624
|
-
|
|
830
|
+
loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
|
|
831
|
+
loadLibraryCode(libraryKey: string): Promise<string>;
|
|
625
832
|
}
|
|
626
833
|
interface LoadEmbeddedAssetsRequest {
|
|
627
834
|
assetKey: string;
|
|
@@ -668,25 +875,29 @@ interface LeaderboardConfig {
|
|
|
668
875
|
maxDurationSec: number;
|
|
669
876
|
minScore: number;
|
|
670
877
|
maxScore: number;
|
|
671
|
-
|
|
672
|
-
|
|
878
|
+
requiresToken: boolean;
|
|
879
|
+
enableScoreSealing: boolean;
|
|
880
|
+
scoreSealingSecret?: string;
|
|
673
881
|
modes: Record<string, LeaderboardModeConfig>;
|
|
674
882
|
periods: Record<string, LeaderboardPeriodConfig>;
|
|
675
883
|
antiCheat: LeaderboardAntiCheatConfig;
|
|
676
884
|
displaySettings: LeaderboardDisplaySettings;
|
|
677
885
|
}
|
|
678
|
-
interface
|
|
679
|
-
|
|
886
|
+
interface ScoreToken {
|
|
887
|
+
token: string;
|
|
680
888
|
startTime: number;
|
|
681
889
|
expiresAt: number;
|
|
682
|
-
|
|
890
|
+
sealingNonce?: string | null;
|
|
891
|
+
sealingSecret?: string | null;
|
|
683
892
|
mode: string;
|
|
684
893
|
}
|
|
685
|
-
interface
|
|
894
|
+
interface SubmitScoreParams {
|
|
895
|
+
token?: string;
|
|
896
|
+
score: number;
|
|
897
|
+
duration: number;
|
|
686
898
|
mode?: string;
|
|
687
899
|
telemetry?: Record<string, any>;
|
|
688
900
|
metadata?: Record<string, any>;
|
|
689
|
-
hash?: string;
|
|
690
901
|
}
|
|
691
902
|
interface SubmitScoreResult {
|
|
692
903
|
accepted: boolean;
|
|
@@ -694,7 +905,7 @@ interface SubmitScoreResult {
|
|
|
694
905
|
zScore?: number | null;
|
|
695
906
|
isAnomaly?: boolean;
|
|
696
907
|
}
|
|
697
|
-
interface
|
|
908
|
+
interface GetPagedScoresOptions {
|
|
698
909
|
mode?: string;
|
|
699
910
|
period?: string;
|
|
700
911
|
periodDate?: number | string;
|
|
@@ -710,9 +921,9 @@ interface LeaderboardEntry {
|
|
|
710
921
|
username: string;
|
|
711
922
|
avatarUrl: string | null;
|
|
712
923
|
score: number;
|
|
713
|
-
|
|
924
|
+
duration: number;
|
|
714
925
|
submittedAt: number;
|
|
715
|
-
|
|
926
|
+
token?: string;
|
|
716
927
|
rank: number | null;
|
|
717
928
|
zScore?: number | null;
|
|
718
929
|
isAnomaly?: boolean;
|
|
@@ -722,7 +933,7 @@ interface LeaderboardEntry {
|
|
|
722
933
|
metadata?: Record<string, any> | null;
|
|
723
934
|
isSeed?: boolean;
|
|
724
935
|
}
|
|
725
|
-
interface
|
|
936
|
+
interface PagedScoresResponse {
|
|
726
937
|
variant: 'standard' | 'highlight';
|
|
727
938
|
entries: LeaderboardEntry[];
|
|
728
939
|
totalEntries: number;
|
|
@@ -730,12 +941,12 @@ interface LeaderboardResponse {
|
|
|
730
941
|
playerRank: number | null;
|
|
731
942
|
periodInstance: string;
|
|
732
943
|
}
|
|
733
|
-
interface
|
|
944
|
+
interface PlayerRankOptions {
|
|
734
945
|
mode?: string;
|
|
735
946
|
period?: string;
|
|
736
947
|
periodDate?: number | string;
|
|
737
948
|
}
|
|
738
|
-
interface
|
|
949
|
+
interface PlayerRankResult {
|
|
739
950
|
rank: number | null;
|
|
740
951
|
score?: number;
|
|
741
952
|
totalPlayers: number;
|
|
@@ -743,7 +954,7 @@ interface PlayerStats {
|
|
|
743
954
|
trustScore: number;
|
|
744
955
|
periodInstance: string;
|
|
745
956
|
}
|
|
746
|
-
interface
|
|
957
|
+
interface PodiumScoresContext {
|
|
747
958
|
topEntries: LeaderboardEntry[];
|
|
748
959
|
beforePlayer: LeaderboardEntry[];
|
|
749
960
|
playerEntry?: LeaderboardEntry | null;
|
|
@@ -753,18 +964,18 @@ interface LeaderboardHighlightContext {
|
|
|
753
964
|
omittedBefore: number;
|
|
754
965
|
omittedAfter: number;
|
|
755
966
|
}
|
|
756
|
-
interface
|
|
967
|
+
interface PodiumScoresResponse extends PagedScoresResponse {
|
|
757
968
|
variant: 'highlight';
|
|
758
|
-
context:
|
|
969
|
+
context: PodiumScoresContext;
|
|
759
970
|
}
|
|
760
|
-
interface
|
|
971
|
+
interface GetPodiumScoresOptions extends Omit<GetPagedScoresOptions, 'variant'> {
|
|
761
972
|
}
|
|
762
973
|
interface LeaderboardApi {
|
|
763
|
-
|
|
764
|
-
submitScore(
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
974
|
+
createScoreToken(mode?: string): Promise<ScoreToken>;
|
|
975
|
+
submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult>;
|
|
976
|
+
getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse>;
|
|
977
|
+
getMyRank(options?: PlayerRankOptions): Promise<PlayerRankResult>;
|
|
978
|
+
getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
|
|
768
979
|
}
|
|
769
980
|
|
|
770
981
|
interface PreloaderApi {
|
|
@@ -818,7 +1029,7 @@ interface SocialApi {
|
|
|
818
1029
|
* - iOS / Android: opens the native share sheet.
|
|
819
1030
|
* - Web: copies the generated URL to the clipboard (with fallback toast).
|
|
820
1031
|
*
|
|
821
|
-
* @param options.launchParams Arbitrary launch parameters
|
|
1032
|
+
* @param options.launchParams Arbitrary launch parameters for your game.
|
|
822
1033
|
* @param options.metadata Optional OpenGraph metadata for rich previews.
|
|
823
1034
|
* @returns The generated share URL.
|
|
824
1035
|
*/
|
|
@@ -831,7 +1042,7 @@ interface SocialApi {
|
|
|
831
1042
|
*
|
|
832
1043
|
* Games can render or print the returned QR image or re-use the share URL.
|
|
833
1044
|
*
|
|
834
|
-
* @param options.launchParams Arbitrary launch parameters
|
|
1045
|
+
* @param options.launchParams Arbitrary launch parameters for your game.
|
|
835
1046
|
* @param options.metadata Optional OpenGraph metadata for the share.
|
|
836
1047
|
* @param options.qrOptions Customisation for the generated QR code.
|
|
837
1048
|
* @returns The generated share URL and QR code (as a data URL).
|
|
@@ -843,12 +1054,20 @@ interface SocialApi {
|
|
|
843
1054
|
}): Promise<QRCodeResult>;
|
|
844
1055
|
}
|
|
845
1056
|
|
|
846
|
-
|
|
1057
|
+
/**
|
|
1058
|
+
* Safe area insets representing padding needed to avoid device notches and host UI.
|
|
1059
|
+
* Includes toolbar/feedHeader height + device safe areas.
|
|
1060
|
+
*/
|
|
1061
|
+
interface SafeArea {
|
|
847
1062
|
left: number;
|
|
848
1063
|
top: number;
|
|
849
1064
|
right: number;
|
|
850
1065
|
bottom: number;
|
|
851
1066
|
}
|
|
1067
|
+
/**
|
|
1068
|
+
* @deprecated Use SafeArea instead. Will be removed in v4.0.0
|
|
1069
|
+
*/
|
|
1070
|
+
type HudInsets = SafeArea;
|
|
852
1071
|
interface InitializationOptions {
|
|
853
1072
|
helpText?: string;
|
|
854
1073
|
hardDisableMock?: boolean;
|
|
@@ -856,7 +1075,11 @@ interface InitializationOptions {
|
|
|
856
1075
|
usePreloader?: boolean;
|
|
857
1076
|
}
|
|
858
1077
|
interface InitializationContext {
|
|
859
|
-
|
|
1078
|
+
/**
|
|
1079
|
+
* Safe area insets from INIT_SDK response.
|
|
1080
|
+
* @deprecated Use VenusAPI.system.getSafeArea() instead. Will be removed in v4.0.0
|
|
1081
|
+
*/
|
|
1082
|
+
safeArea?: SafeArea;
|
|
860
1083
|
initializeAsleep: boolean;
|
|
861
1084
|
}
|
|
862
1085
|
interface Host {
|
|
@@ -870,9 +1093,9 @@ interface Host {
|
|
|
870
1093
|
readonly notifications: NotificationsApi;
|
|
871
1094
|
readonly popups: PopupsApi;
|
|
872
1095
|
readonly profile: ProfileApi;
|
|
1096
|
+
readonly system: SystemApi;
|
|
873
1097
|
readonly cdn: CdnApi;
|
|
874
1098
|
readonly time: TimeApi;
|
|
875
|
-
readonly post: PostApi;
|
|
876
1099
|
readonly ai: AiApi;
|
|
877
1100
|
readonly haptics: HapticsApi;
|
|
878
1101
|
readonly features: FeaturesApi;
|
|
@@ -982,23 +1205,72 @@ interface RecipeRequirementResult {
|
|
|
982
1205
|
recipeId: string;
|
|
983
1206
|
entity: string | null;
|
|
984
1207
|
amount?: number;
|
|
985
|
-
inputs: Record<string,
|
|
1208
|
+
inputs: Record<string, number | string>;
|
|
986
1209
|
canAfford: boolean;
|
|
987
1210
|
disabled: boolean;
|
|
988
1211
|
}
|
|
989
|
-
interface
|
|
990
|
-
|
|
1212
|
+
interface SimulationRunSummary {
|
|
1213
|
+
id: string;
|
|
1214
|
+
recipeId: string;
|
|
1215
|
+
status: string;
|
|
1216
|
+
startTime: number;
|
|
1217
|
+
expiresAt: number;
|
|
1218
|
+
entity?: string;
|
|
1219
|
+
inputs?: Record<string, number | string>;
|
|
1220
|
+
outputs?: Record<string, number | string>;
|
|
1221
|
+
commitmentEndsAt?: number;
|
|
1222
|
+
participantCount?: number;
|
|
1223
|
+
}
|
|
1224
|
+
type VenusSimulationStateResponse = SimulationPersonalState | SimulationRoomState;
|
|
1225
|
+
type SimulationUpdateType = 'entity' | 'activeRuns' | 'snapshot';
|
|
1226
|
+
interface SimulationUpdateBase {
|
|
1227
|
+
timestamp: number;
|
|
1228
|
+
reason?: 'recipe_completed' | 'auto_restart' | 'manual_update' | 'state_sync';
|
|
1229
|
+
}
|
|
1230
|
+
interface SimulationEntityUpdate extends SimulationUpdateBase {
|
|
1231
|
+
type: 'entity';
|
|
1232
|
+
entities: Array<{
|
|
1233
|
+
entityId: string;
|
|
1234
|
+
quantity: number | string;
|
|
1235
|
+
}>;
|
|
1236
|
+
}
|
|
1237
|
+
interface SimulationActiveRunsUpdate extends SimulationUpdateBase {
|
|
1238
|
+
type: 'activeRuns';
|
|
991
1239
|
activeRuns: Array<{
|
|
992
1240
|
id: string;
|
|
993
1241
|
recipeId: string;
|
|
994
1242
|
status: string;
|
|
995
1243
|
startTime: number;
|
|
996
1244
|
expiresAt: number;
|
|
1245
|
+
entity?: string;
|
|
997
1246
|
inputs?: Record<string, number | string>;
|
|
998
1247
|
outputs?: Record<string, number | string>;
|
|
1248
|
+
}>;
|
|
1249
|
+
}
|
|
1250
|
+
interface SimulationSnapshotUpdate extends SimulationUpdateBase {
|
|
1251
|
+
type: 'snapshot';
|
|
1252
|
+
entities?: Array<{
|
|
1253
|
+
entityId: string;
|
|
1254
|
+
quantity: number | string;
|
|
1255
|
+
}>;
|
|
1256
|
+
activeRuns?: Array<{
|
|
1257
|
+
id: string;
|
|
1258
|
+
recipeId: string;
|
|
1259
|
+
status: string;
|
|
1260
|
+
startTime: number;
|
|
1261
|
+
expiresAt: number;
|
|
999
1262
|
entity?: string;
|
|
1263
|
+
inputs?: Record<string, number | string>;
|
|
1264
|
+
outputs?: Record<string, number | string>;
|
|
1000
1265
|
}>;
|
|
1001
|
-
|
|
1266
|
+
}
|
|
1267
|
+
type SimulationUpdateData = SimulationEntityUpdate | SimulationActiveRunsUpdate | SimulationSnapshotUpdate;
|
|
1268
|
+
interface SimulationSubscribeOptions {
|
|
1269
|
+
entities?: string[];
|
|
1270
|
+
tags?: string[];
|
|
1271
|
+
activeRuns?: boolean;
|
|
1272
|
+
roomId?: string;
|
|
1273
|
+
onUpdate: (data: SimulationUpdateData) => void;
|
|
1002
1274
|
}
|
|
1003
1275
|
interface VenusSimulationEffect {
|
|
1004
1276
|
type: string;
|
|
@@ -1052,93 +1324,40 @@ interface RecipeRequirementQuery {
|
|
|
1052
1324
|
interface BatchRecipeRequirementsResult {
|
|
1053
1325
|
success: boolean;
|
|
1054
1326
|
results: RecipeRequirementResult[];
|
|
1055
|
-
errors?: Array<
|
|
1327
|
+
errors?: Array<unknown>;
|
|
1056
1328
|
}
|
|
1057
|
-
interface
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
getConfigAsync(): Promise<VenusSimulationConfig>;
|
|
1063
|
-
executeRecipeAsync(recipeId: string, inputs?: Record<string, any>, options?: any): Promise<any>;
|
|
1064
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, any>, roomId?: string, options?: any): Promise<any>;
|
|
1065
|
-
getActiveRunsAsync(): Promise<any[]>;
|
|
1066
|
-
collectRecipeAsync(runId: string): Promise<any>;
|
|
1067
|
-
triggerRecipeChainAsync(triggerRecipeId: string, context?: any, roomId?: string): Promise<any>;
|
|
1068
|
-
getRecipeRequirementsAsync(recipeId: string, entity?: string, amount?: number): Promise<RecipeRequirementResult>;
|
|
1069
|
-
getBatchRecipeRequirementsAsync(queries: RecipeRequirementQuery[]): Promise<BatchRecipeRequirementsResult>;
|
|
1070
|
-
getAvailableRecipesAsync(roomId?: string, includeActorRecipes?: boolean): Promise<Array<any>>;
|
|
1071
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
1072
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
1073
|
-
getSlotContainersAsync(): Promise<Array<any>>;
|
|
1074
|
-
getSlotAssignmentsAsync(containerId: string): Promise<Array<any>>;
|
|
1075
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
1076
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
1077
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
1078
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
1079
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
1080
|
-
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
1081
|
-
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
1082
|
-
}
|
|
1083
|
-
interface VenusConfig {
|
|
1084
|
-
user?: {
|
|
1085
|
-
id: string;
|
|
1086
|
-
username?: string;
|
|
1087
|
-
languageCode: string;
|
|
1088
|
-
locale: string;
|
|
1089
|
-
};
|
|
1090
|
-
profile?: {
|
|
1091
|
-
id: string;
|
|
1092
|
-
username: string;
|
|
1093
|
-
avatarUrl?: string;
|
|
1094
|
-
isAnonymous?: boolean;
|
|
1095
|
-
};
|
|
1096
|
-
device?: {
|
|
1097
|
-
screenSize: {
|
|
1098
|
-
width: number;
|
|
1099
|
-
height: number;
|
|
1100
|
-
};
|
|
1101
|
-
viewportSize: {
|
|
1102
|
-
width: number;
|
|
1103
|
-
height: number;
|
|
1104
|
-
};
|
|
1105
|
-
orientation: string;
|
|
1106
|
-
hapticsEnabled: boolean;
|
|
1107
|
-
};
|
|
1108
|
-
theme?: Record<string, any>;
|
|
1109
|
-
environment?: {
|
|
1110
|
-
isDevelopment: boolean;
|
|
1111
|
-
platform: string;
|
|
1112
|
-
platformVersion: string;
|
|
1113
|
-
browserInfo?: {
|
|
1114
|
-
browser: string;
|
|
1115
|
-
isMobile: boolean;
|
|
1116
|
-
};
|
|
1117
|
-
};
|
|
1118
|
-
ui: {
|
|
1119
|
-
safeArea: {
|
|
1120
|
-
top: number;
|
|
1121
|
-
left: number;
|
|
1122
|
-
right: number;
|
|
1123
|
-
bottom: number;
|
|
1124
|
-
};
|
|
1125
|
-
controls: Record<string, any>;
|
|
1126
|
-
};
|
|
1127
|
-
rooms?: VenusRoomsConfig;
|
|
1329
|
+
interface VenusExecuteRecipeOptions {
|
|
1330
|
+
roomId?: string;
|
|
1331
|
+
batchAmount?: number;
|
|
1332
|
+
allowPartialBatch?: boolean;
|
|
1333
|
+
entity?: string;
|
|
1128
1334
|
}
|
|
1129
|
-
interface
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1335
|
+
interface VenusExecuteScopedRecipeOptions {
|
|
1336
|
+
roomId?: string;
|
|
1337
|
+
}
|
|
1338
|
+
interface VenusAvailableRecipe {
|
|
1339
|
+
id: string;
|
|
1340
|
+
scope: string;
|
|
1341
|
+
clientViewable: boolean;
|
|
1342
|
+
}
|
|
1343
|
+
interface VenusCollectRecipeResult {
|
|
1344
|
+
success: boolean;
|
|
1345
|
+
runId: string;
|
|
1346
|
+
rewards: Record<string, unknown>;
|
|
1347
|
+
message: string;
|
|
1348
|
+
}
|
|
1349
|
+
interface VenusExecuteRecipeResult {
|
|
1350
|
+
success: boolean;
|
|
1351
|
+
status?: string;
|
|
1352
|
+
runId?: string;
|
|
1353
|
+
expiresAt?: string;
|
|
1354
|
+
queuePosition?: number;
|
|
1355
|
+
outputs?: Record<string, number | string>;
|
|
1356
|
+
data?: Record<string, unknown>;
|
|
1357
|
+
message?: string;
|
|
1358
|
+
amountRequested?: number;
|
|
1359
|
+
amountFulfilled?: number;
|
|
1360
|
+
partialSuccess?: boolean;
|
|
1142
1361
|
}
|
|
1143
1362
|
interface ActionSheetOption {
|
|
1144
1363
|
label: string;
|
|
@@ -1153,20 +1372,36 @@ interface Profile {
|
|
|
1153
1372
|
isAnonymous?: boolean;
|
|
1154
1373
|
}
|
|
1155
1374
|
interface VenusAPI {
|
|
1156
|
-
|
|
1375
|
+
/**
|
|
1376
|
+
* @deprecated All config properties have been removed. Use VenusAPI methods instead.
|
|
1377
|
+
* Will be removed in v4.0.0
|
|
1378
|
+
*/
|
|
1379
|
+
config: Record<string, never>;
|
|
1157
1380
|
launchParams: Record<string, string>;
|
|
1381
|
+
_profileData?: Profile;
|
|
1382
|
+
_deviceData?: DeviceInfo;
|
|
1383
|
+
_environmentData?: EnvironmentInfo;
|
|
1384
|
+
_safeAreaData?: SafeArea;
|
|
1385
|
+
_localeData?: string;
|
|
1386
|
+
_languageCodeData?: string;
|
|
1158
1387
|
_mock: any;
|
|
1159
1388
|
_bootstrap: {
|
|
1160
1389
|
apiInjected: boolean;
|
|
1161
1390
|
venus: any;
|
|
1162
1391
|
};
|
|
1163
1392
|
initializeAsync(options?: InitializationOptions): Promise<InitializationContext>;
|
|
1164
|
-
simulation:
|
|
1393
|
+
simulation: SimulationApi;
|
|
1165
1394
|
leaderboard: LeaderboardApi;
|
|
1166
1395
|
log(message: string, ...args: any[]): void;
|
|
1167
1396
|
error(message: string, ...args: any[]): void;
|
|
1168
1397
|
isAvailable(): boolean;
|
|
1398
|
+
/**
|
|
1399
|
+
* @deprecated Use VenusAPI.system.isMobile() instead
|
|
1400
|
+
*/
|
|
1169
1401
|
isMobile(): boolean;
|
|
1402
|
+
/**
|
|
1403
|
+
* @deprecated Use VenusAPI.system.isWeb() instead
|
|
1404
|
+
*/
|
|
1170
1405
|
isWeb(): boolean;
|
|
1171
1406
|
isMock(): boolean;
|
|
1172
1407
|
/**
|
|
@@ -1186,8 +1421,15 @@ interface VenusAPI {
|
|
|
1186
1421
|
getFeatureGate(options: {
|
|
1187
1422
|
gateName: string;
|
|
1188
1423
|
}): Promise<any>;
|
|
1424
|
+
system: SystemApi;
|
|
1425
|
+
getProfile(): Profile;
|
|
1426
|
+
/**
|
|
1427
|
+
* @deprecated Use getProfile() instead
|
|
1428
|
+
*/
|
|
1189
1429
|
getCurrentProfile(): Profile;
|
|
1190
1430
|
getLaunchParams(): Record<string, string>;
|
|
1431
|
+
getLocale(): string;
|
|
1432
|
+
getLanguageCode(): string;
|
|
1191
1433
|
/**
|
|
1192
1434
|
* @deprecated Please use the popups API. (e.g, VenusAPI.popups)
|
|
1193
1435
|
*/
|
|
@@ -1258,11 +1500,6 @@ interface VenusAPI {
|
|
|
1258
1500
|
key(index: number): Promise<string | null>;
|
|
1259
1501
|
};
|
|
1260
1502
|
requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
|
|
1261
|
-
getPostInteractionsAsync(): Promise<any>;
|
|
1262
|
-
getPostInteractions(): Promise<any>;
|
|
1263
|
-
toggleLikeAsync(): Promise<any>;
|
|
1264
|
-
toggleFollowAsync(): Promise<any>;
|
|
1265
|
-
openCommentsAsync(options?: any): Promise<void>;
|
|
1266
1503
|
/**
|
|
1267
1504
|
* @deprecated Please use the ads API. (e.g, VenusAPI.ads)
|
|
1268
1505
|
*/
|
|
@@ -1271,16 +1508,8 @@ interface VenusAPI {
|
|
|
1271
1508
|
* @deprecated Please use the ads API. (e.g, VenusAPI.ads)
|
|
1272
1509
|
*/
|
|
1273
1510
|
showRewardedAdAsync(): Promise<boolean>;
|
|
1274
|
-
requestTimeAsync(): Promise<
|
|
1275
|
-
|
|
1276
|
-
}>;
|
|
1277
|
-
getFutureTimeAsync(options: {
|
|
1278
|
-
days?: number;
|
|
1279
|
-
hours?: number;
|
|
1280
|
-
minutes?: number;
|
|
1281
|
-
timeOfDay?: any;
|
|
1282
|
-
timezone?: string;
|
|
1283
|
-
}): Promise<number>;
|
|
1511
|
+
requestTimeAsync(): Promise<ServerTimeData>;
|
|
1512
|
+
getFutureTimeAsync(options: GetFutureTimeOptions): Promise<number>;
|
|
1284
1513
|
formatTime(timestamp: number, options?: any): string;
|
|
1285
1514
|
formatNumber(value: number, options?: any): string;
|
|
1286
1515
|
/**
|
|
@@ -1320,7 +1549,7 @@ interface VenusAPI {
|
|
|
1320
1549
|
isOptional?: boolean;
|
|
1321
1550
|
}>>;
|
|
1322
1551
|
cleanupAssets(): void;
|
|
1323
|
-
assetLoader
|
|
1552
|
+
assetLoader: {
|
|
1324
1553
|
getCached(url: string): string | null;
|
|
1325
1554
|
};
|
|
1326
1555
|
showAvatar3dEditorAsync(options: {
|
|
@@ -1341,43 +1570,22 @@ interface VenusAPI {
|
|
|
1341
1570
|
isInStack: boolean;
|
|
1342
1571
|
stackPosition: number;
|
|
1343
1572
|
};
|
|
1344
|
-
rooms:
|
|
1345
|
-
create(options: any): Promise<VenusRoom>;
|
|
1346
|
-
joinOrCreate(options: any): Promise<{
|
|
1347
|
-
action: 'created' | 'joined';
|
|
1348
|
-
room: VenusRoom;
|
|
1349
|
-
playersJoined: number;
|
|
1350
|
-
}>;
|
|
1351
|
-
joinByCode(roomCode: string): Promise<VenusRoom>;
|
|
1352
|
-
list(includeArchived?: boolean): Promise<VenusRoom[]>;
|
|
1353
|
-
subscribeToRoom(room: VenusRoom, options: {
|
|
1354
|
-
onData?: (event: any) => void;
|
|
1355
|
-
onMessages?: (event: any) => void;
|
|
1356
|
-
onMoves?: (event: any) => void;
|
|
1357
|
-
onGameEvents?: (event: any) => void;
|
|
1358
|
-
}): () => void;
|
|
1359
|
-
proposeMove(room: VenusRoom, proposalPayload: {
|
|
1360
|
-
gameSpecificState: any;
|
|
1361
|
-
moveType: string;
|
|
1362
|
-
clientContext?: Record<string, any>;
|
|
1363
|
-
clientProposalId?: string;
|
|
1364
|
-
}): Promise<{
|
|
1365
|
-
proposedMoveId: string;
|
|
1366
|
-
}>;
|
|
1367
|
-
validateMove(room: VenusRoom, moveId: string, isValid: boolean, reason?: string, validatorId?: string): Promise<any>;
|
|
1368
|
-
updateRoomData(room: VenusRoom, updates: any, merge?: boolean): Promise<any>;
|
|
1369
|
-
getRoomData(room: VenusRoom): Promise<any>;
|
|
1370
|
-
sendRoomMessage(room: VenusRoom, messageData: any): Promise<string>;
|
|
1371
|
-
startRoomGame(room: VenusRoom, gameConfig?: any, turnOrder?: any): Promise<any>;
|
|
1372
|
-
leaveRoom(room: VenusRoom): Promise<any>;
|
|
1373
|
-
};
|
|
1573
|
+
rooms: RoomsApi;
|
|
1374
1574
|
notifyCleanupComplete(): void;
|
|
1375
1575
|
RoomEvents: {
|
|
1376
1576
|
OPTIMISTIC_GAME_STATE_UPDATED: string;
|
|
1377
1577
|
PROPOSED_MOVE_VALIDATION_UPDATED: string;
|
|
1378
1578
|
};
|
|
1379
|
-
numbers
|
|
1380
|
-
|
|
1579
|
+
numbers: {
|
|
1580
|
+
isBigNumber(value: any): boolean;
|
|
1581
|
+
normalize(value: string | number | any): any;
|
|
1582
|
+
format: {
|
|
1583
|
+
incremental(value: any): string;
|
|
1584
|
+
};
|
|
1585
|
+
calculateGeometricSeriesCost(baseCost: number | string, multiplier: number, currentQuantity: number, purchaseAmount: number): any;
|
|
1586
|
+
calculateMaxAffordableDecimal(availableCash: number | string, baseCost: number | string, multiplier: number, currentQuantity: number): number;
|
|
1587
|
+
formatDecimalCurrency(decimalValue: any): string;
|
|
1588
|
+
Decimal: any;
|
|
1381
1589
|
};
|
|
1382
1590
|
iap: IapApi;
|
|
1383
1591
|
cdn: CdnApi;
|
|
@@ -1406,4 +1614,4 @@ interface AdsApi {
|
|
|
1406
1614
|
showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
|
|
1407
1615
|
}
|
|
1408
1616
|
|
|
1409
|
-
export { type
|
|
1617
|
+
export { type SubPath as $, type ActionSheetOption as A, type BatchRecipeRequirementsResult as B, type ScheduleLocalNotification as C, type ScheduleNotificationOptions as D, type PopupsApi as E, type ActionSheetItem as F, type ShowActionSheetOptions as G, type Host as H, type ShowAlertOptions as I, type ShowConfirmOptions as J, type ShowToastOptions as K, type ShowInterstitialAdOptions as L, type ShowRewardedAdOptions as M, type NavigationApi as N, type ProfileApi as O, type Profile as P, type QuitOptions as Q, type RecipeRequirementResult as R, type SimulationRunSummary as S, type DeviceApi as T, type DeviceInfo as U, type VenusAPI as V, type EnvironmentApi as W, type EnvironmentInfo as X, type SystemApi as Y, type SafeArea as Z, type CdnApi as _, type VenusSimulationStateResponse as a, type SubmitScoreParams as a$, type FetchBlobOptions as a0, type TimeApi as a1, type ServerTimeData as a2, type GetFutureTimeOptions as a3, type AiApi as a4, type AiChatCompletionRequest as a5, type AiChatCompletionData as a6, type HapticsApi as a7, HapticFeedbackStyle as a8, type FeaturesApi as a9, type Recipe as aA, type GetBatchRecipeRequirements as aB, type TriggerRecipeChainOptions as aC, type RoomDataUpdate as aD, type RoomMessageEvent as aE, type ProposedMoveEvent as aF, VenusTransport as aG, type RoomsApi as aH, type CreateRoomOptions as aI, type JoinOrCreateRoomOptions as aJ, type JoinOrCreateResult as aK, type ListRoomsOptions as aL, type UpdateRoomDataOptions as aM, type RoomMessageRequest as aN, type StartRoomGameOptions as aO, type ProposeMoveRequest as aP, type ProposeMoveResult as aQ, type ValidateMoveVerdict as aR, type ValidateMoveResult as aS, type RoomSubscriptionOptions as aT, type LoggingApi as aU, type IapApi as aV, type SpendCurrencyOptions as aW, type LoadEmbeddedAssetsResponse as aX, type SharedAssetsApi as aY, type LeaderboardApi as aZ, type ScoreToken as a_, type Experiment as aa, type LifecycleApi as ab, type SleepCallback as ac, type Subscription as ad, type AwakeCallback as ae, type PauseCallback as af, type ResumeCallback as ag, type QuitCallback as ah, type SimulationApi as ai, type SimulationSlotValidationResult as aj, type SimulationBatchOperation as ak, type SimulationBatchOperationsResult as al, type SimulationAvailableItem as am, type SimulationPowerPreview as an, type SimulationSlotMutationResult as ao, type SimulationSlotContainer as ap, type SimulationAssignment as aq, type SimulationState as ar, type ExecuteRecipeOptions as as, type ExecuteRecipeResponse as at, type CollectRecipeResult as au, type GetActiveRunsOptions as av, type ExecuteScopedRecipeOptions as aw, type ExecuteScopedRecipeResult as ax, type GetAvailableRecipesOptions as ay, type GetAvailableRecipesResult as az, type SimulationUpdateType as b, type SubmitScoreResult as b0, type GetPagedScoresOptions as b1, type PagedScoresResponse as b2, type PlayerRankOptions as b3, type PlayerRankResult as b4, type GetPodiumScoresOptions as b5, type PodiumScoresResponse as b6, type PreloaderApi as b7, type SocialApi as b8, type ShareMetadata as b9, type SimulationRoomActiveRecipe as bA, type SimulationRoomState as bB, type SimulationBatchOperationAssign as bC, type SimulationBatchOperationRemove as bD, type SimulationBatchOperationResult as bE, RpcSharedAssetsApi as bF, type LoadEmbeddedAssetsRequest as bG, type LeaderboardModeConfig as bH, type LeaderboardPeriodType as bI, type LeaderboardPeriodConfig as bJ, type LeaderboardAntiCheatConfig as bK, type LeaderboardDisplaySettings as bL, type LeaderboardConfig as bM, type LeaderboardEntry as bN, type PodiumScoresContext as bO, type HudInsets as bP, createHost as bQ, type ShareLinkResult as ba, type SocialQRCodeOptions as bb, type QRCodeResult as bc, type Avatar3dApi as bd, type AssetManifest as be, type Avatar3dConfig as bf, type ShowEditorOptions as bg, type Avatar3dEdits as bh, type AdsApi as bi, type InitializationOptions as bj, type InitializationContext as bk, type AiMessage as bl, type Asset as bm, type Category as bn, MockAvatarApi as bo, type TimeIntervalTriggerInput as bp, type NotificationTriggerInput as bq, type OnRequestCallback as br, type OnResponseCallback as bs, type OnNotificationCallback as bt, type RpcTransport as bu, type JoinRoomMatchCriteria as bv, type RoomMessageEventType as bw, type VenusRoomPayload as bx, type RecipeInfo as by, type SimulationPersonalState as bz, type SimulationEntityUpdate as c, type SimulationActiveRunsUpdate as d, type SimulationSnapshotUpdate as e, type SimulationUpdateData as f, type SimulationSubscribeOptions as g, type VenusSimulationEffect as h, type VenusSimulationRecipe as i, type VenusSimulationConfig as j, type RecipeRequirementQuery as k, type VenusExecuteRecipeOptions as l, type VenusExecuteScopedRecipeOptions as m, type VenusAvailableRecipe as n, type VenusCollectRecipeResult as o, type VenusExecuteRecipeResult as p, VenusRoom as q, type AnalyticsApi as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NotificationsApi as z };
|