-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCatalyst.types.ts
519 lines (473 loc) · 10.6 KB
/
Catalyst.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
import type { ChainId } from '@dcl/schemas/dist/dapps/chain-id'
import type { EntityType } from '@dcl/schemas/dist/platform/entity'
export type Snapshot = {
face?: string
face128?: string
face256?: string
body: string
}
export type BodyColor = {
color: {
r: number
g: number
b: number
a?: number
}
}
export enum SceneContentRating {
RATING_PENDING = 'RP',
EVERYONE = 'E',
TEEN = 'T',
ADULT = 'A',
RESTRICTED = 'R',
}
/** @TODO remove */
/** @deprecated use @dcl/schemas/dist/platform/profile/avatar */
export type Avatar = {
userId: string
email: string | null | undefined
name: string | null | undefined
hasClaimedName: boolean
description: string | null | undefined
ethAddress: string
version: number
avatar: {
bodyShape: string
snapshots: Snapshot
eyes: BodyColor
hair: BodyColor
skin: BodyColor
wearables: string[]
emotes?: { slot: number; urn: string }[]
version?: number
}
inventory?: string[]
blocked?: string[]
tutorialStep: number
hasConnectedWeb3?: boolean
}
export type ProfileMetadata = {
avatars: Avatar[]
}
export type ProfileResponse = ProfileMetadata
export type Layer = {
name: string
usersCount: number
maxUsers: number
}
export type CommsStatusOptions =
| boolean
| {}
| { includeLayers: boolean }
| { includeUsersParcels: boolean }
export type Status = CommsStatus
export type StatusWithLayers = CommsStatusWithLayers
export type CommsStatus = {
name: string
version: string
currenTime: number
env: {
secure: boolean
commitHash: string
}
ready: boolean
}
export type CommsStatusWithLayers = CommsStatus & {
layers: (Layer & { usersParcels: Position[] })[]
}
export type CommsStatusWithUsers = CommsStatus & {
usersCount: number
usersParcels: [number, number][]
}
export type CatalystAbout = {
healthy: boolean
content: {
healthy: boolean
version: string //"6.0.6",
commitHash: string //"d2eeccaffe2a9c22ac963348851c7791b63fc517",
publicUrl: string //"https://peer.decentraland.org/content/"
}
lambdas: {
healthy: boolean
version: string //"6.0.6",
commitHash: string //"d2eeccaffe2a9c22ac963348851c7791b63fc517",
publicUrl: string //"https://peer.decentraland.org/lambdas/"
}
configurations: {
networkId: ChainId
globalScenesUrn: string[]
scenesUrn: string[]
realmName: string // "hera"
}
comms: {
healthy: boolean
protocol: string // "v3",
commitHash: string //"b3ec3327ceef53473853068dcdad8ea08d7a0f9c"
}
bff: {
healthy: boolean
commitHash: string //"4352737ca24a0c590387fba4b46da297408e899a",
userCount: number
protocolVersion: string //"1.0_0",
publicUrl: string //"/bff"
}
acceptingUsers: boolean
}
export type LambdasStatus = {
version: string
currentTime: number
contentServerUrl: string
commitHash: string
}
export type ContentStatus = {
name: string
version: string
currentTime: number
lastImmutableTime: number
historySize: number
synchronizationStatus: {
otherServers: {
address: string
connectionState:
| 'Connected'
| 'Connection lost'
| 'Could never be reached'
lastDeploymentTimestamp: number
}[]
lastSyncWithDAO: number
synchronizationState:
| 'Bootstrapping'
| 'Syncing'
| 'Synced'
| 'Failed to sync'
lastSyncWithOtherServers: number
}
commitHash: string
ethNetwork: string
}
export type Position = [number, number]
export type Position3D = {
x: number
y: number
z: number
}
export type Servers = {
baseUrl: string
owner: string
id: string
}
export type Realm = {
serverName: string
url: string
usersCount: number
maxUsers: number
userParcels: [number, number][]
}
export type HotScene = {
id: string
name: string
baseCoords: [number, number]
usersTotalCount: number
parcels: [number, number][]
thumbnail: string
creator: string
description: string
realms: Realm[]
}
export type WorldLivePerWorldProps = {
users: number
worldName: string
}
export type WorldLiveDataProps = {
perWorld: WorldLivePerWorldProps[]
totalUsers: number
}
export type LayerUser = {
id: string
userId: string
protocolVersion: number
peerId: string
parcel: [number, number]
position: [number, number, number]
lastPing: number
address: string
}
/**@deprecated */
export type EntityScene = {
id: string
type: 'scene'
timestamp: number
pointers: string[]
content: {
file: string
hash: string
}[]
metadata: {
display: {
title: string | 'interactive-text'
description?: string
navmapThumbnail?: string
favicon: 'favicon_asset'
}
contact: {
name: string
email: string
}
owner: string
scene: {
parcels: string[]
base: string
}
communications: {
type: 'webrtc'
signalling: string
}
policy: {
contentRating: SceneContentRating
fly: boolean
voiceEnabled: boolean
blacklist: []
}
main: string
tags: string[]
spawnPoints: [
{
name: 'spawn1'
default: boolean
position: Position3D
cameraTarget: Position3D
}
]
}
}
export type Peer = {
id: string
address: string
parcel: [number, number]
position: [number, number, number]
lastPing: number
}
export enum ContentDeploymentSortingField {
LocalTimestamp = 'local_timestamp',
EntityTimestamp = 'entity_timestamp',
}
export enum ContentDeploymentSortingOrder {
ASCENDING = 'ASC',
DESCENDING = 'DESC',
}
export type ContentDeploymentOptions = {
offset: number
limit: number
from: number | Date
to: number | Date
onlyCurrentlyPointed: boolean
lastId: string
entityIds: string[]
entityTypes: EntityType[]
sortingField: ContentDeploymentSortingField
sortingOrder: ContentDeploymentSortingOrder
}
export type ContentDeployment =
| ContentDeploymentScene
| ContentDeploymentProfile
| ContentDeploymentWearable
| ContentDeploymentStore
| ContentDeploymentEmote
| ContentDeploymentWorld
export type ContentDeploymentBase = {
entityId: string
entityTimestamp: number
localTimestamp: number
deployedBy: string
pointers: string[]
content: { key: string; hash: string }[]
}
export type SceneMetadata = {
display?: {
title?: string // "My Cool Scene",
description?: string // "You won't believe how cool this scene is",
favicon?: string // "favicon_asset",
navmapThumbnail?: string // "scene-thumbnail.png" | "https://decentraland.org/images/thumbnail.png"
}
owner?: string
contact?: {
name?: string
email?: string
}
main?: string // "bin/game.js",
tags?: string[]
scene?: {
parcels: string[]
base: string
}
requiredPermissions?: string[]
spawnPoints?: {
name: string
default: boolean
position: {
x: number[]
y: number[]
z: number[]
}
cameraTarget: {
x: number
y: number
z: number
}
}[]
communications?: {
type: string // "webrtc",
signalling: string // "https://signalling-01.decentraland.org"
}
policy?: {
contentRating: SceneContentRating
fly: boolean
voiceEnabled: boolean
blacklist: string[]
teleportPosition: string
}
source?: {
version: number
origin: string
projectId: string
point: {
x: number
y: number
}
rotation: string // "north",
layout: {
rows: number // 2,
cols: number // 1
}
}
worldConfiguration?:
| {
name: string
dclName?: never
fixedAdapter?: string
minimapVisible?: boolean
skybox?: number
skyboxConfig?: {
fixedHour: number
textures: string[]
}
placesConfig?: {
optOut: boolean
}
}
| {
// old property
dclName: string
name?: never
fixedAdapter?: never
minimapVisible?: never
skybox?: never
skyboxConfig?: never
placesConfig?: never
}
}
export type ContentEntity = {
version: string
pointers: string[]
timestamp: number
content: { file: string; hash: string }[]
}
export type ContentEntityScene = ContentEntity & {
type: EntityType.SCENE
metadata: SceneMetadata
}
export type ContentEntityProfile = ContentEntity & {
type: EntityType.PROFILE
metadata: ProfileMetadata
}
export type ContentEntityWearable = ContentEntity & {
type: EntityType.WEARABLE
metadata: WearableMetadata
}
export type ContentEntityStore = ContentEntity & {
type: EntityType.STORE
metadata: StoreMetadata
}
export type ContentEntityEmote = ContentEntity & {
type: EntityType.EMOTE
metadata: {} // TODO: emote metadata
}
export type ContentDeploymentScene = ContentDeploymentBase & {
entityType: EntityType.SCENE
metadata: SceneMetadata
}
export type ContentDeploymentWorld = ContentDeploymentBase & {
entityType: EntityType.SCENE
metadata: SceneMetadata
}
export type ContentDeploymentProfile = ContentDeploymentBase & {
entityType: EntityType.PROFILE
metadata: ProfileMetadata
}
export type WearableMetadata = {
id: string
name: string
description: string
collectionAddress: string
rarity: string
image: string
metrics: {
triangles: number
materials: number
textures: number
meshes: number
bodies: number
entities: number
}
thumbnail: string
data: {
tags: string[]
category: string
representations: {
mainFile: string // "Earring_SquareEarring.glb"
bodyShapes: string[] // [ "urn:decentraland:off-chain:base-avatars:BaseFemale" ]
contents: string[] // [ "AvatarWearables_TX.png", "Earring_SquareEarring.glb" ]
}[]
}
i18n: { code: string; text: string }[]
createdAt: number
updatedAt: number
}
export type ContentDeploymentWearable = ContentDeploymentBase & {
entityType: EntityType.WEARABLE
metadata: WearableMetadata
}
export type StoreMetadata = {
id: string
description: string
images: { name: string; file: string }[]
links: { name: string; url: string }[]
owner: string
version: number
}
export type ContentDeploymentStore = ContentDeploymentBase & {
entityType: EntityType.STORE
metadata: StoreMetadata
}
export type ContentDeploymentEmote = ContentDeploymentBase & {
entityType: EntityType.EMOTE
metadata: {} // TODO
}
export type ContentDeploymentResponse = {
deployments: ContentDeployment[]
filters: Pick<
ContentDeploymentOptions,
'from' | 'to' | 'entityIds' | 'entityTypes'
>
pagination: Pick<ContentDeploymentOptions, 'offset' | 'limit' | 'lastId'> & {
moreData: boolean
next: string
}
}
export type StatsParcel = {
peersCount: number
parcel: {
x: number
y: number
}
}